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

/// Enables speech transcription and resource management.
///
/// @Snippet(path: "SpeechQuickstart")
public class SpeechClient: Clients.SpeechProtocol {
  let inner: any Clients.SpeechStub
  let pollingErrorPolicy: GoogleCloudGax.PollingErrorPolicy
  let pollingBackoffPolicy: GoogleCloudGax.BackoffPolicy

  /// Creates a new `SpeechClient` instance.
  public init(_ options: GoogleCloudGax.ClientOptions = .init()) throws {
    var inner: any Clients.SpeechStub = try Clients.SpeechTransport(options)
    inner = Clients.SpeechRetry(inner, options: options)
    if let logger = options.logger {
      inner = Clients.SpeechLogging(inner, logger: logger)
    }
    self.inner = inner
    self.pollingErrorPolicy = options.pollingErrorPolicy
    self.pollingBackoffPolicy = options.pollingBackoffPolicy
  }

  /// Creates a [Recognizer][google.cloud.speech.v2.Recognizer].
  ///
  /// [google.cloud.speech.v2.Recognizer]: <doc:Recognizer>
  ///
  /// @Snippet(path: "Speech_CreateRecognizer")
  public func createRecognizer(
    request: CreateRecognizerRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleLongRunning.Operation {
    try await self.inner.createRecognizer(request: request, options: options)
  }

  /// Creates a [Recognizer][google.cloud.speech.v2.Recognizer].
  ///
  /// [google.cloud.speech.v2.Recognizer]: <doc:Recognizer>
  ///
  /// @Snippet(path: "Speech_CreateRecognizer")
  public func createRecognizer(
    withPolling: CreateRecognizerRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> any GoogleCloudGax.PollableOperation<Recognizer> {
    let extractStatus = {
      (op: GoogleLongRunning.Operation) throws
        -> GoogleCloudGax._PollableOperationImpl<Recognizer>.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 Recognizer(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.createRecognizer(request: withPolling, options: options)
    let initialState = try extractStatus(rawOp)
    let poll = { () async throws -> GoogleCloudGax._PollableOperationImpl<Recognizer>.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 Recognizers.
  ///
  /// @Snippet(path: "Speech_ListRecognizers")
  public func listRecognizers(
    request: ListRecognizersRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleCloudSpeechV2.ListRecognizersResponse {
    try await self.inner.listRecognizers(request: request, options: options)
  }

  /// Lists Recognizers.
  ///
  /// @Snippet(path: "Speech_ListRecognizers")
  public func listRecognizers(
    byItem: ListRecognizersRequest, options: GoogleCloudGax.RequestOptions
  ) throws -> any AsyncSequence<Recognizer, Swift.Error> {
    let listRpc = {
      (token: Swift.String) async throws -> GoogleCloudSpeechV2.ListRecognizersResponse in
      var request = byItem
      request.pageToken = token
      return try await self.listRecognizers(request: request, options: options)
    }
    return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
  }

  /// Returns the requested
  /// [Recognizer][google.cloud.speech.v2.Recognizer]. Fails with
  /// [NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested Recognizer doesn't
  /// exist.
  ///
  /// [google.cloud.speech.v2.Recognizer]: <doc:Recognizer>
  ///
  /// @Snippet(path: "Speech_GetRecognizer")
  public func getRecognizer(
    request: GetRecognizerRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleCloudSpeechV2.Recognizer {
    try await self.inner.getRecognizer(request: request, options: options)
  }

  /// Updates the [Recognizer][google.cloud.speech.v2.Recognizer].
  ///
  /// [google.cloud.speech.v2.Recognizer]: <doc:Recognizer>
  ///
  /// @Snippet(path: "Speech_UpdateRecognizer")
  public func updateRecognizer(
    request: UpdateRecognizerRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleLongRunning.Operation {
    try await self.inner.updateRecognizer(request: request, options: options)
  }

  /// Updates the [Recognizer][google.cloud.speech.v2.Recognizer].
  ///
  /// [google.cloud.speech.v2.Recognizer]: <doc:Recognizer>
  ///
  /// @Snippet(path: "Speech_UpdateRecognizer")
  public func updateRecognizer(
    withPolling: UpdateRecognizerRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> any GoogleCloudGax.PollableOperation<Recognizer> {
    let extractStatus = {
      (op: GoogleLongRunning.Operation) throws
        -> GoogleCloudGax._PollableOperationImpl<Recognizer>.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 Recognizer(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.updateRecognizer(request: withPolling, options: options)
    let initialState = try extractStatus(rawOp)
    let poll = { () async throws -> GoogleCloudGax._PollableOperationImpl<Recognizer>.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 the [Recognizer][google.cloud.speech.v2.Recognizer].
  ///
  /// [google.cloud.speech.v2.Recognizer]: <doc:Recognizer>
  ///
  /// @Snippet(path: "Speech_DeleteRecognizer")
  public func deleteRecognizer(
    request: DeleteRecognizerRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleLongRunning.Operation {
    try await self.inner.deleteRecognizer(request: request, options: options)
  }

  /// Deletes the [Recognizer][google.cloud.speech.v2.Recognizer].
  ///
  /// [google.cloud.speech.v2.Recognizer]: <doc:Recognizer>
  ///
  /// @Snippet(path: "Speech_DeleteRecognizer")
  public func deleteRecognizer(
    withPolling: DeleteRecognizerRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> any GoogleCloudGax.PollableOperation<Recognizer> {
    let extractStatus = {
      (op: GoogleLongRunning.Operation) throws
        -> GoogleCloudGax._PollableOperationImpl<Recognizer>.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 Recognizer(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.deleteRecognizer(request: withPolling, options: options)
    let initialState = try extractStatus(rawOp)
    let poll = { () async throws -> GoogleCloudGax._PollableOperationImpl<Recognizer>.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,
    )
  }

  /// Undeletes the [Recognizer][google.cloud.speech.v2.Recognizer].
  ///
  /// [google.cloud.speech.v2.Recognizer]: <doc:Recognizer>
  ///
  /// @Snippet(path: "Speech_UndeleteRecognizer")
  public func undeleteRecognizer(
    request: UndeleteRecognizerRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleLongRunning.Operation {
    try await self.inner.undeleteRecognizer(request: request, options: options)
  }

  /// Undeletes the [Recognizer][google.cloud.speech.v2.Recognizer].
  ///
  /// [google.cloud.speech.v2.Recognizer]: <doc:Recognizer>
  ///
  /// @Snippet(path: "Speech_UndeleteRecognizer")
  public func undeleteRecognizer(
    withPolling: UndeleteRecognizerRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> any GoogleCloudGax.PollableOperation<Recognizer> {
    let extractStatus = {
      (op: GoogleLongRunning.Operation) throws
        -> GoogleCloudGax._PollableOperationImpl<Recognizer>.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 Recognizer(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.undeleteRecognizer(request: withPolling, options: options)
    let initialState = try extractStatus(rawOp)
    let poll = { () async throws -> GoogleCloudGax._PollableOperationImpl<Recognizer>.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,
    )
  }

  /// Performs synchronous Speech recognition: receive results after all audio
  /// has been sent and processed.
  ///
  /// @Snippet(path: "Speech_Recognize")
  public func recognize(
    request: RecognizeRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleCloudSpeechV2.RecognizeResponse {
    try await self.inner.recognize(request: request, options: options)
  }

  /// Performs batch asynchronous speech recognition: send a request with N
  /// audio files and receive a long running operation that can be polled to see
  /// when the transcriptions are finished.
  ///
  /// @Snippet(path: "Speech_BatchRecognize")
  public func batchRecognize(
    request: BatchRecognizeRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleLongRunning.Operation {
    try await self.inner.batchRecognize(request: request, options: options)
  }

  /// Performs batch asynchronous speech recognition: send a request with N
  /// audio files and receive a long running operation that can be polled to see
  /// when the transcriptions are finished.
  ///
  /// @Snippet(path: "Speech_BatchRecognize")
  public func batchRecognize(
    withPolling: BatchRecognizeRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> any GoogleCloudGax.PollableOperation<BatchRecognizeResponse> {
    let extractStatus = {
      (op: GoogleLongRunning.Operation) throws
        -> GoogleCloudGax._PollableOperationImpl<BatchRecognizeResponse>.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 BatchRecognizeResponse(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.batchRecognize(request: withPolling, options: options)
    let initialState = try extractStatus(rawOp)
    let poll = {
      () async throws -> GoogleCloudGax._PollableOperationImpl<BatchRecognizeResponse>.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 requested [Config][google.cloud.speech.v2.Config].
  ///
  /// [google.cloud.speech.v2.Config]: <doc:Config>
  ///
  /// @Snippet(path: "Speech_GetConfig")
  public func getConfig(
    request: GetConfigRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleCloudSpeechV2.Config {
    try await self.inner.getConfig(request: request, options: options)
  }

  /// Updates the [Config][google.cloud.speech.v2.Config].
  ///
  /// [google.cloud.speech.v2.Config]: <doc:Config>
  ///
  /// @Snippet(path: "Speech_UpdateConfig")
  public func updateConfig(
    request: UpdateConfigRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleCloudSpeechV2.Config {
    try await self.inner.updateConfig(request: request, options: options)
  }

  /// Creates a [CustomClass][google.cloud.speech.v2.CustomClass].
  ///
  /// [google.cloud.speech.v2.CustomClass]: <doc:CustomClass>
  ///
  /// @Snippet(path: "Speech_CreateCustomClass")
  public func createCustomClass(
    request: CreateCustomClassRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleLongRunning.Operation {
    try await self.inner.createCustomClass(request: request, options: options)
  }

  /// Creates a [CustomClass][google.cloud.speech.v2.CustomClass].
  ///
  /// [google.cloud.speech.v2.CustomClass]: <doc:CustomClass>
  ///
  /// @Snippet(path: "Speech_CreateCustomClass")
  public func createCustomClass(
    withPolling: CreateCustomClassRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> any GoogleCloudGax.PollableOperation<CustomClass> {
    let extractStatus = {
      (op: GoogleLongRunning.Operation) throws
        -> GoogleCloudGax._PollableOperationImpl<CustomClass>.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 CustomClass(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.createCustomClass(request: withPolling, options: options)
    let initialState = try extractStatus(rawOp)
    let poll = { () async throws -> GoogleCloudGax._PollableOperationImpl<CustomClass>.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 CustomClasses.
  ///
  /// @Snippet(path: "Speech_ListCustomClasses")
  public func listCustomClasses(
    request: ListCustomClassesRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleCloudSpeechV2.ListCustomClassesResponse {
    try await self.inner.listCustomClasses(request: request, options: options)
  }

  /// Lists CustomClasses.
  ///
  /// @Snippet(path: "Speech_ListCustomClasses")
  public func listCustomClasses(
    byItem: ListCustomClassesRequest, options: GoogleCloudGax.RequestOptions
  ) throws -> any AsyncSequence<CustomClass, Swift.Error> {
    let listRpc = {
      (token: Swift.String) async throws -> GoogleCloudSpeechV2.ListCustomClassesResponse in
      var request = byItem
      request.pageToken = token
      return try await self.listCustomClasses(request: request, options: options)
    }
    return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
  }

  /// Returns the requested
  /// [CustomClass][google.cloud.speech.v2.CustomClass].
  ///
  /// [google.cloud.speech.v2.CustomClass]: <doc:CustomClass>
  ///
  /// @Snippet(path: "Speech_GetCustomClass")
  public func getCustomClass(
    request: GetCustomClassRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleCloudSpeechV2.CustomClass {
    try await self.inner.getCustomClass(request: request, options: options)
  }

  /// Updates the [CustomClass][google.cloud.speech.v2.CustomClass].
  ///
  /// [google.cloud.speech.v2.CustomClass]: <doc:CustomClass>
  ///
  /// @Snippet(path: "Speech_UpdateCustomClass")
  public func updateCustomClass(
    request: UpdateCustomClassRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleLongRunning.Operation {
    try await self.inner.updateCustomClass(request: request, options: options)
  }

  /// Updates the [CustomClass][google.cloud.speech.v2.CustomClass].
  ///
  /// [google.cloud.speech.v2.CustomClass]: <doc:CustomClass>
  ///
  /// @Snippet(path: "Speech_UpdateCustomClass")
  public func updateCustomClass(
    withPolling: UpdateCustomClassRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> any GoogleCloudGax.PollableOperation<CustomClass> {
    let extractStatus = {
      (op: GoogleLongRunning.Operation) throws
        -> GoogleCloudGax._PollableOperationImpl<CustomClass>.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 CustomClass(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.updateCustomClass(request: withPolling, options: options)
    let initialState = try extractStatus(rawOp)
    let poll = { () async throws -> GoogleCloudGax._PollableOperationImpl<CustomClass>.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 the [CustomClass][google.cloud.speech.v2.CustomClass].
  ///
  /// [google.cloud.speech.v2.CustomClass]: <doc:CustomClass>
  ///
  /// @Snippet(path: "Speech_DeleteCustomClass")
  public func deleteCustomClass(
    request: DeleteCustomClassRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleLongRunning.Operation {
    try await self.inner.deleteCustomClass(request: request, options: options)
  }

  /// Deletes the [CustomClass][google.cloud.speech.v2.CustomClass].
  ///
  /// [google.cloud.speech.v2.CustomClass]: <doc:CustomClass>
  ///
  /// @Snippet(path: "Speech_DeleteCustomClass")
  public func deleteCustomClass(
    withPolling: DeleteCustomClassRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> any GoogleCloudGax.PollableOperation<CustomClass> {
    let extractStatus = {
      (op: GoogleLongRunning.Operation) throws
        -> GoogleCloudGax._PollableOperationImpl<CustomClass>.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 CustomClass(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.deleteCustomClass(request: withPolling, options: options)
    let initialState = try extractStatus(rawOp)
    let poll = { () async throws -> GoogleCloudGax._PollableOperationImpl<CustomClass>.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,
    )
  }

  /// Undeletes the [CustomClass][google.cloud.speech.v2.CustomClass].
  ///
  /// [google.cloud.speech.v2.CustomClass]: <doc:CustomClass>
  ///
  /// @Snippet(path: "Speech_UndeleteCustomClass")
  public func undeleteCustomClass(
    request: UndeleteCustomClassRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleLongRunning.Operation {
    try await self.inner.undeleteCustomClass(request: request, options: options)
  }

  /// Undeletes the [CustomClass][google.cloud.speech.v2.CustomClass].
  ///
  /// [google.cloud.speech.v2.CustomClass]: <doc:CustomClass>
  ///
  /// @Snippet(path: "Speech_UndeleteCustomClass")
  public func undeleteCustomClass(
    withPolling: UndeleteCustomClassRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> any GoogleCloudGax.PollableOperation<CustomClass> {
    let extractStatus = {
      (op: GoogleLongRunning.Operation) throws
        -> GoogleCloudGax._PollableOperationImpl<CustomClass>.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 CustomClass(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.undeleteCustomClass(request: withPolling, options: options)
    let initialState = try extractStatus(rawOp)
    let poll = { () async throws -> GoogleCloudGax._PollableOperationImpl<CustomClass>.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,
    )
  }

  /// Creates a [PhraseSet][google.cloud.speech.v2.PhraseSet].
  ///
  /// [google.cloud.speech.v2.PhraseSet]: <doc:PhraseSet>
  ///
  /// @Snippet(path: "Speech_CreatePhraseSet")
  public func createPhraseSet(
    request: CreatePhraseSetRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleLongRunning.Operation {
    try await self.inner.createPhraseSet(request: request, options: options)
  }

  /// Creates a [PhraseSet][google.cloud.speech.v2.PhraseSet].
  ///
  /// [google.cloud.speech.v2.PhraseSet]: <doc:PhraseSet>
  ///
  /// @Snippet(path: "Speech_CreatePhraseSet")
  public func createPhraseSet(
    withPolling: CreatePhraseSetRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> any GoogleCloudGax.PollableOperation<PhraseSet> {
    let extractStatus = {
      (op: GoogleLongRunning.Operation) throws
        -> GoogleCloudGax._PollableOperationImpl<PhraseSet>.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 PhraseSet(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.createPhraseSet(request: withPolling, options: options)
    let initialState = try extractStatus(rawOp)
    let poll = { () async throws -> GoogleCloudGax._PollableOperationImpl<PhraseSet>.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 PhraseSets.
  ///
  /// @Snippet(path: "Speech_ListPhraseSets")
  public func listPhraseSets(
    request: ListPhraseSetsRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleCloudSpeechV2.ListPhraseSetsResponse {
    try await self.inner.listPhraseSets(request: request, options: options)
  }

  /// Lists PhraseSets.
  ///
  /// @Snippet(path: "Speech_ListPhraseSets")
  public func listPhraseSets(
    byItem: ListPhraseSetsRequest, options: GoogleCloudGax.RequestOptions
  ) throws -> any AsyncSequence<PhraseSet, Swift.Error> {
    let listRpc = {
      (token: Swift.String) async throws -> GoogleCloudSpeechV2.ListPhraseSetsResponse in
      var request = byItem
      request.pageToken = token
      return try await self.listPhraseSets(request: request, options: options)
    }
    return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
  }

  /// Returns the requested
  /// [PhraseSet][google.cloud.speech.v2.PhraseSet].
  ///
  /// [google.cloud.speech.v2.PhraseSet]: <doc:PhraseSet>
  ///
  /// @Snippet(path: "Speech_GetPhraseSet")
  public func getPhraseSet(
    request: GetPhraseSetRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleCloudSpeechV2.PhraseSet {
    try await self.inner.getPhraseSet(request: request, options: options)
  }

  /// Updates the [PhraseSet][google.cloud.speech.v2.PhraseSet].
  ///
  /// [google.cloud.speech.v2.PhraseSet]: <doc:PhraseSet>
  ///
  /// @Snippet(path: "Speech_UpdatePhraseSet")
  public func updatePhraseSet(
    request: UpdatePhraseSetRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleLongRunning.Operation {
    try await self.inner.updatePhraseSet(request: request, options: options)
  }

  /// Updates the [PhraseSet][google.cloud.speech.v2.PhraseSet].
  ///
  /// [google.cloud.speech.v2.PhraseSet]: <doc:PhraseSet>
  ///
  /// @Snippet(path: "Speech_UpdatePhraseSet")
  public func updatePhraseSet(
    withPolling: UpdatePhraseSetRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> any GoogleCloudGax.PollableOperation<PhraseSet> {
    let extractStatus = {
      (op: GoogleLongRunning.Operation) throws
        -> GoogleCloudGax._PollableOperationImpl<PhraseSet>.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 PhraseSet(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.updatePhraseSet(request: withPolling, options: options)
    let initialState = try extractStatus(rawOp)
    let poll = { () async throws -> GoogleCloudGax._PollableOperationImpl<PhraseSet>.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 the [PhraseSet][google.cloud.speech.v2.PhraseSet].
  ///
  /// [google.cloud.speech.v2.PhraseSet]: <doc:PhraseSet>
  ///
  /// @Snippet(path: "Speech_DeletePhraseSet")
  public func deletePhraseSet(
    request: DeletePhraseSetRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleLongRunning.Operation {
    try await self.inner.deletePhraseSet(request: request, options: options)
  }

  /// Deletes the [PhraseSet][google.cloud.speech.v2.PhraseSet].
  ///
  /// [google.cloud.speech.v2.PhraseSet]: <doc:PhraseSet>
  ///
  /// @Snippet(path: "Speech_DeletePhraseSet")
  public func deletePhraseSet(
    withPolling: DeletePhraseSetRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> any GoogleCloudGax.PollableOperation<PhraseSet> {
    let extractStatus = {
      (op: GoogleLongRunning.Operation) throws
        -> GoogleCloudGax._PollableOperationImpl<PhraseSet>.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 PhraseSet(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.deletePhraseSet(request: withPolling, options: options)
    let initialState = try extractStatus(rawOp)
    let poll = { () async throws -> GoogleCloudGax._PollableOperationImpl<PhraseSet>.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,
    )
  }

  /// Undeletes the [PhraseSet][google.cloud.speech.v2.PhraseSet].
  ///
  /// [google.cloud.speech.v2.PhraseSet]: <doc:PhraseSet>
  ///
  /// @Snippet(path: "Speech_UndeletePhraseSet")
  public func undeletePhraseSet(
    request: UndeletePhraseSetRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleLongRunning.Operation {
    try await self.inner.undeletePhraseSet(request: request, options: options)
  }

  /// Undeletes the [PhraseSet][google.cloud.speech.v2.PhraseSet].
  ///
  /// [google.cloud.speech.v2.PhraseSet]: <doc:PhraseSet>
  ///
  /// @Snippet(path: "Speech_UndeletePhraseSet")
  public func undeletePhraseSet(
    withPolling: UndeletePhraseSetRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> any GoogleCloudGax.PollableOperation<PhraseSet> {
    let extractStatus = {
      (op: GoogleLongRunning.Operation) throws
        -> GoogleCloudGax._PollableOperationImpl<PhraseSet>.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 PhraseSet(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.undeletePhraseSet(request: withPolling, options: options)
    let initialState = try extractStatus(rawOp)
    let poll = { () async throws -> GoogleCloudGax._PollableOperationImpl<PhraseSet>.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: "Speech_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: "Speech_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: "Speech_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: "Speech_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: "Speech_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: "Speech_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: "Speech_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: "Speech_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 `SpeechClient`.
  ///
  /// To mock `SpeechClient` change your functions to receive
  /// `some SpeechProtocol` or `any SpeechProtocol`
  /// and pass a mock implementation in your tests.
  public protocol SpeechProtocol {
    /// See `SpeechClient.createRecognizer`.
    func createRecognizer(request: CreateRecognizerRequest) async throws
      -> GoogleLongRunning.Operation

    /// See `SpeechClient.createRecognizer`.
    func createRecognizer(withPolling: CreateRecognizerRequest) async throws -> any GoogleCloudGax
      .PollableOperation<Recognizer>

    /// See `SpeechClient.createRecognizer`.
    func createRecognizer(
      parent: Swift.String,
      recognizer: Recognizer?,
      recognizerId: Swift.String,
    ) async throws -> any GoogleCloudGax.PollableOperation<Recognizer>

    /// See `SpeechClient.listRecognizers`.
    func listRecognizers(request: ListRecognizersRequest) async throws
      -> GoogleCloudSpeechV2.ListRecognizersResponse

    /// See `SpeechClient.listRecognizers`.
    func listRecognizers(
      byItem: ListRecognizersRequest
    ) throws -> any AsyncSequence<Recognizer, Swift.Error>

    /// See `SpeechClient.listRecognizers`.
    func listRecognizers(
      parent: Swift.String,
    ) throws -> any AsyncSequence<Recognizer, Swift.Error>

    /// See `SpeechClient.getRecognizer`.
    func getRecognizer(request: GetRecognizerRequest) async throws -> GoogleCloudSpeechV2.Recognizer

    /// See `SpeechClient.getRecognizer`.
    func getRecognizer(
      name: Swift.String,
    ) async throws -> GoogleCloudSpeechV2.Recognizer

    /// See `SpeechClient.updateRecognizer`.
    func updateRecognizer(request: UpdateRecognizerRequest) async throws
      -> GoogleLongRunning.Operation

    /// See `SpeechClient.updateRecognizer`.
    func updateRecognizer(withPolling: UpdateRecognizerRequest) async throws -> any GoogleCloudGax
      .PollableOperation<Recognizer>

    /// See `SpeechClient.updateRecognizer`.
    func updateRecognizer(
      recognizer: Recognizer?,
      updateMask: GoogleCloudWkt.FieldMask?,
    ) async throws -> any GoogleCloudGax.PollableOperation<Recognizer>

    /// See `SpeechClient.deleteRecognizer`.
    func deleteRecognizer(request: DeleteRecognizerRequest) async throws
      -> GoogleLongRunning.Operation

    /// See `SpeechClient.deleteRecognizer`.
    func deleteRecognizer(withPolling: DeleteRecognizerRequest) async throws -> any GoogleCloudGax
      .PollableOperation<Recognizer>

    /// See `SpeechClient.deleteRecognizer`.
    func deleteRecognizer(
      name: Swift.String,
    ) async throws -> any GoogleCloudGax.PollableOperation<Recognizer>

    /// See `SpeechClient.undeleteRecognizer`.
    func undeleteRecognizer(request: UndeleteRecognizerRequest) async throws
      -> GoogleLongRunning.Operation

    /// See `SpeechClient.undeleteRecognizer`.
    func undeleteRecognizer(withPolling: UndeleteRecognizerRequest) async throws
      -> any GoogleCloudGax.PollableOperation<Recognizer>

    /// See `SpeechClient.undeleteRecognizer`.
    func undeleteRecognizer(
      name: Swift.String,
    ) async throws -> any GoogleCloudGax.PollableOperation<Recognizer>

    /// See `SpeechClient.recognize`.
    func recognize(request: RecognizeRequest) async throws -> GoogleCloudSpeechV2.RecognizeResponse

    /// See `SpeechClient.recognize`.
    func recognize(
      recognizer: Swift.String,
      config: RecognitionConfig?,
      configMask: GoogleCloudWkt.FieldMask?,
      content: Foundation.Data,
    ) async throws -> GoogleCloudSpeechV2.RecognizeResponse

    /// See `SpeechClient.recognize`.
    func recognize(
      recognizer: Swift.String,
      config: RecognitionConfig?,
      configMask: GoogleCloudWkt.FieldMask?,
      uri: Swift.String,
    ) async throws -> GoogleCloudSpeechV2.RecognizeResponse

    /// See `SpeechClient.batchRecognize`.
    func batchRecognize(request: BatchRecognizeRequest) async throws -> GoogleLongRunning.Operation

    /// See `SpeechClient.batchRecognize`.
    func batchRecognize(withPolling: BatchRecognizeRequest) async throws -> any GoogleCloudGax
      .PollableOperation<BatchRecognizeResponse>

    /// See `SpeechClient.batchRecognize`.
    func batchRecognize(
      recognizer: Swift.String,
      config: RecognitionConfig?,
      configMask: GoogleCloudWkt.FieldMask?,
      files: [BatchRecognizeFileMetadata],
    ) async throws -> any GoogleCloudGax.PollableOperation<BatchRecognizeResponse>

    /// See `SpeechClient.getConfig`.
    func getConfig(request: GetConfigRequest) async throws -> GoogleCloudSpeechV2.Config

    /// See `SpeechClient.getConfig`.
    func getConfig(
      name: Swift.String,
    ) async throws -> GoogleCloudSpeechV2.Config

    /// See `SpeechClient.updateConfig`.
    func updateConfig(request: UpdateConfigRequest) async throws -> GoogleCloudSpeechV2.Config

    /// See `SpeechClient.updateConfig`.
    func updateConfig(
      config: Config?,
      updateMask: GoogleCloudWkt.FieldMask?,
    ) async throws -> GoogleCloudSpeechV2.Config

    /// See `SpeechClient.createCustomClass`.
    func createCustomClass(request: CreateCustomClassRequest) async throws
      -> GoogleLongRunning.Operation

    /// See `SpeechClient.createCustomClass`.
    func createCustomClass(withPolling: CreateCustomClassRequest) async throws -> any GoogleCloudGax
      .PollableOperation<CustomClass>

    /// See `SpeechClient.createCustomClass`.
    func createCustomClass(
      parent: Swift.String,
      customClass: CustomClass?,
      customClassId: Swift.String,
    ) async throws -> any GoogleCloudGax.PollableOperation<CustomClass>

    /// See `SpeechClient.listCustomClasses`.
    func listCustomClasses(request: ListCustomClassesRequest) async throws
      -> GoogleCloudSpeechV2.ListCustomClassesResponse

    /// See `SpeechClient.listCustomClasses`.
    func listCustomClasses(
      byItem: ListCustomClassesRequest
    ) throws -> any AsyncSequence<CustomClass, Swift.Error>

    /// See `SpeechClient.listCustomClasses`.
    func listCustomClasses(
      parent: Swift.String,
    ) throws -> any AsyncSequence<CustomClass, Swift.Error>

    /// See `SpeechClient.getCustomClass`.
    func getCustomClass(request: GetCustomClassRequest) async throws
      -> GoogleCloudSpeechV2.CustomClass

    /// See `SpeechClient.getCustomClass`.
    func getCustomClass(
      name: Swift.String,
    ) async throws -> GoogleCloudSpeechV2.CustomClass

    /// See `SpeechClient.updateCustomClass`.
    func updateCustomClass(request: UpdateCustomClassRequest) async throws
      -> GoogleLongRunning.Operation

    /// See `SpeechClient.updateCustomClass`.
    func updateCustomClass(withPolling: UpdateCustomClassRequest) async throws -> any GoogleCloudGax
      .PollableOperation<CustomClass>

    /// See `SpeechClient.updateCustomClass`.
    func updateCustomClass(
      customClass: CustomClass?,
      updateMask: GoogleCloudWkt.FieldMask?,
    ) async throws -> any GoogleCloudGax.PollableOperation<CustomClass>

    /// See `SpeechClient.deleteCustomClass`.
    func deleteCustomClass(request: DeleteCustomClassRequest) async throws
      -> GoogleLongRunning.Operation

    /// See `SpeechClient.deleteCustomClass`.
    func deleteCustomClass(withPolling: DeleteCustomClassRequest) async throws -> any GoogleCloudGax
      .PollableOperation<CustomClass>

    /// See `SpeechClient.deleteCustomClass`.
    func deleteCustomClass(
      name: Swift.String,
    ) async throws -> any GoogleCloudGax.PollableOperation<CustomClass>

    /// See `SpeechClient.undeleteCustomClass`.
    func undeleteCustomClass(request: UndeleteCustomClassRequest) async throws
      -> GoogleLongRunning.Operation

    /// See `SpeechClient.undeleteCustomClass`.
    func undeleteCustomClass(withPolling: UndeleteCustomClassRequest) async throws
      -> any GoogleCloudGax.PollableOperation<CustomClass>

    /// See `SpeechClient.undeleteCustomClass`.
    func undeleteCustomClass(
      name: Swift.String,
    ) async throws -> any GoogleCloudGax.PollableOperation<CustomClass>

    /// See `SpeechClient.createPhraseSet`.
    func createPhraseSet(request: CreatePhraseSetRequest) async throws
      -> GoogleLongRunning.Operation

    /// See `SpeechClient.createPhraseSet`.
    func createPhraseSet(withPolling: CreatePhraseSetRequest) async throws -> any GoogleCloudGax
      .PollableOperation<PhraseSet>

    /// See `SpeechClient.createPhraseSet`.
    func createPhraseSet(
      parent: Swift.String,
      phraseSet: PhraseSet?,
      phraseSetId: Swift.String,
    ) async throws -> any GoogleCloudGax.PollableOperation<PhraseSet>

    /// See `SpeechClient.listPhraseSets`.
    func listPhraseSets(request: ListPhraseSetsRequest) async throws
      -> GoogleCloudSpeechV2.ListPhraseSetsResponse

    /// See `SpeechClient.listPhraseSets`.
    func listPhraseSets(
      byItem: ListPhraseSetsRequest
    ) throws -> any AsyncSequence<PhraseSet, Swift.Error>

    /// See `SpeechClient.listPhraseSets`.
    func listPhraseSets(
      parent: Swift.String,
    ) throws -> any AsyncSequence<PhraseSet, Swift.Error>

    /// See `SpeechClient.getPhraseSet`.
    func getPhraseSet(request: GetPhraseSetRequest) async throws -> GoogleCloudSpeechV2.PhraseSet

    /// See `SpeechClient.getPhraseSet`.
    func getPhraseSet(
      name: Swift.String,
    ) async throws -> GoogleCloudSpeechV2.PhraseSet

    /// See `SpeechClient.updatePhraseSet`.
    func updatePhraseSet(request: UpdatePhraseSetRequest) async throws
      -> GoogleLongRunning.Operation

    /// See `SpeechClient.updatePhraseSet`.
    func updatePhraseSet(withPolling: UpdatePhraseSetRequest) async throws -> any GoogleCloudGax
      .PollableOperation<PhraseSet>

    /// See `SpeechClient.updatePhraseSet`.
    func updatePhraseSet(
      phraseSet: PhraseSet?,
      updateMask: GoogleCloudWkt.FieldMask?,
    ) async throws -> any GoogleCloudGax.PollableOperation<PhraseSet>

    /// See `SpeechClient.deletePhraseSet`.
    func deletePhraseSet(request: DeletePhraseSetRequest) async throws
      -> GoogleLongRunning.Operation

    /// See `SpeechClient.deletePhraseSet`.
    func deletePhraseSet(withPolling: DeletePhraseSetRequest) async throws -> any GoogleCloudGax
      .PollableOperation<PhraseSet>

    /// See `SpeechClient.deletePhraseSet`.
    func deletePhraseSet(
      name: Swift.String,
    ) async throws -> any GoogleCloudGax.PollableOperation<PhraseSet>

    /// See `SpeechClient.undeletePhraseSet`.
    func undeletePhraseSet(request: UndeletePhraseSetRequest) async throws
      -> GoogleLongRunning.Operation

    /// See `SpeechClient.undeletePhraseSet`.
    func undeletePhraseSet(withPolling: UndeletePhraseSetRequest) async throws -> any GoogleCloudGax
      .PollableOperation<PhraseSet>

    /// See `SpeechClient.undeletePhraseSet`.
    func undeletePhraseSet(
      name: Swift.String,
    ) async throws -> any GoogleCloudGax.PollableOperation<PhraseSet>

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

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

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

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

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

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

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

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

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

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

    /// See `SpeechClient.createRecognizer`.
    func createRecognizer(
      request: CreateRecognizerRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation

    /// See `SpeechClient.createRecognizer`.
    func createRecognizer(
      withPolling: CreateRecognizerRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<Recognizer>

    /// See `SpeechClient.listRecognizers`.
    func listRecognizers(
      request: ListRecognizersRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudSpeechV2.ListRecognizersResponse

    /// See `SpeechClient.listRecognizers`.
    func listRecognizers(
      byItem: ListRecognizersRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<Recognizer, Swift.Error>

    /// See `SpeechClient.getRecognizer`.
    func getRecognizer(
      request: GetRecognizerRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudSpeechV2.Recognizer

    /// See `SpeechClient.updateRecognizer`.
    func updateRecognizer(
      request: UpdateRecognizerRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation

    /// See `SpeechClient.updateRecognizer`.
    func updateRecognizer(
      withPolling: UpdateRecognizerRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<Recognizer>

    /// See `SpeechClient.deleteRecognizer`.
    func deleteRecognizer(
      request: DeleteRecognizerRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation

    /// See `SpeechClient.deleteRecognizer`.
    func deleteRecognizer(
      withPolling: DeleteRecognizerRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<Recognizer>

    /// See `SpeechClient.undeleteRecognizer`.
    func undeleteRecognizer(
      request: UndeleteRecognizerRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation

    /// See `SpeechClient.undeleteRecognizer`.
    func undeleteRecognizer(
      withPolling: UndeleteRecognizerRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<Recognizer>

    /// See `SpeechClient.recognize`.
    func recognize(
      request: RecognizeRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudSpeechV2.RecognizeResponse

    /// See `SpeechClient.batchRecognize`.
    func batchRecognize(
      request: BatchRecognizeRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation

    /// See `SpeechClient.batchRecognize`.
    func batchRecognize(
      withPolling: BatchRecognizeRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<BatchRecognizeResponse>

    /// See `SpeechClient.getConfig`.
    func getConfig(
      request: GetConfigRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudSpeechV2.Config

    /// See `SpeechClient.updateConfig`.
    func updateConfig(
      request: UpdateConfigRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudSpeechV2.Config

    /// See `SpeechClient.createCustomClass`.
    func createCustomClass(
      request: CreateCustomClassRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation

    /// See `SpeechClient.createCustomClass`.
    func createCustomClass(
      withPolling: CreateCustomClassRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<CustomClass>

    /// See `SpeechClient.listCustomClasses`.
    func listCustomClasses(
      request: ListCustomClassesRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudSpeechV2.ListCustomClassesResponse

    /// See `SpeechClient.listCustomClasses`.
    func listCustomClasses(
      byItem: ListCustomClassesRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<CustomClass, Swift.Error>

    /// See `SpeechClient.getCustomClass`.
    func getCustomClass(
      request: GetCustomClassRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudSpeechV2.CustomClass

    /// See `SpeechClient.updateCustomClass`.
    func updateCustomClass(
      request: UpdateCustomClassRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation

    /// See `SpeechClient.updateCustomClass`.
    func updateCustomClass(
      withPolling: UpdateCustomClassRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<CustomClass>

    /// See `SpeechClient.deleteCustomClass`.
    func deleteCustomClass(
      request: DeleteCustomClassRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation

    /// See `SpeechClient.deleteCustomClass`.
    func deleteCustomClass(
      withPolling: DeleteCustomClassRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<CustomClass>

    /// See `SpeechClient.undeleteCustomClass`.
    func undeleteCustomClass(
      request: UndeleteCustomClassRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation

    /// See `SpeechClient.undeleteCustomClass`.
    func undeleteCustomClass(
      withPolling: UndeleteCustomClassRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<CustomClass>

    /// See `SpeechClient.createPhraseSet`.
    func createPhraseSet(
      request: CreatePhraseSetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation

    /// See `SpeechClient.createPhraseSet`.
    func createPhraseSet(
      withPolling: CreatePhraseSetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<PhraseSet>

    /// See `SpeechClient.listPhraseSets`.
    func listPhraseSets(
      request: ListPhraseSetsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudSpeechV2.ListPhraseSetsResponse

    /// See `SpeechClient.listPhraseSets`.
    func listPhraseSets(
      byItem: ListPhraseSetsRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<PhraseSet, Swift.Error>

    /// See `SpeechClient.getPhraseSet`.
    func getPhraseSet(
      request: GetPhraseSetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudSpeechV2.PhraseSet

    /// See `SpeechClient.updatePhraseSet`.
    func updatePhraseSet(
      request: UpdatePhraseSetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation

    /// See `SpeechClient.updatePhraseSet`.
    func updatePhraseSet(
      withPolling: UpdatePhraseSetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<PhraseSet>

    /// See `SpeechClient.deletePhraseSet`.
    func deletePhraseSet(
      request: DeletePhraseSetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation

    /// See `SpeechClient.deletePhraseSet`.
    func deletePhraseSet(
      withPolling: DeletePhraseSetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<PhraseSet>

    /// See `SpeechClient.undeletePhraseSet`.
    func undeletePhraseSet(
      request: UndeletePhraseSetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation

    /// See `SpeechClient.undeletePhraseSet`.
    func undeletePhraseSet(
      withPolling: UndeletePhraseSetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<PhraseSet>

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

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

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

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

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

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

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

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

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

  public func createRecognizer(withPolling: CreateRecognizerRequest) async throws
    -> any GoogleCloudGax.PollableOperation<Recognizer>
  {
    try await self.createRecognizer(withPolling: withPolling, options: .init())
  }

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

  public func createRecognizer(
    parent: Swift.String,
    recognizer: Recognizer?,
    recognizerId: Swift.String,
  ) async throws -> any GoogleCloudGax.PollableOperation<Recognizer> {
    let request = CreateRecognizerRequest().with {
      $0.parent = parent
      $0.recognizer = recognizer
      $0.recognizerId = recognizerId
    }
    return try await self.createRecognizer(withPolling: request)
  }

  public func listRecognizers(request: ListRecognizersRequest) async throws
    -> GoogleCloudSpeechV2.ListRecognizersResponse
  {
    try await self.listRecognizers(request: request, options: .init())
  }

  public func listRecognizers(
    request: ListRecognizersRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleCloudSpeechV2.ListRecognizersResponse {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func listRecognizers(
    byItem: ListRecognizersRequest
  ) throws -> any AsyncSequence<Recognizer, Swift.Error> {
    try self.listRecognizers(byItem: byItem, options: .init())
  }

  public func listRecognizers(
    byItem: ListRecognizersRequest, options: GoogleCloudGax.RequestOptions
  ) throws -> any AsyncSequence<Recognizer, Swift.Error> {
    let listRpc = {
      (token: Swift.String) async throws -> GoogleCloudSpeechV2.ListRecognizersResponse in
      throw GoogleCloudGax.RequestError.unimplemented
    }
    return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
  }

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

  public func getRecognizer(request: GetRecognizerRequest) async throws
    -> GoogleCloudSpeechV2.Recognizer
  {
    try await self.getRecognizer(request: request, options: .init())
  }

  public func getRecognizer(
    request: GetRecognizerRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleCloudSpeechV2.Recognizer {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func getRecognizer(
    name: Swift.String,
  ) async throws -> GoogleCloudSpeechV2.Recognizer {
    let request = GetRecognizerRequest().with {
      $0.name = name
    }
    return try await self.getRecognizer(request: request)
  }

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

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

  public func updateRecognizer(withPolling: UpdateRecognizerRequest) async throws
    -> any GoogleCloudGax.PollableOperation<Recognizer>
  {
    try await self.updateRecognizer(withPolling: withPolling, options: .init())
  }

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

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

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

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

  public func deleteRecognizer(withPolling: DeleteRecognizerRequest) async throws
    -> any GoogleCloudGax.PollableOperation<Recognizer>
  {
    try await self.deleteRecognizer(withPolling: withPolling, options: .init())
  }

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

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

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

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

  public func undeleteRecognizer(withPolling: UndeleteRecognizerRequest) async throws
    -> any GoogleCloudGax.PollableOperation<Recognizer>
  {
    try await self.undeleteRecognizer(withPolling: withPolling, options: .init())
  }

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

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

  public func recognize(request: RecognizeRequest) async throws
    -> GoogleCloudSpeechV2.RecognizeResponse
  {
    try await self.recognize(request: request, options: .init())
  }

  public func recognize(
    request: RecognizeRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleCloudSpeechV2.RecognizeResponse {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func recognize(
    recognizer: Swift.String,
    config: RecognitionConfig?,
    configMask: GoogleCloudWkt.FieldMask?,
    content: Foundation.Data,
  ) async throws -> GoogleCloudSpeechV2.RecognizeResponse {
    let request = RecognizeRequest().with {
      $0.recognizer = recognizer
      $0.config = config
      $0.configMask = configMask
      $0.audioSource = .content(content)
    }
    return try await self.recognize(request: request)
  }

  public func recognize(
    recognizer: Swift.String,
    config: RecognitionConfig?,
    configMask: GoogleCloudWkt.FieldMask?,
    uri: Swift.String,
  ) async throws -> GoogleCloudSpeechV2.RecognizeResponse {
    let request = RecognizeRequest().with {
      $0.recognizer = recognizer
      $0.config = config
      $0.configMask = configMask
      $0.audioSource = .uri(uri)
    }
    return try await self.recognize(request: request)
  }

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

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

  public func batchRecognize(withPolling: BatchRecognizeRequest) async throws -> any GoogleCloudGax
    .PollableOperation<BatchRecognizeResponse>
  {
    try await self.batchRecognize(withPolling: withPolling, options: .init())
  }

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

  public func batchRecognize(
    recognizer: Swift.String,
    config: RecognitionConfig?,
    configMask: GoogleCloudWkt.FieldMask?,
    files: [BatchRecognizeFileMetadata],
  ) async throws -> any GoogleCloudGax.PollableOperation<BatchRecognizeResponse> {
    let request = BatchRecognizeRequest().with {
      $0.recognizer = recognizer
      $0.config = config
      $0.configMask = configMask
      $0.files = files
    }
    return try await self.batchRecognize(withPolling: request)
  }

  public func getConfig(request: GetConfigRequest) async throws -> GoogleCloudSpeechV2.Config {
    try await self.getConfig(request: request, options: .init())
  }

  public func getConfig(
    request: GetConfigRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleCloudSpeechV2.Config {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func getConfig(
    name: Swift.String,
  ) async throws -> GoogleCloudSpeechV2.Config {
    let request = GetConfigRequest().with {
      $0.name = name
    }
    return try await self.getConfig(request: request)
  }

  public func updateConfig(request: UpdateConfigRequest) async throws -> GoogleCloudSpeechV2.Config
  {
    try await self.updateConfig(request: request, options: .init())
  }

  public func updateConfig(
    request: UpdateConfigRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleCloudSpeechV2.Config {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func updateConfig(
    config: Config?,
    updateMask: GoogleCloudWkt.FieldMask?,
  ) async throws -> GoogleCloudSpeechV2.Config {
    let request = UpdateConfigRequest().with {
      $0.config = config
      $0.updateMask = updateMask
    }
    return try await self.updateConfig(request: request)
  }

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

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

  public func createCustomClass(withPolling: CreateCustomClassRequest) async throws
    -> any GoogleCloudGax.PollableOperation<CustomClass>
  {
    try await self.createCustomClass(withPolling: withPolling, options: .init())
  }

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

  public func createCustomClass(
    parent: Swift.String,
    customClass: CustomClass?,
    customClassId: Swift.String,
  ) async throws -> any GoogleCloudGax.PollableOperation<CustomClass> {
    let request = CreateCustomClassRequest().with {
      $0.parent = parent
      $0.customClass = customClass
      $0.customClassId = customClassId
    }
    return try await self.createCustomClass(withPolling: request)
  }

  public func listCustomClasses(request: ListCustomClassesRequest) async throws
    -> GoogleCloudSpeechV2.ListCustomClassesResponse
  {
    try await self.listCustomClasses(request: request, options: .init())
  }

  public func listCustomClasses(
    request: ListCustomClassesRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleCloudSpeechV2.ListCustomClassesResponse {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func listCustomClasses(
    byItem: ListCustomClassesRequest
  ) throws -> any AsyncSequence<CustomClass, Swift.Error> {
    try self.listCustomClasses(byItem: byItem, options: .init())
  }

  public func listCustomClasses(
    byItem: ListCustomClassesRequest, options: GoogleCloudGax.RequestOptions
  ) throws -> any AsyncSequence<CustomClass, Swift.Error> {
    let listRpc = {
      (token: Swift.String) async throws -> GoogleCloudSpeechV2.ListCustomClassesResponse in
      throw GoogleCloudGax.RequestError.unimplemented
    }
    return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
  }

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

  public func getCustomClass(request: GetCustomClassRequest) async throws
    -> GoogleCloudSpeechV2.CustomClass
  {
    try await self.getCustomClass(request: request, options: .init())
  }

  public func getCustomClass(
    request: GetCustomClassRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleCloudSpeechV2.CustomClass {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func getCustomClass(
    name: Swift.String,
  ) async throws -> GoogleCloudSpeechV2.CustomClass {
    let request = GetCustomClassRequest().with {
      $0.name = name
    }
    return try await self.getCustomClass(request: request)
  }

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

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

  public func updateCustomClass(withPolling: UpdateCustomClassRequest) async throws
    -> any GoogleCloudGax.PollableOperation<CustomClass>
  {
    try await self.updateCustomClass(withPolling: withPolling, options: .init())
  }

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

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

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

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

  public func deleteCustomClass(withPolling: DeleteCustomClassRequest) async throws
    -> any GoogleCloudGax.PollableOperation<CustomClass>
  {
    try await self.deleteCustomClass(withPolling: withPolling, options: .init())
  }

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

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

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

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

  public func undeleteCustomClass(withPolling: UndeleteCustomClassRequest) async throws
    -> any GoogleCloudGax.PollableOperation<CustomClass>
  {
    try await self.undeleteCustomClass(withPolling: withPolling, options: .init())
  }

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

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

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

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

  public func createPhraseSet(withPolling: CreatePhraseSetRequest) async throws
    -> any GoogleCloudGax.PollableOperation<PhraseSet>
  {
    try await self.createPhraseSet(withPolling: withPolling, options: .init())
  }

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

  public func createPhraseSet(
    parent: Swift.String,
    phraseSet: PhraseSet?,
    phraseSetId: Swift.String,
  ) async throws -> any GoogleCloudGax.PollableOperation<PhraseSet> {
    let request = CreatePhraseSetRequest().with {
      $0.parent = parent
      $0.phraseSet = phraseSet
      $0.phraseSetId = phraseSetId
    }
    return try await self.createPhraseSet(withPolling: request)
  }

  public func listPhraseSets(request: ListPhraseSetsRequest) async throws
    -> GoogleCloudSpeechV2.ListPhraseSetsResponse
  {
    try await self.listPhraseSets(request: request, options: .init())
  }

  public func listPhraseSets(
    request: ListPhraseSetsRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleCloudSpeechV2.ListPhraseSetsResponse {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func listPhraseSets(
    byItem: ListPhraseSetsRequest
  ) throws -> any AsyncSequence<PhraseSet, Swift.Error> {
    try self.listPhraseSets(byItem: byItem, options: .init())
  }

  public func listPhraseSets(
    byItem: ListPhraseSetsRequest, options: GoogleCloudGax.RequestOptions
  ) throws -> any AsyncSequence<PhraseSet, Swift.Error> {
    let listRpc = {
      (token: Swift.String) async throws -> GoogleCloudSpeechV2.ListPhraseSetsResponse in
      throw GoogleCloudGax.RequestError.unimplemented
    }
    return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
  }

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

  public func getPhraseSet(request: GetPhraseSetRequest) async throws
    -> GoogleCloudSpeechV2.PhraseSet
  {
    try await self.getPhraseSet(request: request, options: .init())
  }

  public func getPhraseSet(
    request: GetPhraseSetRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleCloudSpeechV2.PhraseSet {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func getPhraseSet(
    name: Swift.String,
  ) async throws -> GoogleCloudSpeechV2.PhraseSet {
    let request = GetPhraseSetRequest().with {
      $0.name = name
    }
    return try await self.getPhraseSet(request: request)
  }

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

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

  public func updatePhraseSet(withPolling: UpdatePhraseSetRequest) async throws
    -> any GoogleCloudGax.PollableOperation<PhraseSet>
  {
    try await self.updatePhraseSet(withPolling: withPolling, options: .init())
  }

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

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

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

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

  public func deletePhraseSet(withPolling: DeletePhraseSetRequest) async throws
    -> any GoogleCloudGax.PollableOperation<PhraseSet>
  {
    try await self.deletePhraseSet(withPolling: withPolling, options: .init())
  }

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

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

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

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

  public func undeletePhraseSet(withPolling: UndeletePhraseSetRequest) async throws
    -> any GoogleCloudGax.PollableOperation<PhraseSet>
  {
    try await self.undeletePhraseSet(withPolling: withPolling, options: .init())
  }

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

  public func undeletePhraseSet(
    name: Swift.String,
  ) async throws -> any GoogleCloudGax.PollableOperation<PhraseSet> {
    let request = UndeletePhraseSetRequest().with {
      $0.name = name
    }
    return try await self.undeletePhraseSet(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)
  }
}
