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

  /// Service for managing [EntityTypes][google.cloud.dialogflow.cx.v3.EntityType].
  ///
  /// [google.cloud.dialogflow.cx.v3.EntityType]: <doc:EntityType>
  ///
  /// @Snippet(path: "EntityTypesQuickstart")
  public class EntityTypesClient: Clients.EntityTypesProtocol {
    let inner: any Clients.EntityTypesStub
    let pollingErrorPolicy: GoogleCloudGax.PollingErrorPolicy
    let pollingBackoffPolicy: GoogleCloudGax.BackoffPolicy

    /// Creates a new `EntityTypesClient` instance.
    public init(_ options: GoogleCloudGax.ClientOptions = .init()) throws {
      var inner: any Clients.EntityTypesStub = try Clients.EntityTypesTransport(options)
      inner = Clients.EntityTypesRetry(inner, options: options)
      if let logger = options.logger {
        inner = Clients.EntityTypesLogging(inner, logger: logger)
      }
      self.inner = inner
      self.pollingErrorPolicy = options.pollingErrorPolicy
      self.pollingBackoffPolicy = options.pollingBackoffPolicy
    }

    /// Retrieves the specified entity type.
    ///
    /// @Snippet(path: "EntityTypes_GetEntityType")
    public func getEntityType(
      request: GetEntityTypeRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDialogflowCXV3.EntityType {
      try await self.inner.getEntityType(request: request, options: options)
    }

    /// Creates an entity type in the specified agent.
    ///
    /// Note: You should always train a flow prior to sending it queries. See the
    /// [training
    /// documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
    ///
    /// @Snippet(path: "EntityTypes_CreateEntityType")
    public func createEntityType(
      request: CreateEntityTypeRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDialogflowCXV3.EntityType {
      try await self.inner.createEntityType(request: request, options: options)
    }

    /// Updates the specified entity type.
    ///
    /// Note: You should always train a flow prior to sending it queries. See the
    /// [training
    /// documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
    ///
    /// @Snippet(path: "EntityTypes_UpdateEntityType")
    public func updateEntityType(
      request: UpdateEntityTypeRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDialogflowCXV3.EntityType {
      try await self.inner.updateEntityType(request: request, options: options)
    }

    /// Deletes the specified entity type.
    ///
    /// Note: You should always train a flow prior to sending it queries. See the
    /// [training
    /// documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
    ///
    /// @Snippet(path: "EntityTypes_DeleteEntityType")
    public func deleteEntityType(
      request: DeleteEntityTypeRequest, options: GoogleCloudGax.RequestOptions
    ) async throws {
      try await self.inner.deleteEntityType(request: request, options: options)
    }

    /// Returns the list of all entity types in the specified agent.
    ///
    /// @Snippet(path: "EntityTypes_ListEntityTypes")
    public func listEntityTypes(
      request: ListEntityTypesRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDialogflowCXV3.ListEntityTypesResponse {
      try await self.inner.listEntityTypes(request: request, options: options)
    }

    /// Returns the list of all entity types in the specified agent.
    ///
    /// @Snippet(path: "EntityTypes_ListEntityTypes")
    public func listEntityTypes(
      byItem: ListEntityTypesRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<EntityType, Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws -> GoogleCloudDialogflowCXV3.ListEntityTypesResponse in
        var request = byItem
        request.pageToken = token
        return try await self.listEntityTypes(request: request, options: options)
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

    /// Exports the selected entity types.
    ///
    /// @Snippet(path: "EntityTypes_ExportEntityTypes")
    public func exportEntityTypes(
      request: ExportEntityTypesRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self.inner.exportEntityTypes(request: request, options: options)
    }

    /// Exports the selected entity types.
    ///
    /// @Snippet(path: "EntityTypes_ExportEntityTypes")
    public func exportEntityTypes(
      withPolling: ExportEntityTypesRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<ExportEntityTypesResponse> {
      let extractStatus = {
        (op: GoogleLongRunning.Operation) throws
          -> GoogleCloudGax._PollableOperationImpl<ExportEntityTypesResponse>.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 ExportEntityTypesResponse(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.exportEntityTypes(request: withPolling, options: options)
      let initialState = try extractStatus(rawOp)
      let poll = {
        () async throws -> GoogleCloudGax._PollableOperationImpl<ExportEntityTypesResponse>.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 the specified entitytypes into the agent.
    ///
    /// @Snippet(path: "EntityTypes_ImportEntityTypes")
    public func importEntityTypes(
      request: ImportEntityTypesRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self.inner.importEntityTypes(request: request, options: options)
    }

    /// Imports the specified entitytypes into the agent.
    ///
    /// @Snippet(path: "EntityTypes_ImportEntityTypes")
    public func importEntityTypes(
      withPolling: ImportEntityTypesRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<ImportEntityTypesResponse> {
      let extractStatus = {
        (op: GoogleLongRunning.Operation) throws
          -> GoogleCloudGax._PollableOperationImpl<ImportEntityTypesResponse>.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 ImportEntityTypesResponse(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.importEntityTypes(request: withPolling, options: options)
      let initialState = try extractStatus(rawOp)
      let poll = {
        () async throws -> GoogleCloudGax._PollableOperationImpl<ImportEntityTypesResponse>.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.
    ///
    /// 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: "EntityTypes_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: "EntityTypes_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: "EntityTypes_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: "EntityTypes_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: "EntityTypes_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: "EntityTypes_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: "EntityTypes_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 `EntityTypesClient`.
    ///
    /// To mock `EntityTypesClient` change your functions to receive
    /// `some EntityTypesProtocol` or `any EntityTypesProtocol`
    /// and pass a mock implementation in your tests.
    public protocol EntityTypesProtocol {
      /// See `EntityTypesClient.getEntityType`.
      func getEntityType(request: GetEntityTypeRequest) async throws
        -> GoogleCloudDialogflowCXV3.EntityType

      /// See `EntityTypesClient.getEntityType`.
      func getEntityType(
        name: Swift.String,
      ) async throws -> GoogleCloudDialogflowCXV3.EntityType

      /// See `EntityTypesClient.createEntityType`.
      func createEntityType(request: CreateEntityTypeRequest) async throws
        -> GoogleCloudDialogflowCXV3.EntityType

      /// See `EntityTypesClient.createEntityType`.
      func createEntityType(
        parent: Swift.String,
        entityType: EntityType?,
      ) async throws -> GoogleCloudDialogflowCXV3.EntityType

      /// See `EntityTypesClient.updateEntityType`.
      func updateEntityType(request: UpdateEntityTypeRequest) async throws
        -> GoogleCloudDialogflowCXV3.EntityType

      /// See `EntityTypesClient.updateEntityType`.
      func updateEntityType(
        entityType: EntityType?,
        updateMask: GoogleCloudWkt.FieldMask?,
      ) async throws -> GoogleCloudDialogflowCXV3.EntityType

      /// See `EntityTypesClient.deleteEntityType`.
      func deleteEntityType(request: DeleteEntityTypeRequest) async throws

      /// See `EntityTypesClient.deleteEntityType`.
      func deleteEntityType(
        name: Swift.String,
      ) async throws

      /// See `EntityTypesClient.listEntityTypes`.
      func listEntityTypes(request: ListEntityTypesRequest) async throws
        -> GoogleCloudDialogflowCXV3.ListEntityTypesResponse

      /// See `EntityTypesClient.listEntityTypes`.
      func listEntityTypes(
        byItem: ListEntityTypesRequest
      ) throws -> any AsyncSequence<EntityType, Swift.Error>

      /// See `EntityTypesClient.listEntityTypes`.
      func listEntityTypes(
        parent: Swift.String,
      ) throws -> any AsyncSequence<EntityType, Swift.Error>

      /// See `EntityTypesClient.exportEntityTypes`.
      func exportEntityTypes(request: ExportEntityTypesRequest) async throws
        -> GoogleLongRunning.Operation

      /// See `EntityTypesClient.exportEntityTypes`.
      func exportEntityTypes(withPolling: ExportEntityTypesRequest) async throws
        -> any GoogleCloudGax.PollableOperation<ExportEntityTypesResponse>

      /// See `EntityTypesClient.importEntityTypes`.
      func importEntityTypes(request: ImportEntityTypesRequest) async throws
        -> GoogleLongRunning.Operation

      /// See `EntityTypesClient.importEntityTypes`.
      func importEntityTypes(withPolling: ImportEntityTypesRequest) async throws
        -> any GoogleCloudGax.PollableOperation<ImportEntityTypesResponse>

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

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

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

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

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

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

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

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

      /// See `EntityTypesClient.getEntityType`.
      func getEntityType(
        request: GetEntityTypeRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudDialogflowCXV3.EntityType

      /// See `EntityTypesClient.createEntityType`.
      func createEntityType(
        request: CreateEntityTypeRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudDialogflowCXV3.EntityType

      /// See `EntityTypesClient.updateEntityType`.
      func updateEntityType(
        request: UpdateEntityTypeRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudDialogflowCXV3.EntityType

      /// See `EntityTypesClient.deleteEntityType`.
      func deleteEntityType(
        request: DeleteEntityTypeRequest, options: GoogleCloudGax.RequestOptions
      ) async throws

      /// See `EntityTypesClient.listEntityTypes`.
      func listEntityTypes(
        request: ListEntityTypesRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudDialogflowCXV3.ListEntityTypesResponse

      /// See `EntityTypesClient.listEntityTypes`.
      func listEntityTypes(
        byItem: ListEntityTypesRequest, options: GoogleCloudGax.RequestOptions
      ) throws -> any AsyncSequence<EntityType, Swift.Error>

      /// See `EntityTypesClient.exportEntityTypes`.
      func exportEntityTypes(
        request: ExportEntityTypesRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleLongRunning.Operation

      /// See `EntityTypesClient.exportEntityTypes`.
      func exportEntityTypes(
        withPolling: ExportEntityTypesRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> any GoogleCloudGax.PollableOperation<ExportEntityTypesResponse>

      /// See `EntityTypesClient.importEntityTypes`.
      func importEntityTypes(
        request: ImportEntityTypesRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleLongRunning.Operation

      /// See `EntityTypesClient.importEntityTypes`.
      func importEntityTypes(
        withPolling: ImportEntityTypesRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> any GoogleCloudGax.PollableOperation<ImportEntityTypesResponse>

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

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

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

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

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

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

  // Default implementations
  extension Clients.EntityTypesProtocol {
    public func getEntityType(request: GetEntityTypeRequest) async throws
      -> GoogleCloudDialogflowCXV3.EntityType
    {
      try await self.getEntityType(request: request, options: .init())
    }

    public func getEntityType(
      request: GetEntityTypeRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDialogflowCXV3.EntityType {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func getEntityType(
      name: Swift.String,
    ) async throws -> GoogleCloudDialogflowCXV3.EntityType {
      let request = GetEntityTypeRequest().with {
        $0.name = name
      }
      return try await self.getEntityType(request: request)
    }

    public func createEntityType(request: CreateEntityTypeRequest) async throws
      -> GoogleCloudDialogflowCXV3.EntityType
    {
      try await self.createEntityType(request: request, options: .init())
    }

    public func createEntityType(
      request: CreateEntityTypeRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDialogflowCXV3.EntityType {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func createEntityType(
      parent: Swift.String,
      entityType: EntityType?,
    ) async throws -> GoogleCloudDialogflowCXV3.EntityType {
      let request = CreateEntityTypeRequest().with {
        $0.parent = parent
        $0.entityType = entityType
      }
      return try await self.createEntityType(request: request)
    }

    public func updateEntityType(request: UpdateEntityTypeRequest) async throws
      -> GoogleCloudDialogflowCXV3.EntityType
    {
      try await self.updateEntityType(request: request, options: .init())
    }

    public func updateEntityType(
      request: UpdateEntityTypeRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDialogflowCXV3.EntityType {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func updateEntityType(
      entityType: EntityType?,
      updateMask: GoogleCloudWkt.FieldMask?,
    ) async throws -> GoogleCloudDialogflowCXV3.EntityType {
      let request = UpdateEntityTypeRequest().with {
        $0.entityType = entityType
        $0.updateMask = updateMask
      }
      return try await self.updateEntityType(request: request)
    }

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

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

    public func deleteEntityType(
      name: Swift.String,
    ) async throws {
      let request = DeleteEntityTypeRequest().with {
        $0.name = name
      }
      try await self.deleteEntityType(request: request)
    }

    public func listEntityTypes(request: ListEntityTypesRequest) async throws
      -> GoogleCloudDialogflowCXV3.ListEntityTypesResponse
    {
      try await self.listEntityTypes(request: request, options: .init())
    }

    public func listEntityTypes(
      request: ListEntityTypesRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDialogflowCXV3.ListEntityTypesResponse {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func listEntityTypes(
      byItem: ListEntityTypesRequest
    ) throws -> any AsyncSequence<EntityType, Swift.Error> {
      try self.listEntityTypes(byItem: byItem, options: .init())
    }

    public func listEntityTypes(
      byItem: ListEntityTypesRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<EntityType, Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws -> GoogleCloudDialogflowCXV3.ListEntityTypesResponse in
        throw GoogleCloudGax.RequestError.unimplemented
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

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

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

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

    public func exportEntityTypes(withPolling: ExportEntityTypesRequest) async throws
      -> any GoogleCloudGax.PollableOperation<ExportEntityTypesResponse>
    {
      try await self.exportEntityTypes(withPolling: withPolling, options: .init())
    }

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

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

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

    public func importEntityTypes(withPolling: ImportEntityTypesRequest) async throws
      -> any GoogleCloudGax.PollableOperation<ImportEntityTypesResponse>
    {
      try await self.importEntityTypes(withPolling: withPolling, options: .init())
    }

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

    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
