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

  /// Service for managing Identity Mapping Stores.
  ///
  /// @Snippet(path: "IdentityMappingStoreServiceQuickstart")
  public class IdentityMappingStoreServiceClient: Clients.IdentityMappingStoreServiceProtocol {
    let inner: any Clients.IdentityMappingStoreServiceStub
    let pollingErrorPolicy: GoogleCloudGax.PollingErrorPolicy
    let pollingBackoffPolicy: GoogleCloudGax.BackoffPolicy

    /// Creates a new `IdentityMappingStoreServiceClient` instance.
    public init(_ options: GoogleCloudGax.ClientOptions = .init()) throws {
      var inner: any Clients.IdentityMappingStoreServiceStub =
        try Clients.IdentityMappingStoreServiceTransport(options)
      inner = Clients.IdentityMappingStoreServiceRetry(inner, options: options)
      if let logger = options.logger {
        inner = Clients.IdentityMappingStoreServiceLogging(inner, logger: logger)
      }
      self.inner = inner
      self.pollingErrorPolicy = options.pollingErrorPolicy
      self.pollingBackoffPolicy = options.pollingBackoffPolicy
    }

    /// Creates a new Identity Mapping Store.
    ///
    /// @Snippet(path: "IdentityMappingStoreService_CreateIdentityMappingStore")
    public func createIdentityMappingStore(
      request: CreateIdentityMappingStoreRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDiscoveryEngineV1.IdentityMappingStore {
      try await self.inner.createIdentityMappingStore(request: request, options: options)
    }

    /// Gets the Identity Mapping Store.
    ///
    /// @Snippet(path: "IdentityMappingStoreService_GetIdentityMappingStore")
    public func getIdentityMappingStore(
      request: GetIdentityMappingStoreRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDiscoveryEngineV1.IdentityMappingStore {
      try await self.inner.getIdentityMappingStore(request: request, options: options)
    }

    /// Deletes the Identity Mapping Store.
    ///
    /// @Snippet(path: "IdentityMappingStoreService_DeleteIdentityMappingStore")
    public func deleteIdentityMappingStore(
      request: DeleteIdentityMappingStoreRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self.inner.deleteIdentityMappingStore(request: request, options: options)
    }

    /// Deletes the Identity Mapping Store.
    ///
    /// @Snippet(path: "IdentityMappingStoreService_DeleteIdentityMappingStore")
    public func deleteIdentityMappingStore(
      withPolling: DeleteIdentityMappingStoreRequest, 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.deleteIdentityMappingStore(request: withPolling, options: options)
      let initialState = try extractStatus(rawOp)
      let poll = { () async throws -> GoogleCloudGax._PollableOperationImpl<Void>.State in
        let op = try await self.getOperation(
          request: .init().with { $0.name = rawOp.name }, options: options)
        return try extractStatus(op)
      }
      return GoogleCloudGax._PollableOperationImpl(
        initialState: initialState,
        polling: options.pollingErrorPolicy ?? self.pollingErrorPolicy,
        backoff: options.pollingBackoffPolicy ?? self.pollingBackoffPolicy,
        poll: poll,
      )
    }

    /// Imports a list of Identity Mapping Entries to an Identity Mapping Store.
    ///
    /// @Snippet(path: "IdentityMappingStoreService_ImportIdentityMappings")
    public func importIdentityMappings(
      request: ImportIdentityMappingsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self.inner.importIdentityMappings(request: request, options: options)
    }

    /// Imports a list of Identity Mapping Entries to an Identity Mapping Store.
    ///
    /// @Snippet(path: "IdentityMappingStoreService_ImportIdentityMappings")
    public func importIdentityMappings(
      withPolling: ImportIdentityMappingsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<ImportIdentityMappingsResponse> {
      let extractStatus = {
        (op: GoogleLongRunning.Operation) throws
          -> GoogleCloudGax._PollableOperationImpl<ImportIdentityMappingsResponse>.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 ImportIdentityMappingsResponse(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.importIdentityMappings(request: withPolling, options: options)
      let initialState = try extractStatus(rawOp)
      let poll = {
        () async throws
          -> GoogleCloudGax._PollableOperationImpl<ImportIdentityMappingsResponse>.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,
      )
    }

    /// Purges specified or all Identity Mapping Entries from an Identity Mapping
    /// Store.
    ///
    /// @Snippet(path: "IdentityMappingStoreService_PurgeIdentityMappings")
    public func purgeIdentityMappings(
      request: PurgeIdentityMappingsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self.inner.purgeIdentityMappings(request: request, options: options)
    }

    /// Purges specified or all Identity Mapping Entries from an Identity Mapping
    /// Store.
    ///
    /// @Snippet(path: "IdentityMappingStoreService_PurgeIdentityMappings")
    public func purgeIdentityMappings(
      withPolling: PurgeIdentityMappingsRequest, 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.purgeIdentityMappings(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,
      )
    }

    /// Lists Identity Mappings in an Identity Mapping Store.
    ///
    /// @Snippet(path: "IdentityMappingStoreService_ListIdentityMappings")
    public func listIdentityMappings(
      request: ListIdentityMappingsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDiscoveryEngineV1.ListIdentityMappingsResponse {
      try await self.inner.listIdentityMappings(request: request, options: options)
    }

    /// Lists Identity Mappings in an Identity Mapping Store.
    ///
    /// @Snippet(path: "IdentityMappingStoreService_ListIdentityMappings")
    public func listIdentityMappings(
      byItem: ListIdentityMappingsRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<IdentityMappingEntry, Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws
          -> GoogleCloudDiscoveryEngineV1.ListIdentityMappingsResponse in
        var request = byItem
        request.pageToken = token
        return try await self.listIdentityMappings(request: request, options: options)
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

    /// Lists all Identity Mapping Stores.
    ///
    /// @Snippet(path: "IdentityMappingStoreService_ListIdentityMappingStores")
    public func listIdentityMappingStores(
      request: ListIdentityMappingStoresRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDiscoveryEngineV1.ListIdentityMappingStoresResponse {
      try await self.inner.listIdentityMappingStores(request: request, options: options)
    }

    /// Lists all Identity Mapping Stores.
    ///
    /// @Snippet(path: "IdentityMappingStoreService_ListIdentityMappingStores")
    public func listIdentityMappingStores(
      byItem: ListIdentityMappingStoresRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<IdentityMappingStore, Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws
          -> GoogleCloudDiscoveryEngineV1.ListIdentityMappingStoresResponse in
        var request = byItem
        request.pageToken = token
        return try await self.listIdentityMappingStores(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: "IdentityMappingStoreService_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: "IdentityMappingStoreService_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: "IdentityMappingStoreService_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: "IdentityMappingStoreService_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 `IdentityMappingStoreServiceClient`.
    ///
    /// To mock `IdentityMappingStoreServiceClient` change your functions to receive
    /// `some IdentityMappingStoreServiceProtocol` or `any IdentityMappingStoreServiceProtocol`
    /// and pass a mock implementation in your tests.
    public protocol IdentityMappingStoreServiceProtocol {
      /// See `IdentityMappingStoreServiceClient.createIdentityMappingStore`.
      func createIdentityMappingStore(request: CreateIdentityMappingStoreRequest) async throws
        -> GoogleCloudDiscoveryEngineV1.IdentityMappingStore

      /// See `IdentityMappingStoreServiceClient.createIdentityMappingStore`.
      func createIdentityMappingStore(
        parent: Swift.String,
        identityMappingStore: IdentityMappingStore?,
        identityMappingStoreId: Swift.String,
      ) async throws -> GoogleCloudDiscoveryEngineV1.IdentityMappingStore

      /// See `IdentityMappingStoreServiceClient.getIdentityMappingStore`.
      func getIdentityMappingStore(request: GetIdentityMappingStoreRequest) async throws
        -> GoogleCloudDiscoveryEngineV1.IdentityMappingStore

      /// See `IdentityMappingStoreServiceClient.getIdentityMappingStore`.
      func getIdentityMappingStore(
        name: Swift.String,
      ) async throws -> GoogleCloudDiscoveryEngineV1.IdentityMappingStore

      /// See `IdentityMappingStoreServiceClient.deleteIdentityMappingStore`.
      func deleteIdentityMappingStore(request: DeleteIdentityMappingStoreRequest) async throws
        -> GoogleLongRunning.Operation

      /// See `IdentityMappingStoreServiceClient.deleteIdentityMappingStore`.
      func deleteIdentityMappingStore(withPolling: DeleteIdentityMappingStoreRequest) async throws
        -> any GoogleCloudGax.PollableOperation<Void>

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

      /// See `IdentityMappingStoreServiceClient.importIdentityMappings`.
      func importIdentityMappings(request: ImportIdentityMappingsRequest) async throws
        -> GoogleLongRunning.Operation

      /// See `IdentityMappingStoreServiceClient.importIdentityMappings`.
      func importIdentityMappings(withPolling: ImportIdentityMappingsRequest) async throws
        -> any GoogleCloudGax.PollableOperation<ImportIdentityMappingsResponse>

      /// See `IdentityMappingStoreServiceClient.purgeIdentityMappings`.
      func purgeIdentityMappings(request: PurgeIdentityMappingsRequest) async throws
        -> GoogleLongRunning.Operation

      /// See `IdentityMappingStoreServiceClient.purgeIdentityMappings`.
      func purgeIdentityMappings(withPolling: PurgeIdentityMappingsRequest) async throws
        -> any GoogleCloudGax.PollableOperation<Void>

      /// See `IdentityMappingStoreServiceClient.listIdentityMappings`.
      func listIdentityMappings(request: ListIdentityMappingsRequest) async throws
        -> GoogleCloudDiscoveryEngineV1.ListIdentityMappingsResponse

      /// See `IdentityMappingStoreServiceClient.listIdentityMappings`.
      func listIdentityMappings(
        byItem: ListIdentityMappingsRequest
      ) throws -> any AsyncSequence<IdentityMappingEntry, Swift.Error>

      /// See `IdentityMappingStoreServiceClient.listIdentityMappingStores`.
      func listIdentityMappingStores(request: ListIdentityMappingStoresRequest) async throws
        -> GoogleCloudDiscoveryEngineV1.ListIdentityMappingStoresResponse

      /// See `IdentityMappingStoreServiceClient.listIdentityMappingStores`.
      func listIdentityMappingStores(
        byItem: ListIdentityMappingStoresRequest
      ) throws -> any AsyncSequence<IdentityMappingStore, Swift.Error>

      /// See `IdentityMappingStoreServiceClient.listIdentityMappingStores`.
      func listIdentityMappingStores(
        parent: Swift.String,
      ) throws -> any AsyncSequence<IdentityMappingStore, Swift.Error>

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

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

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

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

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

      /// See `IdentityMappingStoreServiceClient.createIdentityMappingStore`.
      func createIdentityMappingStore(
        request: CreateIdentityMappingStoreRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudDiscoveryEngineV1.IdentityMappingStore

      /// See `IdentityMappingStoreServiceClient.getIdentityMappingStore`.
      func getIdentityMappingStore(
        request: GetIdentityMappingStoreRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudDiscoveryEngineV1.IdentityMappingStore

      /// See `IdentityMappingStoreServiceClient.deleteIdentityMappingStore`.
      func deleteIdentityMappingStore(
        request: DeleteIdentityMappingStoreRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleLongRunning.Operation

      /// See `IdentityMappingStoreServiceClient.deleteIdentityMappingStore`.
      func deleteIdentityMappingStore(
        withPolling: DeleteIdentityMappingStoreRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> any GoogleCloudGax.PollableOperation<Void>

      /// See `IdentityMappingStoreServiceClient.importIdentityMappings`.
      func importIdentityMappings(
        request: ImportIdentityMappingsRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleLongRunning.Operation

      /// See `IdentityMappingStoreServiceClient.importIdentityMappings`.
      func importIdentityMappings(
        withPolling: ImportIdentityMappingsRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> any GoogleCloudGax.PollableOperation<ImportIdentityMappingsResponse>

      /// See `IdentityMappingStoreServiceClient.purgeIdentityMappings`.
      func purgeIdentityMappings(
        request: PurgeIdentityMappingsRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleLongRunning.Operation

      /// See `IdentityMappingStoreServiceClient.purgeIdentityMappings`.
      func purgeIdentityMappings(
        withPolling: PurgeIdentityMappingsRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> any GoogleCloudGax.PollableOperation<Void>

      /// See `IdentityMappingStoreServiceClient.listIdentityMappings`.
      func listIdentityMappings(
        request: ListIdentityMappingsRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudDiscoveryEngineV1.ListIdentityMappingsResponse

      /// See `IdentityMappingStoreServiceClient.listIdentityMappings`.
      func listIdentityMappings(
        byItem: ListIdentityMappingsRequest, options: GoogleCloudGax.RequestOptions
      ) throws -> any AsyncSequence<IdentityMappingEntry, Swift.Error>

      /// See `IdentityMappingStoreServiceClient.listIdentityMappingStores`.
      func listIdentityMappingStores(
        request: ListIdentityMappingStoresRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudDiscoveryEngineV1.ListIdentityMappingStoresResponse

      /// See `IdentityMappingStoreServiceClient.listIdentityMappingStores`.
      func listIdentityMappingStores(
        byItem: ListIdentityMappingStoresRequest, options: GoogleCloudGax.RequestOptions
      ) throws -> any AsyncSequence<IdentityMappingStore, Swift.Error>

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

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

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

  // Default implementations
  extension Clients.IdentityMappingStoreServiceProtocol {
    public func createIdentityMappingStore(request: CreateIdentityMappingStoreRequest) async throws
      -> GoogleCloudDiscoveryEngineV1.IdentityMappingStore
    {
      try await self.createIdentityMappingStore(request: request, options: .init())
    }

    public func createIdentityMappingStore(
      request: CreateIdentityMappingStoreRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDiscoveryEngineV1.IdentityMappingStore {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func createIdentityMappingStore(
      parent: Swift.String,
      identityMappingStore: IdentityMappingStore?,
      identityMappingStoreId: Swift.String,
    ) async throws -> GoogleCloudDiscoveryEngineV1.IdentityMappingStore {
      let request = CreateIdentityMappingStoreRequest().with {
        $0.parent = parent
        $0.identityMappingStore = identityMappingStore
        $0.identityMappingStoreId = identityMappingStoreId
      }
      return try await self.createIdentityMappingStore(request: request)
    }

    public func getIdentityMappingStore(request: GetIdentityMappingStoreRequest) async throws
      -> GoogleCloudDiscoveryEngineV1.IdentityMappingStore
    {
      try await self.getIdentityMappingStore(request: request, options: .init())
    }

    public func getIdentityMappingStore(
      request: GetIdentityMappingStoreRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDiscoveryEngineV1.IdentityMappingStore {
      throw GoogleCloudGax.RequestError.unimplemented
    }

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

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

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

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

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

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

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

    public func importIdentityMappings(withPolling: ImportIdentityMappingsRequest) async throws
      -> any GoogleCloudGax.PollableOperation<ImportIdentityMappingsResponse>
    {
      try await self.importIdentityMappings(withPolling: withPolling, options: .init())
    }

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

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

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

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

    public func purgeIdentityMappings(
      withPolling: PurgeIdentityMappingsRequest, 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 listIdentityMappings(request: ListIdentityMappingsRequest) async throws
      -> GoogleCloudDiscoveryEngineV1.ListIdentityMappingsResponse
    {
      try await self.listIdentityMappings(request: request, options: .init())
    }

    public func listIdentityMappings(
      request: ListIdentityMappingsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDiscoveryEngineV1.ListIdentityMappingsResponse {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func listIdentityMappings(
      byItem: ListIdentityMappingsRequest
    ) throws -> any AsyncSequence<IdentityMappingEntry, Swift.Error> {
      try self.listIdentityMappings(byItem: byItem, options: .init())
    }

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

    public func listIdentityMappingStores(request: ListIdentityMappingStoresRequest) async throws
      -> GoogleCloudDiscoveryEngineV1.ListIdentityMappingStoresResponse
    {
      try await self.listIdentityMappingStores(request: request, options: .init())
    }

    public func listIdentityMappingStores(
      request: ListIdentityMappingStoresRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDiscoveryEngineV1.ListIdentityMappingStoresResponse {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func listIdentityMappingStores(
      byItem: ListIdentityMappingStoresRequest
    ) throws -> any AsyncSequence<IdentityMappingStore, Swift.Error> {
      try self.listIdentityMappingStores(byItem: byItem, options: .init())
    }

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

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

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

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

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

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

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

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

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

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

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

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

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