// 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.

import Foundation
#if canImport(FoundationNetworking)
  import FoundationNetworking
#endif
import GoogleCloudWkt
import GoogleLongRunning
import GoogleRpc
import GoogleCloudGax
import struct Logging.Logger

extension Clients {
  final class AwsClustersLogging: AwsClustersStub {
    let inner: any AwsClustersStub
    let logger: Logger

    public init(_ inner: any AwsClustersStub, logger: Logger) {
      var logger = logger
      logger[metadataKey: "gcp.artifact.id"] = "google-cloud-gkemulticloud-v1"
      logger[metadataKey: "gcp.client.service"] = "gkemulticloud"
      logger[metadataKey: "gcp.experimental.swift.client"] = "AwsClusters"
      self.inner = inner
      self.logger = logger
    }

    func _intercept<Input, Output>(
      request: Input,
      options: GoogleCloudGax.RequestOptions,
      name: Swift.String,
      action: (Input, GoogleCloudGax.RequestOptions) async throws -> Output,
    ) async throws -> Output {
      var logger = logger
      logger[metadataKey: "gcp.experimental.swift.request.id"] = "\(UUID())"
      logger[metadataKey: "gcp.experimental.swift.method"] = .string(name)
      logger.debug("enter  : \(request) \(options)")
      do {
        let output = try await action(request, options)
        logger.debug("success: \(request) \(options) \(output)")
        return output
      } catch let error {
        logger.debug("error  : \(request) \(options) \(error)")
        throw error
      }
    }

