// 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 GoogleCloudWkt
import GoogleLongRunning
import GoogleRpc
import GoogleCloudGax

/// Enables services that service consumers want to use on Google Cloud Platform,
/// lists the available or enabled services, or disables services that service
/// consumers no longer use.
///
/// See [Service Usage API](https://cloud.google.com/service-usage/docs/overview)
///
/// @Snippet(path: "ServiceUsageQuickstart")
public class ServiceUsageClient: Clients.ServiceUsageProtocol {
  let inner: any Clients.ServiceUsageStub
  let pollingErrorPolicy: GoogleCloudGax.PollingErrorPolicy
  let pollingBackoffPolicy: GoogleCloudGax.BackoffPolicy

  /// Creates a new `ServiceUsageClient` instance.
  public init(_ options: GoogleCloudGax.ClientOptions = .init()) throws {
    var inner: any Clients.ServiceUsageStub = try Clients.ServiceUsageTransport(options)
    inner = Clients.ServiceUsageRetry(inner, options: options)
    if let logger = options.logger {
      inner = Clients.ServiceUsageLogging(inner, logger: logger)
    }
    self.inner = inner
    self.pollingErrorPolicy = options.pollingErrorPolicy
    self.pollingBackoffPolicy = options.pollingBackoffPolicy
  }

