// 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 RegionInstanceGroupManagers
  import Foundation
  #if canImport(FoundationNetworking)
    import FoundationNetworking
  #endif
  import GoogleCloudWkt
  import GoogleCloudGax
  import struct Logging.Logger

  extension Clients {
    final class RegionInstanceGroupManagersLogging: RegionInstanceGroupManagersStub {
      let inner: any RegionInstanceGroupManagersStub
      let logger: Logger

      public init(_ inner: any RegionInstanceGroupManagersStub, logger: Logger) {
        var logger = logger
        logger[metadataKey: "gcp.artifact.id"] = "google-cloud-compute-v1"
        logger[metadataKey: "gcp.client.service"] = "compute"
        logger[metadataKey: "gcp.experimental.swift.client"] = "RegionInstanceGroupManagers"
        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 abandonInstances(
        request: RegionInstanceGroupManagersClient.AbandonInstancesRequest,
        options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation {
        try await self._intercept(
          request: request,
          options: options,
          name: "abandonInstances",
          action: {
            (
              r: RegionInstanceGroupManagersClient.AbandonInstancesRequest,
              o: GoogleCloudGax.RequestOptions
            ) async throws -> GoogleCloudComputeV1.Operation
            in
            return try await self.inner.abandonInstances(request: r, options: o)
          })
      }

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

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

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

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

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

      public func `get`(
        request: RegionInstanceGroupManagersClient.GetRequest,
        options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.InstanceGroupManager {
        try await self._intercept(
          request: request,
          options: options,
          name: "`get`",
          action: {
            (r: RegionInstanceGroupManagersClient.GetRequest, o: GoogleCloudGax.RequestOptions)
              async throws -> GoogleCloudComputeV1.InstanceGroupManager
            in
            return try await self.inner.`get`(request: r, options: o)
          })
      }

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

      public func list(
        request: RegionInstanceGroupManagersClient.ListRequest,
        options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.RegionInstanceGroupManagerList {
        try await self._intercept(
          request: request,
          options: options,
          name: "list",
          action: {
            (r: RegionInstanceGroupManagersClient.ListRequest, o: GoogleCloudGax.RequestOptions)
              async throws -> GoogleCloudComputeV1.RegionInstanceGroupManagerList
            in
            return try await self.inner.list(request: r, options: o)
          })
      }

      public func listErrors(
        request: RegionInstanceGroupManagersClient.ListErrorsRequest,
        options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.RegionInstanceGroupManagersListErrorsResponse {
        try await self._intercept(
          request: request,
          options: options,
          name: "listErrors",
          action: {
            (
              r: RegionInstanceGroupManagersClient.ListErrorsRequest,
              o: GoogleCloudGax.RequestOptions
            ) async throws -> GoogleCloudComputeV1.RegionInstanceGroupManagersListErrorsResponse
            in
            return try await self.inner.listErrors(request: r, options: o)
          })
      }

      public func listManagedInstances(
        request: RegionInstanceGroupManagersClient.ListManagedInstancesRequest,
        options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.RegionInstanceGroupManagersListInstancesResponse {
        try await self._intercept(
          request: request,
          options: options,
          name: "listManagedInstances",
          action: {
            (
              r: RegionInstanceGroupManagersClient.ListManagedInstancesRequest,
              o: GoogleCloudGax.RequestOptions
            ) async throws -> GoogleCloudComputeV1.RegionInstanceGroupManagersListInstancesResponse
            in
            return try await self.inner.listManagedInstances(request: r, options: o)
          })
      }

      public func listPerInstanceConfigs(
        request: RegionInstanceGroupManagersClient.ListPerInstanceConfigsRequest,
        options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.RegionInstanceGroupManagersListInstanceConfigsResp {
        try await self._intercept(
          request: request,
          options: options,
          name: "listPerInstanceConfigs",
          action: {
            (
              r: RegionInstanceGroupManagersClient.ListPerInstanceConfigsRequest,
              o: GoogleCloudGax.RequestOptions
            ) async throws
              -> GoogleCloudComputeV1.RegionInstanceGroupManagersListInstanceConfigsResp
            in
            return try await self.inner.listPerInstanceConfigs(request: r, options: o)
          })
      }

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

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

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

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

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

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

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

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

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

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

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

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