    public func createAwsCluster(
      request: CreateAwsClusterRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self._intercept(
        request: request,
        options: options,
        name: "createAwsCluster",
        action: {
          (r: CreateAwsClusterRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleLongRunning.Operation
          in
          return try await self.inner.createAwsCluster(request: r, options: o)
        })
    }

    public func updateAwsCluster(
      request: UpdateAwsClusterRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self._intercept(
        request: request,
        options: options,
        name: "updateAwsCluster",
        action: {
          (r: UpdateAwsClusterRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleLongRunning.Operation
          in
          return try await self.inner.updateAwsCluster(request: r, options: o)
        })
    }

    public func getAwsCluster(
      request: GetAwsClusterRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudGKEMultiCloudV1.AwsCluster {
      try await self._intercept(
        request: request,
        options: options,
        name: "getAwsCluster",
        action: {
          (r: GetAwsClusterRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleCloudGKEMultiCloudV1.AwsCluster
          in
          return try await self.inner.getAwsCluster(request: r, options: o)
        })
    }

    public func listAwsClusters(
      request: ListAwsClustersRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudGKEMultiCloudV1.ListAwsClustersResponse {
      try await self._intercept(
        request: request,
        options: options,
        name: "listAwsClusters",
        action: {
          (r: ListAwsClustersRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleCloudGKEMultiCloudV1.ListAwsClustersResponse
          in
          return try await self.inner.listAwsClusters(request: r, options: o)
        })
    }

    public func deleteAwsCluster(
      request: DeleteAwsClusterRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self._intercept(
        request: request,
        options: options,
        name: "deleteAwsCluster",
        action: {
          (r: DeleteAwsClusterRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleLongRunning.Operation
          in
          return try await self.inner.deleteAwsCluster(request: r, options: o)
        })
    }

    public func generateAwsClusterAgentToken(
      request: GenerateAwsClusterAgentTokenRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudGKEMultiCloudV1.GenerateAwsClusterAgentTokenResponse {
      try await self._intercept(
        request: request,
        options: options,
        name: "generateAwsClusterAgentToken",
        action: {
          (r: GenerateAwsClusterAgentTokenRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleCloudGKEMultiCloudV1.GenerateAwsClusterAgentTokenResponse
          in
          return try await self.inner.generateAwsClusterAgentToken(request: r, options: o)
        })
    }

    public func generateAwsAccessToken(
      request: GenerateAwsAccessTokenRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudGKEMultiCloudV1.GenerateAwsAccessTokenResponse {
      try await self._intercept(
        request: request,
        options: options,
        name: "generateAwsAccessToken",
        action: {
          (r: GenerateAwsAccessTokenRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleCloudGKEMultiCloudV1.GenerateAwsAccessTokenResponse
          in
          return try await self.inner.generateAwsAccessToken(request: r, options: o)
        })
    }

    public func createAwsNodePool(
      request: CreateAwsNodePoolRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self._intercept(
        request: request,
        options: options,
        name: "createAwsNodePool",
        action: {
          (r: CreateAwsNodePoolRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleLongRunning.Operation
          in
          return try await self.inner.createAwsNodePool(request: r, options: o)
        })
    }

    public func updateAwsNodePool(
      request: UpdateAwsNodePoolRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self._intercept(
        request: request,
        options: options,
        name: "updateAwsNodePool",
        action: {
          (r: UpdateAwsNodePoolRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleLongRunning.Operation
          in
          return try await self.inner.updateAwsNodePool(request: r, options: o)
        })
    }

    public func rollbackAwsNodePoolUpdate(
      request: RollbackAwsNodePoolUpdateRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self._intercept(
        request: request,
        options: options,
        name: "rollbackAwsNodePoolUpdate",
        action: {
          (r: RollbackAwsNodePoolUpdateRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleLongRunning.Operation
          in
          return try await self.inner.rollbackAwsNodePoolUpdate(request: r, options: o)
        })
    }

    public func getAwsNodePool(
      request: GetAwsNodePoolRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudGKEMultiCloudV1.AwsNodePool {
      try await self._intercept(
        request: request,
        options: options,
        name: "getAwsNodePool",
        action: {
          (r: GetAwsNodePoolRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleCloudGKEMultiCloudV1.AwsNodePool
          in
          return try await self.inner.getAwsNodePool(request: r, options: o)
        })
    }

    public func listAwsNodePools(
      request: ListAwsNodePoolsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudGKEMultiCloudV1.ListAwsNodePoolsResponse {
      try await self._intercept(
        request: request,
        options: options,
        name: "listAwsNodePools",
        action: {
          (r: ListAwsNodePoolsRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleCloudGKEMultiCloudV1.ListAwsNodePoolsResponse
          in
          return try await self.inner.listAwsNodePools(request: r, options: o)
        })
    }

    public func deleteAwsNodePool(
      request: DeleteAwsNodePoolRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self._intercept(
        request: request,
        options: options,
        name: "deleteAwsNodePool",
        action: {
          (r: DeleteAwsNodePoolRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleLongRunning.Operation
          in
          return try await self.inner.deleteAwsNodePool(request: r, options: o)
        })
    }

    public func getAwsOpenIdConfig(
      request: GetAwsOpenIdConfigRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudGKEMultiCloudV1.AwsOpenIdConfig {
      try await self._intercept(
        request: request,
        options: options,
        name: "getAwsOpenIdConfig",
        action: {
          (r: GetAwsOpenIdConfigRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleCloudGKEMultiCloudV1.AwsOpenIdConfig
          in
          return try await self.inner.getAwsOpenIdConfig(request: r, options: o)
        })
    }

    public func getAwsJsonWebKeys(
      request: GetAwsJsonWebKeysRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudGKEMultiCloudV1.AwsJsonWebKeys {
      try await self._intercept(
        request: request,
        options: options,
        name: "getAwsJsonWebKeys",
        action: {
          (r: GetAwsJsonWebKeysRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleCloudGKEMultiCloudV1.AwsJsonWebKeys
          in
          return try await self.inner.getAwsJsonWebKeys(request: r, options: o)
        })
    }

    public func getAwsServerConfig(
      request: GetAwsServerConfigRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudGKEMultiCloudV1.AwsServerConfig {
      try await self._intercept(
        request: request,
        options: options,
        name: "getAwsServerConfig",
        action: {
          (r: GetAwsServerConfigRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleCloudGKEMultiCloudV1.AwsServerConfig
          in
          return try await self.inner.getAwsServerConfig(request: r, options: o)
        })
    }

    public func listOperations(
      request: GoogleLongRunning.ListOperationsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.ListOperationsResponse {
      try await self._intercept(
        request: request,
        options: options,
        name: "listOperations",
        action: {
          (r: GoogleLongRunning.ListOperationsRequest, o: GoogleCloudGax.RequestOptions)
            async throws -> GoogleLongRunning.ListOperationsResponse
          in
          return try await self.inner.listOperations(request: r, options: o)
        })
    }

    public func getOperation(
      request: GoogleLongRunning.GetOperationRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self._intercept(
        request: request,
        options: options,
        name: "getOperation",
        action: {
          (r: GoogleLongRunning.GetOperationRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleLongRunning.Operation
          in
          return try await self.inner.getOperation(request: r, options: o)
        })
    }

    public func deleteOperation(
      request: GoogleLongRunning.DeleteOperationRequest, options: GoogleCloudGax.RequestOptions
    ) async throws {
      try await self._intercept(
        request: request,
        options: options,
        name: "deleteOperation",
        action: {
          (r: GoogleLongRunning.DeleteOperationRequest, o: GoogleCloudGax.RequestOptions)
            async throws -> Void in
          return try await self.inner.deleteOperation(request: r, options: o)
        })
    }

    public func cancelOperation(
      request: GoogleLongRunning.CancelOperationRequest, options: GoogleCloudGax.RequestOptions
    ) async throws {
      try await self._intercept(
        request: request,
        options: options,
        name: "cancelOperation",
        action: {
          (r: GoogleLongRunning.CancelOperationRequest, o: GoogleCloudGax.RequestOptions)
            async throws -> Void in
          return try await self.inner.cancelOperation(request: r, options: o)
        })
    }
  }
}
