// 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 Projects
  import Foundation
  #if canImport(FoundationNetworking)
    import FoundationNetworking
  #endif
  import GoogleCloudWkt
  import GoogleCloudGax

  extension Clients {
    protocol ProjectsStub {
      func disableXpnHost(
        request: ProjectsClient.DisableXpnHostRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation

      func disableXpnResource(
        request: ProjectsClient.DisableXpnResourceRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation

      func enableXpnHost(
        request: ProjectsClient.EnableXpnHostRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation

      func enableXpnResource(
        request: ProjectsClient.EnableXpnResourceRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation

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

      func getXpnHost(
        request: ProjectsClient.GetXpnHostRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Project

      func getXpnResources(
        request: ProjectsClient.GetXpnResourcesRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.ProjectsGetXpnResources

      func listXpnHosts(
        request: ProjectsClient.ListXpnHostsRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.XpnHostList

      func moveDisk(
        request: ProjectsClient.MoveDiskRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation

      func moveInstance(
        request: ProjectsClient.MoveInstanceRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation

      func setCloudArmorTier(
        request: ProjectsClient.SetCloudArmorTierRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation

      func setCommonInstanceMetadata(
        request: ProjectsClient.SetCommonInstanceMetadataRequest,
        options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation

      func setDefaultNetworkTier(
        request: ProjectsClient.SetDefaultNetworkTierRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation

      func setUsageExportBucket(
        request: ProjectsClient.SetUsageExportBucketRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation

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

    class ProjectsTransport: ProjectsStub {
      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 disableXpnHost(
        request: ProjectsClient.DisableXpnHostRequest, 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")
          }
          return "/compute/v1/projects/\(pathVariable0)/disableXpnHost"
        }()
        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")
        let (data, _) = try await self.inner.rpc(for: req).get()
        return try GoogleCloudWkt._ProtoJSONDecoder().decode(
          GoogleCloudComputeV1.Operation.self, from: data)
      }

      public func disableXpnResource(
        request: ProjectsClient.DisableXpnResourceRequest, 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")
          }
          return "/compute/v1/projects/\(pathVariable0)/disableXpnResource"
        }()
        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 enableXpnHost(
        request: ProjectsClient.EnableXpnHostRequest, 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")
          }
          return "/compute/v1/projects/\(pathVariable0)/enableXpnHost"
        }()
        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")
        let (data, _) = try await self.inner.rpc(for: req).get()
        return try GoogleCloudWkt._ProtoJSONDecoder().decode(
          GoogleCloudComputeV1.Operation.self, from: data)
      }

      public func enableXpnResource(
        request: ProjectsClient.EnableXpnResourceRequest, 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")
          }
          return "/compute/v1/projects/\(pathVariable0)/enableXpnResource"
        }()
        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 `get`(
        request: ProjectsClient.GetRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Project {
        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)"
        }()
        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.Project.self, from: data)
      }

      public func getXpnHost(
        request: ProjectsClient.GetXpnHostRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Project {
        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)/getXpnHost"
        }()
        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.Project.self, from: data)
      }

      public func getXpnResources(
        request: ProjectsClient.GetXpnResourcesRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.ProjectsGetXpnResources {
        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)/getXpnResources"
        }()
        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.ProjectsGetXpnResources.self, from: data)
      }

      public func listXpnHosts(
        request: ProjectsClient.ListXpnHostsRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.XpnHostList {
        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)/listXpnHosts"
        }()
        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 = "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.XpnHostList.self, from: data)
      }

      public func moveDisk(
        request: ProjectsClient.MoveDiskRequest, 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")
          }
          return "/compute/v1/projects/\(pathVariable0)/moveDisk"
        }()
        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 moveInstance(
        request: ProjectsClient.MoveInstanceRequest, 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")
          }
          return "/compute/v1/projects/\(pathVariable0)/moveInstance"
        }()
        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 setCloudArmorTier(
        request: ProjectsClient.SetCloudArmorTierRequest, 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")
          }
          return "/compute/v1/projects/\(pathVariable0)/setCloudArmorTier"
        }()
        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 setCommonInstanceMetadata(
        request: ProjectsClient.SetCommonInstanceMetadataRequest,
        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")
          }
          return "/compute/v1/projects/\(pathVariable0)/setCommonInstanceMetadata"
        }()
        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 setDefaultNetworkTier(
        request: ProjectsClient.SetDefaultNetworkTierRequest, 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")
          }
          return "/compute/v1/projects/\(pathVariable0)/setDefaultNetworkTier"
        }()
        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 setUsageExportBucket(
        request: ProjectsClient.SetUsageExportBucketRequest, 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")
          }
          return "/compute/v1/projects/\(pathVariable0)/setUsageExportBucket"
        }()
        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: GlobalOperationsClient.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.operation as Swift.String?, !pathVariable1.isEmpty
          else {
            throw GoogleCloudGax.RequestError.binding("'request.operation' is not set or is empty")
          }
          return "/compute/v1/projects/\(pathVariable0)/global/operations/\(pathVariable1)"
        }()
        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
