// 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 EndpointService
  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 Endpoints.
  ///
  /// @Snippet(path: "EndpointServiceQuickstart")
  public class EndpointServiceClient: Clients.EndpointServiceProtocol {
    let inner: any Clients.EndpointServiceStub
    let pollingErrorPolicy: GoogleCloudGax.PollingErrorPolicy
    let pollingBackoffPolicy: GoogleCloudGax.BackoffPolicy

    /// Creates a new `EndpointServiceClient` instance.
    public init(_ options: GoogleCloudGax.ClientOptions = .init()) throws {
      var inner: any Clients.EndpointServiceStub = try Clients.EndpointServiceTransport(options)
      inner = Clients.EndpointServiceRetry(inner, options: options)
      if let logger = options.logger {
        inner = Clients.EndpointServiceLogging(inner, logger: logger)
      }
      self.inner = inner
      self.pollingErrorPolicy = options.pollingErrorPolicy
      self.pollingBackoffPolicy = options.pollingBackoffPolicy
    }

    /// Creates an Endpoint.
    ///
    /// @Snippet(path: "EndpointService_CreateEndpoint")
    public func createEndpoint(
      request: CreateEndpointRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self.inner.createEndpoint(request: request, options: options)
    }

    /// Creates an Endpoint.
    ///
    /// @Snippet(path: "EndpointService_CreateEndpoint")
    public func createEndpoint(
      withPolling: CreateEndpointRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<Endpoint> {
      let extractStatus = {
        (op: GoogleLongRunning.Operation) throws
          -> GoogleCloudGax._PollableOperationImpl<Endpoint>.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 Endpoint(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.createEndpoint(request: withPolling, options: options)
      let initialState = try extractStatus(rawOp)
      let poll = { () async throws -> GoogleCloudGax._PollableOperationImpl<Endpoint>.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 Endpoint.
    ///
    /// @Snippet(path: "EndpointService_GetEndpoint")
    public func getEndpoint(
      request: GetEndpointRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.Endpoint {
      try await self.inner.getEndpoint(request: request, options: options)
    }

    /// Lists Endpoints in a Location.
    ///
    /// @Snippet(path: "EndpointService_ListEndpoints")
    public func listEndpoints(
      request: ListEndpointsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.ListEndpointsResponse {
      try await self.inner.listEndpoints(request: request, options: options)
    }

    /// Lists Endpoints in a Location.
    ///
    /// @Snippet(path: "EndpointService_ListEndpoints")
    public func listEndpoints(
      byItem: ListEndpointsRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<Endpoint, Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws -> GoogleCloudAIPlatformV1.ListEndpointsResponse in
        var request = byItem
        request.pageToken = token
        return try await self.listEndpoints(request: request, options: options)
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

    /// Updates an Endpoint.
    ///
    /// @Snippet(path: "EndpointService_UpdateEndpoint")
    public func updateEndpoint(
      request: UpdateEndpointRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.Endpoint {
      try await self.inner.updateEndpoint(request: request, options: options)
    }

    /// Updates an Endpoint with a long running operation.
    ///
    /// @Snippet(path: "EndpointService_UpdateEndpointLongRunning")
    public func updateEndpointLongRunning(
      request: UpdateEndpointLongRunningRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self.inner.updateEndpointLongRunning(request: request, options: options)
    }

    /// Updates an Endpoint with a long running operation.
    ///
    /// @Snippet(path: "EndpointService_UpdateEndpointLongRunning")
    public func updateEndpointLongRunning(
      withPolling: UpdateEndpointLongRunningRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<Endpoint> {
      let extractStatus = {
        (op: GoogleLongRunning.Operation) throws
          -> GoogleCloudGax._PollableOperationImpl<Endpoint>.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 Endpoint(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.updateEndpointLongRunning(request: withPolling, options: options)
      let initialState = try extractStatus(rawOp)
      let poll = { () async throws -> GoogleCloudGax._PollableOperationImpl<Endpoint>.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 an Endpoint.
    ///
    /// @Snippet(path: "EndpointService_DeleteEndpoint")
    public func deleteEndpoint(
      request: DeleteEndpointRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self.inner.deleteEndpoint(request: request, options: options)
    }

    /// Deletes an Endpoint.
    ///
    /// @Snippet(path: "EndpointService_DeleteEndpoint")
    public func deleteEndpoint(
      withPolling: DeleteEndpointRequest, 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.deleteEndpoint(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,
      )
    }

    /// Deploys a Model into this Endpoint, creating a DeployedModel within it.
    ///
    /// @Snippet(path: "EndpointService_DeployModel")
    public func deployModel(
      request: DeployModelRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self.inner.deployModel(request: request, options: options)
    }

    /// Deploys a Model into this Endpoint, creating a DeployedModel within it.
    ///
    /// @Snippet(path: "EndpointService_DeployModel")
    public func deployModel(
      withPolling: DeployModelRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<DeployModelResponse> {
      let extractStatus = {
        (op: GoogleLongRunning.Operation) throws
          -> GoogleCloudGax._PollableOperationImpl<DeployModelResponse>.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 DeployModelResponse(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.deployModel(request: withPolling, options: options)
      let initialState = try extractStatus(rawOp)
      let poll = {
        () async throws -> GoogleCloudGax._PollableOperationImpl<DeployModelResponse>.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,
      )
    }

    /// Undeploys a Model from an Endpoint, removing a DeployedModel from it, and
    /// freeing all resources it's using.
    ///
    /// @Snippet(path: "EndpointService_UndeployModel")
    public func undeployModel(
      request: UndeployModelRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self.inner.undeployModel(request: request, options: options)
    }

    /// Undeploys a Model from an Endpoint, removing a DeployedModel from it, and
    /// freeing all resources it's using.
    ///
    /// @Snippet(path: "EndpointService_UndeployModel")
    public func undeployModel(
      withPolling: UndeployModelRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<UndeployModelResponse> {
      let extractStatus = {
        (op: GoogleLongRunning.Operation) throws
          -> GoogleCloudGax._PollableOperationImpl<UndeployModelResponse>.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 UndeployModelResponse(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.undeployModel(request: withPolling, options: options)
      let initialState = try extractStatus(rawOp)
      let poll = {
        () async throws -> GoogleCloudGax._PollableOperationImpl<UndeployModelResponse>.State in
        let op = try await self.getOperation(
          request: .init().with { $0.name = rawOp.name }, options: options)
        return try extractStatus(op)
      }
      return GoogleCloudGax._PollableOperationImpl(
        initialState: initialState,
        polling: options.pollingErrorPolicy ?? self.pollingErrorPolicy,
        backoff: options.pollingBackoffPolicy ?? self.pollingBackoffPolicy,
        poll: poll,
      )
    }

    /// Updates an existing deployed model. Updatable fields include
    /// `min_replica_count`, `max_replica_count`, `required_replica_count`,
    /// `autoscaling_metric_specs`, `disable_container_logging` (v1 only), and
    /// `enable_container_logging` (v1beta1 only).
    ///
    /// @Snippet(path: "EndpointService_MutateDeployedModel")
    public func mutateDeployedModel(
      request: MutateDeployedModelRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self.inner.mutateDeployedModel(request: request, options: options)
    }

    /// Updates an existing deployed model. Updatable fields include
    /// `min_replica_count`, `max_replica_count`, `required_replica_count`,
    /// `autoscaling_metric_specs`, `disable_container_logging` (v1 only), and
    /// `enable_container_logging` (v1beta1 only).
    ///
    /// @Snippet(path: "EndpointService_MutateDeployedModel")
    public func mutateDeployedModel(
      withPolling: MutateDeployedModelRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<MutateDeployedModelResponse> {
      let extractStatus = {
        (op: GoogleLongRunning.Operation) throws
          -> GoogleCloudGax._PollableOperationImpl<MutateDeployedModelResponse>.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 MutateDeployedModelResponse(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.mutateDeployedModel(request: withPolling, options: options)
      let initialState = try extractStatus(rawOp)
      let poll = {
        () async throws -> GoogleCloudGax._PollableOperationImpl<MutateDeployedModelResponse>.State
        in
        let op = try await self.getOperation(
          request: .init().with { $0.name = rawOp.name }, options: options)
        return try extractStatus(op)
      }
      return GoogleCloudGax._PollableOperationImpl(
        initialState: initialState,
        polling: options.pollingErrorPolicy ?? self.pollingErrorPolicy,
        backoff: options.pollingBackoffPolicy ?? self.pollingBackoffPolicy,
        poll: poll,
      )
    }

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

      /// See `EndpointServiceClient.createEndpoint`.
      func createEndpoint(withPolling: CreateEndpointRequest) async throws -> any GoogleCloudGax
        .PollableOperation<Endpoint>

      /// See `EndpointServiceClient.createEndpoint`.
      func createEndpoint(
        parent: Swift.String,
        endpoint: Endpoint?,
      ) async throws -> any GoogleCloudGax.PollableOperation<Endpoint>

      /// See `EndpointServiceClient.createEndpoint`.
      func createEndpoint(
        parent: Swift.String,
        endpoint: Endpoint?,
        endpointId: Swift.String,
      ) async throws -> any GoogleCloudGax.PollableOperation<Endpoint>

      /// See `EndpointServiceClient.getEndpoint`.
      func getEndpoint(request: GetEndpointRequest) async throws -> GoogleCloudAIPlatformV1.Endpoint

      /// See `EndpointServiceClient.getEndpoint`.
      func getEndpoint(
        name: Swift.String,
      ) async throws -> GoogleCloudAIPlatformV1.Endpoint

      /// See `EndpointServiceClient.listEndpoints`.
      func listEndpoints(request: ListEndpointsRequest) async throws
        -> GoogleCloudAIPlatformV1.ListEndpointsResponse

      /// See `EndpointServiceClient.listEndpoints`.
      func listEndpoints(
        byItem: ListEndpointsRequest
      ) throws -> any AsyncSequence<Endpoint, Swift.Error>

      /// See `EndpointServiceClient.listEndpoints`.
      func listEndpoints(
        parent: Swift.String,
      ) throws -> any AsyncSequence<Endpoint, Swift.Error>

      /// See `EndpointServiceClient.updateEndpoint`.
      func updateEndpoint(request: UpdateEndpointRequest) async throws
        -> GoogleCloudAIPlatformV1.Endpoint

      /// See `EndpointServiceClient.updateEndpoint`.
      func updateEndpoint(
        endpoint: Endpoint?,
        updateMask: GoogleCloudWkt.FieldMask?,
      ) async throws -> GoogleCloudAIPlatformV1.Endpoint

      /// See `EndpointServiceClient.updateEndpointLongRunning`.
      func updateEndpointLongRunning(request: UpdateEndpointLongRunningRequest) async throws
        -> GoogleLongRunning.Operation

      /// See `EndpointServiceClient.updateEndpointLongRunning`.
      func updateEndpointLongRunning(withPolling: UpdateEndpointLongRunningRequest) async throws
        -> any GoogleCloudGax.PollableOperation<Endpoint>

      /// See `EndpointServiceClient.updateEndpointLongRunning`.
      func updateEndpointLongRunning(
        endpoint: Endpoint?,
      ) async throws -> any GoogleCloudGax.PollableOperation<Endpoint>

      /// See `EndpointServiceClient.deleteEndpoint`.
      func deleteEndpoint(request: DeleteEndpointRequest) async throws
        -> GoogleLongRunning.Operation

      /// See `EndpointServiceClient.deleteEndpoint`.
      func deleteEndpoint(withPolling: DeleteEndpointRequest) async throws -> any GoogleCloudGax
        .PollableOperation<Void>

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

      /// See `EndpointServiceClient.deployModel`.
      func deployModel(request: DeployModelRequest) async throws -> GoogleLongRunning.Operation

      /// See `EndpointServiceClient.deployModel`.
      func deployModel(withPolling: DeployModelRequest) async throws -> any GoogleCloudGax
        .PollableOperation<DeployModelResponse>

      /// See `EndpointServiceClient.deployModel`.
      func deployModel(
        endpoint: Swift.String,
        deployedModel: DeployedModel?,
        trafficSplit: [Swift.String: Swift.Int32],
      ) async throws -> any GoogleCloudGax.PollableOperation<DeployModelResponse>

      /// See `EndpointServiceClient.undeployModel`.
      func undeployModel(request: UndeployModelRequest) async throws -> GoogleLongRunning.Operation

      /// See `EndpointServiceClient.undeployModel`.
      func undeployModel(withPolling: UndeployModelRequest) async throws -> any GoogleCloudGax
        .PollableOperation<UndeployModelResponse>

      /// See `EndpointServiceClient.undeployModel`.
      func undeployModel(
        endpoint: Swift.String,
        deployedModelId: Swift.String,
        trafficSplit: [Swift.String: Swift.Int32],
      ) async throws -> any GoogleCloudGax.PollableOperation<UndeployModelResponse>

      /// See `EndpointServiceClient.mutateDeployedModel`.
      func mutateDeployedModel(request: MutateDeployedModelRequest) async throws
        -> GoogleLongRunning.Operation

      /// See `EndpointServiceClient.mutateDeployedModel`.
      func mutateDeployedModel(withPolling: MutateDeployedModelRequest) async throws
        -> any GoogleCloudGax.PollableOperation<MutateDeployedModelResponse>

      /// See `EndpointServiceClient.mutateDeployedModel`.
      func mutateDeployedModel(
        endpoint: Swift.String,
        deployedModel: DeployedModel?,
        updateMask: GoogleCloudWkt.FieldMask?,
      ) async throws -> any GoogleCloudGax.PollableOperation<MutateDeployedModelResponse>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      /// See `EndpointServiceClient.createEndpoint`.
      func createEndpoint(
        request: CreateEndpointRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleLongRunning.Operation

      /// See `EndpointServiceClient.createEndpoint`.
      func createEndpoint(
        withPolling: CreateEndpointRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> any GoogleCloudGax.PollableOperation<Endpoint>

      /// See `EndpointServiceClient.getEndpoint`.
      func getEndpoint(
        request: GetEndpointRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudAIPlatformV1.Endpoint

      /// See `EndpointServiceClient.listEndpoints`.
      func listEndpoints(
        request: ListEndpointsRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudAIPlatformV1.ListEndpointsResponse

      /// See `EndpointServiceClient.listEndpoints`.
      func listEndpoints(
        byItem: ListEndpointsRequest, options: GoogleCloudGax.RequestOptions
      ) throws -> any AsyncSequence<Endpoint, Swift.Error>

      /// See `EndpointServiceClient.updateEndpoint`.
      func updateEndpoint(
        request: UpdateEndpointRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudAIPlatformV1.Endpoint

      /// See `EndpointServiceClient.updateEndpointLongRunning`.
      func updateEndpointLongRunning(
        request: UpdateEndpointLongRunningRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleLongRunning.Operation

      /// See `EndpointServiceClient.updateEndpointLongRunning`.
      func updateEndpointLongRunning(
        withPolling: UpdateEndpointLongRunningRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> any GoogleCloudGax.PollableOperation<Endpoint>

      /// See `EndpointServiceClient.deleteEndpoint`.
      func deleteEndpoint(
        request: DeleteEndpointRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleLongRunning.Operation

      /// See `EndpointServiceClient.deleteEndpoint`.
      func deleteEndpoint(
        withPolling: DeleteEndpointRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> any GoogleCloudGax.PollableOperation<Void>

      /// See `EndpointServiceClient.deployModel`.
      func deployModel(
        request: DeployModelRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleLongRunning.Operation

      /// See `EndpointServiceClient.deployModel`.
      func deployModel(
        withPolling: DeployModelRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> any GoogleCloudGax.PollableOperation<DeployModelResponse>

      /// See `EndpointServiceClient.undeployModel`.
      func undeployModel(
        request: UndeployModelRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleLongRunning.Operation

      /// See `EndpointServiceClient.undeployModel`.
      func undeployModel(
        withPolling: UndeployModelRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> any GoogleCloudGax.PollableOperation<UndeployModelResponse>

      /// See `EndpointServiceClient.mutateDeployedModel`.
      func mutateDeployedModel(
        request: MutateDeployedModelRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleLongRunning.Operation

      /// See `EndpointServiceClient.mutateDeployedModel`.
      func mutateDeployedModel(
        withPolling: MutateDeployedModelRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> any GoogleCloudGax.PollableOperation<MutateDeployedModelResponse>

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

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

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

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

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

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

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

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

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

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

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

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

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

    public func createEndpoint(withPolling: CreateEndpointRequest) async throws
      -> any GoogleCloudGax.PollableOperation<Endpoint>
    {
      try await self.createEndpoint(withPolling: withPolling, options: .init())
    }

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

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

    public func createEndpoint(
      parent: Swift.String,
      endpoint: Endpoint?,
      endpointId: Swift.String,
    ) async throws -> any GoogleCloudGax.PollableOperation<Endpoint> {
      let request = CreateEndpointRequest().with {
        $0.parent = parent
        $0.endpoint = endpoint
        $0.endpointId = endpointId
      }
      return try await self.createEndpoint(withPolling: request)
    }

    public func getEndpoint(request: GetEndpointRequest) async throws
      -> GoogleCloudAIPlatformV1.Endpoint
    {
      try await self.getEndpoint(request: request, options: .init())
    }

    public func getEndpoint(
      request: GetEndpointRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.Endpoint {
      throw GoogleCloudGax.RequestError.unimplemented
    }

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

    public func listEndpoints(request: ListEndpointsRequest) async throws
      -> GoogleCloudAIPlatformV1.ListEndpointsResponse
    {
      try await self.listEndpoints(request: request, options: .init())
    }

    public func listEndpoints(
      request: ListEndpointsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.ListEndpointsResponse {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func listEndpoints(
      byItem: ListEndpointsRequest
    ) throws -> any AsyncSequence<Endpoint, Swift.Error> {
      try self.listEndpoints(byItem: byItem, options: .init())
    }

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

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

    public func updateEndpoint(request: UpdateEndpointRequest) async throws
      -> GoogleCloudAIPlatformV1.Endpoint
    {
      try await self.updateEndpoint(request: request, options: .init())
    }

    public func updateEndpoint(
      request: UpdateEndpointRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudAIPlatformV1.Endpoint {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func updateEndpoint(
      endpoint: Endpoint?,
      updateMask: GoogleCloudWkt.FieldMask?,
    ) async throws -> GoogleCloudAIPlatformV1.Endpoint {
      let request = UpdateEndpointRequest().with {
        $0.endpoint = endpoint
        $0.updateMask = updateMask
      }
      return try await self.updateEndpoint(request: request)
    }

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

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

    public func updateEndpointLongRunning(withPolling: UpdateEndpointLongRunningRequest)
      async throws -> any GoogleCloudGax.PollableOperation<Endpoint>
    {
      try await self.updateEndpointLongRunning(withPolling: withPolling, options: .init())
    }

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

    public func updateEndpointLongRunning(
      endpoint: Endpoint?,
    ) async throws -> any GoogleCloudGax.PollableOperation<Endpoint> {
      let request = UpdateEndpointLongRunningRequest().with {
        $0.endpoint = endpoint
      }
      return try await self.updateEndpointLongRunning(withPolling: request)
    }

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

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

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

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

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

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

    public func deployModel(withPolling: DeployModelRequest) async throws -> any GoogleCloudGax
      .PollableOperation<DeployModelResponse>
    {
      try await self.deployModel(withPolling: withPolling, options: .init())
    }

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

    public func deployModel(
      endpoint: Swift.String,
      deployedModel: DeployedModel?,
      trafficSplit: [Swift.String: Swift.Int32],
    ) async throws -> any GoogleCloudGax.PollableOperation<DeployModelResponse> {
      let request = DeployModelRequest().with {
        $0.endpoint = endpoint
        $0.deployedModel = deployedModel
        $0.trafficSplit = trafficSplit
      }
      return try await self.deployModel(withPolling: request)
    }

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

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

    public func undeployModel(withPolling: UndeployModelRequest) async throws -> any GoogleCloudGax
      .PollableOperation<UndeployModelResponse>
    {
      try await self.undeployModel(withPolling: withPolling, options: .init())
    }

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

    public func undeployModel(
      endpoint: Swift.String,
      deployedModelId: Swift.String,
      trafficSplit: [Swift.String: Swift.Int32],
    ) async throws -> any GoogleCloudGax.PollableOperation<UndeployModelResponse> {
      let request = UndeployModelRequest().with {
        $0.endpoint = endpoint
        $0.deployedModelId = deployedModelId
        $0.trafficSplit = trafficSplit
      }
      return try await self.undeployModel(withPolling: request)
    }

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

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

    public func mutateDeployedModel(withPolling: MutateDeployedModelRequest) async throws
      -> any GoogleCloudGax.PollableOperation<MutateDeployedModelResponse>
    {
      try await self.mutateDeployedModel(withPolling: withPolling, options: .init())
    }

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

    public func mutateDeployedModel(
      endpoint: Swift.String,
      deployedModel: DeployedModel?,
      updateMask: GoogleCloudWkt.FieldMask?,
    ) async throws -> any GoogleCloudGax.PollableOperation<MutateDeployedModelResponse> {
      let request = MutateDeployedModelRequest().with {
        $0.endpoint = endpoint
        $0.deployedModel = deployedModel
        $0.updateMask = updateMask
      }
      return try await self.mutateDeployedModel(withPolling: request)
    }

    public func listLocations(request: GoogleCloudLocation.ListLocationsRequest) async throws
      -> GoogleCloudLocation.ListLocationsResponse
    {
      try await self.listLocations(request: request, options: .init())
    }

    public func listLocations(
      request: GoogleCloudLocation.ListLocationsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudLocation.ListLocationsResponse {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func listLocations(
      byItem: GoogleCloudLocation.ListLocationsRequest
    ) throws -> any AsyncSequence<GoogleCloudLocation.Location, Swift.Error> {
      try self.listLocations(byItem: byItem, options: .init())
    }

    public func listLocations(
      byItem: GoogleCloudLocation.ListLocationsRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<GoogleCloudLocation.Location, Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws -> GoogleCloudLocation.ListLocationsResponse in
        throw GoogleCloudGax.RequestError.unimplemented
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

    public func getLocation(request: GoogleCloudLocation.GetLocationRequest) async throws
      -> GoogleCloudLocation.Location
    {
      try await self.getLocation(request: request, options: .init())
    }

    public func getLocation(
      request: GoogleCloudLocation.GetLocationRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudLocation.Location {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func 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
