// Code generated by sidekick. DO NOT EDIT.
//
// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#if Routers
  import Foundation
  #if canImport(FoundationNetworking)
    import FoundationNetworking
  #endif
  import GoogleCloudWkt
  import GoogleCloudGax

  extension Clients {
    protocol RoutersStub {
      func aggregatedList(
        request: RoutersClient.AggregatedListRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.RouterAggregatedList

      func delete(
        request: RoutersClient.DeleteRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation

      func deleteNamedSet(
        request: RoutersClient.DeleteNamedSetRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation

      func deleteRoutePolicy(
        request: RoutersClient.DeleteRoutePolicyRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation

      func `get`(
        request: RoutersClient.GetRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Router

      func getNamedSet(
        request: RoutersClient.GetNamedSetRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.RoutersGetNamedSetResponse

      func getNatIpInfo(
        request: RoutersClient.GetNatIpInfoRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.NatIpInfoResponse

      func getNatMappingInfo(
        request: RoutersClient.GetNatMappingInfoRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.VmEndpointNatMappingsList

      func getRoutePolicy(
        request: RoutersClient.GetRoutePolicyRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.RoutersGetRoutePolicyResponse

      func getRouterStatus(
        request: RoutersClient.GetRouterStatusRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.RouterStatusResponse

      func insert(
        request: RoutersClient.InsertRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation

      func list(
        request: RoutersClient.ListRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.RouterList

      func listBgpRoutes(
        request: RoutersClient.ListBgpRoutesRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.RoutersListBgpRoutes

      func listNamedSets(
        request: RoutersClient.ListNamedSetsRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.RoutersListNamedSets

      func listRoutePolicies(
        request: RoutersClient.ListRoutePoliciesRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.RoutersListRoutePolicies

      func patch(
        request: RoutersClient.PatchRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation

      func patchNamedSet(
        request: RoutersClient.PatchNamedSetRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation

      func patchRoutePolicy(
        request: RoutersClient.PatchRoutePolicyRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation

      func preview(
        request: RoutersClient.PreviewRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.RoutersPreviewResponse

      func update(
        request: RoutersClient.UpdateRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation

      func updateNamedSet(
        request: RoutersClient.UpdateNamedSetRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation

      func updateRoutePolicy(
        request: RoutersClient.UpdateRoutePolicyRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation

      func getOperation(
        request: RegionOperationsClient.GetRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation
    }

    class RoutersTransport: RoutersStub {
      let inner: GoogleCloudGax.HTTPClient

      public init(_ options: GoogleCloudGax.ClientOptions = .init()) throws {
        self.inner = try GoogleCloudGax.HTTPClient(
          from: options, withDefaultEndpoint: "https://compute.googleapis.com")
      }

      public func aggregatedList(
        request: RoutersClient.AggregatedListRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.RouterAggregatedList {
        let path = try { () throws -> Swift.String in
          guard let pathVariable0 = request.project as Swift.String?, !pathVariable0.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.project' is not set or is empty")
          }
          return "/compute/v1/projects/\(pathVariable0)/aggregated/routers"
        }()
        var query = [
          URLQueryItem(name: "$alt", value: "json")
        ]
        let encoder = GoogleCloudGax.QueryParameterEncoder()
        query.append(contentsOf: try encoder.encode(request.filter, prefix: "filter"))
        query.append(
          contentsOf: try encoder.encode(request.includeAllScopes, prefix: "includeAllScopes"))
        query.append(contentsOf: try encoder.encode(request.maxResults, prefix: "maxResults"))
        query.append(contentsOf: try encoder.encode(request.orderBy, prefix: "orderBy"))
        query.append(contentsOf: try encoder.encode(request.pageToken, prefix: "pageToken"))
        query.append(
          contentsOf: try encoder.encode(
            request.returnPartialSuccess, prefix: "returnPartialSuccess"))
        query.append(
          contentsOf: try encoder.encode(
            request.serviceProjectNumber, prefix: "serviceProjectNumber"))
        var req = try await self.inner.Request(path: path, query: query)
        req.httpMethod = "GET"
        req.setValue(Clients.clientHeader, forHTTPHeaderField: "X-Goog-Api-Client")
        let (data, _) = try await self.inner.rpc(for: req).get()
        return try GoogleCloudWkt._ProtoJSONDecoder().decode(
          GoogleCloudComputeV1.RouterAggregatedList.self, from: data)
      }

      public func delete(
        request: RoutersClient.DeleteRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation {
        let path = try { () throws -> Swift.String in
          guard let pathVariable0 = request.project as Swift.String?, !pathVariable0.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.project' is not set or is empty")
          }
          guard let pathVariable1 = request.region as Swift.String?, !pathVariable1.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.region' is not set or is empty")
          }
          guard let pathVariable2 = request.router as Swift.String?, !pathVariable2.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.router' is not set or is empty")
          }
          return
            "/compute/v1/projects/\(pathVariable0)/regions/\(pathVariable1)/routers/\(pathVariable2)"
        }()
        var query = [
          URLQueryItem(name: "$alt", value: "json")
        ]
        let encoder = GoogleCloudGax.QueryParameterEncoder()
        query.append(contentsOf: try encoder.encode(request.requestId, prefix: "requestId"))
        var req = try await self.inner.Request(path: path, query: query)
        req.httpMethod = "DELETE"
        req.setValue(Clients.clientHeader, forHTTPHeaderField: "X-Goog-Api-Client")
        let (data, _) = try await self.inner.rpc(for: req).get()
        return try GoogleCloudWkt._ProtoJSONDecoder().decode(
          GoogleCloudComputeV1.Operation.self, from: data)
      }

      public func deleteNamedSet(
        request: RoutersClient.DeleteNamedSetRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation {
        let path = try { () throws -> Swift.String in
          guard let pathVariable0 = request.project as Swift.String?, !pathVariable0.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.project' is not set or is empty")
          }
          guard let pathVariable1 = request.region as Swift.String?, !pathVariable1.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.region' is not set or is empty")
          }
          guard let pathVariable2 = request.router as Swift.String?, !pathVariable2.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.router' is not set or is empty")
          }
          return
            "/compute/v1/projects/\(pathVariable0)/regions/\(pathVariable1)/routers/\(pathVariable2)/deleteNamedSet"
        }()
        var query = [
          URLQueryItem(name: "$alt", value: "json")
        ]
        let encoder = GoogleCloudGax.QueryParameterEncoder()
        query.append(contentsOf: try encoder.encode(request.namedSet, prefix: "namedSet"))
        query.append(contentsOf: try encoder.encode(request.requestId, prefix: "requestId"))
        var req = try await self.inner.Request(path: path, query: query)
        req.httpMethod = "POST"
        req.setValue(Clients.clientHeader, forHTTPHeaderField: "X-Goog-Api-Client")
        let (data, _) = try await self.inner.rpc(for: req).get()
        return try GoogleCloudWkt._ProtoJSONDecoder().decode(
          GoogleCloudComputeV1.Operation.self, from: data)
      }

      public func deleteRoutePolicy(
        request: RoutersClient.DeleteRoutePolicyRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation {
        let path = try { () throws -> Swift.String in
          guard let pathVariable0 = request.project as Swift.String?, !pathVariable0.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.project' is not set or is empty")
          }
          guard let pathVariable1 = request.region as Swift.String?, !pathVariable1.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.region' is not set or is empty")
          }
          guard let pathVariable2 = request.router as Swift.String?, !pathVariable2.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.router' is not set or is empty")
          }
          return
            "/compute/v1/projects/\(pathVariable0)/regions/\(pathVariable1)/routers/\(pathVariable2)/deleteRoutePolicy"
        }()
        var query = [
          URLQueryItem(name: "$alt", value: "json")
        ]
        let encoder = GoogleCloudGax.QueryParameterEncoder()
        query.append(contentsOf: try encoder.encode(request.policy, prefix: "policy"))
        query.append(contentsOf: try encoder.encode(request.requestId, prefix: "requestId"))
        var req = try await self.inner.Request(path: path, query: query)
        req.httpMethod = "POST"
        req.setValue(Clients.clientHeader, forHTTPHeaderField: "X-Goog-Api-Client")
        let (data, _) = try await self.inner.rpc(for: req).get()
        return try GoogleCloudWkt._ProtoJSONDecoder().decode(
          GoogleCloudComputeV1.Operation.self, from: data)
      }

      public func `get`(
        request: RoutersClient.GetRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Router {
        let path = try { () throws -> Swift.String in
          guard let pathVariable0 = request.project as Swift.String?, !pathVariable0.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.project' is not set or is empty")
          }
          guard let pathVariable1 = request.region as Swift.String?, !pathVariable1.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.region' is not set or is empty")
          }
          guard let pathVariable2 = request.router as Swift.String?, !pathVariable2.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.router' is not set or is empty")
          }
          return
            "/compute/v1/projects/\(pathVariable0)/regions/\(pathVariable1)/routers/\(pathVariable2)"
        }()
        let query = [
          URLQueryItem(name: "$alt", value: "json")
        ]
        var req = try await self.inner.Request(path: path, query: query)
        req.httpMethod = "GET"
        req.setValue(Clients.clientHeader, forHTTPHeaderField: "X-Goog-Api-Client")
        let (data, _) = try await self.inner.rpc(for: req).get()
        return try GoogleCloudWkt._ProtoJSONDecoder().decode(
          GoogleCloudComputeV1.Router.self, from: data)
      }

      public func getNamedSet(
        request: RoutersClient.GetNamedSetRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.RoutersGetNamedSetResponse {
        let path = try { () throws -> Swift.String in
          guard let pathVariable0 = request.project as Swift.String?, !pathVariable0.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.project' is not set or is empty")
          }
          guard let pathVariable1 = request.region as Swift.String?, !pathVariable1.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.region' is not set or is empty")
          }
          guard let pathVariable2 = request.router as Swift.String?, !pathVariable2.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.router' is not set or is empty")
          }
          return
            "/compute/v1/projects/\(pathVariable0)/regions/\(pathVariable1)/routers/\(pathVariable2)/getNamedSet"
        }()
        var query = [
          URLQueryItem(name: "$alt", value: "json")
        ]
        let encoder = GoogleCloudGax.QueryParameterEncoder()
        query.append(contentsOf: try encoder.encode(request.namedSet, prefix: "namedSet"))
        var req = try await self.inner.Request(path: path, query: query)
        req.httpMethod = "GET"
        req.setValue(Clients.clientHeader, forHTTPHeaderField: "X-Goog-Api-Client")
        let (data, _) = try await self.inner.rpc(for: req).get()
        return try GoogleCloudWkt._ProtoJSONDecoder().decode(
          GoogleCloudComputeV1.RoutersGetNamedSetResponse.self, from: data)
      }

      public func getNatIpInfo(
        request: RoutersClient.GetNatIpInfoRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.NatIpInfoResponse {
        let path = try { () throws -> Swift.String in
          guard let pathVariable0 = request.project as Swift.String?, !pathVariable0.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.project' is not set or is empty")
          }
          guard let pathVariable1 = request.region as Swift.String?, !pathVariable1.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.region' is not set or is empty")
          }
          guard let pathVariable2 = request.router as Swift.String?, !pathVariable2.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.router' is not set or is empty")
          }
          return
            "/compute/v1/projects/\(pathVariable0)/regions/\(pathVariable1)/routers/\(pathVariable2)/getNatIpInfo"
        }()
        var query = [
          URLQueryItem(name: "$alt", value: "json")
        ]
        let encoder = GoogleCloudGax.QueryParameterEncoder()
        query.append(contentsOf: try encoder.encode(request.natName, prefix: "natName"))
        var req = try await self.inner.Request(path: path, query: query)
        req.httpMethod = "GET"
        req.setValue(Clients.clientHeader, forHTTPHeaderField: "X-Goog-Api-Client")
        let (data, _) = try await self.inner.rpc(for: req).get()
        return try GoogleCloudWkt._ProtoJSONDecoder().decode(
          GoogleCloudComputeV1.NatIpInfoResponse.self, from: data)
      }

      public func getNatMappingInfo(
        request: RoutersClient.GetNatMappingInfoRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.VmEndpointNatMappingsList {
        let path = try { () throws -> Swift.String in
          guard let pathVariable0 = request.project as Swift.String?, !pathVariable0.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.project' is not set or is empty")
          }
          guard let pathVariable1 = request.region as Swift.String?, !pathVariable1.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.region' is not set or is empty")
          }
          guard let pathVariable2 = request.router as Swift.String?, !pathVariable2.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.router' is not set or is empty")
          }
          return
            "/compute/v1/projects/\(pathVariable0)/regions/\(pathVariable1)/routers/\(pathVariable2)/getNatMappingInfo"
        }()
        var query = [
          URLQueryItem(name: "$alt", value: "json")
        ]
        let encoder = GoogleCloudGax.QueryParameterEncoder()
        query.append(contentsOf: try encoder.encode(request.filter, prefix: "filter"))
        query.append(contentsOf: try encoder.encode(request.maxResults, prefix: "maxResults"))
        query.append(contentsOf: try encoder.encode(request.natName, prefix: "natName"))
        query.append(contentsOf: try encoder.encode(request.orderBy, prefix: "orderBy"))
        query.append(contentsOf: try encoder.encode(request.pageToken, prefix: "pageToken"))
        query.append(
          contentsOf: try encoder.encode(
            request.returnPartialSuccess, prefix: "returnPartialSuccess"))
        var req = try await self.inner.Request(path: path, query: query)
        req.httpMethod = "GET"
        req.setValue(Clients.clientHeader, forHTTPHeaderField: "X-Goog-Api-Client")
        let (data, _) = try await self.inner.rpc(for: req).get()
        return try GoogleCloudWkt._ProtoJSONDecoder().decode(
          GoogleCloudComputeV1.VmEndpointNatMappingsList.self, from: data)
      }

      public func getRoutePolicy(
        request: RoutersClient.GetRoutePolicyRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.RoutersGetRoutePolicyResponse {
        let path = try { () throws -> Swift.String in
          guard let pathVariable0 = request.project as Swift.String?, !pathVariable0.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.project' is not set or is empty")
          }
          guard let pathVariable1 = request.region as Swift.String?, !pathVariable1.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.region' is not set or is empty")
          }
          guard let pathVariable2 = request.router as Swift.String?, !pathVariable2.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.router' is not set or is empty")
          }
          return
            "/compute/v1/projects/\(pathVariable0)/regions/\(pathVariable1)/routers/\(pathVariable2)/getRoutePolicy"
        }()
        var query = [
          URLQueryItem(name: "$alt", value: "json")
        ]
        let encoder = GoogleCloudGax.QueryParameterEncoder()
        query.append(contentsOf: try encoder.encode(request.policy, prefix: "policy"))
        var req = try await self.inner.Request(path: path, query: query)
        req.httpMethod = "GET"
        req.setValue(Clients.clientHeader, forHTTPHeaderField: "X-Goog-Api-Client")
        let (data, _) = try await self.inner.rpc(for: req).get()
        return try GoogleCloudWkt._ProtoJSONDecoder().decode(
          GoogleCloudComputeV1.RoutersGetRoutePolicyResponse.self, from: data)
      }

      public func getRouterStatus(
        request: RoutersClient.GetRouterStatusRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.RouterStatusResponse {
        let path = try { () throws -> Swift.String in
          guard let pathVariable0 = request.project as Swift.String?, !pathVariable0.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.project' is not set or is empty")
          }
          guard let pathVariable1 = request.region as Swift.String?, !pathVariable1.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.region' is not set or is empty")
          }
          guard let pathVariable2 = request.router as Swift.String?, !pathVariable2.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.router' is not set or is empty")
          }
          return
            "/compute/v1/projects/\(pathVariable0)/regions/\(pathVariable1)/routers/\(pathVariable2)/getRouterStatus"
        }()
        let query = [
          URLQueryItem(name: "$alt", value: "json")
        ]
        var req = try await self.inner.Request(path: path, query: query)
        req.httpMethod = "GET"
        req.setValue(Clients.clientHeader, forHTTPHeaderField: "X-Goog-Api-Client")
        let (data, _) = try await self.inner.rpc(for: req).get()
        return try GoogleCloudWkt._ProtoJSONDecoder().decode(
          GoogleCloudComputeV1.RouterStatusResponse.self, from: data)
      }

      public func insert(
        request: RoutersClient.InsertRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation {
        let path = try { () throws -> Swift.String in
          guard let pathVariable0 = request.project as Swift.String?, !pathVariable0.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.project' is not set or is empty")
          }
          guard let pathVariable1 = request.region as Swift.String?, !pathVariable1.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.region' is not set or is empty")
          }
          return "/compute/v1/projects/\(pathVariable0)/regions/\(pathVariable1)/routers"
        }()
        var query = [
          URLQueryItem(name: "$alt", value: "json")
        ]
        let encoder = GoogleCloudGax.QueryParameterEncoder()
        query.append(contentsOf: try encoder.encode(request.requestId, prefix: "requestId"))
        var req = try await self.inner.Request(path: path, query: query)
        req.httpMethod = "POST"
        req.setValue(Clients.clientHeader, forHTTPHeaderField: "X-Goog-Api-Client")
        if let body = request.body {
          req.setValue("application/json", forHTTPHeaderField: "Content-Type")
          req.httpBody = try JSONEncoder().encode(body)
        }
        let (data, _) = try await self.inner.rpc(for: req).get()
        return try GoogleCloudWkt._ProtoJSONDecoder().decode(
          GoogleCloudComputeV1.Operation.self, from: data)
      }

      public func list(
        request: RoutersClient.ListRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.RouterList {
        let path = try { () throws -> Swift.String in
          guard let pathVariable0 = request.project as Swift.String?, !pathVariable0.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.project' is not set or is empty")
          }
          guard let pathVariable1 = request.region as Swift.String?, !pathVariable1.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.region' is not set or is empty")
          }
          return "/compute/v1/projects/\(pathVariable0)/regions/\(pathVariable1)/routers"
        }()
        var query = [
          URLQueryItem(name: "$alt", value: "json")
        ]
        let encoder = GoogleCloudGax.QueryParameterEncoder()
        query.append(contentsOf: try encoder.encode(request.filter, prefix: "filter"))
        query.append(contentsOf: try encoder.encode(request.maxResults, prefix: "maxResults"))
        query.append(contentsOf: try encoder.encode(request.orderBy, prefix: "orderBy"))
        query.append(contentsOf: try encoder.encode(request.pageToken, prefix: "pageToken"))
        query.append(
          contentsOf: try encoder.encode(
            request.returnPartialSuccess, prefix: "returnPartialSuccess"))
        var req = try await self.inner.Request(path: path, query: query)
        req.httpMethod = "GET"
        req.setValue(Clients.clientHeader, forHTTPHeaderField: "X-Goog-Api-Client")
        let (data, _) = try await self.inner.rpc(for: req).get()
        return try GoogleCloudWkt._ProtoJSONDecoder().decode(
          GoogleCloudComputeV1.RouterList.self, from: data)
      }

      public func listBgpRoutes(
        request: RoutersClient.ListBgpRoutesRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.RoutersListBgpRoutes {
        let path = try { () throws -> Swift.String in
          guard let pathVariable0 = request.project as Swift.String?, !pathVariable0.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.project' is not set or is empty")
          }
          guard let pathVariable1 = request.region as Swift.String?, !pathVariable1.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.region' is not set or is empty")
          }
          guard let pathVariable2 = request.router as Swift.String?, !pathVariable2.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.router' is not set or is empty")
          }
          return
            "/compute/v1/projects/\(pathVariable0)/regions/\(pathVariable1)/routers/\(pathVariable2)/listBgpRoutes"
        }()
        var query = [
          URLQueryItem(name: "$alt", value: "json")
        ]
        let encoder = GoogleCloudGax.QueryParameterEncoder()
        query.append(contentsOf: try encoder.encode(request.addressFamily, prefix: "addressFamily"))
        query.append(
          contentsOf: try encoder.encode(request.destinationPrefix, prefix: "destinationPrefix"))
        query.append(contentsOf: try encoder.encode(request.filter, prefix: "filter"))
        query.append(contentsOf: try encoder.encode(request.maxResults, prefix: "maxResults"))
        query.append(contentsOf: try encoder.encode(request.orderBy, prefix: "orderBy"))
        query.append(contentsOf: try encoder.encode(request.pageToken, prefix: "pageToken"))
        query.append(contentsOf: try encoder.encode(request.peer, prefix: "peer"))
        query.append(contentsOf: try encoder.encode(request.policyApplied, prefix: "policyApplied"))
        query.append(
          contentsOf: try encoder.encode(
            request.returnPartialSuccess, prefix: "returnPartialSuccess"))
        query.append(contentsOf: try encoder.encode(request.routeType, prefix: "routeType"))
        var req = try await self.inner.Request(path: path, query: query)
        req.httpMethod = "GET"
        req.setValue(Clients.clientHeader, forHTTPHeaderField: "X-Goog-Api-Client")
        let (data, _) = try await self.inner.rpc(for: req).get()
        return try GoogleCloudWkt._ProtoJSONDecoder().decode(
          GoogleCloudComputeV1.RoutersListBgpRoutes.self, from: data)
      }

      public func listNamedSets(
        request: RoutersClient.ListNamedSetsRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.RoutersListNamedSets {
        let path = try { () throws -> Swift.String in
          guard let pathVariable0 = request.project as Swift.String?, !pathVariable0.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.project' is not set or is empty")
          }
          guard let pathVariable1 = request.region as Swift.String?, !pathVariable1.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.region' is not set or is empty")
          }
          guard let pathVariable2 = request.router as Swift.String?, !pathVariable2.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.router' is not set or is empty")
          }
          return
            "/compute/v1/projects/\(pathVariable0)/regions/\(pathVariable1)/routers/\(pathVariable2)/listNamedSets"
        }()
        var query = [
          URLQueryItem(name: "$alt", value: "json")
        ]
        let encoder = GoogleCloudGax.QueryParameterEncoder()
        query.append(contentsOf: try encoder.encode(request.filter, prefix: "filter"))
        query.append(contentsOf: try encoder.encode(request.maxResults, prefix: "maxResults"))
        query.append(contentsOf: try encoder.encode(request.orderBy, prefix: "orderBy"))
        query.append(contentsOf: try encoder.encode(request.pageToken, prefix: "pageToken"))
        query.append(
          contentsOf: try encoder.encode(
            request.returnPartialSuccess, prefix: "returnPartialSuccess"))
        var req = try await self.inner.Request(path: path, query: query)
        req.httpMethod = "GET"
        req.setValue(Clients.clientHeader, forHTTPHeaderField: "X-Goog-Api-Client")
        let (data, _) = try await self.inner.rpc(for: req).get()
        return try GoogleCloudWkt._ProtoJSONDecoder().decode(
          GoogleCloudComputeV1.RoutersListNamedSets.self, from: data)
      }

      public func listRoutePolicies(
        request: RoutersClient.ListRoutePoliciesRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.RoutersListRoutePolicies {
        let path = try { () throws -> Swift.String in
          guard let pathVariable0 = request.project as Swift.String?, !pathVariable0.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.project' is not set or is empty")
          }
          guard let pathVariable1 = request.region as Swift.String?, !pathVariable1.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.region' is not set or is empty")
          }
          guard let pathVariable2 = request.router as Swift.String?, !pathVariable2.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.router' is not set or is empty")
          }
          return
            "/compute/v1/projects/\(pathVariable0)/regions/\(pathVariable1)/routers/\(pathVariable2)/listRoutePolicies"
        }()
        var query = [
          URLQueryItem(name: "$alt", value: "json")
        ]
        let encoder = GoogleCloudGax.QueryParameterEncoder()
        query.append(contentsOf: try encoder.encode(request.filter, prefix: "filter"))
        query.append(contentsOf: try encoder.encode(request.maxResults, prefix: "maxResults"))
        query.append(contentsOf: try encoder.encode(request.orderBy, prefix: "orderBy"))
        query.append(contentsOf: try encoder.encode(request.pageToken, prefix: "pageToken"))
        query.append(
          contentsOf: try encoder.encode(
            request.returnPartialSuccess, prefix: "returnPartialSuccess"))
        var req = try await self.inner.Request(path: path, query: query)
        req.httpMethod = "GET"
        req.setValue(Clients.clientHeader, forHTTPHeaderField: "X-Goog-Api-Client")
        let (data, _) = try await self.inner.rpc(for: req).get()
        return try GoogleCloudWkt._ProtoJSONDecoder().decode(
          GoogleCloudComputeV1.RoutersListRoutePolicies.self, from: data)
      }

      public func patch(
        request: RoutersClient.PatchRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation {
        let path = try { () throws -> Swift.String in
          guard let pathVariable0 = request.project as Swift.String?, !pathVariable0.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.project' is not set or is empty")
          }
          guard let pathVariable1 = request.region as Swift.String?, !pathVariable1.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.region' is not set or is empty")
          }
          guard let pathVariable2 = request.router as Swift.String?, !pathVariable2.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.router' is not set or is empty")
          }
          return
            "/compute/v1/projects/\(pathVariable0)/regions/\(pathVariable1)/routers/\(pathVariable2)"
        }()
        var query = [
          URLQueryItem(name: "$alt", value: "json")
        ]
        let encoder = GoogleCloudGax.QueryParameterEncoder()
        query.append(contentsOf: try encoder.encode(request.requestId, prefix: "requestId"))
        var req = try await self.inner.Request(path: path, query: query)
        req.httpMethod = "PATCH"
        req.setValue(Clients.clientHeader, forHTTPHeaderField: "X-Goog-Api-Client")
        if let body = request.body {
          req.setValue("application/json", forHTTPHeaderField: "Content-Type")
          req.httpBody = try JSONEncoder().encode(body)
        }
        let (data, _) = try await self.inner.rpc(for: req).get()
        return try GoogleCloudWkt._ProtoJSONDecoder().decode(
          GoogleCloudComputeV1.Operation.self, from: data)
      }

      public func patchNamedSet(
        request: RoutersClient.PatchNamedSetRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation {
        let path = try { () throws -> Swift.String in
          guard let pathVariable0 = request.project as Swift.String?, !pathVariable0.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.project' is not set or is empty")
          }
          guard let pathVariable1 = request.region as Swift.String?, !pathVariable1.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.region' is not set or is empty")
          }
          guard let pathVariable2 = request.router as Swift.String?, !pathVariable2.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.router' is not set or is empty")
          }
          return
            "/compute/v1/projects/\(pathVariable0)/regions/\(pathVariable1)/routers/\(pathVariable2)/patchNamedSet"
        }()
        var query = [
          URLQueryItem(name: "$alt", value: "json")
        ]
        let encoder = GoogleCloudGax.QueryParameterEncoder()
        query.append(contentsOf: try encoder.encode(request.requestId, prefix: "requestId"))
        var req = try await self.inner.Request(path: path, query: query)
        req.httpMethod = "POST"
        req.setValue(Clients.clientHeader, forHTTPHeaderField: "X-Goog-Api-Client")
        if let body = request.body {
          req.setValue("application/json", forHTTPHeaderField: "Content-Type")
          req.httpBody = try JSONEncoder().encode(body)
        }
        let (data, _) = try await self.inner.rpc(for: req).get()
        return try GoogleCloudWkt._ProtoJSONDecoder().decode(
          GoogleCloudComputeV1.Operation.self, from: data)
      }

      public func patchRoutePolicy(
        request: RoutersClient.PatchRoutePolicyRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation {
        let path = try { () throws -> Swift.String in
          guard let pathVariable0 = request.project as Swift.String?, !pathVariable0.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.project' is not set or is empty")
          }
          guard let pathVariable1 = request.region as Swift.String?, !pathVariable1.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.region' is not set or is empty")
          }
          guard let pathVariable2 = request.router as Swift.String?, !pathVariable2.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.router' is not set or is empty")
          }
          return
            "/compute/v1/projects/\(pathVariable0)/regions/\(pathVariable1)/routers/\(pathVariable2)/patchRoutePolicy"
        }()
        var query = [
          URLQueryItem(name: "$alt", value: "json")
        ]
        let encoder = GoogleCloudGax.QueryParameterEncoder()
        query.append(contentsOf: try encoder.encode(request.requestId, prefix: "requestId"))
        var req = try await self.inner.Request(path: path, query: query)
        req.httpMethod = "POST"
        req.setValue(Clients.clientHeader, forHTTPHeaderField: "X-Goog-Api-Client")
        if let body = request.body {
          req.setValue("application/json", forHTTPHeaderField: "Content-Type")
          req.httpBody = try JSONEncoder().encode(body)
        }
        let (data, _) = try await self.inner.rpc(for: req).get()
        return try GoogleCloudWkt._ProtoJSONDecoder().decode(
          GoogleCloudComputeV1.Operation.self, from: data)
      }

      public func preview(
        request: RoutersClient.PreviewRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.RoutersPreviewResponse {
        let path = try { () throws -> Swift.String in
          guard let pathVariable0 = request.project as Swift.String?, !pathVariable0.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.project' is not set or is empty")
          }
          guard let pathVariable1 = request.region as Swift.String?, !pathVariable1.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.region' is not set or is empty")
          }
          guard let pathVariable2 = request.router as Swift.String?, !pathVariable2.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.router' is not set or is empty")
          }
          return
            "/compute/v1/projects/\(pathVariable0)/regions/\(pathVariable1)/routers/\(pathVariable2)/preview"
        }()
        let query = [
          URLQueryItem(name: "$alt", value: "json")
        ]
        var req = try await self.inner.Request(path: path, query: query)
        req.httpMethod = "POST"
        req.setValue(Clients.clientHeader, forHTTPHeaderField: "X-Goog-Api-Client")
        if let body = request.body {
          req.setValue("application/json", forHTTPHeaderField: "Content-Type")
          req.httpBody = try JSONEncoder().encode(body)
        }
        let (data, _) = try await self.inner.rpc(for: req).get()
        return try GoogleCloudWkt._ProtoJSONDecoder().decode(
          GoogleCloudComputeV1.RoutersPreviewResponse.self, from: data)
      }

      public func update(
        request: RoutersClient.UpdateRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation {
        let path = try { () throws -> Swift.String in
          guard let pathVariable0 = request.project as Swift.String?, !pathVariable0.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.project' is not set or is empty")
          }
          guard let pathVariable1 = request.region as Swift.String?, !pathVariable1.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.region' is not set or is empty")
          }
          guard let pathVariable2 = request.router as Swift.String?, !pathVariable2.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.router' is not set or is empty")
          }
          return
            "/compute/v1/projects/\(pathVariable0)/regions/\(pathVariable1)/routers/\(pathVariable2)"
        }()
        var query = [
          URLQueryItem(name: "$alt", value: "json")
        ]
        let encoder = GoogleCloudGax.QueryParameterEncoder()
        query.append(contentsOf: try encoder.encode(request.requestId, prefix: "requestId"))
        var req = try await self.inner.Request(path: path, query: query)
        req.httpMethod = "PUT"
        req.setValue(Clients.clientHeader, forHTTPHeaderField: "X-Goog-Api-Client")
        if let body = request.body {
          req.setValue("application/json", forHTTPHeaderField: "Content-Type")
          req.httpBody = try JSONEncoder().encode(body)
        }
        let (data, _) = try await self.inner.rpc(for: req).get()
        return try GoogleCloudWkt._ProtoJSONDecoder().decode(
          GoogleCloudComputeV1.Operation.self, from: data)
      }

      public func updateNamedSet(
        request: RoutersClient.UpdateNamedSetRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation {
        let path = try { () throws -> Swift.String in
          guard let pathVariable0 = request.project as Swift.String?, !pathVariable0.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.project' is not set or is empty")
          }
          guard let pathVariable1 = request.region as Swift.String?, !pathVariable1.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.region' is not set or is empty")
          }
          guard let pathVariable2 = request.router as Swift.String?, !pathVariable2.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.router' is not set or is empty")
          }
          return
            "/compute/v1/projects/\(pathVariable0)/regions/\(pathVariable1)/routers/\(pathVariable2)/updateNamedSet"
        }()
        var query = [
          URLQueryItem(name: "$alt", value: "json")
        ]
        let encoder = GoogleCloudGax.QueryParameterEncoder()
        query.append(contentsOf: try encoder.encode(request.requestId, prefix: "requestId"))
        var req = try await self.inner.Request(path: path, query: query)
        req.httpMethod = "POST"
        req.setValue(Clients.clientHeader, forHTTPHeaderField: "X-Goog-Api-Client")
        if let body = request.body {
          req.setValue("application/json", forHTTPHeaderField: "Content-Type")
          req.httpBody = try JSONEncoder().encode(body)
        }
        let (data, _) = try await self.inner.rpc(for: req).get()
        return try GoogleCloudWkt._ProtoJSONDecoder().decode(
          GoogleCloudComputeV1.Operation.self, from: data)
      }

      public func updateRoutePolicy(
        request: RoutersClient.UpdateRoutePolicyRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation {
        let path = try { () throws -> Swift.String in
          guard let pathVariable0 = request.project as Swift.String?, !pathVariable0.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.project' is not set or is empty")
          }
          guard let pathVariable1 = request.region as Swift.String?, !pathVariable1.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.region' is not set or is empty")
          }
          guard let pathVariable2 = request.router as Swift.String?, !pathVariable2.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.router' is not set or is empty")
          }
          return
            "/compute/v1/projects/\(pathVariable0)/regions/\(pathVariable1)/routers/\(pathVariable2)/updateRoutePolicy"
        }()
        var query = [
          URLQueryItem(name: "$alt", value: "json")
        ]
        let encoder = GoogleCloudGax.QueryParameterEncoder()
        query.append(contentsOf: try encoder.encode(request.requestId, prefix: "requestId"))
        var req = try await self.inner.Request(path: path, query: query)
        req.httpMethod = "POST"
        req.setValue(Clients.clientHeader, forHTTPHeaderField: "X-Goog-Api-Client")
        if let body = request.body {
          req.setValue("application/json", forHTTPHeaderField: "Content-Type")
          req.httpBody = try JSONEncoder().encode(body)
        }
        let (data, _) = try await self.inner.rpc(for: req).get()
        return try GoogleCloudWkt._ProtoJSONDecoder().decode(
          GoogleCloudComputeV1.Operation.self, from: data)
      }

      public func getOperation(
        request: RegionOperationsClient.GetRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation {
        let path = try { () throws -> Swift.String in
          guard let pathVariable0 = request.project as Swift.String?, !pathVariable0.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.project' is not set or is empty")
          }
          guard let pathVariable1 = request.region as Swift.String?, !pathVariable1.isEmpty else {
            throw GoogleCloudGax.RequestError.binding("'request.region' is not set or is empty")
          }
          guard let pathVariable2 = request.operation as Swift.String?, !pathVariable2.isEmpty
          else {
            throw GoogleCloudGax.RequestError.binding("'request.operation' is not set or is empty")
          }
          return
            "/compute/v1/projects/\(pathVariable0)/regions/\(pathVariable1)/operations/\(pathVariable2)"
        }()
        let query = [
          URLQueryItem(name: "$alt", value: "json")
        ]
        var req = try await self.inner.Request(path: path, query: query)
        req.httpMethod = "GET"
        req.setValue(Clients.clientHeader, forHTTPHeaderField: "X-Goog-Api-Client")
        let (data, _) = try await self.inner.rpc(for: req).get()
        return try GoogleCloudWkt._ProtoJSONDecoder().decode(
          GoogleCloudComputeV1.Operation.self, from: data)
      }
    }
  }
#endif
