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

  /// Service for the `regionNetworkEndpointGroups` resource.
  ///
  /// @Snippet(path: "regionNetworkEndpointGroupsQuickstart")
  public class RegionNetworkEndpointGroupsClient: Clients.RegionNetworkEndpointGroupsProtocol {
    let inner: any Clients.RegionNetworkEndpointGroupsStub
    let pollingErrorPolicy: GoogleCloudGax.PollingErrorPolicy
    let pollingBackoffPolicy: GoogleCloudGax.BackoffPolicy

    /// Creates a new `RegionNetworkEndpointGroupsClient` instance.
    public init(_ options: GoogleCloudGax.ClientOptions = .init()) throws {
      var inner: any Clients.RegionNetworkEndpointGroupsStub =
        try Clients.RegionNetworkEndpointGroupsTransport(options)
      inner = Clients.RegionNetworkEndpointGroupsRetry(inner, options: options)
      if let logger = options.logger {
        inner = Clients.RegionNetworkEndpointGroupsLogging(inner, logger: logger)
      }
      self.inner = inner
      self.pollingErrorPolicy = options.pollingErrorPolicy
      self.pollingBackoffPolicy = options.pollingBackoffPolicy
    }

    /// Attach a list of network endpoints to the specified network endpoint group.
    ///
    /// @Snippet(path: "regionNetworkEndpointGroups_attachNetworkEndpoints")
    public func attachNetworkEndpoints(
      request: RegionNetworkEndpointGroupsClient.AttachNetworkEndpointsRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      try await self.inner.attachNetworkEndpoints(request: request, options: options)
    }

    /// Attach a list of network endpoints to the specified network endpoint group.
    ///
    /// @Snippet(path: "regionNetworkEndpointGroups_attachNetworkEndpoints")
    public func attachNetworkEndpoints(
      withPolling: RegionNetworkEndpointGroupsClient.AttachNetworkEndpointsRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<GoogleCloudComputeV1.Operation> {
      let extractStatus = {
        (op: GoogleCloudComputeV1.Operation) throws
          -> GoogleCloudGax._PollableOperationImpl<GoogleCloudComputeV1.Operation>.State in
        guard op._done() else {
          return .init(done: false, result: nil)
        }

        do {
          try op._detectErrors()
        } catch let e as GoogleCloudGax.RequestError {
          return .init(done: true, result: .failure(e))
        }
        return .init(done: true, result: .success(op))
      }
      let rawOp = try await self.attachNetworkEndpoints(request: withPolling, options: options)
      let initialState = try extractStatus(rawOp)
      let poll = {
        () async throws
          -> GoogleCloudGax._PollableOperationImpl<GoogleCloudComputeV1.Operation>.State in
        let op = try await self.getOperation(
          request: .init().with {
            $0.operation = rawOp._name()
            $0.project = withPolling.project
            $0.region = withPolling.region
          }, options: options)
        return try extractStatus(op)
      }
      return GoogleCloudGax._PollableOperationImpl(
        initialState: initialState,
        polling: options.pollingErrorPolicy ?? self.pollingErrorPolicy,
        backoff: options.pollingBackoffPolicy ?? self.pollingBackoffPolicy,
        poll: poll
      )
    }

    /// Deletes the specified network endpoint group. Note that the NEG cannot be
    /// deleted if it is configured as a backend of a backend service.
    ///
    /// @Snippet(path: "regionNetworkEndpointGroups_delete")
    public func delete(
      request: RegionNetworkEndpointGroupsClient.DeleteRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      try await self.inner.delete(request: request, options: options)
    }

    /// Deletes the specified network endpoint group. Note that the NEG cannot be
    /// deleted if it is configured as a backend of a backend service.
    ///
    /// @Snippet(path: "regionNetworkEndpointGroups_delete")
    public func delete(
      withPolling: RegionNetworkEndpointGroupsClient.DeleteRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<GoogleCloudComputeV1.Operation> {
      let extractStatus = {
        (op: GoogleCloudComputeV1.Operation) throws
          -> GoogleCloudGax._PollableOperationImpl<GoogleCloudComputeV1.Operation>.State in
        guard op._done() else {
          return .init(done: false, result: nil)
        }

        do {
          try op._detectErrors()
        } catch let e as GoogleCloudGax.RequestError {
          return .init(done: true, result: .failure(e))
        }
        return .init(done: true, result: .success(op))
      }
      let rawOp = try await self.delete(request: withPolling, options: options)
      let initialState = try extractStatus(rawOp)
      let poll = {
        () async throws
          -> GoogleCloudGax._PollableOperationImpl<GoogleCloudComputeV1.Operation>.State in
        let op = try await self.getOperation(
          request: .init().with {
            $0.operation = rawOp._name()
            $0.project = withPolling.project
            $0.region = withPolling.region
          }, options: options)
        return try extractStatus(op)
      }
      return GoogleCloudGax._PollableOperationImpl(
        initialState: initialState,
        polling: options.pollingErrorPolicy ?? self.pollingErrorPolicy,
        backoff: options.pollingBackoffPolicy ?? self.pollingBackoffPolicy,
        poll: poll
      )
    }

    /// Detach the network endpoint from the specified network endpoint group.
    ///
    /// @Snippet(path: "regionNetworkEndpointGroups_detachNetworkEndpoints")
    public func detachNetworkEndpoints(
      request: RegionNetworkEndpointGroupsClient.DetachNetworkEndpointsRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      try await self.inner.detachNetworkEndpoints(request: request, options: options)
    }

    /// Detach the network endpoint from the specified network endpoint group.
    ///
    /// @Snippet(path: "regionNetworkEndpointGroups_detachNetworkEndpoints")
    public func detachNetworkEndpoints(
      withPolling: RegionNetworkEndpointGroupsClient.DetachNetworkEndpointsRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<GoogleCloudComputeV1.Operation> {
      let extractStatus = {
        (op: GoogleCloudComputeV1.Operation) throws
          -> GoogleCloudGax._PollableOperationImpl<GoogleCloudComputeV1.Operation>.State in
        guard op._done() else {
          return .init(done: false, result: nil)
        }

        do {
          try op._detectErrors()
        } catch let e as GoogleCloudGax.RequestError {
          return .init(done: true, result: .failure(e))
        }
        return .init(done: true, result: .success(op))
      }
      let rawOp = try await self.detachNetworkEndpoints(request: withPolling, options: options)
      let initialState = try extractStatus(rawOp)
      let poll = {
        () async throws
          -> GoogleCloudGax._PollableOperationImpl<GoogleCloudComputeV1.Operation>.State in
        let op = try await self.getOperation(
          request: .init().with {
            $0.operation = rawOp._name()
            $0.project = withPolling.project
            $0.region = withPolling.region
          }, options: options)
        return try extractStatus(op)
      }
      return GoogleCloudGax._PollableOperationImpl(
        initialState: initialState,
        polling: options.pollingErrorPolicy ?? self.pollingErrorPolicy,
        backoff: options.pollingBackoffPolicy ?? self.pollingBackoffPolicy,
        poll: poll
      )
    }

    /// Returns the specified network endpoint group.
    ///
    /// @Snippet(path: "regionNetworkEndpointGroups_get")
    public func `get`(
      request: RegionNetworkEndpointGroupsClient.GetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.NetworkEndpointGroup {
      try await self.inner.`get`(request: request, options: options)
    }

    /// Creates a network endpoint group in the specified project using the
    /// parameters that are included in the request.
    ///
    /// Note: Use the following APIs to manage network endpoint groups:
    ///
    ///    -
    ///    To manage NEGs with zonal scope (such as zonal NEGs, hybrid connectivity
    ///    NEGs): zonal
    ///    API
    ///    -
    ///    To manage NEGs with regional scope (such as regional internet NEGs,
    ///    serverless NEGs, Private Service Connect NEGs): regional
    ///    API
    ///    -
    ///    To manage NEGs with global scope (such as global internet NEGs):global
    ///    API
    ///
    /// @Snippet(path: "regionNetworkEndpointGroups_insert")
    public func insert(
      request: RegionNetworkEndpointGroupsClient.InsertRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      try await self.inner.insert(request: request, options: options)
    }

    /// Creates a network endpoint group in the specified project using the
    /// parameters that are included in the request.
    ///
    /// Note: Use the following APIs to manage network endpoint groups:
    ///
    ///    -
    ///    To manage NEGs with zonal scope (such as zonal NEGs, hybrid connectivity
    ///    NEGs): zonal
    ///    API
    ///    -
    ///    To manage NEGs with regional scope (such as regional internet NEGs,
    ///    serverless NEGs, Private Service Connect NEGs): regional
    ///    API
    ///    -
    ///    To manage NEGs with global scope (such as global internet NEGs):global
    ///    API
    ///
    /// @Snippet(path: "regionNetworkEndpointGroups_insert")
    public func insert(
      withPolling: RegionNetworkEndpointGroupsClient.InsertRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<GoogleCloudComputeV1.Operation> {
      let extractStatus = {
        (op: GoogleCloudComputeV1.Operation) throws
          -> GoogleCloudGax._PollableOperationImpl<GoogleCloudComputeV1.Operation>.State in
        guard op._done() else {
          return .init(done: false, result: nil)
        }

        do {
          try op._detectErrors()
        } catch let e as GoogleCloudGax.RequestError {
          return .init(done: true, result: .failure(e))
        }
        return .init(done: true, result: .success(op))
      }
      let rawOp = try await self.insert(request: withPolling, options: options)
      let initialState = try extractStatus(rawOp)
      let poll = {
        () async throws
          -> GoogleCloudGax._PollableOperationImpl<GoogleCloudComputeV1.Operation>.State in
        let op = try await self.getOperation(
          request: .init().with {
            $0.operation = rawOp._name()
            $0.project = withPolling.project
            $0.region = withPolling.region
          }, options: options)
        return try extractStatus(op)
      }
      return GoogleCloudGax._PollableOperationImpl(
        initialState: initialState,
        polling: options.pollingErrorPolicy ?? self.pollingErrorPolicy,
        backoff: options.pollingBackoffPolicy ?? self.pollingBackoffPolicy,
        poll: poll
      )
    }

    /// Retrieves the list of regional network endpoint groups available to the
    /// specified project in the given region.
    ///
    /// @Snippet(path: "regionNetworkEndpointGroups_list")
    public func list(
      request: RegionNetworkEndpointGroupsClient.ListRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.NetworkEndpointGroupList {
      try await self.inner.list(request: request, options: options)
    }

    /// Retrieves the list of regional network endpoint groups available to the
    /// specified project in the given region.
    ///
    /// @Snippet(path: "regionNetworkEndpointGroups_list")
    public func list(
      byItem: RegionNetworkEndpointGroupsClient.ListRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<NetworkEndpointGroup, Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws -> GoogleCloudComputeV1.NetworkEndpointGroupList in
        var request = byItem
        request.pageToken = token
        return try await self.list(request: request, options: options)
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

    /// Lists the network endpoints in the specified network endpoint group.
    ///
    /// @Snippet(path: "regionNetworkEndpointGroups_listNetworkEndpoints")
    public func listNetworkEndpoints(
      request: RegionNetworkEndpointGroupsClient.ListNetworkEndpointsRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.NetworkEndpointGroupsListNetworkEndpoints {
      try await self.inner.listNetworkEndpoints(request: request, options: options)
    }

    /// Lists the network endpoints in the specified network endpoint group.
    ///
    /// @Snippet(path: "regionNetworkEndpointGroups_listNetworkEndpoints")
    public func listNetworkEndpoints(
      byItem: RegionNetworkEndpointGroupsClient.ListNetworkEndpointsRequest,
      options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<NetworkEndpointWithHealthStatus, Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws
          -> GoogleCloudComputeV1.NetworkEndpointGroupsListNetworkEndpoints in
        var request = byItem
        request.pageToken = token
        return try await self.listNetworkEndpoints(request: request, options: options)
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

    /// Retrieves the specified region-specific Operations resource.
    ///
    /// @Snippet(path: "regionNetworkEndpointGroups_getOperation")
    func getOperation(
      request: RegionOperationsClient.GetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      try await self.inner.getOperation(request: request, options: options)
    }
  }

  extension Clients {
    /// A Swift protocol to mock `RegionNetworkEndpointGroupsClient`.
    ///
    /// To mock `RegionNetworkEndpointGroupsClient` change your functions to receive
    /// `some RegionNetworkEndpointGroupsProtocol` or `any RegionNetworkEndpointGroupsProtocol`
    /// and pass a mock implementation in your tests.
    public protocol RegionNetworkEndpointGroupsProtocol {
      /// See `RegionNetworkEndpointGroupsClient.attachNetworkEndpoints`.
      func attachNetworkEndpoints(
        request: RegionNetworkEndpointGroupsClient.AttachNetworkEndpointsRequest
      ) async throws -> GoogleCloudComputeV1.Operation

      /// See `RegionNetworkEndpointGroupsClient.delete`.
      func delete(request: RegionNetworkEndpointGroupsClient.DeleteRequest) async throws
        -> GoogleCloudComputeV1.Operation

      /// See `RegionNetworkEndpointGroupsClient.detachNetworkEndpoints`.
      func detachNetworkEndpoints(
        request: RegionNetworkEndpointGroupsClient.DetachNetworkEndpointsRequest
      ) async throws -> GoogleCloudComputeV1.Operation

      /// See `RegionNetworkEndpointGroupsClient.`get``.
      func `get`(request: RegionNetworkEndpointGroupsClient.GetRequest) async throws
        -> GoogleCloudComputeV1.NetworkEndpointGroup

      /// See `RegionNetworkEndpointGroupsClient.`get``.
      func `get`(
        project: Swift.String,
        region: Swift.String,
        networkEndpointGroup: Swift.String,
      ) async throws -> GoogleCloudComputeV1.NetworkEndpointGroup

      /// See `RegionNetworkEndpointGroupsClient.insert`.
      func insert(request: RegionNetworkEndpointGroupsClient.InsertRequest) async throws
        -> GoogleCloudComputeV1.Operation

      /// See `RegionNetworkEndpointGroupsClient.list`.
      func list(request: RegionNetworkEndpointGroupsClient.ListRequest) async throws
        -> GoogleCloudComputeV1.NetworkEndpointGroupList

      /// See `RegionNetworkEndpointGroupsClient.list`.
      func list(
        byItem: RegionNetworkEndpointGroupsClient.ListRequest
      ) throws -> any AsyncSequence<NetworkEndpointGroup, Swift.Error>

      /// See `RegionNetworkEndpointGroupsClient.list`.
      func list(
        project: Swift.String,
        region: Swift.String,
      ) throws -> any AsyncSequence<NetworkEndpointGroup, Swift.Error>

      /// See `RegionNetworkEndpointGroupsClient.listNetworkEndpoints`.
      func listNetworkEndpoints(
        request: RegionNetworkEndpointGroupsClient.ListNetworkEndpointsRequest
      ) async throws -> GoogleCloudComputeV1.NetworkEndpointGroupsListNetworkEndpoints

      /// See `RegionNetworkEndpointGroupsClient.listNetworkEndpoints`.
      func listNetworkEndpoints(
        byItem: RegionNetworkEndpointGroupsClient.ListNetworkEndpointsRequest
      ) throws -> any AsyncSequence<NetworkEndpointWithHealthStatus, Swift.Error>

      /// See `RegionNetworkEndpointGroupsClient.listNetworkEndpoints`.
      func listNetworkEndpoints(
        project: Swift.String,
        region: Swift.String,
        networkEndpointGroup: Swift.String,
      ) throws -> any AsyncSequence<NetworkEndpointWithHealthStatus, Swift.Error>

      /// See `RegionNetworkEndpointGroupsClient.attachNetworkEndpoints`.
      func attachNetworkEndpoints(
        request: RegionNetworkEndpointGroupsClient.AttachNetworkEndpointsRequest,
        options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation

      /// See `RegionNetworkEndpointGroupsClient.delete`.
      func delete(
        request: RegionNetworkEndpointGroupsClient.DeleteRequest,
        options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation

      /// See `RegionNetworkEndpointGroupsClient.detachNetworkEndpoints`.
      func detachNetworkEndpoints(
        request: RegionNetworkEndpointGroupsClient.DetachNetworkEndpointsRequest,
        options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation

      /// See `RegionNetworkEndpointGroupsClient.`get``.
      func `get`(
        request: RegionNetworkEndpointGroupsClient.GetRequest,
        options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.NetworkEndpointGroup

      /// See `RegionNetworkEndpointGroupsClient.insert`.
      func insert(
        request: RegionNetworkEndpointGroupsClient.InsertRequest,
        options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation

      /// See `RegionNetworkEndpointGroupsClient.list`.
      func list(
        request: RegionNetworkEndpointGroupsClient.ListRequest,
        options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.NetworkEndpointGroupList

      /// See `RegionNetworkEndpointGroupsClient.list`.
      func list(
        byItem: RegionNetworkEndpointGroupsClient.ListRequest,
        options: GoogleCloudGax.RequestOptions
      ) throws -> any AsyncSequence<NetworkEndpointGroup, Swift.Error>

      /// See `RegionNetworkEndpointGroupsClient.listNetworkEndpoints`.
      func listNetworkEndpoints(
        request: RegionNetworkEndpointGroupsClient.ListNetworkEndpointsRequest,
        options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.NetworkEndpointGroupsListNetworkEndpoints

      /// See `RegionNetworkEndpointGroupsClient.listNetworkEndpoints`.
      func listNetworkEndpoints(
        byItem: RegionNetworkEndpointGroupsClient.ListNetworkEndpointsRequest,
        options: GoogleCloudGax.RequestOptions
      ) throws -> any AsyncSequence<NetworkEndpointWithHealthStatus, Swift.Error>
    }
  }

  // Default implementations
  extension Clients.RegionNetworkEndpointGroupsProtocol {
    public func attachNetworkEndpoints(
      request: RegionNetworkEndpointGroupsClient.AttachNetworkEndpointsRequest
    ) async throws -> GoogleCloudComputeV1.Operation {
      try await self.attachNetworkEndpoints(request: request, options: .init())
    }

    public func attachNetworkEndpoints(
      request: RegionNetworkEndpointGroupsClient.AttachNetworkEndpointsRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func attachNetworkEndpoints(
      withPolling: RegionNetworkEndpointGroupsClient.AttachNetworkEndpointsRequest
    ) async throws -> any GoogleCloudGax.PollableOperation<GoogleCloudComputeV1.Operation> {
      try await self.attachNetworkEndpoints(withPolling: withPolling, options: .init())
    }

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

    public func attachNetworkEndpoints(
      project: Swift.String,
      region: Swift.String,
      networkEndpointGroup: Swift.String,
      body: RegionNetworkEndpointGroupsAttachEndpointsRequest?,
    ) async throws -> any GoogleCloudGax.PollableOperation<GoogleCloudComputeV1.Operation> {
      let request = RegionNetworkEndpointGroupsClient.AttachNetworkEndpointsRequest().with {
        $0.project = project
        $0.region = region
        $0.networkEndpointGroup = networkEndpointGroup
        $0.body = body
      }
      return try await self.attachNetworkEndpoints(withPolling: request)
    }

    public func delete(request: RegionNetworkEndpointGroupsClient.DeleteRequest) async throws
      -> GoogleCloudComputeV1.Operation
    {
      try await self.delete(request: request, options: .init())
    }

    public func delete(
      request: RegionNetworkEndpointGroupsClient.DeleteRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func delete(
      withPolling: RegionNetworkEndpointGroupsClient.DeleteRequest
    ) async throws -> any GoogleCloudGax.PollableOperation<GoogleCloudComputeV1.Operation> {
      try await self.delete(withPolling: withPolling, options: .init())
    }

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

    public func delete(
      project: Swift.String,
      region: Swift.String,
      networkEndpointGroup: Swift.String,
    ) async throws -> any GoogleCloudGax.PollableOperation<GoogleCloudComputeV1.Operation> {
      let request = RegionNetworkEndpointGroupsClient.DeleteRequest().with {
        $0.project = project
        $0.region = region
        $0.networkEndpointGroup = networkEndpointGroup
      }
      return try await self.delete(withPolling: request)
    }

    public func detachNetworkEndpoints(
      request: RegionNetworkEndpointGroupsClient.DetachNetworkEndpointsRequest
    ) async throws -> GoogleCloudComputeV1.Operation {
      try await self.detachNetworkEndpoints(request: request, options: .init())
    }

    public func detachNetworkEndpoints(
      request: RegionNetworkEndpointGroupsClient.DetachNetworkEndpointsRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func detachNetworkEndpoints(
      withPolling: RegionNetworkEndpointGroupsClient.DetachNetworkEndpointsRequest
    ) async throws -> any GoogleCloudGax.PollableOperation<GoogleCloudComputeV1.Operation> {
      try await self.detachNetworkEndpoints(withPolling: withPolling, options: .init())
    }

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

    public func detachNetworkEndpoints(
      project: Swift.String,
      region: Swift.String,
      networkEndpointGroup: Swift.String,
      body: RegionNetworkEndpointGroupsDetachEndpointsRequest?,
    ) async throws -> any GoogleCloudGax.PollableOperation<GoogleCloudComputeV1.Operation> {
      let request = RegionNetworkEndpointGroupsClient.DetachNetworkEndpointsRequest().with {
        $0.project = project
        $0.region = region
        $0.networkEndpointGroup = networkEndpointGroup
        $0.body = body
      }
      return try await self.detachNetworkEndpoints(withPolling: request)
    }

    public func `get`(request: RegionNetworkEndpointGroupsClient.GetRequest) async throws
      -> GoogleCloudComputeV1.NetworkEndpointGroup
    {
      try await self.`get`(request: request, options: .init())
    }

    public func `get`(
      request: RegionNetworkEndpointGroupsClient.GetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.NetworkEndpointGroup {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func `get`(
      project: Swift.String,
      region: Swift.String,
      networkEndpointGroup: Swift.String,
    ) async throws -> GoogleCloudComputeV1.NetworkEndpointGroup {
      let request = RegionNetworkEndpointGroupsClient.GetRequest().with {
        $0.project = project
        $0.region = region
        $0.networkEndpointGroup = networkEndpointGroup
      }
      return try await self.`get`(request: request)
    }

    public func insert(request: RegionNetworkEndpointGroupsClient.InsertRequest) async throws
      -> GoogleCloudComputeV1.Operation
    {
      try await self.insert(request: request, options: .init())
    }

    public func insert(
      request: RegionNetworkEndpointGroupsClient.InsertRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func insert(
      withPolling: RegionNetworkEndpointGroupsClient.InsertRequest
    ) async throws -> any GoogleCloudGax.PollableOperation<GoogleCloudComputeV1.Operation> {
      try await self.insert(withPolling: withPolling, options: .init())
    }

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

    public func insert(
      project: Swift.String,
      region: Swift.String,
      body: NetworkEndpointGroup?,
    ) async throws -> any GoogleCloudGax.PollableOperation<GoogleCloudComputeV1.Operation> {
      let request = RegionNetworkEndpointGroupsClient.InsertRequest().with {
        $0.project = project
        $0.region = region
        $0.body = body
      }
      return try await self.insert(withPolling: request)
    }

    public func list(request: RegionNetworkEndpointGroupsClient.ListRequest) async throws
      -> GoogleCloudComputeV1.NetworkEndpointGroupList
    {
      try await self.list(request: request, options: .init())
    }

    public func list(
      request: RegionNetworkEndpointGroupsClient.ListRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.NetworkEndpointGroupList {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func list(
      byItem: RegionNetworkEndpointGroupsClient.ListRequest
    ) throws -> any AsyncSequence<NetworkEndpointGroup, Swift.Error> {
      try self.list(byItem: byItem, options: .init())
    }

    public func list(
      byItem: RegionNetworkEndpointGroupsClient.ListRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<NetworkEndpointGroup, Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws -> GoogleCloudComputeV1.NetworkEndpointGroupList in
        throw GoogleCloudGax.RequestError.unimplemented
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

    public func list(
      project: Swift.String,
      region: Swift.String,
    ) throws -> any AsyncSequence<NetworkEndpointGroup, Swift.Error> {
      let request = RegionNetworkEndpointGroupsClient.ListRequest().with {
        $0.project = project
        $0.region = region
      }
      return try self.list(byItem: request)
    }

    public func listNetworkEndpoints(
      request: RegionNetworkEndpointGroupsClient.ListNetworkEndpointsRequest
    ) async throws -> GoogleCloudComputeV1.NetworkEndpointGroupsListNetworkEndpoints {
      try await self.listNetworkEndpoints(request: request, options: .init())
    }

    public func listNetworkEndpoints(
      request: RegionNetworkEndpointGroupsClient.ListNetworkEndpointsRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.NetworkEndpointGroupsListNetworkEndpoints {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func listNetworkEndpoints(
      byItem: RegionNetworkEndpointGroupsClient.ListNetworkEndpointsRequest
    ) throws -> any AsyncSequence<NetworkEndpointWithHealthStatus, Swift.Error> {
      try self.listNetworkEndpoints(byItem: byItem, options: .init())
    }

    public func listNetworkEndpoints(
      byItem: RegionNetworkEndpointGroupsClient.ListNetworkEndpointsRequest,
      options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<NetworkEndpointWithHealthStatus, Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws
          -> GoogleCloudComputeV1.NetworkEndpointGroupsListNetworkEndpoints in
        throw GoogleCloudGax.RequestError.unimplemented
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

    public func listNetworkEndpoints(
      project: Swift.String,
      region: Swift.String,
      networkEndpointGroup: Swift.String,
    ) throws -> any AsyncSequence<NetworkEndpointWithHealthStatus, Swift.Error> {
      let request = RegionNetworkEndpointGroupsClient.ListNetworkEndpointsRequest().with {
        $0.project = project
        $0.region = region
        $0.networkEndpointGroup = networkEndpointGroup
      }
      return try self.listNetworkEndpoints(byItem: request)
    }

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

    public func getOperation(
      request: RegionOperationsClient.GetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      throw GoogleCloudGax.RequestError.unimplemented
    }
  }
#endif
