// 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 DatasetService
  import Foundation
  #if canImport(FoundationNetworking)
    import FoundationNetworking
  #endif
  import GoogleCloudLocation
  import GoogleCloudWkt
  import GoogleIAMV1
  import GoogleLongRunning
  import GoogleRpc
  import GoogleCloudGax

  /// The service that manages Vertex AI Dataset and its child resources.
  ///
  /// @Snippet(path: "DatasetServiceQuickstart")
  public class DatasetServiceClient: Clients.DatasetServiceProtocol {
    let inner: any Clients.DatasetServiceStub
    let pollingErrorPolicy: GoogleCloudGax.PollingErrorPolicy
    let pollingBackoffPolicy: GoogleCloudGax.BackoffPolicy

    /// Creates a new `DatasetServiceClient` instance.
    public init(_ options: GoogleCloudGax.ClientOptions = .init()) throws {
      var inner: any Clients.DatasetServiceStub = try Clients.DatasetServiceTransport(options)
      inner = Clients.DatasetServiceRetry(inner, options: options)
      if let logger = options.logger {
        inner = Clients.DatasetServiceLogging(inner, logger: logger)
      }
      self.inner = inner
      self.pollingErrorPolicy = options.pollingErrorPolicy
      self.pollingBackoffPolicy = options.pollingBackoffPolicy
    }

    /// Creates a Dataset.
    ///
    /// @Snippet(path: "DatasetService_CreateDataset")
    public func createDataset(
      request: CreateDatasetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self.inner.createDataset(request: request, options: options)
    }

    /// Creates a Dataset.
    ///
    /// @Snippet(path: "DatasetService_CreateDataset")
    public func createDataset(
      withPolling: CreateDatasetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<Dataset> {
      let extractStatus = {
        (op: GoogleLongRunning.Operation) throws
          -> GoogleCloudGax._PollableOperationImpl<Dataset>.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 Dataset(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.createDataset(request: withPolling, options: options)
      let initialState = try extractStatus(rawOp)
      let poll = { () async throws -> GoogleCloudGax._PollableOperationImpl<Dataset>.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,
      )
    }

    /// Gets a Dataset.
    ///
    /// @Snippet(path: "DatasetService_GetDataset")
    public func getDataset(
      request: GetDatasetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.Dataset {
      try await self.inner.getDataset(request: request, options: options)
    }

    /// Updates a Dataset.
    ///
    /// @Snippet(path: "DatasetService_UpdateDataset")
    public func updateDataset(
      request: UpdateDatasetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.Dataset {
      try await self.inner.updateDataset(request: request, options: options)
    }

    /// Lists Datasets in a Location.
    ///
    /// @Snippet(path: "DatasetService_ListDatasets")
    public func listDatasets(
      request: ListDatasetsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.ListDatasetsResponse {
      try await self.inner.listDatasets(request: request, options: options)
    }

    /// Lists Datasets in a Location.
    ///
    /// @Snippet(path: "DatasetService_ListDatasets")
    public func listDatasets(
      byItem: ListDatasetsRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<Dataset, Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws -> GoogleCloudAIPlatformV1.ListDatasetsResponse in
        var request = byItem
        request.pageToken = token
        return try await self.listDatasets(request: request, options: options)
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

    /// Deletes a Dataset.
    ///
    /// @Snippet(path: "DatasetService_DeleteDataset")
    public func deleteDataset(
      request: DeleteDatasetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self.inner.deleteDataset(request: request, options: options)
    }

    /// Deletes a Dataset.
    ///
    /// @Snippet(path: "DatasetService_DeleteDataset")
    public func deleteDataset(
      withPolling: DeleteDatasetRequest, 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.deleteDataset(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,
      )
    }

    /// Imports data into a Dataset.
    ///
    /// @Snippet(path: "DatasetService_ImportData")
    public func importData(
      request: ImportDataRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self.inner.importData(request: request, options: options)
    }

    /// Imports data into a Dataset.
    ///
    /// @Snippet(path: "DatasetService_ImportData")
    public func importData(
      withPolling: ImportDataRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<ImportDataResponse> {
      let extractStatus = {
        (op: GoogleLongRunning.Operation) throws
          -> GoogleCloudGax._PollableOperationImpl<ImportDataResponse>.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 ImportDataResponse(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.importData(request: withPolling, options: options)
      let initialState = try extractStatus(rawOp)
      let poll = {
        () async throws -> GoogleCloudGax._PollableOperationImpl<ImportDataResponse>.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,
      )
    }

    /// Exports data from a Dataset.
    ///
    /// @Snippet(path: "DatasetService_ExportData")
    public func exportData(
      request: ExportDataRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self.inner.exportData(request: request, options: options)
    }

    /// Exports data from a Dataset.
    ///
    /// @Snippet(path: "DatasetService_ExportData")
    public func exportData(
      withPolling: ExportDataRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<ExportDataResponse> {
      let extractStatus = {
        (op: GoogleLongRunning.Operation) throws
          -> GoogleCloudGax._PollableOperationImpl<ExportDataResponse>.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 ExportDataResponse(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.exportData(request: withPolling, options: options)
      let initialState = try extractStatus(rawOp)
      let poll = {
        () async throws -> GoogleCloudGax._PollableOperationImpl<ExportDataResponse>.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,
      )
    }

    /// Create a version from a Dataset.
    ///
    /// @Snippet(path: "DatasetService_CreateDatasetVersion")
    public func createDatasetVersion(
      request: CreateDatasetVersionRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self.inner.createDatasetVersion(request: request, options: options)
    }

    /// Create a version from a Dataset.
    ///
    /// @Snippet(path: "DatasetService_CreateDatasetVersion")
    public func createDatasetVersion(
      withPolling: CreateDatasetVersionRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<DatasetVersion> {
      let extractStatus = {
        (op: GoogleLongRunning.Operation) throws
          -> GoogleCloudGax._PollableOperationImpl<DatasetVersion>.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 DatasetVersion(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.createDatasetVersion(request: withPolling, options: options)
      let initialState = try extractStatus(rawOp)
      let poll = { () async throws -> GoogleCloudGax._PollableOperationImpl<DatasetVersion>.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 a DatasetVersion.
    ///
    /// @Snippet(path: "DatasetService_UpdateDatasetVersion")
    public func updateDatasetVersion(
      request: UpdateDatasetVersionRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.DatasetVersion {
      try await self.inner.updateDatasetVersion(request: request, options: options)
    }

    /// Deletes a Dataset version.
    ///
    /// @Snippet(path: "DatasetService_DeleteDatasetVersion")
    public func deleteDatasetVersion(
      request: DeleteDatasetVersionRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self.inner.deleteDatasetVersion(request: request, options: options)
    }

    /// Deletes a Dataset version.
    ///
    /// @Snippet(path: "DatasetService_DeleteDatasetVersion")
    public func deleteDatasetVersion(
      withPolling: DeleteDatasetVersionRequest, 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.deleteDatasetVersion(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,
      )
    }

    /// Gets a Dataset version.
    ///
    /// @Snippet(path: "DatasetService_GetDatasetVersion")
    public func getDatasetVersion(
      request: GetDatasetVersionRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.DatasetVersion {
      try await self.inner.getDatasetVersion(request: request, options: options)
    }

    /// Lists DatasetVersions in a Dataset.
    ///
    /// @Snippet(path: "DatasetService_ListDatasetVersions")
    public func listDatasetVersions(
      request: ListDatasetVersionsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.ListDatasetVersionsResponse {
      try await self.inner.listDatasetVersions(request: request, options: options)
    }

    /// Lists DatasetVersions in a Dataset.
    ///
    /// @Snippet(path: "DatasetService_ListDatasetVersions")
    public func listDatasetVersions(
      byItem: ListDatasetVersionsRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<DatasetVersion, Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws -> GoogleCloudAIPlatformV1.ListDatasetVersionsResponse in
        var request = byItem
        request.pageToken = token
        return try await self.listDatasetVersions(request: request, options: options)
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

    /// Restores a dataset version.
    ///
    /// @Snippet(path: "DatasetService_RestoreDatasetVersion")
    public func restoreDatasetVersion(
      request: RestoreDatasetVersionRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self.inner.restoreDatasetVersion(request: request, options: options)
    }

    /// Restores a dataset version.
    ///
    /// @Snippet(path: "DatasetService_RestoreDatasetVersion")
    public func restoreDatasetVersion(
      withPolling: RestoreDatasetVersionRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<DatasetVersion> {
      let extractStatus = {
        (op: GoogleLongRunning.Operation) throws
          -> GoogleCloudGax._PollableOperationImpl<DatasetVersion>.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 DatasetVersion(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.restoreDatasetVersion(request: withPolling, options: options)
      let initialState = try extractStatus(rawOp)
      let poll = { () async throws -> GoogleCloudGax._PollableOperationImpl<DatasetVersion>.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 DataItems in a Dataset.
    ///
    /// @Snippet(path: "DatasetService_ListDataItems")
    public func listDataItems(
      request: ListDataItemsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.ListDataItemsResponse {
      try await self.inner.listDataItems(request: request, options: options)
    }

    /// Lists DataItems in a Dataset.
    ///
    /// @Snippet(path: "DatasetService_ListDataItems")
    public func listDataItems(
      byItem: ListDataItemsRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<DataItem, Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws -> GoogleCloudAIPlatformV1.ListDataItemsResponse in
        var request = byItem
        request.pageToken = token
        return try await self.listDataItems(request: request, options: options)
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

    /// Searches DataItems in a Dataset.
    ///
    /// @Snippet(path: "DatasetService_SearchDataItems")
    public func searchDataItems(
      request: SearchDataItemsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.SearchDataItemsResponse {
      try await self.inner.searchDataItems(request: request, options: options)
    }

    /// Searches DataItems in a Dataset.
    ///
    /// @Snippet(path: "DatasetService_SearchDataItems")
    public func searchDataItems(
      byItem: SearchDataItemsRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<DataItemView, Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws -> GoogleCloudAIPlatformV1.SearchDataItemsResponse in
        var request = byItem
        request.pageToken = token
        return try await self.searchDataItems(request: request, options: options)
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

    /// Lists SavedQueries in a Dataset.
    ///
    /// @Snippet(path: "DatasetService_ListSavedQueries")
    public func listSavedQueries(
      request: ListSavedQueriesRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.ListSavedQueriesResponse {
      try await self.inner.listSavedQueries(request: request, options: options)
    }

    /// Lists SavedQueries in a Dataset.
    ///
    /// @Snippet(path: "DatasetService_ListSavedQueries")
    public func listSavedQueries(
      byItem: ListSavedQueriesRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<SavedQuery, Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws -> GoogleCloudAIPlatformV1.ListSavedQueriesResponse in
        var request = byItem
        request.pageToken = token
        return try await self.listSavedQueries(request: request, options: options)
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

    /// Deletes a SavedQuery.
    ///
    /// @Snippet(path: "DatasetService_DeleteSavedQuery")
    public func deleteSavedQuery(
      request: DeleteSavedQueryRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self.inner.deleteSavedQuery(request: request, options: options)
    }

    /// Deletes a SavedQuery.
    ///
    /// @Snippet(path: "DatasetService_DeleteSavedQuery")
    public func deleteSavedQuery(
      withPolling: DeleteSavedQueryRequest, 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.deleteSavedQuery(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,
      )
    }

    /// Gets an AnnotationSpec.
    ///
    /// @Snippet(path: "DatasetService_GetAnnotationSpec")
    public func getAnnotationSpec(
      request: GetAnnotationSpecRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.AnnotationSpec {
      try await self.inner.getAnnotationSpec(request: request, options: options)
    }

    /// Lists Annotations belongs to a dataitem.
    ///
    /// @Snippet(path: "DatasetService_ListAnnotations")
    public func listAnnotations(
      request: ListAnnotationsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.ListAnnotationsResponse {
      try await self.inner.listAnnotations(request: request, options: options)
    }

    /// Lists Annotations belongs to a dataitem.
    ///
    /// @Snippet(path: "DatasetService_ListAnnotations")
    public func listAnnotations(
      byItem: ListAnnotationsRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<Annotation, Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws -> GoogleCloudAIPlatformV1.ListAnnotationsResponse in
        var request = byItem
        request.pageToken = token
        return try await self.listAnnotations(request: request, options: options)
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

    /// Lists information about the supported locations for this service.
    ///
    /// @Snippet(path: "DatasetService_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.
    ///
    /// @Snippet(path: "DatasetService_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: "DatasetService_GetLocation")
    public func getLocation(
      request: GoogleCloudLocation.GetLocationRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudLocation.Location {
      try await self.inner.getLocation(request: request, options: options)
    }

    /// Sets the access control policy on the specified resource. Replaces
    /// any existing policy.
    ///
    /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
    /// errors.
    ///
    /// @Snippet(path: "DatasetService_SetIamPolicy")
    public func setIamPolicy(
      request: GoogleIAMV1.SetIamPolicyRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleIAMV1.Policy {
      try await self.inner.setIamPolicy(request: request, options: options)
    }

    /// Gets the access control policy for a resource. Returns an empty policy
    /// if the resource exists and does not have a policy set.
    ///
    /// @Snippet(path: "DatasetService_GetIamPolicy")
    public func getIamPolicy(
      request: GoogleIAMV1.GetIamPolicyRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleIAMV1.Policy {
      try await self.inner.getIamPolicy(request: request, options: options)
    }

    /// Returns permissions that a caller has on the specified resource. If the
    /// resource does not exist, this will return an empty set of
    /// permissions, not a `NOT_FOUND` error.
    ///
    /// Note: This operation is designed to be used for building
    /// permission-aware UIs and command-line tools, not for authorization
    /// checking. This operation may "fail open" without warning.
    ///
    /// @Snippet(path: "DatasetService_TestIamPermissions")
    public func testIamPermissions(
      request: GoogleIAMV1.TestIamPermissionsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleIAMV1.TestIamPermissionsResponse {
      try await self.inner.testIamPermissions(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: "DatasetService_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: "DatasetService_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: "DatasetService_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: "DatasetService_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: "DatasetService_CancelOperation")
    public func cancelOperation(
      request: GoogleLongRunning.CancelOperationRequest, options: GoogleCloudGax.RequestOptions
    ) async throws {
      try await self.inner.cancelOperation(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: "DatasetService_WaitOperation")
    public func waitOperation(
      request: GoogleLongRunning.WaitOperationRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self.inner.waitOperation(request: request, options: options)
    }
  }

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

      /// See `DatasetServiceClient.createDataset`.
      func createDataset(withPolling: CreateDatasetRequest) async throws -> any GoogleCloudGax
        .PollableOperation<Dataset>

      /// See `DatasetServiceClient.createDataset`.
      func createDataset(
        parent: Swift.String,
        dataset: Dataset?,
      ) async throws -> any GoogleCloudGax.PollableOperation<Dataset>

      /// See `DatasetServiceClient.getDataset`.
      func getDataset(request: GetDatasetRequest) async throws -> GoogleCloudAIPlatformV1.Dataset

      /// See `DatasetServiceClient.getDataset`.
      func getDataset(
        name: Swift.String,
      ) async throws -> GoogleCloudAIPlatformV1.Dataset

      /// See `DatasetServiceClient.updateDataset`.
      func updateDataset(request: UpdateDatasetRequest) async throws
        -> GoogleCloudAIPlatformV1.Dataset

      /// See `DatasetServiceClient.updateDataset`.
      func updateDataset(
        dataset: Dataset?,
        updateMask: GoogleCloudWkt.FieldMask?,
      ) async throws -> GoogleCloudAIPlatformV1.Dataset

      /// See `DatasetServiceClient.listDatasets`.
      func listDatasets(request: ListDatasetsRequest) async throws
        -> GoogleCloudAIPlatformV1.ListDatasetsResponse

      /// See `DatasetServiceClient.listDatasets`.
      func listDatasets(
        byItem: ListDatasetsRequest
      ) throws -> any AsyncSequence<Dataset, Swift.Error>

      /// See `DatasetServiceClient.listDatasets`.
      func listDatasets(
        parent: Swift.String,
      ) throws -> any AsyncSequence<Dataset, Swift.Error>

      /// See `DatasetServiceClient.deleteDataset`.
      func deleteDataset(request: DeleteDatasetRequest) async throws -> GoogleLongRunning.Operation

      /// See `DatasetServiceClient.deleteDataset`.
      func deleteDataset(withPolling: DeleteDatasetRequest) async throws -> any GoogleCloudGax
        .PollableOperation<Void>

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

      /// See `DatasetServiceClient.importData`.
      func importData(request: ImportDataRequest) async throws -> GoogleLongRunning.Operation

      /// See `DatasetServiceClient.importData`.
      func importData(withPolling: ImportDataRequest) async throws -> any GoogleCloudGax
        .PollableOperation<ImportDataResponse>

      /// See `DatasetServiceClient.importData`.
      func importData(
        name: Swift.String,
        importConfigs: [ImportDataConfig],
      ) async throws -> any GoogleCloudGax.PollableOperation<ImportDataResponse>

      /// See `DatasetServiceClient.exportData`.
      func exportData(request: ExportDataRequest) async throws -> GoogleLongRunning.Operation

      /// See `DatasetServiceClient.exportData`.
      func exportData(withPolling: ExportDataRequest) async throws -> any GoogleCloudGax
        .PollableOperation<ExportDataResponse>

      /// See `DatasetServiceClient.exportData`.
      func exportData(
        name: Swift.String,
        exportConfig: ExportDataConfig?,
      ) async throws -> any GoogleCloudGax.PollableOperation<ExportDataResponse>

      /// See `DatasetServiceClient.createDatasetVersion`.
      func createDatasetVersion(request: CreateDatasetVersionRequest) async throws
        -> GoogleLongRunning.Operation

      /// See `DatasetServiceClient.createDatasetVersion`.
      func createDatasetVersion(withPolling: CreateDatasetVersionRequest) async throws
        -> any GoogleCloudGax.PollableOperation<DatasetVersion>

      /// See `DatasetServiceClient.createDatasetVersion`.
      func createDatasetVersion(
        parent: Swift.String,
        datasetVersion: DatasetVersion?,
      ) async throws -> any GoogleCloudGax.PollableOperation<DatasetVersion>

      /// See `DatasetServiceClient.updateDatasetVersion`.
      func updateDatasetVersion(request: UpdateDatasetVersionRequest) async throws
        -> GoogleCloudAIPlatformV1.DatasetVersion

      /// See `DatasetServiceClient.updateDatasetVersion`.
      func updateDatasetVersion(
        datasetVersion: DatasetVersion?,
        updateMask: GoogleCloudWkt.FieldMask?,
      ) async throws -> GoogleCloudAIPlatformV1.DatasetVersion

      /// See `DatasetServiceClient.deleteDatasetVersion`.
      func deleteDatasetVersion(request: DeleteDatasetVersionRequest) async throws
        -> GoogleLongRunning.Operation

      /// See `DatasetServiceClient.deleteDatasetVersion`.
      func deleteDatasetVersion(withPolling: DeleteDatasetVersionRequest) async throws
        -> any GoogleCloudGax.PollableOperation<Void>

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

      /// See `DatasetServiceClient.getDatasetVersion`.
      func getDatasetVersion(request: GetDatasetVersionRequest) async throws
        -> GoogleCloudAIPlatformV1.DatasetVersion

      /// See `DatasetServiceClient.getDatasetVersion`.
      func getDatasetVersion(
        name: Swift.String,
      ) async throws -> GoogleCloudAIPlatformV1.DatasetVersion

      /// See `DatasetServiceClient.listDatasetVersions`.
      func listDatasetVersions(request: ListDatasetVersionsRequest) async throws
        -> GoogleCloudAIPlatformV1.ListDatasetVersionsResponse

      /// See `DatasetServiceClient.listDatasetVersions`.
      func listDatasetVersions(
        byItem: ListDatasetVersionsRequest
      ) throws -> any AsyncSequence<DatasetVersion, Swift.Error>

      /// See `DatasetServiceClient.listDatasetVersions`.
      func listDatasetVersions(
        parent: Swift.String,
      ) throws -> any AsyncSequence<DatasetVersion, Swift.Error>

      /// See `DatasetServiceClient.restoreDatasetVersion`.
      func restoreDatasetVersion(request: RestoreDatasetVersionRequest) async throws
        -> GoogleLongRunning.Operation

      /// See `DatasetServiceClient.restoreDatasetVersion`.
      func restoreDatasetVersion(withPolling: RestoreDatasetVersionRequest) async throws
        -> any GoogleCloudGax.PollableOperation<DatasetVersion>

      /// See `DatasetServiceClient.restoreDatasetVersion`.
      func restoreDatasetVersion(
        name: Swift.String,
      ) async throws -> any GoogleCloudGax.PollableOperation<DatasetVersion>

      /// See `DatasetServiceClient.listDataItems`.
      func listDataItems(request: ListDataItemsRequest) async throws
        -> GoogleCloudAIPlatformV1.ListDataItemsResponse

      /// See `DatasetServiceClient.listDataItems`.
      func listDataItems(
        byItem: ListDataItemsRequest
      ) throws -> any AsyncSequence<DataItem, Swift.Error>

      /// See `DatasetServiceClient.listDataItems`.
      func listDataItems(
        parent: Swift.String,
      ) throws -> any AsyncSequence<DataItem, Swift.Error>

      /// See `DatasetServiceClient.searchDataItems`.
      func searchDataItems(request: SearchDataItemsRequest) async throws
        -> GoogleCloudAIPlatformV1.SearchDataItemsResponse

      /// See `DatasetServiceClient.searchDataItems`.
      func searchDataItems(
        byItem: SearchDataItemsRequest
      ) throws -> any AsyncSequence<DataItemView, Swift.Error>

      /// See `DatasetServiceClient.listSavedQueries`.
      func listSavedQueries(request: ListSavedQueriesRequest) async throws
        -> GoogleCloudAIPlatformV1.ListSavedQueriesResponse

      /// See `DatasetServiceClient.listSavedQueries`.
      func listSavedQueries(
        byItem: ListSavedQueriesRequest
      ) throws -> any AsyncSequence<SavedQuery, Swift.Error>

      /// See `DatasetServiceClient.listSavedQueries`.
      func listSavedQueries(
        parent: Swift.String,
      ) throws -> any AsyncSequence<SavedQuery, Swift.Error>

      /// See `DatasetServiceClient.deleteSavedQuery`.
      func deleteSavedQuery(request: DeleteSavedQueryRequest) async throws
        -> GoogleLongRunning.Operation

      /// See `DatasetServiceClient.deleteSavedQuery`.
      func deleteSavedQuery(withPolling: DeleteSavedQueryRequest) async throws -> any GoogleCloudGax
        .PollableOperation<Void>

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

      /// See `DatasetServiceClient.getAnnotationSpec`.
      func getAnnotationSpec(request: GetAnnotationSpecRequest) async throws
        -> GoogleCloudAIPlatformV1.AnnotationSpec

      /// See `DatasetServiceClient.getAnnotationSpec`.
      func getAnnotationSpec(
        name: Swift.String,
      ) async throws -> GoogleCloudAIPlatformV1.AnnotationSpec

      /// See `DatasetServiceClient.listAnnotations`.
      func listAnnotations(request: ListAnnotationsRequest) async throws
        -> GoogleCloudAIPlatformV1.ListAnnotationsResponse

      /// See `DatasetServiceClient.listAnnotations`.
      func listAnnotations(
        byItem: ListAnnotationsRequest
      ) throws -> any AsyncSequence<Annotation, Swift.Error>

      /// See `DatasetServiceClient.listAnnotations`.
      func listAnnotations(
        parent: Swift.String,
      ) throws -> any AsyncSequence<Annotation, Swift.Error>

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

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

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

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

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

      /// See `DatasetServiceClient.testIamPermissions`.
      func testIamPermissions(request: GoogleIAMV1.TestIamPermissionsRequest) async throws
        -> GoogleIAMV1.TestIamPermissionsResponse

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

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

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

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

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

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

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

      /// See `DatasetServiceClient.waitOperation`.
      func waitOperation(request: GoogleLongRunning.WaitOperationRequest) async throws
        -> GoogleLongRunning.Operation

      /// See `DatasetServiceClient.createDataset`.
      func createDataset(
        request: CreateDatasetRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleLongRunning.Operation

      /// See `DatasetServiceClient.createDataset`.
      func createDataset(
        withPolling: CreateDatasetRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> any GoogleCloudGax.PollableOperation<Dataset>

      /// See `DatasetServiceClient.getDataset`.
      func getDataset(
        request: GetDatasetRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudAIPlatformV1.Dataset

      /// See `DatasetServiceClient.updateDataset`.
      func updateDataset(
        request: UpdateDatasetRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudAIPlatformV1.Dataset

      /// See `DatasetServiceClient.listDatasets`.
      func listDatasets(
        request: ListDatasetsRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudAIPlatformV1.ListDatasetsResponse

      /// See `DatasetServiceClient.listDatasets`.
      func listDatasets(
        byItem: ListDatasetsRequest, options: GoogleCloudGax.RequestOptions
      ) throws -> any AsyncSequence<Dataset, Swift.Error>

      /// See `DatasetServiceClient.deleteDataset`.
      func deleteDataset(
        request: DeleteDatasetRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleLongRunning.Operation

      /// See `DatasetServiceClient.deleteDataset`.
      func deleteDataset(
        withPolling: DeleteDatasetRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> any GoogleCloudGax.PollableOperation<Void>

      /// See `DatasetServiceClient.importData`.
      func importData(
        request: ImportDataRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleLongRunning.Operation

      /// See `DatasetServiceClient.importData`.
      func importData(
        withPolling: ImportDataRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> any GoogleCloudGax.PollableOperation<ImportDataResponse>

      /// See `DatasetServiceClient.exportData`.
      func exportData(
        request: ExportDataRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleLongRunning.Operation

      /// See `DatasetServiceClient.exportData`.
      func exportData(
        withPolling: ExportDataRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> any GoogleCloudGax.PollableOperation<ExportDataResponse>

      /// See `DatasetServiceClient.createDatasetVersion`.
      func createDatasetVersion(
        request: CreateDatasetVersionRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleLongRunning.Operation

      /// See `DatasetServiceClient.createDatasetVersion`.
      func createDatasetVersion(
        withPolling: CreateDatasetVersionRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> any GoogleCloudGax.PollableOperation<DatasetVersion>

      /// See `DatasetServiceClient.updateDatasetVersion`.
      func updateDatasetVersion(
        request: UpdateDatasetVersionRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudAIPlatformV1.DatasetVersion

      /// See `DatasetServiceClient.deleteDatasetVersion`.
      func deleteDatasetVersion(
        request: DeleteDatasetVersionRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleLongRunning.Operation

      /// See `DatasetServiceClient.deleteDatasetVersion`.
      func deleteDatasetVersion(
        withPolling: DeleteDatasetVersionRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> any GoogleCloudGax.PollableOperation<Void>

      /// See `DatasetServiceClient.getDatasetVersion`.
      func getDatasetVersion(
        request: GetDatasetVersionRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudAIPlatformV1.DatasetVersion

      /// See `DatasetServiceClient.listDatasetVersions`.
      func listDatasetVersions(
        request: ListDatasetVersionsRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudAIPlatformV1.ListDatasetVersionsResponse

      /// See `DatasetServiceClient.listDatasetVersions`.
      func listDatasetVersions(
        byItem: ListDatasetVersionsRequest, options: GoogleCloudGax.RequestOptions
      ) throws -> any AsyncSequence<DatasetVersion, Swift.Error>

      /// See `DatasetServiceClient.restoreDatasetVersion`.
      func restoreDatasetVersion(
        request: RestoreDatasetVersionRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleLongRunning.Operation

      /// See `DatasetServiceClient.restoreDatasetVersion`.
      func restoreDatasetVersion(
        withPolling: RestoreDatasetVersionRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> any GoogleCloudGax.PollableOperation<DatasetVersion>

      /// See `DatasetServiceClient.listDataItems`.
      func listDataItems(
        request: ListDataItemsRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudAIPlatformV1.ListDataItemsResponse

      /// See `DatasetServiceClient.listDataItems`.
      func listDataItems(
        byItem: ListDataItemsRequest, options: GoogleCloudGax.RequestOptions
      ) throws -> any AsyncSequence<DataItem, Swift.Error>

      /// See `DatasetServiceClient.searchDataItems`.
      func searchDataItems(
        request: SearchDataItemsRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudAIPlatformV1.SearchDataItemsResponse

      /// See `DatasetServiceClient.searchDataItems`.
      func searchDataItems(
        byItem: SearchDataItemsRequest, options: GoogleCloudGax.RequestOptions
      ) throws -> any AsyncSequence<DataItemView, Swift.Error>

      /// See `DatasetServiceClient.listSavedQueries`.
      func listSavedQueries(
        request: ListSavedQueriesRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudAIPlatformV1.ListSavedQueriesResponse

      /// See `DatasetServiceClient.listSavedQueries`.
      func listSavedQueries(
        byItem: ListSavedQueriesRequest, options: GoogleCloudGax.RequestOptions
      ) throws -> any AsyncSequence<SavedQuery, Swift.Error>

      /// See `DatasetServiceClient.deleteSavedQuery`.
      func deleteSavedQuery(
        request: DeleteSavedQueryRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleLongRunning.Operation

      /// See `DatasetServiceClient.deleteSavedQuery`.
      func deleteSavedQuery(
        withPolling: DeleteSavedQueryRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> any GoogleCloudGax.PollableOperation<Void>

      /// See `DatasetServiceClient.getAnnotationSpec`.
      func getAnnotationSpec(
        request: GetAnnotationSpecRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudAIPlatformV1.AnnotationSpec

      /// See `DatasetServiceClient.listAnnotations`.
      func listAnnotations(
        request: ListAnnotationsRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudAIPlatformV1.ListAnnotationsResponse

      /// See `DatasetServiceClient.listAnnotations`.
      func listAnnotations(
        byItem: ListAnnotationsRequest, options: GoogleCloudGax.RequestOptions
      ) throws -> any AsyncSequence<Annotation, Swift.Error>

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

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

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

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

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

      /// See `DatasetServiceClient.testIamPermissions`.
      func testIamPermissions(
        request: GoogleIAMV1.TestIamPermissionsRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleIAMV1.TestIamPermissionsResponse

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

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

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

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

      /// See `DatasetServiceClient.waitOperation`.
      func waitOperation(
        request: GoogleLongRunning.WaitOperationRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleLongRunning.Operation
    }
  }

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

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

    public func createDataset(withPolling: CreateDatasetRequest) async throws -> any GoogleCloudGax
      .PollableOperation<Dataset>
    {
      try await self.createDataset(withPolling: withPolling, options: .init())
    }

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

    public func createDataset(
      parent: Swift.String,
      dataset: Dataset?,
    ) async throws -> any GoogleCloudGax.PollableOperation<Dataset> {
      let request = CreateDatasetRequest().with {
        $0.parent = parent
        $0.dataset = dataset
      }
      return try await self.createDataset(withPolling: request)
    }

    public func getDataset(request: GetDatasetRequest) async throws
      -> GoogleCloudAIPlatformV1.Dataset
    {
      try await self.getDataset(request: request, options: .init())
    }

    public func getDataset(
      request: GetDatasetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.Dataset {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func getDataset(
      name: Swift.String,
    ) async throws -> GoogleCloudAIPlatformV1.Dataset {
      let request = GetDatasetRequest().with {
        $0.name = name
      }
      return try await self.getDataset(request: request)
    }

    public func updateDataset(request: UpdateDatasetRequest) async throws
      -> GoogleCloudAIPlatformV1.Dataset
    {
      try await self.updateDataset(request: request, options: .init())
    }

    public func updateDataset(
      request: UpdateDatasetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.Dataset {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func updateDataset(
      dataset: Dataset?,
      updateMask: GoogleCloudWkt.FieldMask?,
    ) async throws -> GoogleCloudAIPlatformV1.Dataset {
      let request = UpdateDatasetRequest().with {
        $0.dataset = dataset
        $0.updateMask = updateMask
      }
      return try await self.updateDataset(request: request)
    }

    public func listDatasets(request: ListDatasetsRequest) async throws
      -> GoogleCloudAIPlatformV1.ListDatasetsResponse
    {
      try await self.listDatasets(request: request, options: .init())
    }

    public func listDatasets(
      request: ListDatasetsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.ListDatasetsResponse {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func listDatasets(
      byItem: ListDatasetsRequest
    ) throws -> any AsyncSequence<Dataset, Swift.Error> {
      try self.listDatasets(byItem: byItem, options: .init())
    }

    public func listDatasets(
      byItem: ListDatasetsRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<Dataset, Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws -> GoogleCloudAIPlatformV1.ListDatasetsResponse in
        throw GoogleCloudGax.RequestError.unimplemented
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

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

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

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

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

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

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

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

    public func importData(withPolling: ImportDataRequest) async throws -> any GoogleCloudGax
      .PollableOperation<ImportDataResponse>
    {
      try await self.importData(withPolling: withPolling, options: .init())
    }

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

    public func importData(
      name: Swift.String,
      importConfigs: [ImportDataConfig],
    ) async throws -> any GoogleCloudGax.PollableOperation<ImportDataResponse> {
      let request = ImportDataRequest().with {
        $0.name = name
        $0.importConfigs = importConfigs
      }
      return try await self.importData(withPolling: request)
    }

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

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

    public func exportData(withPolling: ExportDataRequest) async throws -> any GoogleCloudGax
      .PollableOperation<ExportDataResponse>
    {
      try await self.exportData(withPolling: withPolling, options: .init())
    }

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

    public func exportData(
      name: Swift.String,
      exportConfig: ExportDataConfig?,
    ) async throws -> any GoogleCloudGax.PollableOperation<ExportDataResponse> {
      let request = ExportDataRequest().with {
        $0.name = name
        $0.exportConfig = exportConfig
      }
      return try await self.exportData(withPolling: request)
    }

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

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

    public func createDatasetVersion(withPolling: CreateDatasetVersionRequest) async throws
      -> any GoogleCloudGax.PollableOperation<DatasetVersion>
    {
      try await self.createDatasetVersion(withPolling: withPolling, options: .init())
    }

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

    public func createDatasetVersion(
      parent: Swift.String,
      datasetVersion: DatasetVersion?,
    ) async throws -> any GoogleCloudGax.PollableOperation<DatasetVersion> {
      let request = CreateDatasetVersionRequest().with {
        $0.parent = parent
        $0.datasetVersion = datasetVersion
      }
      return try await self.createDatasetVersion(withPolling: request)
    }

    public func updateDatasetVersion(request: UpdateDatasetVersionRequest) async throws
      -> GoogleCloudAIPlatformV1.DatasetVersion
    {
      try await self.updateDatasetVersion(request: request, options: .init())
    }

    public func updateDatasetVersion(
      request: UpdateDatasetVersionRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.DatasetVersion {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func updateDatasetVersion(
      datasetVersion: DatasetVersion?,
      updateMask: GoogleCloudWkt.FieldMask?,
    ) async throws -> GoogleCloudAIPlatformV1.DatasetVersion {
      let request = UpdateDatasetVersionRequest().with {
        $0.datasetVersion = datasetVersion
        $0.updateMask = updateMask
      }
      return try await self.updateDatasetVersion(request: request)
    }

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

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

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

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

    public func getDatasetVersion(request: GetDatasetVersionRequest) async throws
      -> GoogleCloudAIPlatformV1.DatasetVersion
    {
      try await self.getDatasetVersion(request: request, options: .init())
    }

    public func getDatasetVersion(
      request: GetDatasetVersionRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.DatasetVersion {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func getDatasetVersion(
      name: Swift.String,
    ) async throws -> GoogleCloudAIPlatformV1.DatasetVersion {
      let request = GetDatasetVersionRequest().with {
        $0.name = name
      }
      return try await self.getDatasetVersion(request: request)
    }

    public func listDatasetVersions(request: ListDatasetVersionsRequest) async throws
      -> GoogleCloudAIPlatformV1.ListDatasetVersionsResponse
    {
      try await self.listDatasetVersions(request: request, options: .init())
    }

    public func listDatasetVersions(
      request: ListDatasetVersionsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.ListDatasetVersionsResponse {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func listDatasetVersions(
      byItem: ListDatasetVersionsRequest
    ) throws -> any AsyncSequence<DatasetVersion, Swift.Error> {
      try self.listDatasetVersions(byItem: byItem, options: .init())
    }

    public func listDatasetVersions(
      byItem: ListDatasetVersionsRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<DatasetVersion, Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws -> GoogleCloudAIPlatformV1.ListDatasetVersionsResponse in
        throw GoogleCloudGax.RequestError.unimplemented
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

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

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

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

    public func restoreDatasetVersion(withPolling: RestoreDatasetVersionRequest) async throws
      -> any GoogleCloudGax.PollableOperation<DatasetVersion>
    {
      try await self.restoreDatasetVersion(withPolling: withPolling, options: .init())
    }

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

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

    public func listDataItems(request: ListDataItemsRequest) async throws
      -> GoogleCloudAIPlatformV1.ListDataItemsResponse
    {
      try await self.listDataItems(request: request, options: .init())
    }

    public func listDataItems(
      request: ListDataItemsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.ListDataItemsResponse {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func listDataItems(
      byItem: ListDataItemsRequest
    ) throws -> any AsyncSequence<DataItem, Swift.Error> {
      try self.listDataItems(byItem: byItem, options: .init())
    }

    public func listDataItems(
      byItem: ListDataItemsRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<DataItem, Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws -> GoogleCloudAIPlatformV1.ListDataItemsResponse in
        throw GoogleCloudGax.RequestError.unimplemented
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

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

    public func searchDataItems(request: SearchDataItemsRequest) async throws
      -> GoogleCloudAIPlatformV1.SearchDataItemsResponse
    {
      try await self.searchDataItems(request: request, options: .init())
    }

    public func searchDataItems(
      request: SearchDataItemsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.SearchDataItemsResponse {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func searchDataItems(
      byItem: SearchDataItemsRequest
    ) throws -> any AsyncSequence<DataItemView, Swift.Error> {
      try self.searchDataItems(byItem: byItem, options: .init())
    }

    public func searchDataItems(
      byItem: SearchDataItemsRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<DataItemView, Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws -> GoogleCloudAIPlatformV1.SearchDataItemsResponse in
        throw GoogleCloudGax.RequestError.unimplemented
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

    public func listSavedQueries(request: ListSavedQueriesRequest) async throws
      -> GoogleCloudAIPlatformV1.ListSavedQueriesResponse
    {
      try await self.listSavedQueries(request: request, options: .init())
    }

    public func listSavedQueries(
      request: ListSavedQueriesRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.ListSavedQueriesResponse {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func listSavedQueries(
      byItem: ListSavedQueriesRequest
    ) throws -> any AsyncSequence<SavedQuery, Swift.Error> {
      try self.listSavedQueries(byItem: byItem, options: .init())
    }

    public func listSavedQueries(
      byItem: ListSavedQueriesRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<SavedQuery, Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws -> GoogleCloudAIPlatformV1.ListSavedQueriesResponse in
        throw GoogleCloudGax.RequestError.unimplemented
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

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

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

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

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

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

    public func getAnnotationSpec(request: GetAnnotationSpecRequest) async throws
      -> GoogleCloudAIPlatformV1.AnnotationSpec
    {
      try await self.getAnnotationSpec(request: request, options: .init())
    }

    public func getAnnotationSpec(
      request: GetAnnotationSpecRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.AnnotationSpec {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func getAnnotationSpec(
      name: Swift.String,
    ) async throws -> GoogleCloudAIPlatformV1.AnnotationSpec {
      let request = GetAnnotationSpecRequest().with {
        $0.name = name
      }
      return try await self.getAnnotationSpec(request: request)
    }

    public func listAnnotations(request: ListAnnotationsRequest) async throws
      -> GoogleCloudAIPlatformV1.ListAnnotationsResponse
    {
      try await self.listAnnotations(request: request, options: .init())
    }

    public func listAnnotations(
      request: ListAnnotationsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.ListAnnotationsResponse {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func listAnnotations(
      byItem: ListAnnotationsRequest
    ) throws -> any AsyncSequence<Annotation, Swift.Error> {
      try self.listAnnotations(byItem: byItem, options: .init())
    }

    public func listAnnotations(
      byItem: ListAnnotationsRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<Annotation, Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws -> GoogleCloudAIPlatformV1.ListAnnotationsResponse in
        throw GoogleCloudGax.RequestError.unimplemented
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

    public func listAnnotations(
      parent: Swift.String,
    ) throws -> any AsyncSequence<Annotation, Swift.Error> {
      let request = ListAnnotationsRequest().with {
        $0.parent = parent
      }
      return try self.listAnnotations(byItem: 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 setIamPolicy(request: GoogleIAMV1.SetIamPolicyRequest) async throws
      -> GoogleIAMV1.Policy
    {
      try await self.setIamPolicy(request: request, options: .init())
    }

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

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

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

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

    public func testIamPermissions(
      request: GoogleIAMV1.TestIamPermissionsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleIAMV1.TestIamPermissionsResponse {
      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)
    }

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

    public func waitOperation(
      request: GoogleLongRunning.WaitOperationRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      throw GoogleCloudGax.RequestError.unimplemented
    }
  }
#endif
