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

  /// A service for managing Vertex AI's machine learning Models.
  ///
  /// @Snippet(path: "ModelServiceQuickstart")
  public class ModelServiceClient: Clients.ModelServiceProtocol {
    let inner: any Clients.ModelServiceStub
    let pollingErrorPolicy: GoogleCloudGax.PollingErrorPolicy
    let pollingBackoffPolicy: GoogleCloudGax.BackoffPolicy

    /// Creates a new `ModelServiceClient` instance.
    public init(_ options: GoogleCloudGax.ClientOptions = .init()) throws {
      var inner: any Clients.ModelServiceStub = try Clients.ModelServiceTransport(options)
      inner = Clients.ModelServiceRetry(inner, options: options)
      if let logger = options.logger {
        inner = Clients.ModelServiceLogging(inner, logger: logger)
      }
      self.inner = inner
      self.pollingErrorPolicy = options.pollingErrorPolicy
      self.pollingBackoffPolicy = options.pollingBackoffPolicy
    }

    /// Uploads a Model artifact into Vertex AI.
    ///
    /// @Snippet(path: "ModelService_UploadModel")
    public func uploadModel(
      request: UploadModelRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self.inner.uploadModel(request: request, options: options)
    }

    /// Uploads a Model artifact into Vertex AI.
    ///
    /// @Snippet(path: "ModelService_UploadModel")
    public func uploadModel(
      withPolling: UploadModelRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<UploadModelResponse> {
      let extractStatus = {
        (op: GoogleLongRunning.Operation) throws
          -> GoogleCloudGax._PollableOperationImpl<UploadModelResponse>.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 UploadModelResponse(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.uploadModel(request: withPolling, options: options)
      let initialState = try extractStatus(rawOp)
      let poll = {
        () async throws -> GoogleCloudGax._PollableOperationImpl<UploadModelResponse>.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 Model.
    ///
    /// @Snippet(path: "ModelService_GetModel")
    public func getModel(
      request: GetModelRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.Model {
      try await self.inner.getModel(request: request, options: options)
    }

    /// Lists Models in a Location.
    ///
    /// @Snippet(path: "ModelService_ListModels")
    public func listModels(
      request: ListModelsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.ListModelsResponse {
      try await self.inner.listModels(request: request, options: options)
    }

    /// Lists Models in a Location.
    ///
    /// @Snippet(path: "ModelService_ListModels")
    public func listModels(
      byItem: ListModelsRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<Model, Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws -> GoogleCloudAIPlatformV1.ListModelsResponse in
        var request = byItem
        request.pageToken = token
        return try await self.listModels(request: request, options: options)
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

    /// Lists versions of the specified model.
    ///
    /// @Snippet(path: "ModelService_ListModelVersions")
    public func listModelVersions(
      request: ListModelVersionsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.ListModelVersionsResponse {
      try await self.inner.listModelVersions(request: request, options: options)
    }

    /// Lists versions of the specified model.
    ///
    /// @Snippet(path: "ModelService_ListModelVersions")
    public func listModelVersions(
      byItem: ListModelVersionsRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<Model, Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws -> GoogleCloudAIPlatformV1.ListModelVersionsResponse in
        var request = byItem
        request.pageToken = token
        return try await self.listModelVersions(request: request, options: options)
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

    /// Lists checkpoints of the specified model version.
    ///
    /// @Snippet(path: "ModelService_ListModelVersionCheckpoints")
    public func listModelVersionCheckpoints(
      request: ListModelVersionCheckpointsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.ListModelVersionCheckpointsResponse {
      try await self.inner.listModelVersionCheckpoints(request: request, options: options)
    }

    /// Lists checkpoints of the specified model version.
    ///
    /// @Snippet(path: "ModelService_ListModelVersionCheckpoints")
    public func listModelVersionCheckpoints(
      byItem: ListModelVersionCheckpointsRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<ModelVersionCheckpoint, Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws
          -> GoogleCloudAIPlatformV1.ListModelVersionCheckpointsResponse in
        var request = byItem
        request.pageToken = token
        return try await self.listModelVersionCheckpoints(request: request, options: options)
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

    /// Updates a Model.
    ///
    /// @Snippet(path: "ModelService_UpdateModel")
    public func updateModel(
      request: UpdateModelRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.Model {
      try await self.inner.updateModel(request: request, options: options)
    }

    /// Incrementally update the dataset used for an examples model.
    ///
    /// @Snippet(path: "ModelService_UpdateExplanationDataset")
    public func updateExplanationDataset(
      request: UpdateExplanationDatasetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self.inner.updateExplanationDataset(request: request, options: options)
    }

    /// Incrementally update the dataset used for an examples model.
    ///
    /// @Snippet(path: "ModelService_UpdateExplanationDataset")
    public func updateExplanationDataset(
      withPolling: UpdateExplanationDatasetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<UpdateExplanationDatasetResponse> {
      let extractStatus = {
        (op: GoogleLongRunning.Operation) throws
          -> GoogleCloudGax._PollableOperationImpl<UpdateExplanationDatasetResponse>.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 UpdateExplanationDatasetResponse(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.updateExplanationDataset(request: withPolling, options: options)
      let initialState = try extractStatus(rawOp)
      let poll = {
        () async throws
          -> GoogleCloudGax._PollableOperationImpl<UpdateExplanationDatasetResponse>.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 Model.
    ///
    /// A model cannot be deleted if any
    /// [Endpoint][google.cloud.aiplatform.v1.Endpoint] resource has a
    /// [DeployedModel][google.cloud.aiplatform.v1.DeployedModel] based on the
    /// model in its
    /// [deployed_models][google.cloud.aiplatform.v1.Endpoint.deployed_models]
    /// field.
    ///
    /// [google.cloud.aiplatform.v1.DeployedModel]: <doc:DeployedModel>
    /// [google.cloud.aiplatform.v1.Endpoint]: <doc:Endpoint>
    /// [google.cloud.aiplatform.v1.Endpoint.deployed_models]: <doc:Endpoint/deployedModels>
    ///
    /// @Snippet(path: "ModelService_DeleteModel")
    public func deleteModel(
      request: DeleteModelRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self.inner.deleteModel(request: request, options: options)
    }

    /// Deletes a Model.
    ///
    /// A model cannot be deleted if any
    /// [Endpoint][google.cloud.aiplatform.v1.Endpoint] resource has a
    /// [DeployedModel][google.cloud.aiplatform.v1.DeployedModel] based on the
    /// model in its
    /// [deployed_models][google.cloud.aiplatform.v1.Endpoint.deployed_models]
    /// field.
    ///
    /// [google.cloud.aiplatform.v1.DeployedModel]: <doc:DeployedModel>
    /// [google.cloud.aiplatform.v1.Endpoint]: <doc:Endpoint>
    /// [google.cloud.aiplatform.v1.Endpoint.deployed_models]: <doc:Endpoint/deployedModels>
    ///
    /// @Snippet(path: "ModelService_DeleteModel")
    public func deleteModel(
      withPolling: DeleteModelRequest, 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.deleteModel(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,
      )
    }

    /// Deletes a Model version.
    ///
    /// Model version can only be deleted if there are no
    /// [DeployedModels][google.cloud.aiplatform.v1.DeployedModel] created from it.
    /// Deleting the only version in the Model is not allowed. Use
    /// [DeleteModel][google.cloud.aiplatform.v1.ModelService.DeleteModel] for
    /// deleting the Model instead.
    ///
    /// [google.cloud.aiplatform.v1.DeployedModel]: <doc:DeployedModel>
    /// [google.cloud.aiplatform.v1.ModelService.DeleteModel]: <doc:ModelService/deleteModel(request:)>
    ///
    /// @Snippet(path: "ModelService_DeleteModelVersion")
    public func deleteModelVersion(
      request: DeleteModelVersionRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self.inner.deleteModelVersion(request: request, options: options)
    }

    /// Deletes a Model version.
    ///
    /// Model version can only be deleted if there are no
    /// [DeployedModels][google.cloud.aiplatform.v1.DeployedModel] created from it.
    /// Deleting the only version in the Model is not allowed. Use
    /// [DeleteModel][google.cloud.aiplatform.v1.ModelService.DeleteModel] for
    /// deleting the Model instead.
    ///
    /// [google.cloud.aiplatform.v1.DeployedModel]: <doc:DeployedModel>
    /// [google.cloud.aiplatform.v1.ModelService.DeleteModel]: <doc:ModelService/deleteModel(request:)>
    ///
    /// @Snippet(path: "ModelService_DeleteModelVersion")
    public func deleteModelVersion(
      withPolling: DeleteModelVersionRequest, 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.deleteModelVersion(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,
      )
    }

    /// Merges a set of aliases for a Model version.
    ///
    /// @Snippet(path: "ModelService_MergeVersionAliases")
    public func mergeVersionAliases(
      request: MergeVersionAliasesRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.Model {
      try await self.inner.mergeVersionAliases(request: request, options: options)
    }

    /// Exports a trained, exportable Model to a location specified by the
    /// user. A Model is considered to be exportable if it has at least one
    /// [supported export
    /// format][google.cloud.aiplatform.v1.Model.supported_export_formats].
    ///
    /// [google.cloud.aiplatform.v1.Model.supported_export_formats]: <doc:Model/supportedExportFormats>
    ///
    /// @Snippet(path: "ModelService_ExportModel")
    public func exportModel(
      request: ExportModelRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self.inner.exportModel(request: request, options: options)
    }

    /// Exports a trained, exportable Model to a location specified by the
    /// user. A Model is considered to be exportable if it has at least one
    /// [supported export
    /// format][google.cloud.aiplatform.v1.Model.supported_export_formats].
    ///
    /// [google.cloud.aiplatform.v1.Model.supported_export_formats]: <doc:Model/supportedExportFormats>
    ///
    /// @Snippet(path: "ModelService_ExportModel")
    public func exportModel(
      withPolling: ExportModelRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<ExportModelResponse> {
      let extractStatus = {
        (op: GoogleLongRunning.Operation) throws
          -> GoogleCloudGax._PollableOperationImpl<ExportModelResponse>.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 ExportModelResponse(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.exportModel(request: withPolling, options: options)
      let initialState = try extractStatus(rawOp)
      let poll = {
        () async throws -> GoogleCloudGax._PollableOperationImpl<ExportModelResponse>.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,
      )
    }

    /// Copies an already existing Vertex AI Model into the specified Location.
    /// The source Model must exist in the same Project.
    /// When copying custom Models, the users themselves are responsible for
    /// [Model.metadata][google.cloud.aiplatform.v1.Model.metadata] content to be
    /// region-agnostic, as well as making sure that any resources (e.g. files) it
    /// depends on remain accessible.
    ///
    /// [google.cloud.aiplatform.v1.Model.metadata]: <doc:Model/metadata>
    ///
    /// @Snippet(path: "ModelService_CopyModel")
    public func copyModel(
      request: CopyModelRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self.inner.copyModel(request: request, options: options)
    }

    /// Copies an already existing Vertex AI Model into the specified Location.
    /// The source Model must exist in the same Project.
    /// When copying custom Models, the users themselves are responsible for
    /// [Model.metadata][google.cloud.aiplatform.v1.Model.metadata] content to be
    /// region-agnostic, as well as making sure that any resources (e.g. files) it
    /// depends on remain accessible.
    ///
    /// [google.cloud.aiplatform.v1.Model.metadata]: <doc:Model/metadata>
    ///
    /// @Snippet(path: "ModelService_CopyModel")
    public func copyModel(
      withPolling: CopyModelRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<CopyModelResponse> {
      let extractStatus = {
        (op: GoogleLongRunning.Operation) throws
          -> GoogleCloudGax._PollableOperationImpl<CopyModelResponse>.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 CopyModelResponse(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.copyModel(request: withPolling, options: options)
      let initialState = try extractStatus(rawOp)
      let poll = {
        () async throws -> GoogleCloudGax._PollableOperationImpl<CopyModelResponse>.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 an externally generated ModelEvaluation.
    ///
    /// @Snippet(path: "ModelService_ImportModelEvaluation")
    public func importModelEvaluation(
      request: ImportModelEvaluationRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.ModelEvaluation {
      try await self.inner.importModelEvaluation(request: request, options: options)
    }

    /// Imports a list of externally generated ModelEvaluationSlice.
    ///
    /// @Snippet(path: "ModelService_BatchImportModelEvaluationSlices")
    public func batchImportModelEvaluationSlices(
      request: BatchImportModelEvaluationSlicesRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.BatchImportModelEvaluationSlicesResponse {
      try await self.inner.batchImportModelEvaluationSlices(request: request, options: options)
    }

    /// Imports a list of externally generated EvaluatedAnnotations.
    ///
    /// @Snippet(path: "ModelService_BatchImportEvaluatedAnnotations")
    public func batchImportEvaluatedAnnotations(
      request: BatchImportEvaluatedAnnotationsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.BatchImportEvaluatedAnnotationsResponse {
      try await self.inner.batchImportEvaluatedAnnotations(request: request, options: options)
    }

    /// Gets a ModelEvaluation.
    ///
    /// @Snippet(path: "ModelService_GetModelEvaluation")
    public func getModelEvaluation(
      request: GetModelEvaluationRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.ModelEvaluation {
      try await self.inner.getModelEvaluation(request: request, options: options)
    }

    /// Lists ModelEvaluations in a Model.
    ///
    /// @Snippet(path: "ModelService_ListModelEvaluations")
    public func listModelEvaluations(
      request: ListModelEvaluationsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.ListModelEvaluationsResponse {
      try await self.inner.listModelEvaluations(request: request, options: options)
    }

    /// Lists ModelEvaluations in a Model.
    ///
    /// @Snippet(path: "ModelService_ListModelEvaluations")
    public func listModelEvaluations(
      byItem: ListModelEvaluationsRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<ModelEvaluation, Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws -> GoogleCloudAIPlatformV1.ListModelEvaluationsResponse
        in
        var request = byItem
        request.pageToken = token
        return try await self.listModelEvaluations(request: request, options: options)
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

    /// Gets a ModelEvaluationSlice.
    ///
    /// @Snippet(path: "ModelService_GetModelEvaluationSlice")
    public func getModelEvaluationSlice(
      request: GetModelEvaluationSliceRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.ModelEvaluationSlice {
      try await self.inner.getModelEvaluationSlice(request: request, options: options)
    }

    /// Lists ModelEvaluationSlices in a ModelEvaluation.
    ///
    /// @Snippet(path: "ModelService_ListModelEvaluationSlices")
    public func listModelEvaluationSlices(
      request: ListModelEvaluationSlicesRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.ListModelEvaluationSlicesResponse {
      try await self.inner.listModelEvaluationSlices(request: request, options: options)
    }

    /// Lists ModelEvaluationSlices in a ModelEvaluation.
    ///
    /// @Snippet(path: "ModelService_ListModelEvaluationSlices")
    public func listModelEvaluationSlices(
      byItem: ListModelEvaluationSlicesRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<ModelEvaluationSlice, Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws
          -> GoogleCloudAIPlatformV1.ListModelEvaluationSlicesResponse in
        var request = byItem
        request.pageToken = token
        return try await self.listModelEvaluationSlices(request: request, options: options)
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

    /// Lists information about the supported locations for this service.
    ///
    /// @Snippet(path: "ModelService_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: "ModelService_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: "ModelService_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: "ModelService_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: "ModelService_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: "ModelService_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: "ModelService_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: "ModelService_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: "ModelService_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: "ModelService_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: "ModelService_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: "ModelService_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 `ModelServiceClient`.
    ///
    /// To mock `ModelServiceClient` change your functions to receive
    /// `some ModelServiceProtocol` or `any ModelServiceProtocol`
    /// and pass a mock implementation in your tests.
    public protocol ModelServiceProtocol {
      /// See `ModelServiceClient.uploadModel`.
      func uploadModel(request: UploadModelRequest) async throws -> GoogleLongRunning.Operation

      /// See `ModelServiceClient.uploadModel`.
      func uploadModel(withPolling: UploadModelRequest) async throws -> any GoogleCloudGax
        .PollableOperation<UploadModelResponse>

      /// See `ModelServiceClient.uploadModel`.
      func uploadModel(
        parent: Swift.String,
        model: Model?,
      ) async throws -> any GoogleCloudGax.PollableOperation<UploadModelResponse>

      /// See `ModelServiceClient.getModel`.
      func getModel(request: GetModelRequest) async throws -> GoogleCloudAIPlatformV1.Model

      /// See `ModelServiceClient.getModel`.
      func getModel(
        name: Swift.String,
      ) async throws -> GoogleCloudAIPlatformV1.Model

      /// See `ModelServiceClient.listModels`.
      func listModels(request: ListModelsRequest) async throws
        -> GoogleCloudAIPlatformV1.ListModelsResponse

      /// See `ModelServiceClient.listModels`.
      func listModels(
        byItem: ListModelsRequest
      ) throws -> any AsyncSequence<Model, Swift.Error>

      /// See `ModelServiceClient.listModels`.
      func listModels(
        parent: Swift.String,
      ) throws -> any AsyncSequence<Model, Swift.Error>

      /// See `ModelServiceClient.listModelVersions`.
      func listModelVersions(request: ListModelVersionsRequest) async throws
        -> GoogleCloudAIPlatformV1.ListModelVersionsResponse

      /// See `ModelServiceClient.listModelVersions`.
      func listModelVersions(
        byItem: ListModelVersionsRequest
      ) throws -> any AsyncSequence<Model, Swift.Error>

      /// See `ModelServiceClient.listModelVersions`.
      func listModelVersions(
        name: Swift.String,
      ) throws -> any AsyncSequence<Model, Swift.Error>

      /// See `ModelServiceClient.listModelVersionCheckpoints`.
      func listModelVersionCheckpoints(request: ListModelVersionCheckpointsRequest) async throws
        -> GoogleCloudAIPlatformV1.ListModelVersionCheckpointsResponse

      /// See `ModelServiceClient.listModelVersionCheckpoints`.
      func listModelVersionCheckpoints(
        byItem: ListModelVersionCheckpointsRequest
      ) throws -> any AsyncSequence<ModelVersionCheckpoint, Swift.Error>

      /// See `ModelServiceClient.listModelVersionCheckpoints`.
      func listModelVersionCheckpoints(
        name: Swift.String,
      ) throws -> any AsyncSequence<ModelVersionCheckpoint, Swift.Error>

      /// See `ModelServiceClient.updateModel`.
      func updateModel(request: UpdateModelRequest) async throws -> GoogleCloudAIPlatformV1.Model

      /// See `ModelServiceClient.updateModel`.
      func updateModel(
        model: Model?,
        updateMask: GoogleCloudWkt.FieldMask?,
      ) async throws -> GoogleCloudAIPlatformV1.Model

      /// See `ModelServiceClient.updateExplanationDataset`.
      func updateExplanationDataset(request: UpdateExplanationDatasetRequest) async throws
        -> GoogleLongRunning.Operation

      /// See `ModelServiceClient.updateExplanationDataset`.
      func updateExplanationDataset(withPolling: UpdateExplanationDatasetRequest) async throws
        -> any GoogleCloudGax.PollableOperation<UpdateExplanationDatasetResponse>

      /// See `ModelServiceClient.updateExplanationDataset`.
      func updateExplanationDataset(
        model: Swift.String,
      ) async throws -> any GoogleCloudGax.PollableOperation<UpdateExplanationDatasetResponse>

      /// See `ModelServiceClient.deleteModel`.
      func deleteModel(request: DeleteModelRequest) async throws -> GoogleLongRunning.Operation

      /// See `ModelServiceClient.deleteModel`.
      func deleteModel(withPolling: DeleteModelRequest) async throws -> any GoogleCloudGax
        .PollableOperation<Void>

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

      /// See `ModelServiceClient.deleteModelVersion`.
      func deleteModelVersion(request: DeleteModelVersionRequest) async throws
        -> GoogleLongRunning.Operation

      /// See `ModelServiceClient.deleteModelVersion`.
      func deleteModelVersion(withPolling: DeleteModelVersionRequest) async throws
        -> any GoogleCloudGax.PollableOperation<Void>

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

      /// See `ModelServiceClient.mergeVersionAliases`.
      func mergeVersionAliases(request: MergeVersionAliasesRequest) async throws
        -> GoogleCloudAIPlatformV1.Model

      /// See `ModelServiceClient.mergeVersionAliases`.
      func mergeVersionAliases(
        name: Swift.String,
        versionAliases: [Swift.String],
      ) async throws -> GoogleCloudAIPlatformV1.Model

      /// See `ModelServiceClient.exportModel`.
      func exportModel(request: ExportModelRequest) async throws -> GoogleLongRunning.Operation

      /// See `ModelServiceClient.exportModel`.
      func exportModel(withPolling: ExportModelRequest) async throws -> any GoogleCloudGax
        .PollableOperation<ExportModelResponse>

      /// See `ModelServiceClient.exportModel`.
      func exportModel(
        name: Swift.String,
        outputConfig: ExportModelRequest.OutputConfig?,
      ) async throws -> any GoogleCloudGax.PollableOperation<ExportModelResponse>

      /// See `ModelServiceClient.copyModel`.
      func copyModel(request: CopyModelRequest) async throws -> GoogleLongRunning.Operation

      /// See `ModelServiceClient.copyModel`.
      func copyModel(withPolling: CopyModelRequest) async throws -> any GoogleCloudGax
        .PollableOperation<CopyModelResponse>

      /// See `ModelServiceClient.copyModel`.
      func copyModel(
        parent: Swift.String,
        sourceModel: Swift.String,
      ) async throws -> any GoogleCloudGax.PollableOperation<CopyModelResponse>

      /// See `ModelServiceClient.importModelEvaluation`.
      func importModelEvaluation(request: ImportModelEvaluationRequest) async throws
        -> GoogleCloudAIPlatformV1.ModelEvaluation

      /// See `ModelServiceClient.importModelEvaluation`.
      func importModelEvaluation(
        parent: Swift.String,
        modelEvaluation: ModelEvaluation?,
      ) async throws -> GoogleCloudAIPlatformV1.ModelEvaluation

      /// See `ModelServiceClient.batchImportModelEvaluationSlices`.
      func batchImportModelEvaluationSlices(request: BatchImportModelEvaluationSlicesRequest)
        async throws -> GoogleCloudAIPlatformV1.BatchImportModelEvaluationSlicesResponse

      /// See `ModelServiceClient.batchImportModelEvaluationSlices`.
      func batchImportModelEvaluationSlices(
        parent: Swift.String,
        modelEvaluationSlices: [ModelEvaluationSlice],
      ) async throws -> GoogleCloudAIPlatformV1.BatchImportModelEvaluationSlicesResponse

      /// See `ModelServiceClient.batchImportEvaluatedAnnotations`.
      func batchImportEvaluatedAnnotations(request: BatchImportEvaluatedAnnotationsRequest)
        async throws -> GoogleCloudAIPlatformV1.BatchImportEvaluatedAnnotationsResponse

      /// See `ModelServiceClient.batchImportEvaluatedAnnotations`.
      func batchImportEvaluatedAnnotations(
        parent: Swift.String,
        evaluatedAnnotations: [EvaluatedAnnotation],
      ) async throws -> GoogleCloudAIPlatformV1.BatchImportEvaluatedAnnotationsResponse

      /// See `ModelServiceClient.getModelEvaluation`.
      func getModelEvaluation(request: GetModelEvaluationRequest) async throws
        -> GoogleCloudAIPlatformV1.ModelEvaluation

      /// See `ModelServiceClient.getModelEvaluation`.
      func getModelEvaluation(
        name: Swift.String,
      ) async throws -> GoogleCloudAIPlatformV1.ModelEvaluation

      /// See `ModelServiceClient.listModelEvaluations`.
      func listModelEvaluations(request: ListModelEvaluationsRequest) async throws
        -> GoogleCloudAIPlatformV1.ListModelEvaluationsResponse

      /// See `ModelServiceClient.listModelEvaluations`.
      func listModelEvaluations(
        byItem: ListModelEvaluationsRequest
      ) throws -> any AsyncSequence<ModelEvaluation, Swift.Error>

      /// See `ModelServiceClient.listModelEvaluations`.
      func listModelEvaluations(
        parent: Swift.String,
      ) throws -> any AsyncSequence<ModelEvaluation, Swift.Error>

      /// See `ModelServiceClient.getModelEvaluationSlice`.
      func getModelEvaluationSlice(request: GetModelEvaluationSliceRequest) async throws
        -> GoogleCloudAIPlatformV1.ModelEvaluationSlice

      /// See `ModelServiceClient.getModelEvaluationSlice`.
      func getModelEvaluationSlice(
        name: Swift.String,
      ) async throws -> GoogleCloudAIPlatformV1.ModelEvaluationSlice

      /// See `ModelServiceClient.listModelEvaluationSlices`.
      func listModelEvaluationSlices(request: ListModelEvaluationSlicesRequest) async throws
        -> GoogleCloudAIPlatformV1.ListModelEvaluationSlicesResponse

      /// See `ModelServiceClient.listModelEvaluationSlices`.
      func listModelEvaluationSlices(
        byItem: ListModelEvaluationSlicesRequest
      ) throws -> any AsyncSequence<ModelEvaluationSlice, Swift.Error>

      /// See `ModelServiceClient.listModelEvaluationSlices`.
      func listModelEvaluationSlices(
        parent: Swift.String,
      ) throws -> any AsyncSequence<ModelEvaluationSlice, Swift.Error>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      /// See `ModelServiceClient.uploadModel`.
      func uploadModel(
        request: UploadModelRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleLongRunning.Operation

      /// See `ModelServiceClient.uploadModel`.
      func uploadModel(
        withPolling: UploadModelRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> any GoogleCloudGax.PollableOperation<UploadModelResponse>

      /// See `ModelServiceClient.getModel`.
      func getModel(
        request: GetModelRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudAIPlatformV1.Model

      /// See `ModelServiceClient.listModels`.
      func listModels(
        request: ListModelsRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudAIPlatformV1.ListModelsResponse

      /// See `ModelServiceClient.listModels`.
      func listModels(
        byItem: ListModelsRequest, options: GoogleCloudGax.RequestOptions
      ) throws -> any AsyncSequence<Model, Swift.Error>

      /// See `ModelServiceClient.listModelVersions`.
      func listModelVersions(
        request: ListModelVersionsRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudAIPlatformV1.ListModelVersionsResponse

      /// See `ModelServiceClient.listModelVersions`.
      func listModelVersions(
        byItem: ListModelVersionsRequest, options: GoogleCloudGax.RequestOptions
      ) throws -> any AsyncSequence<Model, Swift.Error>

      /// See `ModelServiceClient.listModelVersionCheckpoints`.
      func listModelVersionCheckpoints(
        request: ListModelVersionCheckpointsRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudAIPlatformV1.ListModelVersionCheckpointsResponse

      /// See `ModelServiceClient.listModelVersionCheckpoints`.
      func listModelVersionCheckpoints(
        byItem: ListModelVersionCheckpointsRequest, options: GoogleCloudGax.RequestOptions
      ) throws -> any AsyncSequence<ModelVersionCheckpoint, Swift.Error>

      /// See `ModelServiceClient.updateModel`.
      func updateModel(
        request: UpdateModelRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudAIPlatformV1.Model

      /// See `ModelServiceClient.updateExplanationDataset`.
      func updateExplanationDataset(
        request: UpdateExplanationDatasetRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleLongRunning.Operation

      /// See `ModelServiceClient.updateExplanationDataset`.
      func updateExplanationDataset(
        withPolling: UpdateExplanationDatasetRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> any GoogleCloudGax.PollableOperation<UpdateExplanationDatasetResponse>

      /// See `ModelServiceClient.deleteModel`.
      func deleteModel(
        request: DeleteModelRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleLongRunning.Operation

      /// See `ModelServiceClient.deleteModel`.
      func deleteModel(
        withPolling: DeleteModelRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> any GoogleCloudGax.PollableOperation<Void>

      /// See `ModelServiceClient.deleteModelVersion`.
      func deleteModelVersion(
        request: DeleteModelVersionRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleLongRunning.Operation

      /// See `ModelServiceClient.deleteModelVersion`.
      func deleteModelVersion(
        withPolling: DeleteModelVersionRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> any GoogleCloudGax.PollableOperation<Void>

      /// See `ModelServiceClient.mergeVersionAliases`.
      func mergeVersionAliases(
        request: MergeVersionAliasesRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudAIPlatformV1.Model

      /// See `ModelServiceClient.exportModel`.
      func exportModel(
        request: ExportModelRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleLongRunning.Operation

      /// See `ModelServiceClient.exportModel`.
      func exportModel(
        withPolling: ExportModelRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> any GoogleCloudGax.PollableOperation<ExportModelResponse>

      /// See `ModelServiceClient.copyModel`.
      func copyModel(
        request: CopyModelRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleLongRunning.Operation

      /// See `ModelServiceClient.copyModel`.
      func copyModel(
        withPolling: CopyModelRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> any GoogleCloudGax.PollableOperation<CopyModelResponse>

      /// See `ModelServiceClient.importModelEvaluation`.
      func importModelEvaluation(
        request: ImportModelEvaluationRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudAIPlatformV1.ModelEvaluation

      /// See `ModelServiceClient.batchImportModelEvaluationSlices`.
      func batchImportModelEvaluationSlices(
        request: BatchImportModelEvaluationSlicesRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudAIPlatformV1.BatchImportModelEvaluationSlicesResponse

      /// See `ModelServiceClient.batchImportEvaluatedAnnotations`.
      func batchImportEvaluatedAnnotations(
        request: BatchImportEvaluatedAnnotationsRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudAIPlatformV1.BatchImportEvaluatedAnnotationsResponse

      /// See `ModelServiceClient.getModelEvaluation`.
      func getModelEvaluation(
        request: GetModelEvaluationRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudAIPlatformV1.ModelEvaluation

      /// See `ModelServiceClient.listModelEvaluations`.
      func listModelEvaluations(
        request: ListModelEvaluationsRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudAIPlatformV1.ListModelEvaluationsResponse

      /// See `ModelServiceClient.listModelEvaluations`.
      func listModelEvaluations(
        byItem: ListModelEvaluationsRequest, options: GoogleCloudGax.RequestOptions
      ) throws -> any AsyncSequence<ModelEvaluation, Swift.Error>

      /// See `ModelServiceClient.getModelEvaluationSlice`.
      func getModelEvaluationSlice(
        request: GetModelEvaluationSliceRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudAIPlatformV1.ModelEvaluationSlice

      /// See `ModelServiceClient.listModelEvaluationSlices`.
      func listModelEvaluationSlices(
        request: ListModelEvaluationSlicesRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudAIPlatformV1.ListModelEvaluationSlicesResponse

      /// See `ModelServiceClient.listModelEvaluationSlices`.
      func listModelEvaluationSlices(
        byItem: ListModelEvaluationSlicesRequest, options: GoogleCloudGax.RequestOptions
      ) throws -> any AsyncSequence<ModelEvaluationSlice, Swift.Error>

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

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

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

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

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

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

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

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

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

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

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

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

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

    public func uploadModel(withPolling: UploadModelRequest) async throws -> any GoogleCloudGax
      .PollableOperation<UploadModelResponse>
    {
      try await self.uploadModel(withPolling: withPolling, options: .init())
    }

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

    public func uploadModel(
      parent: Swift.String,
      model: Model?,
    ) async throws -> any GoogleCloudGax.PollableOperation<UploadModelResponse> {
      let request = UploadModelRequest().with {
        $0.parent = parent
        $0.model = model
      }
      return try await self.uploadModel(withPolling: request)
    }

    public func getModel(request: GetModelRequest) async throws -> GoogleCloudAIPlatformV1.Model {
      try await self.getModel(request: request, options: .init())
    }

    public func getModel(
      request: GetModelRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.Model {
      throw GoogleCloudGax.RequestError.unimplemented
    }

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

    public func listModels(request: ListModelsRequest) async throws
      -> GoogleCloudAIPlatformV1.ListModelsResponse
    {
      try await self.listModels(request: request, options: .init())
    }

    public func listModels(
      request: ListModelsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.ListModelsResponse {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func listModels(
      byItem: ListModelsRequest
    ) throws -> any AsyncSequence<Model, Swift.Error> {
      try self.listModels(byItem: byItem, options: .init())
    }

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

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

    public func listModelVersions(request: ListModelVersionsRequest) async throws
      -> GoogleCloudAIPlatformV1.ListModelVersionsResponse
    {
      try await self.listModelVersions(request: request, options: .init())
    }

    public func listModelVersions(
      request: ListModelVersionsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.ListModelVersionsResponse {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func listModelVersions(
      byItem: ListModelVersionsRequest
    ) throws -> any AsyncSequence<Model, Swift.Error> {
      try self.listModelVersions(byItem: byItem, options: .init())
    }

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

    public func listModelVersions(
      name: Swift.String,
    ) throws -> any AsyncSequence<Model, Swift.Error> {
      let request = ListModelVersionsRequest().with {
        $0.name = name
      }
      return try self.listModelVersions(byItem: request)
    }

    public func listModelVersionCheckpoints(request: ListModelVersionCheckpointsRequest)
      async throws -> GoogleCloudAIPlatformV1.ListModelVersionCheckpointsResponse
    {
      try await self.listModelVersionCheckpoints(request: request, options: .init())
    }

    public func listModelVersionCheckpoints(
      request: ListModelVersionCheckpointsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.ListModelVersionCheckpointsResponse {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func listModelVersionCheckpoints(
      byItem: ListModelVersionCheckpointsRequest
    ) throws -> any AsyncSequence<ModelVersionCheckpoint, Swift.Error> {
      try self.listModelVersionCheckpoints(byItem: byItem, options: .init())
    }

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

    public func listModelVersionCheckpoints(
      name: Swift.String,
    ) throws -> any AsyncSequence<ModelVersionCheckpoint, Swift.Error> {
      let request = ListModelVersionCheckpointsRequest().with {
        $0.name = name
      }
      return try self.listModelVersionCheckpoints(byItem: request)
    }

    public func updateModel(request: UpdateModelRequest) async throws
      -> GoogleCloudAIPlatformV1.Model
    {
      try await self.updateModel(request: request, options: .init())
    }

    public func updateModel(
      request: UpdateModelRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.Model {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func updateModel(
      model: Model?,
      updateMask: GoogleCloudWkt.FieldMask?,
    ) async throws -> GoogleCloudAIPlatformV1.Model {
      let request = UpdateModelRequest().with {
        $0.model = model
        $0.updateMask = updateMask
      }
      return try await self.updateModel(request: request)
    }

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

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

    public func updateExplanationDataset(withPolling: UpdateExplanationDatasetRequest) async throws
      -> any GoogleCloudGax.PollableOperation<UpdateExplanationDatasetResponse>
    {
      try await self.updateExplanationDataset(withPolling: withPolling, options: .init())
    }

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

    public func updateExplanationDataset(
      model: Swift.String,
    ) async throws -> any GoogleCloudGax.PollableOperation<UpdateExplanationDatasetResponse> {
      let request = UpdateExplanationDatasetRequest().with {
        $0.model = model
      }
      return try await self.updateExplanationDataset(withPolling: request)
    }

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

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

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

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

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

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

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

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

    public func mergeVersionAliases(request: MergeVersionAliasesRequest) async throws
      -> GoogleCloudAIPlatformV1.Model
    {
      try await self.mergeVersionAliases(request: request, options: .init())
    }

    public func mergeVersionAliases(
      request: MergeVersionAliasesRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.Model {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func mergeVersionAliases(
      name: Swift.String,
      versionAliases: [Swift.String],
    ) async throws -> GoogleCloudAIPlatformV1.Model {
      let request = MergeVersionAliasesRequest().with {
        $0.name = name
        $0.versionAliases = versionAliases
      }
      return try await self.mergeVersionAliases(request: request)
    }

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

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

    public func exportModel(withPolling: ExportModelRequest) async throws -> any GoogleCloudGax
      .PollableOperation<ExportModelResponse>
    {
      try await self.exportModel(withPolling: withPolling, options: .init())
    }

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

    public func exportModel(
      name: Swift.String,
      outputConfig: ExportModelRequest.OutputConfig?,
    ) async throws -> any GoogleCloudGax.PollableOperation<ExportModelResponse> {
      let request = ExportModelRequest().with {
        $0.name = name
        $0.outputConfig = outputConfig
      }
      return try await self.exportModel(withPolling: request)
    }

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

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

    public func copyModel(withPolling: CopyModelRequest) async throws -> any GoogleCloudGax
      .PollableOperation<CopyModelResponse>
    {
      try await self.copyModel(withPolling: withPolling, options: .init())
    }

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

    public func copyModel(
      parent: Swift.String,
      sourceModel: Swift.String,
    ) async throws -> any GoogleCloudGax.PollableOperation<CopyModelResponse> {
      let request = CopyModelRequest().with {
        $0.parent = parent
        $0.sourceModel = sourceModel
      }
      return try await self.copyModel(withPolling: request)
    }

    public func importModelEvaluation(request: ImportModelEvaluationRequest) async throws
      -> GoogleCloudAIPlatformV1.ModelEvaluation
    {
      try await self.importModelEvaluation(request: request, options: .init())
    }

    public func importModelEvaluation(
      request: ImportModelEvaluationRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.ModelEvaluation {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func importModelEvaluation(
      parent: Swift.String,
      modelEvaluation: ModelEvaluation?,
    ) async throws -> GoogleCloudAIPlatformV1.ModelEvaluation {
      let request = ImportModelEvaluationRequest().with {
        $0.parent = parent
        $0.modelEvaluation = modelEvaluation
      }
      return try await self.importModelEvaluation(request: request)
    }

    public func batchImportModelEvaluationSlices(request: BatchImportModelEvaluationSlicesRequest)
      async throws -> GoogleCloudAIPlatformV1.BatchImportModelEvaluationSlicesResponse
    {
      try await self.batchImportModelEvaluationSlices(request: request, options: .init())
    }

    public func batchImportModelEvaluationSlices(
      request: BatchImportModelEvaluationSlicesRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.BatchImportModelEvaluationSlicesResponse {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func batchImportModelEvaluationSlices(
      parent: Swift.String,
      modelEvaluationSlices: [ModelEvaluationSlice],
    ) async throws -> GoogleCloudAIPlatformV1.BatchImportModelEvaluationSlicesResponse {
      let request = BatchImportModelEvaluationSlicesRequest().with {
        $0.parent = parent
        $0.modelEvaluationSlices = modelEvaluationSlices
      }
      return try await self.batchImportModelEvaluationSlices(request: request)
    }

    public func batchImportEvaluatedAnnotations(request: BatchImportEvaluatedAnnotationsRequest)
      async throws -> GoogleCloudAIPlatformV1.BatchImportEvaluatedAnnotationsResponse
    {
      try await self.batchImportEvaluatedAnnotations(request: request, options: .init())
    }

    public func batchImportEvaluatedAnnotations(
      request: BatchImportEvaluatedAnnotationsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.BatchImportEvaluatedAnnotationsResponse {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func batchImportEvaluatedAnnotations(
      parent: Swift.String,
      evaluatedAnnotations: [EvaluatedAnnotation],
    ) async throws -> GoogleCloudAIPlatformV1.BatchImportEvaluatedAnnotationsResponse {
      let request = BatchImportEvaluatedAnnotationsRequest().with {
        $0.parent = parent
        $0.evaluatedAnnotations = evaluatedAnnotations
      }
      return try await self.batchImportEvaluatedAnnotations(request: request)
    }

    public func getModelEvaluation(request: GetModelEvaluationRequest) async throws
      -> GoogleCloudAIPlatformV1.ModelEvaluation
    {
      try await self.getModelEvaluation(request: request, options: .init())
    }

    public func getModelEvaluation(
      request: GetModelEvaluationRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.ModelEvaluation {
      throw GoogleCloudGax.RequestError.unimplemented
    }

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

    public func listModelEvaluations(request: ListModelEvaluationsRequest) async throws
      -> GoogleCloudAIPlatformV1.ListModelEvaluationsResponse
    {
      try await self.listModelEvaluations(request: request, options: .init())
    }

    public func listModelEvaluations(
      request: ListModelEvaluationsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.ListModelEvaluationsResponse {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func listModelEvaluations(
      byItem: ListModelEvaluationsRequest
    ) throws -> any AsyncSequence<ModelEvaluation, Swift.Error> {
      try self.listModelEvaluations(byItem: byItem, options: .init())
    }

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

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

    public func getModelEvaluationSlice(request: GetModelEvaluationSliceRequest) async throws
      -> GoogleCloudAIPlatformV1.ModelEvaluationSlice
    {
      try await self.getModelEvaluationSlice(request: request, options: .init())
    }

    public func getModelEvaluationSlice(
      request: GetModelEvaluationSliceRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.ModelEvaluationSlice {
      throw GoogleCloudGax.RequestError.unimplemented
    }

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

    public func listModelEvaluationSlices(request: ListModelEvaluationSlicesRequest) async throws
      -> GoogleCloudAIPlatformV1.ListModelEvaluationSlicesResponse
    {
      try await self.listModelEvaluationSlices(request: request, options: .init())
    }

    public func listModelEvaluationSlices(
      request: ListModelEvaluationSlicesRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.ListModelEvaluationSlicesResponse {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func listModelEvaluationSlices(
      byItem: ListModelEvaluationSlicesRequest
    ) throws -> any AsyncSequence<ModelEvaluationSlice, Swift.Error> {
      try self.listModelEvaluationSlices(byItem: byItem, options: .init())
    }

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

    public func listModelEvaluationSlices(
      parent: Swift.String,
    ) throws -> any AsyncSequence<ModelEvaluationSlice, Swift.Error> {
      let request = ListModelEvaluationSlicesRequest().with {
        $0.parent = parent
      }
      return try self.listModelEvaluationSlices(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
