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

  /// Service for the `interconnectRemoteLocations` resource.
  ///
  /// @Snippet(path: "interconnectRemoteLocationsQuickstart")
  public class InterconnectRemoteLocationsClient: Clients.InterconnectRemoteLocationsProtocol {
    let inner: any Clients.InterconnectRemoteLocationsStub

    /// Creates a new `InterconnectRemoteLocationsClient` instance.
    public init(_ options: GoogleCloudGax.ClientOptions = .init()) throws {
      var inner: any Clients.InterconnectRemoteLocationsStub =
        try Clients.InterconnectRemoteLocationsTransport(options)
      inner = Clients.InterconnectRemoteLocationsRetry(inner, options: options)
      if let logger = options.logger {
        inner = Clients.InterconnectRemoteLocationsLogging(inner, logger: logger)
      }
      self.inner = inner
    }

    /// Returns the details for the specified interconnect remote location. Gets a
    /// list of available interconnect remote locations by making alist() request.
    ///
    /// @Snippet(path: "interconnectRemoteLocations_get")
    public func `get`(
      request: InterconnectRemoteLocationsClient.GetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.InterconnectRemoteLocation {
      try await self.inner.`get`(request: request, options: options)
    }

    /// Retrieves the list of interconnect remote locations available to the
    /// specified project.
    ///
    /// @Snippet(path: "interconnectRemoteLocations_list")
    public func list(
      request: InterconnectRemoteLocationsClient.ListRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.InterconnectRemoteLocationList {
      try await self.inner.list(request: request, options: options)
    }

    /// Retrieves the list of interconnect remote locations available to the
    /// specified project.
    ///
    /// @Snippet(path: "interconnectRemoteLocations_list")
    public func list(
      byItem: InterconnectRemoteLocationsClient.ListRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<InterconnectRemoteLocation, Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws -> GoogleCloudComputeV1.InterconnectRemoteLocationList in
        var request = byItem
        request.pageToken = token
        return try await self.list(request: request, options: options)
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }
  }

  extension Clients {
    /// A Swift protocol to mock `InterconnectRemoteLocationsClient`.
    ///
    /// To mock `InterconnectRemoteLocationsClient` change your functions to receive
    /// `some InterconnectRemoteLocationsProtocol` or `any InterconnectRemoteLocationsProtocol`
    /// and pass a mock implementation in your tests.
    public protocol InterconnectRemoteLocationsProtocol {
      /// See `InterconnectRemoteLocationsClient.`get``.
      func `get`(request: InterconnectRemoteLocationsClient.GetRequest) async throws
        -> GoogleCloudComputeV1.InterconnectRemoteLocation

      /// See `InterconnectRemoteLocationsClient.`get``.
      func `get`(
        project: Swift.String,
        interconnectRemoteLocation: Swift.String,
      ) async throws -> GoogleCloudComputeV1.InterconnectRemoteLocation

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

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

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

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

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

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

  // Default implementations
  extension Clients.InterconnectRemoteLocationsProtocol {
    public func `get`(request: InterconnectRemoteLocationsClient.GetRequest) async throws
      -> GoogleCloudComputeV1.InterconnectRemoteLocation
    {
      try await self.`get`(request: request, options: .init())
    }

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

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

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

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

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

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

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