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

  /// Service for the `interconnectAttachmentGroups` resource.
  ///
  /// @Snippet(path: "interconnectAttachmentGroupsQuickstart")
  public class InterconnectAttachmentGroupsClient: Clients.InterconnectAttachmentGroupsProtocol {
    let inner: any Clients.InterconnectAttachmentGroupsStub
    let pollingErrorPolicy: GoogleCloudGax.PollingErrorPolicy
    let pollingBackoffPolicy: GoogleCloudGax.BackoffPolicy

    /// Creates a new `InterconnectAttachmentGroupsClient` instance.
    public init(_ options: GoogleCloudGax.ClientOptions = .init()) throws {
      var inner: any Clients.InterconnectAttachmentGroupsStub =
        try Clients.InterconnectAttachmentGroupsTransport(options)
      inner = Clients.InterconnectAttachmentGroupsRetry(inner, options: options)
      if let logger = options.logger {
        inner = Clients.InterconnectAttachmentGroupsLogging(inner, logger: logger)
      }
      self.inner = inner
      self.pollingErrorPolicy = options.pollingErrorPolicy
      self.pollingBackoffPolicy = options.pollingBackoffPolicy
    }

    /// Deletes the specified InterconnectAttachmentGroup in the given scope
    ///
    /// @Snippet(path: "interconnectAttachmentGroups_delete")
    public func delete(
      request: InterconnectAttachmentGroupsClient.DeleteRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      try await self.inner.delete(request: request, options: options)
    }

    /// Deletes the specified InterconnectAttachmentGroup in the given scope
    ///
    /// @Snippet(path: "interconnectAttachmentGroups_delete")
    public func delete(
      withPolling: InterconnectAttachmentGroupsClient.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 InterconnectAttachmentGroup resource in the given
    /// scope.
    ///
    /// @Snippet(path: "interconnectAttachmentGroups_get")
    public func `get`(
      request: InterconnectAttachmentGroupsClient.GetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.InterconnectAttachmentGroup {
      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: "interconnectAttachmentGroups_getIamPolicy")
    public func getIamPolicy(
      request: InterconnectAttachmentGroupsClient.GetIamPolicyRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Policy {
      try await self.inner.getIamPolicy(request: request, options: options)
    }

    /// Returns the InterconnectAttachmentStatuses for the specified
    /// InterconnectAttachmentGroup resource.
    ///
    /// @Snippet(path: "interconnectAttachmentGroups_getOperationalStatus")
    public func getOperationalStatus(
      request: InterconnectAttachmentGroupsClient.GetOperationalStatusRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.InterconnectAttachmentGroupsGetOperationalStatusResponse
    {
      try await self.inner.getOperationalStatus(request: request, options: options)
    }

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

    /// Creates a InterconnectAttachmentGroup in the specified project in the given
    /// scope using the parameters that are included in the request.
    ///
    /// @Snippet(path: "interconnectAttachmentGroups_insert")
    public func insert(
      withPolling: InterconnectAttachmentGroupsClient.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 InterconnectAttachmentGroups for a project in the given scope.
    ///
    /// @Snippet(path: "interconnectAttachmentGroups_list")
    public func list(
      request: InterconnectAttachmentGroupsClient.ListRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.InterconnectAttachmentGroupsListResponse {
      try await self.inner.list(request: request, options: options)
    }

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

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

    /// Patches the specified InterconnectAttachmentGroup resource with the data
    /// included in the request. This method supports PATCH
    /// semantics and usesJSON merge
    /// patch format and processing rules.
    ///
    /// @Snippet(path: "interconnectAttachmentGroups_patch")
    public func patch(
      withPolling: InterconnectAttachmentGroupsClient.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: "interconnectAttachmentGroups_setIamPolicy")
    public func setIamPolicy(
      request: InterconnectAttachmentGroupsClient.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: "interconnectAttachmentGroups_testIamPermissions")
    public func testIamPermissions(
      request: InterconnectAttachmentGroupsClient.TestIamPermissionsRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.TestPermissionsResponse {
      try await self.inner.testIamPermissions(request: request, options: options)
    }

    /// Retrieves the specified Operations resource.
    ///
    /// @Snippet(path: "interconnectAttachmentGroups_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 `InterconnectAttachmentGroupsClient`.
    ///
    /// To mock `InterconnectAttachmentGroupsClient` change your functions to receive
    /// `some InterconnectAttachmentGroupsProtocol` or `any InterconnectAttachmentGroupsProtocol`
    /// and pass a mock implementation in your tests.
    public protocol InterconnectAttachmentGroupsProtocol {
      /// See `InterconnectAttachmentGroupsClient.delete`.
      func delete(request: InterconnectAttachmentGroupsClient.DeleteRequest) async throws
        -> GoogleCloudComputeV1.Operation

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

      /// See `InterconnectAttachmentGroupsClient.`get``.
      func `get`(
        project: Swift.String,
        interconnectAttachmentGroup: Swift.String,
      ) async throws -> GoogleCloudComputeV1.InterconnectAttachmentGroup

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

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

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

      /// See `InterconnectAttachmentGroupsClient.getOperationalStatus`.
      func getOperationalStatus(
        project: Swift.String,
        interconnectAttachmentGroup: Swift.String,
      ) async throws
        -> GoogleCloudComputeV1.InterconnectAttachmentGroupsGetOperationalStatusResponse

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  // Default implementations
  extension Clients.InterconnectAttachmentGroupsProtocol {
    public func delete(request: InterconnectAttachmentGroupsClient.DeleteRequest) async throws
      -> GoogleCloudComputeV1.Operation
    {
      try await self.delete(request: request, options: .init())
    }

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

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

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

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

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

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

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

    public func getIamPolicy(
      request: InterconnectAttachmentGroupsClient.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 = InterconnectAttachmentGroupsClient.GetIamPolicyRequest().with {
        $0.project = project
        $0.resource = resource
      }
      return try await self.getIamPolicy(request: request)
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    public func setIamPolicy(
      request: InterconnectAttachmentGroupsClient.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 = InterconnectAttachmentGroupsClient.SetIamPolicyRequest().with {
        $0.project = project
        $0.resource = resource
        $0.body = body
      }
      return try await self.setIamPolicy(request: request)
    }

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

    public func testIamPermissions(
      request: InterconnectAttachmentGroupsClient.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 = InterconnectAttachmentGroupsClient.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
