// Code generated by sidekick. DO NOT EDIT.
//
// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

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

  /// Service for managing [Engine][google.cloud.discoveryengine.v1.Engine]
  /// configuration.
  ///
  /// [google.cloud.discoveryengine.v1.Engine]: <doc:Engine>
  ///
  /// @Snippet(path: "EngineServiceQuickstart")
  public class EngineServiceClient: Clients.EngineServiceProtocol {
    let inner: any Clients.EngineServiceStub
    let pollingErrorPolicy: GoogleCloudGax.PollingErrorPolicy
    let pollingBackoffPolicy: GoogleCloudGax.BackoffPolicy

    /// Creates a new `EngineServiceClient` instance.
    public init(_ options: GoogleCloudGax.ClientOptions = .init()) throws {
      var inner: any Clients.EngineServiceStub = try Clients.EngineServiceTransport(options)
      inner = Clients.EngineServiceRetry(inner, options: options)
      if let logger = options.logger {
        inner = Clients.EngineServiceLogging(inner, logger: logger)
      }
      self.inner = inner
      self.pollingErrorPolicy = options.pollingErrorPolicy
      self.pollingBackoffPolicy = options.pollingBackoffPolicy
    }

    /// Creates a [Engine][google.cloud.discoveryengine.v1.Engine].
    ///
    /// [google.cloud.discoveryengine.v1.Engine]: <doc:Engine>
    ///
    /// @Snippet(path: "EngineService_CreateEngine")
    public func createEngine(
      request: CreateEngineRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self.inner.createEngine(request: request, options: options)
    }

    /// Creates a [Engine][google.cloud.discoveryengine.v1.Engine].
    ///
    /// [google.cloud.discoveryengine.v1.Engine]: <doc:Engine>
    ///
    /// @Snippet(path: "EngineService_CreateEngine")
    public func createEngine(
      withPolling: CreateEngineRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<Engine> {
      let extractStatus = {
        (op: GoogleLongRunning.Operation) throws
          -> GoogleCloudGax._PollableOperationImpl<Engine>.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 Engine(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.createEngine(request: withPolling, options: options)
      let initialState = try extractStatus(rawOp)
      let poll = { () async throws -> GoogleCloudGax._PollableOperationImpl<Engine>.State in
        let op = try await self.getOperation(
          request: .init().with { $0.name = rawOp.name }, options: options)
        return try extractStatus(op)
      }
      return GoogleCloudGax._PollableOperationImpl(
        initialState: initialState,
        polling: options.pollingErrorPolicy ?? self.pollingErrorPolicy,
        backoff: options.pollingBackoffPolicy ?? self.pollingBackoffPolicy,
        poll: poll,
      )
    }

    /// Deletes a [Engine][google.cloud.discoveryengine.v1.Engine].
    ///
    /// [google.cloud.discoveryengine.v1.Engine]: <doc:Engine>
    ///
    /// @Snippet(path: "EngineService_DeleteEngine")
    public func deleteEngine(
      request: DeleteEngineRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self.inner.deleteEngine(request: request, options: options)
    }

    /// Deletes a [Engine][google.cloud.discoveryengine.v1.Engine].
    ///
    /// [google.cloud.discoveryengine.v1.Engine]: <doc:Engine>
    ///
    /// @Snippet(path: "EngineService_DeleteEngine")
    public func deleteEngine(
      withPolling: DeleteEngineRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<Void> {
      let extractStatus = {
        (op: GoogleLongRunning.Operation) throws
          -> GoogleCloudGax._PollableOperationImpl<Void>.State in
        guard op.done else {
          return .init(done: false, result: nil)
        }

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

    /// Updates an [Engine][google.cloud.discoveryengine.v1.Engine]
    ///
    /// [google.cloud.discoveryengine.v1.Engine]: <doc:Engine>
    ///
    /// @Snippet(path: "EngineService_UpdateEngine")
    public func updateEngine(
      request: UpdateEngineRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDiscoveryEngineV1.Engine {
      try await self.inner.updateEngine(request: request, options: options)
    }

    /// Gets a [Engine][google.cloud.discoveryengine.v1.Engine].
    ///
    /// [google.cloud.discoveryengine.v1.Engine]: <doc:Engine>
    ///
    /// @Snippet(path: "EngineService_GetEngine")
    public func getEngine(
      request: GetEngineRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDiscoveryEngineV1.Engine {
      try await self.inner.getEngine(request: request, options: options)
    }

    /// Lists all the [Engine][google.cloud.discoveryengine.v1.Engine]s associated
    /// with the project.
    ///
    /// [google.cloud.discoveryengine.v1.Engine]: <doc:Engine>
    ///
    /// @Snippet(path: "EngineService_ListEngines")
    public func listEngines(
      request: ListEnginesRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDiscoveryEngineV1.ListEnginesResponse {
      try await self.inner.listEngines(request: request, options: options)
    }

    /// Lists all the [Engine][google.cloud.discoveryengine.v1.Engine]s associated
    /// with the project.
    ///
    /// [google.cloud.discoveryengine.v1.Engine]: <doc:Engine>
    ///
    /// @Snippet(path: "EngineService_ListEngines")
    public func listEngines(
      byItem: ListEnginesRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<Engine, Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws -> GoogleCloudDiscoveryEngineV1.ListEnginesResponse in
        var request = byItem
        request.pageToken = token
        return try await self.listEngines(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: "EngineService_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: "EngineService_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: "EngineService_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: "EngineService_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 `EngineServiceClient`.
    ///
    /// To mock `EngineServiceClient` change your functions to receive
    /// `some EngineServiceProtocol` or `any EngineServiceProtocol`
    /// and pass a mock implementation in your tests.
    public protocol EngineServiceProtocol {
      /// See `EngineServiceClient.createEngine`.
      func createEngine(request: CreateEngineRequest) async throws -> GoogleLongRunning.Operation

      /// See `EngineServiceClient.createEngine`.
      func createEngine(withPolling: CreateEngineRequest) async throws -> any GoogleCloudGax
        .PollableOperation<Engine>

      /// See `EngineServiceClient.createEngine`.
      func createEngine(
        parent: Swift.String,
        engine: Engine?,
        engineId: Swift.String,
      ) async throws -> any GoogleCloudGax.PollableOperation<Engine>

      /// See `EngineServiceClient.deleteEngine`.
      func deleteEngine(request: DeleteEngineRequest) async throws -> GoogleLongRunning.Operation

      /// See `EngineServiceClient.deleteEngine`.
      func deleteEngine(withPolling: DeleteEngineRequest) async throws -> any GoogleCloudGax
        .PollableOperation<Void>

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

      /// See `EngineServiceClient.updateEngine`.
      func updateEngine(request: UpdateEngineRequest) async throws
        -> GoogleCloudDiscoveryEngineV1.Engine

      /// See `EngineServiceClient.updateEngine`.
      func updateEngine(
        engine: Engine?,
        updateMask: GoogleCloudWkt.FieldMask?,
      ) async throws -> GoogleCloudDiscoveryEngineV1.Engine

      /// See `EngineServiceClient.getEngine`.
      func getEngine(request: GetEngineRequest) async throws -> GoogleCloudDiscoveryEngineV1.Engine

      /// See `EngineServiceClient.getEngine`.
      func getEngine(
        name: Swift.String,
      ) async throws -> GoogleCloudDiscoveryEngineV1.Engine

      /// See `EngineServiceClient.listEngines`.
      func listEngines(request: ListEnginesRequest) async throws
        -> GoogleCloudDiscoveryEngineV1.ListEnginesResponse

      /// See `EngineServiceClient.listEngines`.
      func listEngines(
        byItem: ListEnginesRequest
      ) throws -> any AsyncSequence<Engine, Swift.Error>

      /// See `EngineServiceClient.listEngines`.
      func listEngines(
        parent: Swift.String,
      ) throws -> any AsyncSequence<Engine, Swift.Error>

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

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

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

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

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

      /// See `EngineServiceClient.createEngine`.
      func createEngine(
        request: CreateEngineRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleLongRunning.Operation

      /// See `EngineServiceClient.createEngine`.
      func createEngine(
        withPolling: CreateEngineRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> any GoogleCloudGax.PollableOperation<Engine>

      /// See `EngineServiceClient.deleteEngine`.
      func deleteEngine(
        request: DeleteEngineRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleLongRunning.Operation

      /// See `EngineServiceClient.deleteEngine`.
      func deleteEngine(
        withPolling: DeleteEngineRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> any GoogleCloudGax.PollableOperation<Void>

      /// See `EngineServiceClient.updateEngine`.
      func updateEngine(
        request: UpdateEngineRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudDiscoveryEngineV1.Engine

      /// See `EngineServiceClient.getEngine`.
      func getEngine(
        request: GetEngineRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudDiscoveryEngineV1.Engine

      /// See `EngineServiceClient.listEngines`.
      func listEngines(
        request: ListEnginesRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudDiscoveryEngineV1.ListEnginesResponse

      /// See `EngineServiceClient.listEngines`.
      func listEngines(
        byItem: ListEnginesRequest, options: GoogleCloudGax.RequestOptions
      ) throws -> any AsyncSequence<Engine, Swift.Error>

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

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

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

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

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

    public func createEngine(withPolling: CreateEngineRequest) async throws -> any GoogleCloudGax
      .PollableOperation<Engine>
    {
      try await self.createEngine(withPolling: withPolling, options: .init())
    }

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

    public func createEngine(
      parent: Swift.String,
      engine: Engine?,
      engineId: Swift.String,
    ) async throws -> any GoogleCloudGax.PollableOperation<Engine> {
      let request = CreateEngineRequest().with {
        $0.parent = parent
        $0.engine = engine
        $0.engineId = engineId
      }
      return try await self.createEngine(withPolling: request)
    }

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

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

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

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

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

    public func updateEngine(request: UpdateEngineRequest) async throws
      -> GoogleCloudDiscoveryEngineV1.Engine
    {
      try await self.updateEngine(request: request, options: .init())
    }

    public func updateEngine(
      request: UpdateEngineRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDiscoveryEngineV1.Engine {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func updateEngine(
      engine: Engine?,
      updateMask: GoogleCloudWkt.FieldMask?,
    ) async throws -> GoogleCloudDiscoveryEngineV1.Engine {
      let request = UpdateEngineRequest().with {
        $0.engine = engine
        $0.updateMask = updateMask
      }
      return try await self.updateEngine(request: request)
    }

    public func getEngine(request: GetEngineRequest) async throws
      -> GoogleCloudDiscoveryEngineV1.Engine
    {
      try await self.getEngine(request: request, options: .init())
    }

    public func getEngine(
      request: GetEngineRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDiscoveryEngineV1.Engine {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func getEngine(
      name: Swift.String,
    ) async throws -> GoogleCloudDiscoveryEngineV1.Engine {
      let request = GetEngineRequest().with {
        $0.name = name
      }
      return try await self.getEngine(request: request)
    }

    public func listEngines(request: ListEnginesRequest) async throws
      -> GoogleCloudDiscoveryEngineV1.ListEnginesResponse
    {
      try await self.listEngines(request: request, options: .init())
    }

    public func listEngines(
      request: ListEnginesRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDiscoveryEngineV1.ListEnginesResponse {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func listEngines(
      byItem: ListEnginesRequest
    ) throws -> any AsyncSequence<Engine, Swift.Error> {
      try self.listEngines(byItem: byItem, options: .init())
    }

    public func listEngines(
      byItem: ListEnginesRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<Engine, Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws -> GoogleCloudDiscoveryEngineV1.ListEnginesResponse in
        throw GoogleCloudGax.RequestError.unimplemented
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

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

    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 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)
    }
  }
#endif