  /// Enable a service so that it can be used with a project.
  ///
  /// @Snippet(path: "ServiceUsage_EnableService")
  public func enableService(
    request: EnableServiceRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleLongRunning.Operation {
    try await self.inner.enableService(request: request, options: options)
  }

  /// Enable a service so that it can be used with a project.
  ///
  /// @Snippet(path: "ServiceUsage_EnableService")
  public func enableService(
    withPolling: EnableServiceRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> any GoogleCloudGax.PollableOperation<EnableServiceResponse> {
    let extractStatus = {
      (op: GoogleLongRunning.Operation) throws
        -> GoogleCloudGax._PollableOperationImpl<EnableServiceResponse>.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 EnableServiceResponse(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.enableService(request: withPolling, options: options)
    let initialState = try extractStatus(rawOp)
    let poll = {
      () async throws -> GoogleCloudGax._PollableOperationImpl<EnableServiceResponse>.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,
    )
  }

  /// Disable a service so that it can no longer be used with a project.
  /// This prevents unintended usage that may cause unexpected billing
  /// charges or security leaks.
  ///
  /// It is not valid to call the disable method on a service that is not
  /// currently enabled. Callers will receive a `FAILED_PRECONDITION` status if
  /// the target service is not currently enabled.
  ///
  /// @Snippet(path: "ServiceUsage_DisableService")
  public func disableService(
    request: DisableServiceRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleLongRunning.Operation {
    try await self.inner.disableService(request: request, options: options)
  }

  /// Disable a service so that it can no longer be used with a project.
  /// This prevents unintended usage that may cause unexpected billing
  /// charges or security leaks.
  ///
  /// It is not valid to call the disable method on a service that is not
  /// currently enabled. Callers will receive a `FAILED_PRECONDITION` status if
  /// the target service is not currently enabled.
  ///
  /// @Snippet(path: "ServiceUsage_DisableService")
  public func disableService(
    withPolling: DisableServiceRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> any GoogleCloudGax.PollableOperation<DisableServiceResponse> {
    let extractStatus = {
      (op: GoogleLongRunning.Operation) throws
        -> GoogleCloudGax._PollableOperationImpl<DisableServiceResponse>.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 DisableServiceResponse(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.disableService(request: withPolling, options: options)
    let initialState = try extractStatus(rawOp)
    let poll = {
      () async throws -> GoogleCloudGax._PollableOperationImpl<DisableServiceResponse>.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,
    )
  }

  /// Returns the service configuration and enabled state for a given service.
  ///
  /// @Snippet(path: "ServiceUsage_GetService")
  public func getService(
    request: GetServiceRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleApiServiceUsageV1.Service {
    try await self.inner.getService(request: request, options: options)
  }

  /// List all services available to the specified project, and the current
  /// state of those services with respect to the project. The list includes
  /// all public services, all services for which the calling user has the
  /// `servicemanagement.services.bind` permission, and all services that have
  /// already been enabled on the project. The list can be filtered to
  /// only include services in a specific state, for example to only include
  /// services enabled on the project.
  ///
  /// WARNING: If you need to query enabled services frequently or across
  /// an organization, you should use
  /// [Cloud Asset Inventory
  /// API](https://cloud.google.com/asset-inventory/docs/apis), which provides
  /// higher throughput and richer filtering capability.
  ///
  /// @Snippet(path: "ServiceUsage_ListServices")
  public func listServices(
    request: ListServicesRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleApiServiceUsageV1.ListServicesResponse {
    try await self.inner.listServices(request: request, options: options)
  }

  /// List all services available to the specified project, and the current
  /// state of those services with respect to the project. The list includes
  /// all public services, all services for which the calling user has the
  /// `servicemanagement.services.bind` permission, and all services that have
  /// already been enabled on the project. The list can be filtered to
  /// only include services in a specific state, for example to only include
  /// services enabled on the project.
  ///
  /// WARNING: If you need to query enabled services frequently or across
  /// an organization, you should use
  /// [Cloud Asset Inventory
  /// API](https://cloud.google.com/asset-inventory/docs/apis), which provides
  /// higher throughput and richer filtering capability.
  ///
  /// @Snippet(path: "ServiceUsage_ListServices")
  public func listServices(
    byItem: ListServicesRequest, options: GoogleCloudGax.RequestOptions
  ) throws -> any AsyncSequence<Service, Swift.Error> {
    let listRpc = {
      (token: Swift.String) async throws -> GoogleApiServiceUsageV1.ListServicesResponse in
      var request = byItem
      request.pageToken = token
      return try await self.listServices(request: request, options: options)
    }
    return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
  }

  /// Enable multiple services on a project. The operation is atomic: if enabling
  /// any service fails, then the entire batch fails, and no state changes occur.
  /// To enable a single service, use the `EnableService` method instead.
  ///
  /// @Snippet(path: "ServiceUsage_BatchEnableServices")
  public func batchEnableServices(
    request: BatchEnableServicesRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleLongRunning.Operation {
    try await self.inner.batchEnableServices(request: request, options: options)
  }

  /// Enable multiple services on a project. The operation is atomic: if enabling
  /// any service fails, then the entire batch fails, and no state changes occur.
  /// To enable a single service, use the `EnableService` method instead.
  ///
  /// @Snippet(path: "ServiceUsage_BatchEnableServices")
  public func batchEnableServices(
    withPolling: BatchEnableServicesRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> any GoogleCloudGax.PollableOperation<BatchEnableServicesResponse> {
    let extractStatus = {
      (op: GoogleLongRunning.Operation) throws
        -> GoogleCloudGax._PollableOperationImpl<BatchEnableServicesResponse>.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 BatchEnableServicesResponse(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.batchEnableServices(request: withPolling, options: options)
    let initialState = try extractStatus(rawOp)
    let poll = {
      () async throws -> GoogleCloudGax._PollableOperationImpl<BatchEnableServicesResponse>.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,
    )
  }

  /// Returns the service configurations and enabled states for a given list of
  /// services.
  ///
  /// @Snippet(path: "ServiceUsage_BatchGetServices")
  public func batchGetServices(
    request: BatchGetServicesRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleApiServiceUsageV1.BatchGetServicesResponse {
    try await self.inner.batchGetServices(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: "ServiceUsage_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: "ServiceUsage_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: "ServiceUsage_GetOperation")
  func getOperation(
    request: GoogleLongRunning.GetOperationRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleLongRunning.Operation {
    try await self.inner.getOperation(request: request, options: options)
  }
}

extension Clients {
  /// A Swift protocol to mock `ServiceUsageClient`.
  ///
  /// To mock `ServiceUsageClient` change your functions to receive
  /// `some ServiceUsageProtocol` or `any ServiceUsageProtocol`
  /// and pass a mock implementation in your tests.
  public protocol ServiceUsageProtocol {
    /// See `ServiceUsageClient.enableService`.
    func enableService(request: EnableServiceRequest) async throws -> GoogleLongRunning.Operation

    /// See `ServiceUsageClient.enableService`.
    func enableService(withPolling: EnableServiceRequest) async throws -> any GoogleCloudGax
      .PollableOperation<EnableServiceResponse>

    /// See `ServiceUsageClient.disableService`.
    func disableService(request: DisableServiceRequest) async throws -> GoogleLongRunning.Operation

    /// See `ServiceUsageClient.disableService`.
    func disableService(withPolling: DisableServiceRequest) async throws -> any GoogleCloudGax
      .PollableOperation<DisableServiceResponse>

    /// See `ServiceUsageClient.getService`.
    func getService(request: GetServiceRequest) async throws -> GoogleApiServiceUsageV1.Service

    /// See `ServiceUsageClient.listServices`.
    func listServices(request: ListServicesRequest) async throws
      -> GoogleApiServiceUsageV1.ListServicesResponse

    /// See `ServiceUsageClient.listServices`.
    func listServices(
      byItem: ListServicesRequest
    ) throws -> any AsyncSequence<Service, Swift.Error>

    /// See `ServiceUsageClient.batchEnableServices`.
    func batchEnableServices(request: BatchEnableServicesRequest) async throws
      -> GoogleLongRunning.Operation

    /// See `ServiceUsageClient.batchEnableServices`.
    func batchEnableServices(withPolling: BatchEnableServicesRequest) async throws
      -> any GoogleCloudGax.PollableOperation<BatchEnableServicesResponse>

    /// See `ServiceUsageClient.batchGetServices`.
    func batchGetServices(request: BatchGetServicesRequest) async throws
      -> GoogleApiServiceUsageV1.BatchGetServicesResponse

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

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

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

    /// See `ServiceUsageClient.enableService`.
    func enableService(
      request: EnableServiceRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation

    /// See `ServiceUsageClient.enableService`.
    func enableService(
      withPolling: EnableServiceRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<EnableServiceResponse>

    /// See `ServiceUsageClient.disableService`.
    func disableService(
      request: DisableServiceRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation

    /// See `ServiceUsageClient.disableService`.
    func disableService(
      withPolling: DisableServiceRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<DisableServiceResponse>

    /// See `ServiceUsageClient.getService`.
    func getService(
      request: GetServiceRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleApiServiceUsageV1.Service

    /// See `ServiceUsageClient.listServices`.
    func listServices(
      request: ListServicesRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleApiServiceUsageV1.ListServicesResponse

    /// See `ServiceUsageClient.listServices`.
    func listServices(
      byItem: ListServicesRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<Service, Swift.Error>

    /// See `ServiceUsageClient.batchEnableServices`.
    func batchEnableServices(
      request: BatchEnableServicesRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation

    /// See `ServiceUsageClient.batchEnableServices`.
    func batchEnableServices(
      withPolling: BatchEnableServicesRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<BatchEnableServicesResponse>

    /// See `ServiceUsageClient.batchGetServices`.
    func batchGetServices(
      request: BatchGetServicesRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleApiServiceUsageV1.BatchGetServicesResponse

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

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

// Default implementations
extension Clients.ServiceUsageProtocol {
  public func enableService(request: EnableServiceRequest) async throws
    -> GoogleLongRunning.Operation
  {
    try await self.enableService(request: request, options: .init())
  }

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

  public func enableService(withPolling: EnableServiceRequest) async throws -> any GoogleCloudGax
    .PollableOperation<EnableServiceResponse>
  {
    try await self.enableService(withPolling: withPolling, options: .init())
  }

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

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

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

  public func disableService(withPolling: DisableServiceRequest) async throws -> any GoogleCloudGax
    .PollableOperation<DisableServiceResponse>
  {
    try await self.disableService(withPolling: withPolling, options: .init())
  }

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

  public func getService(request: GetServiceRequest) async throws -> GoogleApiServiceUsageV1.Service
  {
    try await self.getService(request: request, options: .init())
  }

  public func getService(
    request: GetServiceRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleApiServiceUsageV1.Service {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func listServices(request: ListServicesRequest) async throws
    -> GoogleApiServiceUsageV1.ListServicesResponse
  {
    try await self.listServices(request: request, options: .init())
  }

  public func listServices(
    request: ListServicesRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleApiServiceUsageV1.ListServicesResponse {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func listServices(
    byItem: ListServicesRequest
  ) throws -> any AsyncSequence<Service, Swift.Error> {
    try self.listServices(byItem: byItem, options: .init())
  }

  public func listServices(
    byItem: ListServicesRequest, options: GoogleCloudGax.RequestOptions
  ) throws -> any AsyncSequence<Service, Swift.Error> {
    let listRpc = {
      (token: Swift.String) async throws -> GoogleApiServiceUsageV1.ListServicesResponse in
      throw GoogleCloudGax.RequestError.unimplemented
    }
    return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
  }

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

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

  public func batchEnableServices(withPolling: BatchEnableServicesRequest) async throws
    -> any GoogleCloudGax.PollableOperation<BatchEnableServicesResponse>
  {
    try await self.batchEnableServices(withPolling: withPolling, options: .init())
  }

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

  public func batchGetServices(request: BatchGetServicesRequest) async throws
    -> GoogleApiServiceUsageV1.BatchGetServicesResponse
  {
    try await self.batchGetServices(request: request, options: .init())
  }

  public func batchGetServices(
    request: BatchGetServicesRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleApiServiceUsageV1.BatchGetServicesResponse {
    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)
  }
}
