// 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.

import Foundation
#if canImport(FoundationNetworking)
  import FoundationNetworking
#endif
import GoogleCloudLocation
import GoogleCloudWkt
import GoogleLongRunning
import GoogleRpc
import GoogleCloudGax

/// Service describing handlers for resources
///
/// @Snippet(path: "HypercomputeClusterQuickstart")
public class HypercomputeClusterClient: Clients.HypercomputeClusterProtocol {
  let inner: any Clients.HypercomputeClusterStub
  let pollingErrorPolicy: GoogleCloudGax.PollingErrorPolicy
  let pollingBackoffPolicy: GoogleCloudGax.BackoffPolicy

  /// Creates a new `HypercomputeClusterClient` instance.
  public init(_ options: GoogleCloudGax.ClientOptions = .init()) throws {
    var inner: any Clients.HypercomputeClusterStub = try Clients.HypercomputeClusterTransport(
      options)
    inner = Clients.HypercomputeClusterRetry(inner, options: options)
    if let logger = options.logger {
      inner = Clients.HypercomputeClusterLogging(inner, logger: logger)
    }
    self.inner = inner
    self.pollingErrorPolicy = options.pollingErrorPolicy
    self.pollingBackoffPolicy = options.pollingBackoffPolicy
  }

  /// Lists Clusters in a given project and location.
  ///
  /// @Snippet(path: "HypercomputeCluster_ListClusters")
  public func listClusters(
    request: ListClustersRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleCloudHypercomputeClusterV1.ListClustersResponse {
    try await self.inner.listClusters(request: request, options: options)
  }

  /// Lists Clusters in a given project and location.
  ///
  /// @Snippet(path: "HypercomputeCluster_ListClusters")
  public func listClusters(
    byItem: ListClustersRequest, options: GoogleCloudGax.RequestOptions
  ) throws -> any AsyncSequence<Cluster, Swift.Error> {
    let listRpc = {
      (token: Swift.String) async throws -> GoogleCloudHypercomputeClusterV1.ListClustersResponse in
      var request = byItem
      request.pageToken = token
      return try await self.listClusters(request: request, options: options)
    }
    return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
  }

  /// Gets details of a single Cluster.
  ///
  /// @Snippet(path: "HypercomputeCluster_GetCluster")
  public func getCluster(
    request: GetClusterRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleCloudHypercomputeClusterV1.Cluster {
    try await self.inner.getCluster(request: request, options: options)
  }

  /// Creates a new Cluster in a given project and location.
  ///
  /// @Snippet(path: "HypercomputeCluster_CreateCluster")
  public func createCluster(
    request: CreateClusterRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleLongRunning.Operation {
    try await self.inner.createCluster(request: request, options: options)
  }

  /// Creates a new Cluster in a given project and location.
  ///
  /// @Snippet(path: "HypercomputeCluster_CreateCluster")
  public func createCluster(
    withPolling: CreateClusterRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> any GoogleCloudGax.PollableOperation<Cluster> {
    let extractStatus = {
      (op: GoogleLongRunning.Operation) throws
        -> GoogleCloudGax._PollableOperationImpl<Cluster>.State in
      guard op.done else {
        return .init(done: false, result: nil)
      }

      switch op.result {
      case .response(let anyValue):
        guard let anyValueUnwrapped = anyValue else {
          return .init(
            done: true,
            result: .failure(
              GoogleCloudGax.RequestError.binding(
                "Operation completed but response value was missing")))
        }
        let response = try Cluster(fromAny: anyValueUnwrapped)
        return .init(done: true, result: .success(response))
      case .error(let status):
        guard let statusUnwrapped = status else {
          return .init(
            done: true,
            result: .failure(
              GoogleCloudGax.RequestError.binding("Operation completed but error value was missing")
            ))
        }
        let error = GoogleCloudGax.RequestError.service(
          GoogleCloudGax.ServiceError(
            code: GoogleRpc.Code(intValue: Int(statusUnwrapped.code)),
            message: statusUnwrapped.message))
        return .init(done: true, result: .failure(error))
      case .none:
        return .init(
          done: true,
          result: .failure(
            GoogleCloudGax.RequestError.binding("Operation completed but result was missing")))
      }
    }
    let rawOp = try await self.createCluster(request: withPolling, options: options)
    let initialState = try extractStatus(rawOp)
    let poll = { () async throws -> GoogleCloudGax._PollableOperationImpl<Cluster>.State in
      let op = try await self.getOperation(
        request: .init().with { $0.name = rawOp.name }, options: options)
      return try extractStatus(op)
    }
    return GoogleCloudGax._PollableOperationImpl(
      initialState: initialState,
      polling: options.pollingErrorPolicy ?? self.pollingErrorPolicy,
      backoff: options.pollingBackoffPolicy ?? self.pollingBackoffPolicy,
      poll: poll,
    )
  }

  /// Updates the parameters of a single Cluster.
  ///
  /// @Snippet(path: "HypercomputeCluster_UpdateCluster")
  public func updateCluster(
    request: UpdateClusterRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleLongRunning.Operation {
    try await self.inner.updateCluster(request: request, options: options)
  }

  /// Updates the parameters of a single Cluster.
  ///
  /// @Snippet(path: "HypercomputeCluster_UpdateCluster")
  public func updateCluster(
    withPolling: UpdateClusterRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> any GoogleCloudGax.PollableOperation<Cluster> {
    let extractStatus = {
      (op: GoogleLongRunning.Operation) throws
        -> GoogleCloudGax._PollableOperationImpl<Cluster>.State in
      guard op.done else {
        return .init(done: false, result: nil)
      }

      switch op.result {
      case .response(let anyValue):
        guard let anyValueUnwrapped = anyValue else {
          return .init(
            done: true,
            result: .failure(
              GoogleCloudGax.RequestError.binding(
                "Operation completed but response value was missing")))
        }
        let response = try Cluster(fromAny: anyValueUnwrapped)
        return .init(done: true, result: .success(response))
      case .error(let status):
        guard let statusUnwrapped = status else {
          return .init(
            done: true,
            result: .failure(
              GoogleCloudGax.RequestError.binding("Operation completed but error value was missing")
            ))
        }
        let error = GoogleCloudGax.RequestError.service(
          GoogleCloudGax.ServiceError(
            code: GoogleRpc.Code(intValue: Int(statusUnwrapped.code)),
            message: statusUnwrapped.message))
        return .init(done: true, result: .failure(error))
      case .none:
        return .init(
          done: true,
          result: .failure(
            GoogleCloudGax.RequestError.binding("Operation completed but result was missing")))
      }
    }
    let rawOp = try await self.updateCluster(request: withPolling, options: options)
    let initialState = try extractStatus(rawOp)
    let poll = { () async throws -> GoogleCloudGax._PollableOperationImpl<Cluster>.State in
      let op = try await self.getOperation(
        request: .init().with { $0.name = rawOp.name }, options: options)
      return try extractStatus(op)
    }
    return GoogleCloudGax._PollableOperationImpl(
      initialState: initialState,
      polling: options.pollingErrorPolicy ?? self.pollingErrorPolicy,
      backoff: options.pollingBackoffPolicy ?? self.pollingBackoffPolicy,
      poll: poll,
    )
  }

  /// Deletes a single Cluster.
  ///
  /// @Snippet(path: "HypercomputeCluster_DeleteCluster")
  public func deleteCluster(
    request: DeleteClusterRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleLongRunning.Operation {
    try await self.inner.deleteCluster(request: request, options: options)
  }

  /// Deletes a single Cluster.
  ///
  /// @Snippet(path: "HypercomputeCluster_DeleteCluster")
  public func deleteCluster(
    withPolling: DeleteClusterRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> any GoogleCloudGax.PollableOperation<Void> {
    let extractStatus = {
      (op: GoogleLongRunning.Operation) throws -> GoogleCloudGax._PollableOperationImpl<Void>.State
      in
      guard op.done else {
        return .init(done: false, result: nil)
      }

      switch op.result {
      case .response:
        return .init(done: true, result: .success(()))
      case .error(let status):
        guard let statusUnwrapped = status else {
          return .init(
            done: true,
            result: .failure(
              GoogleCloudGax.RequestError.binding("Operation completed but error value was missing")
            ))
        }
        let error = GoogleCloudGax.RequestError.service(
          GoogleCloudGax.ServiceError(
            code: GoogleRpc.Code(intValue: Int(statusUnwrapped.code)),
            message: statusUnwrapped.message))
        return .init(done: true, result: .failure(error))
      case .none:
        return .init(
          done: true,
          result: .failure(
            GoogleCloudGax.RequestError.binding("Operation completed but result was missing")))
      }
    }
    let rawOp = try await self.deleteCluster(request: withPolling, options: options)
    let initialState = try extractStatus(rawOp)
    let poll = { () async throws -> GoogleCloudGax._PollableOperationImpl<Void>.State in
      let op = try await self.getOperation(
        request: .init().with { $0.name = rawOp.name }, options: options)
      return try extractStatus(op)
    }
    return GoogleCloudGax._PollableOperationImpl(
      initialState: initialState,
      polling: options.pollingErrorPolicy ?? self.pollingErrorPolicy,
      backoff: options.pollingBackoffPolicy ?? self.pollingBackoffPolicy,
      poll: poll,
    )
  }

  /// Lists information about the supported locations for this service.
  /// This method can be called in two ways:
  ///
  /// *   **List all public locations:** Use the path `GET /v1/locations`.
  /// *   **List project-visible locations:** Use the path
  /// `GET /v1/projects/{project_id}/locations`. This may include public
  /// locations as well as private or other locations specifically visible
  /// to the project.
  ///
  /// @Snippet(path: "HypercomputeCluster_ListLocations")
  public func listLocations(
    request: GoogleCloudLocation.ListLocationsRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleCloudLocation.ListLocationsResponse {
    try await self.inner.listLocations(request: request, options: options)
  }

  /// Lists information about the supported locations for this service.
  /// This method can be called in two ways:
  ///
  /// *   **List all public locations:** Use the path `GET /v1/locations`.
  /// *   **List project-visible locations:** Use the path
  /// `GET /v1/projects/{project_id}/locations`. This may include public
  /// locations as well as private or other locations specifically visible
  /// to the project.
  ///
  /// @Snippet(path: "HypercomputeCluster_ListLocations")
  public func listLocations(
    byItem: GoogleCloudLocation.ListLocationsRequest, options: GoogleCloudGax.RequestOptions
  ) throws -> any AsyncSequence<GoogleCloudLocation.Location, Swift.Error> {
    let listRpc = {
      (token: Swift.String) async throws -> GoogleCloudLocation.ListLocationsResponse in
      var request = byItem
      request.pageToken = token
      return try await self.listLocations(request: request, options: options)
    }
    return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
  }

  /// Gets information about a location.
  ///
  /// @Snippet(path: "HypercomputeCluster_GetLocation")
  public func getLocation(
    request: GoogleCloudLocation.GetLocationRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleCloudLocation.Location {
    try await self.inner.getLocation(request: request, options: options)
  }

  /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
  ///
  /// [google.longrunning.Operations]: https://www.google.com/search?q=Swift+google.longrunning+Operations
  ///
  /// @Snippet(path: "HypercomputeCluster_ListOperations")
  public func listOperations(
    request: GoogleLongRunning.ListOperationsRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleLongRunning.ListOperationsResponse {
    try await self.inner.listOperations(request: request, options: options)
  }

  /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
  ///
  /// [google.longrunning.Operations]: https://www.google.com/search?q=Swift+google.longrunning+Operations
  ///
  /// @Snippet(path: "HypercomputeCluster_ListOperations")
  public func listOperations(
    byItem: GoogleLongRunning.ListOperationsRequest, options: GoogleCloudGax.RequestOptions
  ) throws -> any AsyncSequence<GoogleLongRunning.Operation, Swift.Error> {
    let listRpc = {
      (token: Swift.String) async throws -> GoogleLongRunning.ListOperationsResponse in
      var request = byItem
      request.pageToken = token
      return try await self.listOperations(request: request, options: options)
    }
    return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
  }

  /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
  ///
  /// [google.longrunning.Operations]: https://www.google.com/search?q=Swift+google.longrunning+Operations
  ///
  /// @Snippet(path: "HypercomputeCluster_GetOperation")
  func getOperation(
    request: GoogleLongRunning.GetOperationRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleLongRunning.Operation {
    try await self.inner.getOperation(request: request, options: options)
  }

  /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
  ///
  /// [google.longrunning.Operations]: https://www.google.com/search?q=Swift+google.longrunning+Operations
  ///
  /// @Snippet(path: "HypercomputeCluster_DeleteOperation")
  public func deleteOperation(
    request: GoogleLongRunning.DeleteOperationRequest, options: GoogleCloudGax.RequestOptions
  ) async throws {
    try await self.inner.deleteOperation(request: request, options: options)
  }

  /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
  ///
  /// [google.longrunning.Operations]: https://www.google.com/search?q=Swift+google.longrunning+Operations
  ///
  /// @Snippet(path: "HypercomputeCluster_CancelOperation")
  public func cancelOperation(
    request: GoogleLongRunning.CancelOperationRequest, options: GoogleCloudGax.RequestOptions
  ) async throws {
    try await self.inner.cancelOperation(request: request, options: options)
  }
}

extension Clients {
  /// A Swift protocol to mock `HypercomputeClusterClient`.
  ///
  /// To mock `HypercomputeClusterClient` change your functions to receive
  /// `some HypercomputeClusterProtocol` or `any HypercomputeClusterProtocol`
  /// and pass a mock implementation in your tests.
  public protocol HypercomputeClusterProtocol {
    /// See `HypercomputeClusterClient.listClusters`.
    func listClusters(request: ListClustersRequest) async throws
      -> GoogleCloudHypercomputeClusterV1.ListClustersResponse

    /// See `HypercomputeClusterClient.listClusters`.
    func listClusters(
      byItem: ListClustersRequest
    ) throws -> any AsyncSequence<Cluster, Swift.Error>

    /// See `HypercomputeClusterClient.listClusters`.
    func listClusters(
      parent: Swift.String,
    ) throws -> any AsyncSequence<Cluster, Swift.Error>

    /// See `HypercomputeClusterClient.getCluster`.
    func getCluster(request: GetClusterRequest) async throws
      -> GoogleCloudHypercomputeClusterV1.Cluster

    /// See `HypercomputeClusterClient.getCluster`.
    func getCluster(
      name: Swift.String,
    ) async throws -> GoogleCloudHypercomputeClusterV1.Cluster

    /// See `HypercomputeClusterClient.createCluster`.
    func createCluster(request: CreateClusterRequest) async throws -> GoogleLongRunning.Operation

    /// See `HypercomputeClusterClient.createCluster`.
    func createCluster(withPolling: CreateClusterRequest) async throws -> any GoogleCloudGax
      .PollableOperation<Cluster>

    /// See `HypercomputeClusterClient.createCluster`.
    func createCluster(
      parent: Swift.String,
      cluster: Cluster?,
      clusterId: Swift.String,
    ) async throws -> any GoogleCloudGax.PollableOperation<Cluster>

    /// See `HypercomputeClusterClient.updateCluster`.
    func updateCluster(request: UpdateClusterRequest) async throws -> GoogleLongRunning.Operation

    /// See `HypercomputeClusterClient.updateCluster`.
    func updateCluster(withPolling: UpdateClusterRequest) async throws -> any GoogleCloudGax
      .PollableOperation<Cluster>

    /// See `HypercomputeClusterClient.updateCluster`.
    func updateCluster(
      cluster: Cluster?,
      updateMask: GoogleCloudWkt.FieldMask?,
    ) async throws -> any GoogleCloudGax.PollableOperation<Cluster>

    /// See `HypercomputeClusterClient.deleteCluster`.
    func deleteCluster(request: DeleteClusterRequest) async throws -> GoogleLongRunning.Operation

    /// See `HypercomputeClusterClient.deleteCluster`.
    func deleteCluster(withPolling: DeleteClusterRequest) async throws -> any GoogleCloudGax
      .PollableOperation<Void>

    /// See `HypercomputeClusterClient.deleteCluster`.
    func deleteCluster(
      name: Swift.String,
    ) async throws -> any GoogleCloudGax.PollableOperation<Void>

    /// See `HypercomputeClusterClient.listLocations`.
    func listLocations(request: GoogleCloudLocation.ListLocationsRequest) async throws
      -> GoogleCloudLocation.ListLocationsResponse

    /// See `HypercomputeClusterClient.listLocations`.
    func listLocations(
      byItem: GoogleCloudLocation.ListLocationsRequest
    ) throws -> any AsyncSequence<GoogleCloudLocation.Location, Swift.Error>

    /// See `HypercomputeClusterClient.getLocation`.
    func getLocation(request: GoogleCloudLocation.GetLocationRequest) async throws
      -> GoogleCloudLocation.Location

    /// See `HypercomputeClusterClient.listOperations`.
    func listOperations(request: GoogleLongRunning.ListOperationsRequest) async throws
      -> GoogleLongRunning.ListOperationsResponse

    /// See `HypercomputeClusterClient.listOperations`.
    func listOperations(
      byItem: GoogleLongRunning.ListOperationsRequest
    ) throws -> any AsyncSequence<GoogleLongRunning.Operation, Swift.Error>

    /// See `HypercomputeClusterClient.listOperations`.
    func listOperations(
      name: Swift.String,
      filter: Swift.String,
    ) throws -> any AsyncSequence<GoogleLongRunning.Operation, Swift.Error>

    /// See `HypercomputeClusterClient.deleteOperation`.
    func deleteOperation(request: GoogleLongRunning.DeleteOperationRequest) async throws

    /// See `HypercomputeClusterClient.deleteOperation`.
    func deleteOperation(
      name: Swift.String,
    ) async throws

    /// See `HypercomputeClusterClient.cancelOperation`.
    func cancelOperation(request: GoogleLongRunning.CancelOperationRequest) async throws

    /// See `HypercomputeClusterClient.cancelOperation`.
    func cancelOperation(
      name: Swift.String,
    ) async throws

    /// See `HypercomputeClusterClient.listClusters`.
    func listClusters(
      request: ListClustersRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudHypercomputeClusterV1.ListClustersResponse

    /// See `HypercomputeClusterClient.listClusters`.
    func listClusters(
      byItem: ListClustersRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<Cluster, Swift.Error>

    /// See `HypercomputeClusterClient.getCluster`.
    func getCluster(
      request: GetClusterRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudHypercomputeClusterV1.Cluster

    /// See `HypercomputeClusterClient.createCluster`.
    func createCluster(
      request: CreateClusterRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation

    /// See `HypercomputeClusterClient.createCluster`.
    func createCluster(
      withPolling: CreateClusterRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<Cluster>

    /// See `HypercomputeClusterClient.updateCluster`.
    func updateCluster(
      request: UpdateClusterRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation

    /// See `HypercomputeClusterClient.updateCluster`.
    func updateCluster(
      withPolling: UpdateClusterRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<Cluster>

    /// See `HypercomputeClusterClient.deleteCluster`.
    func deleteCluster(
      request: DeleteClusterRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation

    /// See `HypercomputeClusterClient.deleteCluster`.
    func deleteCluster(
      withPolling: DeleteClusterRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<Void>

    /// See `HypercomputeClusterClient.listLocations`.
    func listLocations(
      request: GoogleCloudLocation.ListLocationsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudLocation.ListLocationsResponse

    /// See `HypercomputeClusterClient.listLocations`.
    func listLocations(
      byItem: GoogleCloudLocation.ListLocationsRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<GoogleCloudLocation.Location, Swift.Error>

    /// See `HypercomputeClusterClient.getLocation`.
    func getLocation(
      request: GoogleCloudLocation.GetLocationRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudLocation.Location

    /// See `HypercomputeClusterClient.listOperations`.
    func listOperations(
      request: GoogleLongRunning.ListOperationsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.ListOperationsResponse

    /// See `HypercomputeClusterClient.listOperations`.
    func listOperations(
      byItem: GoogleLongRunning.ListOperationsRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<GoogleLongRunning.Operation, Swift.Error>

    /// See `HypercomputeClusterClient.deleteOperation`.
    func deleteOperation(
      request: GoogleLongRunning.DeleteOperationRequest, options: GoogleCloudGax.RequestOptions
    ) async throws

    /// See `HypercomputeClusterClient.cancelOperation`.
    func cancelOperation(
      request: GoogleLongRunning.CancelOperationRequest, options: GoogleCloudGax.RequestOptions
    ) async throws
  }
}

// Default implementations
extension Clients.HypercomputeClusterProtocol {
  public func listClusters(request: ListClustersRequest) async throws
    -> GoogleCloudHypercomputeClusterV1.ListClustersResponse
  {
    try await self.listClusters(request: request, options: .init())
  }

  public func listClusters(
    request: ListClustersRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleCloudHypercomputeClusterV1.ListClustersResponse {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func listClusters(
    byItem: ListClustersRequest
  ) throws -> any AsyncSequence<Cluster, Swift.Error> {
    try self.listClusters(byItem: byItem, options: .init())
  }

  public func listClusters(
    byItem: ListClustersRequest, options: GoogleCloudGax.RequestOptions
  ) throws -> any AsyncSequence<Cluster, Swift.Error> {
    let listRpc = {
      (token: Swift.String) async throws -> GoogleCloudHypercomputeClusterV1.ListClustersResponse in
      throw GoogleCloudGax.RequestError.unimplemented
    }
    return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
  }

  public func listClusters(
    parent: Swift.String,
  ) throws -> any AsyncSequence<Cluster, Swift.Error> {
    let request = ListClustersRequest().with {
      $0.parent = parent
    }
    return try self.listClusters(byItem: request)
  }

  public func getCluster(request: GetClusterRequest) async throws
    -> GoogleCloudHypercomputeClusterV1.Cluster
  {
    try await self.getCluster(request: request, options: .init())
  }

  public func getCluster(
    request: GetClusterRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleCloudHypercomputeClusterV1.Cluster {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func getCluster(
    name: Swift.String,
  ) async throws -> GoogleCloudHypercomputeClusterV1.Cluster {
    let request = GetClusterRequest().with {
      $0.name = name
    }
    return try await self.getCluster(request: request)
  }

  public func createCluster(request: CreateClusterRequest) async throws
    -> GoogleLongRunning.Operation
  {
    try await self.createCluster(request: request, options: .init())
  }

  public func createCluster(
    request: CreateClusterRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleLongRunning.Operation {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func createCluster(withPolling: CreateClusterRequest) async throws -> any GoogleCloudGax
    .PollableOperation<Cluster>
  {
    try await self.createCluster(withPolling: withPolling, options: .init())
  }

  public func createCluster(
    withPolling: CreateClusterRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> any GoogleCloudGax.PollableOperation<Cluster> {
    let poll = { () async throws -> GoogleCloudGax._PollableOperationImpl<Cluster>.State in
      throw GoogleCloudGax.RequestError.unimplemented
    }
    return GoogleCloudGax._PollableOperationImpl(
      initialState: .init(done: false, result: nil), poll: poll)
  }

  public func createCluster(
    parent: Swift.String,
    cluster: Cluster?,
    clusterId: Swift.String,
  ) async throws -> any GoogleCloudGax.PollableOperation<Cluster> {
    let request = CreateClusterRequest().with {
      $0.parent = parent
      $0.cluster = cluster
      $0.clusterId = clusterId
    }
    return try await self.createCluster(withPolling: request)
  }

  public func updateCluster(request: UpdateClusterRequest) async throws
    -> GoogleLongRunning.Operation
  {
    try await self.updateCluster(request: request, options: .init())
  }

  public func updateCluster(
    request: UpdateClusterRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleLongRunning.Operation {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func updateCluster(withPolling: UpdateClusterRequest) async throws -> any GoogleCloudGax
    .PollableOperation<Cluster>
  {
    try await self.updateCluster(withPolling: withPolling, options: .init())
  }

  public func updateCluster(
    withPolling: UpdateClusterRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> any GoogleCloudGax.PollableOperation<Cluster> {
    let poll = { () async throws -> GoogleCloudGax._PollableOperationImpl<Cluster>.State in
      throw GoogleCloudGax.RequestError.unimplemented
    }
    return GoogleCloudGax._PollableOperationImpl(
      initialState: .init(done: false, result: nil), poll: poll)
  }

  public func updateCluster(
    cluster: Cluster?,
    updateMask: GoogleCloudWkt.FieldMask?,
  ) async throws -> any GoogleCloudGax.PollableOperation<Cluster> {
    let request = UpdateClusterRequest().with {
      $0.cluster = cluster
      $0.updateMask = updateMask
    }
    return try await self.updateCluster(withPolling: request)
  }

  public func deleteCluster(request: DeleteClusterRequest) async throws
    -> GoogleLongRunning.Operation
  {
    try await self.deleteCluster(request: request, options: .init())
  }

  public func deleteCluster(
    request: DeleteClusterRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleLongRunning.Operation {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func deleteCluster(withPolling: DeleteClusterRequest) async throws -> any GoogleCloudGax
    .PollableOperation<Void>
  {
    try await self.deleteCluster(withPolling: withPolling, options: .init())
  }

  public func deleteCluster(
    withPolling: DeleteClusterRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> any GoogleCloudGax.PollableOperation<Void> {
    let poll = { () async throws -> GoogleCloudGax._PollableOperationImpl<Void>.State in
      throw GoogleCloudGax.RequestError.unimplemented
    }
    return GoogleCloudGax._PollableOperationImpl(
      initialState: .init(done: false, result: nil), poll: poll)
  }

  public func deleteCluster(
    name: Swift.String,
  ) async throws -> any GoogleCloudGax.PollableOperation<Void> {
    let request = DeleteClusterRequest().with {
      $0.name = name
    }
    return try await self.deleteCluster(withPolling: request)
  }

  public func listLocations(request: GoogleCloudLocation.ListLocationsRequest) async throws
    -> GoogleCloudLocation.ListLocationsResponse
  {
    try await self.listLocations(request: request, options: .init())
  }

  public func listLocations(
    request: GoogleCloudLocation.ListLocationsRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleCloudLocation.ListLocationsResponse {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func listLocations(
    byItem: GoogleCloudLocation.ListLocationsRequest
  ) throws -> any AsyncSequence<GoogleCloudLocation.Location, Swift.Error> {
    try self.listLocations(byItem: byItem, options: .init())
  }

  public func listLocations(
    byItem: GoogleCloudLocation.ListLocationsRequest, options: GoogleCloudGax.RequestOptions
  ) throws -> any AsyncSequence<GoogleCloudLocation.Location, Swift.Error> {
    let listRpc = {
      (token: Swift.String) async throws -> GoogleCloudLocation.ListLocationsResponse in
      throw GoogleCloudGax.RequestError.unimplemented
    }
    return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
  }

  public func getLocation(request: GoogleCloudLocation.GetLocationRequest) async throws
    -> GoogleCloudLocation.Location
  {
    try await self.getLocation(request: request, options: .init())
  }

  public func getLocation(
    request: GoogleCloudLocation.GetLocationRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleCloudLocation.Location {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func listOperations(request: GoogleLongRunning.ListOperationsRequest) async throws
    -> GoogleLongRunning.ListOperationsResponse
  {
    try await self.listOperations(request: request, options: .init())
  }

  public func listOperations(
    request: GoogleLongRunning.ListOperationsRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleLongRunning.ListOperationsResponse {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func listOperations(
    byItem: GoogleLongRunning.ListOperationsRequest
  ) throws -> any AsyncSequence<GoogleLongRunning.Operation, Swift.Error> {
    try self.listOperations(byItem: byItem, options: .init())
  }

  public func listOperations(
    byItem: GoogleLongRunning.ListOperationsRequest, options: GoogleCloudGax.RequestOptions
  ) throws -> any AsyncSequence<GoogleLongRunning.Operation, Swift.Error> {
    let listRpc = {
      (token: Swift.String) async throws -> GoogleLongRunning.ListOperationsResponse in
      throw GoogleCloudGax.RequestError.unimplemented
    }
    return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
  }

  public func listOperations(
    name: Swift.String,
    filter: Swift.String,
  ) throws -> any AsyncSequence<GoogleLongRunning.Operation, Swift.Error> {
    let request = GoogleLongRunning.ListOperationsRequest().with {
      $0.name = name
      $0.filter = filter
    }
    return try self.listOperations(byItem: request)
  }

  public func getOperation(request: GoogleLongRunning.GetOperationRequest) async throws
    -> GoogleLongRunning.Operation
  {
    try await self.getOperation(request: request, options: .init())
  }

  public func getOperation(
    request: GoogleLongRunning.GetOperationRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleLongRunning.Operation {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func getOperation(
    name: Swift.String,
  ) async throws -> GoogleLongRunning.Operation {
    let request = GoogleLongRunning.GetOperationRequest().with {
      $0.name = name
    }
    return try await self.getOperation(request: request)
  }

  public func deleteOperation(request: GoogleLongRunning.DeleteOperationRequest) async throws {
    try await self.deleteOperation(request: request, options: .init())
  }

  public func deleteOperation(
    request: GoogleLongRunning.DeleteOperationRequest, options: GoogleCloudGax.RequestOptions
  ) async throws {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func deleteOperation(
    name: Swift.String,
  ) async throws {
    let request = GoogleLongRunning.DeleteOperationRequest().with {
      $0.name = name
    }
    try await self.deleteOperation(request: request)
  }

  public func cancelOperation(request: GoogleLongRunning.CancelOperationRequest) async throws {
    try await self.cancelOperation(request: request, options: .init())
  }

  public func cancelOperation(
    request: GoogleLongRunning.CancelOperationRequest, options: GoogleCloudGax.RequestOptions
  ) async throws {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func cancelOperation(
    name: Swift.String,
  ) async throws {
    let request = GoogleLongRunning.CancelOperationRequest().with {
      $0.name = name
    }
    try await self.cancelOperation(request: request)
  }
}
