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

  /// Service for the `storagePools` resource.
  ///
  /// @Snippet(path: "storagePoolsQuickstart")
  public class StoragePoolsClient: Clients.StoragePoolsProtocol {
    let inner: any Clients.StoragePoolsStub
    let pollingErrorPolicy: GoogleCloudGax.PollingErrorPolicy
    let pollingBackoffPolicy: GoogleCloudGax.BackoffPolicy

    /// Creates a new `StoragePoolsClient` instance.
    public init(_ options: GoogleCloudGax.ClientOptions = .init()) throws {
      var inner: any Clients.StoragePoolsStub = try Clients.StoragePoolsTransport(options)
      inner = Clients.StoragePoolsRetry(inner, options: options)
      if let logger = options.logger {
        inner = Clients.StoragePoolsLogging(inner, logger: logger)
      }
      self.inner = inner
      self.pollingErrorPolicy = options.pollingErrorPolicy
      self.pollingBackoffPolicy = options.pollingBackoffPolicy
    }

    /// Retrieves an aggregated list of storage pools.
    ///
    /// To prevent failure, Google recommends that you set the
    /// `returnPartialSuccess` parameter to `true`.
    ///
    /// @Snippet(path: "storagePools_aggregatedList")
    public func aggregatedList(
      request: StoragePoolsClient.AggregatedListRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.StoragePoolAggregatedList {
      try await self.inner.aggregatedList(request: request, options: options)
    }

    /// Retrieves an aggregated list of storage pools.
    ///
    /// To prevent failure, Google recommends that you set the
    /// `returnPartialSuccess` parameter to `true`.
    ///
    /// @Snippet(path: "storagePools_aggregatedList")
    public func aggregatedList(
      byItem: StoragePoolsClient.AggregatedListRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<(Swift.String, StoragePoolsScopedList), Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws -> GoogleCloudComputeV1.StoragePoolAggregatedList in
        var request = byItem
        request.pageToken = token
        return try await self.aggregatedList(request: request, options: options)
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

    /// Deletes the specified storage pool. Deleting a storagePool
    /// removes its data permanently and is irreversible. However, deleting a
    /// storagePool does not delete any snapshots previously
    /// made from the storagePool. You must separately delete
    /// snapshots.
    ///
    /// @Snippet(path: "storagePools_delete")
    public func delete(
      request: StoragePoolsClient.DeleteRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      try await self.inner.delete(request: request, options: options)
    }

    /// Deletes the specified storage pool. Deleting a storagePool
    /// removes its data permanently and is irreversible. However, deleting a
    /// storagePool does not delete any snapshots previously
    /// made from the storagePool. You must separately delete
    /// snapshots.
    ///
    /// @Snippet(path: "storagePools_delete")
    public func delete(
      withPolling: StoragePoolsClient.DeleteRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<GoogleCloudComputeV1.Operation> {
      let extractStatus = {
        (op: GoogleCloudComputeV1.Operation) throws
          -> GoogleCloudGax._PollableOperationImpl<GoogleCloudComputeV1.Operation>.State in
        guard op._done() else {
          return .init(done: false, result: nil)
        }

        do {
          try op._detectErrors()
        } catch let e as GoogleCloudGax.RequestError {
          return .init(done: true, result: .failure(e))
        }
        return .init(done: true, result: .success(op))
      }
      let rawOp = try await self.delete(request: withPolling, options: options)
      let initialState = try extractStatus(rawOp)
      let poll = {
        () async throws
          -> GoogleCloudGax._PollableOperationImpl<GoogleCloudComputeV1.Operation>.State in
        let op = try await self.getOperation(
          request: .init().with {
            $0.operation = rawOp._name()
            $0.project = withPolling.project
            $0.zone = withPolling.zone
          }, options: options)
        return try extractStatus(op)
      }
      return GoogleCloudGax._PollableOperationImpl(
        initialState: initialState,
        polling: options.pollingErrorPolicy ?? self.pollingErrorPolicy,
        backoff: options.pollingBackoffPolicy ?? self.pollingBackoffPolicy,
        poll: poll
      )
    }

    /// Returns a specified storage pool. Gets a list of available
    /// storage pools by making a list() request.
    ///
    /// @Snippet(path: "storagePools_get")
    public func `get`(
      request: StoragePoolsClient.GetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.StoragePool {
      try await self.inner.`get`(request: request, options: options)
    }

    /// Gets the access control policy for a resource. May be empty if no such
    /// policy or resource exists.
    ///
    /// @Snippet(path: "storagePools_getIamPolicy")
    public func getIamPolicy(
      request: StoragePoolsClient.GetIamPolicyRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Policy {
      try await self.inner.getIamPolicy(request: request, options: options)
    }

    /// Creates a storage pool in the specified project using the data
    /// in the request.
    ///
    /// @Snippet(path: "storagePools_insert")
    public func insert(
      request: StoragePoolsClient.InsertRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      try await self.inner.insert(request: request, options: options)
    }

    /// Creates a storage pool in the specified project using the data
    /// in the request.
    ///
    /// @Snippet(path: "storagePools_insert")
    public func insert(
      withPolling: StoragePoolsClient.InsertRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<GoogleCloudComputeV1.Operation> {
      let extractStatus = {
        (op: GoogleCloudComputeV1.Operation) throws
          -> GoogleCloudGax._PollableOperationImpl<GoogleCloudComputeV1.Operation>.State in
        guard op._done() else {
          return .init(done: false, result: nil)
        }

        do {
          try op._detectErrors()
        } catch let e as GoogleCloudGax.RequestError {
          return .init(done: true, result: .failure(e))
        }
        return .init(done: true, result: .success(op))
      }
      let rawOp = try await self.insert(request: withPolling, options: options)
      let initialState = try extractStatus(rawOp)
      let poll = {
        () async throws
          -> GoogleCloudGax._PollableOperationImpl<GoogleCloudComputeV1.Operation>.State in
        let op = try await self.getOperation(
          request: .init().with {
            $0.operation = rawOp._name()
            $0.project = withPolling.project
            $0.zone = withPolling.zone
          }, options: options)
        return try extractStatus(op)
      }
      return GoogleCloudGax._PollableOperationImpl(
        initialState: initialState,
        polling: options.pollingErrorPolicy ?? self.pollingErrorPolicy,
        backoff: options.pollingBackoffPolicy ?? self.pollingBackoffPolicy,
        poll: poll
      )
    }

    /// Retrieves a list of storage pools contained within
    /// the specified zone.
    ///
    /// @Snippet(path: "storagePools_list")
    public func list(
      request: StoragePoolsClient.ListRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.StoragePoolList {
      try await self.inner.list(request: request, options: options)
    }

    /// Retrieves a list of storage pools contained within
    /// the specified zone.
    ///
    /// @Snippet(path: "storagePools_list")
    public func list(
      byItem: StoragePoolsClient.ListRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<StoragePool, Swift.Error> {
      let listRpc = { (token: Swift.String) async throws -> GoogleCloudComputeV1.StoragePoolList in
        var request = byItem
        request.pageToken = token
        return try await self.list(request: request, options: options)
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

    /// Lists the disks in a specified storage pool.
    ///
    /// @Snippet(path: "storagePools_listDisks")
    public func listDisks(
      request: StoragePoolsClient.ListDisksRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.StoragePoolListDisks {
      try await self.inner.listDisks(request: request, options: options)
    }

    /// Lists the disks in a specified storage pool.
    ///
    /// @Snippet(path: "storagePools_listDisks")
    public func listDisks(
      byItem: StoragePoolsClient.ListDisksRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<StoragePoolDisk, Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws -> GoogleCloudComputeV1.StoragePoolListDisks in
        var request = byItem
        request.pageToken = token
        return try await self.listDisks(request: request, options: options)
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

    /// Sets the access control policy on the specified resource.
    /// Replaces any existing policy.
    ///
    /// @Snippet(path: "storagePools_setIamPolicy")
    public func setIamPolicy(
      request: StoragePoolsClient.SetIamPolicyRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Policy {
      try await self.inner.setIamPolicy(request: request, options: options)
    }

    /// Returns permissions that a caller has on the specified resource.
    ///
    /// @Snippet(path: "storagePools_testIamPermissions")
    public func testIamPermissions(
      request: StoragePoolsClient.TestIamPermissionsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.TestPermissionsResponse {
      try await self.inner.testIamPermissions(request: request, options: options)
    }

    /// Updates the specified storagePool with the data included in the request.
    /// The update is performed only on selected fields included as part
    /// of update-mask. Only the following fields can be modified:
    /// pool_provisioned_capacity_gb, pool_provisioned_iops and
    /// pool_provisioned_throughput.
    ///
    /// @Snippet(path: "storagePools_update")
    public func update(
      request: StoragePoolsClient.UpdateRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      try await self.inner.update(request: request, options: options)
    }

    /// Updates the specified storagePool with the data included in the request.
    /// The update is performed only on selected fields included as part
    /// of update-mask. Only the following fields can be modified:
    /// pool_provisioned_capacity_gb, pool_provisioned_iops and
    /// pool_provisioned_throughput.
    ///
    /// @Snippet(path: "storagePools_update")
    public func update(
      withPolling: StoragePoolsClient.UpdateRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<GoogleCloudComputeV1.Operation> {
      let extractStatus = {
        (op: GoogleCloudComputeV1.Operation) throws
          -> GoogleCloudGax._PollableOperationImpl<GoogleCloudComputeV1.Operation>.State in
        guard op._done() else {
          return .init(done: false, result: nil)
        }

        do {
          try op._detectErrors()
        } catch let e as GoogleCloudGax.RequestError {
          return .init(done: true, result: .failure(e))
        }
        return .init(done: true, result: .success(op))
      }
      let rawOp = try await self.update(request: withPolling, options: options)
      let initialState = try extractStatus(rawOp)
      let poll = {
        () async throws
          -> GoogleCloudGax._PollableOperationImpl<GoogleCloudComputeV1.Operation>.State in
        let op = try await self.getOperation(
          request: .init().with {
            $0.operation = rawOp._name()
            $0.project = withPolling.project
            $0.zone = withPolling.zone
          }, options: options)
        return try extractStatus(op)
      }
      return GoogleCloudGax._PollableOperationImpl(
        initialState: initialState,
        polling: options.pollingErrorPolicy ?? self.pollingErrorPolicy,
        backoff: options.pollingBackoffPolicy ?? self.pollingBackoffPolicy,
        poll: poll
      )
    }

    /// Retrieves the specified zone-specific Operations resource.
    ///
    /// @Snippet(path: "storagePools_getOperation")
    func getOperation(
      request: ZoneOperationsClient.GetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      try await self.inner.getOperation(request: request, options: options)
    }
  }

  extension Clients {
    /// A Swift protocol to mock `StoragePoolsClient`.
    ///
    /// To mock `StoragePoolsClient` change your functions to receive
    /// `some StoragePoolsProtocol` or `any StoragePoolsProtocol`
    /// and pass a mock implementation in your tests.
    public protocol StoragePoolsProtocol {
      /// See `StoragePoolsClient.aggregatedList`.
      func aggregatedList(request: StoragePoolsClient.AggregatedListRequest) async throws
        -> GoogleCloudComputeV1.StoragePoolAggregatedList

      /// See `StoragePoolsClient.aggregatedList`.
      func aggregatedList(
        byItem: StoragePoolsClient.AggregatedListRequest
      ) throws -> any AsyncSequence<(Swift.String, StoragePoolsScopedList), Swift.Error>

      /// See `StoragePoolsClient.aggregatedList`.
      func aggregatedList(
        project: Swift.String,
      ) throws -> any AsyncSequence<(Swift.String, StoragePoolsScopedList), Swift.Error>

      /// See `StoragePoolsClient.delete`.
      func delete(request: StoragePoolsClient.DeleteRequest) async throws
        -> GoogleCloudComputeV1.Operation

      /// See `StoragePoolsClient.`get``.
      func `get`(request: StoragePoolsClient.GetRequest) async throws
        -> GoogleCloudComputeV1.StoragePool

      /// See `StoragePoolsClient.`get``.
      func `get`(
        project: Swift.String,
        zone: Swift.String,
        storagePool: Swift.String,
      ) async throws -> GoogleCloudComputeV1.StoragePool

      /// See `StoragePoolsClient.getIamPolicy`.
      func getIamPolicy(request: StoragePoolsClient.GetIamPolicyRequest) async throws
        -> GoogleCloudComputeV1.Policy

      /// See `StoragePoolsClient.getIamPolicy`.
      func getIamPolicy(
        project: Swift.String,
        zone: Swift.String,
        resource: Swift.String,
      ) async throws -> GoogleCloudComputeV1.Policy

      /// See `StoragePoolsClient.insert`.
      func insert(request: StoragePoolsClient.InsertRequest) async throws
        -> GoogleCloudComputeV1.Operation

      /// See `StoragePoolsClient.list`.
      func list(request: StoragePoolsClient.ListRequest) async throws
        -> GoogleCloudComputeV1.StoragePoolList

      /// See `StoragePoolsClient.list`.
      func list(
        byItem: StoragePoolsClient.ListRequest
      ) throws -> any AsyncSequence<StoragePool, Swift.Error>

      /// See `StoragePoolsClient.list`.
      func list(
        project: Swift.String,
        zone: Swift.String,
      ) throws -> any AsyncSequence<StoragePool, Swift.Error>

      /// See `StoragePoolsClient.listDisks`.
      func listDisks(request: StoragePoolsClient.ListDisksRequest) async throws
        -> GoogleCloudComputeV1.StoragePoolListDisks

      /// See `StoragePoolsClient.listDisks`.
      func listDisks(
        byItem: StoragePoolsClient.ListDisksRequest
      ) throws -> any AsyncSequence<StoragePoolDisk, Swift.Error>

      /// See `StoragePoolsClient.listDisks`.
      func listDisks(
        project: Swift.String,
        zone: Swift.String,
        storagePool: Swift.String,
      ) throws -> any AsyncSequence<StoragePoolDisk, Swift.Error>

      /// See `StoragePoolsClient.setIamPolicy`.
      func setIamPolicy(request: StoragePoolsClient.SetIamPolicyRequest) async throws
        -> GoogleCloudComputeV1.Policy

      /// See `StoragePoolsClient.setIamPolicy`.
      func setIamPolicy(
        project: Swift.String,
        zone: Swift.String,
        resource: Swift.String,
        body: ZoneSetPolicyRequest?,
      ) async throws -> GoogleCloudComputeV1.Policy

      /// See `StoragePoolsClient.testIamPermissions`.
      func testIamPermissions(request: StoragePoolsClient.TestIamPermissionsRequest) async throws
        -> GoogleCloudComputeV1.TestPermissionsResponse

      /// See `StoragePoolsClient.testIamPermissions`.
      func testIamPermissions(
        project: Swift.String,
        zone: Swift.String,
        resource: Swift.String,
        body: TestPermissionsRequest?,
      ) async throws -> GoogleCloudComputeV1.TestPermissionsResponse

      /// See `StoragePoolsClient.update`.
      func update(request: StoragePoolsClient.UpdateRequest) async throws
        -> GoogleCloudComputeV1.Operation

      /// See `StoragePoolsClient.aggregatedList`.
      func aggregatedList(
        request: StoragePoolsClient.AggregatedListRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.StoragePoolAggregatedList

      /// See `StoragePoolsClient.aggregatedList`.
      func aggregatedList(
        byItem: StoragePoolsClient.AggregatedListRequest, options: GoogleCloudGax.RequestOptions
      ) throws -> any AsyncSequence<(Swift.String, StoragePoolsScopedList), Swift.Error>

      /// See `StoragePoolsClient.delete`.
      func delete(
        request: StoragePoolsClient.DeleteRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation

      /// See `StoragePoolsClient.`get``.
      func `get`(
        request: StoragePoolsClient.GetRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.StoragePool

      /// See `StoragePoolsClient.getIamPolicy`.
      func getIamPolicy(
        request: StoragePoolsClient.GetIamPolicyRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Policy

      /// See `StoragePoolsClient.insert`.
      func insert(
        request: StoragePoolsClient.InsertRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation

      /// See `StoragePoolsClient.list`.
      func list(
        request: StoragePoolsClient.ListRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.StoragePoolList

      /// See `StoragePoolsClient.list`.
      func list(
        byItem: StoragePoolsClient.ListRequest, options: GoogleCloudGax.RequestOptions
      ) throws -> any AsyncSequence<StoragePool, Swift.Error>

      /// See `StoragePoolsClient.listDisks`.
      func listDisks(
        request: StoragePoolsClient.ListDisksRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.StoragePoolListDisks

      /// See `StoragePoolsClient.listDisks`.
      func listDisks(
        byItem: StoragePoolsClient.ListDisksRequest, options: GoogleCloudGax.RequestOptions
      ) throws -> any AsyncSequence<StoragePoolDisk, Swift.Error>

      /// See `StoragePoolsClient.setIamPolicy`.
      func setIamPolicy(
        request: StoragePoolsClient.SetIamPolicyRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Policy

      /// See `StoragePoolsClient.testIamPermissions`.
      func testIamPermissions(
        request: StoragePoolsClient.TestIamPermissionsRequest,
        options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.TestPermissionsResponse

      /// See `StoragePoolsClient.update`.
      func update(
        request: StoragePoolsClient.UpdateRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation
    }
  }

  // Default implementations
  extension Clients.StoragePoolsProtocol {
    public func aggregatedList(request: StoragePoolsClient.AggregatedListRequest) async throws
      -> GoogleCloudComputeV1.StoragePoolAggregatedList
    {
      try await self.aggregatedList(request: request, options: .init())
    }

    public func aggregatedList(
      request: StoragePoolsClient.AggregatedListRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.StoragePoolAggregatedList {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func aggregatedList(
      byItem: StoragePoolsClient.AggregatedListRequest
    ) throws -> any AsyncSequence<(Swift.String, StoragePoolsScopedList), Swift.Error> {
      try self.aggregatedList(byItem: byItem, options: .init())
    }

    public func aggregatedList(
      byItem: StoragePoolsClient.AggregatedListRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<(Swift.String, StoragePoolsScopedList), Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws -> GoogleCloudComputeV1.StoragePoolAggregatedList in
        throw GoogleCloudGax.RequestError.unimplemented
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

    public func aggregatedList(
      project: Swift.String,
    ) throws -> any AsyncSequence<(Swift.String, StoragePoolsScopedList), Swift.Error> {
      let request = StoragePoolsClient.AggregatedListRequest().with {
        $0.project = project
      }
      return try self.aggregatedList(byItem: request)
    }

    public func delete(request: StoragePoolsClient.DeleteRequest) async throws
      -> GoogleCloudComputeV1.Operation
    {
      try await self.delete(request: request, options: .init())
    }

    public func delete(
      request: StoragePoolsClient.DeleteRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func delete(
      withPolling: StoragePoolsClient.DeleteRequest
    ) async throws -> any GoogleCloudGax.PollableOperation<GoogleCloudComputeV1.Operation> {
      try await self.delete(withPolling: withPolling, options: .init())
    }

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

    public func delete(
      project: Swift.String,
      zone: Swift.String,
      storagePool: Swift.String,
    ) async throws -> any GoogleCloudGax.PollableOperation<GoogleCloudComputeV1.Operation> {
      let request = StoragePoolsClient.DeleteRequest().with {
        $0.project = project
        $0.zone = zone
        $0.storagePool = storagePool
      }
      return try await self.delete(withPolling: request)
    }

    public func `get`(request: StoragePoolsClient.GetRequest) async throws
      -> GoogleCloudComputeV1.StoragePool
    {
      try await self.`get`(request: request, options: .init())
    }

    public func `get`(
      request: StoragePoolsClient.GetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.StoragePool {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func `get`(
      project: Swift.String,
      zone: Swift.String,
      storagePool: Swift.String,
    ) async throws -> GoogleCloudComputeV1.StoragePool {
      let request = StoragePoolsClient.GetRequest().with {
        $0.project = project
        $0.zone = zone
        $0.storagePool = storagePool
      }
      return try await self.`get`(request: request)
    }

    public func getIamPolicy(request: StoragePoolsClient.GetIamPolicyRequest) async throws
      -> GoogleCloudComputeV1.Policy
    {
      try await self.getIamPolicy(request: request, options: .init())
    }

    public func getIamPolicy(
      request: StoragePoolsClient.GetIamPolicyRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Policy {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func getIamPolicy(
      project: Swift.String,
      zone: Swift.String,
      resource: Swift.String,
    ) async throws -> GoogleCloudComputeV1.Policy {
      let request = StoragePoolsClient.GetIamPolicyRequest().with {
        $0.project = project
        $0.zone = zone
        $0.resource = resource
      }
      return try await self.getIamPolicy(request: request)
    }

    public func insert(request: StoragePoolsClient.InsertRequest) async throws
      -> GoogleCloudComputeV1.Operation
    {
      try await self.insert(request: request, options: .init())
    }

    public func insert(
      request: StoragePoolsClient.InsertRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func insert(
      withPolling: StoragePoolsClient.InsertRequest
    ) async throws -> any GoogleCloudGax.PollableOperation<GoogleCloudComputeV1.Operation> {
      try await self.insert(withPolling: withPolling, options: .init())
    }

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

    public func insert(
      project: Swift.String,
      zone: Swift.String,
      body: StoragePool?,
    ) async throws -> any GoogleCloudGax.PollableOperation<GoogleCloudComputeV1.Operation> {
      let request = StoragePoolsClient.InsertRequest().with {
        $0.project = project
        $0.zone = zone
        $0.body = body
      }
      return try await self.insert(withPolling: request)
    }

    public func list(request: StoragePoolsClient.ListRequest) async throws
      -> GoogleCloudComputeV1.StoragePoolList
    {
      try await self.list(request: request, options: .init())
    }

    public func list(
      request: StoragePoolsClient.ListRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.StoragePoolList {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func list(
      byItem: StoragePoolsClient.ListRequest
    ) throws -> any AsyncSequence<StoragePool, Swift.Error> {
      try self.list(byItem: byItem, options: .init())
    }

    public func list(
      byItem: StoragePoolsClient.ListRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<StoragePool, Swift.Error> {
      let listRpc = { (token: Swift.String) async throws -> GoogleCloudComputeV1.StoragePoolList in
        throw GoogleCloudGax.RequestError.unimplemented
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

    public func list(
      project: Swift.String,
      zone: Swift.String,
    ) throws -> any AsyncSequence<StoragePool, Swift.Error> {
      let request = StoragePoolsClient.ListRequest().with {
        $0.project = project
        $0.zone = zone
      }
      return try self.list(byItem: request)
    }

    public func listDisks(request: StoragePoolsClient.ListDisksRequest) async throws
      -> GoogleCloudComputeV1.StoragePoolListDisks
    {
      try await self.listDisks(request: request, options: .init())
    }

    public func listDisks(
      request: StoragePoolsClient.ListDisksRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.StoragePoolListDisks {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func listDisks(
      byItem: StoragePoolsClient.ListDisksRequest
    ) throws -> any AsyncSequence<StoragePoolDisk, Swift.Error> {
      try self.listDisks(byItem: byItem, options: .init())
    }

    public func listDisks(
      byItem: StoragePoolsClient.ListDisksRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<StoragePoolDisk, Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws -> GoogleCloudComputeV1.StoragePoolListDisks in
        throw GoogleCloudGax.RequestError.unimplemented
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

    public func listDisks(
      project: Swift.String,
      zone: Swift.String,
      storagePool: Swift.String,
    ) throws -> any AsyncSequence<StoragePoolDisk, Swift.Error> {
      let request = StoragePoolsClient.ListDisksRequest().with {
        $0.project = project
        $0.zone = zone
        $0.storagePool = storagePool
      }
      return try self.listDisks(byItem: request)
    }

    public func setIamPolicy(request: StoragePoolsClient.SetIamPolicyRequest) async throws
      -> GoogleCloudComputeV1.Policy
    {
      try await self.setIamPolicy(request: request, options: .init())
    }

    public func setIamPolicy(
      request: StoragePoolsClient.SetIamPolicyRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Policy {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func setIamPolicy(
      project: Swift.String,
      zone: Swift.String,
      resource: Swift.String,
      body: ZoneSetPolicyRequest?,
    ) async throws -> GoogleCloudComputeV1.Policy {
      let request = StoragePoolsClient.SetIamPolicyRequest().with {
        $0.project = project
        $0.zone = zone
        $0.resource = resource
        $0.body = body
      }
      return try await self.setIamPolicy(request: request)
    }

    public func testIamPermissions(request: StoragePoolsClient.TestIamPermissionsRequest)
      async throws -> GoogleCloudComputeV1.TestPermissionsResponse
    {
      try await self.testIamPermissions(request: request, options: .init())
    }

    public func testIamPermissions(
      request: StoragePoolsClient.TestIamPermissionsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.TestPermissionsResponse {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func testIamPermissions(
      project: Swift.String,
      zone: Swift.String,
      resource: Swift.String,
      body: TestPermissionsRequest?,
    ) async throws -> GoogleCloudComputeV1.TestPermissionsResponse {
      let request = StoragePoolsClient.TestIamPermissionsRequest().with {
        $0.project = project
        $0.zone = zone
        $0.resource = resource
        $0.body = body
      }
      return try await self.testIamPermissions(request: request)
    }

    public func update(request: StoragePoolsClient.UpdateRequest) async throws
      -> GoogleCloudComputeV1.Operation
    {
      try await self.update(request: request, options: .init())
    }

    public func update(
      request: StoragePoolsClient.UpdateRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func update(
      withPolling: StoragePoolsClient.UpdateRequest
    ) async throws -> any GoogleCloudGax.PollableOperation<GoogleCloudComputeV1.Operation> {
      try await self.update(withPolling: withPolling, options: .init())
    }

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

    public func update(
      project: Swift.String,
      zone: Swift.String,
      storagePool: Swift.String,
      body: StoragePool?,
    ) async throws -> any GoogleCloudGax.PollableOperation<GoogleCloudComputeV1.Operation> {
      let request = StoragePoolsClient.UpdateRequest().with {
        $0.project = project
        $0.zone = zone
        $0.storagePool = storagePool
        $0.body = body
      }
      return try await self.update(withPolling: request)
    }

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

    public func getOperation(
      request: ZoneOperationsClient.GetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      throw GoogleCloudGax.RequestError.unimplemented
    }
  }
#endif
