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

  /// Service for managing [Environments][google.cloud.dialogflow.v2.Environment].
  ///
  /// [google.cloud.dialogflow.v2.Environment]: <doc:Environment>
  ///
  /// @Snippet(path: "EnvironmentsQuickstart")
  public class EnvironmentsClient: Clients.EnvironmentsProtocol {
    let inner: any Clients.EnvironmentsStub

    /// Creates a new `EnvironmentsClient` instance.
    public init(_ options: GoogleCloudGax.ClientOptions = .init()) throws {
      var inner: any Clients.EnvironmentsStub = try Clients.EnvironmentsTransport(options)
      inner = Clients.EnvironmentsRetry(inner, options: options)
      if let logger = options.logger {
        inner = Clients.EnvironmentsLogging(inner, logger: logger)
      }
      self.inner = inner
    }

    /// Returns the list of all non-default environments of the specified agent.
    ///
    /// @Snippet(path: "Environments_ListEnvironments")
    public func listEnvironments(
      request: ListEnvironmentsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDialogflowV2.ListEnvironmentsResponse {
      try await self.inner.listEnvironments(request: request, options: options)
    }

    /// Returns the list of all non-default environments of the specified agent.
    ///
    /// @Snippet(path: "Environments_ListEnvironments")
    public func listEnvironments(
      byItem: ListEnvironmentsRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<Environment, Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws -> GoogleCloudDialogflowV2.ListEnvironmentsResponse in
        var request = byItem
        request.pageToken = token
        return try await self.listEnvironments(request: request, options: options)
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

    /// Retrieves the specified agent environment.
    ///
    /// @Snippet(path: "Environments_GetEnvironment")
    public func getEnvironment(
      request: GetEnvironmentRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDialogflowV2.Environment {
      try await self.inner.getEnvironment(request: request, options: options)
    }

    /// Creates an agent environment.
    ///
    /// @Snippet(path: "Environments_CreateEnvironment")
    public func createEnvironment(
      request: CreateEnvironmentRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDialogflowV2.Environment {
      try await self.inner.createEnvironment(request: request, options: options)
    }

    /// Updates the specified agent environment.
    ///
    /// This method allows you to deploy new agent versions into the environment.
    /// When an environment is pointed to a new agent version by setting
    /// `environment.agent_version`, the environment is temporarily set to the
    /// `LOADING` state. During that time, the environment continues serving the
    /// previous version of the agent. After the new agent version is done loading,
    /// the environment is set back to the `RUNNING` state.
    /// You can use "-" as Environment ID in environment name to update an agent
    /// version in the default environment. WARNING: this will negate all recent
    /// changes to the draft agent and can't be undone. You may want to save the
    /// draft agent to a version before calling this method.
    ///
    /// @Snippet(path: "Environments_UpdateEnvironment")
    public func updateEnvironment(
      request: UpdateEnvironmentRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDialogflowV2.Environment {
      try await self.inner.updateEnvironment(request: request, options: options)
    }

    /// Deletes the specified agent environment.
    ///
    /// @Snippet(path: "Environments_DeleteEnvironment")
    public func deleteEnvironment(
      request: DeleteEnvironmentRequest, options: GoogleCloudGax.RequestOptions
    ) async throws {
      try await self.inner.deleteEnvironment(request: request, options: options)
    }

    /// Gets the history of the specified environment.
    ///
    /// @Snippet(path: "Environments_GetEnvironmentHistory")
    public func getEnvironmentHistory(
      request: GetEnvironmentHistoryRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDialogflowV2.EnvironmentHistory {
      try await self.inner.getEnvironmentHistory(request: request, options: options)
    }

    /// Gets the history of the specified environment.
    ///
    /// @Snippet(path: "Environments_GetEnvironmentHistory")
    public func getEnvironmentHistory(
      byItem: GetEnvironmentHistoryRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<EnvironmentHistory.Entry, Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws -> GoogleCloudDialogflowV2.EnvironmentHistory in
        var request = byItem
        request.pageToken = token
        return try await self.getEnvironmentHistory(request: request, options: options)
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

    /// Lists information about the supported locations for this service.
    ///
    /// This method lists locations based on the resource scope provided in
    /// the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: *
    /// **Global locations**: If `name` is empty, the method lists the
    /// public locations available to all projects. * **Project-specific
    /// locations**: If `name` follows the format
    /// `projects/{project}`, the method lists locations visible to that
    /// specific project. This includes public, private, or other
    /// project-specific locations enabled for the project.
    ///
    /// For gRPC and client library implementations, the resource name is
    /// passed as the `name` field. For direct service calls, the resource
    /// name is
    /// incorporated into the request path based on the specific service
    /// implementation and version.
    ///
    /// [google.cloud.location.ListLocationsRequest.name]: https://www.google.com/search?q=Swift+google.cloud.location+GoogleCloudLocation.ListLocationsRequest/name
    ///
    /// @Snippet(path: "Environments_ListLocations")
    public func listLocations(
      request: GoogleCloudLocation.ListLocationsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudLocation.ListLocationsResponse {
      try await self.inner.listLocations(request: request, options: options)
    }

    /// Lists information about the supported locations for this service.
    ///
    /// This method lists locations based on the resource scope provided in
    /// the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: *
    /// **Global locations**: If `name` is empty, the method lists the
    /// public locations available to all projects. * **Project-specific
    /// locations**: If `name` follows the format
    /// `projects/{project}`, the method lists locations visible to that
    /// specific project. This includes public, private, or other
    /// project-specific locations enabled for the project.
    ///
    /// For gRPC and client library implementations, the resource name is
    /// passed as the `name` field. For direct service calls, the resource
    /// name is
    /// incorporated into the request path based on the specific service
    /// implementation and version.
    ///
    /// [google.cloud.location.ListLocationsRequest.name]: https://www.google.com/search?q=Swift+google.cloud.location+GoogleCloudLocation.ListLocationsRequest/name
    ///
    /// @Snippet(path: "Environments_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: "Environments_GetLocation")
    public func getLocation(
      request: GoogleCloudLocation.GetLocationRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudLocation.Location {
      try await self.inner.getLocation(request: request, options: options)
    }

    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
    ///
    /// [google.longrunning.Operations]: https://www.google.com/search?q=Swift+google.longrunning+Operations
    ///
    /// @Snippet(path: "Environments_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: "Environments_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: "Environments_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: "Environments_CancelOperation")
    public func cancelOperation(
      request: GoogleLongRunning.CancelOperationRequest, options: GoogleCloudGax.RequestOptions
    ) async throws {
      try await self.inner.cancelOperation(request: request, options: options)
    }
  }

  extension Clients {
    /// A Swift protocol to mock `EnvironmentsClient`.
    ///
    /// To mock `EnvironmentsClient` change your functions to receive
    /// `some EnvironmentsProtocol` or `any EnvironmentsProtocol`
    /// and pass a mock implementation in your tests.
    public protocol EnvironmentsProtocol {
      /// See `EnvironmentsClient.listEnvironments`.
      func listEnvironments(request: ListEnvironmentsRequest) async throws
        -> GoogleCloudDialogflowV2.ListEnvironmentsResponse

      /// See `EnvironmentsClient.listEnvironments`.
      func listEnvironments(
        byItem: ListEnvironmentsRequest
      ) throws -> any AsyncSequence<Environment, Swift.Error>

      /// See `EnvironmentsClient.listEnvironments`.
      func listEnvironments(
        parent: Swift.String,
      ) throws -> any AsyncSequence<Environment, Swift.Error>

      /// See `EnvironmentsClient.getEnvironment`.
      func getEnvironment(request: GetEnvironmentRequest) async throws
        -> GoogleCloudDialogflowV2.Environment

      /// See `EnvironmentsClient.createEnvironment`.
      func createEnvironment(request: CreateEnvironmentRequest) async throws
        -> GoogleCloudDialogflowV2.Environment

      /// See `EnvironmentsClient.updateEnvironment`.
      func updateEnvironment(request: UpdateEnvironmentRequest) async throws
        -> GoogleCloudDialogflowV2.Environment

      /// See `EnvironmentsClient.deleteEnvironment`.
      func deleteEnvironment(request: DeleteEnvironmentRequest) async throws

      /// See `EnvironmentsClient.getEnvironmentHistory`.
      func getEnvironmentHistory(request: GetEnvironmentHistoryRequest) async throws
        -> GoogleCloudDialogflowV2.EnvironmentHistory

      /// See `EnvironmentsClient.getEnvironmentHistory`.
      func getEnvironmentHistory(
        byItem: GetEnvironmentHistoryRequest
      ) throws -> any AsyncSequence<EnvironmentHistory.Entry, Swift.Error>

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

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

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

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

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

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

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

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

      /// See `EnvironmentsClient.listEnvironments`.
      func listEnvironments(
        request: ListEnvironmentsRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudDialogflowV2.ListEnvironmentsResponse

      /// See `EnvironmentsClient.listEnvironments`.
      func listEnvironments(
        byItem: ListEnvironmentsRequest, options: GoogleCloudGax.RequestOptions
      ) throws -> any AsyncSequence<Environment, Swift.Error>

      /// See `EnvironmentsClient.getEnvironment`.
      func getEnvironment(
        request: GetEnvironmentRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudDialogflowV2.Environment

      /// See `EnvironmentsClient.createEnvironment`.
      func createEnvironment(
        request: CreateEnvironmentRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudDialogflowV2.Environment

      /// See `EnvironmentsClient.updateEnvironment`.
      func updateEnvironment(
        request: UpdateEnvironmentRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudDialogflowV2.Environment

      /// See `EnvironmentsClient.deleteEnvironment`.
      func deleteEnvironment(
        request: DeleteEnvironmentRequest, options: GoogleCloudGax.RequestOptions
      ) async throws

      /// See `EnvironmentsClient.getEnvironmentHistory`.
      func getEnvironmentHistory(
        request: GetEnvironmentHistoryRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudDialogflowV2.EnvironmentHistory

      /// See `EnvironmentsClient.getEnvironmentHistory`.
      func getEnvironmentHistory(
        byItem: GetEnvironmentHistoryRequest, options: GoogleCloudGax.RequestOptions
      ) throws -> any AsyncSequence<EnvironmentHistory.Entry, Swift.Error>

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

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

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

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

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

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

  // Default implementations
  extension Clients.EnvironmentsProtocol {
    public func listEnvironments(request: ListEnvironmentsRequest) async throws
      -> GoogleCloudDialogflowV2.ListEnvironmentsResponse
    {
      try await self.listEnvironments(request: request, options: .init())
    }

    public func listEnvironments(
      request: ListEnvironmentsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDialogflowV2.ListEnvironmentsResponse {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func listEnvironments(
      byItem: ListEnvironmentsRequest
    ) throws -> any AsyncSequence<Environment, Swift.Error> {
      try self.listEnvironments(byItem: byItem, options: .init())
    }

    public func listEnvironments(
      byItem: ListEnvironmentsRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<Environment, Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws -> GoogleCloudDialogflowV2.ListEnvironmentsResponse in
        throw GoogleCloudGax.RequestError.unimplemented
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

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

    public func getEnvironment(request: GetEnvironmentRequest) async throws
      -> GoogleCloudDialogflowV2.Environment
    {
      try await self.getEnvironment(request: request, options: .init())
    }

    public func getEnvironment(
      request: GetEnvironmentRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDialogflowV2.Environment {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func createEnvironment(request: CreateEnvironmentRequest) async throws
      -> GoogleCloudDialogflowV2.Environment
    {
      try await self.createEnvironment(request: request, options: .init())
    }

    public func createEnvironment(
      request: CreateEnvironmentRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDialogflowV2.Environment {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func updateEnvironment(request: UpdateEnvironmentRequest) async throws
      -> GoogleCloudDialogflowV2.Environment
    {
      try await self.updateEnvironment(request: request, options: .init())
    }

    public func updateEnvironment(
      request: UpdateEnvironmentRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDialogflowV2.Environment {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func deleteEnvironment(request: DeleteEnvironmentRequest) async throws {
      try await self.deleteEnvironment(request: request, options: .init())
    }

    public func deleteEnvironment(
      request: DeleteEnvironmentRequest, options: GoogleCloudGax.RequestOptions
    ) async throws {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func getEnvironmentHistory(request: GetEnvironmentHistoryRequest) async throws
      -> GoogleCloudDialogflowV2.EnvironmentHistory
    {
      try await self.getEnvironmentHistory(request: request, options: .init())
    }

    public func getEnvironmentHistory(
      request: GetEnvironmentHistoryRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDialogflowV2.EnvironmentHistory {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func getEnvironmentHistory(
      byItem: GetEnvironmentHistoryRequest
    ) throws -> any AsyncSequence<EnvironmentHistory.Entry, Swift.Error> {
      try self.getEnvironmentHistory(byItem: byItem, options: .init())
    }

    public func getEnvironmentHistory(
      byItem: GetEnvironmentHistoryRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<EnvironmentHistory.Entry, Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws -> GoogleCloudDialogflowV2.EnvironmentHistory in
        throw GoogleCloudGax.RequestError.unimplemented
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

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

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

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

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

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

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

    public func listOperations(request: GoogleLongRunning.ListOperationsRequest) async throws
      -> GoogleLongRunning.ListOperationsResponse
    {
      try await self.listOperations(request: request, options: .init())
    }

    public func listOperations(
      request: GoogleLongRunning.ListOperationsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.ListOperationsResponse {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func listOperations(
      byItem: GoogleLongRunning.ListOperationsRequest
    ) throws -> any AsyncSequence<GoogleLongRunning.Operation, Swift.Error> {
      try self.listOperations(byItem: byItem, options: .init())
    }

    public func listOperations(
      byItem: GoogleLongRunning.ListOperationsRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<GoogleLongRunning.Operation, Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws -> GoogleLongRunning.ListOperationsResponse in
        throw GoogleCloudGax.RequestError.unimplemented
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

    public func listOperations(
      name: Swift.String,
      filter: Swift.String,
    ) throws -> any AsyncSequence<GoogleLongRunning.Operation, Swift.Error> {
      let request = GoogleLongRunning.ListOperationsRequest().with {
        $0.name = name
        $0.filter = filter
      }
      return try self.listOperations(byItem: request)
    }

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

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

    public func getOperation(
      name: Swift.String,
    ) async throws -> GoogleLongRunning.Operation {
      let request = GoogleLongRunning.GetOperationRequest().with {
        $0.name = name
      }
      return try await self.getOperation(request: request)
    }

    public func cancelOperation(request: GoogleLongRunning.CancelOperationRequest) async throws {
      try await self.cancelOperation(request: request, options: .init())
    }

    public func cancelOperation(
      request: GoogleLongRunning.CancelOperationRequest, options: GoogleCloudGax.RequestOptions
    ) async throws {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func cancelOperation(
      name: Swift.String,
    ) async throws {
      let request = GoogleLongRunning.CancelOperationRequest().with {
        $0.name = name
      }
      try await self.cancelOperation(request: request)
    }
  }
#endif
