| // Copyright 2026 Google LLC. | |
| // Use of this source code is governed by a BSD-style | |
| // license that can be found in the LICENSE file. | |
| // Code generated file. DO NOT EDIT. | |
| // Package networkservices provides access to the Network Services API. | |
| // | |
| // For product documentation, see: https://cloud.google.com/networking | |
| // | |
| // # Library status | |
| // | |
| // These client libraries are officially supported by Google. However, this | |
| // library is considered complete and is in maintenance mode. This means | |
| // that we will address critical bugs and security issues but will not add | |
| // any new features. | |
| // | |
| // When possible, we recommend using our newer | |
| // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) | |
| // that are still actively being worked and iterated on. | |
| // | |
| // # Creating a client | |
| // | |
| // Usage example: | |
| // | |
| // import "google.golang.org/api/networkservices/v1beta1" | |
| // ... | |
| // ctx := context.Background() | |
| // networkservicesService, err := networkservices.NewService(ctx) | |
| // | |
| // In this example, Google Application Default Credentials are used for | |
| // authentication. For information on how to create and obtain Application | |
| // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. | |
| // | |
| // # Other authentication options | |
| // | |
| // To use an API key for authentication (note: some APIs do not support API | |
| // keys), use [google.golang.org/api/option.WithAPIKey]: | |
| // | |
| // networkservicesService, err := networkservices.NewService(ctx, option.WithAPIKey("AIza...")) | |
| // | |
| // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth | |
| // flow, use [google.golang.org/api/option.WithTokenSource]: | |
| // | |
| // config := &oauth2.Config{...} | |
| // // ... | |
| // token, err := config.Exchange(ctx, ...) | |
| // networkservicesService, err := networkservices.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) | |
| // | |
| // See [google.golang.org/api/option.ClientOption] for details on options. | |
| package networkservices // import "google.golang.org/api/networkservices/v1beta1" | |
| import ( | |
| "bytes" | |
| "context" | |
| "encoding/json" | |
| "errors" | |
| "fmt" | |
| "io" | |
| "log/slog" | |
| "net/http" | |
| "net/url" | |
| "strconv" | |
| "strings" | |
| "github.com/googleapis/gax-go/v2/internallog" | |
| googleapi "google.golang.org/api/googleapi" | |
| internal "google.golang.org/api/internal" | |
| gensupport "google.golang.org/api/internal/gensupport" | |
| option "google.golang.org/api/option" | |
| internaloption "google.golang.org/api/option/internaloption" | |
| htransport "google.golang.org/api/transport/http" | |
| ) | |
| // Always reference these packages, just in case the auto-generated code | |
| // below doesn't. | |
| var _ = bytes.NewBuffer | |
| var _ = strconv.Itoa | |
| var _ = fmt.Sprintf | |
| var _ = json.NewDecoder | |
| var _ = io.Copy | |
| var _ = url.Parse | |
| var _ = gensupport.MarshalJSON | |
| var _ = googleapi.Version | |
| var _ = errors.New | |
| var _ = strings.Replace | |
| var _ = context.Canceled | |
| var _ = internaloption.WithDefaultEndpoint | |
| var _ = internal.Version | |
| var _ = internallog.New | |
| const apiId = "networkservices:v1beta1" | |
| const apiName = "networkservices" | |
| const apiVersion = "v1beta1" | |
| const basePath = "https://networkservices.googleapis.com/" | |
| const basePathTemplate = "https://networkservices.UNIVERSE_DOMAIN/" | |
| const mtlsBasePath = "https://networkservices.mtls.googleapis.com/" | |
| // OAuth2 scopes used by this API. | |
| const ( | |
| // See, edit, configure, and delete your Google Cloud data and see the email | |
| // address for your Google Account. | |
| CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" | |
| ) | |
| // NewService creates a new Service. | |
| func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { | |
| scopesOption := internaloption.WithDefaultScopes( | |
| "https://www.googleapis.com/auth/cloud-platform", | |
| ) | |
| // NOTE: prepend, so we don't override user-specified scopes. | |
| opts = append([]option.ClientOption{scopesOption}, opts...) | |
| opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) | |
| opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate)) | |
| opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) | |
| opts = append(opts, internaloption.EnableNewAuthLibrary()) | |
| client, endpoint, err := htransport.NewClient(ctx, opts...) | |
| if err != nil { | |
| return nil, err | |
| } | |
| s := &Service{client: client, BasePath: basePath, logger: internaloption.GetLogger(opts)} | |
| s.Projects = NewProjectsService(s) | |
| if endpoint != "" { | |
| s.BasePath = endpoint | |
| } | |
| return s, nil | |
| } | |
| // New creates a new Service. It uses the provided http.Client for requests. | |
| // | |
| // Deprecated: please use NewService instead. | |
| // To provide a custom HTTP client, use option.WithHTTPClient. | |
| // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. | |
| func New(client *http.Client) (*Service, error) { | |
| if client == nil { | |
| return nil, errors.New("client is nil") | |
| } | |
| return NewService(context.TODO(), option.WithHTTPClient(client)) | |
| } | |
| type Service struct { | |
| client *http.Client | |
| logger *slog.Logger | |
| BasePath string // API endpoint base URL | |
| UserAgent string // optional additional User-Agent fragment | |
| Projects *ProjectsService | |
| } | |
| func (s *Service) userAgent() string { | |
| if s.UserAgent == "" { | |
| return googleapi.UserAgent | |
| } | |
| return googleapi.UserAgent + " " + s.UserAgent | |
| } | |
| func NewProjectsService(s *Service) *ProjectsService { | |
| rs := &ProjectsService{s: s} | |
| rs.Locations = NewProjectsLocationsService(s) | |
| return rs | |
| } | |
| type ProjectsService struct { | |
| s *Service | |
| Locations *ProjectsLocationsService | |
| } | |
| func NewProjectsLocationsService(s *Service) *ProjectsLocationsService { | |
| rs := &ProjectsLocationsService{s: s} | |
| rs.AgentConnectivityTemplates = NewProjectsLocationsAgentConnectivityTemplatesService(s) | |
| rs.AgentGateways = NewProjectsLocationsAgentGatewaysService(s) | |
| rs.AuthzExtensions = NewProjectsLocationsAuthzExtensionsService(s) | |
| rs.CdnEdgeExtensions = NewProjectsLocationsCdnEdgeExtensionsService(s) | |
| rs.EndpointPolicies = NewProjectsLocationsEndpointPoliciesService(s) | |
| rs.ExtensionBindings = NewProjectsLocationsExtensionBindingsService(s) | |
| rs.Gateways = NewProjectsLocationsGatewaysService(s) | |
| rs.GrpcRoutes = NewProjectsLocationsGrpcRoutesService(s) | |
| rs.HttpRoutes = NewProjectsLocationsHttpRoutesService(s) | |
| rs.LbEdgeExtensions = NewProjectsLocationsLbEdgeExtensionsService(s) | |
| rs.LbRouteExtensions = NewProjectsLocationsLbRouteExtensionsService(s) | |
| rs.LbTcpExtensions = NewProjectsLocationsLbTcpExtensionsService(s) | |
| rs.LbTrafficExtensions = NewProjectsLocationsLbTrafficExtensionsService(s) | |
| rs.Meshes = NewProjectsLocationsMeshesService(s) | |
| rs.Operations = NewProjectsLocationsOperationsService(s) | |
| rs.ProducerExtensions = NewProjectsLocationsProducerExtensionsService(s) | |
| rs.ServiceBindings = NewProjectsLocationsServiceBindingsService(s) | |
| rs.ServiceLbPolicies = NewProjectsLocationsServiceLbPoliciesService(s) | |
| rs.TcpRoutes = NewProjectsLocationsTcpRoutesService(s) | |
| rs.TelemetryPolicies = NewProjectsLocationsTelemetryPoliciesService(s) | |
| rs.TlsRoutes = NewProjectsLocationsTlsRoutesService(s) | |
| rs.WasmPlugins = NewProjectsLocationsWasmPluginsService(s) | |
| return rs | |
| } | |
| type ProjectsLocationsService struct { | |
| s *Service | |
| AgentConnectivityTemplates *ProjectsLocationsAgentConnectivityTemplatesService | |
| AgentGateways *ProjectsLocationsAgentGatewaysService | |
| AuthzExtensions *ProjectsLocationsAuthzExtensionsService | |
| CdnEdgeExtensions *ProjectsLocationsCdnEdgeExtensionsService | |
| EndpointPolicies *ProjectsLocationsEndpointPoliciesService | |
| ExtensionBindings *ProjectsLocationsExtensionBindingsService | |
| Gateways *ProjectsLocationsGatewaysService | |
| GrpcRoutes *ProjectsLocationsGrpcRoutesService | |
| HttpRoutes *ProjectsLocationsHttpRoutesService | |
| LbEdgeExtensions *ProjectsLocationsLbEdgeExtensionsService | |
| LbRouteExtensions *ProjectsLocationsLbRouteExtensionsService | |
| LbTcpExtensions *ProjectsLocationsLbTcpExtensionsService | |
| LbTrafficExtensions *ProjectsLocationsLbTrafficExtensionsService | |
| Meshes *ProjectsLocationsMeshesService | |
| Operations *ProjectsLocationsOperationsService | |
| ProducerExtensions *ProjectsLocationsProducerExtensionsService | |
| ServiceBindings *ProjectsLocationsServiceBindingsService | |
| ServiceLbPolicies *ProjectsLocationsServiceLbPoliciesService | |
| TcpRoutes *ProjectsLocationsTcpRoutesService | |
| TelemetryPolicies *ProjectsLocationsTelemetryPoliciesService | |
| TlsRoutes *ProjectsLocationsTlsRoutesService | |
| WasmPlugins *ProjectsLocationsWasmPluginsService | |
| } | |
| func NewProjectsLocationsAgentConnectivityTemplatesService(s *Service) *ProjectsLocationsAgentConnectivityTemplatesService { | |
| rs := &ProjectsLocationsAgentConnectivityTemplatesService{s: s} | |
| return rs | |
| } | |
| type ProjectsLocationsAgentConnectivityTemplatesService struct { | |
| s *Service | |
| } | |
| func NewProjectsLocationsAgentGatewaysService(s *Service) *ProjectsLocationsAgentGatewaysService { | |
| rs := &ProjectsLocationsAgentGatewaysService{s: s} | |
| return rs | |
| } | |
| type ProjectsLocationsAgentGatewaysService struct { | |
| s *Service | |
| } | |
| func NewProjectsLocationsAuthzExtensionsService(s *Service) *ProjectsLocationsAuthzExtensionsService { | |
| rs := &ProjectsLocationsAuthzExtensionsService{s: s} | |
| return rs | |
| } | |
| type ProjectsLocationsAuthzExtensionsService struct { | |
| s *Service | |
| } | |
| func NewProjectsLocationsCdnEdgeExtensionsService(s *Service) *ProjectsLocationsCdnEdgeExtensionsService { | |
| rs := &ProjectsLocationsCdnEdgeExtensionsService{s: s} | |
| return rs | |
| } | |
| type ProjectsLocationsCdnEdgeExtensionsService struct { | |
| s *Service | |
| } | |
| func NewProjectsLocationsEndpointPoliciesService(s *Service) *ProjectsLocationsEndpointPoliciesService { | |
| rs := &ProjectsLocationsEndpointPoliciesService{s: s} | |
| return rs | |
| } | |
| type ProjectsLocationsEndpointPoliciesService struct { | |
| s *Service | |
| } | |
| func NewProjectsLocationsExtensionBindingsService(s *Service) *ProjectsLocationsExtensionBindingsService { | |
| rs := &ProjectsLocationsExtensionBindingsService{s: s} | |
| return rs | |
| } | |
| type ProjectsLocationsExtensionBindingsService struct { | |
| s *Service | |
| } | |
| func NewProjectsLocationsGatewaysService(s *Service) *ProjectsLocationsGatewaysService { | |
| rs := &ProjectsLocationsGatewaysService{s: s} | |
| rs.RouteViews = NewProjectsLocationsGatewaysRouteViewsService(s) | |
| return rs | |
| } | |
| type ProjectsLocationsGatewaysService struct { | |
| s *Service | |
| RouteViews *ProjectsLocationsGatewaysRouteViewsService | |
| } | |
| func NewProjectsLocationsGatewaysRouteViewsService(s *Service) *ProjectsLocationsGatewaysRouteViewsService { | |
| rs := &ProjectsLocationsGatewaysRouteViewsService{s: s} | |
| return rs | |
| } | |
| type ProjectsLocationsGatewaysRouteViewsService struct { | |
| s *Service | |
| } | |
| func NewProjectsLocationsGrpcRoutesService(s *Service) *ProjectsLocationsGrpcRoutesService { | |
| rs := &ProjectsLocationsGrpcRoutesService{s: s} | |
| return rs | |
| } | |
| type ProjectsLocationsGrpcRoutesService struct { | |
| s *Service | |
| } | |
| func NewProjectsLocationsHttpRoutesService(s *Service) *ProjectsLocationsHttpRoutesService { | |
| rs := &ProjectsLocationsHttpRoutesService{s: s} | |
| return rs | |
| } | |
| type ProjectsLocationsHttpRoutesService struct { | |
| s *Service | |
| } | |
| func NewProjectsLocationsLbEdgeExtensionsService(s *Service) *ProjectsLocationsLbEdgeExtensionsService { | |
| rs := &ProjectsLocationsLbEdgeExtensionsService{s: s} | |
| return rs | |
| } | |
| type ProjectsLocationsLbEdgeExtensionsService struct { | |
| s *Service | |
| } | |
| func NewProjectsLocationsLbRouteExtensionsService(s *Service) *ProjectsLocationsLbRouteExtensionsService { | |
| rs := &ProjectsLocationsLbRouteExtensionsService{s: s} | |
| return rs | |
| } | |
| type ProjectsLocationsLbRouteExtensionsService struct { | |
| s *Service | |
| } | |
| func NewProjectsLocationsLbTcpExtensionsService(s *Service) *ProjectsLocationsLbTcpExtensionsService { | |
| rs := &ProjectsLocationsLbTcpExtensionsService{s: s} | |
| return rs | |
| } | |
| type ProjectsLocationsLbTcpExtensionsService struct { | |
| s *Service | |
| } | |
| func NewProjectsLocationsLbTrafficExtensionsService(s *Service) *ProjectsLocationsLbTrafficExtensionsService { | |
| rs := &ProjectsLocationsLbTrafficExtensionsService{s: s} | |
| return rs | |
| } | |
| type ProjectsLocationsLbTrafficExtensionsService struct { | |
| s *Service | |
| } | |
| func NewProjectsLocationsMeshesService(s *Service) *ProjectsLocationsMeshesService { | |
| rs := &ProjectsLocationsMeshesService{s: s} | |
| rs.RouteViews = NewProjectsLocationsMeshesRouteViewsService(s) | |
| return rs | |
| } | |
| type ProjectsLocationsMeshesService struct { | |
| s *Service | |
| RouteViews *ProjectsLocationsMeshesRouteViewsService | |
| } | |
| func NewProjectsLocationsMeshesRouteViewsService(s *Service) *ProjectsLocationsMeshesRouteViewsService { | |
| rs := &ProjectsLocationsMeshesRouteViewsService{s: s} | |
| return rs | |
| } | |
| type ProjectsLocationsMeshesRouteViewsService struct { | |
| s *Service | |
| } | |
| func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService { | |
| rs := &ProjectsLocationsOperationsService{s: s} | |
| return rs | |
| } | |
| type ProjectsLocationsOperationsService struct { | |
| s *Service | |
| } | |
| func NewProjectsLocationsProducerExtensionsService(s *Service) *ProjectsLocationsProducerExtensionsService { | |
| rs := &ProjectsLocationsProducerExtensionsService{s: s} | |
| return rs | |
| } | |
| type ProjectsLocationsProducerExtensionsService struct { | |
| s *Service | |
| } | |
| func NewProjectsLocationsServiceBindingsService(s *Service) *ProjectsLocationsServiceBindingsService { | |
| rs := &ProjectsLocationsServiceBindingsService{s: s} | |
| return rs | |
| } | |
| type ProjectsLocationsServiceBindingsService struct { | |
| s *Service | |
| } | |
| func NewProjectsLocationsServiceLbPoliciesService(s *Service) *ProjectsLocationsServiceLbPoliciesService { | |
| rs := &ProjectsLocationsServiceLbPoliciesService{s: s} | |
| return rs | |
| } | |
| type ProjectsLocationsServiceLbPoliciesService struct { | |
| s *Service | |
| } | |
| func NewProjectsLocationsTcpRoutesService(s *Service) *ProjectsLocationsTcpRoutesService { | |
| rs := &ProjectsLocationsTcpRoutesService{s: s} | |
| return rs | |
| } | |
| type ProjectsLocationsTcpRoutesService struct { | |
| s *Service | |
| } | |
| func NewProjectsLocationsTelemetryPoliciesService(s *Service) *ProjectsLocationsTelemetryPoliciesService { | |
| rs := &ProjectsLocationsTelemetryPoliciesService{s: s} | |
| return rs | |
| } | |
| type ProjectsLocationsTelemetryPoliciesService struct { | |
| s *Service | |
| } | |
| func NewProjectsLocationsTlsRoutesService(s *Service) *ProjectsLocationsTlsRoutesService { | |
| rs := &ProjectsLocationsTlsRoutesService{s: s} | |
| return rs | |
| } | |
| type ProjectsLocationsTlsRoutesService struct { | |
| s *Service | |
| } | |
| func NewProjectsLocationsWasmPluginsService(s *Service) *ProjectsLocationsWasmPluginsService { | |
| rs := &ProjectsLocationsWasmPluginsService{s: s} | |
| rs.Versions = NewProjectsLocationsWasmPluginsVersionsService(s) | |
| return rs | |
| } | |
| type ProjectsLocationsWasmPluginsService struct { | |
| s *Service | |
| Versions *ProjectsLocationsWasmPluginsVersionsService | |
| } | |
| func NewProjectsLocationsWasmPluginsVersionsService(s *Service) *ProjectsLocationsWasmPluginsVersionsService { | |
| rs := &ProjectsLocationsWasmPluginsVersionsService{s: s} | |
| return rs | |
| } | |
| type ProjectsLocationsWasmPluginsVersionsService struct { | |
| s *Service | |
| } | |
| // AgentConnectivityTemplate: AgentConnectivityTemplate represents a reusable | |
| // network configuration. | |
| type AgentConnectivityTemplate struct { | |
| // AccessPath: Optional. Immutable. The path of the access. Maps roughly to | |
| // ingress/egress, though we keep CLIENT_TO_AGENT and AGENT_TO_ANYWHERE as | |
| // carryovers from Agent Gateway's original resource model. The path is | |
| // immutable once set. Exactly one path can be set. | |
| // | |
| // Possible values: | |
| // "ACCESS_PATH_UNSPECIFIED" - Unspecified access path. | |
| // "CLIENT_TO_AGENT" - Protect connection to Agent or Tool. | |
| // "AGENT_TO_ANYWHERE" - Govern agent connections to destinations. | |
| AccessPath string `json:"accessPath,omitempty"` | |
| // AccessTypes: Optional. The types of network access provided to the gateway. | |
| // Both PUBLIC and PRIVATE can be configured. | |
| // | |
| // Possible values: | |
| // "ACCESS_TYPE_UNSPECIFIED" - Unspecified access type. | |
| // "PUBLIC" - Public network access. | |
| // "PRIVATE" - Private network access. | |
| AccessTypes []string `json:"accessTypes,omitempty"` | |
| // AgentCompute: Optional. The compute environment where the agent is hosted. | |
| // Exactly one type of compute must be chosen. | |
| // | |
| // Possible values: | |
| // "AGENT_COMPUTE_UNSPECIFIED" - Unspecified compute type. | |
| // "GKE" - Google Kubernetes Engine. | |
| // "CLOUD_RUN" - Google Cloud Run. | |
| // "BORG" - Google Borg (for 1P producers). | |
| // "GCE_VM" - Google Compute Engine VM. | |
| AgentCompute string `json:"agentCompute,omitempty"` | |
| // CreateTime: Output only. The timestamp when the resource was created. | |
| CreateTime string `json:"createTime,omitempty"` | |
| // DeploymentModel: Optional. The deployment model for the gateway. | |
| // | |
| // Possible values: | |
| // "DEPLOYMENT_MODEL_UNSPECIFIED" - Unspecified deployment model. | |
| // "CENTRALIZED" - Centralized deployment. | |
| // "AMBIENT" - Ambient deployment. | |
| DeploymentModel string `json:"deploymentModel,omitempty"` | |
| // Description: Optional. A free-text description of the resource. Max length | |
| // 1024 characters. | |
| Description string `json:"description,omitempty"` | |
| // EgressNetworkConfig: Optional. Configuration for egress network traffic. | |
| EgressNetworkConfig *EgressNetworkConfig `json:"egressNetworkConfig,omitempty"` | |
| // Etag: Optional. Etag of the resource. If this is provided, it must match the | |
| // server's etag. If the provided etag does not match the server's etag, the | |
| // request will fail with a 409 ABORTED error. | |
| Etag string `json:"etag,omitempty"` | |
| // Labels: Optional. Set of label tags associated with the | |
| // AgentConnectivityTemplate resource. | |
| Labels map[string]string `json:"labels,omitempty"` | |
| // Name: Identifier. Name of the AgentConnectivityTemplate resource. It matches | |
| // pattern `projects/*/locations/*/agentConnectivityTemplates/`. | |
| Name string `json:"name,omitempty"` | |
| // UpdateTime: Output only. The timestamp when the resource was updated. | |
| UpdateTime string `json:"updateTime,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "AccessPath") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "AccessPath") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s AgentConnectivityTemplate) MarshalJSON() ([]byte, error) { | |
| type NoMethod AgentConnectivityTemplate | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // AgentGateway: AgentGateway represents the agent gateway resource. | |
| type AgentGateway struct { | |
| // AgentConnectivityTemplate: Optional. The resource name of the | |
| // AgentConnectivityTemplate. Format: | |
| // projects/{project}/locations/{location}/agentConnectivityTemplates/{template} | |
| AgentConnectivityTemplate string `json:"agentConnectivityTemplate,omitempty"` | |
| // AgentGatewayCard: Output only. Field for populated AgentGateway card. | |
| AgentGatewayCard *AgentGatewayAgentGatewayOutputCard `json:"agentGatewayCard,omitempty"` | |
| // CreateTime: Output only. The timestamp when the resource was created. | |
| CreateTime string `json:"createTime,omitempty"` | |
| // Description: Optional. A free-text description of the resource. Max length | |
| // 1024 characters. | |
| Description string `json:"description,omitempty"` | |
| // Etag: Optional. Etag of the resource. If this is provided, it must match the | |
| // server's etag. If the provided etag does not match the server's etag, the | |
| // request will fail with a 409 ABORTED error. | |
| Etag string `json:"etag,omitempty"` | |
| // GoogleManaged: Optional. Proxy is orchestrated and managed by GoogleCloud in | |
| // a tenant project. | |
| GoogleManaged *AgentGatewayGoogleManaged `json:"googleManaged,omitempty"` | |
| // Labels: Optional. Set of label tags associated with the AgentGateway | |
| // resource. | |
| Labels map[string]string `json:"labels,omitempty"` | |
| // Name: Identifier. Name of the AgentGateway resource. It matches pattern | |
| // `projects/*/locations/*/agentGateways/`. | |
| Name string `json:"name,omitempty"` | |
| // NetworkConfig: Optional. Network configuration for the AgentGateway. | |
| NetworkConfig *AgentGatewayNetworkConfig `json:"networkConfig,omitempty"` | |
| // Protocols: Optional. Deprecated. | |
| // | |
| // Possible values: | |
| // "PROTOCOL_UNSPECIFIED" - Unspecified protocol. | |
| // "MCP" - Message Control Plane protocol. | |
| Protocols []string `json:"protocols,omitempty"` | |
| // Registries: Optional. A list of Agent registries containing the agents, MCP | |
| // servers and tools governed by the Agent Gateway. Note: Currently limited to | |
| // project-scoped registries Must be of format | |
| // `//agentregistry.googleapis.com/projects/{project}/locations/{location}/` | |
| Registries []string `json:"registries,omitempty"` | |
| // SelfManaged: Optional. Attach to existing Application Load Balancers or | |
| // Secure Web Proxies. | |
| SelfManaged *AgentGatewaySelfManaged `json:"selfManaged,omitempty"` | |
| // UpdateTime: Output only. The timestamp when the resource was updated. | |
| UpdateTime string `json:"updateTime,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "AgentConnectivityTemplate") | |
| // to unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "AgentConnectivityTemplate") to | |
| // include in API requests with the JSON null value. By default, fields with | |
| // empty values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s AgentGateway) MarshalJSON() ([]byte, error) { | |
| type NoMethod AgentGateway | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // AgentGatewayAgentGatewayOutputCard: AgentGatewayOutputCard contains | |
| // informational output-only fields | |
| type AgentGatewayAgentGatewayOutputCard struct { | |
| // MtlsEndpoint: Output only. mTLS Endpoint associated with this AgentGateway | |
| MtlsEndpoint string `json:"mtlsEndpoint,omitempty"` | |
| // RootCertificates: Output only. Root Certificates for Agents to validate this | |
| // AgentGateway | |
| RootCertificates []string `json:"rootCertificates,omitempty"` | |
| // ServiceExtensionsServiceAccount: Output only. Service Account used by | |
| // Service Extensions to operate. | |
| ServiceExtensionsServiceAccount string `json:"serviceExtensionsServiceAccount,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "MtlsEndpoint") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "MtlsEndpoint") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s AgentGatewayAgentGatewayOutputCard) MarshalJSON() ([]byte, error) { | |
| type NoMethod AgentGatewayAgentGatewayOutputCard | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // AgentGatewayGoogleManaged: Configuration for Google Managed deployment mode. | |
| // Proxy is orchestrated and managed by GoogleCloud in a tenant project. | |
| type AgentGatewayGoogleManaged struct { | |
| // GovernedAccessPath: Optional. Operating Mode of Agent Gateway. | |
| // | |
| // Possible values: | |
| // "GOVERNED_ACCESS_PATH_UNSPECIFIED" - Governed access path is not | |
| // specified. | |
| // "AGENT_TO_ANYWHERE" - Govern agent conections to destinations. | |
| // "CLIENT_TO_AGENT" - Protect connection to Agent or Tool. | |
| GovernedAccessPath string `json:"governedAccessPath,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "GovernedAccessPath") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "GovernedAccessPath") to include | |
| // in API requests with the JSON null value. By default, fields with empty | |
| // values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s AgentGatewayGoogleManaged) MarshalJSON() ([]byte, error) { | |
| type NoMethod AgentGatewayGoogleManaged | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // AgentGatewayNetworkConfig: NetworkConfig contains network configurations for | |
| // the AgentGateway. | |
| type AgentGatewayNetworkConfig struct { | |
| // DnsPeeringConfig: Optional. Optional DNS peering configuration for | |
| // connectivity to your private VPC network. | |
| DnsPeeringConfig *AgentGatewayNetworkConfigDnsPeeringConfig `json:"dnsPeeringConfig,omitempty"` | |
| // Egress: Optional. Optional PSC-Interface network attachment for connectivity | |
| // to your private VPCs network. | |
| Egress *AgentGatewayNetworkConfigEgress `json:"egress,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "DnsPeeringConfig") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "DnsPeeringConfig") to include in | |
| // API requests with the JSON null value. By default, fields with empty values | |
| // are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s AgentGatewayNetworkConfig) MarshalJSON() ([]byte, error) { | |
| type NoMethod AgentGatewayNetworkConfig | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // AgentGatewayNetworkConfigDnsPeeringConfig: DNS peering config for the user | |
| // VPC network. | |
| type AgentGatewayNetworkConfigDnsPeeringConfig struct { | |
| // Domains: Required. Domain names for which DNS queries should be forwarded to | |
| // the target network. | |
| Domains []string `json:"domains,omitempty"` | |
| // TargetNetwork: Required. Target network in 'target project' to which DNS | |
| // queries should be forwarded to. Must be in format of | |
| // `projects/{project}/global/networks/{network}`. | |
| TargetNetwork string `json:"targetNetwork,omitempty"` | |
| // TargetProject: Required. Target project ID to which DNS queries should be | |
| // forwarded to. This can be the same project that contains the AgentGateway or | |
| // a different project. | |
| TargetProject string `json:"targetProject,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "Domains") to unconditionally | |
| // include in API requests. By default, fields with empty or default values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Domains") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s AgentGatewayNetworkConfigDnsPeeringConfig) MarshalJSON() ([]byte, error) { | |
| type NoMethod AgentGatewayNetworkConfigDnsPeeringConfig | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // AgentGatewayNetworkConfigEgress: Configuration for Egress | |
| type AgentGatewayNetworkConfigEgress struct { | |
| // NetworkAttachment: Optional. The URI of the Network Attachment resource. | |
| NetworkAttachment string `json:"networkAttachment,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "NetworkAttachment") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "NetworkAttachment") to include in | |
| // API requests with the JSON null value. By default, fields with empty values | |
| // are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s AgentGatewayNetworkConfigEgress) MarshalJSON() ([]byte, error) { | |
| type NoMethod AgentGatewayNetworkConfigEgress | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // AgentGatewaySelfManaged: Configuration for Self Managed deployment mode. | |
| // Attach to existing Application Load Balancers or Secure Web Proxies. | |
| type AgentGatewaySelfManaged struct { | |
| // ResourceUri: Optional. A supported Google Cloud networking proxy in the | |
| // Project and Location | |
| ResourceUri string `json:"resourceUri,omitempty"` | |
| // ResourceUris: Optional. List of supported Google Cloud networking proxies in | |
| // the Project and Location. resource_uris is mutually exclusive with | |
| // resource_uri. | |
| ResourceUris []string `json:"resourceUris,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "ResourceUri") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "ResourceUri") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s AgentGatewaySelfManaged) MarshalJSON() ([]byte, error) { | |
| type NoMethod AgentGatewaySelfManaged | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // AuthzExtension: `AuthzExtension` is a resource that allows traffic | |
| // forwarding to a callout backend service to make an authorization decision. | |
| type AuthzExtension struct { | |
| // Authority: Optional. The `:authority` header in the gRPC request sent from | |
| // Envoy to the extension service. It is required when the `service` field | |
| // points to a backend service. | |
| Authority string `json:"authority,omitempty"` | |
| // CreateTime: Output only. The timestamp when the resource was created. | |
| CreateTime string `json:"createTime,omitempty"` | |
| // Description: Optional. A human-readable description of the resource. | |
| Description string `json:"description,omitempty"` | |
| // FailOpen: Optional. Determines how the proxy behaves if the call to the | |
| // extension fails or times out. When set to `TRUE`, request or response | |
| // processing continues without error. Any subsequent extensions in the | |
| // extension chain are also executed. When set to `FALSE` or the default | |
| // setting of `FALSE` is used, one of the following happens: * If response | |
| // headers have not been delivered to the downstream client, a generic 500 | |
| // error is returned to the client. The error response can be tailored by | |
| // configuring a custom error response in the load balancer. * If response | |
| // headers have been delivered, then the HTTP stream to the downstream client | |
| // is reset. | |
| FailOpen bool `json:"failOpen,omitempty"` | |
| // ForwardAttributes: Optional. List of the Envoy attributes to forward to the | |
| // extension server. The attributes provided here are included as part of the | |
| // `ProcessingRequest.attributes` field (of type `map`), where the keys are the | |
| // attribute names. Refer to the documentation | |
| // (https://cloud.google.com/service-extensions/docs/cel-matcher-language-reference#attributes) | |
| // for the names of attributes that can be forwarded. If omitted, no attributes | |
| // are sent. Each element is a string indicating the attribute name. | |
| ForwardAttributes []string `json:"forwardAttributes,omitempty"` | |
| // ForwardHeaders: Optional. List of the HTTP headers to forward to the | |
| // extension (from the client). If omitted, all headers are sent. Each element | |
| // is a string indicating the header name. | |
| ForwardHeaders []string `json:"forwardHeaders,omitempty"` | |
| // Labels: Optional. Set of labels associated with the `AuthzExtension` | |
| // resource. The format must comply with the requirements for labels | |
| // (/compute/docs/labeling-resources#requirements) for Google Cloud resources. | |
| Labels map[string]string `json:"labels,omitempty"` | |
| // LoadBalancingScheme: Optional. All backend services and forwarding rules | |
| // referenced by this extension must share the same load balancing scheme. The | |
| // supported values are `INTERNAL_MANAGED` and `EXTERNAL_MANAGED`. You can omit | |
| // this field for `AuthzExtensions` resources that don't reference a backend | |
| // service. For more information, see Backend services overview | |
| // (https://cloud.google.com/load-balancing/docs/backend-service). | |
| // | |
| // Possible values: | |
| // "LOAD_BALANCING_SCHEME_UNSPECIFIED" - Default value. Do not use. | |
| // "INTERNAL_MANAGED" - Signifies that this is used for Internal HTTP(S) Load | |
| // Balancing. | |
| // "EXTERNAL_MANAGED" - Signifies that this is used for External Managed | |
| // HTTP(S) Load Balancing. | |
| LoadBalancingScheme string `json:"loadBalancingScheme,omitempty"` | |
| // Metadata: Optional. The metadata provided here is included as part of the | |
| // `metadata_context` (of type `google.protobuf.Struct`) in the | |
| // `ProcessingRequest` message sent to the extension server. The metadata is | |
| // available under the namespace `com.google.authz_extension.`. The following | |
| // variables are supported in the metadata Struct: `{forwarding_rule_id}` - | |
| // substituted with the forwarding rule's fully qualified resource name. | |
| Metadata googleapi.RawMessage `json:"metadata,omitempty"` | |
| // Name: Required. Identifier. Name of the `AuthzExtension` resource in the | |
| // following format: | |
| // `projects/{project}/locations/{location}/authzExtensions/{authz_extension}`. | |
| Name string `json:"name,omitempty"` | |
| // Service: Required. The reference to the service that runs the extension. To | |
| // configure a callout extension: For global AuthzExtension, `service` must be | |
| // a fully-qualified reference to a backend service | |
| // (https://cloud.google.com/compute/docs/reference/rest/v1/backendServices) in | |
| // the format: | |
| // `https://www.googleapis.com/compute/v1/projects/{project}/global/backendServi | |
| // ces/{backendService}`. For regional AuthzExtension, `service` must be a | |
| // fully-qualified reference to one of the following: * a backend service | |
| // (https://cloud.google.com/compute/docs/reference/rest/v1/backendServices) in | |
| // the format: | |
| // `https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/ba | |
| // ckendServices/{backendService}`. * a fully qualified domain name that can be | |
| // resolved by the Google Cloud DNS. * `iap.googleapis.com` and it can only be | |
| // referenced by an AuthzPolicy with the policyProfile set to REQUEST_AUTHZ. * | |
| // `modelarmor..rep.googleapis.com` and it can only be referenced by an | |
| // AuthzPolicy with the policyProfile set to CONTENT_AUTHZ. | |
| Service string `json:"service,omitempty"` | |
| // Timeout: Required. Specifies the timeout for each individual message on the | |
| // stream. The timeout must be between 10-10000 milliseconds. | |
| Timeout string `json:"timeout,omitempty"` | |
| // UpdateTime: Output only. The timestamp when the resource was updated. | |
| UpdateTime string `json:"updateTime,omitempty"` | |
| // WireFormat: Optional. The format of communication supported by the callout | |
| // extension. This field is supported only for regional `AuthzExtension` | |
| // resources. If not specified, the default value `EXT_PROC_GRPC` is used. | |
| // Global `AuthzExtension` resources use the `EXT_PROC_GRPC` wire format. | |
| // | |
| // Possible values: | |
| // "WIRE_FORMAT_UNSPECIFIED" - Not specified. | |
| // "EXT_PROC_GRPC" - The extension service uses ext_proc gRPC API over a gRPC | |
| // stream. This is the default value if the wire format is not specified. The | |
| // backend service for the extension must use HTTP2 or H2C as the protocol. All | |
| // `supported_events` for a client request are sent as part of the same gRPC | |
| // stream. | |
| // "EXT_AUTHZ_GRPC" - The extension service uses Envoy's `ext_authz` gRPC | |
| // API. The backend service for the extension must use HTTP2 or H2C as the | |
| // protocol. `EXT_AUTHZ_GRPC` is only supported for regional `AuthzExtension` | |
| // resources. | |
| WireFormat string `json:"wireFormat,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "Authority") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Authority") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s AuthzExtension) MarshalJSON() ([]byte, error) { | |
| type NoMethod AuthzExtension | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // CancelOperationRequest: The request message for Operations.CancelOperation. | |
| type CancelOperationRequest struct { | |
| } | |
| // CdnEdgeExtension: `CdnEdgeExtension` is a resource that lets the extension | |
| // service modify the headers of both requests to the cache and responses from | |
| // the cache served by an `EdgeCacheService` | |
| // (https://cloud.google.com/media-cdn/docs/reference/rest/v1/projects.locations.edgeCacheServices). | |
| type CdnEdgeExtension struct { | |
| // CreateTime: Output only. The timestamp when the resource was created. | |
| CreateTime string `json:"createTime,omitempty"` | |
| // Description: Optional. A human-readable description of the resource. | |
| Description string `json:"description,omitempty"` | |
| // ExtensionChains: Required. A set of ordered extension chains that contain | |
| // the match conditions and extensions to execute. Match conditions for each | |
| // extension chain are evaluated in sequence for a given request. The first | |
| // extension chain that has a condition that matches the request is executed. | |
| // Any subsequent extension chains do not execute. Limited to 5 extension | |
| // chains per resource. | |
| ExtensionChains []*ExtensionChain `json:"extensionChains,omitempty"` | |
| // Labels: Optional. Set of labels associated with the `CdnEdgeExtension` | |
| // resource. The format must comply with the requirements for labels | |
| // (https://cloud.google.com/compute/docs/labeling-resources#requirements) for | |
| // Google Cloud resources. | |
| Labels map[string]string `json:"labels,omitempty"` | |
| // Name: Required. Identifier. Name of the `CdnEdgeExtension` resource in the | |
| // following format: | |
| // `projects/{project}/locations/{location}/cdnEdgeExtensions/{cdn_edge_extensio | |
| // n}`. | |
| Name string `json:"name,omitempty"` | |
| // Target: Required. Specifies the set of resources to which this extension | |
| // should be applied to. | |
| Target *CdnEdgeExtensionTarget `json:"target,omitempty"` | |
| // UpdateTime: Output only. The timestamp when the resource was updated. | |
| UpdateTime string `json:"updateTime,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "CreateTime") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "CreateTime") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s CdnEdgeExtension) MarshalJSON() ([]byte, error) { | |
| type NoMethod CdnEdgeExtension | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // CdnEdgeExtensionTarget: Specifies the set of targets to which | |
| // `CdnEdgeExtension` should be applied to. | |
| type CdnEdgeExtensionTarget struct { | |
| // Resources: Required. A list of references to the resources that are targeted | |
| // by `CdnEdgeExtension`. Types of resources supported: `EdgeCacheService`. The | |
| // format must be the full resource name of EdgeCacheService | |
| // (https://cloud.google.com/media-cdn/docs/reference/rest/v1/projects.locations.edgeCacheServices) | |
| // in the following format: | |
| // `//networkservices.googleapis.com/projects/{project}/locations/{location}/edg | |
| // eCacheServices/{edgeCacheService}`. | |
| Resources []string `json:"resources,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "Resources") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Resources") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s CdnEdgeExtensionTarget) MarshalJSON() ([]byte, error) { | |
| type NoMethod CdnEdgeExtensionTarget | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // DnsPeeringConfig: DNS Peering configuration. | |
| type DnsPeeringConfig struct { | |
| // Domain: Optional. Deprecated: Use `domains` instead. The domain to peer. | |
| Domain string `json:"domain,omitempty"` | |
| // Domains: Optional. The domains to peer. | |
| Domains []string `json:"domains,omitempty"` | |
| // TargetNetwork: Optional. The target network resource name for DNS peering. | |
| // Format: projects/{project}/global/networks/{network_id} | |
| TargetNetwork string `json:"targetNetwork,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "Domain") to unconditionally | |
| // include in API requests. By default, fields with empty or default values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Domain") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s DnsPeeringConfig) MarshalJSON() ([]byte, error) { | |
| type NoMethod DnsPeeringConfig | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // EgressNetworkConfig: Egress network config | |
| type EgressNetworkConfig struct { | |
| // DnsPeeringConfig: Optional. DNS Peering configuration. | |
| DnsPeeringConfig *DnsPeeringConfig `json:"dnsPeeringConfig,omitempty"` | |
| // NetworkAttachment: Optional. The network attachment resource name. Format: | |
| // projects/{project}/regions/{region}/networkAttachments/{network_attachment_id | |
| // } | |
| NetworkAttachment string `json:"networkAttachment,omitempty"` | |
| // TlsConfig: Optional. The TLS configuration for the egress traffic. | |
| TlsConfig *EgressNetworkConfigTlsConfig `json:"tlsConfig,omitempty"` | |
| // TrustConfig: Optional. Deprecated: Use tls_config instead. The trust config | |
| // resource name. Format: | |
| // projects/{project}/locations/{location}/trustConfigs/{trust_config} | |
| TrustConfig string `json:"trustConfig,omitempty"` | |
| // VpcEgress: Optional. The VPC egress setting. | |
| // | |
| // Possible values: | |
| // "VPC_EGRESS_UNSPECIFIED" - Unspecified | |
| // "ALL_TRAFFIC" - All outbound traffic is routed through the VPC connector. | |
| // "PRIVATE_RANGES_ONLY" - Only private IP ranges are routed through the VPC | |
| // connector. | |
| VpcEgress string `json:"vpcEgress,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "DnsPeeringConfig") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "DnsPeeringConfig") to include in | |
| // API requests with the JSON null value. By default, fields with empty values | |
| // are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s EgressNetworkConfig) MarshalJSON() ([]byte, error) { | |
| type NoMethod EgressNetworkConfig | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // EgressNetworkConfigTlsConfig: Configuration for TLS connections. | |
| type EgressNetworkConfigTlsConfig struct { | |
| // AdditionalRoots: Optional. The additional roots to trust. | |
| // | |
| // Possible values: | |
| // "ADDITIONAL_ROOTS_UNSPECIFIED" - Unspecified additional roots. | |
| // "NO_ADDITIONAL_ROOTS" - Trust only the certificates provided in | |
| // `trust_config`. | |
| // "PUBLICLY_TRUSTED_ROOTS" - Trust certificates provided in `trust_config` | |
| // and publicly trusted roots. | |
| AdditionalRoots string `json:"additionalRoots,omitempty"` | |
| // TrustConfig: Optional. The trust config resource name. Format: | |
| // projects/{project}/locations/{location}/trustConfigs/{trust_config} | |
| TrustConfig string `json:"trustConfig,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "AdditionalRoots") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "AdditionalRoots") to include in | |
| // API requests with the JSON null value. By default, fields with empty values | |
| // are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s EgressNetworkConfigTlsConfig) MarshalJSON() ([]byte, error) { | |
| type NoMethod EgressNetworkConfigTlsConfig | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // Empty: A generic empty message that you can re-use to avoid defining | |
| // duplicated empty messages in your APIs. A typical example is to use it as | |
| // the request or the response type of an API method. For instance: service Foo | |
| // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } | |
| type Empty struct { | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| } | |
| // EndpointMatcher: A definition of a matcher that selects endpoints to which | |
| // the policies should be applied. | |
| type EndpointMatcher struct { | |
| // MetadataLabelMatcher: The matcher is based on node metadata presented by xDS | |
| // clients. | |
| MetadataLabelMatcher *MetadataLabelMatcher `json:"metadataLabelMatcher,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "MetadataLabelMatcher") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "MetadataLabelMatcher") to include | |
| // in API requests with the JSON null value. By default, fields with empty | |
| // values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s EndpointMatcher) MarshalJSON() ([]byte, error) { | |
| type NoMethod EndpointMatcher | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // EndpointPolicy: EndpointPolicy is a resource that helps apply desired | |
| // configuration on the endpoints that match specific criteria. For example, | |
| // this resource can be used to apply "authentication config" an all endpoints | |
| // that serve on port 8080. | |
| type EndpointPolicy struct { | |
| // AuthorizationPolicy: Optional. This field specifies the URL of | |
| // AuthorizationPolicy resource that applies authorization policies to the | |
| // inbound traffic at the matched endpoints. Refer to Authorization. If this | |
| // field is not specified, authorization is disabled(no authz checks) for this | |
| // endpoint. | |
| AuthorizationPolicy string `json:"authorizationPolicy,omitempty"` | |
| // ClientTlsPolicy: Optional. Deprecated: This field is not used and is a | |
| // no-op. A URL referring to a ClientTlsPolicy resource. ClientTlsPolicy can be | |
| // set to specify the authentication for traffic from the proxy to the actual | |
| // endpoints. More specifically, it is applied to the outgoing traffic from the | |
| // proxy to the endpoint. This is typically used for sidecar model where the | |
| // proxy identifies itself as endpoint to the control plane, with the | |
| // connection between sidecar and endpoint requiring authentication. If this | |
| // field is not set, authentication is disabled(open). Applicable only when | |
| // EndpointPolicyType is SIDECAR_PROXY. | |
| ClientTlsPolicy string `json:"clientTlsPolicy,omitempty"` | |
| // CreateTime: Output only. The timestamp when the resource was created. | |
| CreateTime string `json:"createTime,omitempty"` | |
| // Description: Optional. A free-text description of the resource. Max length | |
| // 1024 characters. | |
| Description string `json:"description,omitempty"` | |
| // EndpointMatcher: Required. A matcher that selects endpoints to which the | |
| // policies should be applied. | |
| EndpointMatcher *EndpointMatcher `json:"endpointMatcher,omitempty"` | |
| // Labels: Optional. Set of label tags associated with the EndpointPolicy | |
| // resource. | |
| Labels map[string]string `json:"labels,omitempty"` | |
| // Name: Identifier. Name of the EndpointPolicy resource. It matches pattern | |
| // `projects/{project}/locations/*/endpointPolicies/{endpoint_policy}`. | |
| Name string `json:"name,omitempty"` | |
| // SecurityPolicy: Optional. A URL referring to a SecurityPolicy resource. | |
| // SecurityPolicy is used to enforce rate limiting policy on the inbound | |
| // traffic at the identified backends. If this field is not set, rate limiting | |
| // is disabled for this endpoint. | |
| SecurityPolicy string `json:"securityPolicy,omitempty"` | |
| // ServerTlsPolicy: Optional. A URL referring to ServerTlsPolicy resource. | |
| // ServerTlsPolicy is used to determine the authentication policy to be applied | |
| // to terminate the inbound traffic at the identified backends. If this field | |
| // is not set, authentication is disabled(open) for this endpoint. | |
| ServerTlsPolicy string `json:"serverTlsPolicy,omitempty"` | |
| // TrafficPortSelector: Optional. Port selector for the (matched) endpoints. If | |
| // no port selector is provided, the matched config is applied to all ports. | |
| TrafficPortSelector *TrafficPortSelector `json:"trafficPortSelector,omitempty"` | |
| // Type: Required. The type of endpoint policy. This is primarily used to | |
| // validate the configuration. | |
| // | |
| // Possible values: | |
| // "ENDPOINT_POLICY_TYPE_UNSPECIFIED" - Default value. Must not be used. | |
| // "SIDECAR_PROXY" - Represents a proxy deployed as a sidecar. | |
| // "GRPC_SERVER" - Represents a proxyless gRPC backend. | |
| Type string `json:"type,omitempty"` | |
| // UpdateTime: Output only. The timestamp when the resource was updated. | |
| UpdateTime string `json:"updateTime,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "AuthorizationPolicy") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "AuthorizationPolicy") to include | |
| // in API requests with the JSON null value. By default, fields with empty | |
| // values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s EndpointPolicy) MarshalJSON() ([]byte, error) { | |
| type NoMethod EndpointPolicy | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ExtensionBinding: `ExtensionBinding` is a resource representing the | |
| // attachment of an extension to a service. | |
| type ExtensionBinding struct { | |
| // CreateTime: Output only. The timestamp when the resource was created. | |
| CreateTime string `json:"createTime,omitempty"` | |
| // Description: Optional. A human-readable description of the resource. | |
| Description string `json:"description,omitempty"` | |
| // Etag: Optional. Etag of the resource. If provided, it must match the | |
| // server's etag. If the provided etag does not match the server's etag, the | |
| // request will fail with a 409 ABORTED error. | |
| Etag string `json:"etag,omitempty"` | |
| // FailOpen: Optional. Determines the behavior of the extension binding when | |
| // the call to the extension fails or times out. Default value is `FALSE`. When | |
| // set to `TRUE`, failures of the extension are silently ignored. | |
| FailOpen bool `json:"failOpen,omitempty"` | |
| // Labels: Optional. Set of labels associated with the `ExtensionBinding` | |
| // resource. The format must comply with the following requirements | |
| // (https://cloud.google.com/compute/docs/labeling-resources#requirements). | |
| Labels map[string]string `json:"labels,omitempty"` | |
| // MatchConditions: Optional. A list of match conditions to evaluate against | |
| // the incoming request. The extension is invoked if the request matches at | |
| // least one condition, or if no match conditions are specified. A request | |
| // matches a condition only if it matches every field that is set in that | |
| // condition. Limited to 5 conditions. | |
| MatchConditions []*ExtensionBindingMatchCondition `json:"matchConditions,omitempty"` | |
| // Name: Identifier. Name of the `ExtensionBinding` resource in the following | |
| // format: | |
| // `projects/{project}/locations/{location}/extensionBindings/{extension_binding | |
| // }`. | |
| Name string `json:"name,omitempty"` | |
| // Priority: Optional. Priority of the extension binding. Lower numbers | |
| // indicate higher priority. The priority determines the order in which | |
| // extension bindings are applied to a request. | |
| Priority int64 `json:"priority,omitempty"` | |
| // ProducerExtension: Required. The name of the extension that this binding | |
| // should attach to target resources. Format: For Google-provided extensions, | |
| // specify the service endpoint, for example | |
| // `modelarmor.us-central1.rep.googleapis.com`. | |
| ProducerExtension string `json:"producerExtension,omitempty"` | |
| // ProducerMetadata: Optional. Additional metadata that should be passed to the | |
| // attached extension with each request. This field is subject to the following | |
| // limitations: * The total size of the metadata must be less than 1 KiB. * The | |
| // total number of keys must be less than 16. * The length of each key must be | |
| // less than 64 characters. * The length of each value must be less than 1024 | |
| // characters. | |
| ProducerMetadata map[string]string `json:"producerMetadata,omitempty"` | |
| // Target: Required. Specifies a target to which this `ExtensionBinding` should | |
| // be attached. | |
| Target *ExtensionBindingTarget `json:"target,omitempty"` | |
| // UpdateTime: Output only. The timestamp when the resource was updated. | |
| UpdateTime string `json:"updateTime,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "CreateTime") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "CreateTime") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ExtensionBinding) MarshalJSON() ([]byte, error) { | |
| type NoMethod ExtensionBinding | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ExtensionBindingMatchCondition: Conditions to match against the incoming | |
| // request. | |
| type ExtensionBindingMatchCondition struct { | |
| // To: Optional. Describes properties of a destination of a request. If | |
| // specified, the extension will only be invoked on requests to destinations | |
| // that match the specified criteria. | |
| To *ExtensionBindingMatchConditionTo `json:"to,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "To") to unconditionally | |
| // include in API requests. By default, fields with empty or default values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "To") to include in API requests | |
| // with the JSON null value. By default, fields with empty values are omitted | |
| // from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ExtensionBindingMatchCondition) MarshalJSON() ([]byte, error) { | |
| type NoMethod ExtensionBindingMatchCondition | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ExtensionBindingMatchConditionHeaderMatch: Determines how an HTTP header | |
| // should be matched. | |
| type ExtensionBindingMatchConditionHeaderMatch struct { | |
| // Name: Required. Specifies the name of the header in the request. | |
| Name string `json:"name,omitempty"` | |
| // Value: Optional. Specifies how the header match will be performed. | |
| Value *ExtensionBindingMatchConditionStringMatch `json:"value,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "Name") to unconditionally | |
| // include in API requests. By default, fields with empty or default values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Name") to include in API requests | |
| // with the JSON null value. By default, fields with empty values are omitted | |
| // from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ExtensionBindingMatchConditionHeaderMatch) MarshalJSON() ([]byte, error) { | |
| type NoMethod ExtensionBindingMatchConditionHeaderMatch | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ExtensionBindingMatchConditionStringMatch: Specifies matching logic for | |
| // string values. | |
| type ExtensionBindingMatchConditionStringMatch struct { | |
| // Contains: Optional. The input string must contain the substring specified | |
| // here. An empty substring is not allowed. Examples: * `abc` matches the value | |
| // `xyz.abc.def`. | |
| Contains string `json:"contains,omitempty"` | |
| // Exact: Optional. The input string must match exactly the string specified | |
| // here. Examples: * `abc` only matches the value `abc`. | |
| Exact string `json:"exact,omitempty"` | |
| // IgnoreCase: Optional. If true, the `exact`, `prefix`, `suffix`, or | |
| // `contains` match is case insensitive. For example, the matcher `data` | |
| // matches both `Data` and `data` when set to true. | |
| IgnoreCase bool `json:"ignoreCase,omitempty"` | |
| // Prefix: Optional. The input string must have the prefix specified here. An | |
| // empty prefix is not allowed. Examples: * `abc` matches the value `abc.xyz`. | |
| Prefix string `json:"prefix,omitempty"` | |
| // Suffix: Optional. The input string must have the suffix specified here. An | |
| // empty suffix is not allowed. Examples: * `abc` matches the value `xyz.abc`. | |
| Suffix string `json:"suffix,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "Contains") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Contains") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ExtensionBindingMatchConditionStringMatch) MarshalJSON() ([]byte, error) { | |
| type NoMethod ExtensionBindingMatchConditionStringMatch | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ExtensionBindingMatchConditionTo: Describes properties of one or more | |
| // destinations of a request. | |
| type ExtensionBindingMatchConditionTo struct { | |
| // Destination: Optional. Describes properties of the destination of a request. | |
| // A request matches the destination only if it matches every field that is | |
| // set. Fields that are not set are always considered a match. For example, if | |
| // only `hosts` and `paths` are set, a request matches when any host matches | |
| // and any path matches. At least one of `destination` or `not_destination` | |
| // must be specified. | |
| Destination *ExtensionBindingMatchConditionToDestination `json:"destination,omitempty"` | |
| // NotDestination: Optional. Describes the negated properties of the request | |
| // destination. Extension will not be invoked on requests that match the | |
| // criteria specified in this field. At least one of destination or | |
| // not_destination must be specified. | |
| NotDestination *ExtensionBindingMatchConditionToDestination `json:"notDestination,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "Destination") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Destination") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ExtensionBindingMatchConditionTo) MarshalJSON() ([]byte, error) { | |
| type NoMethod ExtensionBindingMatchConditionTo | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ExtensionBindingMatchConditionToDestination: Describes properties of a | |
| // single destination. | |
| type ExtensionBindingMatchConditionToDestination struct { | |
| // HeaderSet: Optional. A set of HTTP headers to match against. If not | |
| // specified, requests with any headers are matched. | |
| HeaderSet *ExtensionBindingMatchConditionToDestinationHeaderSet `json:"headerSet,omitempty"` | |
| // Hosts: Optional. A list of HTTP Hosts to match against. Limited to 10 hosts. | |
| // If not specified, any host is allowed. If specified, a match occurs if any | |
| // of the hosts matches the host value in the request. | |
| Hosts []*ExtensionBindingMatchConditionStringMatch `json:"hosts,omitempty"` | |
| // Paths: Optional. A list of paths to match against. Limited to 10 paths. If | |
| // not specified, any path is allowed. Note that this path match includes the | |
| // query parameters. For gRPC services, this should be a fully-qualified name | |
| // of the form /package.service/method. | |
| Paths []*ExtensionBindingMatchConditionStringMatch `json:"paths,omitempty"` | |
| // Resources: Optional. A list of non-empty strings whose value is matched | |
| // against the resource to which a request is sent (e.g., an Agent in | |
| // AiApplication). If not specified, any resource is allowed. If specified, a | |
| // match occurs if any of the resources matches the resource value in the | |
| // request. Limited to 5 resources. When matching against resources in the | |
| // AgentRegistry, use the URNs of the registry resources. | |
| Resources []*ExtensionBindingMatchConditionStringMatch `json:"resources,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "HeaderSet") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "HeaderSet") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ExtensionBindingMatchConditionToDestination) MarshalJSON() ([]byte, error) { | |
| type NoMethod ExtensionBindingMatchConditionToDestination | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ExtensionBindingMatchConditionToDestinationHeaderSet: Describes a set of | |
| // HTTP headers to match against. | |
| type ExtensionBindingMatchConditionToDestinationHeaderSet struct { | |
| // Headers: Required. A list of HTTP headers to match against. If multiple | |
| // header matches are provided, they are evaluated as an AND, meaning that all | |
| // header matches must match for the request to match. Limited to 10 headers. | |
| Headers []*ExtensionBindingMatchConditionHeaderMatch `json:"headers,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "Headers") to unconditionally | |
| // include in API requests. By default, fields with empty or default values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Headers") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ExtensionBindingMatchConditionToDestinationHeaderSet) MarshalJSON() ([]byte, error) { | |
| type NoMethod ExtensionBindingMatchConditionToDestinationHeaderSet | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ExtensionBindingTarget: Specifies a list of targets to which this | |
| // `ExtensionBinding` should attach. | |
| type ExtensionBindingTarget struct { | |
| // Resources: Optional. The references to the target resources to which this | |
| // binding should attach. Exactly one of `resources` or `scope` must be set. | |
| // For AI Application resources, specify the full resource name in the format: | |
| // `projects/{project}/locations/{location}/applications/{application}`. | |
| // Limited to 1 resource. | |
| Resources []string `json:"resources,omitempty"` | |
| // Scope: Optional. Specifies the scope of resources to which this binding | |
| // should attach. Exactly one of `resources` or `scope` must be set. | |
| Scope *ExtensionBindingTargetScope `json:"scope,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "Resources") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Resources") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ExtensionBindingTarget) MarshalJSON() ([]byte, error) { | |
| type NoMethod ExtensionBindingTarget | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ExtensionBindingTargetScope: Specifies the scope of resources to which this | |
| // binding should attach. | |
| type ExtensionBindingTargetScope struct { | |
| // Parent: Required. The parent resource that defines the scope, in the format | |
| // `projects/{project_number}`. When the scope is a project, the binding | |
| // applies to the resources that meet all of the following conditions: * The | |
| // resource belongs to the specified project. * The resource is in the same | |
| // location as the `ExtensionBinding`. * The resource type is listed in | |
| // `resource_types`. | |
| Parent string `json:"parent,omitempty"` | |
| // ResourceTypes: Required. The types of resources to which the binding should | |
| // attach. Limited to 1 resource type. | |
| // | |
| // Possible values: | |
| // "RESOURCE_TYPE_UNSPECIFIED" - Default value. Should not be used. | |
| // "AI_APPLICATION" - AI Application resources. | |
| // "AGENT_GATEWAY" - Agent Gateway resources. | |
| ResourceTypes []string `json:"resourceTypes,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "Parent") to unconditionally | |
| // include in API requests. By default, fields with empty or default values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Parent") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ExtensionBindingTargetScope) MarshalJSON() ([]byte, error) { | |
| type NoMethod ExtensionBindingTargetScope | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ExtensionChain: A single extension chain wrapper that contains the match | |
| // conditions and extensions to execute. | |
| type ExtensionChain struct { | |
| // Extensions: Required. A set of extensions to execute for the matching | |
| // request. At least one extension is required. Up to 3 extensions can be | |
| // defined for each extension chain for `LbTrafficExtension` resource. | |
| // `LbRouteExtension`, `LbEdgeExtension`, and `LbTcpExtension` chains are | |
| // limited to 1 extension per extension chain. | |
| Extensions []*ExtensionChainExtension `json:"extensions,omitempty"` | |
| // MatchCondition: Required. Conditions under which this chain is invoked for a | |
| // request. | |
| MatchCondition *ExtensionChainMatchCondition `json:"matchCondition,omitempty"` | |
| // Name: Required. The name for this extension chain. The name is logged as | |
| // part of the HTTP request logs. The name must conform with RFC-1034, is | |
| // restricted to lower-cased letters, numbers and hyphens, and can have a | |
| // maximum length of 63 characters. Additionally, the first character must be a | |
| // letter and the last a letter or a number. | |
| Name string `json:"name,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "Extensions") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Extensions") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ExtensionChain) MarshalJSON() ([]byte, error) { | |
| type NoMethod ExtensionChain | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ExtensionChainExtension: A single extension in the chain to execute for the | |
| // matching request. | |
| type ExtensionChainExtension struct { | |
| // AllowDynamicForwarding: Optional. When set to `TRUE`, the response from an | |
| // extension service is allowed to set the | |
| // `com.google.envoy.dynamic_forwarding` namespace in the dynamic metadata. | |
| // This field is not supported for plugin extensions or AuthzExtensions. | |
| // Setting it results in a validation error. | |
| AllowDynamicForwarding bool `json:"allowDynamicForwarding,omitempty"` | |
| // Authority: Optional. The `:authority` header in the gRPC request sent from | |
| // Envoy to the extension service. Required for Callout extensions. This field | |
| // is not supported for plugin extensions. Setting it results in a validation | |
| // error. | |
| Authority string `json:"authority,omitempty"` | |
| // FailOpen: Optional. Determines how the proxy behaves if the call to the | |
| // extension fails or times out. When set to `TRUE`, request or response | |
| // processing continues without error. Any subsequent extensions in the | |
| // extension chain are also executed. When set to `FALSE` or the default | |
| // setting of `FALSE` is used, one of the following happens: * If response | |
| // headers have not been delivered to the downstream client, a generic 500 | |
| // error is returned to the client. The error response can be tailored by | |
| // configuring a custom error response in the load balancer. * If response | |
| // headers have been delivered, then the HTTP stream to the downstream client | |
| // is reset. | |
| FailOpen bool `json:"failOpen,omitempty"` | |
| // ForwardAttributes: Optional. List of the Envoy attributes to forward to the | |
| // extension server. The attributes provided here are included as part of the | |
| // `ProcessingRequest.attributes` field (of type `map`), where the keys are the | |
| // attribute names. Refer to the documentation | |
| // (https://cloud.google.com/service-extensions/docs/cel-matcher-language-reference#attributes) | |
| // for the names of attributes that can be forwarded. If omitted, no attributes | |
| // are sent. Each element is a string indicating the attribute name. | |
| ForwardAttributes []string `json:"forwardAttributes,omitempty"` | |
| // ForwardHeaders: Optional. List of the HTTP headers to forward to the | |
| // extension (from the client or backend). If omitted, all headers are sent. | |
| // Each element is a string indicating the header name. | |
| ForwardHeaders []string `json:"forwardHeaders,omitempty"` | |
| // Metadata: Optional. The metadata provided here is included as part of the | |
| // `metadata_context` (of type `google.protobuf.Struct`) in the | |
| // `ProcessingRequest` message sent to the extension server. For | |
| // `AuthzExtension` resources, the metadata is available under the namespace | |
| // `com.google.authz_extension.`. For other types of extensions, the metadata | |
| // is available under the namespace `com.google....`. For example: | |
| // `com.google.lb_traffic_extension.lbtrafficextension1.chain1.ext1`. The | |
| // following variables are supported in the metadata: `{forwarding_rule_id}` - | |
| // substituted with the forwarding rule's fully qualified resource name. This | |
| // field must not be set for plugin extensions. Setting it results in a | |
| // validation error. You can set metadata at either the resource level or the | |
| // extension level. The extension level metadata is recommended because you can | |
| // pass a different set of metadata through each extension to the backend. This | |
| // field is subject to following limitations: * The total size of the metadata | |
| // must be less than 1KiB. * The total number of keys in the metadata must be | |
| // less than 16. * The length of each key must be less than 64 characters. * | |
| // The length of each value must be less than 1024 characters. * All values | |
| // must be strings. | |
| Metadata googleapi.RawMessage `json:"metadata,omitempty"` | |
| // Name: Optional. The name for this extension. The name is logged as part of | |
| // the HTTP request logs. The name must conform with RFC-1034, is restricted to | |
| // lower-cased letters, numbers and hyphens, and can have a maximum length of | |
| // 63 characters. Additionally, the first character must be a letter and the | |
| // last a letter or a number. This field is required except for AuthzExtension. | |
| Name string `json:"name,omitempty"` | |
| // ObservabilityMode: Optional. When set to `true`, the calls to the extension | |
| // backend are performed asynchronously, without pausing the processing of the | |
| // ongoing request. In this mode, only `STREAMED` (default) body processing is | |
| // supported. Responses, if any, are ignored. Supported by regional | |
| // `LbTrafficExtension` and `LbRouteExtension` resources. | |
| ObservabilityMode bool `json:"observabilityMode,omitempty"` | |
| // RequestBodySendMode: Optional. Configures the send mode for request body | |
| // processing. The field can only be set if `supported_events` includes | |
| // `REQUEST_BODY`. If `supported_events` includes `REQUEST_BODY`, but | |
| // `request_body_send_mode` is unset, the default value `STREAMED` is used. | |
| // When this field is set to `FULL_DUPLEX_STREAMED`, `supported_events` must | |
| // include both `REQUEST_BODY` and `REQUEST_TRAILERS`. This field can be set | |
| // only for `LbTrafficExtension` and `LbRouteExtension` resources, and only | |
| // when the `service` field of the extension points to a `BackendService`. Only | |
| // `FULL_DUPLEX_STREAMED` mode is supported for `LbRouteExtension` resources. | |
| // | |
| // Possible values: | |
| // "BODY_SEND_MODE_UNSPECIFIED" - Default value. Do not use. | |
| // "BODY_SEND_MODE_STREAMED" - Calls to the extension are executed in the | |
| // streamed mode. Subsequent chunks will be sent only after the previous chunks | |
| // have been processed. The content of the body chunks is sent one way to the | |
| // extension. Extension may send modified chunks back. This is the default | |
| // value if the processing mode is not specified. | |
| // "BODY_SEND_MODE_FULL_DUPLEX_STREAMED" - Calls are executed in the full | |
| // duplex mode. Subsequent chunks will be sent for processing without waiting | |
| // for the response for the previous chunk or for the response for | |
| // `REQUEST_HEADERS` event. Extension can freely modify or chunk the body | |
| // contents. If the extension doesn't send the body contents back, the next | |
| // extension in the chain or the upstream will receive an empty body. | |
| RequestBodySendMode string `json:"requestBodySendMode,omitempty"` | |
| // ResponseBodySendMode: Optional. Configures the send mode for response | |
| // processing. If unspecified, the default value `STREAMED` is used. The field | |
| // can only be set if `supported_events` includes `RESPONSE_BODY`. If | |
| // `supported_events` includes `RESPONSE_BODY`, but `response_body_send_mode` | |
| // is unset, the default value `STREAMED` is used. When this field is set to | |
| // `FULL_DUPLEX_STREAMED`, `supported_events` must include both `RESPONSE_BODY` | |
| // and `RESPONSE_TRAILERS`. This field can be set only for `LbTrafficExtension` | |
| // resources, and only when the `service` field of the extension points to a | |
| // `BackendService`. | |
| // | |
| // Possible values: | |
| // "BODY_SEND_MODE_UNSPECIFIED" - Default value. Do not use. | |
| // "BODY_SEND_MODE_STREAMED" - Calls to the extension are executed in the | |
| // streamed mode. Subsequent chunks will be sent only after the previous chunks | |
| // have been processed. The content of the body chunks is sent one way to the | |
| // extension. Extension may send modified chunks back. This is the default | |
| // value if the processing mode is not specified. | |
| // "BODY_SEND_MODE_FULL_DUPLEX_STREAMED" - Calls are executed in the full | |
| // duplex mode. Subsequent chunks will be sent for processing without waiting | |
| // for the response for the previous chunk or for the response for | |
| // `REQUEST_HEADERS` event. Extension can freely modify or chunk the body | |
| // contents. If the extension doesn't send the body contents back, the next | |
| // extension in the chain or the upstream will receive an empty body. | |
| ResponseBodySendMode string `json:"responseBodySendMode,omitempty"` | |
| // Service: Required. The reference to the service that runs the extension. To | |
| // configure a callout extension, `service` must be a fully-qualified reference | |
| // to a backend service | |
| // (https://cloud.google.com/compute/docs/reference/rest/v1/backendServices) in | |
| // the format: | |
| // `https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/ba | |
| // ckendServices/{backendService}` or | |
| // `https://www.googleapis.com/compute/v1/projects/{project}/global/backendServi | |
| // ces/{backendService}`. To configure a plugin extension, `service` must be a | |
| // reference to a `WasmPlugin` resource | |
| // (https://cloud.google.com/service-extensions/docs/reference/rest/v1beta1/projects.locations.wasmPlugins) | |
| // in the format: | |
| // `projects/{project}/locations/{location}/wasmPlugins/{plugin}` or | |
| // `//networkservices.googleapis.com/projects/{project}/locations/{location}/was | |
| // mPlugins/{wasmPlugin}`. Plugin extensions are currently supported for the | |
| // `LbTrafficExtension`, the `LbRouteExtension`, and the `LbEdgeExtension` | |
| // resources. | |
| Service string `json:"service,omitempty"` | |
| // SupportedEvents: Optional. A set of events during request or response | |
| // processing for which this extension is called. For the `LbTrafficExtension` | |
| // resource, this field is required. For the `LbRouteExtension` resource, this | |
| // field is optional. If unspecified, `REQUEST_HEADERS` event is assumed as | |
| // supported. For the `LbEdgeExtension` resource, this field is required and | |
| // must only contain `REQUEST_HEADERS` event. For the `AuthzExtension` | |
| // resource, this field is optional. `REQUEST_HEADERS` is the only supported | |
| // event. If unspecified, `REQUEST_HEADERS` event is assumed as supported. For | |
| // the `CdnEdgeExtension` resource, this field is optional. Eligible values are | |
| // `REQUEST_HEADERS` and `RESPONSE_HEADERS`. If unspecified, both are assumed | |
| // as supported. | |
| // | |
| // Possible values: | |
| // "EVENT_TYPE_UNSPECIFIED" - Unspecified value. Do not use. | |
| // "REQUEST_HEADERS" - If included in `supported_events`, the extension is | |
| // called when the HTTP request headers arrive. | |
| // "REQUEST_BODY" - If included in `supported_events`, the extension is | |
| // called when the HTTP request body arrives. | |
| // "RESPONSE_HEADERS" - If included in `supported_events`, the extension is | |
| // called when the HTTP response headers arrive. | |
| // "RESPONSE_BODY" - If included in `supported_events`, the extension is | |
| // called when the HTTP response body arrives. | |
| // "REQUEST_TRAILERS" - If included in `supported_events`, the extension is | |
| // called when the HTTP request trailers arrives. | |
| // "RESPONSE_TRAILERS" - If included in `supported_events`, the extension is | |
| // called when the HTTP response trailers arrives. | |
| SupportedEvents []string `json:"supportedEvents,omitempty"` | |
| // Timeout: Optional. Specifies the timeout for each individual message on the | |
| // stream. The timeout must be between `10`-`10000` milliseconds. Required for | |
| // callout extensions. This field is not supported for plugin extensions. | |
| // Setting it results in a validation error. | |
| Timeout string `json:"timeout,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "AllowDynamicForwarding") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "AllowDynamicForwarding") to | |
| // include in API requests with the JSON null value. By default, fields with | |
| // empty values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ExtensionChainExtension) MarshalJSON() ([]byte, error) { | |
| type NoMethod ExtensionChainExtension | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ExtensionChainMatchCondition: Conditions under which this chain is invoked | |
| // for a request. | |
| type ExtensionChainMatchCondition struct { | |
| // CelExpression: Required. A Common Expression Language (CEL) expression that | |
| // is used to match requests for which the extension chain is executed. For | |
| // more information, see CEL matcher language reference | |
| // (https://cloud.google.com/service-extensions/docs/cel-matcher-language-reference). | |
| CelExpression string `json:"celExpression,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "CelExpression") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "CelExpression") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ExtensionChainMatchCondition) MarshalJSON() ([]byte, error) { | |
| type NoMethod ExtensionChainMatchCondition | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // Gateway: Gateway represents the configuration for a proxy, typically a load | |
| // balancer. It captures the ip:port over which the services are exposed by the | |
| // proxy, along with any policy configurations. Routes have reference to to | |
| // Gateways to dictate how requests should be routed by this Gateway. | |
| type Gateway struct { | |
| // Addresses: Optional. Zero or one IPv4 or IPv6 address on which the Gateway | |
| // will receive the traffic. When no address is provided, an IP from the | |
| // subnetwork is allocated This field only applies to gateways of type | |
| // 'SECURE_WEB_GATEWAY'. Gateways of type 'OPEN_MESH' listen on 0.0.0.0 for | |
| // IPv4 and :: for IPv6. | |
| Addresses []string `json:"addresses,omitempty"` | |
| // AllPorts: Optional. If true, the Gateway will listen on all ports. This is | |
| // mutually exclusive with the `ports` field. This field only applies to | |
| // gateways of type 'SECURE_WEB_GATEWAY'. | |
| AllPorts bool `json:"allPorts,omitempty"` | |
| // AllowGlobalAccess: Optional. If true, the gateway will allow traffic from | |
| // clients outside of the region where the gateway is located. This field is | |
| // configurable only for gateways of type SECURE_WEB_GATEWAY. | |
| AllowGlobalAccess bool `json:"allowGlobalAccess,omitempty"` | |
| // CertificateUrls: Optional. A fully-qualified Certificates URL reference. The | |
| // proxy presents a Certificate (selected based on SNI) when establishing a TLS | |
| // connection. This feature only applies to gateways of type | |
| // 'SECURE_WEB_GATEWAY'. | |
| CertificateUrls []string `json:"certificateUrls,omitempty"` | |
| // CreateTime: Output only. The timestamp when the resource was created. | |
| CreateTime string `json:"createTime,omitempty"` | |
| // Description: Optional. A free-text description of the resource. Max length | |
| // 1024 characters. | |
| Description string `json:"description,omitempty"` | |
| // EnvoyHeaders: Optional. Determines if envoy will insert internal debug | |
| // headers into upstream requests. Other Envoy headers may still be injected. | |
| // By default, envoy will not insert any debug headers. | |
| // | |
| // Possible values: | |
| // "ENVOY_HEADERS_UNSPECIFIED" - Defaults to NONE. | |
| // "NONE" - Suppress envoy debug headers. | |
| // "DEBUG_HEADERS" - Envoy will insert default internal debug headers into | |
| // upstream requests: x-envoy-attempt-count, x-envoy-is-timeout-retry, | |
| // x-envoy-expected-rq-timeout-ms, x-envoy-original-path, | |
| // x-envoy-upstream-stream-duration-ms | |
| EnvoyHeaders string `json:"envoyHeaders,omitempty"` | |
| // GatewaySecurityPolicy: Optional. A fully-qualified GatewaySecurityPolicy URL | |
| // reference. Defines how a server should apply security policy to inbound (VM | |
| // to Proxy) initiated connections. For example: | |
| // `projects/*/locations/*/gatewaySecurityPolicies/swg-policy`. This policy is | |
| // specific to gateways of type 'SECURE_WEB_GATEWAY'. | |
| GatewaySecurityPolicy string `json:"gatewaySecurityPolicy,omitempty"` | |
| // IpVersion: Optional. The IP Version that will be used by this gateway. Valid | |
| // options are IPV4 or IPV6. Default is IPV4. | |
| // | |
| // Possible values: | |
| // "IP_VERSION_UNSPECIFIED" - The type when IP version is not specified. | |
| // Defaults to IPV4. | |
| // "IPV4" - The type for IP version 4. | |
| // "IPV6" - The type for IP version 6. | |
| IpVersion string `json:"ipVersion,omitempty"` | |
| // Labels: Optional. Set of label tags associated with the Gateway resource. | |
| Labels map[string]string `json:"labels,omitempty"` | |
| // Name: Identifier. Name of the Gateway resource. It matches pattern | |
| // `projects/*/locations/*/gateways/`. | |
| Name string `json:"name,omitempty"` | |
| // Network: Optional. The relative resource name identifying the VPC network | |
| // that is using this configuration. For example: | |
| // `projects/*/global/networks/network-1`. Currently, this field is specific to | |
| // gateways of type 'SECURE_WEB_GATEWAY'. | |
| Network string `json:"network,omitempty"` | |
| // Ports: Required. One or more port numbers (1-65535), on which the Gateway | |
| // will receive traffic. The proxy binds to the specified ports. Gateways of | |
| // type 'SECURE_WEB_GATEWAY' are limited to 5 ports. Gateways of type | |
| // 'OPEN_MESH' listen on 0.0.0.0 for IPv4 and :: for IPv6 and support multiple | |
| // ports. | |
| Ports []int64 `json:"ports,omitempty"` | |
| // RoutingMode: Optional. The routing mode of the Gateway. This field is | |
| // configurable only for gateways of type SECURE_WEB_GATEWAY. This field is | |
| // required for gateways of type SECURE_WEB_GATEWAY. | |
| // | |
| // Possible values: | |
| // "EXPLICIT_ROUTING_MODE" - The routing mode is explicit; clients are | |
| // configured to send traffic through the gateway. This is the default routing | |
| // mode. | |
| // "NEXT_HOP_ROUTING_MODE" - The routing mode is next-hop. Clients are | |
| // unaware of the gateway, and a route (advanced route or other route type) can | |
| // be configured to direct traffic from client to gateway. The gateway then | |
| // acts as a next-hop to the destination. | |
| RoutingMode string `json:"routingMode,omitempty"` | |
| // Scope: Optional. Scope determines how configuration across multiple Gateway | |
| // instances are merged. The configuration for multiple Gateway instances with | |
| // the same scope will be merged as presented as a single configuration to the | |
| // proxy/load balancer. Max length 64 characters. Scope should start with a | |
| // letter and can only have letters, numbers, hyphens. | |
| Scope string `json:"scope,omitempty"` | |
| // SelfLink: Output only. Server-defined URL of this resource | |
| SelfLink string `json:"selfLink,omitempty"` | |
| // ServerTlsPolicy: Optional. A fully-qualified ServerTLSPolicy URL reference. | |
| // Specifies how TLS traffic is terminated. If empty, TLS termination is | |
| // disabled. | |
| ServerTlsPolicy string `json:"serverTlsPolicy,omitempty"` | |
| // Subnetwork: Optional. The relative resource name identifying the subnetwork | |
| // in which this SWG is allocated. For example: | |
| // `projects/*/regions/us-central1/subnetworks/network-1` Currently, this field | |
| // is specific to gateways of type 'SECURE_WEB_GATEWAY". | |
| Subnetwork string `json:"subnetwork,omitempty"` | |
| // Type: Immutable. The type of the customer managed gateway. This field is | |
| // required. If unspecified, an error is returned. | |
| // | |
| // Possible values: | |
| // "TYPE_UNSPECIFIED" - The type of the customer managed gateway is | |
| // unspecified. | |
| // "OPEN_MESH" - The type of the customer managed gateway is TrafficDirector | |
| // Open Mesh. | |
| // "SECURE_WEB_GATEWAY" - The type of the customer managed gateway is | |
| // SecureWebGateway (SWG). | |
| Type string `json:"type,omitempty"` | |
| // UpdateTime: Output only. The timestamp when the resource was updated. | |
| UpdateTime string `json:"updateTime,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "Addresses") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Addresses") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s Gateway) MarshalJSON() ([]byte, error) { | |
| type NoMethod Gateway | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // GatewayRouteView: GatewayRouteView defines view-only resource for Routes to | |
| // a Gateway | |
| type GatewayRouteView struct { | |
| // Name: Output only. Identifier. Full path name of the GatewayRouteView | |
| // resource. Format: | |
| // projects/{project_number}/locations/{location}/gateways/{gateway}/routeViews/ | |
| // {route_view} | |
| Name string `json:"name,omitempty"` | |
| // RouteId: Output only. The resource id for the route. | |
| RouteId string `json:"routeId,omitempty"` | |
| // RouteLocation: Output only. Location where the route exists. | |
| RouteLocation string `json:"routeLocation,omitempty"` | |
| // RouteProjectNumber: Output only. Project number where the route exists. | |
| RouteProjectNumber int64 `json:"routeProjectNumber,omitempty,string"` | |
| // RouteType: Output only. Type of the route: HttpRoute,GrpcRoute,TcpRoute, or | |
| // TlsRoute | |
| RouteType string `json:"routeType,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "Name") to unconditionally | |
| // include in API requests. By default, fields with empty or default values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Name") to include in API requests | |
| // with the JSON null value. By default, fields with empty values are omitted | |
| // from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s GatewayRouteView) MarshalJSON() ([]byte, error) { | |
| type NoMethod GatewayRouteView | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // GrpcRoute: GrpcRoute is the resource defining how gRPC traffic routed by a | |
| // Mesh or Gateway resource is routed. | |
| type GrpcRoute struct { | |
| // CreateTime: Output only. The timestamp when the resource was created. | |
| CreateTime string `json:"createTime,omitempty"` | |
| // Description: Optional. A free-text description of the resource. Max length | |
| // 1024 characters. | |
| Description string `json:"description,omitempty"` | |
| // Gateways: Optional. Gateways defines a list of gateways this GrpcRoute is | |
| // attached to, as one of the routing rules to route the requests served by the | |
| // gateway. Each gateway reference should match the pattern: | |
| // `projects/*/locations/*/gateways/` | |
| Gateways []string `json:"gateways,omitempty"` | |
| // Hostnames: Required. Service hostnames with an optional port for which this | |
| // route describes traffic. Format: [:] Hostname is the fully qualified domain | |
| // name of a network host. This matches the RFC 1123 definition of a hostname | |
| // with 2 notable exceptions: - IPs are not allowed. - A hostname may be | |
| // prefixed with a wildcard label (`*.`). The wildcard label must appear by | |
| // itself as the first label. Hostname can be "precise" which is a domain name | |
| // without the terminating dot of a network host (e.g. `foo.example.com`) or | |
| // "wildcard", which is a domain name prefixed with a single wildcard label | |
| // (e.g. `*.example.com`). Note that as per RFC1035 and RFC1123, a label must | |
| // consist of lower case alphanumeric characters or '-', and must start and end | |
| // with an alphanumeric character. No other punctuation is allowed. The routes | |
| // associated with a Mesh or Gateway must have unique hostnames. If you attempt | |
| // to attach multiple routes with conflicting hostnames, the configuration will | |
| // be rejected. For example, while it is acceptable for routes for the | |
| // hostnames `*.foo.bar.com` and `*.bar.com` to be associated with the same | |
| // route, it is not possible to associate two routes both with `*.bar.com` or | |
| // both with `bar.com`. If a port is specified, then gRPC clients must use the | |
| // channel URI with the port to match this rule (i.e. "xds:///service:123"), | |
| // otherwise they must supply the URI without a port (i.e. "xds:///service"). | |
| Hostnames []string `json:"hostnames,omitempty"` | |
| // Labels: Optional. Set of label tags associated with the GrpcRoute resource. | |
| Labels map[string]string `json:"labels,omitempty"` | |
| // Meshes: Optional. Meshes defines a list of meshes this GrpcRoute is attached | |
| // to, as one of the routing rules to route the requests served by the mesh. | |
| // Each mesh reference should match the pattern: | |
| // `projects/*/locations/*/meshes/` | |
| Meshes []string `json:"meshes,omitempty"` | |
| // Name: Identifier. Name of the GrpcRoute resource. It matches pattern | |
| // `projects/*/locations/*/grpcRoutes/` | |
| Name string `json:"name,omitempty"` | |
| // Rules: Required. A list of detailed rules defining how to route traffic. | |
| // Within a single GrpcRoute, the GrpcRoute.RouteAction associated with the | |
| // first matching GrpcRoute.RouteRule will be executed. At least one rule must | |
| // be supplied. | |
| Rules []*GrpcRouteRouteRule `json:"rules,omitempty"` | |
| // SelfLink: Output only. Server-defined URL of this resource | |
| SelfLink string `json:"selfLink,omitempty"` | |
| // UpdateTime: Output only. The timestamp when the resource was updated. | |
| UpdateTime string `json:"updateTime,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "CreateTime") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "CreateTime") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s GrpcRoute) MarshalJSON() ([]byte, error) { | |
| type NoMethod GrpcRoute | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // GrpcRouteDestination: The destination to which traffic will be routed. | |
| type GrpcRouteDestination struct { | |
| // ServiceName: Required. The URL of a destination service to which to route | |
| // traffic. Must refer to either a BackendService or ServiceDirectoryService. | |
| ServiceName string `json:"serviceName,omitempty"` | |
| // Weight: Optional. Specifies the proportion of requests forwarded to the | |
| // backend referenced by the serviceName field. This is computed as: - | |
| // weight/Sum(weights in this destination list). For non-zero values, there may | |
| // be some epsilon from the exact proportion defined here depending on the | |
| // precision an implementation supports. If only one serviceName is specified | |
| // and it has a weight greater than 0, 100% of the traffic is forwarded to that | |
| // backend. If weights are specified for any one service name, they need to be | |
| // specified for all of them. If weights are unspecified for all services, | |
| // then, traffic is distributed in equal proportions to all of them. | |
| Weight int64 `json:"weight,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "ServiceName") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "ServiceName") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s GrpcRouteDestination) MarshalJSON() ([]byte, error) { | |
| type NoMethod GrpcRouteDestination | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // GrpcRouteFaultInjectionPolicy: The specification for fault injection | |
| // introduced into traffic to test the resiliency of clients to destination | |
| // service failure. As part of fault injection, when clients send requests to a | |
| // destination, delays can be introduced on a percentage of requests before | |
| // sending those requests to the destination service. Similarly requests from | |
| // clients can be aborted by for a percentage of requests. | |
| type GrpcRouteFaultInjectionPolicy struct { | |
| // Abort: The specification for aborting to client requests. | |
| Abort *GrpcRouteFaultInjectionPolicyAbort `json:"abort,omitempty"` | |
| // Delay: The specification for injecting delay to client requests. | |
| Delay *GrpcRouteFaultInjectionPolicyDelay `json:"delay,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "Abort") to unconditionally | |
| // include in API requests. By default, fields with empty or default values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Abort") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s GrpcRouteFaultInjectionPolicy) MarshalJSON() ([]byte, error) { | |
| type NoMethod GrpcRouteFaultInjectionPolicy | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // GrpcRouteFaultInjectionPolicyAbort: Specification of how client requests are | |
| // aborted as part of fault injection before being sent to a destination. | |
| type GrpcRouteFaultInjectionPolicyAbort struct { | |
| // HttpStatus: The HTTP status code used to abort the request. The value must | |
| // be between 200 and 599 inclusive. | |
| HttpStatus int64 `json:"httpStatus,omitempty"` | |
| // Percentage: The percentage of traffic which will be aborted. The value must | |
| // be between [0, 100] | |
| Percentage int64 `json:"percentage,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "HttpStatus") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "HttpStatus") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s GrpcRouteFaultInjectionPolicyAbort) MarshalJSON() ([]byte, error) { | |
| type NoMethod GrpcRouteFaultInjectionPolicyAbort | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // GrpcRouteFaultInjectionPolicyDelay: Specification of how client requests are | |
| // delayed as part of fault injection before being sent to a destination. | |
| type GrpcRouteFaultInjectionPolicyDelay struct { | |
| // FixedDelay: Specify a fixed delay before forwarding the request. | |
| FixedDelay string `json:"fixedDelay,omitempty"` | |
| // Percentage: The percentage of traffic on which delay will be injected. The | |
| // value must be between [0, 100] | |
| Percentage int64 `json:"percentage,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "FixedDelay") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "FixedDelay") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s GrpcRouteFaultInjectionPolicyDelay) MarshalJSON() ([]byte, error) { | |
| type NoMethod GrpcRouteFaultInjectionPolicyDelay | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // GrpcRouteHeaderMatch: A match against a collection of headers. | |
| type GrpcRouteHeaderMatch struct { | |
| // Key: Required. The key of the header. | |
| Key string `json:"key,omitempty"` | |
| // Type: Optional. Specifies how to match against the value of the header. If | |
| // not specified, a default value of EXACT is used. | |
| // | |
| // Possible values: | |
| // "TYPE_UNSPECIFIED" - Unspecified. | |
| // "EXACT" - Will only match the exact value provided. | |
| // "REGULAR_EXPRESSION" - Will match paths conforming to the prefix specified | |
| // by value. RE2 syntax is supported. | |
| Type string `json:"type,omitempty"` | |
| // Value: Required. The value of the header. | |
| Value string `json:"value,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "Key") to unconditionally | |
| // include in API requests. By default, fields with empty or default values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Key") to include in API requests | |
| // with the JSON null value. By default, fields with empty values are omitted | |
| // from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s GrpcRouteHeaderMatch) MarshalJSON() ([]byte, error) { | |
| type NoMethod GrpcRouteHeaderMatch | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // GrpcRouteMethodMatch: Specifies a match against a method. | |
| type GrpcRouteMethodMatch struct { | |
| // CaseSensitive: Optional. Specifies that matches are case sensitive. The | |
| // default value is true. case_sensitive must not be used with a type of | |
| // REGULAR_EXPRESSION. | |
| CaseSensitive bool `json:"caseSensitive,omitempty"` | |
| // GrpcMethod: Required. Name of the method to match against. If unspecified, | |
| // will match all methods. | |
| GrpcMethod string `json:"grpcMethod,omitempty"` | |
| // GrpcService: Required. Name of the service to match against. If unspecified, | |
| // will match all services. | |
| GrpcService string `json:"grpcService,omitempty"` | |
| // Type: Optional. Specifies how to match against the name. If not specified, a | |
| // default value of "EXACT" is used. | |
| // | |
| // Possible values: | |
| // "TYPE_UNSPECIFIED" - Unspecified. | |
| // "EXACT" - Will only match the exact name provided. | |
| // "REGULAR_EXPRESSION" - Will interpret grpc_method and grpc_service as | |
| // regexes. RE2 syntax is supported. | |
| Type string `json:"type,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "CaseSensitive") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "CaseSensitive") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s GrpcRouteMethodMatch) MarshalJSON() ([]byte, error) { | |
| type NoMethod GrpcRouteMethodMatch | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // GrpcRouteRetryPolicy: The specifications for retries. Specifies one or more | |
| // conditions for which this retry rule applies. Valid values are: | |
| type GrpcRouteRetryPolicy struct { | |
| // NumRetries: Specifies the allowed number of retries. This number must be > | |
| // 0. If not specified, default to 1. | |
| NumRetries int64 `json:"numRetries,omitempty"` | |
| // RetryConditions: - connect-failure: Router will retry on failures connecting | |
| // to Backend Services, for example due to connection timeouts. - | |
| // refused-stream: Router will retry if the backend service resets the stream | |
| // with a REFUSED_STREAM error code. This reset type indicates that it is safe | |
| // to retry. - cancelled: Router will retry if the gRPC status code in the | |
| // response header is set to cancelled - deadline-exceeded: Router will retry | |
| // if the gRPC status code in the response header is set to deadline-exceeded - | |
| // resource-exhausted: Router will retry if the gRPC status code in the | |
| // response header is set to resource-exhausted - unavailable: Router will | |
| // retry if the gRPC status code in the response header is set to unavailable | |
| RetryConditions []string `json:"retryConditions,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "NumRetries") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "NumRetries") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s GrpcRouteRetryPolicy) MarshalJSON() ([]byte, error) { | |
| type NoMethod GrpcRouteRetryPolicy | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // GrpcRouteRouteAction: Specifies how to route matched traffic. | |
| type GrpcRouteRouteAction struct { | |
| // Destinations: Optional. The destination services to which traffic should be | |
| // forwarded. If multiple destinations are specified, traffic will be split | |
| // between Backend Service(s) according to the weight field of these | |
| // destinations. | |
| Destinations []*GrpcRouteDestination `json:"destinations,omitempty"` | |
| // FaultInjectionPolicy: Optional. The specification for fault injection | |
| // introduced into traffic to test the resiliency of clients to destination | |
| // service failure. As part of fault injection, when clients send requests to a | |
| // destination, delays can be introduced on a percentage of requests before | |
| // sending those requests to the destination service. Similarly requests from | |
| // clients can be aborted by for a percentage of requests. timeout and | |
| // retry_policy will be ignored by clients that are configured with a | |
| // fault_injection_policy | |
| FaultInjectionPolicy *GrpcRouteFaultInjectionPolicy `json:"faultInjectionPolicy,omitempty"` | |
| // IdleTimeout: Optional. Specifies the idle timeout for the selected route. | |
| // The idle timeout is defined as the period in which there are no bytes sent | |
| // or received on either the upstream or downstream connection. If not set, the | |
| // default idle timeout is 1 hour. If set to 0s, the timeout will be disabled. | |
| IdleTimeout string `json:"idleTimeout,omitempty"` | |
| // RetryPolicy: Optional. Specifies the retry policy associated with this | |
| // route. | |
| RetryPolicy *GrpcRouteRetryPolicy `json:"retryPolicy,omitempty"` | |
| // StatefulSessionAffinity: Optional. Specifies cookie-based stateful session | |
| // affinity. | |
| StatefulSessionAffinity *GrpcRouteStatefulSessionAffinityPolicy `json:"statefulSessionAffinity,omitempty"` | |
| // Timeout: Optional. Specifies the timeout for selected route. Timeout is | |
| // computed from the time the request has been fully processed (i.e. end of | |
| // stream) up until the response has been completely processed. Timeout | |
| // includes all retries. | |
| Timeout string `json:"timeout,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "Destinations") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Destinations") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s GrpcRouteRouteAction) MarshalJSON() ([]byte, error) { | |
| type NoMethod GrpcRouteRouteAction | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // GrpcRouteRouteMatch: Criteria for matching traffic. A RouteMatch will be | |
| // considered to match when all supplied fields match. | |
| type GrpcRouteRouteMatch struct { | |
| // Headers: Optional. Specifies a collection of headers to match. | |
| Headers []*GrpcRouteHeaderMatch `json:"headers,omitempty"` | |
| // Method: Optional. A gRPC method to match against. If this field is empty or | |
| // omitted, will match all methods. | |
| Method *GrpcRouteMethodMatch `json:"method,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "Headers") to unconditionally | |
| // include in API requests. By default, fields with empty or default values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Headers") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s GrpcRouteRouteMatch) MarshalJSON() ([]byte, error) { | |
| type NoMethod GrpcRouteRouteMatch | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // GrpcRouteRouteRule: Describes how to route traffic. | |
| type GrpcRouteRouteRule struct { | |
| // Action: Required. A detailed rule defining how to route traffic. This field | |
| // is required. | |
| Action *GrpcRouteRouteAction `json:"action,omitempty"` | |
| // Matches: Optional. Matches define conditions used for matching the rule | |
| // against incoming gRPC requests. Each match is independent, i.e. this rule | |
| // will be matched if ANY one of the matches is satisfied. If no matches field | |
| // is specified, this rule will unconditionally match traffic. | |
| Matches []*GrpcRouteRouteMatch `json:"matches,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "Action") to unconditionally | |
| // include in API requests. By default, fields with empty or default values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Action") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s GrpcRouteRouteRule) MarshalJSON() ([]byte, error) { | |
| type NoMethod GrpcRouteRouteRule | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // GrpcRouteStatefulSessionAffinityPolicy: The specification for cookie-based | |
| // stateful session affinity where the date plane supplies a “session | |
| // cookie” with the name "GSSA" which encodes a specific destination host and | |
| // each request containing that cookie will be directed to that host as long as | |
| // the destination host remains up and healthy. The gRPC proxyless mesh library | |
| // or sidecar proxy will manage the session cookie but the client application | |
| // code is responsible for copying the cookie from each RPC in the session to | |
| // the next. | |
| type GrpcRouteStatefulSessionAffinityPolicy struct { | |
| // CookieTtl: Required. The cookie TTL value for the Set-Cookie header | |
| // generated by the data plane. The lifetime of the cookie may be set to a | |
| // value from 0 to 86400 seconds (24 hours) inclusive. Set this to 0s to use a | |
| // session cookie and disable cookie expiration. | |
| CookieTtl string `json:"cookieTtl,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "CookieTtl") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "CookieTtl") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s GrpcRouteStatefulSessionAffinityPolicy) MarshalJSON() ([]byte, error) { | |
| type NoMethod GrpcRouteStatefulSessionAffinityPolicy | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // HttpRoute: HttpRoute is the resource defining how HTTP traffic should be | |
| // routed by a Mesh or Gateway resource. | |
| type HttpRoute struct { | |
| // CreateTime: Output only. The timestamp when the resource was created. | |
| CreateTime string `json:"createTime,omitempty"` | |
| // Description: Optional. A free-text description of the resource. Max length | |
| // 1024 characters. | |
| Description string `json:"description,omitempty"` | |
| // Gateways: Optional. Gateways defines a list of gateways this HttpRoute is | |
| // attached to, as one of the routing rules to route the requests served by the | |
| // gateway. Each gateway reference should match the pattern: | |
| // `projects/*/locations/*/gateways/` | |
| Gateways []string `json:"gateways,omitempty"` | |
| // Hostnames: Required. Hostnames define a set of hosts that should match | |
| // against the HTTP host header to select a HttpRoute to process the request. | |
| // Hostname is the fully qualified domain name of a network host, as defined by | |
| // RFC 1123 with the exception that: - IPs are not allowed. - A hostname may be | |
| // prefixed with a wildcard label (`*.`). The wildcard label must appear by | |
| // itself as the first label. Hostname can be "precise" which is a domain name | |
| // without the terminating dot of a network host (e.g. `foo.example.com`) or | |
| // "wildcard", which is a domain name prefixed with a single wildcard label | |
| // (e.g. `*.example.com`). Note that as per RFC1035 and RFC1123, a label must | |
| // consist of lower case alphanumeric characters or '-', and must start and end | |
| // with an alphanumeric character. No other punctuation is allowed. The routes | |
| // associated with a Mesh or Gateways must have unique hostnames. If you | |
| // attempt to attach multiple routes with conflicting hostnames, the | |
| // configuration will be rejected. For example, while it is acceptable for | |
| // routes for the hostnames `*.foo.bar.com` and `*.bar.com` to be associated | |
| // with the same Mesh (or Gateways under the same scope), it is not possible to | |
| // associate two routes both with `*.bar.com` or both with `bar.com`. | |
| Hostnames []string `json:"hostnames,omitempty"` | |
| // Labels: Optional. Set of label tags associated with the HttpRoute resource. | |
| Labels map[string]string `json:"labels,omitempty"` | |
| // Meshes: Optional. Meshes defines a list of meshes this HttpRoute is attached | |
| // to, as one of the routing rules to route the requests served by the mesh. | |
| // Each mesh reference should match the pattern: | |
| // `projects/*/locations/*/meshes/` The attached Mesh should be of a type | |
| // SIDECAR | |
| Meshes []string `json:"meshes,omitempty"` | |
| // Name: Identifier. Name of the HttpRoute resource. It matches pattern | |
| // `projects/*/locations/*/httpRoutes/http_route_name>`. | |
| Name string `json:"name,omitempty"` | |
| // Rules: Required. Rules that define how traffic is routed and handled. Rules | |
| // will be matched sequentially based on the RouteMatch specified for the rule. | |
| Rules []*HttpRouteRouteRule `json:"rules,omitempty"` | |
| // SelfLink: Output only. Server-defined URL of this resource | |
| SelfLink string `json:"selfLink,omitempty"` | |
| // UpdateTime: Output only. The timestamp when the resource was updated. | |
| UpdateTime string `json:"updateTime,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "CreateTime") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "CreateTime") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s HttpRoute) MarshalJSON() ([]byte, error) { | |
| type NoMethod HttpRoute | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // HttpRouteCorsPolicy: The Specification for allowing client side cross-origin | |
| // requests. | |
| type HttpRouteCorsPolicy struct { | |
| // AllowCredentials: In response to a preflight request, setting this to true | |
| // indicates that the actual request can include user credentials. This | |
| // translates to the Access-Control-Allow-Credentials header. Default value is | |
| // false. | |
| AllowCredentials bool `json:"allowCredentials,omitempty"` | |
| // AllowHeaders: Specifies the content for Access-Control-Allow-Headers header. | |
| AllowHeaders []string `json:"allowHeaders,omitempty"` | |
| // AllowMethods: Specifies the content for Access-Control-Allow-Methods header. | |
| AllowMethods []string `json:"allowMethods,omitempty"` | |
| // AllowOriginRegexes: Specifies the regular expression patterns that match | |
| // allowed origins. For regular expression grammar, please see | |
| // https://github.com/google/re2/wiki/Syntax. | |
| AllowOriginRegexes []string `json:"allowOriginRegexes,omitempty"` | |
| // AllowOrigins: Specifies the list of origins that will be allowed to do CORS | |
| // requests. An origin is allowed if it matches either an item in allow_origins | |
| // or an item in allow_origin_regexes. | |
| AllowOrigins []string `json:"allowOrigins,omitempty"` | |
| // Disabled: If true, the CORS policy is disabled. The default value is false, | |
| // which indicates that the CORS policy is in effect. | |
| Disabled bool `json:"disabled,omitempty"` | |
| // ExposeHeaders: Specifies the content for Access-Control-Expose-Headers | |
| // header. | |
| ExposeHeaders []string `json:"exposeHeaders,omitempty"` | |
| // MaxAge: Specifies how long result of a preflight request can be cached in | |
| // seconds. This translates to the Access-Control-Max-Age header. | |
| MaxAge string `json:"maxAge,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "AllowCredentials") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "AllowCredentials") to include in | |
| // API requests with the JSON null value. By default, fields with empty values | |
| // are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s HttpRouteCorsPolicy) MarshalJSON() ([]byte, error) { | |
| type NoMethod HttpRouteCorsPolicy | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // HttpRouteDestination: Specifications of a destination to which the request | |
| // should be routed to. | |
| type HttpRouteDestination struct { | |
| // RequestHeaderModifier: Optional. The specification for modifying the headers | |
| // of a matching request prior to delivery of the request to the destination. | |
| // If HeaderModifiers are set on both the Destination and the RouteAction, they | |
| // will be merged. Conflicts between the two will not be resolved on the | |
| // configuration. | |
| RequestHeaderModifier *HttpRouteHeaderModifier `json:"requestHeaderModifier,omitempty"` | |
| // ResponseHeaderModifier: Optional. The specification for modifying the | |
| // headers of a response prior to sending the response back to the client. If | |
| // HeaderModifiers are set on both the Destination and the RouteAction, they | |
| // will be merged. Conflicts between the two will not be resolved on the | |
| // configuration. | |
| ResponseHeaderModifier *HttpRouteHeaderModifier `json:"responseHeaderModifier,omitempty"` | |
| // ServiceName: The URL of a BackendService to route traffic to. | |
| ServiceName string `json:"serviceName,omitempty"` | |
| // Weight: Specifies the proportion of requests forwarded to the backend | |
| // referenced by the serviceName field. This is computed as: - | |
| // weight/Sum(weights in this destination list). For non-zero values, there may | |
| // be some epsilon from the exact proportion defined here depending on the | |
| // precision an implementation supports. If only one serviceName is specified | |
| // and it has a weight greater than 0, 100% of the traffic is forwarded to that | |
| // backend. If weights are specified for any one service name, they need to be | |
| // specified for all of them. If weights are unspecified for all services, | |
| // then, traffic is distributed in equal proportions to all of them. | |
| Weight int64 `json:"weight,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "RequestHeaderModifier") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "RequestHeaderModifier") to | |
| // include in API requests with the JSON null value. By default, fields with | |
| // empty values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s HttpRouteDestination) MarshalJSON() ([]byte, error) { | |
| type NoMethod HttpRouteDestination | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // HttpRouteFaultInjectionPolicy: The specification for fault injection | |
| // introduced into traffic to test the resiliency of clients to destination | |
| // service failure. As part of fault injection, when clients send requests to a | |
| // destination, delays can be introduced by client proxy on a percentage of | |
| // requests before sending those requests to the destination service. Similarly | |
| // requests can be aborted by client proxy for a percentage of requests. | |
| type HttpRouteFaultInjectionPolicy struct { | |
| // Abort: The specification for aborting to client requests. | |
| Abort *HttpRouteFaultInjectionPolicyAbort `json:"abort,omitempty"` | |
| // Delay: The specification for injecting delay to client requests. | |
| Delay *HttpRouteFaultInjectionPolicyDelay `json:"delay,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "Abort") to unconditionally | |
| // include in API requests. By default, fields with empty or default values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Abort") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s HttpRouteFaultInjectionPolicy) MarshalJSON() ([]byte, error) { | |
| type NoMethod HttpRouteFaultInjectionPolicy | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // HttpRouteFaultInjectionPolicyAbort: Specification of how client requests are | |
| // aborted as part of fault injection before being sent to a destination. | |
| type HttpRouteFaultInjectionPolicyAbort struct { | |
| // HttpStatus: The HTTP status code used to abort the request. The value must | |
| // be between 200 and 599 inclusive. | |
| HttpStatus int64 `json:"httpStatus,omitempty"` | |
| // Percentage: The percentage of traffic which will be aborted. The value must | |
| // be between [0, 100] | |
| Percentage int64 `json:"percentage,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "HttpStatus") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "HttpStatus") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s HttpRouteFaultInjectionPolicyAbort) MarshalJSON() ([]byte, error) { | |
| type NoMethod HttpRouteFaultInjectionPolicyAbort | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // HttpRouteFaultInjectionPolicyDelay: Specification of how client requests are | |
| // delayed as part of fault injection before being sent to a destination. | |
| type HttpRouteFaultInjectionPolicyDelay struct { | |
| // FixedDelay: Specify a fixed delay before forwarding the request. | |
| FixedDelay string `json:"fixedDelay,omitempty"` | |
| // Percentage: The percentage of traffic on which delay will be injected. The | |
| // value must be between [0, 100] | |
| Percentage int64 `json:"percentage,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "FixedDelay") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "FixedDelay") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s HttpRouteFaultInjectionPolicyDelay) MarshalJSON() ([]byte, error) { | |
| type NoMethod HttpRouteFaultInjectionPolicyDelay | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // HttpRouteHeaderMatch: Specifies how to select a route rule based on HTTP | |
| // request headers. | |
| type HttpRouteHeaderMatch struct { | |
| // ExactMatch: The value of the header should match exactly the content of | |
| // exact_match. | |
| ExactMatch string `json:"exactMatch,omitempty"` | |
| // Header: The name of the HTTP header to match against. | |
| Header string `json:"header,omitempty"` | |
| // InvertMatch: If specified, the match result will be inverted before | |
| // checking. Default value is set to false. | |
| InvertMatch bool `json:"invertMatch,omitempty"` | |
| // PrefixMatch: The value of the header must start with the contents of | |
| // prefix_match. | |
| PrefixMatch string `json:"prefixMatch,omitempty"` | |
| // PresentMatch: A header with header_name must exist. The match takes place | |
| // whether or not the header has a value. | |
| PresentMatch bool `json:"presentMatch,omitempty"` | |
| // RangeMatch: If specified, the rule will match if the request header value is | |
| // within the range. | |
| RangeMatch *HttpRouteHeaderMatchIntegerRange `json:"rangeMatch,omitempty"` | |
| // RegexMatch: The value of the header must match the regular expression | |
| // specified in regex_match. For regular expression grammar, please see: | |
| // https://github.com/google/re2/wiki/Syntax | |
| RegexMatch string `json:"regexMatch,omitempty"` | |
| // SuffixMatch: The value of the header must end with the contents of | |
| // suffix_match. | |
| SuffixMatch string `json:"suffixMatch,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "ExactMatch") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "ExactMatch") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s HttpRouteHeaderMatch) MarshalJSON() ([]byte, error) { | |
| type NoMethod HttpRouteHeaderMatch | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // HttpRouteHeaderMatchIntegerRange: Represents an integer value range. | |
| type HttpRouteHeaderMatchIntegerRange struct { | |
| // End: End of the range (exclusive) | |
| End int64 `json:"end,omitempty"` | |
| // Start: Start of the range (inclusive) | |
| Start int64 `json:"start,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "End") to unconditionally | |
| // include in API requests. By default, fields with empty or default values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "End") to include in API requests | |
| // with the JSON null value. By default, fields with empty values are omitted | |
| // from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s HttpRouteHeaderMatchIntegerRange) MarshalJSON() ([]byte, error) { | |
| type NoMethod HttpRouteHeaderMatchIntegerRange | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // HttpRouteHeaderModifier: The specification for modifying HTTP header in HTTP | |
| // request and HTTP response. | |
| type HttpRouteHeaderModifier struct { | |
| // Add: Add the headers with given map where key is the name of the header, | |
| // value is the value of the header. | |
| Add map[string]string `json:"add,omitempty"` | |
| // Remove: Remove headers (matching by header names) specified in the list. | |
| Remove []string `json:"remove,omitempty"` | |
| // Set: Completely overwrite/replace the headers with given map where key is | |
| // the name of the header, value is the value of the header. | |
| Set map[string]string `json:"set,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "Add") to unconditionally | |
| // include in API requests. By default, fields with empty or default values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Add") to include in API requests | |
| // with the JSON null value. By default, fields with empty values are omitted | |
| // from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s HttpRouteHeaderModifier) MarshalJSON() ([]byte, error) { | |
| type NoMethod HttpRouteHeaderModifier | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // HttpRouteHttpDirectResponse: Static HTTP response object to be returned. | |
| type HttpRouteHttpDirectResponse struct { | |
| // BytesBody: Optional. Response body as bytes. Maximum body size is 4096B. | |
| BytesBody string `json:"bytesBody,omitempty"` | |
| // Status: Required. Status to return as part of HTTP Response. Must be a | |
| // positive integer. | |
| Status int64 `json:"status,omitempty"` | |
| // StringBody: Optional. Response body as a string. Maximum body length is 1024 | |
| // characters. | |
| StringBody string `json:"stringBody,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "BytesBody") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "BytesBody") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s HttpRouteHttpDirectResponse) MarshalJSON() ([]byte, error) { | |
| type NoMethod HttpRouteHttpDirectResponse | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // HttpRouteQueryParameterMatch: Specifications to match a query parameter in | |
| // the request. | |
| type HttpRouteQueryParameterMatch struct { | |
| // ExactMatch: The value of the query parameter must exactly match the contents | |
| // of exact_match. Only one of exact_match, regex_match, or present_match must | |
| // be set. | |
| ExactMatch string `json:"exactMatch,omitempty"` | |
| // PresentMatch: Specifies that the QueryParameterMatcher matches if request | |
| // contains query parameter, irrespective of whether the parameter has a value | |
| // or not. Only one of exact_match, regex_match, or present_match must be set. | |
| PresentMatch bool `json:"presentMatch,omitempty"` | |
| // QueryParameter: The name of the query parameter to match. | |
| QueryParameter string `json:"queryParameter,omitempty"` | |
| // RegexMatch: The value of the query parameter must match the regular | |
| // expression specified by regex_match. For regular expression grammar, please | |
| // see https://github.com/google/re2/wiki/Syntax Only one of exact_match, | |
| // regex_match, or present_match must be set. | |
| RegexMatch string `json:"regexMatch,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "ExactMatch") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "ExactMatch") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s HttpRouteQueryParameterMatch) MarshalJSON() ([]byte, error) { | |
| type NoMethod HttpRouteQueryParameterMatch | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // HttpRouteRedirect: The specification for redirecting traffic. | |
| type HttpRouteRedirect struct { | |
| // HostRedirect: The host that will be used in the redirect response instead of | |
| // the one that was supplied in the request. | |
| HostRedirect string `json:"hostRedirect,omitempty"` | |
| // HttpsRedirect: If set to true, the URL scheme in the redirected request is | |
| // set to https. If set to false, the URL scheme of the redirected request will | |
| // remain the same as that of the request. The default is set to false. | |
| HttpsRedirect bool `json:"httpsRedirect,omitempty"` | |
| // PathRedirect: The path that will be used in the redirect response instead of | |
| // the one that was supplied in the request. path_redirect can not be supplied | |
| // together with prefix_redirect. Supply one alone or neither. If neither is | |
| // supplied, the path of the original request will be used for the redirect. | |
| PathRedirect string `json:"pathRedirect,omitempty"` | |
| // PortRedirect: The port that will be used in the redirected request instead | |
| // of the one that was supplied in the request. | |
| PortRedirect int64 `json:"portRedirect,omitempty"` | |
| // PrefixRewrite: Indicates that during redirection, the matched prefix (or | |
| // path) should be swapped with this value. This option allows URLs be | |
| // dynamically created based on the request. | |
| PrefixRewrite string `json:"prefixRewrite,omitempty"` | |
| // ResponseCode: The HTTP Status code to use for the redirect. | |
| // | |
| // Possible values: | |
| // "RESPONSE_CODE_UNSPECIFIED" - Default value | |
| // "MOVED_PERMANENTLY_DEFAULT" - Corresponds to 301. | |
| // "FOUND" - Corresponds to 302. | |
| // "SEE_OTHER" - Corresponds to 303. | |
| // "TEMPORARY_REDIRECT" - Corresponds to 307. In this case, the request | |
| // method will be retained. | |
| // "PERMANENT_REDIRECT" - Corresponds to 308. In this case, the request | |
| // method will be retained. | |
| ResponseCode string `json:"responseCode,omitempty"` | |
| // StripQuery: if set to true, any accompanying query portion of the original | |
| // URL is removed prior to redirecting the request. If set to false, the query | |
| // portion of the original URL is retained. The default is set to false. | |
| StripQuery bool `json:"stripQuery,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "HostRedirect") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "HostRedirect") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s HttpRouteRedirect) MarshalJSON() ([]byte, error) { | |
| type NoMethod HttpRouteRedirect | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // HttpRouteRequestMirrorPolicy: Specifies the policy on how requests are | |
| // shadowed to a separate mirrored destination service. The proxy does not wait | |
| // for responses from the shadow service. Prior to sending traffic to the | |
| // shadow service, the host/authority header is suffixed with -shadow. | |
| // Mirroring is currently not supported for Cloud Run destinations. | |
| type HttpRouteRequestMirrorPolicy struct { | |
| // Destination: The destination the requests will be mirrored to. The weight of | |
| // the destination will be ignored. | |
| Destination *HttpRouteDestination `json:"destination,omitempty"` | |
| // MirrorPercent: Optional. The percentage of requests to get mirrored to the | |
| // desired destination. | |
| MirrorPercent float64 `json:"mirrorPercent,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "Destination") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Destination") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s HttpRouteRequestMirrorPolicy) MarshalJSON() ([]byte, error) { | |
| type NoMethod HttpRouteRequestMirrorPolicy | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| func (s *HttpRouteRequestMirrorPolicy) UnmarshalJSON(data []byte) error { | |
| type NoMethod HttpRouteRequestMirrorPolicy | |
| var s1 struct { | |
| MirrorPercent gensupport.JSONFloat64 `json:"mirrorPercent"` | |
| *NoMethod | |
| } | |
| s1.NoMethod = (*NoMethod)(s) | |
| if err := json.Unmarshal(data, &s1); err != nil { | |
| return err | |
| } | |
| s.MirrorPercent = float64(s1.MirrorPercent) | |
| return nil | |
| } | |
| // HttpRouteRetryPolicy: The specifications for retries. | |
| type HttpRouteRetryPolicy struct { | |
| // NumRetries: Specifies the allowed number of retries. This number must be > | |
| // 0. If not specified, default to 1. | |
| NumRetries int64 `json:"numRetries,omitempty"` | |
| // PerTryTimeout: Specifies a non-zero timeout per retry attempt. | |
| PerTryTimeout string `json:"perTryTimeout,omitempty"` | |
| // RetryConditions: Specifies one or more conditions when this retry policy | |
| // applies. Valid values are: 5xx: Proxy will attempt a retry if the | |
| // destination service responds with any 5xx response code, of if the | |
| // destination service does not respond at all, example: disconnect, reset, | |
| // read timeout, connection failure and refused streams. gateway-error: Similar | |
| // to 5xx, but only applies to response codes 502, 503, 504. reset: Proxy will | |
| // attempt a retry if the destination service does not respond at all | |
| // (disconnect/reset/read timeout) connect-failure: Proxy will retry on | |
| // failures connecting to destination for example due to connection timeouts. | |
| // retriable-4xx: Proxy will retry fro retriable 4xx response codes. Currently | |
| // the only retriable error supported is 409. refused-stream: Proxy will retry | |
| // if the destination resets the stream with a REFUSED_STREAM error code. This | |
| // reset type indicates that it is safe to retry. | |
| RetryConditions []string `json:"retryConditions,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "NumRetries") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "NumRetries") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s HttpRouteRetryPolicy) MarshalJSON() ([]byte, error) { | |
| type NoMethod HttpRouteRetryPolicy | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // HttpRouteRouteAction: The specifications for routing traffic and applying | |
| // associated policies. | |
| type HttpRouteRouteAction struct { | |
| // CorsPolicy: The specification for allowing client side cross-origin | |
| // requests. | |
| CorsPolicy *HttpRouteCorsPolicy `json:"corsPolicy,omitempty"` | |
| // Destinations: The destination to which traffic should be forwarded. | |
| Destinations []*HttpRouteDestination `json:"destinations,omitempty"` | |
| // DirectResponse: Optional. Static HTTP Response object to be returned | |
| // regardless of the request. | |
| DirectResponse *HttpRouteHttpDirectResponse `json:"directResponse,omitempty"` | |
| // FaultInjectionPolicy: The specification for fault injection introduced into | |
| // traffic to test the resiliency of clients to backend service failure. As | |
| // part of fault injection, when clients send requests to a backend service, | |
| // delays can be introduced on a percentage of requests before sending those | |
| // requests to the backend service. Similarly requests from clients can be | |
| // aborted for a percentage of requests. timeout and retry_policy will be | |
| // ignored by clients that are configured with a fault_injection_policy | |
| FaultInjectionPolicy *HttpRouteFaultInjectionPolicy `json:"faultInjectionPolicy,omitempty"` | |
| // IdleTimeout: Optional. Specifies the idle timeout for the selected route. | |
| // The idle timeout is defined as the period in which there are no bytes sent | |
| // or received on either the upstream or downstream connection. If not set, the | |
| // default idle timeout is 1 hour. If set to 0s, the timeout will be disabled. | |
| IdleTimeout string `json:"idleTimeout,omitempty"` | |
| // Redirect: If set, the request is directed as configured by this field. | |
| Redirect *HttpRouteRedirect `json:"redirect,omitempty"` | |
| // RequestHeaderModifier: The specification for modifying the headers of a | |
| // matching request prior to delivery of the request to the destination. If | |
| // HeaderModifiers are set on both the Destination and the RouteAction, they | |
| // will be merged. Conflicts between the two will not be resolved on the | |
| // configuration. | |
| RequestHeaderModifier *HttpRouteHeaderModifier `json:"requestHeaderModifier,omitempty"` | |
| // RequestMirrorPolicy: Specifies the policy on how requests intended for the | |
| // routes destination are shadowed to a separate mirrored destination. Proxy | |
| // will not wait for the shadow destination to respond before returning the | |
| // response. Prior to sending traffic to the shadow service, the host/authority | |
| // header is suffixed with -shadow. | |
| RequestMirrorPolicy *HttpRouteRequestMirrorPolicy `json:"requestMirrorPolicy,omitempty"` | |
| // ResponseHeaderModifier: The specification for modifying the headers of a | |
| // response prior to sending the response back to the client. If | |
| // HeaderModifiers are set on both the Destination and the RouteAction, they | |
| // will be merged. Conflicts between the two will not be resolved on the | |
| // configuration. | |
| ResponseHeaderModifier *HttpRouteHeaderModifier `json:"responseHeaderModifier,omitempty"` | |
| // RetryPolicy: Specifies the retry policy associated with this route. | |
| RetryPolicy *HttpRouteRetryPolicy `json:"retryPolicy,omitempty"` | |
| // StatefulSessionAffinity: Optional. Specifies cookie-based stateful session | |
| // affinity. | |
| StatefulSessionAffinity *HttpRouteStatefulSessionAffinityPolicy `json:"statefulSessionAffinity,omitempty"` | |
| // Timeout: Specifies the timeout for selected route. Timeout is computed from | |
| // the time the request has been fully processed (i.e. end of stream) up until | |
| // the response has been completely processed. Timeout includes all retries. | |
| Timeout string `json:"timeout,omitempty"` | |
| // UrlRewrite: The specification for rewrite URL before forwarding requests to | |
| // the destination. | |
| UrlRewrite *HttpRouteURLRewrite `json:"urlRewrite,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "CorsPolicy") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "CorsPolicy") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s HttpRouteRouteAction) MarshalJSON() ([]byte, error) { | |
| type NoMethod HttpRouteRouteAction | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // HttpRouteRouteMatch: RouteMatch defines specifications used to match | |
| // requests. If multiple match types are set, this RouteMatch will match if ALL | |
| // type of matches are matched. | |
| type HttpRouteRouteMatch struct { | |
| // FullPathMatch: The HTTP request path value should exactly match this value. | |
| // Only one of full_path_match, prefix_match, or regex_match should be used. | |
| FullPathMatch string `json:"fullPathMatch,omitempty"` | |
| // Headers: Specifies a list of HTTP request headers to match against. ALL of | |
| // the supplied headers must be matched. | |
| Headers []*HttpRouteHeaderMatch `json:"headers,omitempty"` | |
| // IgnoreCase: Specifies if prefix_match and full_path_match matches are case | |
| // sensitive. The default value is false. | |
| IgnoreCase bool `json:"ignoreCase,omitempty"` | |
| // PrefixMatch: The HTTP request path value must begin with specified | |
| // prefix_match. prefix_match must begin with a /. Only one of full_path_match, | |
| // prefix_match, or regex_match should be used. | |
| PrefixMatch string `json:"prefixMatch,omitempty"` | |
| // QueryParameters: Specifies a list of query parameters to match against. ALL | |
| // of the query parameters must be matched. | |
| QueryParameters []*HttpRouteQueryParameterMatch `json:"queryParameters,omitempty"` | |
| // RegexMatch: The HTTP request path value must satisfy the regular expression | |
| // specified by regex_match after removing any query parameters and anchor | |
| // supplied with the original URL. For regular expression grammar, please see | |
| // https://github.com/google/re2/wiki/Syntax Only one of full_path_match, | |
| // prefix_match, or regex_match should be used. | |
| RegexMatch string `json:"regexMatch,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "FullPathMatch") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "FullPathMatch") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s HttpRouteRouteMatch) MarshalJSON() ([]byte, error) { | |
| type NoMethod HttpRouteRouteMatch | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // HttpRouteRouteRule: Specifies how to match traffic and how to route traffic | |
| // when traffic is matched. | |
| type HttpRouteRouteRule struct { | |
| // Action: The detailed rule defining how to route matched traffic. | |
| Action *HttpRouteRouteAction `json:"action,omitempty"` | |
| // Matches: A list of matches define conditions used for matching the rule | |
| // against incoming HTTP requests. Each match is independent, i.e. this rule | |
| // will be matched if ANY one of the matches is satisfied. If no matches field | |
| // is specified, this rule will unconditionally match traffic. If a default | |
| // rule is desired to be configured, add a rule with no matches specified to | |
| // the end of the rules list. | |
| Matches []*HttpRouteRouteMatch `json:"matches,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "Action") to unconditionally | |
| // include in API requests. By default, fields with empty or default values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Action") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s HttpRouteRouteRule) MarshalJSON() ([]byte, error) { | |
| type NoMethod HttpRouteRouteRule | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // HttpRouteStatefulSessionAffinityPolicy: The specification for cookie-based | |
| // stateful session affinity where the date plane supplies a “session | |
| // cookie” with the name "GSSA" which encodes a specific destination host and | |
| // each request containing that cookie will be directed to that host as long as | |
| // the destination host remains up and healthy. The gRPC proxyless mesh library | |
| // or sidecar proxy will manage the session cookie but the client application | |
| // code is responsible for copying the cookie from each RPC in the session to | |
| // the next. | |
| type HttpRouteStatefulSessionAffinityPolicy struct { | |
| // CookieTtl: Required. The cookie TTL value for the Set-Cookie header | |
| // generated by the data plane. The lifetime of the cookie may be set to a | |
| // value from 0 to 86400 seconds (24 hours) inclusive. Set this to 0s to use a | |
| // session cookie and disable cookie expiration. | |
| CookieTtl string `json:"cookieTtl,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "CookieTtl") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "CookieTtl") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s HttpRouteStatefulSessionAffinityPolicy) MarshalJSON() ([]byte, error) { | |
| type NoMethod HttpRouteStatefulSessionAffinityPolicy | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // HttpRouteURLRewrite: The specification for modifying the URL of the request, | |
| // prior to forwarding the request to the destination. | |
| type HttpRouteURLRewrite struct { | |
| // HostRewrite: Prior to forwarding the request to the selected destination, | |
| // the requests host header is replaced by this value. | |
| HostRewrite string `json:"hostRewrite,omitempty"` | |
| // PathPrefixRewrite: Prior to forwarding the request to the selected | |
| // destination, the matching portion of the requests path is replaced by this | |
| // value. | |
| PathPrefixRewrite string `json:"pathPrefixRewrite,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "HostRewrite") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "HostRewrite") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s HttpRouteURLRewrite) MarshalJSON() ([]byte, error) { | |
| type NoMethod HttpRouteURLRewrite | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // LbEdgeExtension: `LbEdgeExtension` is a resource that lets the extension | |
| // service influence the selection of backend services and Cloud CDN cache keys | |
| // by modifying request headers. | |
| type LbEdgeExtension struct { | |
| // CreateTime: Output only. The timestamp when the resource was created. | |
| CreateTime string `json:"createTime,omitempty"` | |
| // Description: Optional. A human-readable description of the resource. | |
| Description string `json:"description,omitempty"` | |
| // ExtensionChains: Required. A set of ordered extension chains that contain | |
| // the match conditions and extensions to execute. Match conditions for each | |
| // extension chain are evaluated in sequence for a given request. The first | |
| // extension chain that has a condition that matches the request is executed. | |
| // Any subsequent extension chains do not execute. Limited to 5 extension | |
| // chains per resource. | |
| ExtensionChains []*ExtensionChain `json:"extensionChains,omitempty"` | |
| // ForwardingRules: Required. A list of references to the forwarding rules to | |
| // which this service extension is attached. At least one forwarding rule is | |
| // required. Only one `LbEdgeExtension` resource can be associated with a | |
| // forwarding rule. | |
| ForwardingRules []string `json:"forwardingRules,omitempty"` | |
| // Labels: Optional. Set of labels associated with the `LbEdgeExtension` | |
| // resource. The format must comply with the requirements for labels | |
| // (https://cloud.google.com/compute/docs/labeling-resources#requirements) for | |
| // Google Cloud resources. | |
| Labels map[string]string `json:"labels,omitempty"` | |
| // LoadBalancingScheme: Required. All forwarding rules referenced by this | |
| // extension must share the same load balancing scheme. Supported values: | |
| // `EXTERNAL_MANAGED`. | |
| // | |
| // Possible values: | |
| // "LOAD_BALANCING_SCHEME_UNSPECIFIED" - Default value. Do not use. | |
| // "INTERNAL_MANAGED" - Signifies that this is used for Internal HTTP(S) Load | |
| // Balancing. | |
| // "EXTERNAL_MANAGED" - Signifies that this is used for External Managed | |
| // HTTP(S) Load Balancing. | |
| LoadBalancingScheme string `json:"loadBalancingScheme,omitempty"` | |
| // Name: Required. Identifier. Name of the `LbEdgeExtension` resource in the | |
| // following format: | |
| // `projects/{project}/locations/{location}/lbEdgeExtensions/{lb_edge_extension} | |
| // `. | |
| Name string `json:"name,omitempty"` | |
| // UpdateTime: Output only. The timestamp when the resource was updated. | |
| UpdateTime string `json:"updateTime,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "CreateTime") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "CreateTime") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s LbEdgeExtension) MarshalJSON() ([]byte, error) { | |
| type NoMethod LbEdgeExtension | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // LbRouteExtension: `LbRouteExtension` is a resource that lets you control | |
| // where traffic is routed to for a given request. | |
| type LbRouteExtension struct { | |
| // CreateTime: Output only. The timestamp when the resource was created. | |
| CreateTime string `json:"createTime,omitempty"` | |
| // Description: Optional. A human-readable description of the resource. | |
| Description string `json:"description,omitempty"` | |
| // ExtensionChains: Required. A set of ordered extension chains that contain | |
| // the match conditions and extensions to execute. Match conditions for each | |
| // extension chain are evaluated in sequence for a given request. The first | |
| // extension chain that has a condition that matches the request is executed. | |
| // Any subsequent extension chains do not execute. Limited to 5 extension | |
| // chains per resource. | |
| ExtensionChains []*ExtensionChain `json:"extensionChains,omitempty"` | |
| // ForwardingRules: Required. A list of references to the forwarding rules to | |
| // which this service extension is attached. At least one forwarding rule is | |
| // required. Only one `LbRouteExtension` resource can be associated with a | |
| // forwarding rule. | |
| ForwardingRules []string `json:"forwardingRules,omitempty"` | |
| // Labels: Optional. Set of labels associated with the `LbRouteExtension` | |
| // resource. The format must comply with the requirements for labels | |
| // (https://cloud.google.com/compute/docs/labeling-resources#requirements) for | |
| // Google Cloud resources. | |
| Labels map[string]string `json:"labels,omitempty"` | |
| // LoadBalancingScheme: Required. All backend services and forwarding rules | |
| // referenced by this extension must share the same load balancing scheme. | |
| // Supported values: `INTERNAL_MANAGED`, `EXTERNAL_MANAGED`. For more | |
| // information, refer to Backend services overview | |
| // (https://cloud.google.com/load-balancing/docs/backend-service). | |
| // | |
| // Possible values: | |
| // "LOAD_BALANCING_SCHEME_UNSPECIFIED" - Default value. Do not use. | |
| // "INTERNAL_MANAGED" - Signifies that this is used for Internal HTTP(S) Load | |
| // Balancing. | |
| // "EXTERNAL_MANAGED" - Signifies that this is used for External Managed | |
| // HTTP(S) Load Balancing. | |
| LoadBalancingScheme string `json:"loadBalancingScheme,omitempty"` | |
| // Metadata: Optional. The metadata provided here is included as part of the | |
| // `metadata_context` (of type `google.protobuf.Struct`) in the | |
| // `ProcessingRequest` message sent to the extension server. The metadata | |
| // applies to all extensions in all extensions chains in this resource. The | |
| // metadata is available under the key `com.google.lb_route_extension.`. The | |
| // following variables are supported in the metadata: `{forwarding_rule_id}` - | |
| // substituted with the forwarding rule's fully qualified resource name. This | |
| // field must not be set if at least one of the extension chains contains | |
| // plugin extensions. Setting it results in a validation error. You can set | |
| // metadata at either the resource level or the extension level. The extension | |
| // level metadata is recommended because you can pass a different set of | |
| // metadata through each extension to the backend. | |
| Metadata googleapi.RawMessage `json:"metadata,omitempty"` | |
| // Name: Required. Identifier. Name of the `LbRouteExtension` resource in the | |
| // following format: | |
| // `projects/{project}/locations/{location}/lbRouteExtensions/{lb_route_extensio | |
| // n}`. | |
| Name string `json:"name,omitempty"` | |
| // UpdateTime: Output only. The timestamp when the resource was updated. | |
| UpdateTime string `json:"updateTime,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "CreateTime") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "CreateTime") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s LbRouteExtension) MarshalJSON() ([]byte, error) { | |
| type NoMethod LbRouteExtension | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // LbTcpExtension: `LbTcpExtension` is a resource that allows traffic | |
| // forwarding to different backend services to make allow/deny decisions on TCP | |
| // connections for all L7 Load Balancers within a network. Currently only | |
| // internal load-balancers are supported. | |
| type LbTcpExtension struct { | |
| // CreateTime: Output only. The timestamp when the resource was created. | |
| CreateTime string `json:"createTime,omitempty"` | |
| // Description: Optional. A human-readable description of the resource. | |
| Description string `json:"description,omitempty"` | |
| // ExtensionChains: Required. A set of ordered extension chains that contain | |
| // the match conditions and extensions to execute. Match conditions for each | |
| // extension chain are evaluated in sequence for a given request. The first | |
| // extension chain that has a condition that matches the request is executed. | |
| // Any subsequent extension chains do not execute. Limited to 1 extension chain | |
| // per resource. | |
| ExtensionChains []*ExtensionChain `json:"extensionChains,omitempty"` | |
| // Labels: Optional. Set of labels associated with the `LbTcpExtension` | |
| // resource. The format must comply with the requirements for labels | |
| // (/compute/docs/labeling-resources#requirements) for Google Cloud resources. | |
| Labels map[string]string `json:"labels,omitempty"` | |
| // LoadBalancingScheme: Required. All backend services and forwarding rules | |
| // referenced by this extension must share the same load balancing scheme. | |
| // Supported values: `INTERNAL_MANAGED`. For more information, refer to Backend | |
| // services overview | |
| // (https://cloud.google.com/load-balancing/docs/backend-service). | |
| // | |
| // Possible values: | |
| // "LOAD_BALANCING_SCHEME_UNSPECIFIED" - Default value. Do not use. | |
| // "INTERNAL_MANAGED" - Signifies that this is used for Internal HTTP(S) Load | |
| // Balancing. | |
| // "EXTERNAL_MANAGED" - Signifies that this is used for External Managed | |
| // HTTP(S) Load Balancing. | |
| LoadBalancingScheme string `json:"loadBalancingScheme,omitempty"` | |
| // Name: Required. Identifier. Name of the `LbTcpExtension` resource in the | |
| // following format: | |
| // `projects/{project}/locations/{location}/LbTcpExtension/{lb_tcp_extension}` | |
| Name string `json:"name,omitempty"` | |
| // Networks: Optional. If set, this `LbTcpExtension` resource applies to all | |
| // `ForwardingRule` resources in these VPC networks. Values should be relative | |
| // resource names identifying VPC networks, for example | |
| // `projects/*/global/networks/network-1`. Currently limited to 1 network per | |
| // resource. Limited to 1 network per resource. | |
| Networks []string `json:"networks,omitempty"` | |
| // UpdateTime: Output only. The timestamp when the resource was updated. | |
| UpdateTime string `json:"updateTime,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "CreateTime") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "CreateTime") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s LbTcpExtension) MarshalJSON() ([]byte, error) { | |
| type NoMethod LbTcpExtension | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // LbTrafficExtension: `LbTrafficExtension` is a resource that lets the | |
| // extension service modify the headers and payloads of both requests and | |
| // responses without impacting the choice of backend services or any other | |
| // security policies associated with the backend service. | |
| type LbTrafficExtension struct { | |
| // CreateTime: Output only. The timestamp when the resource was created. | |
| CreateTime string `json:"createTime,omitempty"` | |
| // Description: Optional. A human-readable description of the resource. | |
| Description string `json:"description,omitempty"` | |
| // ExtensionChains: Required. A set of ordered extension chains that contain | |
| // the match conditions and extensions to execute. Match conditions for each | |
| // extension chain are evaluated in sequence for a given request. The first | |
| // extension chain that has a condition that matches the request is executed. | |
| // Any subsequent extension chains do not execute. Limited to 5 extension | |
| // chains per resource. | |
| ExtensionChains []*ExtensionChain `json:"extensionChains,omitempty"` | |
| // ForwardingRules: Optional. A list of references to the forwarding rules to | |
| // which this service extension is attached. At least one forwarding rule is | |
| // required. Only one `LbTrafficExtension` resource can be associated with a | |
| // forwarding rule. | |
| ForwardingRules []string `json:"forwardingRules,omitempty"` | |
| // Labels: Optional. Set of labels associated with the `LbTrafficExtension` | |
| // resource. The format must comply with the requirements for labels | |
| // (https://cloud.google.com/compute/docs/labeling-resources#requirements) for | |
| // Google Cloud resources. | |
| Labels map[string]string `json:"labels,omitempty"` | |
| // LoadBalancingScheme: Required. All backend services and forwarding rules | |
| // referenced by this extension must share the same load balancing scheme. | |
| // Supported values: `INTERNAL_MANAGED` and `EXTERNAL_MANAGED`. For more | |
| // information, refer to Backend services overview | |
| // (https://cloud.google.com/load-balancing/docs/backend-service). | |
| // | |
| // Possible values: | |
| // "LOAD_BALANCING_SCHEME_UNSPECIFIED" - Default value. Do not use. | |
| // "INTERNAL_MANAGED" - Signifies that this is used for Internal HTTP(S) Load | |
| // Balancing. | |
| // "EXTERNAL_MANAGED" - Signifies that this is used for External Managed | |
| // HTTP(S) Load Balancing. | |
| LoadBalancingScheme string `json:"loadBalancingScheme,omitempty"` | |
| // Metadata: Optional. The metadata provided here is included as part of the | |
| // `metadata_context` (of type `google.protobuf.Struct`) in the | |
| // `ProcessingRequest` message sent to the extension server. The metadata | |
| // applies to all extensions in all extensions chains in this resource. The | |
| // metadata is available under the key `com.google.lb_traffic_extension.`. The | |
| // following variables are supported in the metadata: `{forwarding_rule_id}` - | |
| // substituted with the forwarding rule's fully qualified resource name. This | |
| // field must not be set if at least one of the extension chains contains | |
| // plugin extensions. Setting it results in a validation error. You can set | |
| // metadata at either the resource level or the extension level. The extension | |
| // level metadata is recommended because you can pass a different set of | |
| // metadata through each extension to the backend. | |
| Metadata googleapi.RawMessage `json:"metadata,omitempty"` | |
| // Name: Required. Identifier. Name of the `LbTrafficExtension` resource in the | |
| // following format: | |
| // `projects/{project}/locations/{location}/lbTrafficExtensions/{lb_traffic_exte | |
| // nsion}`. | |
| Name string `json:"name,omitempty"` | |
| // UpdateTime: Output only. The timestamp when the resource was updated. | |
| UpdateTime string `json:"updateTime,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "CreateTime") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "CreateTime") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s LbTrafficExtension) MarshalJSON() ([]byte, error) { | |
| type NoMethod LbTrafficExtension | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ListAgentConnectivityTemplatesResponse: Response returned by the | |
| // ListAgentConnectivityTemplates method. | |
| type ListAgentConnectivityTemplatesResponse struct { | |
| // AgentConnectivityTemplates: List of AgentConnectivityTemplate resources. | |
| AgentConnectivityTemplates []*AgentConnectivityTemplate `json:"agentConnectivityTemplates,omitempty"` | |
| // NextPageToken: If there might be more results than those appearing in this | |
| // response, then `next_page_token` is included. To get the next set of | |
| // results, call this method again using the value of `next_page_token` as | |
| // `page_token`. | |
| NextPageToken string `json:"nextPageToken,omitempty"` | |
| // Unreachable: Unordered list. Unreachable resources. Populated when the | |
| // request attempts to list all resources across all supported locations, while | |
| // some locations are temporarily unavailable. | |
| Unreachable []string `json:"unreachable,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "AgentConnectivityTemplates") | |
| // to unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "AgentConnectivityTemplates") to | |
| // include in API requests with the JSON null value. By default, fields with | |
| // empty values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ListAgentConnectivityTemplatesResponse) MarshalJSON() ([]byte, error) { | |
| type NoMethod ListAgentConnectivityTemplatesResponse | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ListAgentGatewaysResponse: Response returned by the ListAgentGateways | |
| // method. | |
| type ListAgentGatewaysResponse struct { | |
| // AgentGateways: List of AgentGateway resources. | |
| AgentGateways []*AgentGateway `json:"agentGateways,omitempty"` | |
| // NextPageToken: If there might be more results than those appearing in this | |
| // response, then `next_page_token` is included. To get the next set of | |
| // results, call this method again using the value of `next_page_token` as | |
| // `page_token`. | |
| NextPageToken string `json:"nextPageToken,omitempty"` | |
| // Unreachable: Unreachable resources. Populated when the request attempts to | |
| // list all resources across all supported locations, while some locations are | |
| // temporarily unavailable. | |
| Unreachable []string `json:"unreachable,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "AgentGateways") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "AgentGateways") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ListAgentGatewaysResponse) MarshalJSON() ([]byte, error) { | |
| type NoMethod ListAgentGatewaysResponse | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ListAuthzExtensionsResponse: Message for response to listing | |
| // `AuthzExtension` resources. | |
| type ListAuthzExtensionsResponse struct { | |
| // AuthzExtensions: The list of `AuthzExtension` resources. | |
| AuthzExtensions []*AuthzExtension `json:"authzExtensions,omitempty"` | |
| // NextPageToken: A token identifying a page of results that the server | |
| // returns. | |
| NextPageToken string `json:"nextPageToken,omitempty"` | |
| // Unreachable: Locations that could not be reached. | |
| Unreachable []string `json:"unreachable,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "AuthzExtensions") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "AuthzExtensions") to include in | |
| // API requests with the JSON null value. By default, fields with empty values | |
| // are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ListAuthzExtensionsResponse) MarshalJSON() ([]byte, error) { | |
| type NoMethod ListAuthzExtensionsResponse | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ListCdnEdgeExtensionsResponse: Message for response to listing | |
| // `CdnEdgeExtension` resources. | |
| type ListCdnEdgeExtensionsResponse struct { | |
| // CdnEdgeExtensions: The list of `CdnEdgeExtension` resources. | |
| CdnEdgeExtensions []*CdnEdgeExtension `json:"cdnEdgeExtensions,omitempty"` | |
| // NextPageToken: A token identifying a page of results that the server | |
| // returns. | |
| NextPageToken string `json:"nextPageToken,omitempty"` | |
| // Unreachable: Locations that could not be reached. | |
| Unreachable []string `json:"unreachable,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "CdnEdgeExtensions") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "CdnEdgeExtensions") to include in | |
| // API requests with the JSON null value. By default, fields with empty values | |
| // are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ListCdnEdgeExtensionsResponse) MarshalJSON() ([]byte, error) { | |
| type NoMethod ListCdnEdgeExtensionsResponse | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ListEndpointPoliciesResponse: Response returned by the ListEndpointPolicies | |
| // method. | |
| type ListEndpointPoliciesResponse struct { | |
| // EndpointPolicies: List of EndpointPolicy resources. | |
| EndpointPolicies []*EndpointPolicy `json:"endpointPolicies,omitempty"` | |
| // NextPageToken: If there might be more results than those appearing in this | |
| // response, then `next_page_token` is included. To get the next set of | |
| // results, call this method again using the value of `next_page_token` as | |
| // `page_token`. | |
| NextPageToken string `json:"nextPageToken,omitempty"` | |
| // Unreachable: Unreachable resources. Populated when the request opts into | |
| // return_partial_success and reading across collections e.g. when attempting | |
| // to list all resources across all supported locations. | |
| Unreachable []string `json:"unreachable,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "EndpointPolicies") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "EndpointPolicies") to include in | |
| // API requests with the JSON null value. By default, fields with empty values | |
| // are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ListEndpointPoliciesResponse) MarshalJSON() ([]byte, error) { | |
| type NoMethod ListEndpointPoliciesResponse | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ListExtensionBindingsResponse: Response returned by the | |
| // `ListExtensionBindings` method. | |
| type ListExtensionBindingsResponse struct { | |
| // ExtensionBindings: List of `ExtensionBinding` resources. | |
| ExtensionBindings []*ExtensionBinding `json:"extensionBindings,omitempty"` | |
| // NextPageToken: If there might be more results than those appearing in this | |
| // response, then `next_page_token` is included. To get the next set of | |
| // results, call this method again using the value of `next_page_token` as | |
| // `page_token`. | |
| NextPageToken string `json:"nextPageToken,omitempty"` | |
| // Unreachable: Unordered list. Unreachable resources. Populated when the | |
| // request attempts to list all resources across all supported locations, while | |
| // some locations are temporarily unavailable. The resource names are in the | |
| // format | |
| // `projects/{project}/locations/{location}/extensionBindings/{extension_binding | |
| // }`. | |
| Unreachable []string `json:"unreachable,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "ExtensionBindings") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "ExtensionBindings") to include in | |
| // API requests with the JSON null value. By default, fields with empty values | |
| // are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ListExtensionBindingsResponse) MarshalJSON() ([]byte, error) { | |
| type NoMethod ListExtensionBindingsResponse | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ListGatewayRouteViewsResponse: Response returned by the | |
| // ListGatewayRouteViews method. | |
| type ListGatewayRouteViewsResponse struct { | |
| // GatewayRouteViews: List of GatewayRouteView resources. | |
| GatewayRouteViews []*GatewayRouteView `json:"gatewayRouteViews,omitempty"` | |
| // NextPageToken: A token, which can be sent as `page_token` to retrieve the | |
| // next page. If this field is omitted, there are no subsequent pages. | |
| NextPageToken string `json:"nextPageToken,omitempty"` | |
| // Unreachable: Unreachable resources. Populated when the request attempts to | |
| // list all resources across all supported locations, while some locations are | |
| // temporarily unavailable. | |
| Unreachable []string `json:"unreachable,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "GatewayRouteViews") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "GatewayRouteViews") to include in | |
| // API requests with the JSON null value. By default, fields with empty values | |
| // are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ListGatewayRouteViewsResponse) MarshalJSON() ([]byte, error) { | |
| type NoMethod ListGatewayRouteViewsResponse | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ListGatewaysResponse: Response returned by the ListGateways method. | |
| type ListGatewaysResponse struct { | |
| // Gateways: List of Gateway resources. | |
| Gateways []*Gateway `json:"gateways,omitempty"` | |
| // NextPageToken: If there might be more results than those appearing in this | |
| // response, then `next_page_token` is included. To get the next set of | |
| // results, call this method again using the value of `next_page_token` as | |
| // `page_token`. | |
| NextPageToken string `json:"nextPageToken,omitempty"` | |
| // Unreachable: Locations that could not be reached. | |
| Unreachable []string `json:"unreachable,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "Gateways") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Gateways") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ListGatewaysResponse) MarshalJSON() ([]byte, error) { | |
| type NoMethod ListGatewaysResponse | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ListGrpcRoutesResponse: Response returned by the ListGrpcRoutes method. | |
| type ListGrpcRoutesResponse struct { | |
| // GrpcRoutes: List of GrpcRoute resources. | |
| GrpcRoutes []*GrpcRoute `json:"grpcRoutes,omitempty"` | |
| // NextPageToken: If there might be more results than those appearing in this | |
| // response, then `next_page_token` is included. To get the next set of | |
| // results, call this method again using the value of `next_page_token` as | |
| // `page_token`. | |
| NextPageToken string `json:"nextPageToken,omitempty"` | |
| // Unreachable: Unreachable resources. Populated when the request opts into | |
| // return_partial_success and reading across collections e.g. when attempting | |
| // to list all resources across all supported locations. | |
| Unreachable []string `json:"unreachable,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "GrpcRoutes") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "GrpcRoutes") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ListGrpcRoutesResponse) MarshalJSON() ([]byte, error) { | |
| type NoMethod ListGrpcRoutesResponse | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ListHttpRoutesResponse: Response returned by the ListHttpRoutes method. | |
| type ListHttpRoutesResponse struct { | |
| // HttpRoutes: List of HttpRoute resources. | |
| HttpRoutes []*HttpRoute `json:"httpRoutes,omitempty"` | |
| // NextPageToken: If there might be more results than those appearing in this | |
| // response, then `next_page_token` is included. To get the next set of | |
| // results, call this method again using the value of `next_page_token` as | |
| // `page_token`. | |
| NextPageToken string `json:"nextPageToken,omitempty"` | |
| // Unreachable: Unreachable resources. Populated when the request opts into | |
| // return_partial_success and reading across collections e.g. when attempting | |
| // to list all resources across all supported locations. | |
| Unreachable []string `json:"unreachable,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "HttpRoutes") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "HttpRoutes") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ListHttpRoutesResponse) MarshalJSON() ([]byte, error) { | |
| type NoMethod ListHttpRoutesResponse | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ListLbEdgeExtensionsResponse: Message for response to listing | |
| // `LbEdgeExtension` resources. | |
| type ListLbEdgeExtensionsResponse struct { | |
| // LbEdgeExtensions: The list of `LbEdgeExtension` resources. | |
| LbEdgeExtensions []*LbEdgeExtension `json:"lbEdgeExtensions,omitempty"` | |
| // NextPageToken: A token identifying a page of results that the server | |
| // returns. | |
| NextPageToken string `json:"nextPageToken,omitempty"` | |
| // Unreachable: Locations that could not be reached. | |
| Unreachable []string `json:"unreachable,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "LbEdgeExtensions") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "LbEdgeExtensions") to include in | |
| // API requests with the JSON null value. By default, fields with empty values | |
| // are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ListLbEdgeExtensionsResponse) MarshalJSON() ([]byte, error) { | |
| type NoMethod ListLbEdgeExtensionsResponse | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ListLbRouteExtensionsResponse: Message for response to listing | |
| // `LbRouteExtension` resources. | |
| type ListLbRouteExtensionsResponse struct { | |
| // LbRouteExtensions: The list of `LbRouteExtension` resources. | |
| LbRouteExtensions []*LbRouteExtension `json:"lbRouteExtensions,omitempty"` | |
| // NextPageToken: A token identifying a page of results that the server | |
| // returns. | |
| NextPageToken string `json:"nextPageToken,omitempty"` | |
| // Unreachable: Locations that could not be reached. | |
| Unreachable []string `json:"unreachable,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "LbRouteExtensions") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "LbRouteExtensions") to include in | |
| // API requests with the JSON null value. By default, fields with empty values | |
| // are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ListLbRouteExtensionsResponse) MarshalJSON() ([]byte, error) { | |
| type NoMethod ListLbRouteExtensionsResponse | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ListLbTcpExtensionsResponse: Message for response to listing | |
| // `LbTcpExtension` resources. | |
| type ListLbTcpExtensionsResponse struct { | |
| // LbTcpExtensions: The list of `LbTcpExtension` resources. | |
| LbTcpExtensions []*LbTcpExtension `json:"lbTcpExtensions,omitempty"` | |
| // NextPageToken: A token identifying a page of results that the server | |
| // returns. | |
| NextPageToken string `json:"nextPageToken,omitempty"` | |
| // Unreachable: Locations that could not be reached. | |
| Unreachable []string `json:"unreachable,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "LbTcpExtensions") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "LbTcpExtensions") to include in | |
| // API requests with the JSON null value. By default, fields with empty values | |
| // are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ListLbTcpExtensionsResponse) MarshalJSON() ([]byte, error) { | |
| type NoMethod ListLbTcpExtensionsResponse | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ListLbTrafficExtensionsResponse: Message for response to listing | |
| // `LbTrafficExtension` resources. | |
| type ListLbTrafficExtensionsResponse struct { | |
| // LbTrafficExtensions: The list of `LbTrafficExtension` resources. | |
| LbTrafficExtensions []*LbTrafficExtension `json:"lbTrafficExtensions,omitempty"` | |
| // NextPageToken: A token identifying a page of results that the server | |
| // returns. | |
| NextPageToken string `json:"nextPageToken,omitempty"` | |
| // Unreachable: Locations that could not be reached. | |
| Unreachable []string `json:"unreachable,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "LbTrafficExtensions") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "LbTrafficExtensions") to include | |
| // in API requests with the JSON null value. By default, fields with empty | |
| // values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ListLbTrafficExtensionsResponse) MarshalJSON() ([]byte, error) { | |
| type NoMethod ListLbTrafficExtensionsResponse | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ListLocationsResponse: The response message for Locations.ListLocations. | |
| type ListLocationsResponse struct { | |
| // Locations: A list of locations that matches the specified filter in the | |
| // request. | |
| Locations []*Location `json:"locations,omitempty"` | |
| // NextPageToken: The standard List next-page token. | |
| NextPageToken string `json:"nextPageToken,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "Locations") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Locations") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ListLocationsResponse) MarshalJSON() ([]byte, error) { | |
| type NoMethod ListLocationsResponse | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ListMeshRouteViewsResponse: Response returned by the ListMeshRouteViews | |
| // method. | |
| type ListMeshRouteViewsResponse struct { | |
| // MeshRouteViews: List of MeshRouteView resources. | |
| MeshRouteViews []*MeshRouteView `json:"meshRouteViews,omitempty"` | |
| // NextPageToken: A token, which can be sent as `page_token` to retrieve the | |
| // next page. If this field is omitted, there are no subsequent pages. | |
| NextPageToken string `json:"nextPageToken,omitempty"` | |
| // Unreachable: Unreachable resources. Populated when the request attempts to | |
| // list all resources across all supported locations, while some locations are | |
| // temporarily unavailable. | |
| Unreachable []string `json:"unreachable,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "MeshRouteViews") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "MeshRouteViews") to include in | |
| // API requests with the JSON null value. By default, fields with empty values | |
| // are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ListMeshRouteViewsResponse) MarshalJSON() ([]byte, error) { | |
| type NoMethod ListMeshRouteViewsResponse | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ListMeshesResponse: Response returned by the ListMeshes method. | |
| type ListMeshesResponse struct { | |
| // Meshes: List of Mesh resources. | |
| Meshes []*Mesh `json:"meshes,omitempty"` | |
| // NextPageToken: If there might be more results than those appearing in this | |
| // response, then `next_page_token` is included. To get the next set of | |
| // results, call this method again using the value of `next_page_token` as | |
| // `page_token`. | |
| NextPageToken string `json:"nextPageToken,omitempty"` | |
| // Unreachable: Unreachable resources. Populated when the request opts into | |
| // `return_partial_success` and reading across collections e.g. when attempting | |
| // to list all resources across all supported locations. | |
| Unreachable []string `json:"unreachable,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "Meshes") to unconditionally | |
| // include in API requests. By default, fields with empty or default values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Meshes") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ListMeshesResponse) MarshalJSON() ([]byte, error) { | |
| type NoMethod ListMeshesResponse | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ListOperationsResponse: The response message for Operations.ListOperations. | |
| type ListOperationsResponse struct { | |
| // NextPageToken: The standard List next-page token. | |
| NextPageToken string `json:"nextPageToken,omitempty"` | |
| // Operations: A list of operations that matches the specified filter in the | |
| // request. | |
| Operations []*Operation `json:"operations,omitempty"` | |
| // Unreachable: Unordered list. Unreachable resources. Populated when the | |
| // request sets `ListOperationsRequest.return_partial_success` and reads across | |
| // collections. For example, when attempting to list all resources across all | |
| // supported locations. | |
| Unreachable []string `json:"unreachable,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "NextPageToken") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "NextPageToken") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ListOperationsResponse) MarshalJSON() ([]byte, error) { | |
| type NoMethod ListOperationsResponse | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ListProducerExtensionsResponse: Response returned by the | |
| // `ListProducerExtensions` method. | |
| type ListProducerExtensionsResponse struct { | |
| // NextPageToken: If there might be more results than those appearing in this | |
| // response, then `next_page_token` is included. To get the next set of | |
| // results, call this method again using the value of `next_page_token` as | |
| // `page_token`. | |
| NextPageToken string `json:"nextPageToken,omitempty"` | |
| // ProducerExtensions: List of `ProducerExtension` resources. | |
| ProducerExtensions []*ProducerExtension `json:"producerExtensions,omitempty"` | |
| // Unreachable: Unordered list. Unreachable resources. Populated when the | |
| // request attempts to list all resources across all supported locations, while | |
| // some locations are temporarily unavailable. The resource names are in the | |
| // format: | |
| // `projects/{project}/locations/{location}/producerExtensions/{producer_extensi | |
| // on}`. | |
| Unreachable []string `json:"unreachable,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "NextPageToken") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "NextPageToken") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ListProducerExtensionsResponse) MarshalJSON() ([]byte, error) { | |
| type NoMethod ListProducerExtensionsResponse | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ListServiceBindingsResponse: Response returned by the ListServiceBindings | |
| // method. | |
| type ListServiceBindingsResponse struct { | |
| // NextPageToken: If there might be more results than those appearing in this | |
| // response, then `next_page_token` is included. To get the next set of | |
| // results, call this method again using the value of `next_page_token` as | |
| // `page_token`. | |
| NextPageToken string `json:"nextPageToken,omitempty"` | |
| // ServiceBindings: List of ServiceBinding resources. | |
| ServiceBindings []*ServiceBinding `json:"serviceBindings,omitempty"` | |
| // Unreachable: Unreachable resources. Populated when the request attempts to | |
| // list all resources across all supported locations, while some locations are | |
| // temporarily unavailable. | |
| Unreachable []string `json:"unreachable,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "NextPageToken") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "NextPageToken") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ListServiceBindingsResponse) MarshalJSON() ([]byte, error) { | |
| type NoMethod ListServiceBindingsResponse | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ListServiceLbPoliciesResponse: Response returned by the | |
| // ListServiceLbPolicies method. | |
| type ListServiceLbPoliciesResponse struct { | |
| // NextPageToken: If there might be more results than those appearing in this | |
| // response, then `next_page_token` is included. To get the next set of | |
| // results, call this method again using the value of `next_page_token` as | |
| // `page_token`. | |
| NextPageToken string `json:"nextPageToken,omitempty"` | |
| // ServiceLbPolicies: List of ServiceLbPolicy resources. | |
| ServiceLbPolicies []*ServiceLbPolicy `json:"serviceLbPolicies,omitempty"` | |
| // Unreachable: Unreachable resources. Populated when the request attempts to | |
| // list all resources across all supported locations, while some locations are | |
| // temporarily unavailable. | |
| Unreachable []string `json:"unreachable,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "NextPageToken") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "NextPageToken") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ListServiceLbPoliciesResponse) MarshalJSON() ([]byte, error) { | |
| type NoMethod ListServiceLbPoliciesResponse | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ListTcpRoutesResponse: Response returned by the ListTcpRoutes method. | |
| type ListTcpRoutesResponse struct { | |
| // NextPageToken: If there might be more results than those appearing in this | |
| // response, then `next_page_token` is included. To get the next set of | |
| // results, call this method again using the value of `next_page_token` as | |
| // `page_token`. | |
| NextPageToken string `json:"nextPageToken,omitempty"` | |
| // TcpRoutes: List of TcpRoute resources. | |
| TcpRoutes []*TcpRoute `json:"tcpRoutes,omitempty"` | |
| // Unreachable: Unreachable resources. Populated when the request opts into | |
| // return_partial_success and reading across collections e.g. when attempting | |
| // to list all resources across all supported locations. | |
| Unreachable []string `json:"unreachable,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "NextPageToken") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "NextPageToken") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ListTcpRoutesResponse) MarshalJSON() ([]byte, error) { | |
| type NoMethod ListTcpRoutesResponse | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ListTelemetryPoliciesResponse: Response returned by the | |
| // ListTelemetryPolicies method. | |
| type ListTelemetryPoliciesResponse struct { | |
| // NextPageToken: If there might be more results than those appearing in this | |
| // response, then `next_page_token` is included. To get the next set of | |
| // results, call this method again using the value of `next_page_token` as | |
| // `page_token`. | |
| NextPageToken string `json:"nextPageToken,omitempty"` | |
| // TelemetryPolicies: List of TelemetryPolicy resources. | |
| TelemetryPolicies []*TelemetryPolicy `json:"telemetryPolicies,omitempty"` | |
| // Unreachable: Unreachable resources. Populated when the request attempts to | |
| // list all resources across all supported locations, while some locations are | |
| // temporarily unavailable. | |
| Unreachable []string `json:"unreachable,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "NextPageToken") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "NextPageToken") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ListTelemetryPoliciesResponse) MarshalJSON() ([]byte, error) { | |
| type NoMethod ListTelemetryPoliciesResponse | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ListTlsRoutesResponse: Response returned by the ListTlsRoutes method. | |
| type ListTlsRoutesResponse struct { | |
| // NextPageToken: If there might be more results than those appearing in this | |
| // response, then `next_page_token` is included. To get the next set of | |
| // results, call this method again using the value of `next_page_token` as | |
| // `page_token`. | |
| NextPageToken string `json:"nextPageToken,omitempty"` | |
| // TlsRoutes: List of TlsRoute resources. | |
| TlsRoutes []*TlsRoute `json:"tlsRoutes,omitempty"` | |
| // Unreachable: Unreachable resources. Populated when the request opts into | |
| // return_partial_success and reading across collections e.g. when attempting | |
| // to list all resources across all supported locations. | |
| Unreachable []string `json:"unreachable,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "NextPageToken") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "NextPageToken") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ListTlsRoutesResponse) MarshalJSON() ([]byte, error) { | |
| type NoMethod ListTlsRoutesResponse | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ListWasmPluginVersionsResponse: Response returned by the | |
| // `ListWasmPluginVersions` method. | |
| type ListWasmPluginVersionsResponse struct { | |
| // NextPageToken: If there might be more results than those appearing in this | |
| // response, then `next_page_token` is included. To get the next set of | |
| // results, call this method again using the value of `next_page_token` as | |
| // `page_token`. | |
| NextPageToken string `json:"nextPageToken,omitempty"` | |
| // Unreachable: Unreachable resources. Populated when the request attempts to | |
| // list all resources across all supported locations, while some locations are | |
| // temporarily unavailable. | |
| Unreachable []string `json:"unreachable,omitempty"` | |
| // WasmPluginVersions: List of `WasmPluginVersion` resources. | |
| WasmPluginVersions []*WasmPluginVersion `json:"wasmPluginVersions,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "NextPageToken") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "NextPageToken") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ListWasmPluginVersionsResponse) MarshalJSON() ([]byte, error) { | |
| type NoMethod ListWasmPluginVersionsResponse | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ListWasmPluginsResponse: Response returned by the `ListWasmPlugins` method. | |
| type ListWasmPluginsResponse struct { | |
| // NextPageToken: If there might be more results than those appearing in this | |
| // response, then `next_page_token` is included. To get the next set of | |
| // results, call this method again using the value of `next_page_token` as | |
| // `page_token`. | |
| NextPageToken string `json:"nextPageToken,omitempty"` | |
| // Unreachable: Unreachable resources. Populated when the request attempts to | |
| // list all resources across all supported locations, while some locations are | |
| // temporarily unavailable. | |
| Unreachable []string `json:"unreachable,omitempty"` | |
| // WasmPlugins: List of `WasmPlugin` resources. | |
| WasmPlugins []*WasmPlugin `json:"wasmPlugins,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "NextPageToken") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "NextPageToken") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ListWasmPluginsResponse) MarshalJSON() ([]byte, error) { | |
| type NoMethod ListWasmPluginsResponse | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // Location: A resource that represents a Google Cloud location. | |
| type Location struct { | |
| // DisplayName: The friendly name for this location, typically a nearby city | |
| // name. For example, "Tokyo". | |
| DisplayName string `json:"displayName,omitempty"` | |
| // Labels: Cross-service attributes for the location. For example | |
| // {"cloud.googleapis.com/region": "us-east1"} | |
| Labels map[string]string `json:"labels,omitempty"` | |
| // LocationId: The canonical id for this location. For example: "us-east1". | |
| LocationId string `json:"locationId,omitempty"` | |
| // Metadata: Service-specific metadata. For example the available capacity at | |
| // the given location. | |
| Metadata googleapi.RawMessage `json:"metadata,omitempty"` | |
| // Name: Resource name for the location, which may vary between | |
| // implementations. For example: | |
| // "projects/example-project/locations/us-east1" | |
| Name string `json:"name,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "DisplayName") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "DisplayName") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s Location) MarshalJSON() ([]byte, error) { | |
| type NoMethod Location | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // LoggingConfig: The configuration for Platform Telemetry logging for Eventarc | |
| // Advanced resources. | |
| type LoggingConfig struct { | |
| // LogSeverity: Optional. The minimum severity of logs that will be sent to | |
| // Stackdriver/Platform Telemetry. Logs at severitiy ≥ this value will be | |
| // sent, unless it is NONE. | |
| // | |
| // Possible values: | |
| // "LOG_SEVERITY_UNSPECIFIED" - Log severity is not specified. This value is | |
| // treated the same as NONE, but is used to distinguish between no update and | |
| // update to NONE in update_masks. | |
| // "NONE" - Default value at resource creation, presence of this value must | |
| // be treated as no logging/disable logging. | |
| // "DEBUG" - Debug or trace level logging. | |
| // "INFO" - Routine information, such as ongoing status or performance. | |
| // "NOTICE" - Normal but significant events, such as start up, shut down, or | |
| // a configuration change. | |
| // "WARNING" - Warning events might cause problems. | |
| // "ERROR" - Error events are likely to cause problems. | |
| // "CRITICAL" - Critical events cause more severe problems or outages. | |
| // "ALERT" - A person must take action immediately. | |
| // "EMERGENCY" - One or more systems are unusable. | |
| LogSeverity string `json:"logSeverity,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "LogSeverity") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "LogSeverity") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s LoggingConfig) MarshalJSON() ([]byte, error) { | |
| type NoMethod LoggingConfig | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // Mesh: Mesh represents a logical configuration grouping for workload to | |
| // workload communication within a service mesh. Routes that point to mesh | |
| // dictate how requests are routed within this logical mesh boundary. | |
| type Mesh struct { | |
| // CreateTime: Output only. The timestamp when the resource was created. | |
| CreateTime string `json:"createTime,omitempty"` | |
| // Description: Optional. A free-text description of the resource. Max length | |
| // 1024 characters. | |
| Description string `json:"description,omitempty"` | |
| // EnvoyHeaders: Optional. Determines if envoy will insert internal debug | |
| // headers into upstream requests. Other Envoy headers may still be injected. | |
| // By default, envoy will not insert any debug headers. | |
| // | |
| // Possible values: | |
| // "ENVOY_HEADERS_UNSPECIFIED" - Defaults to NONE. | |
| // "NONE" - Suppress envoy debug headers. | |
| // "DEBUG_HEADERS" - Envoy will insert default internal debug headers into | |
| // upstream requests: x-envoy-attempt-count, x-envoy-is-timeout-retry, | |
| // x-envoy-expected-rq-timeout-ms, x-envoy-original-path, | |
| // x-envoy-upstream-stream-duration-ms | |
| EnvoyHeaders string `json:"envoyHeaders,omitempty"` | |
| // InterceptionPort: Optional. If set to a valid TCP port (1-65535), instructs | |
| // the SIDECAR proxy to listen on the specified port of localhost (127.0.0.1) | |
| // address. The SIDECAR proxy will expect all traffic to be redirected to this | |
| // port regardless of its actual ip:port destination. If unset, a port '15001' | |
| // is used as the interception port. This is applicable only for sidecar proxy | |
| // deployments. | |
| InterceptionPort int64 `json:"interceptionPort,omitempty"` | |
| // Labels: Optional. Set of label tags associated with the Mesh resource. | |
| Labels map[string]string `json:"labels,omitempty"` | |
| // Name: Identifier. Name of the Mesh resource. It matches pattern | |
| // `projects/*/locations/*/meshes/`. | |
| Name string `json:"name,omitempty"` | |
| // SelfLink: Output only. Server-defined URL of this resource | |
| SelfLink string `json:"selfLink,omitempty"` | |
| // UpdateTime: Output only. The timestamp when the resource was updated. | |
| UpdateTime string `json:"updateTime,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "CreateTime") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "CreateTime") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s Mesh) MarshalJSON() ([]byte, error) { | |
| type NoMethod Mesh | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // MeshRouteView: MeshRouteView defines view-only resource for Routes to a Mesh | |
| type MeshRouteView struct { | |
| // Name: Output only. Identifier. Full path name of the MeshRouteView resource. | |
| // Format: | |
| // projects/{project_number}/locations/{location}/meshes/{mesh}/routeViews/{rout | |
| // e_view} | |
| Name string `json:"name,omitempty"` | |
| // RouteId: Output only. The resource id for the route. | |
| RouteId string `json:"routeId,omitempty"` | |
| // RouteLocation: Output only. Location where the route exists. | |
| RouteLocation string `json:"routeLocation,omitempty"` | |
| // RouteProjectNumber: Output only. Project number where the route exists. | |
| RouteProjectNumber int64 `json:"routeProjectNumber,omitempty,string"` | |
| // RouteType: Output only. Type of the route: HttpRoute,GrpcRoute,TcpRoute, or | |
| // TlsRoute | |
| RouteType string `json:"routeType,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "Name") to unconditionally | |
| // include in API requests. By default, fields with empty or default values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Name") to include in API requests | |
| // with the JSON null value. By default, fields with empty values are omitted | |
| // from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s MeshRouteView) MarshalJSON() ([]byte, error) { | |
| type NoMethod MeshRouteView | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // MetadataLabelMatcher: The matcher that is based on node metadata presented | |
| // by xDS clients. | |
| type MetadataLabelMatcher struct { | |
| // MetadataLabelMatchCriteria: Specifies how matching should be done. Supported | |
| // values are: MATCH_ANY: At least one of the Labels specified in the matcher | |
| // should match the metadata presented by xDS client. MATCH_ALL: The metadata | |
| // presented by the xDS client should contain all of the labels specified here. | |
| // The selection is determined based on the best match. For example, suppose | |
| // there are three EndpointPolicy resources P1, P2 and P3 and if P1 has a the | |
| // matcher as MATCH_ANY , P2 has MATCH_ALL , and P3 has MATCH_ALL . If a client | |
| // with label connects, the config from P1 will be selected. If a client with | |
| // label connects, the config from P2 will be selected. If a client with label | |
| // connects, the config from P3 will be selected. If there is more than one | |
| // best match, (for example, if a config P4 with selector exists and if a | |
| // client with label connects), pick up the one with older creation time. | |
| // | |
| // Possible values: | |
| // "METADATA_LABEL_MATCH_CRITERIA_UNSPECIFIED" - Default value. Should not be | |
| // used. | |
| // "MATCH_ANY" - At least one of the Labels specified in the matcher should | |
| // match the metadata presented by xDS client. | |
| // "MATCH_ALL" - The metadata presented by the xDS client should contain all | |
| // of the labels specified here. | |
| MetadataLabelMatchCriteria string `json:"metadataLabelMatchCriteria,omitempty"` | |
| // MetadataLabels: The list of label value pairs that must match labels in the | |
| // provided metadata based on filterMatchCriteria This list can have at most 64 | |
| // entries. The list can be empty if the match criteria is MATCH_ANY, to | |
| // specify a wildcard match (i.e this matches any client). | |
| MetadataLabels []*MetadataLabels `json:"metadataLabels,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "MetadataLabelMatchCriteria") | |
| // to unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "MetadataLabelMatchCriteria") to | |
| // include in API requests with the JSON null value. By default, fields with | |
| // empty values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s MetadataLabelMatcher) MarshalJSON() ([]byte, error) { | |
| type NoMethod MetadataLabelMatcher | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // MetadataLabels: Defines a name-pair value for a single label. | |
| type MetadataLabels struct { | |
| // LabelName: Required. Label name presented as key in xDS Node Metadata. | |
| LabelName string `json:"labelName,omitempty"` | |
| // LabelValue: Required. Label value presented as value corresponding to the | |
| // above key, in xDS Node Metadata. | |
| LabelValue string `json:"labelValue,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "LabelName") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "LabelName") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s MetadataLabels) MarshalJSON() ([]byte, error) { | |
| type NoMethod MetadataLabels | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // MetricsConfiguration: Configuration for metrics collection. | |
| type MetricsConfiguration struct { | |
| // Enabled: Optional. Indicates whether metrics are enabled or disabled. Set to | |
| // true to explicitly enable, or false to explicitly disable. | |
| Enabled bool `json:"enabled,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "Enabled") to unconditionally | |
| // include in API requests. By default, fields with empty or default values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Enabled") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s MetricsConfiguration) MarshalJSON() ([]byte, error) { | |
| type NoMethod MetricsConfiguration | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // Operation: This resource represents a long-running operation that is the | |
| // result of a network API call. | |
| type Operation struct { | |
| // Done: If the value is `false`, it means the operation is still in progress. | |
| // If `true`, the operation is completed, and either `error` or `response` is | |
| // available. | |
| Done bool `json:"done,omitempty"` | |
| // Error: The error result of the operation in case of failure or cancellation. | |
| Error *Status `json:"error,omitempty"` | |
| // Metadata: Service-specific metadata associated with the operation. It | |
| // typically contains progress information and common metadata such as create | |
| // time. Some services might not provide such metadata. Any method that returns | |
| // a long-running operation should document the metadata type, if any. | |
| Metadata googleapi.RawMessage `json:"metadata,omitempty"` | |
| // Name: The server-assigned name, which is only unique within the same service | |
| // that originally returns it. If you use the default HTTP mapping, the `name` | |
| // should be a resource name ending with `operations/{unique_id}`. | |
| Name string `json:"name,omitempty"` | |
| // Response: The normal, successful response of the operation. If the original | |
| // method returns no data on success, such as `Delete`, the response is | |
| // `google.protobuf.Empty`. If the original method is standard | |
| // `Get`/`Create`/`Update`, the response should be the resource. For other | |
| // methods, the response should have the type `XxxResponse`, where `Xxx` is the | |
| // original method name. For example, if the original method name is | |
| // `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. | |
| Response googleapi.RawMessage `json:"response,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "Done") to unconditionally | |
| // include in API requests. By default, fields with empty or default values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Done") to include in API requests | |
| // with the JSON null value. By default, fields with empty values are omitted | |
| // from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s Operation) MarshalJSON() ([]byte, error) { | |
| type NoMethod Operation | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // OperationMetadata: Represents the metadata of the long-running operation. | |
| type OperationMetadata struct { | |
| // ApiVersion: Output only. API version used to start the operation. | |
| ApiVersion string `json:"apiVersion,omitempty"` | |
| // CreateTime: Output only. The time the operation was created. | |
| CreateTime string `json:"createTime,omitempty"` | |
| // EndTime: Output only. The time the operation finished running. | |
| EndTime string `json:"endTime,omitempty"` | |
| // RequestedCancellation: Output only. Identifies whether the user has | |
| // requested cancellation of the operation. Operations that have successfully | |
| // been cancelled have Operation.error value with a google.rpc.Status.code of | |
| // 1, corresponding to `Code.CANCELLED`. | |
| RequestedCancellation bool `json:"requestedCancellation,omitempty"` | |
| // StatusMessage: Output only. Human-readable status of the operation, if any. | |
| StatusMessage string `json:"statusMessage,omitempty"` | |
| // Target: Output only. Server-defined resource path for the target of the | |
| // operation. | |
| Target string `json:"target,omitempty"` | |
| // Verb: Output only. Name of the verb executed by the operation. | |
| Verb string `json:"verb,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "ApiVersion") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "ApiVersion") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s OperationMetadata) MarshalJSON() ([]byte, error) { | |
| type NoMethod OperationMetadata | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ProducerExtension: `ProducerExtension` is a resource representing producer | |
| // defined configuration for their service extension. | |
| type ProducerExtension struct { | |
| // CreateTime: Output only. The timestamp when the resource was created. | |
| CreateTime string `json:"createTime,omitempty"` | |
| // Description: Optional. A human-readable description of the resource. | |
| Description string `json:"description,omitempty"` | |
| // Etag: Optional. Etag of the resource. If this is provided, it must match the | |
| // server's etag. If the provided etag does not match the server's etag, the | |
| // request will fail with a 409 ABORTED error. | |
| Etag string `json:"etag,omitempty"` | |
| // ExtensionSettings: Required. The configuration for the service that this | |
| // `ProducerExtension` offers. | |
| ExtensionSettings *ProducerExtensionExtensionSettings `json:"extensionSettings,omitempty"` | |
| // Labels: Optional. Set of labels associated with the `ProducerExtension` | |
| // resource. The format must comply with the following requirements | |
| // (https://cloud.google.com/compute/docs/labeling-resources#requirements). | |
| Labels map[string]string `json:"labels,omitempty"` | |
| // Name: Identifier. Name of the `ProducerExtension` resource in the following | |
| // format: | |
| // `projects/{project}/locations/{location}/producerExtensions/{producer_extensi | |
| // on}`. | |
| Name string `json:"name,omitempty"` | |
| // Phase: Required. The phase in which this `ProducerExtension` should execute. | |
| // | |
| // Possible values: | |
| // "PHASE_UNSPECIFIED" - Unspecified phase. | |
| // "TRAFFIC" - The `ProducerExtension` will be executed during the traffic | |
| // phase. | |
| // "AUTHZ" - The `ProducerExtension` will be executed during the | |
| // authorization phase. | |
| Phase string `json:"phase,omitempty"` | |
| // UpdateTime: Output only. The timestamp when the resource was updated. | |
| UpdateTime string `json:"updateTime,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "CreateTime") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "CreateTime") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ProducerExtension) MarshalJSON() ([]byte, error) { | |
| type NoMethod ProducerExtension | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ProducerExtensionExtensionSettings: The configuration for the service that | |
| // this `ProducerExtension` offers. | |
| type ProducerExtensionExtensionSettings struct { | |
| // Authority: Optional. The `:authority` header in the request sent to the | |
| // extension service. | |
| Authority string `json:"authority,omitempty"` | |
| // ObservabilityMode: Optional. Whether the extension should function in | |
| // observability mode. | |
| ObservabilityMode bool `json:"observabilityMode,omitempty"` | |
| // Service: Required. URI of the PSC attachment. | |
| Service string `json:"service,omitempty"` | |
| // SupportedEvents: Required. The event types supported by the extension. | |
| // | |
| // Possible values: | |
| // "EVENT_TYPE_UNSPECIFIED" - Unspecified value. Do not use. | |
| // "REQUEST_HEADERS" - If included in `supported_events`, the extension is | |
| // called when the HTTP request headers arrive. | |
| // "REQUEST_BODY" - If included in `supported_events`, the extension is | |
| // called when the HTTP request body arrives. | |
| // "RESPONSE_HEADERS" - If included in `supported_events`, the extension is | |
| // called when the HTTP response headers arrive. | |
| // "RESPONSE_BODY" - If included in `supported_events`, the extension is | |
| // called when the HTTP response body arrives. | |
| // "REQUEST_TRAILERS" - If included in `supported_events`, the extension is | |
| // called when the HTTP request trailers arrives. | |
| // "RESPONSE_TRAILERS" - If included in `supported_events`, the extension is | |
| // called when the HTTP response trailers arrives. | |
| SupportedEvents []string `json:"supportedEvents,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "Authority") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Authority") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ProducerExtensionExtensionSettings) MarshalJSON() ([]byte, error) { | |
| type NoMethod ProducerExtensionExtensionSettings | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| type RetryFilterPerRouteConfig struct { | |
| // CryptoKeyName: The name of the crypto key to use for encrypting event data. | |
| CryptoKeyName string `json:"cryptoKeyName,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "CryptoKeyName") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "CryptoKeyName") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s RetryFilterPerRouteConfig) MarshalJSON() ([]byte, error) { | |
| type NoMethod RetryFilterPerRouteConfig | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ServiceBinding: ServiceBinding can be used to: - Bind a Service Directory | |
| // Service to be used in a BackendService resource. This feature will be | |
| // deprecated soon. - Bind a Private Service Connect producer service to be | |
| // used in consumer Cloud Service Mesh or Application Load Balancers. - Bind a | |
| // Cloud Run service to be used in consumer Cloud Service Mesh or Application | |
| // Load Balancers. | |
| type ServiceBinding struct { | |
| // CreateTime: Output only. The timestamp when the resource was created. | |
| CreateTime string `json:"createTime,omitempty"` | |
| // Description: Optional. A free-text description of the resource. Max length | |
| // 1024 characters. | |
| Description string `json:"description,omitempty"` | |
| // Labels: Optional. Set of label tags associated with the ServiceBinding | |
| // resource. | |
| Labels map[string]string `json:"labels,omitempty"` | |
| // Name: Identifier. Name of the ServiceBinding resource. It matches pattern | |
| // `projects/*/locations/*/serviceBindings/`. | |
| Name string `json:"name,omitempty"` | |
| // Service: Optional. The full Service Directory Service name of the format | |
| // `projects/*/locations/*/namespaces/*/services/*`. This field is for Service | |
| // Directory integration which will be deprecated soon. | |
| Service string `json:"service,omitempty"` | |
| // ServiceId: Output only. The unique identifier of the Service Directory | |
| // Service against which the ServiceBinding resource is validated. This is | |
| // populated when the Service Binding resource is used in another resource | |
| // (like Backend Service). This is of the UUID4 format. This field is for | |
| // Service Directory integration which will be deprecated soon. | |
| ServiceId string `json:"serviceId,omitempty"` | |
| // UpdateTime: Output only. The timestamp when the resource was updated. | |
| UpdateTime string `json:"updateTime,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "CreateTime") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "CreateTime") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ServiceBinding) MarshalJSON() ([]byte, error) { | |
| type NoMethod ServiceBinding | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ServiceLbPolicy: ServiceLbPolicy holds global load balancing and traffic | |
| // distribution configuration that can be applied to a BackendService. | |
| type ServiceLbPolicy struct { | |
| // AutoCapacityDrain: Optional. Configuration to automatically move traffic | |
| // away for unhealthy IG/NEG for the associated Backend Service. | |
| AutoCapacityDrain *ServiceLbPolicyAutoCapacityDrain `json:"autoCapacityDrain,omitempty"` | |
| // CreateTime: Output only. The timestamp when this resource was created. | |
| CreateTime string `json:"createTime,omitempty"` | |
| // Description: Optional. A free-text description of the resource. Max length | |
| // 1024 characters. | |
| Description string `json:"description,omitempty"` | |
| // FailoverConfig: Optional. Configuration related to health based failover. | |
| FailoverConfig *ServiceLbPolicyFailoverConfig `json:"failoverConfig,omitempty"` | |
| // IsolationConfig: Optional. Configuration to provide isolation support for | |
| // the associated Backend Service. | |
| IsolationConfig *ServiceLbPolicyIsolationConfig `json:"isolationConfig,omitempty"` | |
| // Labels: Optional. Set of label tags associated with the ServiceLbPolicy | |
| // resource. | |
| Labels map[string]string `json:"labels,omitempty"` | |
| // LoadBalancingAlgorithm: Optional. The type of load balancing algorithm to be | |
| // used. The default behavior is WATERFALL_BY_REGION. | |
| // | |
| // Possible values: | |
| // "LOAD_BALANCING_ALGORITHM_UNSPECIFIED" - The type of the loadbalancing | |
| // algorithm is unspecified. | |
| // "SPRAY_TO_WORLD" - Balance traffic across all backends across the world | |
| // proportionally based on capacity. | |
| // "SPRAY_TO_REGION" - Direct traffic to the nearest region with endpoints | |
| // and capacity before spilling over to other regions and spread the traffic | |
| // from each client to all the MIGs/NEGs in a region. | |
| // "WATERFALL_BY_REGION" - Direct traffic to the nearest region with | |
| // endpoints and capacity before spilling over to other regions. All MIGs/NEGs | |
| // within a region are evenly loaded but each client might not spread the | |
| // traffic to all the MIGs/NEGs in the region. | |
| // "WATERFALL_BY_ZONE" - Attempt to keep traffic in a single zone closest to | |
| // the client, before spilling over to other zones. | |
| LoadBalancingAlgorithm string `json:"loadBalancingAlgorithm,omitempty"` | |
| // Name: Identifier. Name of the ServiceLbPolicy resource. It matches pattern | |
| // `projects/{project}/locations/{location}/serviceLbPolicies/{service_lb_policy | |
| // _name}`. | |
| Name string `json:"name,omitempty"` | |
| // UpdateTime: Output only. The timestamp when this resource was last updated. | |
| UpdateTime string `json:"updateTime,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "AutoCapacityDrain") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "AutoCapacityDrain") to include in | |
| // API requests with the JSON null value. By default, fields with empty values | |
| // are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ServiceLbPolicy) MarshalJSON() ([]byte, error) { | |
| type NoMethod ServiceLbPolicy | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ServiceLbPolicyAutoCapacityDrain: Option to specify if an unhealthy IG/NEG | |
| // should be considered for global load balancing and traffic routing. | |
| type ServiceLbPolicyAutoCapacityDrain struct { | |
| // Enable: Optional. If set to 'True', an unhealthy IG/NEG will be set as | |
| // drained. - An IG/NEG is considered unhealthy if less than 25% of the | |
| // instances/endpoints in the IG/NEG are healthy. - This option will never | |
| // result in draining more than 50% of the configured IGs/NEGs for the Backend | |
| // Service. | |
| Enable bool `json:"enable,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "Enable") to unconditionally | |
| // include in API requests. By default, fields with empty or default values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Enable") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ServiceLbPolicyAutoCapacityDrain) MarshalJSON() ([]byte, error) { | |
| type NoMethod ServiceLbPolicyAutoCapacityDrain | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ServiceLbPolicyFailoverConfig: Option to specify health based failover | |
| // behavior. This is not related to Network load balancer FailoverPolicy. | |
| type ServiceLbPolicyFailoverConfig struct { | |
| // FailoverHealthThreshold: Optional. The percentage threshold that a load | |
| // balancer will begin to send traffic to failover backends. If the percentage | |
| // of endpoints in a MIG/NEG is smaller than this value, traffic would be sent | |
| // to failover backends if possible. This field should be set to a value | |
| // between 1 and 99. The default value is 50 for Global external HTTP(S) load | |
| // balancer (classic) and Proxyless service mesh, and 70 for others. | |
| FailoverHealthThreshold int64 `json:"failoverHealthThreshold,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "FailoverHealthThreshold") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "FailoverHealthThreshold") to | |
| // include in API requests with the JSON null value. By default, fields with | |
| // empty values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ServiceLbPolicyFailoverConfig) MarshalJSON() ([]byte, error) { | |
| type NoMethod ServiceLbPolicyFailoverConfig | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // ServiceLbPolicyIsolationConfig: Configuration to provide isolation support | |
| // for the associated Backend Service. | |
| type ServiceLbPolicyIsolationConfig struct { | |
| // IsolationGranularity: Optional. The isolation granularity of the load | |
| // balancer. | |
| // | |
| // Possible values: | |
| // "ISOLATION_GRANULARITY_UNSPECIFIED" - No isolation is configured for the | |
| // backend service. Traffic can overflow based on the load balancing algorithm. | |
| // "REGION" - Traffic for this service will be isolated at the cloud region | |
| // level. | |
| IsolationGranularity string `json:"isolationGranularity,omitempty"` | |
| // IsolationMode: Optional. The isolation mode of the load balancer. | |
| // | |
| // Possible values: | |
| // "ISOLATION_MODE_UNSPECIFIED" - No isolation mode is configured for the | |
| // backend service. | |
| // "NEAREST" - Traffic will be sent to the nearest region. | |
| // "STRICT" - Traffic will fail if no serving backends are available in the | |
| // same region as the load balancer. | |
| IsolationMode string `json:"isolationMode,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "IsolationGranularity") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "IsolationGranularity") to include | |
| // in API requests with the JSON null value. By default, fields with empty | |
| // values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s ServiceLbPolicyIsolationConfig) MarshalJSON() ([]byte, error) { | |
| type NoMethod ServiceLbPolicyIsolationConfig | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // Status: The `Status` type defines a logical error model that is suitable for | |
| // different programming environments, including REST APIs and RPC APIs. It is | |
| // used by gRPC (https://github.com/grpc). Each `Status` message contains three | |
| // pieces of data: error code, error message, and error details. You can find | |
| // out more about this error model and how to work with it in the API Design | |
| // Guide (https://cloud.google.com/apis/design/errors). | |
| type Status struct { | |
| // Code: The status code, which should be an enum value of google.rpc.Code. | |
| Code int64 `json:"code,omitempty"` | |
| // Details: A list of messages that carry the error details. There is a common | |
| // set of message types for APIs to use. | |
| Details []googleapi.RawMessage `json:"details,omitempty"` | |
| // Message: A developer-facing error message, which should be in English. Any | |
| // user-facing error message should be localized and sent in the | |
| // google.rpc.Status.details field, or localized by the client. | |
| Message string `json:"message,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "Code") to unconditionally | |
| // include in API requests. By default, fields with empty or default values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Code") to include in API requests | |
| // with the JSON null value. By default, fields with empty values are omitted | |
| // from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s Status) MarshalJSON() ([]byte, error) { | |
| type NoMethod Status | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // TcpRoute: TcpRoute is the resource defining how TCP traffic should be routed | |
| // by a Mesh/Gateway resource. | |
| type TcpRoute struct { | |
| // CreateTime: Output only. The timestamp when the resource was created. | |
| CreateTime string `json:"createTime,omitempty"` | |
| // Description: Optional. A free-text description of the resource. Max length | |
| // 1024 characters. | |
| Description string `json:"description,omitempty"` | |
| // Gateways: Optional. Gateways defines a list of gateways this TcpRoute is | |
| // attached to, as one of the routing rules to route the requests served by the | |
| // gateway. Each gateway reference should match the pattern: | |
| // `projects/*/locations/*/gateways/` | |
| Gateways []string `json:"gateways,omitempty"` | |
| // Labels: Optional. Set of label tags associated with the TcpRoute resource. | |
| Labels map[string]string `json:"labels,omitempty"` | |
| // Meshes: Optional. Meshes defines a list of meshes this TcpRoute is attached | |
| // to, as one of the routing rules to route the requests served by the mesh. | |
| // Each mesh reference should match the pattern: | |
| // `projects/*/locations/*/meshes/` The attached Mesh should be of a type | |
| // SIDECAR | |
| Meshes []string `json:"meshes,omitempty"` | |
| // Name: Identifier. Name of the TcpRoute resource. It matches pattern | |
| // `projects/*/locations/*/tcpRoutes/tcp_route_name>`. | |
| Name string `json:"name,omitempty"` | |
| // Rules: Required. Rules that define how traffic is routed and handled. At | |
| // least one RouteRule must be supplied. If there are multiple rules then the | |
| // action taken will be the first rule to match. | |
| Rules []*TcpRouteRouteRule `json:"rules,omitempty"` | |
| // SelfLink: Output only. Server-defined URL of this resource | |
| SelfLink string `json:"selfLink,omitempty"` | |
| // UpdateTime: Output only. The timestamp when the resource was updated. | |
| UpdateTime string `json:"updateTime,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "CreateTime") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "CreateTime") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s TcpRoute) MarshalJSON() ([]byte, error) { | |
| type NoMethod TcpRoute | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // TcpRouteRouteAction: The specifications for routing traffic and applying | |
| // associated policies. | |
| type TcpRouteRouteAction struct { | |
| // Destinations: Optional. The destination services to which traffic should be | |
| // forwarded. At least one destination service is required. Only one of route | |
| // destination or original destination can be set. | |
| Destinations []*TcpRouteRouteDestination `json:"destinations,omitempty"` | |
| // IdleTimeout: Optional. Specifies the idle timeout for the selected route. | |
| // The idle timeout is defined as the period in which there are no bytes sent | |
| // or received on either the upstream or downstream connection. If not set, the | |
| // default idle timeout is 30 seconds. If set to 0s, the timeout will be | |
| // disabled. | |
| IdleTimeout string `json:"idleTimeout,omitempty"` | |
| // OriginalDestination: Optional. If true, Router will use the destination IP | |
| // and port of the original connection as the destination of the request. | |
| // Default is false. Only one of route destinations or original destination can | |
| // be set. | |
| OriginalDestination bool `json:"originalDestination,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "Destinations") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Destinations") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s TcpRouteRouteAction) MarshalJSON() ([]byte, error) { | |
| type NoMethod TcpRouteRouteAction | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // TcpRouteRouteDestination: Describe the destination for traffic to be routed | |
| // to. | |
| type TcpRouteRouteDestination struct { | |
| // ServiceName: Required. The URL of a BackendService to route traffic to. | |
| ServiceName string `json:"serviceName,omitempty"` | |
| // Weight: Optional. Specifies the proportion of requests forwarded to the | |
| // backend referenced by the serviceName field. This is computed as: - | |
| // weight/Sum(weights in this destination list). For non-zero values, there may | |
| // be some epsilon from the exact proportion defined here depending on the | |
| // precision an implementation supports. If only one serviceName is specified | |
| // and it has a weight greater than 0, 100% of the traffic is forwarded to that | |
| // backend. If weights are specified for any one service name, they need to be | |
| // specified for all of them. If weights are unspecified for all services, | |
| // then, traffic is distributed in equal proportions to all of them. | |
| Weight int64 `json:"weight,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "ServiceName") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "ServiceName") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s TcpRouteRouteDestination) MarshalJSON() ([]byte, error) { | |
| type NoMethod TcpRouteRouteDestination | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // TcpRouteRouteMatch: RouteMatch defines the predicate used to match requests | |
| // to a given action. Multiple match types are "OR"ed for evaluation. If no | |
| // routeMatch field is specified, this rule will unconditionally match traffic. | |
| type TcpRouteRouteMatch struct { | |
| // Address: Required. Must be specified in the CIDR range format. A CIDR range | |
| // consists of an IP Address and a prefix length to construct the subnet mask. | |
| // By default, the prefix length is 32 (i.e. matches a single IP address). Only | |
| // IPV4 addresses are supported. Examples: "10.0.0.1" - matches against this | |
| // exact IP address. "10.0.0.0/8" - matches against any IP address within the | |
| // 10.0.0.0 subnet and 255.255.255.0 mask. "0.0.0.0/0" - matches against any IP | |
| // address'. | |
| Address string `json:"address,omitempty"` | |
| // Port: Required. Specifies the destination port to match against. | |
| Port string `json:"port,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "Address") to unconditionally | |
| // include in API requests. By default, fields with empty or default values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Address") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s TcpRouteRouteMatch) MarshalJSON() ([]byte, error) { | |
| type NoMethod TcpRouteRouteMatch | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // TcpRouteRouteRule: Specifies how to match traffic and how to route traffic | |
| // when traffic is matched. | |
| type TcpRouteRouteRule struct { | |
| // Action: Required. The detailed rule defining how to route matched traffic. | |
| Action *TcpRouteRouteAction `json:"action,omitempty"` | |
| // Matches: Optional. RouteMatch defines the predicate used to match requests | |
| // to a given action. Multiple match types are "OR"ed for evaluation. If no | |
| // routeMatch field is specified, this rule will unconditionally match traffic. | |
| Matches []*TcpRouteRouteMatch `json:"matches,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "Action") to unconditionally | |
| // include in API requests. By default, fields with empty or default values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Action") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s TcpRouteRouteRule) MarshalJSON() ([]byte, error) { | |
| type NoMethod TcpRouteRouteRule | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // TelemetryPolicy: Provides a configuration for telemetry. | |
| type TelemetryPolicy struct { | |
| // Annotations: Optional. User-provided annotations. | |
| Annotations map[string]string `json:"annotations,omitempty"` | |
| // CreateTime: Output only. Indicates the timestamp when the resource was | |
| // created. | |
| CreateTime string `json:"createTime,omitempty"` | |
| // DeleteTime: Output only. The time when this resource was soft-deleted. Only | |
| // populated if the resource is in the process of being deleted. | |
| DeleteTime string `json:"deleteTime,omitempty"` | |
| // DisplayName: Optional. Provides a human-readable name for the policy. | |
| DisplayName string `json:"displayName,omitempty"` | |
| // Etag: Provides a mechanism for optimistic concurrency control. If this is | |
| // provided, it must match the server's etag. If the provided etag does not | |
| // match the server's etag, the request will fail with a 409 ABORTED error. | |
| Etag string `json:"etag,omitempty"` | |
| // Labels: Optional. Set of label tags associated with the TelemetryPolicy | |
| // resource. | |
| Labels map[string]string `json:"labels,omitempty"` | |
| // MetricsConfiguration: Optional. Specifies the top-level configuration block | |
| // within the telemetry policy that contains all the settings for how metrics | |
| // will be applied to the target resources. | |
| MetricsConfiguration *MetricsConfiguration `json:"metricsConfiguration,omitempty"` | |
| // Name: Identifier. Represents the resource name of the policy. Format: | |
| // `projects/{project}/locations/{location}/telemetryPolicies/{telemetry_policy} | |
| // ` | |
| Name string `json:"name,omitempty"` | |
| // Reconciling: Output only. If true, the service is currently reconciling the | |
| // resource to the desired state. | |
| Reconciling bool `json:"reconciling,omitempty"` | |
| // TelemetryTarget: Required. Specifies the set of targets to which this | |
| // telemetry policy applies. | |
| TelemetryTarget *TelemetryTarget `json:"telemetryTarget,omitempty"` | |
| // TracingConfiguration: Optional. Specifies the top-level configuration block | |
| // within the telemetry policy that contains all the settings for how tracing | |
| // will be applied to the target resources. | |
| TracingConfiguration *TracingConfiguration `json:"tracingConfiguration,omitempty"` | |
| // Uid: Output only. Specifies the server-assigned unique identifier for the | |
| // policy. | |
| Uid string `json:"uid,omitempty"` | |
| // UpdateTime: Output only. Indicates the timestamp when the resource was last | |
| // updated. | |
| UpdateTime string `json:"updateTime,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "Annotations") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Annotations") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s TelemetryPolicy) MarshalJSON() ([]byte, error) { | |
| type NoMethod TelemetryPolicy | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // TelemetryTarget: Specifies the set of targets to which the TelemetryPolicy | |
| // should be applied. | |
| type TelemetryTarget struct { | |
| // Resources: Required. Lists references to the resources that are targeted by | |
| // the policy. Types of resources supported: - `run.googleapis.com/` - | |
| // `compute.googleapis.com/` - `networkservices.googleapis.com/` The format | |
| // must be the full resource name of a supported resource. Examples: | |
| // `//run.googleapis.com/projects/{project}/locations/{location}/services/{servi | |
| // ce}` | |
| // `//compute.googleapis.com/projects/my-project/global/forwardingRules/my-fr-1` | |
| // | |
| // `//compute.googleapis.com/projects/my-project/regions/us-central1/forwardingR | |
| // ules/my-fr-1` | |
| // `//networkservices.googleapis.com/projects/my-project/locations/us-central1/g | |
| // ateways/my-secure-web-proxy-gateway` | |
| // `//networkservices.googleapis.com/projects/my-project/locations/us-east1/agen | |
| // tGateways/my-agent-gateway` | |
| Resources []string `json:"resources,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "Resources") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Resources") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s TelemetryTarget) MarshalJSON() ([]byte, error) { | |
| type NoMethod TelemetryTarget | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // TlsRoute: TlsRoute defines how traffic should be routed based on SNI and | |
| // other matching L3 attributes. | |
| type TlsRoute struct { | |
| // CreateTime: Output only. The timestamp when the resource was created. | |
| CreateTime string `json:"createTime,omitempty"` | |
| // Description: Optional. A free-text description of the resource. Max length | |
| // 1024 characters. | |
| Description string `json:"description,omitempty"` | |
| // Gateways: Optional. Gateways defines a list of gateways this TlsRoute is | |
| // attached to, as one of the routing rules to route the requests served by the | |
| // gateway. Each gateway reference should match the pattern: | |
| // `projects/*/locations/*/gateways/` | |
| Gateways []string `json:"gateways,omitempty"` | |
| // Labels: Optional. Set of label tags associated with the TlsRoute resource. | |
| Labels map[string]string `json:"labels,omitempty"` | |
| // Meshes: Optional. Meshes defines a list of meshes this TlsRoute is attached | |
| // to, as one of the routing rules to route the requests served by the mesh. | |
| // Each mesh reference should match the pattern: | |
| // `projects/*/locations/*/meshes/` The attached Mesh should be of a type | |
| // SIDECAR | |
| Meshes []string `json:"meshes,omitempty"` | |
| // Name: Identifier. Name of the TlsRoute resource. It matches pattern | |
| // `projects/*/locations/*/tlsRoutes/tls_route_name>`. | |
| Name string `json:"name,omitempty"` | |
| // Rules: Required. Rules that define how traffic is routed and handled. At | |
| // least one RouteRule must be supplied. If there are multiple rules then the | |
| // action taken will be the first rule to match. | |
| Rules []*TlsRouteRouteRule `json:"rules,omitempty"` | |
| // SelfLink: Output only. Server-defined URL of this resource | |
| SelfLink string `json:"selfLink,omitempty"` | |
| // TargetProxies: Optional. TargetProxies defines a list of TargetTcpProxies | |
| // this TlsRoute is attached to, as one of the routing rules to route the | |
| // requests served by the TargetTcpProxy. Each TargetTcpProxy reference should | |
| // match the pattern: `projects/*/locations/*/targetTcpProxies/` | |
| TargetProxies []string `json:"targetProxies,omitempty"` | |
| // UpdateTime: Output only. The timestamp when the resource was updated. | |
| UpdateTime string `json:"updateTime,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "CreateTime") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "CreateTime") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s TlsRoute) MarshalJSON() ([]byte, error) { | |
| type NoMethod TlsRoute | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // TlsRouteRouteAction: The specifications for routing traffic and applying | |
| // associated policies. | |
| type TlsRouteRouteAction struct { | |
| // Destinations: Required. The destination services to which traffic should be | |
| // forwarded. At least one destination service is required. | |
| Destinations []*TlsRouteRouteDestination `json:"destinations,omitempty"` | |
| // IdleTimeout: Optional. Specifies the idle timeout for the selected route. | |
| // The idle timeout is defined as the period in which there are no bytes sent | |
| // or received on either the upstream or downstream connection. If not set, the | |
| // default idle timeout is 1 hour. If set to 0s, the timeout will be disabled. | |
| IdleTimeout string `json:"idleTimeout,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "Destinations") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Destinations") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s TlsRouteRouteAction) MarshalJSON() ([]byte, error) { | |
| type NoMethod TlsRouteRouteAction | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // TlsRouteRouteDestination: Describe the destination for traffic to be routed | |
| // to. | |
| type TlsRouteRouteDestination struct { | |
| // ServiceName: Required. The URL of a BackendService to route traffic to. | |
| ServiceName string `json:"serviceName,omitempty"` | |
| // Weight: Optional. Specifies the proportion of requests forwarded to the | |
| // backend referenced by the service_name field. This is computed as: - | |
| // weight/Sum(weights in destinations) Weights in all destinations does not | |
| // need to sum up to 100. | |
| Weight int64 `json:"weight,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "ServiceName") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "ServiceName") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s TlsRouteRouteDestination) MarshalJSON() ([]byte, error) { | |
| type NoMethod TlsRouteRouteDestination | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // TlsRouteRouteMatch: RouteMatch defines the predicate used to match requests | |
| // to a given action. Multiple match types are "AND"ed for evaluation. | |
| type TlsRouteRouteMatch struct { | |
| // Alpn: Optional. ALPN (Application-Layer Protocol Negotiation) to match | |
| // against. Examples: "http/1.1", "h2". At least one of sni_host and alpn is | |
| // required. Up to 5 alpns across all matches can be set. | |
| Alpn []string `json:"alpn,omitempty"` | |
| // SniHost: Optional. SNI (server name indicator) to match against. SNI will be | |
| // matched against all wildcard domains, i.e. `www.example.com` will be first | |
| // matched against `www.example.com`, then `*.example.com`, then `*.com.` | |
| // Partial wildcards are not supported, and values like *w.example.com are | |
| // invalid. At least one of sni_host and alpn is required. Up to 100 sni hosts | |
| // across all matches can be set. | |
| SniHost []string `json:"sniHost,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "Alpn") to unconditionally | |
| // include in API requests. By default, fields with empty or default values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Alpn") to include in API requests | |
| // with the JSON null value. By default, fields with empty values are omitted | |
| // from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s TlsRouteRouteMatch) MarshalJSON() ([]byte, error) { | |
| type NoMethod TlsRouteRouteMatch | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // TlsRouteRouteRule: Specifies how to match traffic and how to route traffic | |
| // when traffic is matched. | |
| type TlsRouteRouteRule struct { | |
| // Action: Required. The detailed rule defining how to route matched traffic. | |
| Action *TlsRouteRouteAction `json:"action,omitempty"` | |
| // Matches: Required. RouteMatch defines the predicate used to match requests | |
| // to a given action. Multiple match types are "OR"ed for evaluation. Atleast | |
| // one RouteMatch must be supplied. | |
| Matches []*TlsRouteRouteMatch `json:"matches,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "Action") to unconditionally | |
| // include in API requests. By default, fields with empty or default values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Action") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s TlsRouteRouteRule) MarshalJSON() ([]byte, error) { | |
| type NoMethod TlsRouteRouteRule | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // TracingConfiguration: Configuration for tracing collection. | |
| type TracingConfiguration struct { | |
| // CustomSpanAttributes: Optional. Provides key-value pairs for adding context | |
| // to spans. Supports literalValue (static) and fromHeaderValue (dynamic | |
| // extraction). | |
| CustomSpanAttributes []*TracingConfigurationCustomSpanAttribute `json:"customSpanAttributes,omitempty"` | |
| // ParentBasedSampling: Optional. Configures honoring a sampled bit in | |
| // downstream traceparentID headers. | |
| ParentBasedSampling *TracingConfigurationParentBasedSampling `json:"parentBasedSampling,omitempty"` | |
| // SamplingRate: Optional. Specifies the tracing sampling rate. The sampling | |
| // rate is a float number in the interval [0, 1]. The sampling rate is applied | |
| // to all requests to the targeted resources. The default value is 0.0. | |
| SamplingRate float64 `json:"samplingRate,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "CustomSpanAttributes") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "CustomSpanAttributes") to include | |
| // in API requests with the JSON null value. By default, fields with empty | |
| // values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s TracingConfiguration) MarshalJSON() ([]byte, error) { | |
| type NoMethod TracingConfiguration | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| func (s *TracingConfiguration) UnmarshalJSON(data []byte) error { | |
| type NoMethod TracingConfiguration | |
| var s1 struct { | |
| SamplingRate gensupport.JSONFloat64 `json:"samplingRate"` | |
| *NoMethod | |
| } | |
| s1.NoMethod = (*NoMethod)(s) | |
| if err := json.Unmarshal(data, &s1); err != nil { | |
| return err | |
| } | |
| s.SamplingRate = float64(s1.SamplingRate) | |
| return nil | |
| } | |
| // TracingConfigurationCustomSpanAttribute: Key-value pairs for adding context | |
| // to spans. Supports literal_value (static) and from_header_value (dynamic | |
| // extraction). Note: literal_value and from_header_value are mutually | |
| // exclusive, but at least one of them must be set. | |
| type TracingConfigurationCustomSpanAttribute struct { | |
| // AttributeName: Required. Defines the key for a custom attribute that is | |
| // added to the trace spans generated by the Google Cloud Load Balancer (GCLB). | |
| AttributeName string `json:"attributeName,omitempty"` | |
| // FromHeaderValue: Optional. Specifies an incoming request header name from | |
| // which the value for the custom span attribute should be dynamically | |
| // extracted. Note: the value of the header might be changed during the request | |
| // processing; in this case the resulting value will be stored. | |
| FromHeaderValue string `json:"fromHeaderValue,omitempty"` | |
| // LiteralValue: Optional. Assigns a static, constant value to the custom trace | |
| // span attribute defined by the corresponding attribute_name. | |
| LiteralValue string `json:"literalValue,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "AttributeName") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "AttributeName") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s TracingConfigurationCustomSpanAttribute) MarshalJSON() ([]byte, error) { | |
| type NoMethod TracingConfigurationCustomSpanAttribute | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // TracingConfigurationParentBasedSampling: Configures honoring a sampled bit | |
| // in downstream traceparentID headers. | |
| type TracingConfigurationParentBasedSampling struct { | |
| // Enabled: Optional. Provides a master switch to respect a sampled bit in | |
| // incoming traceparentID headers. Default is false. | |
| Enabled bool `json:"enabled,omitempty"` | |
| // SamplingRate: Optional. Specifies the sampling rate to use when the sampled | |
| // bit is set in the incoming traceparentID header. | |
| SamplingRate float64 `json:"samplingRate,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "Enabled") to unconditionally | |
| // include in API requests. By default, fields with empty or default values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Enabled") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s TracingConfigurationParentBasedSampling) MarshalJSON() ([]byte, error) { | |
| type NoMethod TracingConfigurationParentBasedSampling | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| func (s *TracingConfigurationParentBasedSampling) UnmarshalJSON(data []byte) error { | |
| type NoMethod TracingConfigurationParentBasedSampling | |
| var s1 struct { | |
| SamplingRate gensupport.JSONFloat64 `json:"samplingRate"` | |
| *NoMethod | |
| } | |
| s1.NoMethod = (*NoMethod)(s) | |
| if err := json.Unmarshal(data, &s1); err != nil { | |
| return err | |
| } | |
| s.SamplingRate = float64(s1.SamplingRate) | |
| return nil | |
| } | |
| // TrafficPortSelector: Specification of a port-based selector. | |
| type TrafficPortSelector struct { | |
| // Ports: Optional. A list of ports. Can be port numbers or port range | |
| // (example, [80-90] specifies all ports from 80 to 90, including 80 and 90) or | |
| // named ports or * to specify all ports. If the list is empty, all ports are | |
| // selected. | |
| Ports []string `json:"ports,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "Ports") to unconditionally | |
| // include in API requests. By default, fields with empty or default values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Ports") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s TrafficPortSelector) MarshalJSON() ([]byte, error) { | |
| type NoMethod TrafficPortSelector | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // WasmPlugin: `WasmPlugin` is a resource representing a service executing a | |
| // customer-provided Wasm module. | |
| type WasmPlugin struct { | |
| // CreateTime: Output only. The timestamp when the resource was created. | |
| CreateTime string `json:"createTime,omitempty"` | |
| // Description: Optional. A human-readable description of the resource. | |
| Description string `json:"description,omitempty"` | |
| // KmsKeyName: Optional. The name of the customer-managed CryptoKey | |
| // (https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys) | |
| // to be used to encrypt the `WasmPlugin` image (provided by image_uri) and | |
| // configuration (provided by plugin_config_data or plugin_config_uri) that are | |
| // stored by the `Service Extensions` product at rest. Format: | |
| // `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}` | |
| // By default, Google Cloud automatically encrypts all data at rest using | |
| // Google-owned and Google-managed encryption keys. If you need ownership and | |
| // control of the keys that protect your data at rest, you can specify a | |
| // customer-managed encryption key (CMEK) to encrypt your `WasmPlugin` data. | |
| // For more information, see Using customer-managed encryption keys | |
| // (https://cloud.google.com/service-extensions/docs/cmek). | |
| KmsKeyName string `json:"kmsKeyName,omitempty"` | |
| // KmsKeyVersion: Output only. The name of the specific CryptoKeyVersion | |
| // (https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions) | |
| // used to encrypt the `WasmPlugin` data, if the kms_key_name field is set. | |
| // Format: | |
| // `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}/ | |
| // cryptoKeyVersions/{version}` This is a read-only field. `WasmPlugin` data is | |
| // automatically encrypted using the most recent `CryptoKeyVersion` of the | |
| // `CryptoKey` provided in the `kms_key_name` field. See Cloud KMS resources | |
| // (https://cloud.google.com/kms/docs/resource-hierarchy) for more information. | |
| KmsKeyVersion string `json:"kmsKeyVersion,omitempty"` | |
| // Labels: Optional. Set of labels associated with the `WasmPlugin` resource. | |
| // The format must comply with the following requirements | |
| // (/compute/docs/labeling-resources#requirements). | |
| Labels map[string]string `json:"labels,omitempty"` | |
| // LogConfig: Optional. Specifies the logging options for the activity | |
| // performed by this plugin. If logging is enabled, plugin logs are exported to | |
| // Cloud Logging. Note that the settings relate to the logs generated by using | |
| // logging statements in your Wasm code. | |
| LogConfig *WasmPluginLogConfig `json:"logConfig,omitempty"` | |
| // MainVersionId: Optional. The ID of the `WasmPluginVersion` resource that is | |
| // the currently serving one. The version referred to must be a child of this | |
| // `WasmPlugin` resource. | |
| MainVersionId string `json:"mainVersionId,omitempty"` | |
| // Name: Identifier. Name of the `WasmPlugin` resource in the following format: | |
| // `projects/{project}/locations/{location}/wasmPlugins/{wasm_plugin}`. | |
| Name string `json:"name,omitempty"` | |
| // UpdateTime: Output only. The timestamp when the resource was updated. | |
| UpdateTime string `json:"updateTime,omitempty"` | |
| // UsedBy: Output only. List of all extensions | |
| // (https://cloud.google.com/service-extensions/docs/overview) that use this | |
| // `WasmPlugin` resource. | |
| UsedBy []*WasmPluginUsedBy `json:"usedBy,omitempty"` | |
| // Versions: Optional. All versions of this `WasmPlugin` resource in the | |
| // key-value format. The key is the resource ID, and the value is the | |
| // `VersionDetails` object. Lets you create or update a `WasmPlugin` resource | |
| // and its versions in a single request. When the `main_version_id` field is | |
| // not empty, it must point to one of the `VersionDetails` objects in the map. | |
| // If provided in a `PATCH` request, the new versions replace the previous set. | |
| // Any version omitted from the `versions` field is removed. Because the | |
| // `WasmPluginVersion` resource is immutable, if a `WasmPluginVersion` resource | |
| // with the same name already exists and differs, the request fails. Note: In a | |
| // `GET` request, this field is populated only if the field | |
| // `GetWasmPluginRequest.view` is set to `WASM_PLUGIN_VIEW_FULL`. | |
| Versions map[string]WasmPluginVersionDetails `json:"versions,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "CreateTime") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "CreateTime") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s WasmPlugin) MarshalJSON() ([]byte, error) { | |
| type NoMethod WasmPlugin | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // WasmPluginLogConfig: Specifies the logging options for the activity | |
| // performed by this plugin. If logging is enabled, plugin logs are exported to | |
| // Cloud Logging. | |
| type WasmPluginLogConfig struct { | |
| // Enable: Optional. Specifies whether to enable logging for activity by this | |
| // plugin. Defaults to `false`. | |
| Enable bool `json:"enable,omitempty"` | |
| // MinLogLevel: Optional. Non-empty default. Specifies the lowest level of the | |
| // plugin logs that are exported to Cloud Logging. This setting relates to the | |
| // logs generated by using logging statements in your Wasm code. This field is | |
| // can be set only if logging is enabled for the plugin. If the field is not | |
| // provided when logging is enabled, it is set to `INFO` by default. | |
| // | |
| // Possible values: | |
| // "LOG_LEVEL_UNSPECIFIED" - Unspecified value. Defaults to `LogLevel.INFO`. | |
| // "TRACE" - Report logs with TRACE level and above. | |
| // "DEBUG" - Report logs with DEBUG level and above. | |
| // "INFO" - Report logs with INFO level and above. | |
| // "WARN" - Report logs with WARN level and above. | |
| // "ERROR" - Report logs with ERROR level and above. | |
| // "CRITICAL" - Report logs with CRITICAL level only. | |
| MinLogLevel string `json:"minLogLevel,omitempty"` | |
| // SampleRate: Optional. Non-empty default. Configures the sampling rate of | |
| // activity logs, where `1.0` means all logged activity is reported and `0.0` | |
| // means no activity is reported. A floating point value between `0.0` and | |
| // `1.0` indicates that a percentage of log messages is stored. The default | |
| // value when logging is enabled is `1.0`. The value of the field must be | |
| // between `0` and `1` (inclusive). This field can be specified only if logging | |
| // is enabled for this plugin. | |
| SampleRate float64 `json:"sampleRate,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "Enable") to unconditionally | |
| // include in API requests. By default, fields with empty or default values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Enable") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s WasmPluginLogConfig) MarshalJSON() ([]byte, error) { | |
| type NoMethod WasmPluginLogConfig | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| func (s *WasmPluginLogConfig) UnmarshalJSON(data []byte) error { | |
| type NoMethod WasmPluginLogConfig | |
| var s1 struct { | |
| SampleRate gensupport.JSONFloat64 `json:"sampleRate"` | |
| *NoMethod | |
| } | |
| s1.NoMethod = (*NoMethod)(s) | |
| if err := json.Unmarshal(data, &s1); err != nil { | |
| return err | |
| } | |
| s.SampleRate = float64(s1.SampleRate) | |
| return nil | |
| } | |
| // WasmPluginUsedBy: Defines a resource that uses the `WasmPlugin` resource. | |
| type WasmPluginUsedBy struct { | |
| // Name: Output only. Full name of the resource | |
| // https://google.aip.dev/122#full-resource-names, for example | |
| // `//networkservices.googleapis.com/projects/{project}/locations/{location}/lbR | |
| // outeExtensions/{extension}` | |
| Name string `json:"name,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "Name") to unconditionally | |
| // include in API requests. By default, fields with empty or default values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "Name") to include in API requests | |
| // with the JSON null value. By default, fields with empty values are omitted | |
| // from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s WasmPluginUsedBy) MarshalJSON() ([]byte, error) { | |
| type NoMethod WasmPluginUsedBy | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // WasmPluginVersion: A single immutable version of a `WasmPlugin` resource. | |
| // Defines the Wasm module used and optionally its runtime config. | |
| type WasmPluginVersion struct { | |
| // CreateTime: Output only. The timestamp when the resource was created. | |
| CreateTime string `json:"createTime,omitempty"` | |
| // Description: Optional. A human-readable description of the resource. | |
| Description string `json:"description,omitempty"` | |
| // ImageDigest: Output only. This field holds the digest (usually checksum) | |
| // value for the plugin image. The value is calculated based on the `image_uri` | |
| // field. If the `image_uri` field refers to a container image, the digest | |
| // value is obtained from the container image. If the `image_uri` field refers | |
| // to a generic artifact, the digest value is calculated based on the contents | |
| // of the file. | |
| ImageDigest string `json:"imageDigest,omitempty"` | |
| // ImageUri: Optional. URI of the image containing the Wasm module, stored in | |
| // Artifact Registry. The URI can refer to one of the following repository | |
| // formats: * Container images: the `image_uri` must point to a container that | |
| // contains a single file with the name `plugin.wasm`. When a new | |
| // `WasmPluginVersion` resource is created, the digest of the image is saved in | |
| // the `image_digest` field. When pulling a container image from Artifact | |
| // Registry, the digest value is used instead of an image tag. * Generic | |
| // artifacts: the `image_uri` must be in this format: | |
| // `projects/{project}/locations/{location}/repositories/{repository}/ | |
| // genericArtifacts/{package}:{version}`. The specified package and version | |
| // must contain a file with the name `plugin.wasm`. When a new | |
| // `WasmPluginVersion` resource is created, the checksum of the contents of the | |
| // file is saved in the `image_digest` field. | |
| ImageUri string `json:"imageUri,omitempty"` | |
| // Labels: Optional. Set of labels associated with the `WasmPluginVersion` | |
| // resource. | |
| Labels map[string]string `json:"labels,omitempty"` | |
| // Name: Identifier. Name of the `WasmPluginVersion` resource in the following | |
| // format: `projects/{project}/locations/{location}/wasmPlugins/{wasm_plugin}/ | |
| // versions/{wasm_plugin_version}`. | |
| Name string `json:"name,omitempty"` | |
| // PluginConfigData: Configuration for the plugin. The configuration is | |
| // provided to the plugin at runtime through the `ON_CONFIGURE` callback. When | |
| // a new `WasmPluginVersion` resource is created, the digest of the contents is | |
| // saved in the `plugin_config_digest` field. | |
| PluginConfigData string `json:"pluginConfigData,omitempty"` | |
| // PluginConfigDigest: Output only. This field holds the digest (usually | |
| // checksum) value for the plugin configuration. The value is calculated based | |
| // on the contents of `plugin_config_data` field or the image defined by the | |
| // `plugin_config_uri` field. | |
| PluginConfigDigest string `json:"pluginConfigDigest,omitempty"` | |
| // PluginConfigUri: URI of the plugin configuration stored in the Artifact | |
| // Registry. The configuration is provided to the plugin at runtime through the | |
| // `ON_CONFIGURE` callback. The URI can refer to one of the following | |
| // repository formats: * Container images: the `plugin_config_uri` must point | |
| // to a container that contains a single file with the name `plugin.config`. | |
| // When a new `WasmPluginVersion` resource is created, the digest of the image | |
| // is saved in the `plugin_config_digest` field. When pulling a container image | |
| // from Artifact Registry, the digest value is used instead of an image tag. * | |
| // Generic artifacts: the `plugin_config_uri` must be in this format: | |
| // `projects/{project}/locations/{location}/repositories/{repository}/ | |
| // genericArtifacts/{package}:{version}`. The specified package and version | |
| // must contain a file with the name `plugin.config`. When a new | |
| // `WasmPluginVersion` resource is created, the checksum of the contents of the | |
| // file is saved in the `plugin_config_digest` field. | |
| PluginConfigUri string `json:"pluginConfigUri,omitempty"` | |
| // UpdateTime: Output only. The timestamp when the resource was updated. | |
| UpdateTime string `json:"updateTime,omitempty"` | |
| // ServerResponse contains the HTTP response code and headers from the server. | |
| googleapi.ServerResponse `json:"-"` | |
| // ForceSendFields is a list of field names (e.g. "CreateTime") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "CreateTime") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s WasmPluginVersion) MarshalJSON() ([]byte, error) { | |
| type NoMethod WasmPluginVersion | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| // WasmPluginVersionDetails: Details of a `WasmPluginVersion` resource to be | |
| // inlined in the `WasmPlugin` resource. | |
| type WasmPluginVersionDetails struct { | |
| // CreateTime: Output only. The timestamp when the resource was created. | |
| CreateTime string `json:"createTime,omitempty"` | |
| // Description: Optional. A human-readable description of the resource. | |
| Description string `json:"description,omitempty"` | |
| // ImageDigest: Output only. This field holds the digest (usually checksum) | |
| // value for the plugin image. The value is calculated based on the `image_uri` | |
| // field. If the `image_uri` field refers to a container image, the digest | |
| // value is obtained from the container image. If the `image_uri` field refers | |
| // to a generic artifact, the digest value is calculated based on the contents | |
| // of the file. | |
| ImageDigest string `json:"imageDigest,omitempty"` | |
| // ImageUri: Optional. URI of the image containing the Wasm module, stored in | |
| // Artifact Registry. The URI can refer to one of the following repository | |
| // formats: * Container images: the `image_uri` must point to a container that | |
| // contains a single file with the name `plugin.wasm`. When a new | |
| // `WasmPluginVersion` resource is created, the digest of the image is saved in | |
| // the `image_digest` field. When pulling a container image from Artifact | |
| // Registry, the digest value is used instead of an image tag. * Generic | |
| // artifacts: the `image_uri` must be in this format: | |
| // `projects/{project}/locations/{location}/repositories/{repository}/ | |
| // genericArtifacts/{package}:{version}`. The specified package and version | |
| // must contain a file with the name `plugin.wasm`. When a new | |
| // `WasmPluginVersion` resource is created, the checksum of the contents of the | |
| // file is saved in the `image_digest` field. | |
| ImageUri string `json:"imageUri,omitempty"` | |
| // Labels: Optional. Set of labels associated with the `WasmPluginVersion` | |
| // resource. | |
| Labels map[string]string `json:"labels,omitempty"` | |
| // PluginConfigData: Configuration for the plugin. The configuration is | |
| // provided to the plugin at runtime through the `ON_CONFIGURE` callback. When | |
| // a new `WasmPluginVersion` version is created, the digest of the contents is | |
| // saved in the `plugin_config_digest` field. | |
| PluginConfigData string `json:"pluginConfigData,omitempty"` | |
| // PluginConfigDigest: Output only. This field holds the digest (usually | |
| // checksum) value for the plugin configuration. The value is calculated based | |
| // on the contents of `plugin_config_data` field or the image defined by the | |
| // `plugin_config_uri` field. | |
| PluginConfigDigest string `json:"pluginConfigDigest,omitempty"` | |
| // PluginConfigUri: URI of the plugin configuration stored in the Artifact | |
| // Registry. The configuration is provided to the plugin at runtime through the | |
| // `ON_CONFIGURE` callback. The URI can refer to one of the following | |
| // repository formats: * Container images: the `plugin_config_uri` must point | |
| // to a container that contains a single file with the name `plugin.config`. | |
| // When a new `WasmPluginVersion` resource is created, the digest of the image | |
| // is saved in the `plugin_config_digest` field. When pulling a container image | |
| // from Artifact Registry, the digest value is used instead of an image tag. * | |
| // Generic artifacts: the `plugin_config_uri` must be in this format: | |
| // `projects/{project}/locations/{location}/repositories/{repository}/ | |
| // genericArtifacts/{package}:{version}`. The specified package and version | |
| // must contain a file with the name `plugin.config`. When a new | |
| // `WasmPluginVersion` resource is created, the checksum of the contents of the | |
| // file is saved in the `plugin_config_digest` field. | |
| PluginConfigUri string `json:"pluginConfigUri,omitempty"` | |
| // UpdateTime: Output only. The timestamp when the resource was updated. | |
| UpdateTime string `json:"updateTime,omitempty"` | |
| // ForceSendFields is a list of field names (e.g. "CreateTime") to | |
| // unconditionally include in API requests. By default, fields with empty or | |
| // default values are omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more | |
| // details. | |
| ForceSendFields []string `json:"-"` | |
| // NullFields is a list of field names (e.g. "CreateTime") to include in API | |
| // requests with the JSON null value. By default, fields with empty values are | |
| // omitted from API requests. See | |
| // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. | |
| NullFields []string `json:"-"` | |
| } | |
| func (s WasmPluginVersionDetails) MarshalJSON() ([]byte, error) { | |
| type NoMethod WasmPluginVersionDetails | |
| return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) | |
| } | |
| type ProjectsLocationsGetCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Get: Gets information about a location. | |
| // | |
| // - name: Resource name for the location. | |
| func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall { | |
| c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsGetCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.get", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.get" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Location.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Location{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.get", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsListCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // List: Lists information about the supported locations for this service. This | |
| // method lists locations based on the resource scope provided in the | |
| // ListLocationsRequest.name field: * **Global locations**: If `name` is empty, | |
| // the method lists the public locations available to all projects. * | |
| // **Project-specific locations**: If `name` follows the format | |
| // `projects/{project}`, the method lists locations visible to that specific | |
| // project. This includes public, private, or other project-specific locations | |
| // enabled for the project. For gRPC and client library implementations, the | |
| // resource name is passed as the `name` field. For direct service calls, the | |
| // resource name is incorporated into the request path based on the specific | |
| // service implementation and version. | |
| // | |
| // - name: The resource that owns the locations collection, if applicable. | |
| func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall { | |
| c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // ExtraLocationTypes sets the optional parameter "extraLocationTypes": Do not | |
| // use this field unless explicitly documented otherwise. This is primarily for | |
| // internal usage. | |
| func (c *ProjectsLocationsListCall) ExtraLocationTypes(extraLocationTypes ...string) *ProjectsLocationsListCall { | |
| c.urlParams_.SetMulti("extraLocationTypes", append([]string{}, extraLocationTypes...)) | |
| return c | |
| } | |
| // Filter sets the optional parameter "filter": A filter to narrow down results | |
| // to a preferred subset. The filtering language accepts strings like | |
| // "displayName=tokyo", and is documented in more detail in AIP-160 | |
| // (https://google.aip.dev/160). | |
| func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall { | |
| c.urlParams_.Set("filter", filter) | |
| return c | |
| } | |
| // PageSize sets the optional parameter "pageSize": The maximum number of | |
| // results to return. If not set, the service selects a default. | |
| func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall { | |
| c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) | |
| return c | |
| } | |
| // PageToken sets the optional parameter "pageToken": A page token received | |
| // from the `next_page_token` field in the response. Send that page token to | |
| // receive the subsequent page. | |
| func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall { | |
| c.urlParams_.Set("pageToken", pageToken) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsListCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/locations") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.list", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.list" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *ListLocationsResponse.ServerResponse.Header or (if a response was returned | |
| // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to | |
| // check whether the returned error was because http.StatusNotModified was | |
| // returned. | |
| func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &ListLocationsResponse{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.list", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| // Pages invokes f for each page of results. | |
| // A non-nil error returned from f will halt the iteration. | |
| // The provided context supersedes any context provided to the Context method. | |
| func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error { | |
| c.ctx_ = ctx | |
| defer c.PageToken(c.urlParams_.Get("pageToken")) | |
| for { | |
| x, err := c.Do() | |
| if err != nil { | |
| return err | |
| } | |
| if err := f(x); err != nil { | |
| return err | |
| } | |
| if x.NextPageToken == "" { | |
| return nil | |
| } | |
| c.PageToken(x.NextPageToken) | |
| } | |
| } | |
| type ProjectsLocationsAgentConnectivityTemplatesCreateCall struct { | |
| s *Service | |
| parent string | |
| agentconnectivitytemplate *AgentConnectivityTemplate | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Create: Creates a new AgentConnectivityTemplate in a given project and | |
| // location. | |
| // | |
| // - parent: The parent resource of the AgentConnectivityTemplate. Must be in | |
| // the format `projects/*/locations/*`. | |
| func (r *ProjectsLocationsAgentConnectivityTemplatesService) Create(parent string, agentconnectivitytemplate *AgentConnectivityTemplate) *ProjectsLocationsAgentConnectivityTemplatesCreateCall { | |
| c := &ProjectsLocationsAgentConnectivityTemplatesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| c.agentconnectivitytemplate = agentconnectivitytemplate | |
| return c | |
| } | |
| // AgentConnectivityTemplateId sets the optional parameter | |
| // "agentConnectivityTemplateId": Required. Short name of the | |
| // AgentConnectivityTemplate resource to be created. | |
| func (c *ProjectsLocationsAgentConnectivityTemplatesCreateCall) AgentConnectivityTemplateId(agentConnectivityTemplateId string) *ProjectsLocationsAgentConnectivityTemplatesCreateCall { | |
| c.urlParams_.Set("agentConnectivityTemplateId", agentConnectivityTemplateId) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsAgentConnectivityTemplatesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsAgentConnectivityTemplatesCreateCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsAgentConnectivityTemplatesCreateCall) Context(ctx context.Context) *ProjectsLocationsAgentConnectivityTemplatesCreateCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsAgentConnectivityTemplatesCreateCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsAgentConnectivityTemplatesCreateCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.agentconnectivitytemplate) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/agentConnectivityTemplates") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("POST", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.agentConnectivityTemplates.create", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.agentConnectivityTemplates.create" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsAgentConnectivityTemplatesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.agentConnectivityTemplates.create", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsAgentConnectivityTemplatesDeleteCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Delete: Deletes a single AgentConnectivityTemplate. | |
| // | |
| // - name: A name of the AgentConnectivityTemplate to delete. Must be in the | |
| // format `projects/*/locations/*/agentConnectivityTemplates/*`. | |
| func (r *ProjectsLocationsAgentConnectivityTemplatesService) Delete(name string) *ProjectsLocationsAgentConnectivityTemplatesDeleteCall { | |
| c := &ProjectsLocationsAgentConnectivityTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Etag sets the optional parameter "etag": The etag of the | |
| // AgentConnectivityTemplate to delete. | |
| func (c *ProjectsLocationsAgentConnectivityTemplatesDeleteCall) Etag(etag string) *ProjectsLocationsAgentConnectivityTemplatesDeleteCall { | |
| c.urlParams_.Set("etag", etag) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsAgentConnectivityTemplatesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsAgentConnectivityTemplatesDeleteCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsAgentConnectivityTemplatesDeleteCall) Context(ctx context.Context) *ProjectsLocationsAgentConnectivityTemplatesDeleteCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsAgentConnectivityTemplatesDeleteCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsAgentConnectivityTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("DELETE", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.agentConnectivityTemplates.delete", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.agentConnectivityTemplates.delete" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsAgentConnectivityTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.agentConnectivityTemplates.delete", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsAgentConnectivityTemplatesGetCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Get: Gets details of a single AgentConnectivityTemplate. | |
| // | |
| // - name: A name of the AgentConnectivityTemplate to get. Must be in the | |
| // format `projects/*/locations/*/agentConnectivityTemplates/*`. | |
| func (r *ProjectsLocationsAgentConnectivityTemplatesService) Get(name string) *ProjectsLocationsAgentConnectivityTemplatesGetCall { | |
| c := &ProjectsLocationsAgentConnectivityTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsAgentConnectivityTemplatesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsAgentConnectivityTemplatesGetCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsAgentConnectivityTemplatesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsAgentConnectivityTemplatesGetCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsAgentConnectivityTemplatesGetCall) Context(ctx context.Context) *ProjectsLocationsAgentConnectivityTemplatesGetCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsAgentConnectivityTemplatesGetCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsAgentConnectivityTemplatesGetCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.agentConnectivityTemplates.get", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.agentConnectivityTemplates.get" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *AgentConnectivityTemplate.ServerResponse.Header or (if a response was | |
| // returned at all) in error.(*googleapi.Error).Header. Use | |
| // googleapi.IsNotModified to check whether the returned error was because | |
| // http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsAgentConnectivityTemplatesGetCall) Do(opts ...googleapi.CallOption) (*AgentConnectivityTemplate, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &AgentConnectivityTemplate{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.agentConnectivityTemplates.get", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsAgentConnectivityTemplatesListCall struct { | |
| s *Service | |
| parent string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // List: Lists AgentConnectivityTemplates in a given project and location. | |
| // | |
| // - parent: The project and location from which the AgentConnectivityTemplates | |
| // should be listed, specified in the format `projects/*/locations/*`. | |
| func (r *ProjectsLocationsAgentConnectivityTemplatesService) List(parent string) *ProjectsLocationsAgentConnectivityTemplatesListCall { | |
| c := &ProjectsLocationsAgentConnectivityTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| return c | |
| } | |
| // PageSize sets the optional parameter "pageSize": Maximum number of | |
| // AgentConnectivityTemplates to return per call. | |
| func (c *ProjectsLocationsAgentConnectivityTemplatesListCall) PageSize(pageSize int64) *ProjectsLocationsAgentConnectivityTemplatesListCall { | |
| c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) | |
| return c | |
| } | |
| // PageToken sets the optional parameter "pageToken": The value returned by the | |
| // last `ListAgentConnectivityTemplatesResponse` Indicates that this is a | |
| // continuation of a prior `ListAgentConnectivityTemplates` call, and that the | |
| // system should return the next page of data. | |
| func (c *ProjectsLocationsAgentConnectivityTemplatesListCall) PageToken(pageToken string) *ProjectsLocationsAgentConnectivityTemplatesListCall { | |
| c.urlParams_.Set("pageToken", pageToken) | |
| return c | |
| } | |
| // ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": If | |
| // true, allow partial responses for multi-regional Aggregated List requests. | |
| // Otherwise if one of the locations is down or unreachable, the Aggregated | |
| // List request will fail. | |
| func (c *ProjectsLocationsAgentConnectivityTemplatesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *ProjectsLocationsAgentConnectivityTemplatesListCall { | |
| c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsAgentConnectivityTemplatesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsAgentConnectivityTemplatesListCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsAgentConnectivityTemplatesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsAgentConnectivityTemplatesListCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsAgentConnectivityTemplatesListCall) Context(ctx context.Context) *ProjectsLocationsAgentConnectivityTemplatesListCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsAgentConnectivityTemplatesListCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsAgentConnectivityTemplatesListCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/agentConnectivityTemplates") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.agentConnectivityTemplates.list", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.agentConnectivityTemplates.list" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *ListAgentConnectivityTemplatesResponse.ServerResponse.Header or (if a | |
| // response was returned at all) in error.(*googleapi.Error).Header. Use | |
| // googleapi.IsNotModified to check whether the returned error was because | |
| // http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsAgentConnectivityTemplatesListCall) Do(opts ...googleapi.CallOption) (*ListAgentConnectivityTemplatesResponse, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &ListAgentConnectivityTemplatesResponse{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.agentConnectivityTemplates.list", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| // Pages invokes f for each page of results. | |
| // A non-nil error returned from f will halt the iteration. | |
| // The provided context supersedes any context provided to the Context method. | |
| func (c *ProjectsLocationsAgentConnectivityTemplatesListCall) Pages(ctx context.Context, f func(*ListAgentConnectivityTemplatesResponse) error) error { | |
| c.ctx_ = ctx | |
| defer c.PageToken(c.urlParams_.Get("pageToken")) | |
| for { | |
| x, err := c.Do() | |
| if err != nil { | |
| return err | |
| } | |
| if err := f(x); err != nil { | |
| return err | |
| } | |
| if x.NextPageToken == "" { | |
| return nil | |
| } | |
| c.PageToken(x.NextPageToken) | |
| } | |
| } | |
| type ProjectsLocationsAgentConnectivityTemplatesPatchCall struct { | |
| s *Service | |
| name string | |
| agentconnectivitytemplate *AgentConnectivityTemplate | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Patch: Updates the parameters of a single AgentConnectivityTemplate. | |
| // | |
| // - name: Identifier. Name of the AgentConnectivityTemplate resource. It | |
| // matches pattern `projects/*/locations/*/agentConnectivityTemplates/`. | |
| func (r *ProjectsLocationsAgentConnectivityTemplatesService) Patch(name string, agentconnectivitytemplate *AgentConnectivityTemplate) *ProjectsLocationsAgentConnectivityTemplatesPatchCall { | |
| c := &ProjectsLocationsAgentConnectivityTemplatesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| c.agentconnectivitytemplate = agentconnectivitytemplate | |
| return c | |
| } | |
| // UpdateMask sets the optional parameter "updateMask": Field mask is used to | |
| // specify the fields to be overwritten in the AgentConnectivityTemplate | |
| // resource by the update. The fields specified in the update_mask are relative | |
| // to the resource, not the full request. A field will be overwritten if it is | |
| // in the mask. If the user does not provide a mask then all fields will be | |
| // overwritten. | |
| func (c *ProjectsLocationsAgentConnectivityTemplatesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsAgentConnectivityTemplatesPatchCall { | |
| c.urlParams_.Set("updateMask", updateMask) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsAgentConnectivityTemplatesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsAgentConnectivityTemplatesPatchCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsAgentConnectivityTemplatesPatchCall) Context(ctx context.Context) *ProjectsLocationsAgentConnectivityTemplatesPatchCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsAgentConnectivityTemplatesPatchCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsAgentConnectivityTemplatesPatchCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.agentconnectivitytemplate) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("PATCH", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.agentConnectivityTemplates.patch", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.agentConnectivityTemplates.patch" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsAgentConnectivityTemplatesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.agentConnectivityTemplates.patch", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsAgentGatewaysCreateCall struct { | |
| s *Service | |
| parent string | |
| agentgateway *AgentGateway | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Create: Creates a new AgentGateway in a given project and location. | |
| // | |
| // - parent: The parent resource of the AgentGateway. Must be in the format | |
| // `projects/*/locations/*`. | |
| func (r *ProjectsLocationsAgentGatewaysService) Create(parent string, agentgateway *AgentGateway) *ProjectsLocationsAgentGatewaysCreateCall { | |
| c := &ProjectsLocationsAgentGatewaysCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| c.agentgateway = agentgateway | |
| return c | |
| } | |
| // AgentGatewayId sets the optional parameter "agentGatewayId": Required. Short | |
| // name of the AgentGateway resource to be created. | |
| func (c *ProjectsLocationsAgentGatewaysCreateCall) AgentGatewayId(agentGatewayId string) *ProjectsLocationsAgentGatewaysCreateCall { | |
| c.urlParams_.Set("agentGatewayId", agentGatewayId) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsAgentGatewaysCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsAgentGatewaysCreateCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsAgentGatewaysCreateCall) Context(ctx context.Context) *ProjectsLocationsAgentGatewaysCreateCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsAgentGatewaysCreateCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsAgentGatewaysCreateCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.agentgateway) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/agentGateways") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("POST", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.agentGateways.create", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.agentGateways.create" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsAgentGatewaysCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.agentGateways.create", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsAgentGatewaysDeleteCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Delete: Deletes a single AgentGateway. | |
| // | |
| // - name: A name of the AgentGateway to delete. Must be in the format | |
| // `projects/*/locations/*/agentGateways/*`. | |
| func (r *ProjectsLocationsAgentGatewaysService) Delete(name string) *ProjectsLocationsAgentGatewaysDeleteCall { | |
| c := &ProjectsLocationsAgentGatewaysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Etag sets the optional parameter "etag": The etag of the AgentGateway to | |
| // delete. | |
| func (c *ProjectsLocationsAgentGatewaysDeleteCall) Etag(etag string) *ProjectsLocationsAgentGatewaysDeleteCall { | |
| c.urlParams_.Set("etag", etag) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsAgentGatewaysDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsAgentGatewaysDeleteCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsAgentGatewaysDeleteCall) Context(ctx context.Context) *ProjectsLocationsAgentGatewaysDeleteCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsAgentGatewaysDeleteCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsAgentGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("DELETE", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.agentGateways.delete", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.agentGateways.delete" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsAgentGatewaysDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.agentGateways.delete", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsAgentGatewaysGetCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Get: Gets details of a single AgentGateway. | |
| // | |
| // - name: A name of the AgentGateway to get. Must be in the format | |
| // `projects/*/locations/*/agentGateways/*`. | |
| func (r *ProjectsLocationsAgentGatewaysService) Get(name string) *ProjectsLocationsAgentGatewaysGetCall { | |
| c := &ProjectsLocationsAgentGatewaysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsAgentGatewaysGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsAgentGatewaysGetCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsAgentGatewaysGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsAgentGatewaysGetCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsAgentGatewaysGetCall) Context(ctx context.Context) *ProjectsLocationsAgentGatewaysGetCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsAgentGatewaysGetCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsAgentGatewaysGetCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.agentGateways.get", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.agentGateways.get" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *AgentGateway.ServerResponse.Header or (if a response was returned at all) | |
| // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsAgentGatewaysGetCall) Do(opts ...googleapi.CallOption) (*AgentGateway, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &AgentGateway{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.agentGateways.get", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsAgentGatewaysListCall struct { | |
| s *Service | |
| parent string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // List: Lists AgentGateways in a given project and location. | |
| // | |
| // - parent: The project and location from which the AgentGateways should be | |
| // listed, specified in the format `projects/*/locations/*`. | |
| func (r *ProjectsLocationsAgentGatewaysService) List(parent string) *ProjectsLocationsAgentGatewaysListCall { | |
| c := &ProjectsLocationsAgentGatewaysListCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| return c | |
| } | |
| // Filter sets the optional parameter "filter": A filter expression to filter | |
| // the results listed in the response. The expression must follow the syntax | |
| // described in AIP-160 (https://google.aip.dev/160). | |
| func (c *ProjectsLocationsAgentGatewaysListCall) Filter(filter string) *ProjectsLocationsAgentGatewaysListCall { | |
| c.urlParams_.Set("filter", filter) | |
| return c | |
| } | |
| // PageSize sets the optional parameter "pageSize": Maximum number of | |
| // AgentGateways to return per call. | |
| func (c *ProjectsLocationsAgentGatewaysListCall) PageSize(pageSize int64) *ProjectsLocationsAgentGatewaysListCall { | |
| c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) | |
| return c | |
| } | |
| // PageToken sets the optional parameter "pageToken": The value returned by the | |
| // last `ListAgentGatewaysResponse` Indicates that this is a continuation of a | |
| // prior `ListAgentGateways` call, and that the system should return the next | |
| // page of data. | |
| func (c *ProjectsLocationsAgentGatewaysListCall) PageToken(pageToken string) *ProjectsLocationsAgentGatewaysListCall { | |
| c.urlParams_.Set("pageToken", pageToken) | |
| return c | |
| } | |
| // ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": If | |
| // true, allow partial responses for multi-regional Aggregated List requests. | |
| // Otherwise if one of the locations is down or unreachable, the Aggregated | |
| // List request will fail. | |
| func (c *ProjectsLocationsAgentGatewaysListCall) ReturnPartialSuccess(returnPartialSuccess bool) *ProjectsLocationsAgentGatewaysListCall { | |
| c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsAgentGatewaysListCall) Fields(s ...googleapi.Field) *ProjectsLocationsAgentGatewaysListCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsAgentGatewaysListCall) IfNoneMatch(entityTag string) *ProjectsLocationsAgentGatewaysListCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsAgentGatewaysListCall) Context(ctx context.Context) *ProjectsLocationsAgentGatewaysListCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsAgentGatewaysListCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsAgentGatewaysListCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/agentGateways") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.agentGateways.list", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.agentGateways.list" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *ListAgentGatewaysResponse.ServerResponse.Header or (if a response was | |
| // returned at all) in error.(*googleapi.Error).Header. Use | |
| // googleapi.IsNotModified to check whether the returned error was because | |
| // http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsAgentGatewaysListCall) Do(opts ...googleapi.CallOption) (*ListAgentGatewaysResponse, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &ListAgentGatewaysResponse{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.agentGateways.list", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| // Pages invokes f for each page of results. | |
| // A non-nil error returned from f will halt the iteration. | |
| // The provided context supersedes any context provided to the Context method. | |
| func (c *ProjectsLocationsAgentGatewaysListCall) Pages(ctx context.Context, f func(*ListAgentGatewaysResponse) error) error { | |
| c.ctx_ = ctx | |
| defer c.PageToken(c.urlParams_.Get("pageToken")) | |
| for { | |
| x, err := c.Do() | |
| if err != nil { | |
| return err | |
| } | |
| if err := f(x); err != nil { | |
| return err | |
| } | |
| if x.NextPageToken == "" { | |
| return nil | |
| } | |
| c.PageToken(x.NextPageToken) | |
| } | |
| } | |
| type ProjectsLocationsAgentGatewaysPatchCall struct { | |
| s *Service | |
| name string | |
| agentgateway *AgentGateway | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Patch: Updates the parameters of a single AgentGateway. | |
| // | |
| // - name: Identifier. Name of the AgentGateway resource. It matches pattern | |
| // `projects/*/locations/*/agentGateways/`. | |
| func (r *ProjectsLocationsAgentGatewaysService) Patch(name string, agentgateway *AgentGateway) *ProjectsLocationsAgentGatewaysPatchCall { | |
| c := &ProjectsLocationsAgentGatewaysPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| c.agentgateway = agentgateway | |
| return c | |
| } | |
| // UpdateMask sets the optional parameter "updateMask": Field mask is used to | |
| // specify the fields to be overwritten in the AgentGateway resource by the | |
| // update. The fields specified in the update_mask are relative to the | |
| // resource, not the full request. A field will be overwritten if it is in the | |
| // mask. If the user does not provide a mask then all fields will be | |
| // overwritten. | |
| func (c *ProjectsLocationsAgentGatewaysPatchCall) UpdateMask(updateMask string) *ProjectsLocationsAgentGatewaysPatchCall { | |
| c.urlParams_.Set("updateMask", updateMask) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsAgentGatewaysPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsAgentGatewaysPatchCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsAgentGatewaysPatchCall) Context(ctx context.Context) *ProjectsLocationsAgentGatewaysPatchCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsAgentGatewaysPatchCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsAgentGatewaysPatchCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.agentgateway) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("PATCH", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.agentGateways.patch", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.agentGateways.patch" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsAgentGatewaysPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.agentGateways.patch", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsAuthzExtensionsCreateCall struct { | |
| s *Service | |
| parent string | |
| authzextension *AuthzExtension | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Create: Creates a new `AuthzExtension` resource in a given project and | |
| // location. | |
| // | |
| // - parent: The parent resource of the `AuthzExtension` resource. Must be in | |
| // the format `projects/{project}/locations/{location}`. | |
| func (r *ProjectsLocationsAuthzExtensionsService) Create(parent string, authzextension *AuthzExtension) *ProjectsLocationsAuthzExtensionsCreateCall { | |
| c := &ProjectsLocationsAuthzExtensionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| c.authzextension = authzextension | |
| return c | |
| } | |
| // AuthzExtensionId sets the optional parameter "authzExtensionId": Required. | |
| // User-provided ID of the `AuthzExtension` resource to be created. | |
| func (c *ProjectsLocationsAuthzExtensionsCreateCall) AuthzExtensionId(authzExtensionId string) *ProjectsLocationsAuthzExtensionsCreateCall { | |
| c.urlParams_.Set("authzExtensionId", authzExtensionId) | |
| return c | |
| } | |
| // RequestId sets the optional parameter "requestId": An optional request ID to | |
| // identify requests. Specify a unique request ID so that if you must retry | |
| // your request, the server can ignore the request if it has already been | |
| // completed. The server guarantees that for 60 minutes since the first | |
| // request. For example, consider a situation where you make an initial request | |
| // and the request times out. If you make the request again with the same | |
| // request ID, the server ignores the second request This prevents clients from | |
| // accidentally creating duplicate commitments. The request ID must be a valid | |
| // UUID with the exception that zero UUID is not supported | |
| // (00000000-0000-0000-0000-000000000000). | |
| func (c *ProjectsLocationsAuthzExtensionsCreateCall) RequestId(requestId string) *ProjectsLocationsAuthzExtensionsCreateCall { | |
| c.urlParams_.Set("requestId", requestId) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsAuthzExtensionsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsAuthzExtensionsCreateCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsAuthzExtensionsCreateCall) Context(ctx context.Context) *ProjectsLocationsAuthzExtensionsCreateCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsAuthzExtensionsCreateCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsAuthzExtensionsCreateCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.authzextension) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/authzExtensions") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("POST", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.authzExtensions.create", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.authzExtensions.create" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsAuthzExtensionsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.authzExtensions.create", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsAuthzExtensionsDeleteCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Delete: Deletes the specified `AuthzExtension` resource. | |
| // | |
| // - name: The name of the `AuthzExtension` resource to delete. Must be in the | |
| // format | |
| // `projects/{project}/locations/{location}/authzExtensions/{authz_extension}` | |
| // . | |
| func (r *ProjectsLocationsAuthzExtensionsService) Delete(name string) *ProjectsLocationsAuthzExtensionsDeleteCall { | |
| c := &ProjectsLocationsAuthzExtensionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // RequestId sets the optional parameter "requestId": An optional request ID to | |
| // identify requests. Specify a unique request ID so that if you must retry | |
| // your request, the server can ignore the request if it has already been | |
| // completed. The server guarantees that for 60 minutes after the first | |
| // request. For example, consider a situation where you make an initial request | |
| // and the request times out. If you make the request again with the same | |
| // request ID, the server ignores the second request This prevents clients from | |
| // accidentally creating duplicate commitments. The request ID must be a valid | |
| // UUID with the exception that zero UUID is not supported | |
| // (00000000-0000-0000-0000-000000000000). | |
| func (c *ProjectsLocationsAuthzExtensionsDeleteCall) RequestId(requestId string) *ProjectsLocationsAuthzExtensionsDeleteCall { | |
| c.urlParams_.Set("requestId", requestId) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsAuthzExtensionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsAuthzExtensionsDeleteCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsAuthzExtensionsDeleteCall) Context(ctx context.Context) *ProjectsLocationsAuthzExtensionsDeleteCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsAuthzExtensionsDeleteCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsAuthzExtensionsDeleteCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("DELETE", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.authzExtensions.delete", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.authzExtensions.delete" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsAuthzExtensionsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.authzExtensions.delete", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsAuthzExtensionsGetCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Get: Gets details of the specified `AuthzExtension` resource. | |
| // | |
| // - name: A name of the `AuthzExtension` resource to get. Must be in the | |
| // format | |
| // `projects/{project}/locations/{location}/authzExtensions/{authz_extension}` | |
| // . | |
| func (r *ProjectsLocationsAuthzExtensionsService) Get(name string) *ProjectsLocationsAuthzExtensionsGetCall { | |
| c := &ProjectsLocationsAuthzExtensionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsAuthzExtensionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsAuthzExtensionsGetCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsAuthzExtensionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsAuthzExtensionsGetCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsAuthzExtensionsGetCall) Context(ctx context.Context) *ProjectsLocationsAuthzExtensionsGetCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsAuthzExtensionsGetCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsAuthzExtensionsGetCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.authzExtensions.get", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.authzExtensions.get" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *AuthzExtension.ServerResponse.Header or (if a response was returned at all) | |
| // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsAuthzExtensionsGetCall) Do(opts ...googleapi.CallOption) (*AuthzExtension, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &AuthzExtension{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.authzExtensions.get", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsAuthzExtensionsListCall struct { | |
| s *Service | |
| parent string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // List: Lists `AuthzExtension` resources in a given project and location. | |
| // | |
| // - parent: The project and location from which the `AuthzExtension` resources | |
| // are listed. These values are specified in the following format: | |
| // `projects/{project}/locations/{location}`. | |
| func (r *ProjectsLocationsAuthzExtensionsService) List(parent string) *ProjectsLocationsAuthzExtensionsListCall { | |
| c := &ProjectsLocationsAuthzExtensionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| return c | |
| } | |
| // Filter sets the optional parameter "filter": Filtering results. | |
| func (c *ProjectsLocationsAuthzExtensionsListCall) Filter(filter string) *ProjectsLocationsAuthzExtensionsListCall { | |
| c.urlParams_.Set("filter", filter) | |
| return c | |
| } | |
| // OrderBy sets the optional parameter "orderBy": Hint about how to order the | |
| // results. | |
| func (c *ProjectsLocationsAuthzExtensionsListCall) OrderBy(orderBy string) *ProjectsLocationsAuthzExtensionsListCall { | |
| c.urlParams_.Set("orderBy", orderBy) | |
| return c | |
| } | |
| // PageSize sets the optional parameter "pageSize": Requested page size. The | |
| // server might return fewer items than requested. If unspecified, the server | |
| // picks an appropriate default. | |
| func (c *ProjectsLocationsAuthzExtensionsListCall) PageSize(pageSize int64) *ProjectsLocationsAuthzExtensionsListCall { | |
| c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) | |
| return c | |
| } | |
| // PageToken sets the optional parameter "pageToken": A token identifying a | |
| // page of results that the server returns. | |
| func (c *ProjectsLocationsAuthzExtensionsListCall) PageToken(pageToken string) *ProjectsLocationsAuthzExtensionsListCall { | |
| c.urlParams_.Set("pageToken", pageToken) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsAuthzExtensionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsAuthzExtensionsListCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsAuthzExtensionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsAuthzExtensionsListCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsAuthzExtensionsListCall) Context(ctx context.Context) *ProjectsLocationsAuthzExtensionsListCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsAuthzExtensionsListCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsAuthzExtensionsListCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/authzExtensions") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.authzExtensions.list", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.authzExtensions.list" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *ListAuthzExtensionsResponse.ServerResponse.Header or (if a response was | |
| // returned at all) in error.(*googleapi.Error).Header. Use | |
| // googleapi.IsNotModified to check whether the returned error was because | |
| // http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsAuthzExtensionsListCall) Do(opts ...googleapi.CallOption) (*ListAuthzExtensionsResponse, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &ListAuthzExtensionsResponse{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.authzExtensions.list", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| // Pages invokes f for each page of results. | |
| // A non-nil error returned from f will halt the iteration. | |
| // The provided context supersedes any context provided to the Context method. | |
| func (c *ProjectsLocationsAuthzExtensionsListCall) Pages(ctx context.Context, f func(*ListAuthzExtensionsResponse) error) error { | |
| c.ctx_ = ctx | |
| defer c.PageToken(c.urlParams_.Get("pageToken")) | |
| for { | |
| x, err := c.Do() | |
| if err != nil { | |
| return err | |
| } | |
| if err := f(x); err != nil { | |
| return err | |
| } | |
| if x.NextPageToken == "" { | |
| return nil | |
| } | |
| c.PageToken(x.NextPageToken) | |
| } | |
| } | |
| type ProjectsLocationsAuthzExtensionsPatchCall struct { | |
| s *Service | |
| name string | |
| authzextension *AuthzExtension | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Patch: Updates the parameters of the specified `AuthzExtension` resource. | |
| // | |
| // - name: Identifier. Name of the `AuthzExtension` resource in the following | |
| // format: | |
| // `projects/{project}/locations/{location}/authzExtensions/{authz_extension}` | |
| // . | |
| func (r *ProjectsLocationsAuthzExtensionsService) Patch(name string, authzextension *AuthzExtension) *ProjectsLocationsAuthzExtensionsPatchCall { | |
| c := &ProjectsLocationsAuthzExtensionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| c.authzextension = authzextension | |
| return c | |
| } | |
| // RequestId sets the optional parameter "requestId": An optional request ID to | |
| // identify requests. Specify a unique request ID so that if you must retry | |
| // your request, the server can ignore the request if it has already been | |
| // completed. The server guarantees that for 60 minutes since the first | |
| // request. For example, consider a situation where you make an initial request | |
| // and the request times out. If you make the request again with the same | |
| // request ID, the server ignores the second request This prevents clients from | |
| // accidentally creating duplicate commitments. The request ID must be a valid | |
| // UUID with the exception that zero UUID is not supported | |
| // (00000000-0000-0000-0000-000000000000). | |
| func (c *ProjectsLocationsAuthzExtensionsPatchCall) RequestId(requestId string) *ProjectsLocationsAuthzExtensionsPatchCall { | |
| c.urlParams_.Set("requestId", requestId) | |
| return c | |
| } | |
| // UpdateMask sets the optional parameter "updateMask": Used to specify the | |
| // fields to be overwritten in the `AuthzExtension` resource by the update. The | |
| // fields specified in the `update_mask` are relative to the resource, not the | |
| // full request. A field is overwritten if it is in the mask. If the user does | |
| // not specify a mask, then all fields are overwritten. | |
| func (c *ProjectsLocationsAuthzExtensionsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsAuthzExtensionsPatchCall { | |
| c.urlParams_.Set("updateMask", updateMask) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsAuthzExtensionsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsAuthzExtensionsPatchCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsAuthzExtensionsPatchCall) Context(ctx context.Context) *ProjectsLocationsAuthzExtensionsPatchCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsAuthzExtensionsPatchCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsAuthzExtensionsPatchCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.authzextension) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("PATCH", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.authzExtensions.patch", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.authzExtensions.patch" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsAuthzExtensionsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.authzExtensions.patch", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsCdnEdgeExtensionsCreateCall struct { | |
| s *Service | |
| parent string | |
| cdnedgeextension *CdnEdgeExtension | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Create: Creates a new `CdnEdgeExtension` resource in a given project and | |
| // location. | |
| // | |
| // - parent: The parent resource of the `CdnEdgeExtension` resource. Must be in | |
| // the format `projects/{project}/locations/{location}`. | |
| func (r *ProjectsLocationsCdnEdgeExtensionsService) Create(parent string, cdnedgeextension *CdnEdgeExtension) *ProjectsLocationsCdnEdgeExtensionsCreateCall { | |
| c := &ProjectsLocationsCdnEdgeExtensionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| c.cdnedgeextension = cdnedgeextension | |
| return c | |
| } | |
| // CdnEdgeExtensionId sets the optional parameter "cdnEdgeExtensionId": | |
| // Required. User-provided ID of the `CdnEdgeExtension` resource to be created. | |
| func (c *ProjectsLocationsCdnEdgeExtensionsCreateCall) CdnEdgeExtensionId(cdnEdgeExtensionId string) *ProjectsLocationsCdnEdgeExtensionsCreateCall { | |
| c.urlParams_.Set("cdnEdgeExtensionId", cdnEdgeExtensionId) | |
| return c | |
| } | |
| // RequestId sets the optional parameter "requestId": An optional request ID to | |
| // identify requests. Specify a unique request ID so that if you must retry | |
| // your request, the server can ignore the request if it has already been | |
| // completed. The server guarantees that for 60 minutes since the first | |
| // request. For example, consider a situation where you make an initial request | |
| // and the request times out. If you make the request again with the same | |
| // request ID, the server ignores the second request This prevents clients from | |
| // accidentally creating duplicate commitments. The request ID must be a valid | |
| // UUID with the exception that zero UUID is not supported | |
| // (00000000-0000-0000-0000-000000000000). | |
| func (c *ProjectsLocationsCdnEdgeExtensionsCreateCall) RequestId(requestId string) *ProjectsLocationsCdnEdgeExtensionsCreateCall { | |
| c.urlParams_.Set("requestId", requestId) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsCdnEdgeExtensionsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsCdnEdgeExtensionsCreateCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsCdnEdgeExtensionsCreateCall) Context(ctx context.Context) *ProjectsLocationsCdnEdgeExtensionsCreateCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsCdnEdgeExtensionsCreateCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsCdnEdgeExtensionsCreateCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cdnedgeextension) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/cdnEdgeExtensions") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("POST", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.cdnEdgeExtensions.create", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.cdnEdgeExtensions.create" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsCdnEdgeExtensionsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.cdnEdgeExtensions.create", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsCdnEdgeExtensionsDeleteCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Delete: Deletes the specified `CdnEdgeExtension` resource. | |
| // | |
| // - name: The name of the `CdnEdgeExtension` resource to delete. Must be in | |
| // the format | |
| // `projects/{project}/locations/{location}/cdnEdgeExtensions/{cdn_edge_extens | |
| // ion}`. | |
| func (r *ProjectsLocationsCdnEdgeExtensionsService) Delete(name string) *ProjectsLocationsCdnEdgeExtensionsDeleteCall { | |
| c := &ProjectsLocationsCdnEdgeExtensionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // RequestId sets the optional parameter "requestId": An optional request ID to | |
| // identify requests. Specify a unique request ID so that if you must retry | |
| // your request, the server can ignore the request if it has already been | |
| // completed. The server guarantees that for 60 minutes after the first | |
| // request. For example, consider a situation where you make an initial request | |
| // and the request times out. If you make the request again with the same | |
| // request ID, the server ignores the second request This prevents clients from | |
| // accidentally creating duplicate commitments. The request ID must be a valid | |
| // UUID with the exception that zero UUID is not supported | |
| // (00000000-0000-0000-0000-000000000000). | |
| func (c *ProjectsLocationsCdnEdgeExtensionsDeleteCall) RequestId(requestId string) *ProjectsLocationsCdnEdgeExtensionsDeleteCall { | |
| c.urlParams_.Set("requestId", requestId) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsCdnEdgeExtensionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsCdnEdgeExtensionsDeleteCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsCdnEdgeExtensionsDeleteCall) Context(ctx context.Context) *ProjectsLocationsCdnEdgeExtensionsDeleteCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsCdnEdgeExtensionsDeleteCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsCdnEdgeExtensionsDeleteCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("DELETE", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.cdnEdgeExtensions.delete", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.cdnEdgeExtensions.delete" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsCdnEdgeExtensionsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.cdnEdgeExtensions.delete", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsCdnEdgeExtensionsGetCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Get: Gets details of the specified `CdnEdgeExtension` resource. | |
| // | |
| // - name: A name of the `CdnEdgeExtension` resource to get. Must be in the | |
| // format | |
| // `projects/{project}/locations/{location}/cdnEdgeExtensions/{cdn_edge_extens | |
| // ion}`. | |
| func (r *ProjectsLocationsCdnEdgeExtensionsService) Get(name string) *ProjectsLocationsCdnEdgeExtensionsGetCall { | |
| c := &ProjectsLocationsCdnEdgeExtensionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsCdnEdgeExtensionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCdnEdgeExtensionsGetCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsCdnEdgeExtensionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCdnEdgeExtensionsGetCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsCdnEdgeExtensionsGetCall) Context(ctx context.Context) *ProjectsLocationsCdnEdgeExtensionsGetCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsCdnEdgeExtensionsGetCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsCdnEdgeExtensionsGetCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.cdnEdgeExtensions.get", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.cdnEdgeExtensions.get" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *CdnEdgeExtension.ServerResponse.Header or (if a response was returned at | |
| // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to | |
| // check whether the returned error was because http.StatusNotModified was | |
| // returned. | |
| func (c *ProjectsLocationsCdnEdgeExtensionsGetCall) Do(opts ...googleapi.CallOption) (*CdnEdgeExtension, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &CdnEdgeExtension{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.cdnEdgeExtensions.get", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsCdnEdgeExtensionsListCall struct { | |
| s *Service | |
| parent string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // List: Lists `CdnEdgeExtensions` resources in a given project and location. | |
| // | |
| // - parent: The project and location from which the `CdnEdgeExtension` | |
| // resources are listed. These values are specified in the following format: | |
| // `projects/{project}/locations/{location}`. | |
| func (r *ProjectsLocationsCdnEdgeExtensionsService) List(parent string) *ProjectsLocationsCdnEdgeExtensionsListCall { | |
| c := &ProjectsLocationsCdnEdgeExtensionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| return c | |
| } | |
| // Filter sets the optional parameter "filter": Filtering results. | |
| func (c *ProjectsLocationsCdnEdgeExtensionsListCall) Filter(filter string) *ProjectsLocationsCdnEdgeExtensionsListCall { | |
| c.urlParams_.Set("filter", filter) | |
| return c | |
| } | |
| // OrderBy sets the optional parameter "orderBy": Hint about how to order the | |
| // results. | |
| func (c *ProjectsLocationsCdnEdgeExtensionsListCall) OrderBy(orderBy string) *ProjectsLocationsCdnEdgeExtensionsListCall { | |
| c.urlParams_.Set("orderBy", orderBy) | |
| return c | |
| } | |
| // PageSize sets the optional parameter "pageSize": Requested page size. The | |
| // server might return fewer items than requested. If unspecified, the server | |
| // picks an appropriate default. | |
| func (c *ProjectsLocationsCdnEdgeExtensionsListCall) PageSize(pageSize int64) *ProjectsLocationsCdnEdgeExtensionsListCall { | |
| c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) | |
| return c | |
| } | |
| // PageToken sets the optional parameter "pageToken": A token identifying a | |
| // page of results that the server returns. | |
| func (c *ProjectsLocationsCdnEdgeExtensionsListCall) PageToken(pageToken string) *ProjectsLocationsCdnEdgeExtensionsListCall { | |
| c.urlParams_.Set("pageToken", pageToken) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsCdnEdgeExtensionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCdnEdgeExtensionsListCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsCdnEdgeExtensionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCdnEdgeExtensionsListCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsCdnEdgeExtensionsListCall) Context(ctx context.Context) *ProjectsLocationsCdnEdgeExtensionsListCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsCdnEdgeExtensionsListCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsCdnEdgeExtensionsListCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/cdnEdgeExtensions") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.cdnEdgeExtensions.list", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.cdnEdgeExtensions.list" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *ListCdnEdgeExtensionsResponse.ServerResponse.Header or (if a response was | |
| // returned at all) in error.(*googleapi.Error).Header. Use | |
| // googleapi.IsNotModified to check whether the returned error was because | |
| // http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsCdnEdgeExtensionsListCall) Do(opts ...googleapi.CallOption) (*ListCdnEdgeExtensionsResponse, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &ListCdnEdgeExtensionsResponse{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.cdnEdgeExtensions.list", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| // Pages invokes f for each page of results. | |
| // A non-nil error returned from f will halt the iteration. | |
| // The provided context supersedes any context provided to the Context method. | |
| func (c *ProjectsLocationsCdnEdgeExtensionsListCall) Pages(ctx context.Context, f func(*ListCdnEdgeExtensionsResponse) error) error { | |
| c.ctx_ = ctx | |
| defer c.PageToken(c.urlParams_.Get("pageToken")) | |
| for { | |
| x, err := c.Do() | |
| if err != nil { | |
| return err | |
| } | |
| if err := f(x); err != nil { | |
| return err | |
| } | |
| if x.NextPageToken == "" { | |
| return nil | |
| } | |
| c.PageToken(x.NextPageToken) | |
| } | |
| } | |
| type ProjectsLocationsCdnEdgeExtensionsPatchCall struct { | |
| s *Service | |
| name string | |
| cdnedgeextension *CdnEdgeExtension | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Patch: Updates the parameters of the specified `CdnEdgeExtension` resource. | |
| // | |
| // - name: Identifier. Name of the `CdnEdgeExtension` resource in the following | |
| // format: | |
| // `projects/{project}/locations/{location}/cdnEdgeExtensions/{cdn_edge_extens | |
| // ion}`. | |
| func (r *ProjectsLocationsCdnEdgeExtensionsService) Patch(name string, cdnedgeextension *CdnEdgeExtension) *ProjectsLocationsCdnEdgeExtensionsPatchCall { | |
| c := &ProjectsLocationsCdnEdgeExtensionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| c.cdnedgeextension = cdnedgeextension | |
| return c | |
| } | |
| // RequestId sets the optional parameter "requestId": An optional request ID to | |
| // identify requests. Specify a unique request ID so that if you must retry | |
| // your request, the server can ignore the request if it has already been | |
| // completed. The server guarantees that for 60 minutes since the first | |
| // request. For example, consider a situation where you make an initial request | |
| // and the request times out. If you make the request again with the same | |
| // request ID, the server ignores the second request This prevents clients from | |
| // accidentally creating duplicate commitments. The request ID must be a valid | |
| // UUID with the exception that zero UUID is not supported | |
| // (00000000-0000-0000-0000-000000000000). | |
| func (c *ProjectsLocationsCdnEdgeExtensionsPatchCall) RequestId(requestId string) *ProjectsLocationsCdnEdgeExtensionsPatchCall { | |
| c.urlParams_.Set("requestId", requestId) | |
| return c | |
| } | |
| // UpdateMask sets the optional parameter "updateMask": Used to specify the | |
| // fields to be overwritten in the `CdnEdgeExtension` resource by the update. | |
| // The fields specified in the `update_mask` are relative to the resource, not | |
| // the full request. A field is overwritten if it is in the mask. If the user | |
| // does not specify a mask, then all fields are overwritten. | |
| func (c *ProjectsLocationsCdnEdgeExtensionsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsCdnEdgeExtensionsPatchCall { | |
| c.urlParams_.Set("updateMask", updateMask) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsCdnEdgeExtensionsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCdnEdgeExtensionsPatchCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsCdnEdgeExtensionsPatchCall) Context(ctx context.Context) *ProjectsLocationsCdnEdgeExtensionsPatchCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsCdnEdgeExtensionsPatchCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsCdnEdgeExtensionsPatchCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cdnedgeextension) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("PATCH", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.cdnEdgeExtensions.patch", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.cdnEdgeExtensions.patch" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsCdnEdgeExtensionsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.cdnEdgeExtensions.patch", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsEndpointPoliciesCreateCall struct { | |
| s *Service | |
| parent string | |
| endpointpolicy *EndpointPolicy | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Create: Creates a new EndpointPolicy in a given project and location. | |
| // | |
| // - parent: The parent resource of the EndpointPolicy. Must be in the format | |
| // `projects/*/locations/*`. | |
| func (r *ProjectsLocationsEndpointPoliciesService) Create(parent string, endpointpolicy *EndpointPolicy) *ProjectsLocationsEndpointPoliciesCreateCall { | |
| c := &ProjectsLocationsEndpointPoliciesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| c.endpointpolicy = endpointpolicy | |
| return c | |
| } | |
| // EndpointPolicyId sets the optional parameter "endpointPolicyId": Required. | |
| // Short name of the EndpointPolicy resource to be created. E.g. "CustomECS". | |
| func (c *ProjectsLocationsEndpointPoliciesCreateCall) EndpointPolicyId(endpointPolicyId string) *ProjectsLocationsEndpointPoliciesCreateCall { | |
| c.urlParams_.Set("endpointPolicyId", endpointPolicyId) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsEndpointPoliciesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsEndpointPoliciesCreateCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsEndpointPoliciesCreateCall) Context(ctx context.Context) *ProjectsLocationsEndpointPoliciesCreateCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsEndpointPoliciesCreateCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsEndpointPoliciesCreateCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.endpointpolicy) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/endpointPolicies") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("POST", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.endpointPolicies.create", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.endpointPolicies.create" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsEndpointPoliciesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.endpointPolicies.create", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsEndpointPoliciesDeleteCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Delete: Deletes a single EndpointPolicy. | |
| // | |
| // - name: A name of the EndpointPolicy to delete. Must be in the format | |
| // `projects/*/locations/*/endpointPolicies/*`. | |
| func (r *ProjectsLocationsEndpointPoliciesService) Delete(name string) *ProjectsLocationsEndpointPoliciesDeleteCall { | |
| c := &ProjectsLocationsEndpointPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsEndpointPoliciesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsEndpointPoliciesDeleteCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsEndpointPoliciesDeleteCall) Context(ctx context.Context) *ProjectsLocationsEndpointPoliciesDeleteCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsEndpointPoliciesDeleteCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsEndpointPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("DELETE", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.endpointPolicies.delete", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.endpointPolicies.delete" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsEndpointPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.endpointPolicies.delete", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsEndpointPoliciesGetCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Get: Gets details of a single EndpointPolicy. | |
| // | |
| // - name: A name of the EndpointPolicy to get. Must be in the format | |
| // `projects/*/locations/*/endpointPolicies/*`. | |
| func (r *ProjectsLocationsEndpointPoliciesService) Get(name string) *ProjectsLocationsEndpointPoliciesGetCall { | |
| c := &ProjectsLocationsEndpointPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsEndpointPoliciesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsEndpointPoliciesGetCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsEndpointPoliciesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsEndpointPoliciesGetCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsEndpointPoliciesGetCall) Context(ctx context.Context) *ProjectsLocationsEndpointPoliciesGetCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsEndpointPoliciesGetCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsEndpointPoliciesGetCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.endpointPolicies.get", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.endpointPolicies.get" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *EndpointPolicy.ServerResponse.Header or (if a response was returned at all) | |
| // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsEndpointPoliciesGetCall) Do(opts ...googleapi.CallOption) (*EndpointPolicy, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &EndpointPolicy{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.endpointPolicies.get", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsEndpointPoliciesListCall struct { | |
| s *Service | |
| parent string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // List: Lists EndpointPolicies in a given project and location. | |
| // | |
| // - parent: The project and location from which the EndpointPolicies should be | |
| // listed, specified in the format `projects/*/locations/*`. | |
| func (r *ProjectsLocationsEndpointPoliciesService) List(parent string) *ProjectsLocationsEndpointPoliciesListCall { | |
| c := &ProjectsLocationsEndpointPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| return c | |
| } | |
| // PageSize sets the optional parameter "pageSize": Maximum number of | |
| // EndpointPolicies to return per call. | |
| func (c *ProjectsLocationsEndpointPoliciesListCall) PageSize(pageSize int64) *ProjectsLocationsEndpointPoliciesListCall { | |
| c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) | |
| return c | |
| } | |
| // PageToken sets the optional parameter "pageToken": The value returned by the | |
| // last `ListEndpointPoliciesResponse` Indicates that this is a continuation of | |
| // a prior `ListEndpointPolicies` call, and that the system should return the | |
| // next page of data. | |
| func (c *ProjectsLocationsEndpointPoliciesListCall) PageToken(pageToken string) *ProjectsLocationsEndpointPoliciesListCall { | |
| c.urlParams_.Set("pageToken", pageToken) | |
| return c | |
| } | |
| // ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": If | |
| // true, allow partial responses for multi-regional Aggregated List requests. | |
| // Otherwise if one of the locations is down or unreachable, the Aggregated | |
| // List request will fail. | |
| func (c *ProjectsLocationsEndpointPoliciesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *ProjectsLocationsEndpointPoliciesListCall { | |
| c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsEndpointPoliciesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsEndpointPoliciesListCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsEndpointPoliciesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsEndpointPoliciesListCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsEndpointPoliciesListCall) Context(ctx context.Context) *ProjectsLocationsEndpointPoliciesListCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsEndpointPoliciesListCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsEndpointPoliciesListCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/endpointPolicies") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.endpointPolicies.list", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.endpointPolicies.list" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *ListEndpointPoliciesResponse.ServerResponse.Header or (if a response was | |
| // returned at all) in error.(*googleapi.Error).Header. Use | |
| // googleapi.IsNotModified to check whether the returned error was because | |
| // http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsEndpointPoliciesListCall) Do(opts ...googleapi.CallOption) (*ListEndpointPoliciesResponse, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &ListEndpointPoliciesResponse{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.endpointPolicies.list", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| // Pages invokes f for each page of results. | |
| // A non-nil error returned from f will halt the iteration. | |
| // The provided context supersedes any context provided to the Context method. | |
| func (c *ProjectsLocationsEndpointPoliciesListCall) Pages(ctx context.Context, f func(*ListEndpointPoliciesResponse) error) error { | |
| c.ctx_ = ctx | |
| defer c.PageToken(c.urlParams_.Get("pageToken")) | |
| for { | |
| x, err := c.Do() | |
| if err != nil { | |
| return err | |
| } | |
| if err := f(x); err != nil { | |
| return err | |
| } | |
| if x.NextPageToken == "" { | |
| return nil | |
| } | |
| c.PageToken(x.NextPageToken) | |
| } | |
| } | |
| type ProjectsLocationsEndpointPoliciesPatchCall struct { | |
| s *Service | |
| name string | |
| endpointpolicy *EndpointPolicy | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Patch: Updates the parameters of a single EndpointPolicy. | |
| // | |
| // - name: Identifier. Name of the EndpointPolicy resource. It matches pattern | |
| // `projects/{project}/locations/*/endpointPolicies/{endpoint_policy}`. | |
| func (r *ProjectsLocationsEndpointPoliciesService) Patch(name string, endpointpolicy *EndpointPolicy) *ProjectsLocationsEndpointPoliciesPatchCall { | |
| c := &ProjectsLocationsEndpointPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| c.endpointpolicy = endpointpolicy | |
| return c | |
| } | |
| // UpdateMask sets the optional parameter "updateMask": Field mask is used to | |
| // specify the fields to be overwritten in the EndpointPolicy resource by the | |
| // update. The fields specified in the update_mask are relative to the | |
| // resource, not the full request. A field will be overwritten if it is in the | |
| // mask. If the user does not provide a mask then all fields will be | |
| // overwritten. | |
| func (c *ProjectsLocationsEndpointPoliciesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsEndpointPoliciesPatchCall { | |
| c.urlParams_.Set("updateMask", updateMask) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsEndpointPoliciesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsEndpointPoliciesPatchCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsEndpointPoliciesPatchCall) Context(ctx context.Context) *ProjectsLocationsEndpointPoliciesPatchCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsEndpointPoliciesPatchCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsEndpointPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.endpointpolicy) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("PATCH", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.endpointPolicies.patch", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.endpointPolicies.patch" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsEndpointPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.endpointPolicies.patch", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsExtensionBindingsCreateCall struct { | |
| s *Service | |
| parent string | |
| extensionbinding *ExtensionBinding | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Create: Creates a new `ExtensionBinding` resource in a given project and | |
| // location. | |
| // | |
| // - parent: The parent resource of the `ExtensionBinding` resource. Must be in | |
| // the format `projects/{project}/locations/{location}`. | |
| func (r *ProjectsLocationsExtensionBindingsService) Create(parent string, extensionbinding *ExtensionBinding) *ProjectsLocationsExtensionBindingsCreateCall { | |
| c := &ProjectsLocationsExtensionBindingsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| c.extensionbinding = extensionbinding | |
| return c | |
| } | |
| // ExtensionBindingId sets the optional parameter "extensionBindingId": | |
| // Required. Short name of the `ExtensionBinding` resource to be created. | |
| func (c *ProjectsLocationsExtensionBindingsCreateCall) ExtensionBindingId(extensionBindingId string) *ProjectsLocationsExtensionBindingsCreateCall { | |
| c.urlParams_.Set("extensionBindingId", extensionBindingId) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsExtensionBindingsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsExtensionBindingsCreateCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsExtensionBindingsCreateCall) Context(ctx context.Context) *ProjectsLocationsExtensionBindingsCreateCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsExtensionBindingsCreateCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsExtensionBindingsCreateCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.extensionbinding) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/extensionBindings") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("POST", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.extensionBindings.create", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.extensionBindings.create" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsExtensionBindingsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.extensionBindings.create", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsExtensionBindingsDeleteCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Delete: Deletes the specified `ExtensionBinding` resource. | |
| // | |
| // - name: A name of the `ExtensionBinding` resource to delete. Must be in the | |
| // format | |
| // `projects/{project}/locations/{location}/extensionBindings/{extension_bindi | |
| // ng}`. | |
| func (r *ProjectsLocationsExtensionBindingsService) Delete(name string) *ProjectsLocationsExtensionBindingsDeleteCall { | |
| c := &ProjectsLocationsExtensionBindingsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Etag sets the optional parameter "etag": The etag of the ExtensionBinding to | |
| // delete. | |
| func (c *ProjectsLocationsExtensionBindingsDeleteCall) Etag(etag string) *ProjectsLocationsExtensionBindingsDeleteCall { | |
| c.urlParams_.Set("etag", etag) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsExtensionBindingsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsExtensionBindingsDeleteCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsExtensionBindingsDeleteCall) Context(ctx context.Context) *ProjectsLocationsExtensionBindingsDeleteCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsExtensionBindingsDeleteCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsExtensionBindingsDeleteCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("DELETE", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.extensionBindings.delete", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.extensionBindings.delete" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsExtensionBindingsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.extensionBindings.delete", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsExtensionBindingsGetCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Get: Gets details of the specified `ExtensionBinding` resource. | |
| // | |
| // - name: A name of the `ExtensionBinding` resource to get. Must be in the | |
| // format | |
| // `projects/{project}/locations/{location}/extensionBindings/{extension_bindi | |
| // ng}`. | |
| func (r *ProjectsLocationsExtensionBindingsService) Get(name string) *ProjectsLocationsExtensionBindingsGetCall { | |
| c := &ProjectsLocationsExtensionBindingsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsExtensionBindingsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsExtensionBindingsGetCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsExtensionBindingsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsExtensionBindingsGetCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsExtensionBindingsGetCall) Context(ctx context.Context) *ProjectsLocationsExtensionBindingsGetCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsExtensionBindingsGetCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsExtensionBindingsGetCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.extensionBindings.get", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.extensionBindings.get" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *ExtensionBinding.ServerResponse.Header or (if a response was returned at | |
| // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to | |
| // check whether the returned error was because http.StatusNotModified was | |
| // returned. | |
| func (c *ProjectsLocationsExtensionBindingsGetCall) Do(opts ...googleapi.CallOption) (*ExtensionBinding, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &ExtensionBinding{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.extensionBindings.get", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsExtensionBindingsListCall struct { | |
| s *Service | |
| parent string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // List: Lists `ExtensionBinding` resources in a given project and location. | |
| // | |
| // - parent: The project and location from which the `ExtensionBinding` | |
| // resources should be listed, specified in the format | |
| // `projects/{project}/locations/{location}`. | |
| func (r *ProjectsLocationsExtensionBindingsService) List(parent string) *ProjectsLocationsExtensionBindingsListCall { | |
| c := &ProjectsLocationsExtensionBindingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| return c | |
| } | |
| // PageSize sets the optional parameter "pageSize": Maximum number of | |
| // `ExtensionBinding` resources to return per call. | |
| func (c *ProjectsLocationsExtensionBindingsListCall) PageSize(pageSize int64) *ProjectsLocationsExtensionBindingsListCall { | |
| c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) | |
| return c | |
| } | |
| // PageToken sets the optional parameter "pageToken": The value returned by the | |
| // last `ListExtensionBindingsResponse` Indicates that this is a continuation | |
| // of a prior `ListExtensionBindings` call, and that the system should return | |
| // the next page of data. | |
| func (c *ProjectsLocationsExtensionBindingsListCall) PageToken(pageToken string) *ProjectsLocationsExtensionBindingsListCall { | |
| c.urlParams_.Set("pageToken", pageToken) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsExtensionBindingsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsExtensionBindingsListCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsExtensionBindingsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsExtensionBindingsListCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsExtensionBindingsListCall) Context(ctx context.Context) *ProjectsLocationsExtensionBindingsListCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsExtensionBindingsListCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsExtensionBindingsListCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/extensionBindings") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.extensionBindings.list", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.extensionBindings.list" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *ListExtensionBindingsResponse.ServerResponse.Header or (if a response was | |
| // returned at all) in error.(*googleapi.Error).Header. Use | |
| // googleapi.IsNotModified to check whether the returned error was because | |
| // http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsExtensionBindingsListCall) Do(opts ...googleapi.CallOption) (*ListExtensionBindingsResponse, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &ListExtensionBindingsResponse{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.extensionBindings.list", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| // Pages invokes f for each page of results. | |
| // A non-nil error returned from f will halt the iteration. | |
| // The provided context supersedes any context provided to the Context method. | |
| func (c *ProjectsLocationsExtensionBindingsListCall) Pages(ctx context.Context, f func(*ListExtensionBindingsResponse) error) error { | |
| c.ctx_ = ctx | |
| defer c.PageToken(c.urlParams_.Get("pageToken")) | |
| for { | |
| x, err := c.Do() | |
| if err != nil { | |
| return err | |
| } | |
| if err := f(x); err != nil { | |
| return err | |
| } | |
| if x.NextPageToken == "" { | |
| return nil | |
| } | |
| c.PageToken(x.NextPageToken) | |
| } | |
| } | |
| type ProjectsLocationsExtensionBindingsPatchCall struct { | |
| s *Service | |
| name string | |
| extensionbinding *ExtensionBinding | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Patch: Updates the parameters of the specified `ExtensionBinding` resource. | |
| // | |
| // - name: Identifier. Name of the `ExtensionBinding` resource in the following | |
| // format: | |
| // `projects/{project}/locations/{location}/extensionBindings/{extension_bindi | |
| // ng}`. | |
| func (r *ProjectsLocationsExtensionBindingsService) Patch(name string, extensionbinding *ExtensionBinding) *ProjectsLocationsExtensionBindingsPatchCall { | |
| c := &ProjectsLocationsExtensionBindingsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| c.extensionbinding = extensionbinding | |
| return c | |
| } | |
| // UpdateMask sets the optional parameter "updateMask": Field mask is used to | |
| // specify the fields to be overwritten in the `ExtensionBinding` resource by | |
| // the update. The fields specified in the update_mask are relative to the | |
| // resource, not the full request. A field will be overwritten if it is in the | |
| // mask. If the user does not provide a mask then all fields will be | |
| // overwritten. | |
| func (c *ProjectsLocationsExtensionBindingsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsExtensionBindingsPatchCall { | |
| c.urlParams_.Set("updateMask", updateMask) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsExtensionBindingsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsExtensionBindingsPatchCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsExtensionBindingsPatchCall) Context(ctx context.Context) *ProjectsLocationsExtensionBindingsPatchCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsExtensionBindingsPatchCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsExtensionBindingsPatchCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.extensionbinding) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("PATCH", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.extensionBindings.patch", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.extensionBindings.patch" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsExtensionBindingsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.extensionBindings.patch", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsGatewaysCreateCall struct { | |
| s *Service | |
| parent string | |
| gateway *Gateway | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Create: Creates a new Gateway in a given project and location. | |
| // | |
| // - parent: The parent resource of the Gateway. Must be in the format | |
| // `projects/*/locations/*`. | |
| func (r *ProjectsLocationsGatewaysService) Create(parent string, gateway *Gateway) *ProjectsLocationsGatewaysCreateCall { | |
| c := &ProjectsLocationsGatewaysCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| c.gateway = gateway | |
| return c | |
| } | |
| // GatewayId sets the optional parameter "gatewayId": Required. Short name of | |
| // the Gateway resource to be created. | |
| func (c *ProjectsLocationsGatewaysCreateCall) GatewayId(gatewayId string) *ProjectsLocationsGatewaysCreateCall { | |
| c.urlParams_.Set("gatewayId", gatewayId) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsGatewaysCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsGatewaysCreateCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsGatewaysCreateCall) Context(ctx context.Context) *ProjectsLocationsGatewaysCreateCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsGatewaysCreateCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsGatewaysCreateCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.gateway) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/gateways") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("POST", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.gateways.create", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.gateways.create" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsGatewaysCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.gateways.create", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsGatewaysDeleteCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Delete: Deletes a single Gateway. | |
| // | |
| // - name: A name of the Gateway to delete. Must be in the format | |
| // `projects/*/locations/*/gateways/*`. | |
| func (r *ProjectsLocationsGatewaysService) Delete(name string) *ProjectsLocationsGatewaysDeleteCall { | |
| c := &ProjectsLocationsGatewaysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsGatewaysDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsGatewaysDeleteCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsGatewaysDeleteCall) Context(ctx context.Context) *ProjectsLocationsGatewaysDeleteCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsGatewaysDeleteCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("DELETE", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.gateways.delete", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.gateways.delete" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsGatewaysDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.gateways.delete", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsGatewaysGetCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Get: Gets details of a single Gateway. | |
| // | |
| // - name: A name of the Gateway to get. Must be in the format | |
| // `projects/*/locations/*/gateways/*`. | |
| func (r *ProjectsLocationsGatewaysService) Get(name string) *ProjectsLocationsGatewaysGetCall { | |
| c := &ProjectsLocationsGatewaysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsGatewaysGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGatewaysGetCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsGatewaysGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGatewaysGetCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsGatewaysGetCall) Context(ctx context.Context) *ProjectsLocationsGatewaysGetCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsGatewaysGetCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsGatewaysGetCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.gateways.get", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.gateways.get" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Gateway.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsGatewaysGetCall) Do(opts ...googleapi.CallOption) (*Gateway, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Gateway{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.gateways.get", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsGatewaysListCall struct { | |
| s *Service | |
| parent string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // List: Lists Gateways in a given project and location. | |
| // | |
| // - parent: The project and location from which the Gateways should be listed, | |
| // specified in the format `projects/*/locations/*`. | |
| func (r *ProjectsLocationsGatewaysService) List(parent string) *ProjectsLocationsGatewaysListCall { | |
| c := &ProjectsLocationsGatewaysListCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| return c | |
| } | |
| // PageSize sets the optional parameter "pageSize": Maximum number of Gateways | |
| // to return per call. | |
| func (c *ProjectsLocationsGatewaysListCall) PageSize(pageSize int64) *ProjectsLocationsGatewaysListCall { | |
| c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) | |
| return c | |
| } | |
| // PageToken sets the optional parameter "pageToken": The value returned by the | |
| // last `ListGatewaysResponse` Indicates that this is a continuation of a prior | |
| // `ListGateways` call, and that the system should return the next page of | |
| // data. | |
| func (c *ProjectsLocationsGatewaysListCall) PageToken(pageToken string) *ProjectsLocationsGatewaysListCall { | |
| c.urlParams_.Set("pageToken", pageToken) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsGatewaysListCall) Fields(s ...googleapi.Field) *ProjectsLocationsGatewaysListCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsGatewaysListCall) IfNoneMatch(entityTag string) *ProjectsLocationsGatewaysListCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsGatewaysListCall) Context(ctx context.Context) *ProjectsLocationsGatewaysListCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsGatewaysListCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsGatewaysListCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/gateways") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.gateways.list", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.gateways.list" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *ListGatewaysResponse.ServerResponse.Header or (if a response was returned | |
| // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to | |
| // check whether the returned error was because http.StatusNotModified was | |
| // returned. | |
| func (c *ProjectsLocationsGatewaysListCall) Do(opts ...googleapi.CallOption) (*ListGatewaysResponse, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &ListGatewaysResponse{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.gateways.list", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| // Pages invokes f for each page of results. | |
| // A non-nil error returned from f will halt the iteration. | |
| // The provided context supersedes any context provided to the Context method. | |
| func (c *ProjectsLocationsGatewaysListCall) Pages(ctx context.Context, f func(*ListGatewaysResponse) error) error { | |
| c.ctx_ = ctx | |
| defer c.PageToken(c.urlParams_.Get("pageToken")) | |
| for { | |
| x, err := c.Do() | |
| if err != nil { | |
| return err | |
| } | |
| if err := f(x); err != nil { | |
| return err | |
| } | |
| if x.NextPageToken == "" { | |
| return nil | |
| } | |
| c.PageToken(x.NextPageToken) | |
| } | |
| } | |
| type ProjectsLocationsGatewaysPatchCall struct { | |
| s *Service | |
| name string | |
| gateway *Gateway | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Patch: Updates the parameters of a single Gateway. | |
| // | |
| // - name: Identifier. Name of the Gateway resource. It matches pattern | |
| // `projects/*/locations/*/gateways/`. | |
| func (r *ProjectsLocationsGatewaysService) Patch(name string, gateway *Gateway) *ProjectsLocationsGatewaysPatchCall { | |
| c := &ProjectsLocationsGatewaysPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| c.gateway = gateway | |
| return c | |
| } | |
| // UpdateMask sets the optional parameter "updateMask": Field mask is used to | |
| // specify the fields to be overwritten in the Gateway resource by the update. | |
| // The fields specified in the update_mask are relative to the resource, not | |
| // the full request. A field will be overwritten if it is in the mask. If the | |
| // user does not provide a mask then all fields will be overwritten. | |
| func (c *ProjectsLocationsGatewaysPatchCall) UpdateMask(updateMask string) *ProjectsLocationsGatewaysPatchCall { | |
| c.urlParams_.Set("updateMask", updateMask) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsGatewaysPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsGatewaysPatchCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsGatewaysPatchCall) Context(ctx context.Context) *ProjectsLocationsGatewaysPatchCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsGatewaysPatchCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsGatewaysPatchCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.gateway) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("PATCH", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.gateways.patch", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.gateways.patch" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsGatewaysPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.gateways.patch", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsGatewaysRouteViewsGetCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Get: Get a single RouteView of a Gateway. | |
| // | |
| // - name: Name of the GatewayRouteView resource. Formats: | |
| // projects/{project_number}/locations/{location}/gateways/{gateway}/routeView | |
| // s/{route_view}. | |
| func (r *ProjectsLocationsGatewaysRouteViewsService) Get(name string) *ProjectsLocationsGatewaysRouteViewsGetCall { | |
| c := &ProjectsLocationsGatewaysRouteViewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsGatewaysRouteViewsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGatewaysRouteViewsGetCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsGatewaysRouteViewsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGatewaysRouteViewsGetCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsGatewaysRouteViewsGetCall) Context(ctx context.Context) *ProjectsLocationsGatewaysRouteViewsGetCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsGatewaysRouteViewsGetCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsGatewaysRouteViewsGetCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.gateways.routeViews.get", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.gateways.routeViews.get" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *GatewayRouteView.ServerResponse.Header or (if a response was returned at | |
| // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to | |
| // check whether the returned error was because http.StatusNotModified was | |
| // returned. | |
| func (c *ProjectsLocationsGatewaysRouteViewsGetCall) Do(opts ...googleapi.CallOption) (*GatewayRouteView, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &GatewayRouteView{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.gateways.routeViews.get", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsGatewaysRouteViewsListCall struct { | |
| s *Service | |
| parent string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // List: Lists RouteViews | |
| // | |
| // - parent: The Gateway to which a Route is associated. Formats: | |
| // projects/{project_number}/locations/{location}/gateways/{gateway}. | |
| func (r *ProjectsLocationsGatewaysRouteViewsService) List(parent string) *ProjectsLocationsGatewaysRouteViewsListCall { | |
| c := &ProjectsLocationsGatewaysRouteViewsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| return c | |
| } | |
| // PageSize sets the optional parameter "pageSize": Maximum number of | |
| // GatewayRouteViews to return per call. | |
| func (c *ProjectsLocationsGatewaysRouteViewsListCall) PageSize(pageSize int64) *ProjectsLocationsGatewaysRouteViewsListCall { | |
| c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) | |
| return c | |
| } | |
| // PageToken sets the optional parameter "pageToken": The value returned by the | |
| // last `ListGatewayRouteViewsResponse` Indicates that this is a continuation | |
| // of a prior `ListGatewayRouteViews` call, and that the system should return | |
| // the next page of data. | |
| func (c *ProjectsLocationsGatewaysRouteViewsListCall) PageToken(pageToken string) *ProjectsLocationsGatewaysRouteViewsListCall { | |
| c.urlParams_.Set("pageToken", pageToken) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsGatewaysRouteViewsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsGatewaysRouteViewsListCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsGatewaysRouteViewsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsGatewaysRouteViewsListCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsGatewaysRouteViewsListCall) Context(ctx context.Context) *ProjectsLocationsGatewaysRouteViewsListCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsGatewaysRouteViewsListCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsGatewaysRouteViewsListCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/routeViews") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.gateways.routeViews.list", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.gateways.routeViews.list" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *ListGatewayRouteViewsResponse.ServerResponse.Header or (if a response was | |
| // returned at all) in error.(*googleapi.Error).Header. Use | |
| // googleapi.IsNotModified to check whether the returned error was because | |
| // http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsGatewaysRouteViewsListCall) Do(opts ...googleapi.CallOption) (*ListGatewayRouteViewsResponse, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &ListGatewayRouteViewsResponse{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.gateways.routeViews.list", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| // Pages invokes f for each page of results. | |
| // A non-nil error returned from f will halt the iteration. | |
| // The provided context supersedes any context provided to the Context method. | |
| func (c *ProjectsLocationsGatewaysRouteViewsListCall) Pages(ctx context.Context, f func(*ListGatewayRouteViewsResponse) error) error { | |
| c.ctx_ = ctx | |
| defer c.PageToken(c.urlParams_.Get("pageToken")) | |
| for { | |
| x, err := c.Do() | |
| if err != nil { | |
| return err | |
| } | |
| if err := f(x); err != nil { | |
| return err | |
| } | |
| if x.NextPageToken == "" { | |
| return nil | |
| } | |
| c.PageToken(x.NextPageToken) | |
| } | |
| } | |
| type ProjectsLocationsGrpcRoutesCreateCall struct { | |
| s *Service | |
| parent string | |
| grpcroute *GrpcRoute | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Create: Creates a new GrpcRoute in a given project and location. | |
| // | |
| // - parent: The parent resource of the GrpcRoute. Must be in the format | |
| // `projects/*/locations/*`. | |
| func (r *ProjectsLocationsGrpcRoutesService) Create(parent string, grpcroute *GrpcRoute) *ProjectsLocationsGrpcRoutesCreateCall { | |
| c := &ProjectsLocationsGrpcRoutesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| c.grpcroute = grpcroute | |
| return c | |
| } | |
| // GrpcRouteId sets the optional parameter "grpcRouteId": Required. Short name | |
| // of the GrpcRoute resource to be created. | |
| func (c *ProjectsLocationsGrpcRoutesCreateCall) GrpcRouteId(grpcRouteId string) *ProjectsLocationsGrpcRoutesCreateCall { | |
| c.urlParams_.Set("grpcRouteId", grpcRouteId) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsGrpcRoutesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsGrpcRoutesCreateCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsGrpcRoutesCreateCall) Context(ctx context.Context) *ProjectsLocationsGrpcRoutesCreateCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsGrpcRoutesCreateCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsGrpcRoutesCreateCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.grpcroute) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/grpcRoutes") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("POST", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.grpcRoutes.create", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.grpcRoutes.create" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsGrpcRoutesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.grpcRoutes.create", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsGrpcRoutesDeleteCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Delete: Deletes a single GrpcRoute. | |
| // | |
| // - name: A name of the GrpcRoute to delete. Must be in the format | |
| // `projects/*/locations/*/grpcRoutes/*`. | |
| func (r *ProjectsLocationsGrpcRoutesService) Delete(name string) *ProjectsLocationsGrpcRoutesDeleteCall { | |
| c := &ProjectsLocationsGrpcRoutesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsGrpcRoutesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsGrpcRoutesDeleteCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsGrpcRoutesDeleteCall) Context(ctx context.Context) *ProjectsLocationsGrpcRoutesDeleteCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsGrpcRoutesDeleteCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsGrpcRoutesDeleteCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("DELETE", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.grpcRoutes.delete", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.grpcRoutes.delete" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsGrpcRoutesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.grpcRoutes.delete", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsGrpcRoutesGetCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Get: Gets details of a single GrpcRoute. | |
| // | |
| // - name: A name of the GrpcRoute to get. Must be in the format | |
| // `projects/*/locations/*/grpcRoutes/*`. | |
| func (r *ProjectsLocationsGrpcRoutesService) Get(name string) *ProjectsLocationsGrpcRoutesGetCall { | |
| c := &ProjectsLocationsGrpcRoutesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsGrpcRoutesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGrpcRoutesGetCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsGrpcRoutesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGrpcRoutesGetCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsGrpcRoutesGetCall) Context(ctx context.Context) *ProjectsLocationsGrpcRoutesGetCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsGrpcRoutesGetCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsGrpcRoutesGetCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.grpcRoutes.get", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.grpcRoutes.get" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *GrpcRoute.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsGrpcRoutesGetCall) Do(opts ...googleapi.CallOption) (*GrpcRoute, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &GrpcRoute{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.grpcRoutes.get", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsGrpcRoutesListCall struct { | |
| s *Service | |
| parent string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // List: Lists GrpcRoutes in a given project and location. | |
| // | |
| // - parent: The project and location from which the GrpcRoutes should be | |
| // listed, specified in the format `projects/*/locations/*`. | |
| func (r *ProjectsLocationsGrpcRoutesService) List(parent string) *ProjectsLocationsGrpcRoutesListCall { | |
| c := &ProjectsLocationsGrpcRoutesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| return c | |
| } | |
| // PageSize sets the optional parameter "pageSize": Maximum number of | |
| // GrpcRoutes to return per call. | |
| func (c *ProjectsLocationsGrpcRoutesListCall) PageSize(pageSize int64) *ProjectsLocationsGrpcRoutesListCall { | |
| c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) | |
| return c | |
| } | |
| // PageToken sets the optional parameter "pageToken": The value returned by the | |
| // last `ListGrpcRoutesResponse` Indicates that this is a continuation of a | |
| // prior `ListGrpcRoutes` call, and that the system should return the next page | |
| // of data. | |
| func (c *ProjectsLocationsGrpcRoutesListCall) PageToken(pageToken string) *ProjectsLocationsGrpcRoutesListCall { | |
| c.urlParams_.Set("pageToken", pageToken) | |
| return c | |
| } | |
| // ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": If | |
| // true, allow partial responses for multi-regional Aggregated List requests. | |
| // Otherwise if one of the locations is down or unreachable, the Aggregated | |
| // List request will fail. | |
| func (c *ProjectsLocationsGrpcRoutesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *ProjectsLocationsGrpcRoutesListCall { | |
| c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsGrpcRoutesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsGrpcRoutesListCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsGrpcRoutesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsGrpcRoutesListCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsGrpcRoutesListCall) Context(ctx context.Context) *ProjectsLocationsGrpcRoutesListCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsGrpcRoutesListCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsGrpcRoutesListCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/grpcRoutes") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.grpcRoutes.list", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.grpcRoutes.list" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *ListGrpcRoutesResponse.ServerResponse.Header or (if a response was returned | |
| // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to | |
| // check whether the returned error was because http.StatusNotModified was | |
| // returned. | |
| func (c *ProjectsLocationsGrpcRoutesListCall) Do(opts ...googleapi.CallOption) (*ListGrpcRoutesResponse, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &ListGrpcRoutesResponse{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.grpcRoutes.list", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| // Pages invokes f for each page of results. | |
| // A non-nil error returned from f will halt the iteration. | |
| // The provided context supersedes any context provided to the Context method. | |
| func (c *ProjectsLocationsGrpcRoutesListCall) Pages(ctx context.Context, f func(*ListGrpcRoutesResponse) error) error { | |
| c.ctx_ = ctx | |
| defer c.PageToken(c.urlParams_.Get("pageToken")) | |
| for { | |
| x, err := c.Do() | |
| if err != nil { | |
| return err | |
| } | |
| if err := f(x); err != nil { | |
| return err | |
| } | |
| if x.NextPageToken == "" { | |
| return nil | |
| } | |
| c.PageToken(x.NextPageToken) | |
| } | |
| } | |
| type ProjectsLocationsGrpcRoutesPatchCall struct { | |
| s *Service | |
| name string | |
| grpcroute *GrpcRoute | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Patch: Updates the parameters of a single GrpcRoute. | |
| // | |
| // - name: Identifier. Name of the GrpcRoute resource. It matches pattern | |
| // `projects/*/locations/*/grpcRoutes/`. | |
| func (r *ProjectsLocationsGrpcRoutesService) Patch(name string, grpcroute *GrpcRoute) *ProjectsLocationsGrpcRoutesPatchCall { | |
| c := &ProjectsLocationsGrpcRoutesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| c.grpcroute = grpcroute | |
| return c | |
| } | |
| // UpdateMask sets the optional parameter "updateMask": Field mask is used to | |
| // specify the fields to be overwritten in the GrpcRoute resource by the | |
| // update. The fields specified in the update_mask are relative to the | |
| // resource, not the full request. A field will be overwritten if it is in the | |
| // mask. If the user does not provide a mask then all fields will be | |
| // overwritten. | |
| func (c *ProjectsLocationsGrpcRoutesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsGrpcRoutesPatchCall { | |
| c.urlParams_.Set("updateMask", updateMask) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsGrpcRoutesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsGrpcRoutesPatchCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsGrpcRoutesPatchCall) Context(ctx context.Context) *ProjectsLocationsGrpcRoutesPatchCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsGrpcRoutesPatchCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsGrpcRoutesPatchCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.grpcroute) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("PATCH", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.grpcRoutes.patch", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.grpcRoutes.patch" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsGrpcRoutesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.grpcRoutes.patch", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsHttpRoutesCreateCall struct { | |
| s *Service | |
| parent string | |
| httproute *HttpRoute | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Create: Creates a new HttpRoute in a given project and location. | |
| // | |
| // - parent: The parent resource of the HttpRoute. Must be in the format | |
| // `projects/*/locations/*`. | |
| func (r *ProjectsLocationsHttpRoutesService) Create(parent string, httproute *HttpRoute) *ProjectsLocationsHttpRoutesCreateCall { | |
| c := &ProjectsLocationsHttpRoutesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| c.httproute = httproute | |
| return c | |
| } | |
| // HttpRouteId sets the optional parameter "httpRouteId": Required. Short name | |
| // of the HttpRoute resource to be created. | |
| func (c *ProjectsLocationsHttpRoutesCreateCall) HttpRouteId(httpRouteId string) *ProjectsLocationsHttpRoutesCreateCall { | |
| c.urlParams_.Set("httpRouteId", httpRouteId) | |
| return c | |
| } | |
| // RequestId sets the optional parameter "requestId": Idempotent request UUID. | |
| func (c *ProjectsLocationsHttpRoutesCreateCall) RequestId(requestId string) *ProjectsLocationsHttpRoutesCreateCall { | |
| c.urlParams_.Set("requestId", requestId) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsHttpRoutesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsHttpRoutesCreateCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsHttpRoutesCreateCall) Context(ctx context.Context) *ProjectsLocationsHttpRoutesCreateCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsHttpRoutesCreateCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsHttpRoutesCreateCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.httproute) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/httpRoutes") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("POST", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.httpRoutes.create", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.httpRoutes.create" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsHttpRoutesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.httpRoutes.create", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsHttpRoutesDeleteCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Delete: Deletes a single HttpRoute. | |
| // | |
| // - name: A name of the HttpRoute to delete. Must be in the format | |
| // `projects/*/locations/*/httpRoutes/*`. | |
| func (r *ProjectsLocationsHttpRoutesService) Delete(name string) *ProjectsLocationsHttpRoutesDeleteCall { | |
| c := &ProjectsLocationsHttpRoutesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsHttpRoutesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsHttpRoutesDeleteCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsHttpRoutesDeleteCall) Context(ctx context.Context) *ProjectsLocationsHttpRoutesDeleteCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsHttpRoutesDeleteCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsHttpRoutesDeleteCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("DELETE", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.httpRoutes.delete", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.httpRoutes.delete" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsHttpRoutesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.httpRoutes.delete", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsHttpRoutesGetCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Get: Gets details of a single HttpRoute. | |
| // | |
| // - name: A name of the HttpRoute to get. Must be in the format | |
| // `projects/*/locations/*/httpRoutes/*`. | |
| func (r *ProjectsLocationsHttpRoutesService) Get(name string) *ProjectsLocationsHttpRoutesGetCall { | |
| c := &ProjectsLocationsHttpRoutesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsHttpRoutesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsHttpRoutesGetCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsHttpRoutesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsHttpRoutesGetCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsHttpRoutesGetCall) Context(ctx context.Context) *ProjectsLocationsHttpRoutesGetCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsHttpRoutesGetCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsHttpRoutesGetCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.httpRoutes.get", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.httpRoutes.get" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *HttpRoute.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsHttpRoutesGetCall) Do(opts ...googleapi.CallOption) (*HttpRoute, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &HttpRoute{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.httpRoutes.get", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsHttpRoutesListCall struct { | |
| s *Service | |
| parent string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // List: Lists HttpRoute in a given project and location. | |
| // | |
| // - parent: The project and location from which the HttpRoutes should be | |
| // listed, specified in the format `projects/*/locations/*`. | |
| func (r *ProjectsLocationsHttpRoutesService) List(parent string) *ProjectsLocationsHttpRoutesListCall { | |
| c := &ProjectsLocationsHttpRoutesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| return c | |
| } | |
| // Filter sets the optional parameter "filter": Filter expression to restrict | |
| // the list. | |
| func (c *ProjectsLocationsHttpRoutesListCall) Filter(filter string) *ProjectsLocationsHttpRoutesListCall { | |
| c.urlParams_.Set("filter", filter) | |
| return c | |
| } | |
| // PageSize sets the optional parameter "pageSize": Maximum number of | |
| // HttpRoutes to return per call. | |
| func (c *ProjectsLocationsHttpRoutesListCall) PageSize(pageSize int64) *ProjectsLocationsHttpRoutesListCall { | |
| c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) | |
| return c | |
| } | |
| // PageToken sets the optional parameter "pageToken": The value returned by the | |
| // last `ListHttpRoutesResponse` Indicates that this is a continuation of a | |
| // prior `ListHttpRoutes` call, and that the system should return the next page | |
| // of data. | |
| func (c *ProjectsLocationsHttpRoutesListCall) PageToken(pageToken string) *ProjectsLocationsHttpRoutesListCall { | |
| c.urlParams_.Set("pageToken", pageToken) | |
| return c | |
| } | |
| // ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": If | |
| // true, allow partial responses for multi-regional Aggregated List requests. | |
| // Otherwise if one of the locations is down or unreachable, the Aggregated | |
| // List request will fail. | |
| func (c *ProjectsLocationsHttpRoutesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *ProjectsLocationsHttpRoutesListCall { | |
| c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsHttpRoutesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsHttpRoutesListCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsHttpRoutesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsHttpRoutesListCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsHttpRoutesListCall) Context(ctx context.Context) *ProjectsLocationsHttpRoutesListCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsHttpRoutesListCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsHttpRoutesListCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/httpRoutes") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.httpRoutes.list", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.httpRoutes.list" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *ListHttpRoutesResponse.ServerResponse.Header or (if a response was returned | |
| // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to | |
| // check whether the returned error was because http.StatusNotModified was | |
| // returned. | |
| func (c *ProjectsLocationsHttpRoutesListCall) Do(opts ...googleapi.CallOption) (*ListHttpRoutesResponse, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &ListHttpRoutesResponse{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.httpRoutes.list", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| // Pages invokes f for each page of results. | |
| // A non-nil error returned from f will halt the iteration. | |
| // The provided context supersedes any context provided to the Context method. | |
| func (c *ProjectsLocationsHttpRoutesListCall) Pages(ctx context.Context, f func(*ListHttpRoutesResponse) error) error { | |
| c.ctx_ = ctx | |
| defer c.PageToken(c.urlParams_.Get("pageToken")) | |
| for { | |
| x, err := c.Do() | |
| if err != nil { | |
| return err | |
| } | |
| if err := f(x); err != nil { | |
| return err | |
| } | |
| if x.NextPageToken == "" { | |
| return nil | |
| } | |
| c.PageToken(x.NextPageToken) | |
| } | |
| } | |
| type ProjectsLocationsHttpRoutesPatchCall struct { | |
| s *Service | |
| name string | |
| httproute *HttpRoute | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Patch: Updates the parameters of a single HttpRoute. | |
| // | |
| // - name: Identifier. Name of the HttpRoute resource. It matches pattern | |
| // `projects/*/locations/*/httpRoutes/http_route_name>`. | |
| func (r *ProjectsLocationsHttpRoutesService) Patch(name string, httproute *HttpRoute) *ProjectsLocationsHttpRoutesPatchCall { | |
| c := &ProjectsLocationsHttpRoutesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| c.httproute = httproute | |
| return c | |
| } | |
| // UpdateMask sets the optional parameter "updateMask": Field mask is used to | |
| // specify the fields to be overwritten in the HttpRoute resource by the | |
| // update. The fields specified in the update_mask are relative to the | |
| // resource, not the full request. A field will be overwritten if it is in the | |
| // mask. If the user does not provide a mask then all fields will be | |
| // overwritten. | |
| func (c *ProjectsLocationsHttpRoutesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsHttpRoutesPatchCall { | |
| c.urlParams_.Set("updateMask", updateMask) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsHttpRoutesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsHttpRoutesPatchCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsHttpRoutesPatchCall) Context(ctx context.Context) *ProjectsLocationsHttpRoutesPatchCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsHttpRoutesPatchCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsHttpRoutesPatchCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.httproute) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("PATCH", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.httpRoutes.patch", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.httpRoutes.patch" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsHttpRoutesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.httpRoutes.patch", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsLbEdgeExtensionsCreateCall struct { | |
| s *Service | |
| parent string | |
| lbedgeextension *LbEdgeExtension | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Create: Creates a new `LbEdgeExtension` resource in a given project and | |
| // location. | |
| // | |
| // - parent: The parent resource of the `LbEdgeExtension` resource. Must be in | |
| // the format `projects/{project}/locations/{location}`. | |
| func (r *ProjectsLocationsLbEdgeExtensionsService) Create(parent string, lbedgeextension *LbEdgeExtension) *ProjectsLocationsLbEdgeExtensionsCreateCall { | |
| c := &ProjectsLocationsLbEdgeExtensionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| c.lbedgeextension = lbedgeextension | |
| return c | |
| } | |
| // LbEdgeExtensionId sets the optional parameter "lbEdgeExtensionId": Required. | |
| // User-provided ID of the `LbEdgeExtension` resource to be created. | |
| func (c *ProjectsLocationsLbEdgeExtensionsCreateCall) LbEdgeExtensionId(lbEdgeExtensionId string) *ProjectsLocationsLbEdgeExtensionsCreateCall { | |
| c.urlParams_.Set("lbEdgeExtensionId", lbEdgeExtensionId) | |
| return c | |
| } | |
| // RequestId sets the optional parameter "requestId": An optional request ID to | |
| // identify requests. Specify a unique request ID so that if you must retry | |
| // your request, the server can ignore the request if it has already been | |
| // completed. The server guarantees that for 60 minutes since the first | |
| // request. For example, consider a situation where you make an initial request | |
| // and the request times out. If you make the request again with the same | |
| // request ID, the server ignores the second request This prevents clients from | |
| // accidentally creating duplicate commitments. The request ID must be a valid | |
| // UUID with the exception that zero UUID is not supported | |
| // (00000000-0000-0000-0000-000000000000). | |
| func (c *ProjectsLocationsLbEdgeExtensionsCreateCall) RequestId(requestId string) *ProjectsLocationsLbEdgeExtensionsCreateCall { | |
| c.urlParams_.Set("requestId", requestId) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsLbEdgeExtensionsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbEdgeExtensionsCreateCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsLbEdgeExtensionsCreateCall) Context(ctx context.Context) *ProjectsLocationsLbEdgeExtensionsCreateCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsLbEdgeExtensionsCreateCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsLbEdgeExtensionsCreateCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lbedgeextension) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/lbEdgeExtensions") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("POST", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbEdgeExtensions.create", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.lbEdgeExtensions.create" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsLbEdgeExtensionsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbEdgeExtensions.create", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsLbEdgeExtensionsDeleteCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Delete: Deletes the specified `LbEdgeExtension` resource. | |
| // | |
| // - name: The name of the `LbEdgeExtension` resource to delete. Must be in the | |
| // format | |
| // `projects/{project}/locations/{location}/lbEdgeExtensions/{lb_edge_extensio | |
| // n}`. | |
| func (r *ProjectsLocationsLbEdgeExtensionsService) Delete(name string) *ProjectsLocationsLbEdgeExtensionsDeleteCall { | |
| c := &ProjectsLocationsLbEdgeExtensionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // RequestId sets the optional parameter "requestId": An optional request ID to | |
| // identify requests. Specify a unique request ID so that if you must retry | |
| // your request, the server can ignore the request if it has already been | |
| // completed. The server guarantees that for 60 minutes after the first | |
| // request. For example, consider a situation where you make an initial request | |
| // and the request times out. If you make the request again with the same | |
| // request ID, the server ignores the second request This prevents clients from | |
| // accidentally creating duplicate commitments. The request ID must be a valid | |
| // UUID with the exception that zero UUID is not supported | |
| // (00000000-0000-0000-0000-000000000000). | |
| func (c *ProjectsLocationsLbEdgeExtensionsDeleteCall) RequestId(requestId string) *ProjectsLocationsLbEdgeExtensionsDeleteCall { | |
| c.urlParams_.Set("requestId", requestId) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsLbEdgeExtensionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbEdgeExtensionsDeleteCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsLbEdgeExtensionsDeleteCall) Context(ctx context.Context) *ProjectsLocationsLbEdgeExtensionsDeleteCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsLbEdgeExtensionsDeleteCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsLbEdgeExtensionsDeleteCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("DELETE", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbEdgeExtensions.delete", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.lbEdgeExtensions.delete" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsLbEdgeExtensionsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbEdgeExtensions.delete", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsLbEdgeExtensionsGetCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Get: Gets details of the specified `LbEdgeExtension` resource. | |
| // | |
| // - name: A name of the `LbEdgeExtension` resource to get. Must be in the | |
| // format | |
| // `projects/{project}/locations/{location}/lbEdgeExtensions/{lb_edge_extensio | |
| // n}`. | |
| func (r *ProjectsLocationsLbEdgeExtensionsService) Get(name string) *ProjectsLocationsLbEdgeExtensionsGetCall { | |
| c := &ProjectsLocationsLbEdgeExtensionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsLbEdgeExtensionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbEdgeExtensionsGetCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsLbEdgeExtensionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsLbEdgeExtensionsGetCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsLbEdgeExtensionsGetCall) Context(ctx context.Context) *ProjectsLocationsLbEdgeExtensionsGetCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsLbEdgeExtensionsGetCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsLbEdgeExtensionsGetCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbEdgeExtensions.get", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.lbEdgeExtensions.get" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *LbEdgeExtension.ServerResponse.Header or (if a response was returned at | |
| // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to | |
| // check whether the returned error was because http.StatusNotModified was | |
| // returned. | |
| func (c *ProjectsLocationsLbEdgeExtensionsGetCall) Do(opts ...googleapi.CallOption) (*LbEdgeExtension, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &LbEdgeExtension{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbEdgeExtensions.get", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsLbEdgeExtensionsListCall struct { | |
| s *Service | |
| parent string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // List: Lists `LbEdgeExtension` resources in a given project and location. | |
| // | |
| // - parent: The project and location from which the `LbEdgeExtension` | |
| // resources are listed. These values are specified in the following format: | |
| // `projects/{project}/locations/{location}`. | |
| func (r *ProjectsLocationsLbEdgeExtensionsService) List(parent string) *ProjectsLocationsLbEdgeExtensionsListCall { | |
| c := &ProjectsLocationsLbEdgeExtensionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| return c | |
| } | |
| // Filter sets the optional parameter "filter": Filtering results. | |
| func (c *ProjectsLocationsLbEdgeExtensionsListCall) Filter(filter string) *ProjectsLocationsLbEdgeExtensionsListCall { | |
| c.urlParams_.Set("filter", filter) | |
| return c | |
| } | |
| // OrderBy sets the optional parameter "orderBy": Hint about how to order the | |
| // results. | |
| func (c *ProjectsLocationsLbEdgeExtensionsListCall) OrderBy(orderBy string) *ProjectsLocationsLbEdgeExtensionsListCall { | |
| c.urlParams_.Set("orderBy", orderBy) | |
| return c | |
| } | |
| // PageSize sets the optional parameter "pageSize": Requested page size. The | |
| // server might return fewer items than requested. If unspecified, the server | |
| // picks an appropriate default. | |
| func (c *ProjectsLocationsLbEdgeExtensionsListCall) PageSize(pageSize int64) *ProjectsLocationsLbEdgeExtensionsListCall { | |
| c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) | |
| return c | |
| } | |
| // PageToken sets the optional parameter "pageToken": A token identifying a | |
| // page of results that the server returns. | |
| func (c *ProjectsLocationsLbEdgeExtensionsListCall) PageToken(pageToken string) *ProjectsLocationsLbEdgeExtensionsListCall { | |
| c.urlParams_.Set("pageToken", pageToken) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsLbEdgeExtensionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbEdgeExtensionsListCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsLbEdgeExtensionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsLbEdgeExtensionsListCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsLbEdgeExtensionsListCall) Context(ctx context.Context) *ProjectsLocationsLbEdgeExtensionsListCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsLbEdgeExtensionsListCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsLbEdgeExtensionsListCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/lbEdgeExtensions") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbEdgeExtensions.list", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.lbEdgeExtensions.list" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *ListLbEdgeExtensionsResponse.ServerResponse.Header or (if a response was | |
| // returned at all) in error.(*googleapi.Error).Header. Use | |
| // googleapi.IsNotModified to check whether the returned error was because | |
| // http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsLbEdgeExtensionsListCall) Do(opts ...googleapi.CallOption) (*ListLbEdgeExtensionsResponse, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &ListLbEdgeExtensionsResponse{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbEdgeExtensions.list", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| // Pages invokes f for each page of results. | |
| // A non-nil error returned from f will halt the iteration. | |
| // The provided context supersedes any context provided to the Context method. | |
| func (c *ProjectsLocationsLbEdgeExtensionsListCall) Pages(ctx context.Context, f func(*ListLbEdgeExtensionsResponse) error) error { | |
| c.ctx_ = ctx | |
| defer c.PageToken(c.urlParams_.Get("pageToken")) | |
| for { | |
| x, err := c.Do() | |
| if err != nil { | |
| return err | |
| } | |
| if err := f(x); err != nil { | |
| return err | |
| } | |
| if x.NextPageToken == "" { | |
| return nil | |
| } | |
| c.PageToken(x.NextPageToken) | |
| } | |
| } | |
| type ProjectsLocationsLbEdgeExtensionsPatchCall struct { | |
| s *Service | |
| name string | |
| lbedgeextension *LbEdgeExtension | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Patch: Updates the parameters of the specified `LbEdgeExtension` resource. | |
| // | |
| // - name: Identifier. Name of the `LbEdgeExtension` resource in the following | |
| // format: | |
| // `projects/{project}/locations/{location}/lbEdgeExtensions/{lb_edge_extensio | |
| // n}`. | |
| func (r *ProjectsLocationsLbEdgeExtensionsService) Patch(name string, lbedgeextension *LbEdgeExtension) *ProjectsLocationsLbEdgeExtensionsPatchCall { | |
| c := &ProjectsLocationsLbEdgeExtensionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| c.lbedgeextension = lbedgeextension | |
| return c | |
| } | |
| // RequestId sets the optional parameter "requestId": An optional request ID to | |
| // identify requests. Specify a unique request ID so that if you must retry | |
| // your request, the server can ignore the request if it has already been | |
| // completed. The server guarantees that for 60 minutes since the first | |
| // request. For example, consider a situation where you make an initial request | |
| // and the request times out. If you make the request again with the same | |
| // request ID, the server ignores the second request This prevents clients from | |
| // accidentally creating duplicate commitments. The request ID must be a valid | |
| // UUID with the exception that zero UUID is not supported | |
| // (00000000-0000-0000-0000-000000000000). | |
| func (c *ProjectsLocationsLbEdgeExtensionsPatchCall) RequestId(requestId string) *ProjectsLocationsLbEdgeExtensionsPatchCall { | |
| c.urlParams_.Set("requestId", requestId) | |
| return c | |
| } | |
| // UpdateMask sets the optional parameter "updateMask": Used to specify the | |
| // fields to be overwritten in the `LbEdgeExtension` resource by the update. | |
| // The fields specified in the `update_mask` are relative to the resource, not | |
| // the full request. A field is overwritten if it is in the mask. If the user | |
| // does not specify a mask, then all fields are overwritten. | |
| func (c *ProjectsLocationsLbEdgeExtensionsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsLbEdgeExtensionsPatchCall { | |
| c.urlParams_.Set("updateMask", updateMask) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsLbEdgeExtensionsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbEdgeExtensionsPatchCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsLbEdgeExtensionsPatchCall) Context(ctx context.Context) *ProjectsLocationsLbEdgeExtensionsPatchCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsLbEdgeExtensionsPatchCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsLbEdgeExtensionsPatchCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lbedgeextension) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("PATCH", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbEdgeExtensions.patch", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.lbEdgeExtensions.patch" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsLbEdgeExtensionsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbEdgeExtensions.patch", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsLbRouteExtensionsCreateCall struct { | |
| s *Service | |
| parent string | |
| lbrouteextension *LbRouteExtension | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Create: Creates a new `LbRouteExtension` resource in a given project and | |
| // location. | |
| // | |
| // - parent: The parent resource of the `LbRouteExtension` resource. Must be in | |
| // the format `projects/{project}/locations/{location}`. | |
| func (r *ProjectsLocationsLbRouteExtensionsService) Create(parent string, lbrouteextension *LbRouteExtension) *ProjectsLocationsLbRouteExtensionsCreateCall { | |
| c := &ProjectsLocationsLbRouteExtensionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| c.lbrouteextension = lbrouteextension | |
| return c | |
| } | |
| // LbRouteExtensionId sets the optional parameter "lbRouteExtensionId": | |
| // Required. User-provided ID of the `LbRouteExtension` resource to be created. | |
| func (c *ProjectsLocationsLbRouteExtensionsCreateCall) LbRouteExtensionId(lbRouteExtensionId string) *ProjectsLocationsLbRouteExtensionsCreateCall { | |
| c.urlParams_.Set("lbRouteExtensionId", lbRouteExtensionId) | |
| return c | |
| } | |
| // RequestId sets the optional parameter "requestId": An optional request ID to | |
| // identify requests. Specify a unique request ID so that if you must retry | |
| // your request, the server can ignore the request if it has already been | |
| // completed. The server guarantees that for 60 minutes since the first | |
| // request. For example, consider a situation where you make an initial request | |
| // and the request times out. If you make the request again with the same | |
| // request ID, the server ignores the second request This prevents clients from | |
| // accidentally creating duplicate commitments. The request ID must be a valid | |
| // UUID with the exception that zero UUID is not supported | |
| // (00000000-0000-0000-0000-000000000000). | |
| func (c *ProjectsLocationsLbRouteExtensionsCreateCall) RequestId(requestId string) *ProjectsLocationsLbRouteExtensionsCreateCall { | |
| c.urlParams_.Set("requestId", requestId) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsLbRouteExtensionsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbRouteExtensionsCreateCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsLbRouteExtensionsCreateCall) Context(ctx context.Context) *ProjectsLocationsLbRouteExtensionsCreateCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsLbRouteExtensionsCreateCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsLbRouteExtensionsCreateCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lbrouteextension) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/lbRouteExtensions") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("POST", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbRouteExtensions.create", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.lbRouteExtensions.create" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsLbRouteExtensionsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbRouteExtensions.create", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsLbRouteExtensionsDeleteCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Delete: Deletes the specified `LbRouteExtension` resource. | |
| // | |
| // - name: The name of the `LbRouteExtension` resource to delete. Must be in | |
| // the format | |
| // `projects/{project}/locations/{location}/lbRouteExtensions/{lb_route_extens | |
| // ion}`. | |
| func (r *ProjectsLocationsLbRouteExtensionsService) Delete(name string) *ProjectsLocationsLbRouteExtensionsDeleteCall { | |
| c := &ProjectsLocationsLbRouteExtensionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // RequestId sets the optional parameter "requestId": An optional request ID to | |
| // identify requests. Specify a unique request ID so that if you must retry | |
| // your request, the server can ignore the request if it has already been | |
| // completed. The server guarantees that for 60 minutes after the first | |
| // request. For example, consider a situation where you make an initial request | |
| // and the request times out. If you make the request again with the same | |
| // request ID, the server ignores the second request This prevents clients from | |
| // accidentally creating duplicate commitments. The request ID must be a valid | |
| // UUID with the exception that zero UUID is not supported | |
| // (00000000-0000-0000-0000-000000000000). | |
| func (c *ProjectsLocationsLbRouteExtensionsDeleteCall) RequestId(requestId string) *ProjectsLocationsLbRouteExtensionsDeleteCall { | |
| c.urlParams_.Set("requestId", requestId) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsLbRouteExtensionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbRouteExtensionsDeleteCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsLbRouteExtensionsDeleteCall) Context(ctx context.Context) *ProjectsLocationsLbRouteExtensionsDeleteCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsLbRouteExtensionsDeleteCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsLbRouteExtensionsDeleteCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("DELETE", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbRouteExtensions.delete", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.lbRouteExtensions.delete" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsLbRouteExtensionsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbRouteExtensions.delete", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsLbRouteExtensionsGetCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Get: Gets details of the specified `LbRouteExtension` resource. | |
| // | |
| // - name: A name of the `LbRouteExtension` resource to get. Must be in the | |
| // format | |
| // `projects/{project}/locations/{location}/lbRouteExtensions/{lb_route_extens | |
| // ion}`. | |
| func (r *ProjectsLocationsLbRouteExtensionsService) Get(name string) *ProjectsLocationsLbRouteExtensionsGetCall { | |
| c := &ProjectsLocationsLbRouteExtensionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsLbRouteExtensionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbRouteExtensionsGetCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsLbRouteExtensionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsLbRouteExtensionsGetCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsLbRouteExtensionsGetCall) Context(ctx context.Context) *ProjectsLocationsLbRouteExtensionsGetCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsLbRouteExtensionsGetCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsLbRouteExtensionsGetCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbRouteExtensions.get", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.lbRouteExtensions.get" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *LbRouteExtension.ServerResponse.Header or (if a response was returned at | |
| // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to | |
| // check whether the returned error was because http.StatusNotModified was | |
| // returned. | |
| func (c *ProjectsLocationsLbRouteExtensionsGetCall) Do(opts ...googleapi.CallOption) (*LbRouteExtension, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &LbRouteExtension{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbRouteExtensions.get", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsLbRouteExtensionsListCall struct { | |
| s *Service | |
| parent string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // List: Lists `LbRouteExtension` resources in a given project and location. | |
| // | |
| // - parent: The project and location from which the `LbRouteExtension` | |
| // resources are listed. These values are specified in the following format: | |
| // `projects/{project}/locations/{location}`. | |
| func (r *ProjectsLocationsLbRouteExtensionsService) List(parent string) *ProjectsLocationsLbRouteExtensionsListCall { | |
| c := &ProjectsLocationsLbRouteExtensionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| return c | |
| } | |
| // Filter sets the optional parameter "filter": Filtering results. | |
| func (c *ProjectsLocationsLbRouteExtensionsListCall) Filter(filter string) *ProjectsLocationsLbRouteExtensionsListCall { | |
| c.urlParams_.Set("filter", filter) | |
| return c | |
| } | |
| // OrderBy sets the optional parameter "orderBy": Hint about how to order the | |
| // results. | |
| func (c *ProjectsLocationsLbRouteExtensionsListCall) OrderBy(orderBy string) *ProjectsLocationsLbRouteExtensionsListCall { | |
| c.urlParams_.Set("orderBy", orderBy) | |
| return c | |
| } | |
| // PageSize sets the optional parameter "pageSize": Requested page size. The | |
| // server might return fewer items than requested. If unspecified, the server | |
| // picks an appropriate default. | |
| func (c *ProjectsLocationsLbRouteExtensionsListCall) PageSize(pageSize int64) *ProjectsLocationsLbRouteExtensionsListCall { | |
| c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) | |
| return c | |
| } | |
| // PageToken sets the optional parameter "pageToken": A token identifying a | |
| // page of results that the server returns. | |
| func (c *ProjectsLocationsLbRouteExtensionsListCall) PageToken(pageToken string) *ProjectsLocationsLbRouteExtensionsListCall { | |
| c.urlParams_.Set("pageToken", pageToken) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsLbRouteExtensionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbRouteExtensionsListCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsLbRouteExtensionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsLbRouteExtensionsListCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsLbRouteExtensionsListCall) Context(ctx context.Context) *ProjectsLocationsLbRouteExtensionsListCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsLbRouteExtensionsListCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsLbRouteExtensionsListCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/lbRouteExtensions") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbRouteExtensions.list", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.lbRouteExtensions.list" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *ListLbRouteExtensionsResponse.ServerResponse.Header or (if a response was | |
| // returned at all) in error.(*googleapi.Error).Header. Use | |
| // googleapi.IsNotModified to check whether the returned error was because | |
| // http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsLbRouteExtensionsListCall) Do(opts ...googleapi.CallOption) (*ListLbRouteExtensionsResponse, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &ListLbRouteExtensionsResponse{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbRouteExtensions.list", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| // Pages invokes f for each page of results. | |
| // A non-nil error returned from f will halt the iteration. | |
| // The provided context supersedes any context provided to the Context method. | |
| func (c *ProjectsLocationsLbRouteExtensionsListCall) Pages(ctx context.Context, f func(*ListLbRouteExtensionsResponse) error) error { | |
| c.ctx_ = ctx | |
| defer c.PageToken(c.urlParams_.Get("pageToken")) | |
| for { | |
| x, err := c.Do() | |
| if err != nil { | |
| return err | |
| } | |
| if err := f(x); err != nil { | |
| return err | |
| } | |
| if x.NextPageToken == "" { | |
| return nil | |
| } | |
| c.PageToken(x.NextPageToken) | |
| } | |
| } | |
| type ProjectsLocationsLbRouteExtensionsPatchCall struct { | |
| s *Service | |
| name string | |
| lbrouteextension *LbRouteExtension | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Patch: Updates the parameters of the specified `LbRouteExtension` resource. | |
| // | |
| // - name: Identifier. Name of the `LbRouteExtension` resource in the following | |
| // format: | |
| // `projects/{project}/locations/{location}/lbRouteExtensions/{lb_route_extens | |
| // ion}`. | |
| func (r *ProjectsLocationsLbRouteExtensionsService) Patch(name string, lbrouteextension *LbRouteExtension) *ProjectsLocationsLbRouteExtensionsPatchCall { | |
| c := &ProjectsLocationsLbRouteExtensionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| c.lbrouteextension = lbrouteextension | |
| return c | |
| } | |
| // RequestId sets the optional parameter "requestId": An optional request ID to | |
| // identify requests. Specify a unique request ID so that if you must retry | |
| // your request, the server can ignore the request if it has already been | |
| // completed. The server guarantees that for 60 minutes since the first | |
| // request. For example, consider a situation where you make an initial request | |
| // and the request times out. If you make the request again with the same | |
| // request ID, the server ignores the second request This prevents clients from | |
| // accidentally creating duplicate commitments. The request ID must be a valid | |
| // UUID with the exception that zero UUID is not supported | |
| // (00000000-0000-0000-0000-000000000000). | |
| func (c *ProjectsLocationsLbRouteExtensionsPatchCall) RequestId(requestId string) *ProjectsLocationsLbRouteExtensionsPatchCall { | |
| c.urlParams_.Set("requestId", requestId) | |
| return c | |
| } | |
| // UpdateMask sets the optional parameter "updateMask": Used to specify the | |
| // fields to be overwritten in the `LbRouteExtension` resource by the update. | |
| // The fields specified in the `update_mask` are relative to the resource, not | |
| // the full request. A field is overwritten if it is in the mask. If the user | |
| // does not specify a mask, then all fields are overwritten. | |
| func (c *ProjectsLocationsLbRouteExtensionsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsLbRouteExtensionsPatchCall { | |
| c.urlParams_.Set("updateMask", updateMask) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsLbRouteExtensionsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbRouteExtensionsPatchCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsLbRouteExtensionsPatchCall) Context(ctx context.Context) *ProjectsLocationsLbRouteExtensionsPatchCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsLbRouteExtensionsPatchCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsLbRouteExtensionsPatchCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lbrouteextension) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("PATCH", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbRouteExtensions.patch", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.lbRouteExtensions.patch" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsLbRouteExtensionsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbRouteExtensions.patch", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsLbTcpExtensionsCreateCall struct { | |
| s *Service | |
| parent string | |
| lbtcpextension *LbTcpExtension | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Create: Creates a new `LbTcpExtension` resource in a given project and | |
| // location. | |
| // | |
| // - parent: The parent resource of the `LbTcpExtension` resource. Must be in | |
| // the format `projects/{project}/locations/{location}`. | |
| func (r *ProjectsLocationsLbTcpExtensionsService) Create(parent string, lbtcpextension *LbTcpExtension) *ProjectsLocationsLbTcpExtensionsCreateCall { | |
| c := &ProjectsLocationsLbTcpExtensionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| c.lbtcpextension = lbtcpextension | |
| return c | |
| } | |
| // LbTcpExtensionId sets the optional parameter "lbTcpExtensionId": Required. | |
| // User-provided ID of the `LbTcpExtension` resource to be created. | |
| func (c *ProjectsLocationsLbTcpExtensionsCreateCall) LbTcpExtensionId(lbTcpExtensionId string) *ProjectsLocationsLbTcpExtensionsCreateCall { | |
| c.urlParams_.Set("lbTcpExtensionId", lbTcpExtensionId) | |
| return c | |
| } | |
| // RequestId sets the optional parameter "requestId": An optional request ID to | |
| // identify requests. Specify a unique request ID so that if you must retry | |
| // your request, the server can ignore the request if it has already been | |
| // completed. The server guarantees that for at least 60 minutes since the | |
| // first request. For example, consider a situation where you make an initial | |
| // request and the request times out. If you make the request again with the | |
| // same request ID, the server can check if original operation with the same | |
| // request ID was received, and if so, ignores the second request. This | |
| // prevents clients from accidentally creating duplicate commitments. The | |
| // request ID must be a valid UUID with the exception that zero UUID is not | |
| // supported (00000000-0000-0000-0000-000000000000). | |
| func (c *ProjectsLocationsLbTcpExtensionsCreateCall) RequestId(requestId string) *ProjectsLocationsLbTcpExtensionsCreateCall { | |
| c.urlParams_.Set("requestId", requestId) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsLbTcpExtensionsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbTcpExtensionsCreateCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsLbTcpExtensionsCreateCall) Context(ctx context.Context) *ProjectsLocationsLbTcpExtensionsCreateCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsLbTcpExtensionsCreateCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsLbTcpExtensionsCreateCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lbtcpextension) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/lbTcpExtensions") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("POST", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTcpExtensions.create", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.lbTcpExtensions.create" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsLbTcpExtensionsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTcpExtensions.create", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsLbTcpExtensionsDeleteCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Delete: Deletes the specified `LbTcpExtension` resource. | |
| // | |
| // - name: The name of the `LbTcpExtension` resource to delete. Must be in the | |
| // format | |
| // `projects/{project}/locations/{location}/LbTcpExtensions/{lb_tcp_extension} | |
| // `. | |
| func (r *ProjectsLocationsLbTcpExtensionsService) Delete(name string) *ProjectsLocationsLbTcpExtensionsDeleteCall { | |
| c := &ProjectsLocationsLbTcpExtensionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // RequestId sets the optional parameter "requestId": An optional request ID to | |
| // identify requests. Specify a unique request ID so that if you must retry | |
| // your request, the server can ignore the request if it has already been | |
| // completed. The server guarantees that for at least 60 minutes after the | |
| // first request. For example, consider a situation where you make an initial | |
| // request and the request times out. If you make the request again with the | |
| // same request ID, the server can check if original operation with the same | |
| // request ID was received, and if so, ignores the second request. This | |
| // prevents clients from accidentally creating duplicate commitments. The | |
| // request ID must be a valid UUID with the exception that zero UUID is not | |
| // supported (00000000-0000-0000-0000-000000000000). | |
| func (c *ProjectsLocationsLbTcpExtensionsDeleteCall) RequestId(requestId string) *ProjectsLocationsLbTcpExtensionsDeleteCall { | |
| c.urlParams_.Set("requestId", requestId) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsLbTcpExtensionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbTcpExtensionsDeleteCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsLbTcpExtensionsDeleteCall) Context(ctx context.Context) *ProjectsLocationsLbTcpExtensionsDeleteCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsLbTcpExtensionsDeleteCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsLbTcpExtensionsDeleteCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("DELETE", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTcpExtensions.delete", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.lbTcpExtensions.delete" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsLbTcpExtensionsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTcpExtensions.delete", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsLbTcpExtensionsGetCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Get: Gets details of the specified `LbTcpExtension` resource. | |
| // | |
| // - name: A name of the `LbTcpExtension` resource to get. Must be in the | |
| // format | |
| // `projects/{project}/locations/{location}/LbTcpExtensions/{lb_tcp_extension} | |
| // `. | |
| func (r *ProjectsLocationsLbTcpExtensionsService) Get(name string) *ProjectsLocationsLbTcpExtensionsGetCall { | |
| c := &ProjectsLocationsLbTcpExtensionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsLbTcpExtensionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbTcpExtensionsGetCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsLbTcpExtensionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsLbTcpExtensionsGetCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsLbTcpExtensionsGetCall) Context(ctx context.Context) *ProjectsLocationsLbTcpExtensionsGetCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsLbTcpExtensionsGetCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsLbTcpExtensionsGetCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTcpExtensions.get", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.lbTcpExtensions.get" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *LbTcpExtension.ServerResponse.Header or (if a response was returned at all) | |
| // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsLbTcpExtensionsGetCall) Do(opts ...googleapi.CallOption) (*LbTcpExtension, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &LbTcpExtension{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTcpExtensions.get", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsLbTcpExtensionsListCall struct { | |
| s *Service | |
| parent string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // List: Lists `LbTcpExtension` resources in a given project and location. | |
| // | |
| // - parent: The project and location from which the `LbTcpExtension` resources | |
| // are listed, specified in the following format: | |
| // `projects/{project}/locations/{location}`. | |
| func (r *ProjectsLocationsLbTcpExtensionsService) List(parent string) *ProjectsLocationsLbTcpExtensionsListCall { | |
| c := &ProjectsLocationsLbTcpExtensionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| return c | |
| } | |
| // Filter sets the optional parameter "filter": Filtering results. | |
| func (c *ProjectsLocationsLbTcpExtensionsListCall) Filter(filter string) *ProjectsLocationsLbTcpExtensionsListCall { | |
| c.urlParams_.Set("filter", filter) | |
| return c | |
| } | |
| // OrderBy sets the optional parameter "orderBy": Hint for how to order the | |
| // results. | |
| func (c *ProjectsLocationsLbTcpExtensionsListCall) OrderBy(orderBy string) *ProjectsLocationsLbTcpExtensionsListCall { | |
| c.urlParams_.Set("orderBy", orderBy) | |
| return c | |
| } | |
| // PageSize sets the optional parameter "pageSize": Requested page size. The | |
| // server might return fewer items than requested. If unspecified, the server | |
| // picks an appropriate default. | |
| func (c *ProjectsLocationsLbTcpExtensionsListCall) PageSize(pageSize int64) *ProjectsLocationsLbTcpExtensionsListCall { | |
| c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) | |
| return c | |
| } | |
| // PageToken sets the optional parameter "pageToken": A token identifying a | |
| // page of results that the server returns. | |
| func (c *ProjectsLocationsLbTcpExtensionsListCall) PageToken(pageToken string) *ProjectsLocationsLbTcpExtensionsListCall { | |
| c.urlParams_.Set("pageToken", pageToken) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsLbTcpExtensionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbTcpExtensionsListCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsLbTcpExtensionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsLbTcpExtensionsListCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsLbTcpExtensionsListCall) Context(ctx context.Context) *ProjectsLocationsLbTcpExtensionsListCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsLbTcpExtensionsListCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsLbTcpExtensionsListCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/lbTcpExtensions") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTcpExtensions.list", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.lbTcpExtensions.list" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *ListLbTcpExtensionsResponse.ServerResponse.Header or (if a response was | |
| // returned at all) in error.(*googleapi.Error).Header. Use | |
| // googleapi.IsNotModified to check whether the returned error was because | |
| // http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsLbTcpExtensionsListCall) Do(opts ...googleapi.CallOption) (*ListLbTcpExtensionsResponse, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &ListLbTcpExtensionsResponse{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTcpExtensions.list", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| // Pages invokes f for each page of results. | |
| // A non-nil error returned from f will halt the iteration. | |
| // The provided context supersedes any context provided to the Context method. | |
| func (c *ProjectsLocationsLbTcpExtensionsListCall) Pages(ctx context.Context, f func(*ListLbTcpExtensionsResponse) error) error { | |
| c.ctx_ = ctx | |
| defer c.PageToken(c.urlParams_.Get("pageToken")) | |
| for { | |
| x, err := c.Do() | |
| if err != nil { | |
| return err | |
| } | |
| if err := f(x); err != nil { | |
| return err | |
| } | |
| if x.NextPageToken == "" { | |
| return nil | |
| } | |
| c.PageToken(x.NextPageToken) | |
| } | |
| } | |
| type ProjectsLocationsLbTcpExtensionsPatchCall struct { | |
| s *Service | |
| name string | |
| lbtcpextension *LbTcpExtension | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Patch: Updates the parameters of the specified `LbTcpExtension` resource. | |
| // | |
| // - name: Identifier. Name of the `LbTcpExtension` resource in the following | |
| // format: | |
| // `projects/{project}/locations/{location}/LbTcpExtension/{lb_tcp_extension}`. | |
| func (r *ProjectsLocationsLbTcpExtensionsService) Patch(name string, lbtcpextension *LbTcpExtension) *ProjectsLocationsLbTcpExtensionsPatchCall { | |
| c := &ProjectsLocationsLbTcpExtensionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| c.lbtcpextension = lbtcpextension | |
| return c | |
| } | |
| // RequestId sets the optional parameter "requestId": An optional request ID to | |
| // identify requests. Specify a unique request ID so that if you must retry | |
| // your request, the server can ignore the request if it has already been | |
| // completed. The server guarantees that for at least 60 minutes since the | |
| // first request. For example, consider a situation where you make an initial | |
| // request and the request times out. If you make the request again with the | |
| // same request ID, the server can check if original operation with the same | |
| // request ID was received, and if so, ignores the second request. This | |
| // prevents clients from accidentally creating duplicate commitments. The | |
| // request ID must be a valid UUID with the exception that zero UUID is not | |
| // supported (00000000-0000-0000-0000-000000000000). | |
| func (c *ProjectsLocationsLbTcpExtensionsPatchCall) RequestId(requestId string) *ProjectsLocationsLbTcpExtensionsPatchCall { | |
| c.urlParams_.Set("requestId", requestId) | |
| return c | |
| } | |
| // UpdateMask sets the optional parameter "updateMask": Used to specify the | |
| // fields to be overwritten in the `LbTcpExtension` resource by the update. The | |
| // fields specified in the update_mask are relative to the resource, not the | |
| // full request. A field is overwritten if it is in the mask. If the user does | |
| // not specify a mask, then all fields are overwritten. | |
| func (c *ProjectsLocationsLbTcpExtensionsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsLbTcpExtensionsPatchCall { | |
| c.urlParams_.Set("updateMask", updateMask) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsLbTcpExtensionsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbTcpExtensionsPatchCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsLbTcpExtensionsPatchCall) Context(ctx context.Context) *ProjectsLocationsLbTcpExtensionsPatchCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsLbTcpExtensionsPatchCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsLbTcpExtensionsPatchCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lbtcpextension) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("PATCH", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTcpExtensions.patch", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.lbTcpExtensions.patch" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsLbTcpExtensionsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTcpExtensions.patch", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsLbTrafficExtensionsCreateCall struct { | |
| s *Service | |
| parent string | |
| lbtrafficextension *LbTrafficExtension | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Create: Creates a new `LbTrafficExtension` resource in a given project and | |
| // location. | |
| // | |
| // - parent: The parent resource of the `LbTrafficExtension` resource. Must be | |
| // in the format `projects/{project}/locations/{location}`. | |
| func (r *ProjectsLocationsLbTrafficExtensionsService) Create(parent string, lbtrafficextension *LbTrafficExtension) *ProjectsLocationsLbTrafficExtensionsCreateCall { | |
| c := &ProjectsLocationsLbTrafficExtensionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| c.lbtrafficextension = lbtrafficextension | |
| return c | |
| } | |
| // LbTrafficExtensionId sets the optional parameter "lbTrafficExtensionId": | |
| // Required. User-provided ID of the `LbTrafficExtension` resource to be | |
| // created. | |
| func (c *ProjectsLocationsLbTrafficExtensionsCreateCall) LbTrafficExtensionId(lbTrafficExtensionId string) *ProjectsLocationsLbTrafficExtensionsCreateCall { | |
| c.urlParams_.Set("lbTrafficExtensionId", lbTrafficExtensionId) | |
| return c | |
| } | |
| // RequestId sets the optional parameter "requestId": An optional request ID to | |
| // identify requests. Specify a unique request ID so that if you must retry | |
| // your request, the server can ignore the request if it has already been | |
| // completed. The server guarantees that for 60 minutes since the first | |
| // request. For example, consider a situation where you make an initial request | |
| // and the request times out. If you make the request again with the same | |
| // request ID, the server ignores the second request This prevents clients from | |
| // accidentally creating duplicate commitments. The request ID must be a valid | |
| // UUID with the exception that zero UUID is not supported | |
| // (00000000-0000-0000-0000-000000000000). | |
| func (c *ProjectsLocationsLbTrafficExtensionsCreateCall) RequestId(requestId string) *ProjectsLocationsLbTrafficExtensionsCreateCall { | |
| c.urlParams_.Set("requestId", requestId) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsLbTrafficExtensionsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbTrafficExtensionsCreateCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsLbTrafficExtensionsCreateCall) Context(ctx context.Context) *ProjectsLocationsLbTrafficExtensionsCreateCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsLbTrafficExtensionsCreateCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsLbTrafficExtensionsCreateCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lbtrafficextension) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/lbTrafficExtensions") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("POST", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTrafficExtensions.create", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.lbTrafficExtensions.create" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsLbTrafficExtensionsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTrafficExtensions.create", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsLbTrafficExtensionsDeleteCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Delete: Deletes the specified `LbTrafficExtension` resource. | |
| // | |
| // - name: The name of the `LbTrafficExtension` resource to delete. Must be in | |
| // the format | |
| // `projects/{project}/locations/{location}/lbTrafficExtensions/{lb_traffic_ex | |
| // tension}`. | |
| func (r *ProjectsLocationsLbTrafficExtensionsService) Delete(name string) *ProjectsLocationsLbTrafficExtensionsDeleteCall { | |
| c := &ProjectsLocationsLbTrafficExtensionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // RequestId sets the optional parameter "requestId": An optional request ID to | |
| // identify requests. Specify a unique request ID so that if you must retry | |
| // your request, the server can ignore the request if it has already been | |
| // completed. The server guarantees that for 60 minutes after the first | |
| // request. For example, consider a situation where you make an initial request | |
| // and the request times out. If you make the request again with the same | |
| // request ID, the server ignores the second request This prevents clients from | |
| // accidentally creating duplicate commitments. The request ID must be a valid | |
| // UUID with the exception that zero UUID is not supported | |
| // (00000000-0000-0000-0000-000000000000). | |
| func (c *ProjectsLocationsLbTrafficExtensionsDeleteCall) RequestId(requestId string) *ProjectsLocationsLbTrafficExtensionsDeleteCall { | |
| c.urlParams_.Set("requestId", requestId) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsLbTrafficExtensionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbTrafficExtensionsDeleteCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsLbTrafficExtensionsDeleteCall) Context(ctx context.Context) *ProjectsLocationsLbTrafficExtensionsDeleteCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsLbTrafficExtensionsDeleteCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsLbTrafficExtensionsDeleteCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("DELETE", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTrafficExtensions.delete", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.lbTrafficExtensions.delete" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsLbTrafficExtensionsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTrafficExtensions.delete", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsLbTrafficExtensionsGetCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Get: Gets details of the specified `LbTrafficExtension` resource. | |
| // | |
| // - name: A name of the `LbTrafficExtension` resource to get. Must be in the | |
| // format | |
| // `projects/{project}/locations/{location}/lbTrafficExtensions/{lb_traffic_ex | |
| // tension}`. | |
| func (r *ProjectsLocationsLbTrafficExtensionsService) Get(name string) *ProjectsLocationsLbTrafficExtensionsGetCall { | |
| c := &ProjectsLocationsLbTrafficExtensionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsLbTrafficExtensionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbTrafficExtensionsGetCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsLbTrafficExtensionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsLbTrafficExtensionsGetCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsLbTrafficExtensionsGetCall) Context(ctx context.Context) *ProjectsLocationsLbTrafficExtensionsGetCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsLbTrafficExtensionsGetCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsLbTrafficExtensionsGetCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTrafficExtensions.get", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.lbTrafficExtensions.get" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *LbTrafficExtension.ServerResponse.Header or (if a response was returned at | |
| // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to | |
| // check whether the returned error was because http.StatusNotModified was | |
| // returned. | |
| func (c *ProjectsLocationsLbTrafficExtensionsGetCall) Do(opts ...googleapi.CallOption) (*LbTrafficExtension, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &LbTrafficExtension{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTrafficExtensions.get", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsLbTrafficExtensionsListCall struct { | |
| s *Service | |
| parent string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // List: Lists `LbTrafficExtension` resources in a given project and location. | |
| // | |
| // - parent: The project and location from which the `LbTrafficExtension` | |
| // resources are listed. These values are specified in the following format: | |
| // `projects/{project}/locations/{location}`. | |
| func (r *ProjectsLocationsLbTrafficExtensionsService) List(parent string) *ProjectsLocationsLbTrafficExtensionsListCall { | |
| c := &ProjectsLocationsLbTrafficExtensionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| return c | |
| } | |
| // Filter sets the optional parameter "filter": Filtering results. | |
| func (c *ProjectsLocationsLbTrafficExtensionsListCall) Filter(filter string) *ProjectsLocationsLbTrafficExtensionsListCall { | |
| c.urlParams_.Set("filter", filter) | |
| return c | |
| } | |
| // OrderBy sets the optional parameter "orderBy": Hint about how to order the | |
| // results. | |
| func (c *ProjectsLocationsLbTrafficExtensionsListCall) OrderBy(orderBy string) *ProjectsLocationsLbTrafficExtensionsListCall { | |
| c.urlParams_.Set("orderBy", orderBy) | |
| return c | |
| } | |
| // PageSize sets the optional parameter "pageSize": Requested page size. The | |
| // server might return fewer items than requested. If unspecified, the server | |
| // picks an appropriate default. | |
| func (c *ProjectsLocationsLbTrafficExtensionsListCall) PageSize(pageSize int64) *ProjectsLocationsLbTrafficExtensionsListCall { | |
| c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) | |
| return c | |
| } | |
| // PageToken sets the optional parameter "pageToken": A token identifying a | |
| // page of results that the server returns. | |
| func (c *ProjectsLocationsLbTrafficExtensionsListCall) PageToken(pageToken string) *ProjectsLocationsLbTrafficExtensionsListCall { | |
| c.urlParams_.Set("pageToken", pageToken) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsLbTrafficExtensionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbTrafficExtensionsListCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsLbTrafficExtensionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsLbTrafficExtensionsListCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsLbTrafficExtensionsListCall) Context(ctx context.Context) *ProjectsLocationsLbTrafficExtensionsListCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsLbTrafficExtensionsListCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsLbTrafficExtensionsListCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/lbTrafficExtensions") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTrafficExtensions.list", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.lbTrafficExtensions.list" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *ListLbTrafficExtensionsResponse.ServerResponse.Header or (if a response was | |
| // returned at all) in error.(*googleapi.Error).Header. Use | |
| // googleapi.IsNotModified to check whether the returned error was because | |
| // http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsLbTrafficExtensionsListCall) Do(opts ...googleapi.CallOption) (*ListLbTrafficExtensionsResponse, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &ListLbTrafficExtensionsResponse{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTrafficExtensions.list", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| // Pages invokes f for each page of results. | |
| // A non-nil error returned from f will halt the iteration. | |
| // The provided context supersedes any context provided to the Context method. | |
| func (c *ProjectsLocationsLbTrafficExtensionsListCall) Pages(ctx context.Context, f func(*ListLbTrafficExtensionsResponse) error) error { | |
| c.ctx_ = ctx | |
| defer c.PageToken(c.urlParams_.Get("pageToken")) | |
| for { | |
| x, err := c.Do() | |
| if err != nil { | |
| return err | |
| } | |
| if err := f(x); err != nil { | |
| return err | |
| } | |
| if x.NextPageToken == "" { | |
| return nil | |
| } | |
| c.PageToken(x.NextPageToken) | |
| } | |
| } | |
| type ProjectsLocationsLbTrafficExtensionsPatchCall struct { | |
| s *Service | |
| name string | |
| lbtrafficextension *LbTrafficExtension | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Patch: Updates the parameters of the specified `LbTrafficExtension` | |
| // resource. | |
| // | |
| // - name: Identifier. Name of the `LbTrafficExtension` resource in the | |
| // following format: | |
| // `projects/{project}/locations/{location}/lbTrafficExtensions/{lb_traffic_ex | |
| // tension}`. | |
| func (r *ProjectsLocationsLbTrafficExtensionsService) Patch(name string, lbtrafficextension *LbTrafficExtension) *ProjectsLocationsLbTrafficExtensionsPatchCall { | |
| c := &ProjectsLocationsLbTrafficExtensionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| c.lbtrafficextension = lbtrafficextension | |
| return c | |
| } | |
| // RequestId sets the optional parameter "requestId": An optional request ID to | |
| // identify requests. Specify a unique request ID so that if you must retry | |
| // your request, the server can ignore the request if it has already been | |
| // completed. The server guarantees that for 60 minutes since the first | |
| // request. For example, consider a situation where you make an initial request | |
| // and the request times out. If you make the request again with the same | |
| // request ID, the server ignores the second request This prevents clients from | |
| // accidentally creating duplicate commitments. The request ID must be a valid | |
| // UUID with the exception that zero UUID is not supported | |
| // (00000000-0000-0000-0000-000000000000). | |
| func (c *ProjectsLocationsLbTrafficExtensionsPatchCall) RequestId(requestId string) *ProjectsLocationsLbTrafficExtensionsPatchCall { | |
| c.urlParams_.Set("requestId", requestId) | |
| return c | |
| } | |
| // UpdateMask sets the optional parameter "updateMask": Used to specify the | |
| // fields to be overwritten in the `LbTrafficExtension` resource by the update. | |
| // The fields specified in the `update_mask` are relative to the resource, not | |
| // the full request. A field is overwritten if it is in the mask. If the user | |
| // does not specify a mask, then all fields are overwritten. | |
| func (c *ProjectsLocationsLbTrafficExtensionsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsLbTrafficExtensionsPatchCall { | |
| c.urlParams_.Set("updateMask", updateMask) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsLbTrafficExtensionsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbTrafficExtensionsPatchCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsLbTrafficExtensionsPatchCall) Context(ctx context.Context) *ProjectsLocationsLbTrafficExtensionsPatchCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsLbTrafficExtensionsPatchCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsLbTrafficExtensionsPatchCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lbtrafficextension) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("PATCH", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTrafficExtensions.patch", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.lbTrafficExtensions.patch" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsLbTrafficExtensionsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTrafficExtensions.patch", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsMeshesCreateCall struct { | |
| s *Service | |
| parent string | |
| mesh *Mesh | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Create: Creates a new Mesh in a given project and location. | |
| // | |
| // - parent: The parent resource of the Mesh. Must be in the format | |
| // `projects/*/locations/*`. | |
| func (r *ProjectsLocationsMeshesService) Create(parent string, mesh *Mesh) *ProjectsLocationsMeshesCreateCall { | |
| c := &ProjectsLocationsMeshesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| c.mesh = mesh | |
| return c | |
| } | |
| // MeshId sets the optional parameter "meshId": Required. Short name of the | |
| // Mesh resource to be created. | |
| func (c *ProjectsLocationsMeshesCreateCall) MeshId(meshId string) *ProjectsLocationsMeshesCreateCall { | |
| c.urlParams_.Set("meshId", meshId) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsMeshesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsMeshesCreateCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsMeshesCreateCall) Context(ctx context.Context) *ProjectsLocationsMeshesCreateCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsMeshesCreateCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsMeshesCreateCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.mesh) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/meshes") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("POST", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.meshes.create", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.meshes.create" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsMeshesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.meshes.create", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsMeshesDeleteCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Delete: Deletes a single Mesh. | |
| // | |
| // - name: A name of the Mesh to delete. Must be in the format | |
| // `projects/*/locations/*/meshes/*`. | |
| func (r *ProjectsLocationsMeshesService) Delete(name string) *ProjectsLocationsMeshesDeleteCall { | |
| c := &ProjectsLocationsMeshesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsMeshesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsMeshesDeleteCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsMeshesDeleteCall) Context(ctx context.Context) *ProjectsLocationsMeshesDeleteCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsMeshesDeleteCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsMeshesDeleteCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("DELETE", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.meshes.delete", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.meshes.delete" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsMeshesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.meshes.delete", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsMeshesGetCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Get: Gets details of a single Mesh. | |
| // | |
| // - name: A name of the Mesh to get. Must be in the format | |
| // `projects/*/locations/*/meshes/*`. | |
| func (r *ProjectsLocationsMeshesService) Get(name string) *ProjectsLocationsMeshesGetCall { | |
| c := &ProjectsLocationsMeshesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsMeshesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsMeshesGetCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsMeshesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsMeshesGetCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsMeshesGetCall) Context(ctx context.Context) *ProjectsLocationsMeshesGetCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsMeshesGetCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsMeshesGetCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.meshes.get", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.meshes.get" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Mesh.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsMeshesGetCall) Do(opts ...googleapi.CallOption) (*Mesh, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Mesh{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.meshes.get", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsMeshesListCall struct { | |
| s *Service | |
| parent string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // List: Lists Meshes in a given project and location. | |
| // | |
| // - parent: The project and location from which the Meshes should be listed, | |
| // specified in the format `projects/*/locations/*`. | |
| func (r *ProjectsLocationsMeshesService) List(parent string) *ProjectsLocationsMeshesListCall { | |
| c := &ProjectsLocationsMeshesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| return c | |
| } | |
| // PageSize sets the optional parameter "pageSize": Maximum number of Meshes to | |
| // return per call. | |
| func (c *ProjectsLocationsMeshesListCall) PageSize(pageSize int64) *ProjectsLocationsMeshesListCall { | |
| c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) | |
| return c | |
| } | |
| // PageToken sets the optional parameter "pageToken": The value returned by the | |
| // last `ListMeshesResponse` Indicates that this is a continuation of a prior | |
| // `ListMeshes` call, and that the system should return the next page of data. | |
| func (c *ProjectsLocationsMeshesListCall) PageToken(pageToken string) *ProjectsLocationsMeshesListCall { | |
| c.urlParams_.Set("pageToken", pageToken) | |
| return c | |
| } | |
| // ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": If | |
| // true, allow partial responses for multi-regional Aggregated List requests. | |
| // Otherwise if one of the locations is down or unreachable, the Aggregated | |
| // List request will fail. | |
| func (c *ProjectsLocationsMeshesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *ProjectsLocationsMeshesListCall { | |
| c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsMeshesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsMeshesListCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsMeshesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsMeshesListCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsMeshesListCall) Context(ctx context.Context) *ProjectsLocationsMeshesListCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsMeshesListCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsMeshesListCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/meshes") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.meshes.list", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.meshes.list" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *ListMeshesResponse.ServerResponse.Header or (if a response was returned at | |
| // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to | |
| // check whether the returned error was because http.StatusNotModified was | |
| // returned. | |
| func (c *ProjectsLocationsMeshesListCall) Do(opts ...googleapi.CallOption) (*ListMeshesResponse, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &ListMeshesResponse{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.meshes.list", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| // Pages invokes f for each page of results. | |
| // A non-nil error returned from f will halt the iteration. | |
| // The provided context supersedes any context provided to the Context method. | |
| func (c *ProjectsLocationsMeshesListCall) Pages(ctx context.Context, f func(*ListMeshesResponse) error) error { | |
| c.ctx_ = ctx | |
| defer c.PageToken(c.urlParams_.Get("pageToken")) | |
| for { | |
| x, err := c.Do() | |
| if err != nil { | |
| return err | |
| } | |
| if err := f(x); err != nil { | |
| return err | |
| } | |
| if x.NextPageToken == "" { | |
| return nil | |
| } | |
| c.PageToken(x.NextPageToken) | |
| } | |
| } | |
| type ProjectsLocationsMeshesPatchCall struct { | |
| s *Service | |
| name string | |
| mesh *Mesh | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Patch: Updates the parameters of a single Mesh. | |
| // | |
| // - name: Identifier. Name of the Mesh resource. It matches pattern | |
| // `projects/*/locations/*/meshes/`. | |
| func (r *ProjectsLocationsMeshesService) Patch(name string, mesh *Mesh) *ProjectsLocationsMeshesPatchCall { | |
| c := &ProjectsLocationsMeshesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| c.mesh = mesh | |
| return c | |
| } | |
| // UpdateMask sets the optional parameter "updateMask": Field mask is used to | |
| // specify the fields to be overwritten in the Mesh resource by the update. The | |
| // fields specified in the update_mask are relative to the resource, not the | |
| // full request. A field will be overwritten if it is in the mask. If the user | |
| // does not provide a mask then all fields will be overwritten. | |
| func (c *ProjectsLocationsMeshesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsMeshesPatchCall { | |
| c.urlParams_.Set("updateMask", updateMask) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsMeshesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsMeshesPatchCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsMeshesPatchCall) Context(ctx context.Context) *ProjectsLocationsMeshesPatchCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsMeshesPatchCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsMeshesPatchCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.mesh) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("PATCH", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.meshes.patch", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.meshes.patch" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsMeshesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.meshes.patch", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsMeshesRouteViewsGetCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Get: Get a single RouteView of a Mesh. | |
| // | |
| // - name: Name of the MeshRouteView resource. Format: | |
| // projects/{project_number}/locations/{location}/meshes/{mesh}/routeViews/{ro | |
| // ute_view}. | |
| func (r *ProjectsLocationsMeshesRouteViewsService) Get(name string) *ProjectsLocationsMeshesRouteViewsGetCall { | |
| c := &ProjectsLocationsMeshesRouteViewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsMeshesRouteViewsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsMeshesRouteViewsGetCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsMeshesRouteViewsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsMeshesRouteViewsGetCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsMeshesRouteViewsGetCall) Context(ctx context.Context) *ProjectsLocationsMeshesRouteViewsGetCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsMeshesRouteViewsGetCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsMeshesRouteViewsGetCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.meshes.routeViews.get", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.meshes.routeViews.get" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *MeshRouteView.ServerResponse.Header or (if a response was returned at all) | |
| // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsMeshesRouteViewsGetCall) Do(opts ...googleapi.CallOption) (*MeshRouteView, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &MeshRouteView{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.meshes.routeViews.get", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsMeshesRouteViewsListCall struct { | |
| s *Service | |
| parent string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // List: Lists RouteViews | |
| // | |
| // - parent: The Mesh to which a Route is associated. Format: | |
| // projects/{project_number}/locations/{location}/meshes/{mesh}. | |
| func (r *ProjectsLocationsMeshesRouteViewsService) List(parent string) *ProjectsLocationsMeshesRouteViewsListCall { | |
| c := &ProjectsLocationsMeshesRouteViewsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| return c | |
| } | |
| // PageSize sets the optional parameter "pageSize": Maximum number of | |
| // MeshRouteViews to return per call. | |
| func (c *ProjectsLocationsMeshesRouteViewsListCall) PageSize(pageSize int64) *ProjectsLocationsMeshesRouteViewsListCall { | |
| c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) | |
| return c | |
| } | |
| // PageToken sets the optional parameter "pageToken": The value returned by the | |
| // last `ListMeshRouteViewsResponse` Indicates that this is a continuation of a | |
| // prior `ListMeshRouteViews` call, and that the system should return the next | |
| // page of data. | |
| func (c *ProjectsLocationsMeshesRouteViewsListCall) PageToken(pageToken string) *ProjectsLocationsMeshesRouteViewsListCall { | |
| c.urlParams_.Set("pageToken", pageToken) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsMeshesRouteViewsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsMeshesRouteViewsListCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsMeshesRouteViewsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsMeshesRouteViewsListCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsMeshesRouteViewsListCall) Context(ctx context.Context) *ProjectsLocationsMeshesRouteViewsListCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsMeshesRouteViewsListCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsMeshesRouteViewsListCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/routeViews") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.meshes.routeViews.list", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.meshes.routeViews.list" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *ListMeshRouteViewsResponse.ServerResponse.Header or (if a response was | |
| // returned at all) in error.(*googleapi.Error).Header. Use | |
| // googleapi.IsNotModified to check whether the returned error was because | |
| // http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsMeshesRouteViewsListCall) Do(opts ...googleapi.CallOption) (*ListMeshRouteViewsResponse, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &ListMeshRouteViewsResponse{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.meshes.routeViews.list", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| // Pages invokes f for each page of results. | |
| // A non-nil error returned from f will halt the iteration. | |
| // The provided context supersedes any context provided to the Context method. | |
| func (c *ProjectsLocationsMeshesRouteViewsListCall) Pages(ctx context.Context, f func(*ListMeshRouteViewsResponse) error) error { | |
| c.ctx_ = ctx | |
| defer c.PageToken(c.urlParams_.Get("pageToken")) | |
| for { | |
| x, err := c.Do() | |
| if err != nil { | |
| return err | |
| } | |
| if err := f(x); err != nil { | |
| return err | |
| } | |
| if x.NextPageToken == "" { | |
| return nil | |
| } | |
| c.PageToken(x.NextPageToken) | |
| } | |
| } | |
| type ProjectsLocationsOperationsCancelCall struct { | |
| s *Service | |
| name string | |
| canceloperationrequest *CancelOperationRequest | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Cancel: Starts asynchronous cancellation on a long-running operation. The | |
| // server makes a best effort to cancel the operation, but success is not | |
| // guaranteed. If the server doesn't support this method, it returns | |
| // `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or | |
| // other methods to check whether the cancellation succeeded or whether the | |
| // operation completed despite cancellation. On successful cancellation, the | |
| // operation is not deleted; instead, it becomes an operation with an | |
| // Operation.error value with a google.rpc.Status.code of `1`, corresponding to | |
| // `Code.CANCELLED`. | |
| // | |
| // - name: The name of the operation resource to be cancelled. | |
| func (r *ProjectsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *ProjectsLocationsOperationsCancelCall { | |
| c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| c.canceloperationrequest = canceloperationrequest | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("POST", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.operations.cancel", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.operations.cancel" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Empty.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Empty{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.operations.cancel", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsOperationsDeleteCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Delete: Deletes a long-running operation. This method indicates that the | |
| // client is no longer interested in the operation result. It does not cancel | |
| // the operation. If the server doesn't support this method, it returns | |
| // `google.rpc.Code.UNIMPLEMENTED`. | |
| // | |
| // - name: The name of the operation resource to be deleted. | |
| func (r *ProjectsLocationsOperationsService) Delete(name string) *ProjectsLocationsOperationsDeleteCall { | |
| c := &ProjectsLocationsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsDeleteCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsOperationsDeleteCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("DELETE", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.operations.delete", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.operations.delete" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Empty.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Empty{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.operations.delete", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsOperationsGetCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Get: Gets the latest state of a long-running operation. Clients can use this | |
| // method to poll the operation result at intervals as recommended by the API | |
| // service. | |
| // | |
| // - name: The name of the operation resource. | |
| func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall { | |
| c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsOperationsGetCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.operations.get", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.operations.get" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.operations.get", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsOperationsListCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // List: Lists operations that match the specified filter in the request. If | |
| // the server doesn't support this method, it returns `UNIMPLEMENTED`. | |
| // | |
| // - name: The name of the operation's parent resource. | |
| func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall { | |
| c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Filter sets the optional parameter "filter": The standard list filter. | |
| func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall { | |
| c.urlParams_.Set("filter", filter) | |
| return c | |
| } | |
| // PageSize sets the optional parameter "pageSize": The standard list page | |
| // size. | |
| func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall { | |
| c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) | |
| return c | |
| } | |
| // PageToken sets the optional parameter "pageToken": The standard list page | |
| // token. | |
| func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall { | |
| c.urlParams_.Set("pageToken", pageToken) | |
| return c | |
| } | |
| // ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": | |
| // When set to `true`, operations that are reachable are returned as normal, | |
| // and those that are unreachable are returned in the | |
| // ListOperationsResponse.unreachable field. This can only be `true` when | |
| // reading across collections. For example, when `parent` is set to | |
| // "projects/example/locations/-". This field is not supported by default and | |
| // will result in an `UNIMPLEMENTED` error if set unless explicitly documented | |
| // otherwise in service or product specific documentation. | |
| func (c *ProjectsLocationsOperationsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *ProjectsLocationsOperationsListCall { | |
| c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsOperationsListCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.operations.list", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.operations.list" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *ListOperationsResponse.ServerResponse.Header or (if a response was returned | |
| // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to | |
| // check whether the returned error was because http.StatusNotModified was | |
| // returned. | |
| func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &ListOperationsResponse{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.operations.list", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| // Pages invokes f for each page of results. | |
| // A non-nil error returned from f will halt the iteration. | |
| // The provided context supersedes any context provided to the Context method. | |
| func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error { | |
| c.ctx_ = ctx | |
| defer c.PageToken(c.urlParams_.Get("pageToken")) | |
| for { | |
| x, err := c.Do() | |
| if err != nil { | |
| return err | |
| } | |
| if err := f(x); err != nil { | |
| return err | |
| } | |
| if x.NextPageToken == "" { | |
| return nil | |
| } | |
| c.PageToken(x.NextPageToken) | |
| } | |
| } | |
| type ProjectsLocationsProducerExtensionsCreateCall struct { | |
| s *Service | |
| parent string | |
| producerextension *ProducerExtension | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Create: Creates a new `ProducerExtension` resource in a given project and | |
| // location. | |
| // | |
| // - parent: The parent resource of the `ProducerExtension` resource. Must be | |
| // in the format `projects/{project}/locations/{location}`. | |
| func (r *ProjectsLocationsProducerExtensionsService) Create(parent string, producerextension *ProducerExtension) *ProjectsLocationsProducerExtensionsCreateCall { | |
| c := &ProjectsLocationsProducerExtensionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| c.producerextension = producerextension | |
| return c | |
| } | |
| // ProducerExtensionId sets the optional parameter "producerExtensionId": | |
| // Required. Short name of the `ProducerExtension` resource to be created. | |
| func (c *ProjectsLocationsProducerExtensionsCreateCall) ProducerExtensionId(producerExtensionId string) *ProjectsLocationsProducerExtensionsCreateCall { | |
| c.urlParams_.Set("producerExtensionId", producerExtensionId) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsProducerExtensionsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsProducerExtensionsCreateCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsProducerExtensionsCreateCall) Context(ctx context.Context) *ProjectsLocationsProducerExtensionsCreateCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsProducerExtensionsCreateCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsProducerExtensionsCreateCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.producerextension) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/producerExtensions") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("POST", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.producerExtensions.create", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.producerExtensions.create" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsProducerExtensionsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.producerExtensions.create", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsProducerExtensionsDeleteCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Delete: Deletes the specified `ProducerExtension` resource. | |
| // | |
| // - name: A name of the `ProducerExtension` resource to delete. Must be in the | |
| // format | |
| // `projects/{project}/locations/{location}/producerExtensions/{producer_exten | |
| // sion}`. | |
| func (r *ProjectsLocationsProducerExtensionsService) Delete(name string) *ProjectsLocationsProducerExtensionsDeleteCall { | |
| c := &ProjectsLocationsProducerExtensionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Etag sets the optional parameter "etag": The etag of the ProducerExtension | |
| // to delete. | |
| func (c *ProjectsLocationsProducerExtensionsDeleteCall) Etag(etag string) *ProjectsLocationsProducerExtensionsDeleteCall { | |
| c.urlParams_.Set("etag", etag) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsProducerExtensionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsProducerExtensionsDeleteCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsProducerExtensionsDeleteCall) Context(ctx context.Context) *ProjectsLocationsProducerExtensionsDeleteCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsProducerExtensionsDeleteCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsProducerExtensionsDeleteCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("DELETE", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.producerExtensions.delete", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.producerExtensions.delete" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsProducerExtensionsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.producerExtensions.delete", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsProducerExtensionsGetCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Get: Gets details of the specified `ProducerExtension` resource. | |
| // | |
| // - name: A name of the `ProducerExtension` resource to get. Must be in the | |
| // format | |
| // `projects/{project}/locations/{location}/producerExtensions/{producer_exten | |
| // sion}`. | |
| func (r *ProjectsLocationsProducerExtensionsService) Get(name string) *ProjectsLocationsProducerExtensionsGetCall { | |
| c := &ProjectsLocationsProducerExtensionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsProducerExtensionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsProducerExtensionsGetCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsProducerExtensionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsProducerExtensionsGetCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsProducerExtensionsGetCall) Context(ctx context.Context) *ProjectsLocationsProducerExtensionsGetCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsProducerExtensionsGetCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsProducerExtensionsGetCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.producerExtensions.get", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.producerExtensions.get" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *ProducerExtension.ServerResponse.Header or (if a response was returned at | |
| // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to | |
| // check whether the returned error was because http.StatusNotModified was | |
| // returned. | |
| func (c *ProjectsLocationsProducerExtensionsGetCall) Do(opts ...googleapi.CallOption) (*ProducerExtension, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &ProducerExtension{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.producerExtensions.get", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsProducerExtensionsListCall struct { | |
| s *Service | |
| parent string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // List: Lists `ProducerExtension` resources in a given project and location. | |
| // | |
| // - parent: The project and location from which the `ProducerExtension` | |
| // resources should be listed, specified in the format | |
| // `projects/{project}/locations/{location}`. | |
| func (r *ProjectsLocationsProducerExtensionsService) List(parent string) *ProjectsLocationsProducerExtensionsListCall { | |
| c := &ProjectsLocationsProducerExtensionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| return c | |
| } | |
| // PageSize sets the optional parameter "pageSize": Maximum number of | |
| // `ProducerExtension` resources to return per call. | |
| func (c *ProjectsLocationsProducerExtensionsListCall) PageSize(pageSize int64) *ProjectsLocationsProducerExtensionsListCall { | |
| c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) | |
| return c | |
| } | |
| // PageToken sets the optional parameter "pageToken": The value returned by the | |
| // last `ListProducerExtensionsResponse` Indicates that this is a continuation | |
| // of a prior `ListProducerExtensions` call, and that the system should return | |
| // the next page of data. | |
| func (c *ProjectsLocationsProducerExtensionsListCall) PageToken(pageToken string) *ProjectsLocationsProducerExtensionsListCall { | |
| c.urlParams_.Set("pageToken", pageToken) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsProducerExtensionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsProducerExtensionsListCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsProducerExtensionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsProducerExtensionsListCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsProducerExtensionsListCall) Context(ctx context.Context) *ProjectsLocationsProducerExtensionsListCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsProducerExtensionsListCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsProducerExtensionsListCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/producerExtensions") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.producerExtensions.list", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.producerExtensions.list" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *ListProducerExtensionsResponse.ServerResponse.Header or (if a response was | |
| // returned at all) in error.(*googleapi.Error).Header. Use | |
| // googleapi.IsNotModified to check whether the returned error was because | |
| // http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsProducerExtensionsListCall) Do(opts ...googleapi.CallOption) (*ListProducerExtensionsResponse, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &ListProducerExtensionsResponse{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.producerExtensions.list", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| // Pages invokes f for each page of results. | |
| // A non-nil error returned from f will halt the iteration. | |
| // The provided context supersedes any context provided to the Context method. | |
| func (c *ProjectsLocationsProducerExtensionsListCall) Pages(ctx context.Context, f func(*ListProducerExtensionsResponse) error) error { | |
| c.ctx_ = ctx | |
| defer c.PageToken(c.urlParams_.Get("pageToken")) | |
| for { | |
| x, err := c.Do() | |
| if err != nil { | |
| return err | |
| } | |
| if err := f(x); err != nil { | |
| return err | |
| } | |
| if x.NextPageToken == "" { | |
| return nil | |
| } | |
| c.PageToken(x.NextPageToken) | |
| } | |
| } | |
| type ProjectsLocationsServiceBindingsCreateCall struct { | |
| s *Service | |
| parent string | |
| servicebinding *ServiceBinding | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Create: Creates a new ServiceBinding in a given project and location. | |
| // | |
| // - parent: The parent resource of the ServiceBinding. Must be in the format | |
| // `projects/*/locations/*`. | |
| func (r *ProjectsLocationsServiceBindingsService) Create(parent string, servicebinding *ServiceBinding) *ProjectsLocationsServiceBindingsCreateCall { | |
| c := &ProjectsLocationsServiceBindingsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| c.servicebinding = servicebinding | |
| return c | |
| } | |
| // RequestId sets the optional parameter "requestId": An optional request ID to | |
| // identify requests. Specify a unique request ID so that if you must retry | |
| // your request, the server can ignore the request if it has already been | |
| // completed. The server guarantees this for 60 minutes after the first | |
| // request. For example, consider a situation where you make an initial request | |
| // and the request times out. If you make the request again with the same | |
| // request ID, the server ignores the second request. This prevents clients | |
| // from accidentally creating duplicate commitments. The request ID must be a | |
| // valid UUID version 4 with the exception that zero UUID is not supported | |
| // (00000000-0000-0000-0000-000000000000). | |
| func (c *ProjectsLocationsServiceBindingsCreateCall) RequestId(requestId string) *ProjectsLocationsServiceBindingsCreateCall { | |
| c.urlParams_.Set("requestId", requestId) | |
| return c | |
| } | |
| // ServiceBindingId sets the optional parameter "serviceBindingId": Required. | |
| // Short name of the ServiceBinding resource to be created. | |
| func (c *ProjectsLocationsServiceBindingsCreateCall) ServiceBindingId(serviceBindingId string) *ProjectsLocationsServiceBindingsCreateCall { | |
| c.urlParams_.Set("serviceBindingId", serviceBindingId) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsServiceBindingsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsServiceBindingsCreateCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsServiceBindingsCreateCall) Context(ctx context.Context) *ProjectsLocationsServiceBindingsCreateCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsServiceBindingsCreateCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsServiceBindingsCreateCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.servicebinding) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/serviceBindings") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("POST", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceBindings.create", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.serviceBindings.create" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsServiceBindingsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceBindings.create", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsServiceBindingsDeleteCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Delete: Deletes a single ServiceBinding. | |
| // | |
| // - name: A name of the ServiceBinding to delete. Must be in the format | |
| // `projects/*/locations/*/serviceBindings/*`. | |
| func (r *ProjectsLocationsServiceBindingsService) Delete(name string) *ProjectsLocationsServiceBindingsDeleteCall { | |
| c := &ProjectsLocationsServiceBindingsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // RequestId sets the optional parameter "requestId": An optional request ID to | |
| // identify requests. Specify a unique request ID so that if you must retry | |
| // your request, the server can ignore the request if it has already been | |
| // completed. The server guarantees this for 60 minutes after the first | |
| // request. For example, consider a situation where you make an initial request | |
| // and the request times out. If you make the request again with the same | |
| // request ID, the server ignores the second request. This prevents clients | |
| // from accidentally creating duplicate commitments. The request ID must be a | |
| // valid UUID version 4 with the exception that zero UUID is not supported | |
| // (00000000-0000-0000-0000-000000000000). | |
| func (c *ProjectsLocationsServiceBindingsDeleteCall) RequestId(requestId string) *ProjectsLocationsServiceBindingsDeleteCall { | |
| c.urlParams_.Set("requestId", requestId) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsServiceBindingsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsServiceBindingsDeleteCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsServiceBindingsDeleteCall) Context(ctx context.Context) *ProjectsLocationsServiceBindingsDeleteCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsServiceBindingsDeleteCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsServiceBindingsDeleteCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("DELETE", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceBindings.delete", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.serviceBindings.delete" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsServiceBindingsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceBindings.delete", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsServiceBindingsGetCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Get: Gets details of a single ServiceBinding. | |
| // | |
| // - name: A name of the ServiceBinding to get. Must be in the format | |
| // `projects/*/locations/*/serviceBindings/*`. | |
| func (r *ProjectsLocationsServiceBindingsService) Get(name string) *ProjectsLocationsServiceBindingsGetCall { | |
| c := &ProjectsLocationsServiceBindingsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsServiceBindingsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsServiceBindingsGetCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsServiceBindingsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsServiceBindingsGetCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsServiceBindingsGetCall) Context(ctx context.Context) *ProjectsLocationsServiceBindingsGetCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsServiceBindingsGetCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsServiceBindingsGetCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceBindings.get", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.serviceBindings.get" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *ServiceBinding.ServerResponse.Header or (if a response was returned at all) | |
| // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsServiceBindingsGetCall) Do(opts ...googleapi.CallOption) (*ServiceBinding, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &ServiceBinding{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceBindings.get", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsServiceBindingsListCall struct { | |
| s *Service | |
| parent string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // List: Lists ServiceBinding in a given project and location. | |
| // | |
| // - parent: The project and location from which the ServiceBindings should be | |
| // listed, specified in the format `projects/*/locations/*`. | |
| func (r *ProjectsLocationsServiceBindingsService) List(parent string) *ProjectsLocationsServiceBindingsListCall { | |
| c := &ProjectsLocationsServiceBindingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| return c | |
| } | |
| // PageSize sets the optional parameter "pageSize": Maximum number of | |
| // ServiceBindings to return per call. | |
| func (c *ProjectsLocationsServiceBindingsListCall) PageSize(pageSize int64) *ProjectsLocationsServiceBindingsListCall { | |
| c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) | |
| return c | |
| } | |
| // PageToken sets the optional parameter "pageToken": The value returned by the | |
| // last `ListServiceBindingsResponse` Indicates that this is a continuation of | |
| // a prior `ListRouters` call, and that the system should return the next page | |
| // of data. | |
| func (c *ProjectsLocationsServiceBindingsListCall) PageToken(pageToken string) *ProjectsLocationsServiceBindingsListCall { | |
| c.urlParams_.Set("pageToken", pageToken) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsServiceBindingsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsServiceBindingsListCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsServiceBindingsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsServiceBindingsListCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsServiceBindingsListCall) Context(ctx context.Context) *ProjectsLocationsServiceBindingsListCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsServiceBindingsListCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsServiceBindingsListCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/serviceBindings") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceBindings.list", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.serviceBindings.list" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *ListServiceBindingsResponse.ServerResponse.Header or (if a response was | |
| // returned at all) in error.(*googleapi.Error).Header. Use | |
| // googleapi.IsNotModified to check whether the returned error was because | |
| // http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsServiceBindingsListCall) Do(opts ...googleapi.CallOption) (*ListServiceBindingsResponse, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &ListServiceBindingsResponse{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceBindings.list", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| // Pages invokes f for each page of results. | |
| // A non-nil error returned from f will halt the iteration. | |
| // The provided context supersedes any context provided to the Context method. | |
| func (c *ProjectsLocationsServiceBindingsListCall) Pages(ctx context.Context, f func(*ListServiceBindingsResponse) error) error { | |
| c.ctx_ = ctx | |
| defer c.PageToken(c.urlParams_.Get("pageToken")) | |
| for { | |
| x, err := c.Do() | |
| if err != nil { | |
| return err | |
| } | |
| if err := f(x); err != nil { | |
| return err | |
| } | |
| if x.NextPageToken == "" { | |
| return nil | |
| } | |
| c.PageToken(x.NextPageToken) | |
| } | |
| } | |
| type ProjectsLocationsServiceBindingsPatchCall struct { | |
| s *Service | |
| name string | |
| servicebinding *ServiceBinding | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Patch: Updates the parameters of a single ServiceBinding. | |
| // | |
| // - name: Identifier. Name of the ServiceBinding resource. It matches pattern | |
| // `projects/*/locations/*/serviceBindings/`. | |
| func (r *ProjectsLocationsServiceBindingsService) Patch(name string, servicebinding *ServiceBinding) *ProjectsLocationsServiceBindingsPatchCall { | |
| c := &ProjectsLocationsServiceBindingsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| c.servicebinding = servicebinding | |
| return c | |
| } | |
| // RequestId sets the optional parameter "requestId": An optional request ID to | |
| // identify requests. Specify a unique request ID so that if you must retry | |
| // your request, the server can ignore the request if it has already been | |
| // completed. The server guarantees this for 60 minutes after the first | |
| // request. For example, consider a situation where you make an initial request | |
| // and the request times out. If you make the request again with the same | |
| // request ID, the server ignores the second request. This prevents clients | |
| // from accidentally creating duplicate commitments. The request ID must be a | |
| // valid UUID version 4 with the exception that zero UUID is not supported | |
| // (00000000-0000-0000-0000-000000000000). | |
| func (c *ProjectsLocationsServiceBindingsPatchCall) RequestId(requestId string) *ProjectsLocationsServiceBindingsPatchCall { | |
| c.urlParams_.Set("requestId", requestId) | |
| return c | |
| } | |
| // UpdateMask sets the optional parameter "updateMask": Field mask is used to | |
| // specify the fields to be overwritten in the ServiceBinding resource by the | |
| // update. The fields specified in the update_mask are relative to the | |
| // resource, not the full request. A field will be overwritten if it is in the | |
| // mask. If the user does not provide a mask then all fields will be | |
| // overwritten. | |
| func (c *ProjectsLocationsServiceBindingsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsServiceBindingsPatchCall { | |
| c.urlParams_.Set("updateMask", updateMask) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsServiceBindingsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsServiceBindingsPatchCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsServiceBindingsPatchCall) Context(ctx context.Context) *ProjectsLocationsServiceBindingsPatchCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsServiceBindingsPatchCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsServiceBindingsPatchCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.servicebinding) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("PATCH", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceBindings.patch", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.serviceBindings.patch" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsServiceBindingsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceBindings.patch", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsServiceLbPoliciesCreateCall struct { | |
| s *Service | |
| parent string | |
| servicelbpolicy *ServiceLbPolicy | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Create: Creates a new ServiceLbPolicy in a given project and location. | |
| // | |
| // - parent: The parent resource of the ServiceLbPolicy. Must be in the format | |
| // `projects/{project}/locations/{location}`. | |
| func (r *ProjectsLocationsServiceLbPoliciesService) Create(parent string, servicelbpolicy *ServiceLbPolicy) *ProjectsLocationsServiceLbPoliciesCreateCall { | |
| c := &ProjectsLocationsServiceLbPoliciesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| c.servicelbpolicy = servicelbpolicy | |
| return c | |
| } | |
| // ServiceLbPolicyId sets the optional parameter "serviceLbPolicyId": Required. | |
| // Short name of the ServiceLbPolicy resource to be created. E.g. for resource | |
| // name | |
| // `projects/{project}/locations/{location}/serviceLbPolicies/{service_lb_policy | |
| // _name}`. the id is value of {service_lb_policy_name} | |
| func (c *ProjectsLocationsServiceLbPoliciesCreateCall) ServiceLbPolicyId(serviceLbPolicyId string) *ProjectsLocationsServiceLbPoliciesCreateCall { | |
| c.urlParams_.Set("serviceLbPolicyId", serviceLbPolicyId) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsServiceLbPoliciesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsServiceLbPoliciesCreateCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsServiceLbPoliciesCreateCall) Context(ctx context.Context) *ProjectsLocationsServiceLbPoliciesCreateCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsServiceLbPoliciesCreateCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsServiceLbPoliciesCreateCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.servicelbpolicy) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/serviceLbPolicies") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("POST", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceLbPolicies.create", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.serviceLbPolicies.create" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsServiceLbPoliciesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceLbPolicies.create", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsServiceLbPoliciesDeleteCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Delete: Deletes a single ServiceLbPolicy. | |
| // | |
| // - name: A name of the ServiceLbPolicy to delete. Must be in the format | |
| // `projects/{project}/locations/{location}/serviceLbPolicies/*`. | |
| func (r *ProjectsLocationsServiceLbPoliciesService) Delete(name string) *ProjectsLocationsServiceLbPoliciesDeleteCall { | |
| c := &ProjectsLocationsServiceLbPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsServiceLbPoliciesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsServiceLbPoliciesDeleteCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsServiceLbPoliciesDeleteCall) Context(ctx context.Context) *ProjectsLocationsServiceLbPoliciesDeleteCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsServiceLbPoliciesDeleteCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsServiceLbPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("DELETE", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceLbPolicies.delete", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.serviceLbPolicies.delete" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsServiceLbPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceLbPolicies.delete", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsServiceLbPoliciesGetCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Get: Gets details of a single ServiceLbPolicy. | |
| // | |
| // - name: A name of the ServiceLbPolicy to get. Must be in the format | |
| // `projects/{project}/locations/{location}/serviceLbPolicies/*`. | |
| func (r *ProjectsLocationsServiceLbPoliciesService) Get(name string) *ProjectsLocationsServiceLbPoliciesGetCall { | |
| c := &ProjectsLocationsServiceLbPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsServiceLbPoliciesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsServiceLbPoliciesGetCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsServiceLbPoliciesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsServiceLbPoliciesGetCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsServiceLbPoliciesGetCall) Context(ctx context.Context) *ProjectsLocationsServiceLbPoliciesGetCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsServiceLbPoliciesGetCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsServiceLbPoliciesGetCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceLbPolicies.get", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.serviceLbPolicies.get" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *ServiceLbPolicy.ServerResponse.Header or (if a response was returned at | |
| // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to | |
| // check whether the returned error was because http.StatusNotModified was | |
| // returned. | |
| func (c *ProjectsLocationsServiceLbPoliciesGetCall) Do(opts ...googleapi.CallOption) (*ServiceLbPolicy, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &ServiceLbPolicy{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceLbPolicies.get", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsServiceLbPoliciesListCall struct { | |
| s *Service | |
| parent string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // List: Lists ServiceLbPolicies in a given project and location. | |
| // | |
| // - parent: The project and location from which the ServiceLbPolicies should | |
| // be listed, specified in the format | |
| // `projects/{project}/locations/{location}`. | |
| func (r *ProjectsLocationsServiceLbPoliciesService) List(parent string) *ProjectsLocationsServiceLbPoliciesListCall { | |
| c := &ProjectsLocationsServiceLbPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| return c | |
| } | |
| // PageSize sets the optional parameter "pageSize": Maximum number of | |
| // ServiceLbPolicies to return per call. | |
| func (c *ProjectsLocationsServiceLbPoliciesListCall) PageSize(pageSize int64) *ProjectsLocationsServiceLbPoliciesListCall { | |
| c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) | |
| return c | |
| } | |
| // PageToken sets the optional parameter "pageToken": The value returned by the | |
| // last `ListServiceLbPoliciesResponse` Indicates that this is a continuation | |
| // of a prior `ListRouters` call, and that the system should return the next | |
| // page of data. | |
| func (c *ProjectsLocationsServiceLbPoliciesListCall) PageToken(pageToken string) *ProjectsLocationsServiceLbPoliciesListCall { | |
| c.urlParams_.Set("pageToken", pageToken) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsServiceLbPoliciesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsServiceLbPoliciesListCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsServiceLbPoliciesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsServiceLbPoliciesListCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsServiceLbPoliciesListCall) Context(ctx context.Context) *ProjectsLocationsServiceLbPoliciesListCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsServiceLbPoliciesListCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsServiceLbPoliciesListCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/serviceLbPolicies") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceLbPolicies.list", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.serviceLbPolicies.list" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *ListServiceLbPoliciesResponse.ServerResponse.Header or (if a response was | |
| // returned at all) in error.(*googleapi.Error).Header. Use | |
| // googleapi.IsNotModified to check whether the returned error was because | |
| // http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsServiceLbPoliciesListCall) Do(opts ...googleapi.CallOption) (*ListServiceLbPoliciesResponse, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &ListServiceLbPoliciesResponse{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceLbPolicies.list", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| // Pages invokes f for each page of results. | |
| // A non-nil error returned from f will halt the iteration. | |
| // The provided context supersedes any context provided to the Context method. | |
| func (c *ProjectsLocationsServiceLbPoliciesListCall) Pages(ctx context.Context, f func(*ListServiceLbPoliciesResponse) error) error { | |
| c.ctx_ = ctx | |
| defer c.PageToken(c.urlParams_.Get("pageToken")) | |
| for { | |
| x, err := c.Do() | |
| if err != nil { | |
| return err | |
| } | |
| if err := f(x); err != nil { | |
| return err | |
| } | |
| if x.NextPageToken == "" { | |
| return nil | |
| } | |
| c.PageToken(x.NextPageToken) | |
| } | |
| } | |
| type ProjectsLocationsServiceLbPoliciesPatchCall struct { | |
| s *Service | |
| name string | |
| servicelbpolicy *ServiceLbPolicy | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Patch: Updates the parameters of a single ServiceLbPolicy. | |
| // | |
| // - name: Identifier. Name of the ServiceLbPolicy resource. It matches pattern | |
| // `projects/{project}/locations/{location}/serviceLbPolicies/{service_lb_poli | |
| // cy_name}`. | |
| func (r *ProjectsLocationsServiceLbPoliciesService) Patch(name string, servicelbpolicy *ServiceLbPolicy) *ProjectsLocationsServiceLbPoliciesPatchCall { | |
| c := &ProjectsLocationsServiceLbPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| c.servicelbpolicy = servicelbpolicy | |
| return c | |
| } | |
| // UpdateMask sets the optional parameter "updateMask": Field mask is used to | |
| // specify the fields to be overwritten in the ServiceLbPolicy resource by the | |
| // update. The fields specified in the update_mask are relative to the | |
| // resource, not the full request. A field will be overwritten if it is in the | |
| // mask. If the user does not provide a mask then all fields will be | |
| // overwritten. | |
| func (c *ProjectsLocationsServiceLbPoliciesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsServiceLbPoliciesPatchCall { | |
| c.urlParams_.Set("updateMask", updateMask) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsServiceLbPoliciesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsServiceLbPoliciesPatchCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsServiceLbPoliciesPatchCall) Context(ctx context.Context) *ProjectsLocationsServiceLbPoliciesPatchCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsServiceLbPoliciesPatchCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsServiceLbPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.servicelbpolicy) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("PATCH", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceLbPolicies.patch", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.serviceLbPolicies.patch" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsServiceLbPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceLbPolicies.patch", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsTcpRoutesCreateCall struct { | |
| s *Service | |
| parent string | |
| tcproute *TcpRoute | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Create: Creates a new TcpRoute in a given project and location. | |
| // | |
| // - parent: The parent resource of the TcpRoute. Must be in the format | |
| // `projects/*/locations/*`. | |
| func (r *ProjectsLocationsTcpRoutesService) Create(parent string, tcproute *TcpRoute) *ProjectsLocationsTcpRoutesCreateCall { | |
| c := &ProjectsLocationsTcpRoutesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| c.tcproute = tcproute | |
| return c | |
| } | |
| // TcpRouteId sets the optional parameter "tcpRouteId": Required. Short name of | |
| // the TcpRoute resource to be created. | |
| func (c *ProjectsLocationsTcpRoutesCreateCall) TcpRouteId(tcpRouteId string) *ProjectsLocationsTcpRoutesCreateCall { | |
| c.urlParams_.Set("tcpRouteId", tcpRouteId) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsTcpRoutesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsTcpRoutesCreateCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsTcpRoutesCreateCall) Context(ctx context.Context) *ProjectsLocationsTcpRoutesCreateCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsTcpRoutesCreateCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsTcpRoutesCreateCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tcproute) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/tcpRoutes") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("POST", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tcpRoutes.create", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.tcpRoutes.create" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsTcpRoutesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tcpRoutes.create", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsTcpRoutesDeleteCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Delete: Deletes a single TcpRoute. | |
| // | |
| // - name: A name of the TcpRoute to delete. Must be in the format | |
| // `projects/*/locations/*/tcpRoutes/*`. | |
| func (r *ProjectsLocationsTcpRoutesService) Delete(name string) *ProjectsLocationsTcpRoutesDeleteCall { | |
| c := &ProjectsLocationsTcpRoutesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsTcpRoutesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsTcpRoutesDeleteCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsTcpRoutesDeleteCall) Context(ctx context.Context) *ProjectsLocationsTcpRoutesDeleteCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsTcpRoutesDeleteCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsTcpRoutesDeleteCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("DELETE", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tcpRoutes.delete", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.tcpRoutes.delete" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsTcpRoutesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tcpRoutes.delete", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsTcpRoutesGetCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Get: Gets details of a single TcpRoute. | |
| // | |
| // - name: A name of the TcpRoute to get. Must be in the format | |
| // `projects/*/locations/*/tcpRoutes/*`. | |
| func (r *ProjectsLocationsTcpRoutesService) Get(name string) *ProjectsLocationsTcpRoutesGetCall { | |
| c := &ProjectsLocationsTcpRoutesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsTcpRoutesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsTcpRoutesGetCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsTcpRoutesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsTcpRoutesGetCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsTcpRoutesGetCall) Context(ctx context.Context) *ProjectsLocationsTcpRoutesGetCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsTcpRoutesGetCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsTcpRoutesGetCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tcpRoutes.get", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.tcpRoutes.get" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *TcpRoute.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsTcpRoutesGetCall) Do(opts ...googleapi.CallOption) (*TcpRoute, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &TcpRoute{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tcpRoutes.get", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsTcpRoutesListCall struct { | |
| s *Service | |
| parent string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // List: Lists TcpRoute in a given project and location. | |
| // | |
| // - parent: The project and location from which the TcpRoutes should be | |
| // listed, specified in the format `projects/*/locations/*`. | |
| func (r *ProjectsLocationsTcpRoutesService) List(parent string) *ProjectsLocationsTcpRoutesListCall { | |
| c := &ProjectsLocationsTcpRoutesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| return c | |
| } | |
| // PageSize sets the optional parameter "pageSize": Maximum number of TcpRoutes | |
| // to return per call. | |
| func (c *ProjectsLocationsTcpRoutesListCall) PageSize(pageSize int64) *ProjectsLocationsTcpRoutesListCall { | |
| c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) | |
| return c | |
| } | |
| // PageToken sets the optional parameter "pageToken": The value returned by the | |
| // last `ListTcpRoutesResponse` Indicates that this is a continuation of a | |
| // prior `ListTcpRoutes` call, and that the system should return the next page | |
| // of data. | |
| func (c *ProjectsLocationsTcpRoutesListCall) PageToken(pageToken string) *ProjectsLocationsTcpRoutesListCall { | |
| c.urlParams_.Set("pageToken", pageToken) | |
| return c | |
| } | |
| // ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": If | |
| // true, allow partial responses for multi-regional Aggregated List requests. | |
| // Otherwise if one of the locations is down or unreachable, the Aggregated | |
| // List request will fail. | |
| func (c *ProjectsLocationsTcpRoutesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *ProjectsLocationsTcpRoutesListCall { | |
| c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsTcpRoutesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsTcpRoutesListCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsTcpRoutesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsTcpRoutesListCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsTcpRoutesListCall) Context(ctx context.Context) *ProjectsLocationsTcpRoutesListCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsTcpRoutesListCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsTcpRoutesListCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/tcpRoutes") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tcpRoutes.list", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.tcpRoutes.list" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *ListTcpRoutesResponse.ServerResponse.Header or (if a response was returned | |
| // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to | |
| // check whether the returned error was because http.StatusNotModified was | |
| // returned. | |
| func (c *ProjectsLocationsTcpRoutesListCall) Do(opts ...googleapi.CallOption) (*ListTcpRoutesResponse, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &ListTcpRoutesResponse{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tcpRoutes.list", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| // Pages invokes f for each page of results. | |
| // A non-nil error returned from f will halt the iteration. | |
| // The provided context supersedes any context provided to the Context method. | |
| func (c *ProjectsLocationsTcpRoutesListCall) Pages(ctx context.Context, f func(*ListTcpRoutesResponse) error) error { | |
| c.ctx_ = ctx | |
| defer c.PageToken(c.urlParams_.Get("pageToken")) | |
| for { | |
| x, err := c.Do() | |
| if err != nil { | |
| return err | |
| } | |
| if err := f(x); err != nil { | |
| return err | |
| } | |
| if x.NextPageToken == "" { | |
| return nil | |
| } | |
| c.PageToken(x.NextPageToken) | |
| } | |
| } | |
| type ProjectsLocationsTcpRoutesPatchCall struct { | |
| s *Service | |
| name string | |
| tcproute *TcpRoute | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Patch: Updates the parameters of a single TcpRoute. | |
| // | |
| // - name: Identifier. Name of the TcpRoute resource. It matches pattern | |
| // `projects/*/locations/*/tcpRoutes/tcp_route_name>`. | |
| func (r *ProjectsLocationsTcpRoutesService) Patch(name string, tcproute *TcpRoute) *ProjectsLocationsTcpRoutesPatchCall { | |
| c := &ProjectsLocationsTcpRoutesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| c.tcproute = tcproute | |
| return c | |
| } | |
| // UpdateMask sets the optional parameter "updateMask": Field mask is used to | |
| // specify the fields to be overwritten in the TcpRoute resource by the update. | |
| // The fields specified in the update_mask are relative to the resource, not | |
| // the full request. A field will be overwritten if it is in the mask. If the | |
| // user does not provide a mask then all fields will be overwritten. | |
| func (c *ProjectsLocationsTcpRoutesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsTcpRoutesPatchCall { | |
| c.urlParams_.Set("updateMask", updateMask) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsTcpRoutesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsTcpRoutesPatchCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsTcpRoutesPatchCall) Context(ctx context.Context) *ProjectsLocationsTcpRoutesPatchCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsTcpRoutesPatchCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsTcpRoutesPatchCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tcproute) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("PATCH", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tcpRoutes.patch", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.tcpRoutes.patch" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsTcpRoutesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tcpRoutes.patch", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsTelemetryPoliciesCreateCall struct { | |
| s *Service | |
| parent string | |
| telemetrypolicy *TelemetryPolicy | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Create: Creates a new TelemetryPolicy in a given project and location. | |
| // | |
| // - parent: The parent resource where this policy will be created. Must be in | |
| // the format `projects/{project}/locations/{location}`. | |
| func (r *ProjectsLocationsTelemetryPoliciesService) Create(parent string, telemetrypolicy *TelemetryPolicy) *ProjectsLocationsTelemetryPoliciesCreateCall { | |
| c := &ProjectsLocationsTelemetryPoliciesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| c.telemetrypolicy = telemetrypolicy | |
| return c | |
| } | |
| // TelemetryPolicyId sets the optional parameter "telemetryPolicyId": Required. | |
| // The ID to use for the telemetry policy, which will become the final | |
| // component of the telemetry policy's resource name. This value must be 4-63 | |
| // characters long, and match the regular expression | |
| // `[a-z]([-a-z0-9]{2,61}[a-z0-9])`. | |
| func (c *ProjectsLocationsTelemetryPoliciesCreateCall) TelemetryPolicyId(telemetryPolicyId string) *ProjectsLocationsTelemetryPoliciesCreateCall { | |
| c.urlParams_.Set("telemetryPolicyId", telemetryPolicyId) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsTelemetryPoliciesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsTelemetryPoliciesCreateCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsTelemetryPoliciesCreateCall) Context(ctx context.Context) *ProjectsLocationsTelemetryPoliciesCreateCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsTelemetryPoliciesCreateCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsTelemetryPoliciesCreateCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.telemetrypolicy) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/telemetryPolicies") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("POST", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.telemetryPolicies.create", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.telemetryPolicies.create" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsTelemetryPoliciesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.telemetryPolicies.create", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsTelemetryPoliciesDeleteCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Delete: Deletes a single TelemetryPolicy. | |
| // | |
| // - name: A name of the TelemetryPolicy to delete. Must be in the format | |
| // `projects/{project}/locations/{location}/telemetryPolicies/{telemetry_polic | |
| // y}`. | |
| func (r *ProjectsLocationsTelemetryPoliciesService) Delete(name string) *ProjectsLocationsTelemetryPoliciesDeleteCall { | |
| c := &ProjectsLocationsTelemetryPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Etag sets the optional parameter "etag": The etag of the TelemetryPolicy. If | |
| // this is provided, it must match the server's etag. | |
| func (c *ProjectsLocationsTelemetryPoliciesDeleteCall) Etag(etag string) *ProjectsLocationsTelemetryPoliciesDeleteCall { | |
| c.urlParams_.Set("etag", etag) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsTelemetryPoliciesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsTelemetryPoliciesDeleteCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsTelemetryPoliciesDeleteCall) Context(ctx context.Context) *ProjectsLocationsTelemetryPoliciesDeleteCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsTelemetryPoliciesDeleteCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsTelemetryPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("DELETE", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.telemetryPolicies.delete", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.telemetryPolicies.delete" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsTelemetryPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.telemetryPolicies.delete", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsTelemetryPoliciesGetCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Get: Gets details of a single TelemetryPolicy. | |
| // | |
| // - name: A name of the TelemetryPolicy to get. Must be in the format | |
| // `projects/{project}/locations/{location}/telemetryPolicies/{telemetry_polic | |
| // y}`. | |
| func (r *ProjectsLocationsTelemetryPoliciesService) Get(name string) *ProjectsLocationsTelemetryPoliciesGetCall { | |
| c := &ProjectsLocationsTelemetryPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsTelemetryPoliciesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsTelemetryPoliciesGetCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsTelemetryPoliciesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsTelemetryPoliciesGetCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsTelemetryPoliciesGetCall) Context(ctx context.Context) *ProjectsLocationsTelemetryPoliciesGetCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsTelemetryPoliciesGetCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsTelemetryPoliciesGetCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.telemetryPolicies.get", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.telemetryPolicies.get" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *TelemetryPolicy.ServerResponse.Header or (if a response was returned at | |
| // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to | |
| // check whether the returned error was because http.StatusNotModified was | |
| // returned. | |
| func (c *ProjectsLocationsTelemetryPoliciesGetCall) Do(opts ...googleapi.CallOption) (*TelemetryPolicy, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &TelemetryPolicy{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.telemetryPolicies.get", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsTelemetryPoliciesListCall struct { | |
| s *Service | |
| parent string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // List: Lists TelemetryPolicies in a given project and location. | |
| // | |
| // - parent: The project and location from which the TelemetryPolicies should | |
| // be listed, specified in the format | |
| // `projects/{project}/locations/{location}`. | |
| func (r *ProjectsLocationsTelemetryPoliciesService) List(parent string) *ProjectsLocationsTelemetryPoliciesListCall { | |
| c := &ProjectsLocationsTelemetryPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| return c | |
| } | |
| // PageSize sets the optional parameter "pageSize": The maximum number of | |
| // policies to return. The service may return fewer than this value. If | |
| // unspecified, at most 50 policies will be returned. The maximum value is | |
| // 1000; values above 1000 will be coerced to 1000. | |
| func (c *ProjectsLocationsTelemetryPoliciesListCall) PageSize(pageSize int64) *ProjectsLocationsTelemetryPoliciesListCall { | |
| c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) | |
| return c | |
| } | |
| // PageToken sets the optional parameter "pageToken": A page token, received | |
| // from a previous `ListTelemetryPolicies` call. Provide this to retrieve the | |
| // subsequent page. | |
| func (c *ProjectsLocationsTelemetryPoliciesListCall) PageToken(pageToken string) *ProjectsLocationsTelemetryPoliciesListCall { | |
| c.urlParams_.Set("pageToken", pageToken) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsTelemetryPoliciesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsTelemetryPoliciesListCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsTelemetryPoliciesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsTelemetryPoliciesListCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsTelemetryPoliciesListCall) Context(ctx context.Context) *ProjectsLocationsTelemetryPoliciesListCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsTelemetryPoliciesListCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsTelemetryPoliciesListCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/telemetryPolicies") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.telemetryPolicies.list", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.telemetryPolicies.list" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *ListTelemetryPoliciesResponse.ServerResponse.Header or (if a response was | |
| // returned at all) in error.(*googleapi.Error).Header. Use | |
| // googleapi.IsNotModified to check whether the returned error was because | |
| // http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsTelemetryPoliciesListCall) Do(opts ...googleapi.CallOption) (*ListTelemetryPoliciesResponse, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &ListTelemetryPoliciesResponse{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.telemetryPolicies.list", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| // Pages invokes f for each page of results. | |
| // A non-nil error returned from f will halt the iteration. | |
| // The provided context supersedes any context provided to the Context method. | |
| func (c *ProjectsLocationsTelemetryPoliciesListCall) Pages(ctx context.Context, f func(*ListTelemetryPoliciesResponse) error) error { | |
| c.ctx_ = ctx | |
| defer c.PageToken(c.urlParams_.Get("pageToken")) | |
| for { | |
| x, err := c.Do() | |
| if err != nil { | |
| return err | |
| } | |
| if err := f(x); err != nil { | |
| return err | |
| } | |
| if x.NextPageToken == "" { | |
| return nil | |
| } | |
| c.PageToken(x.NextPageToken) | |
| } | |
| } | |
| type ProjectsLocationsTelemetryPoliciesPatchCall struct { | |
| s *Service | |
| name string | |
| telemetrypolicy *TelemetryPolicy | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Patch: Updates the parameters of a single TelemetryPolicy. | |
| // | |
| // - name: Identifier. Represents the resource name of the policy. Format: | |
| // `projects/{project}/locations/{location}/telemetryPolicies/{telemetry_polic | |
| // y}`. | |
| func (r *ProjectsLocationsTelemetryPoliciesService) Patch(name string, telemetrypolicy *TelemetryPolicy) *ProjectsLocationsTelemetryPoliciesPatchCall { | |
| c := &ProjectsLocationsTelemetryPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| c.telemetrypolicy = telemetrypolicy | |
| return c | |
| } | |
| // AllowMissing sets the optional parameter "allowMissing": If set to true, and | |
| // the telemetry policy is not found, a new telemetry policy will be created. | |
| // In this situation, `update_mask` is ignored. | |
| func (c *ProjectsLocationsTelemetryPoliciesPatchCall) AllowMissing(allowMissing bool) *ProjectsLocationsTelemetryPoliciesPatchCall { | |
| c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing)) | |
| return c | |
| } | |
| // UpdateMask sets the optional parameter "updateMask": Field mask is used to | |
| // specify the fields to be overwritten in the TelemetryPolicy resource by the | |
| // update. The fields specified in the update_mask are relative to the | |
| // resource, not the full request. A field will be overwritten if it is in the | |
| // mask. If the `update_mask` is not provided, the service will treat it as an | |
| // implied field mask equivalent to all fields provided in the request message. | |
| // This means that only the fields populated in the `telemetry_policy` field | |
| // will be updated. The special value `*` can be used to indicate full | |
| // replacement. | |
| func (c *ProjectsLocationsTelemetryPoliciesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsTelemetryPoliciesPatchCall { | |
| c.urlParams_.Set("updateMask", updateMask) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsTelemetryPoliciesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsTelemetryPoliciesPatchCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsTelemetryPoliciesPatchCall) Context(ctx context.Context) *ProjectsLocationsTelemetryPoliciesPatchCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsTelemetryPoliciesPatchCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsTelemetryPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.telemetrypolicy) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("PATCH", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.telemetryPolicies.patch", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.telemetryPolicies.patch" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsTelemetryPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.telemetryPolicies.patch", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsTlsRoutesCreateCall struct { | |
| s *Service | |
| parent string | |
| tlsroute *TlsRoute | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Create: Creates a new TlsRoute in a given project and location. | |
| // | |
| // - parent: The parent resource of the TlsRoute. Must be in the format | |
| // `projects/*/locations/*`. | |
| func (r *ProjectsLocationsTlsRoutesService) Create(parent string, tlsroute *TlsRoute) *ProjectsLocationsTlsRoutesCreateCall { | |
| c := &ProjectsLocationsTlsRoutesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| c.tlsroute = tlsroute | |
| return c | |
| } | |
| // TlsRouteId sets the optional parameter "tlsRouteId": Required. Short name of | |
| // the TlsRoute resource to be created. | |
| func (c *ProjectsLocationsTlsRoutesCreateCall) TlsRouteId(tlsRouteId string) *ProjectsLocationsTlsRoutesCreateCall { | |
| c.urlParams_.Set("tlsRouteId", tlsRouteId) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsTlsRoutesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsTlsRoutesCreateCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsTlsRoutesCreateCall) Context(ctx context.Context) *ProjectsLocationsTlsRoutesCreateCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsTlsRoutesCreateCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsTlsRoutesCreateCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tlsroute) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/tlsRoutes") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("POST", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tlsRoutes.create", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.tlsRoutes.create" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsTlsRoutesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tlsRoutes.create", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsTlsRoutesDeleteCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Delete: Deletes a single TlsRoute. | |
| // | |
| // - name: A name of the TlsRoute to delete. Must be in the format | |
| // `projects/*/locations/*/tlsRoutes/*`. | |
| func (r *ProjectsLocationsTlsRoutesService) Delete(name string) *ProjectsLocationsTlsRoutesDeleteCall { | |
| c := &ProjectsLocationsTlsRoutesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsTlsRoutesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsTlsRoutesDeleteCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsTlsRoutesDeleteCall) Context(ctx context.Context) *ProjectsLocationsTlsRoutesDeleteCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsTlsRoutesDeleteCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsTlsRoutesDeleteCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("DELETE", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tlsRoutes.delete", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.tlsRoutes.delete" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsTlsRoutesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tlsRoutes.delete", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsTlsRoutesGetCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Get: Gets details of a single TlsRoute. | |
| // | |
| // - name: A name of the TlsRoute to get. Must be in the format | |
| // `projects/*/locations/*/tlsRoutes/*`. | |
| func (r *ProjectsLocationsTlsRoutesService) Get(name string) *ProjectsLocationsTlsRoutesGetCall { | |
| c := &ProjectsLocationsTlsRoutesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsTlsRoutesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsTlsRoutesGetCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsTlsRoutesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsTlsRoutesGetCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsTlsRoutesGetCall) Context(ctx context.Context) *ProjectsLocationsTlsRoutesGetCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsTlsRoutesGetCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsTlsRoutesGetCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tlsRoutes.get", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.tlsRoutes.get" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *TlsRoute.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsTlsRoutesGetCall) Do(opts ...googleapi.CallOption) (*TlsRoute, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &TlsRoute{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tlsRoutes.get", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsTlsRoutesListCall struct { | |
| s *Service | |
| parent string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // List: Lists TlsRoute in a given project and location. | |
| // | |
| // - parent: The project and location from which the TlsRoutes should be | |
| // listed, specified in the format `projects/*/locations/*`. | |
| func (r *ProjectsLocationsTlsRoutesService) List(parent string) *ProjectsLocationsTlsRoutesListCall { | |
| c := &ProjectsLocationsTlsRoutesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| return c | |
| } | |
| // PageSize sets the optional parameter "pageSize": Maximum number of TlsRoutes | |
| // to return per call. | |
| func (c *ProjectsLocationsTlsRoutesListCall) PageSize(pageSize int64) *ProjectsLocationsTlsRoutesListCall { | |
| c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) | |
| return c | |
| } | |
| // PageToken sets the optional parameter "pageToken": The value returned by the | |
| // last `ListTlsRoutesResponse` Indicates that this is a continuation of a | |
| // prior `ListTlsRoutes` call, and that the system should return the next page | |
| // of data. | |
| func (c *ProjectsLocationsTlsRoutesListCall) PageToken(pageToken string) *ProjectsLocationsTlsRoutesListCall { | |
| c.urlParams_.Set("pageToken", pageToken) | |
| return c | |
| } | |
| // ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": If | |
| // true, allow partial responses for multi-regional Aggregated List requests. | |
| // Otherwise if one of the locations is down or unreachable, the Aggregated | |
| // List request will fail. | |
| func (c *ProjectsLocationsTlsRoutesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *ProjectsLocationsTlsRoutesListCall { | |
| c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsTlsRoutesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsTlsRoutesListCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsTlsRoutesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsTlsRoutesListCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsTlsRoutesListCall) Context(ctx context.Context) *ProjectsLocationsTlsRoutesListCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsTlsRoutesListCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsTlsRoutesListCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/tlsRoutes") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tlsRoutes.list", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.tlsRoutes.list" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *ListTlsRoutesResponse.ServerResponse.Header or (if a response was returned | |
| // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to | |
| // check whether the returned error was because http.StatusNotModified was | |
| // returned. | |
| func (c *ProjectsLocationsTlsRoutesListCall) Do(opts ...googleapi.CallOption) (*ListTlsRoutesResponse, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &ListTlsRoutesResponse{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tlsRoutes.list", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| // Pages invokes f for each page of results. | |
| // A non-nil error returned from f will halt the iteration. | |
| // The provided context supersedes any context provided to the Context method. | |
| func (c *ProjectsLocationsTlsRoutesListCall) Pages(ctx context.Context, f func(*ListTlsRoutesResponse) error) error { | |
| c.ctx_ = ctx | |
| defer c.PageToken(c.urlParams_.Get("pageToken")) | |
| for { | |
| x, err := c.Do() | |
| if err != nil { | |
| return err | |
| } | |
| if err := f(x); err != nil { | |
| return err | |
| } | |
| if x.NextPageToken == "" { | |
| return nil | |
| } | |
| c.PageToken(x.NextPageToken) | |
| } | |
| } | |
| type ProjectsLocationsTlsRoutesPatchCall struct { | |
| s *Service | |
| name string | |
| tlsroute *TlsRoute | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Patch: Updates the parameters of a single TlsRoute. | |
| // | |
| // - name: Identifier. Name of the TlsRoute resource. It matches pattern | |
| // `projects/*/locations/*/tlsRoutes/tls_route_name>`. | |
| func (r *ProjectsLocationsTlsRoutesService) Patch(name string, tlsroute *TlsRoute) *ProjectsLocationsTlsRoutesPatchCall { | |
| c := &ProjectsLocationsTlsRoutesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| c.tlsroute = tlsroute | |
| return c | |
| } | |
| // UpdateMask sets the optional parameter "updateMask": Field mask is used to | |
| // specify the fields to be overwritten in the TlsRoute resource by the update. | |
| // The fields specified in the update_mask are relative to the resource, not | |
| // the full request. A field will be overwritten if it is in the mask. If the | |
| // user does not provide a mask then all fields will be overwritten. | |
| func (c *ProjectsLocationsTlsRoutesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsTlsRoutesPatchCall { | |
| c.urlParams_.Set("updateMask", updateMask) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsTlsRoutesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsTlsRoutesPatchCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsTlsRoutesPatchCall) Context(ctx context.Context) *ProjectsLocationsTlsRoutesPatchCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsTlsRoutesPatchCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsTlsRoutesPatchCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tlsroute) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("PATCH", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tlsRoutes.patch", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.tlsRoutes.patch" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsTlsRoutesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tlsRoutes.patch", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsWasmPluginsCreateCall struct { | |
| s *Service | |
| parent string | |
| wasmplugin *WasmPlugin | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Create: Creates a new `WasmPlugin` resource in a given project and location. | |
| // | |
| // - parent: The parent resource of the `WasmPlugin` resource. Must be in the | |
| // format `projects/{project}/locations/global`. | |
| func (r *ProjectsLocationsWasmPluginsService) Create(parent string, wasmplugin *WasmPlugin) *ProjectsLocationsWasmPluginsCreateCall { | |
| c := &ProjectsLocationsWasmPluginsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| c.wasmplugin = wasmplugin | |
| return c | |
| } | |
| // WasmPluginId sets the optional parameter "wasmPluginId": Required. | |
| // User-provided ID of the `WasmPlugin` resource to be created. | |
| func (c *ProjectsLocationsWasmPluginsCreateCall) WasmPluginId(wasmPluginId string) *ProjectsLocationsWasmPluginsCreateCall { | |
| c.urlParams_.Set("wasmPluginId", wasmPluginId) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsWasmPluginsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsWasmPluginsCreateCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsWasmPluginsCreateCall) Context(ctx context.Context) *ProjectsLocationsWasmPluginsCreateCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsWasmPluginsCreateCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsWasmPluginsCreateCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.wasmplugin) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/wasmPlugins") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("POST", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.create", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.wasmPlugins.create" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsWasmPluginsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.create", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsWasmPluginsDeleteCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Delete: Deletes the specified `WasmPlugin` resource. | |
| // | |
| // - name: A name of the `WasmPlugin` resource to delete. Must be in the format | |
| // `projects/{project}/locations/global/wasmPlugins/{wasm_plugin}`. | |
| func (r *ProjectsLocationsWasmPluginsService) Delete(name string) *ProjectsLocationsWasmPluginsDeleteCall { | |
| c := &ProjectsLocationsWasmPluginsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsWasmPluginsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsWasmPluginsDeleteCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsWasmPluginsDeleteCall) Context(ctx context.Context) *ProjectsLocationsWasmPluginsDeleteCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsWasmPluginsDeleteCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsWasmPluginsDeleteCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("DELETE", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.delete", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.wasmPlugins.delete" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsWasmPluginsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.delete", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsWasmPluginsGetCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Get: Gets details of the specified `WasmPlugin` resource. | |
| // | |
| // - name: A name of the `WasmPlugin` resource to get. Must be in the format | |
| // `projects/{project}/locations/global/wasmPlugins/{wasm_plugin}`. | |
| func (r *ProjectsLocationsWasmPluginsService) Get(name string) *ProjectsLocationsWasmPluginsGetCall { | |
| c := &ProjectsLocationsWasmPluginsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // View sets the optional parameter "view": Determines how much data must be | |
| // returned in the response. See AIP-157 (https://google.aip.dev/157). | |
| // | |
| // Possible values: | |
| // | |
| // "WASM_PLUGIN_VIEW_UNSPECIFIED" - Unspecified value. Do not use. | |
| // "WASM_PLUGIN_VIEW_BASIC" - If specified in the `GET` request for a | |
| // | |
| // `WasmPlugin` resource, the server's response includes just the `WasmPlugin` | |
| // resource. | |
| // | |
| // "WASM_PLUGIN_VIEW_FULL" - If specified in the `GET` request for a | |
| // | |
| // `WasmPlugin` resource, the server's response includes the `WasmPlugin` | |
| // resource with all its versions. | |
| func (c *ProjectsLocationsWasmPluginsGetCall) View(view string) *ProjectsLocationsWasmPluginsGetCall { | |
| c.urlParams_.Set("view", view) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsWasmPluginsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsWasmPluginsGetCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsWasmPluginsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsWasmPluginsGetCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsWasmPluginsGetCall) Context(ctx context.Context) *ProjectsLocationsWasmPluginsGetCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsWasmPluginsGetCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsWasmPluginsGetCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.get", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.wasmPlugins.get" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *WasmPlugin.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsWasmPluginsGetCall) Do(opts ...googleapi.CallOption) (*WasmPlugin, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &WasmPlugin{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.get", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsWasmPluginsListCall struct { | |
| s *Service | |
| parent string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // List: Lists `WasmPlugin` resources in a given project and location. | |
| // | |
| // - parent: The project and location from which the `WasmPlugin` resources are | |
| // listed, specified in the following format: | |
| // `projects/{project}/locations/global`. | |
| func (r *ProjectsLocationsWasmPluginsService) List(parent string) *ProjectsLocationsWasmPluginsListCall { | |
| c := &ProjectsLocationsWasmPluginsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| return c | |
| } | |
| // PageSize sets the optional parameter "pageSize": Maximum number of | |
| // `WasmPlugin` resources to return per call. If not specified, at most 50 | |
| // `WasmPlugin` resources are returned. The maximum value is 1000; values above | |
| // 1000 are coerced to 1000. | |
| func (c *ProjectsLocationsWasmPluginsListCall) PageSize(pageSize int64) *ProjectsLocationsWasmPluginsListCall { | |
| c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) | |
| return c | |
| } | |
| // PageToken sets the optional parameter "pageToken": The value returned by the | |
| // last `ListWasmPluginsResponse` call. Indicates that this is a continuation | |
| // of a prior `ListWasmPlugins` call, and that the next page of data is to be | |
| // returned. | |
| func (c *ProjectsLocationsWasmPluginsListCall) PageToken(pageToken string) *ProjectsLocationsWasmPluginsListCall { | |
| c.urlParams_.Set("pageToken", pageToken) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsWasmPluginsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsWasmPluginsListCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsWasmPluginsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsWasmPluginsListCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsWasmPluginsListCall) Context(ctx context.Context) *ProjectsLocationsWasmPluginsListCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsWasmPluginsListCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsWasmPluginsListCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/wasmPlugins") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.list", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.wasmPlugins.list" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *ListWasmPluginsResponse.ServerResponse.Header or (if a response was | |
| // returned at all) in error.(*googleapi.Error).Header. Use | |
| // googleapi.IsNotModified to check whether the returned error was because | |
| // http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsWasmPluginsListCall) Do(opts ...googleapi.CallOption) (*ListWasmPluginsResponse, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &ListWasmPluginsResponse{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.list", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| // Pages invokes f for each page of results. | |
| // A non-nil error returned from f will halt the iteration. | |
| // The provided context supersedes any context provided to the Context method. | |
| func (c *ProjectsLocationsWasmPluginsListCall) Pages(ctx context.Context, f func(*ListWasmPluginsResponse) error) error { | |
| c.ctx_ = ctx | |
| defer c.PageToken(c.urlParams_.Get("pageToken")) | |
| for { | |
| x, err := c.Do() | |
| if err != nil { | |
| return err | |
| } | |
| if err := f(x); err != nil { | |
| return err | |
| } | |
| if x.NextPageToken == "" { | |
| return nil | |
| } | |
| c.PageToken(x.NextPageToken) | |
| } | |
| } | |
| type ProjectsLocationsWasmPluginsPatchCall struct { | |
| s *Service | |
| name string | |
| wasmplugin *WasmPlugin | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Patch: Updates the parameters of the specified `WasmPlugin` resource. | |
| // | |
| // - name: Identifier. Name of the `WasmPlugin` resource in the following | |
| // format: | |
| // `projects/{project}/locations/{location}/wasmPlugins/{wasm_plugin}`. | |
| func (r *ProjectsLocationsWasmPluginsService) Patch(name string, wasmplugin *WasmPlugin) *ProjectsLocationsWasmPluginsPatchCall { | |
| c := &ProjectsLocationsWasmPluginsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| c.wasmplugin = wasmplugin | |
| return c | |
| } | |
| // UpdateMask sets the optional parameter "updateMask": Used to specify the | |
| // fields to be overwritten in the `WasmPlugin` resource by the update. The | |
| // fields specified in the `update_mask` field are relative to the resource, | |
| // not the full request. An omitted `update_mask` field is treated as an | |
| // implied `update_mask` field equivalent to all fields that are populated | |
| // (that have a non-empty value). The `update_mask` field supports a special | |
| // value `*`, which means that each field in the given `WasmPlugin` resource | |
| // (including the empty ones) replaces the current value. | |
| func (c *ProjectsLocationsWasmPluginsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsWasmPluginsPatchCall { | |
| c.urlParams_.Set("updateMask", updateMask) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsWasmPluginsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsWasmPluginsPatchCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsWasmPluginsPatchCall) Context(ctx context.Context) *ProjectsLocationsWasmPluginsPatchCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsWasmPluginsPatchCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsWasmPluginsPatchCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.wasmplugin) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("PATCH", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.patch", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.wasmPlugins.patch" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsWasmPluginsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.patch", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsWasmPluginsVersionsCreateCall struct { | |
| s *Service | |
| parent string | |
| wasmpluginversion *WasmPluginVersion | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Create: Creates a new `WasmPluginVersion` resource in a given project and | |
| // location. | |
| // | |
| // - parent: The parent resource of the `WasmPluginVersion` resource. Must be | |
| // in the format | |
| // `projects/{project}/locations/global/wasmPlugins/{wasm_plugin}`. | |
| func (r *ProjectsLocationsWasmPluginsVersionsService) Create(parent string, wasmpluginversion *WasmPluginVersion) *ProjectsLocationsWasmPluginsVersionsCreateCall { | |
| c := &ProjectsLocationsWasmPluginsVersionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| c.wasmpluginversion = wasmpluginversion | |
| return c | |
| } | |
| // WasmPluginVersionId sets the optional parameter "wasmPluginVersionId": | |
| // Required. User-provided ID of the `WasmPluginVersion` resource to be | |
| // created. | |
| func (c *ProjectsLocationsWasmPluginsVersionsCreateCall) WasmPluginVersionId(wasmPluginVersionId string) *ProjectsLocationsWasmPluginsVersionsCreateCall { | |
| c.urlParams_.Set("wasmPluginVersionId", wasmPluginVersionId) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsWasmPluginsVersionsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsWasmPluginsVersionsCreateCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsWasmPluginsVersionsCreateCall) Context(ctx context.Context) *ProjectsLocationsWasmPluginsVersionsCreateCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsWasmPluginsVersionsCreateCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsWasmPluginsVersionsCreateCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) | |
| body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.wasmpluginversion) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/versions") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("POST", urls, body) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.versions.create", "request", internallog.HTTPRequest(req, body.Bytes())) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.wasmPlugins.versions.create" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsWasmPluginsVersionsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.versions.create", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsWasmPluginsVersionsDeleteCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Delete: Deletes the specified `WasmPluginVersion` resource. | |
| // | |
| // - name: A name of the `WasmPluginVersion` resource to delete. Must be in the | |
| // format | |
| // `projects/{project}/locations/global/wasmPlugins/{wasm_plugin}/versions/{wa | |
| // sm_plugin_version}`. | |
| func (r *ProjectsLocationsWasmPluginsVersionsService) Delete(name string) *ProjectsLocationsWasmPluginsVersionsDeleteCall { | |
| c := &ProjectsLocationsWasmPluginsVersionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsWasmPluginsVersionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsWasmPluginsVersionsDeleteCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsWasmPluginsVersionsDeleteCall) Context(ctx context.Context) *ProjectsLocationsWasmPluginsVersionsDeleteCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsWasmPluginsVersionsDeleteCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsWasmPluginsVersionsDeleteCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("DELETE", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.versions.delete", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.wasmPlugins.versions.delete" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *Operation.ServerResponse.Header or (if a response was returned at all) in | |
| // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | |
| // whether the returned error was because http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsWasmPluginsVersionsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &Operation{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.versions.delete", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsWasmPluginsVersionsGetCall struct { | |
| s *Service | |
| name string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // Get: Gets details of the specified `WasmPluginVersion` resource. | |
| // | |
| // - name: A name of the `WasmPluginVersion` resource to get. Must be in the | |
| // format | |
| // `projects/{project}/locations/global/wasmPlugins/{wasm_plugin}/versions/{wa | |
| // sm_plugin_version}`. | |
| func (r *ProjectsLocationsWasmPluginsVersionsService) Get(name string) *ProjectsLocationsWasmPluginsVersionsGetCall { | |
| c := &ProjectsLocationsWasmPluginsVersionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.name = name | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsWasmPluginsVersionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsWasmPluginsVersionsGetCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsWasmPluginsVersionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsWasmPluginsVersionsGetCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsWasmPluginsVersionsGetCall) Context(ctx context.Context) *ProjectsLocationsWasmPluginsVersionsGetCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsWasmPluginsVersionsGetCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsWasmPluginsVersionsGetCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "name": c.name, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.versions.get", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.wasmPlugins.versions.get" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *WasmPluginVersion.ServerResponse.Header or (if a response was returned at | |
| // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to | |
| // check whether the returned error was because http.StatusNotModified was | |
| // returned. | |
| func (c *ProjectsLocationsWasmPluginsVersionsGetCall) Do(opts ...googleapi.CallOption) (*WasmPluginVersion, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &WasmPluginVersion{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.versions.get", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| type ProjectsLocationsWasmPluginsVersionsListCall struct { | |
| s *Service | |
| parent string | |
| urlParams_ gensupport.URLParams | |
| ifNoneMatch_ string | |
| ctx_ context.Context | |
| header_ http.Header | |
| } | |
| // List: Lists `WasmPluginVersion` resources in a given project and location. | |
| // | |
| // - parent: The `WasmPlugin` resource whose `WasmPluginVersion`s are listed, | |
| // specified in the following format: | |
| // `projects/{project}/locations/global/wasmPlugins/{wasm_plugin}`. | |
| func (r *ProjectsLocationsWasmPluginsVersionsService) List(parent string) *ProjectsLocationsWasmPluginsVersionsListCall { | |
| c := &ProjectsLocationsWasmPluginsVersionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} | |
| c.parent = parent | |
| return c | |
| } | |
| // PageSize sets the optional parameter "pageSize": Maximum number of | |
| // `WasmPluginVersion` resources to return per call. If not specified, at most | |
| // 50 `WasmPluginVersion` resources are returned. The maximum value is 1000; | |
| // values above 1000 are coerced to 1000. | |
| func (c *ProjectsLocationsWasmPluginsVersionsListCall) PageSize(pageSize int64) *ProjectsLocationsWasmPluginsVersionsListCall { | |
| c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) | |
| return c | |
| } | |
| // PageToken sets the optional parameter "pageToken": The value returned by the | |
| // last `ListWasmPluginVersionsResponse` call. Indicates that this is a | |
| // continuation of a prior `ListWasmPluginVersions` call, and that the next | |
| // page of data is to be returned. | |
| func (c *ProjectsLocationsWasmPluginsVersionsListCall) PageToken(pageToken string) *ProjectsLocationsWasmPluginsVersionsListCall { | |
| c.urlParams_.Set("pageToken", pageToken) | |
| return c | |
| } | |
| // Fields allows partial responses to be retrieved. See | |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more | |
| // details. | |
| func (c *ProjectsLocationsWasmPluginsVersionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsWasmPluginsVersionsListCall { | |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) | |
| return c | |
| } | |
| // IfNoneMatch sets an optional parameter which makes the operation fail if the | |
| // object's ETag matches the given value. This is useful for getting updates | |
| // only after the object has changed since the last request. | |
| func (c *ProjectsLocationsWasmPluginsVersionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsWasmPluginsVersionsListCall { | |
| c.ifNoneMatch_ = entityTag | |
| return c | |
| } | |
| // Context sets the context to be used in this call's Do method. | |
| func (c *ProjectsLocationsWasmPluginsVersionsListCall) Context(ctx context.Context) *ProjectsLocationsWasmPluginsVersionsListCall { | |
| c.ctx_ = ctx | |
| return c | |
| } | |
| // Header returns a http.Header that can be modified by the caller to add | |
| // headers to the request. | |
| func (c *ProjectsLocationsWasmPluginsVersionsListCall) Header() http.Header { | |
| if c.header_ == nil { | |
| c.header_ = make(http.Header) | |
| } | |
| return c.header_ | |
| } | |
| func (c *ProjectsLocationsWasmPluginsVersionsListCall) doRequest(alt string) (*http.Response, error) { | |
| reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) | |
| if c.ifNoneMatch_ != "" { | |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
| } | |
| c.urlParams_.Set("alt", alt) | |
| c.urlParams_.Set("prettyPrint", "false") | |
| urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/versions") | |
| urls += "?" + c.urlParams_.Encode() | |
| req, err := http.NewRequest("GET", urls, nil) | |
| if err != nil { | |
| return nil, err | |
| } | |
| req.Header = reqHeaders | |
| googleapi.Expand(req.URL, map[string]string{ | |
| "parent": c.parent, | |
| }) | |
| c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.versions.list", "request", internallog.HTTPRequest(req, nil)) | |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) | |
| } | |
| // Do executes the "networkservices.projects.locations.wasmPlugins.versions.list" call. | |
| // Any non-2xx status code is an error. Response headers are in either | |
| // *ListWasmPluginVersionsResponse.ServerResponse.Header or (if a response was | |
| // returned at all) in error.(*googleapi.Error).Header. Use | |
| // googleapi.IsNotModified to check whether the returned error was because | |
| // http.StatusNotModified was returned. | |
| func (c *ProjectsLocationsWasmPluginsVersionsListCall) Do(opts ...googleapi.CallOption) (*ListWasmPluginVersionsResponse, error) { | |
| gensupport.SetOptions(c.urlParams_, opts...) | |
| res, err := c.doRequest("json") | |
| if res != nil && res.StatusCode == http.StatusNotModified { | |
| if res.Body != nil { | |
| res.Body.Close() | |
| } | |
| return nil, gensupport.WrapError(&googleapi.Error{ | |
| Code: res.StatusCode, | |
| Header: res.Header, | |
| }) | |
| } | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer googleapi.CloseBody(res) | |
| if err := googleapi.CheckResponse(res); err != nil { | |
| return nil, gensupport.WrapError(err) | |
| } | |
| ret := &ListWasmPluginVersionsResponse{ | |
| ServerResponse: googleapi.ServerResponse{ | |
| Header: res.Header, | |
| HTTPStatusCode: res.StatusCode, | |
| }, | |
| } | |
| target := &ret | |
| b, err := gensupport.DecodeResponseBytes(target, res) | |
| if err != nil { | |
| return nil, err | |
| } | |
| c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.versions.list", "response", internallog.HTTPResponse(res, b)) | |
| return ret, nil | |
| } | |
| // Pages invokes f for each page of results. | |
| // A non-nil error returned from f will halt the iteration. | |
| // The provided context supersedes any context provided to the Context method. | |
| func (c *ProjectsLocationsWasmPluginsVersionsListCall) Pages(ctx context.Context, f func(*ListWasmPluginVersionsResponse) error) error { | |
| c.ctx_ = ctx | |
| defer c.PageToken(c.urlParams_.Get("pageToken")) | |
| for { | |
| x, err := c.Do() | |
| if err != nil { | |
| return err | |
| } | |
| if err := f(x); err != nil { | |
| return err | |
| } | |
| if x.NextPageToken == "" { | |
| return nil | |
| } | |
| c.PageToken(x.NextPageToken) | |
| } | |
| } |