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

  /// Service for the `interconnectGroups` resource.
  ///
  /// @Snippet(path: "interconnectGroupsQuickstart")
  public class InterconnectGroupsClient: Clients.InterconnectGroupsProtocol {
    let inner: any Clients.InterconnectGroupsStub
    let pollingErrorPolicy: GoogleCloudGax.PollingErrorPolicy
    let pollingBackoffPolicy: GoogleCloudGax.BackoffPolicy

    /// Creates a new `InterconnectGroupsClient` instance.
    public init(_ options: GoogleCloudGax.ClientOptions = .init()) throws {
      var inner: any Clients.InterconnectGroupsStub = try Clients.InterconnectGroupsTransport(
        options)
      inner = Clients.InterconnectGroupsRetry(inner, options: options)
      if let logger = options.logger {
        inner = Clients.InterconnectGroupsLogging(inner, logger: logger)
      }
      self.inner = inner
      self.pollingErrorPolicy = options.pollingErrorPolicy
      self.pollingBackoffPolicy = options.pollingBackoffPolicy
    }

    /// Create Interconnects with redundancy by creating them in a specified
    /// interconnect group.
    ///
    /// @Snippet(path: "interconnectGroups_createMembers")
    public func createMembers(
      request: InterconnectGroupsClient.CreateMembersRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      try await self.inner.createMembers(request: request, options: options)
    }

    /// Create Interconnects with redundancy by creating them in a specified
    /// interconnect group.
    ///
    /// @Snippet(path: "interconnectGroups_createMembers")
    public func createMembers(
      withPolling: InterconnectGroupsClient.CreateMembersRequest,
      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.createMembers(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
          }, 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 InterconnectGroup in the given scope
    ///
    /// @Snippet(path: "interconnectGroups_delete")
    public func delete(
      request: InterconnectGroupsClient.DeleteRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      try await self.inner.delete(request: request, options: options)
    }

    /// Deletes the specified InterconnectGroup in the given scope
    ///
    /// @Snippet(path: "interconnectGroups_delete")
    public func delete(
      withPolling: InterconnectGroupsClient.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
          }, 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 InterconnectGroup resource in the given scope.
    ///
    /// @Snippet(path: "interconnectGroups_get")
    public func `get`(
      request: InterconnectGroupsClient.GetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.InterconnectGroup {
      try await self.inner.`get`(request: request, options: options)
    }

    /// Gets the access control policy for a resource. May be empty if no such
    /// policy or resource exists.
    ///
    /// @Snippet(path: "interconnectGroups_getIamPolicy")
    public func getIamPolicy(
      request: InterconnectGroupsClient.GetIamPolicyRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Policy {
      try await self.inner.getIamPolicy(request: request, options: options)
    }

    /// Returns the interconnectStatuses for the specified
    /// InterconnectGroup.
    ///
    /// @Snippet(path: "interconnectGroups_getOperationalStatus")
    public func getOperationalStatus(
      request: InterconnectGroupsClient.GetOperationalStatusRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.InterconnectGroupsGetOperationalStatusResponse {
      try await self.inner.getOperationalStatus(request: request, options: options)
    }

    /// Creates a InterconnectGroup in the specified project in the given scope
    /// using the parameters that are included in the request.
    ///
    /// @Snippet(path: "interconnectGroups_insert")
    public func insert(
      request: InterconnectGroupsClient.InsertRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      try await self.inner.insert(request: request, options: options)
    }

    /// Creates a InterconnectGroup in the specified project in the given scope
    /// using the parameters that are included in the request.
    ///
    /// @Snippet(path: "interconnectGroups_insert")
    public func insert(
      withPolling: InterconnectGroupsClient.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
          }, options: options)
        return try extractStatus(op)
      }
      return GoogleCloudGax._PollableOperationImpl(
        initialState: initialState,
        polling: options.pollingErrorPolicy ?? self.pollingErrorPolicy,
        backoff: options.pollingBackoffPolicy ?? self.pollingBackoffPolicy,
        poll: poll
      )
    }

    /// Lists the InterconnectGroups for a project in the given scope.
    ///
    /// @Snippet(path: "interconnectGroups_list")
    public func list(
      request: InterconnectGroupsClient.ListRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.InterconnectGroupsListResponse {
      try await self.inner.list(request: request, options: options)
    }

    /// Lists the InterconnectGroups for a project in the given scope.
    ///
    /// @Snippet(path: "interconnectGroups_list")
    public func list(
      byItem: InterconnectGroupsClient.ListRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<InterconnectGroup, Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws -> GoogleCloudComputeV1.InterconnectGroupsListResponse in
        var request = byItem
        request.pageToken = token
        return try await self.list(request: request, options: options)
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

    /// Patches the specified InterconnectGroup resource with the data included in
    /// the request. This method supports PATCH
    /// semantics and usesJSON merge
    /// patch format and processing rules.
    ///
    /// @Snippet(path: "interconnectGroups_patch")
    public func patch(
      request: InterconnectGroupsClient.PatchRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      try await self.inner.patch(request: request, options: options)
    }

    /// Patches the specified InterconnectGroup resource with the data included in
    /// the request. This method supports PATCH
    /// semantics and usesJSON merge
    /// patch format and processing rules.
    ///
    /// @Snippet(path: "interconnectGroups_patch")
    public func patch(
      withPolling: InterconnectGroupsClient.PatchRequest, 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.patch(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
          }, options: options)
        return try extractStatus(op)
      }
      return GoogleCloudGax._PollableOperationImpl(
        initialState: initialState,
        polling: options.pollingErrorPolicy ?? self.pollingErrorPolicy,
        backoff: options.pollingBackoffPolicy ?? self.pollingBackoffPolicy,
        poll: poll
      )
    }

    /// Sets the access control policy on the specified resource.
    /// Replaces any existing policy.
    ///
    /// @Snippet(path: "interconnectGroups_setIamPolicy")
    public func setIamPolicy(
      request: InterconnectGroupsClient.SetIamPolicyRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Policy {
      try await self.inner.setIamPolicy(request: request, options: options)
    }

    /// Returns permissions that a caller has on the specified resource.
    ///
    /// @Snippet(path: "interconnectGroups_testIamPermissions")
    public func testIamPermissions(
      request: InterconnectGroupsClient.TestIamPermissionsRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.TestPermissionsResponse {
      try await self.inner.testIamPermissions(request: request, options: options)
    }

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

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

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

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

      /// See `InterconnectGroupsClient.`get``.
      func `get`(
        project: Swift.String,
        interconnectGroup: Swift.String,
      ) async throws -> GoogleCloudComputeV1.InterconnectGroup

      /// See `InterconnectGroupsClient.getIamPolicy`.
      func getIamPolicy(request: InterconnectGroupsClient.GetIamPolicyRequest) async throws
        -> GoogleCloudComputeV1.Policy

      /// See `InterconnectGroupsClient.getIamPolicy`.
      func getIamPolicy(
        project: Swift.String,
        resource: Swift.String,
      ) async throws -> GoogleCloudComputeV1.Policy

      /// See `InterconnectGroupsClient.getOperationalStatus`.
      func getOperationalStatus(request: InterconnectGroupsClient.GetOperationalStatusRequest)
        async throws -> GoogleCloudComputeV1.InterconnectGroupsGetOperationalStatusResponse

      /// See `InterconnectGroupsClient.getOperationalStatus`.
      func getOperationalStatus(
        project: Swift.String,
        interconnectGroup: Swift.String,
      ) async throws -> GoogleCloudComputeV1.InterconnectGroupsGetOperationalStatusResponse

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

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

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

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

      /// See `InterconnectGroupsClient.patch`.
      func patch(request: InterconnectGroupsClient.PatchRequest) async throws
        -> GoogleCloudComputeV1.Operation

      /// See `InterconnectGroupsClient.setIamPolicy`.
      func setIamPolicy(request: InterconnectGroupsClient.SetIamPolicyRequest) async throws
        -> GoogleCloudComputeV1.Policy

      /// See `InterconnectGroupsClient.setIamPolicy`.
      func setIamPolicy(
        project: Swift.String,
        resource: Swift.String,
        body: GlobalSetPolicyRequest?,
      ) async throws -> GoogleCloudComputeV1.Policy

      /// See `InterconnectGroupsClient.testIamPermissions`.
      func testIamPermissions(request: InterconnectGroupsClient.TestIamPermissionsRequest)
        async throws -> GoogleCloudComputeV1.TestPermissionsResponse

      /// See `InterconnectGroupsClient.testIamPermissions`.
      func testIamPermissions(
        project: Swift.String,
        resource: Swift.String,
        body: TestPermissionsRequest?,
      ) async throws -> GoogleCloudComputeV1.TestPermissionsResponse

      /// See `InterconnectGroupsClient.createMembers`.
      func createMembers(
        request: InterconnectGroupsClient.CreateMembersRequest,
        options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation

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

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

      /// See `InterconnectGroupsClient.getIamPolicy`.
      func getIamPolicy(
        request: InterconnectGroupsClient.GetIamPolicyRequest,
        options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Policy

      /// See `InterconnectGroupsClient.getOperationalStatus`.
      func getOperationalStatus(
        request: InterconnectGroupsClient.GetOperationalStatusRequest,
        options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.InterconnectGroupsGetOperationalStatusResponse

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

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

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

      /// See `InterconnectGroupsClient.patch`.
      func patch(
        request: InterconnectGroupsClient.PatchRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation

      /// See `InterconnectGroupsClient.setIamPolicy`.
      func setIamPolicy(
        request: InterconnectGroupsClient.SetIamPolicyRequest,
        options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Policy

      /// See `InterconnectGroupsClient.testIamPermissions`.
      func testIamPermissions(
        request: InterconnectGroupsClient.TestIamPermissionsRequest,
        options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.TestPermissionsResponse
    }
  }

  // Default implementations
  extension Clients.InterconnectGroupsProtocol {
    public func createMembers(request: InterconnectGroupsClient.CreateMembersRequest) async throws
      -> GoogleCloudComputeV1.Operation
    {
      try await self.createMembers(request: request, options: .init())
    }

    public func createMembers(
      request: InterconnectGroupsClient.CreateMembersRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      throw GoogleCloudGax.RequestError.unimplemented
    }

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

    public func createMembers(
      withPolling: InterconnectGroupsClient.CreateMembersRequest,
      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 createMembers(
      project: Swift.String,
      interconnectGroup: Swift.String,
      body: InterconnectGroupsCreateMembersRequest?,
    ) async throws -> any GoogleCloudGax.PollableOperation<GoogleCloudComputeV1.Operation> {
      let request = InterconnectGroupsClient.CreateMembersRequest().with {
        $0.project = project
        $0.interconnectGroup = interconnectGroup
        $0.body = body
      }
      return try await self.createMembers(withPolling: request)
    }

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

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

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

    public func delete(
      withPolling: InterconnectGroupsClient.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,
      interconnectGroup: Swift.String,
    ) async throws -> any GoogleCloudGax.PollableOperation<GoogleCloudComputeV1.Operation> {
      let request = InterconnectGroupsClient.DeleteRequest().with {
        $0.project = project
        $0.interconnectGroup = interconnectGroup
      }
      return try await self.delete(withPolling: request)
    }

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

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

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

    public func getIamPolicy(request: InterconnectGroupsClient.GetIamPolicyRequest) async throws
      -> GoogleCloudComputeV1.Policy
    {
      try await self.getIamPolicy(request: request, options: .init())
    }

    public func getIamPolicy(
      request: InterconnectGroupsClient.GetIamPolicyRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Policy {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func getIamPolicy(
      project: Swift.String,
      resource: Swift.String,
    ) async throws -> GoogleCloudComputeV1.Policy {
      let request = InterconnectGroupsClient.GetIamPolicyRequest().with {
        $0.project = project
        $0.resource = resource
      }
      return try await self.getIamPolicy(request: request)
    }

    public func getOperationalStatus(request: InterconnectGroupsClient.GetOperationalStatusRequest)
      async throws -> GoogleCloudComputeV1.InterconnectGroupsGetOperationalStatusResponse
    {
      try await self.getOperationalStatus(request: request, options: .init())
    }

    public func getOperationalStatus(
      request: InterconnectGroupsClient.GetOperationalStatusRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.InterconnectGroupsGetOperationalStatusResponse {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func getOperationalStatus(
      project: Swift.String,
      interconnectGroup: Swift.String,
    ) async throws -> GoogleCloudComputeV1.InterconnectGroupsGetOperationalStatusResponse {
      let request = InterconnectGroupsClient.GetOperationalStatusRequest().with {
        $0.project = project
        $0.interconnectGroup = interconnectGroup
      }
      return try await self.getOperationalStatus(request: request)
    }

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

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

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

    public func insert(
      withPolling: InterconnectGroupsClient.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,
      body: InterconnectGroup?,
    ) async throws -> any GoogleCloudGax.PollableOperation<GoogleCloudComputeV1.Operation> {
      let request = InterconnectGroupsClient.InsertRequest().with {
        $0.project = project
        $0.body = body
      }
      return try await self.insert(withPolling: request)
    }

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

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

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

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

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

    public func patch(request: InterconnectGroupsClient.PatchRequest) async throws
      -> GoogleCloudComputeV1.Operation
    {
      try await self.patch(request: request, options: .init())
    }

    public func patch(
      request: InterconnectGroupsClient.PatchRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      throw GoogleCloudGax.RequestError.unimplemented
    }

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

    public func patch(
      withPolling: InterconnectGroupsClient.PatchRequest, 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 patch(
      project: Swift.String,
      interconnectGroup: Swift.String,
      body: InterconnectGroup?,
    ) async throws -> any GoogleCloudGax.PollableOperation<GoogleCloudComputeV1.Operation> {
      let request = InterconnectGroupsClient.PatchRequest().with {
        $0.project = project
        $0.interconnectGroup = interconnectGroup
        $0.body = body
      }
      return try await self.patch(withPolling: request)
    }

    public func setIamPolicy(request: InterconnectGroupsClient.SetIamPolicyRequest) async throws
      -> GoogleCloudComputeV1.Policy
    {
      try await self.setIamPolicy(request: request, options: .init())
    }

    public func setIamPolicy(
      request: InterconnectGroupsClient.SetIamPolicyRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Policy {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func setIamPolicy(
      project: Swift.String,
      resource: Swift.String,
      body: GlobalSetPolicyRequest?,
    ) async throws -> GoogleCloudComputeV1.Policy {
      let request = InterconnectGroupsClient.SetIamPolicyRequest().with {
        $0.project = project
        $0.resource = resource
        $0.body = body
      }
      return try await self.setIamPolicy(request: request)
    }

    public func testIamPermissions(request: InterconnectGroupsClient.TestIamPermissionsRequest)
      async throws -> GoogleCloudComputeV1.TestPermissionsResponse
    {
      try await self.testIamPermissions(request: request, options: .init())
    }

    public func testIamPermissions(
      request: InterconnectGroupsClient.TestIamPermissionsRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.TestPermissionsResponse {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func testIamPermissions(
      project: Swift.String,
      resource: Swift.String,
      body: TestPermissionsRequest?,
    ) async throws -> GoogleCloudComputeV1.TestPermissionsResponse {
      let request = InterconnectGroupsClient.TestIamPermissionsRequest().with {
        $0.project = project
        $0.resource = resource
        $0.body = body
      }
      return try await self.testIamPermissions(request: request)
    }

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

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