// 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 GoogleCloudLocation
import GoogleCloudWkt
import GoogleIAMV1
import GoogleLongRunning
import GoogleRpc
import GoogleCloudGax

extension Clients {
  final class CloudDeployRetry: CloudDeployStub {
    let inner: any CloudDeployStub
    let options: GoogleCloudGax.ClientOptions

    public init(_ inner: any CloudDeployStub, options: GoogleCloudGax.ClientOptions) {
      self.inner = inner
      self.options = options
    }

    func _intercept<Input, Output>(
      request: Input,
      options: GoogleCloudGax.RequestOptions,
      idempotent: Swift.Bool,
      action: (Input, GoogleCloudGax.RequestOptions) async throws -> Output,
    ) async throws -> Output {
      let loop = GoogleCloudGax._RetryLoop(
        options: options, withDefault: self.options, idempotent: idempotent,
      )
      let attempt = { (attemptTimeout: Swift.Duration?) async throws -> Output in
        var attemptOptions = options
        attemptOptions.attemptTimeout = attemptTimeout
        return try await action(request, attemptOptions)
      }
      return try await loop.run(attempt: attempt)
    }

    public func listDeliveryPipelines(
      request: ListDeliveryPipelinesRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDeployV1.ListDeliveryPipelinesResponse {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: true,
        action: {
          (r: ListDeliveryPipelinesRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleCloudDeployV1.ListDeliveryPipelinesResponse
          in
          return try await self.inner.listDeliveryPipelines(request: r, options: o)
        })
    }

    public func getDeliveryPipeline(
      request: GetDeliveryPipelineRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDeployV1.DeliveryPipeline {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: true,
        action: {
          (r: GetDeliveryPipelineRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleCloudDeployV1.DeliveryPipeline
          in
          return try await self.inner.getDeliveryPipeline(request: r, options: o)
        })
    }

    public func createDeliveryPipeline(
      request: CreateDeliveryPipelineRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: false,
        action: {
          (r: CreateDeliveryPipelineRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleLongRunning.Operation
          in
          return try await self.inner.createDeliveryPipeline(request: r, options: o)
        })
    }

    public func updateDeliveryPipeline(
      request: UpdateDeliveryPipelineRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: false,
        action: {
          (r: UpdateDeliveryPipelineRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleLongRunning.Operation
          in
          return try await self.inner.updateDeliveryPipeline(request: r, options: o)
        })
    }

    public func deleteDeliveryPipeline(
      request: DeleteDeliveryPipelineRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: false,
        action: {
          (r: DeleteDeliveryPipelineRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleLongRunning.Operation
          in
          return try await self.inner.deleteDeliveryPipeline(request: r, options: o)
        })
    }

    public func listTargets(
      request: ListTargetsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDeployV1.ListTargetsResponse {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: true,
        action: {
          (r: ListTargetsRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleCloudDeployV1.ListTargetsResponse
          in
          return try await self.inner.listTargets(request: r, options: o)
        })
    }

    public func rollbackTarget(
      request: RollbackTargetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDeployV1.RollbackTargetResponse {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: false,
        action: {
          (r: RollbackTargetRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleCloudDeployV1.RollbackTargetResponse
          in
          return try await self.inner.rollbackTarget(request: r, options: o)
        })
    }

    public func getTarget(
      request: GetTargetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDeployV1.Target {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: true,
        action: {
          (r: GetTargetRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleCloudDeployV1.Target
          in
          return try await self.inner.getTarget(request: r, options: o)
        })
    }

    public func createTarget(
      request: CreateTargetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: false,
        action: {
          (r: CreateTargetRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleLongRunning.Operation
          in
          return try await self.inner.createTarget(request: r, options: o)
        })
    }

    public func updateTarget(
      request: UpdateTargetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: false,
        action: {
          (r: UpdateTargetRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleLongRunning.Operation
          in
          return try await self.inner.updateTarget(request: r, options: o)
        })
    }

    public func deleteTarget(
      request: DeleteTargetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: false,
        action: {
          (r: DeleteTargetRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleLongRunning.Operation
          in
          return try await self.inner.deleteTarget(request: r, options: o)
        })
    }

    public func listCustomTargetTypes(
      request: ListCustomTargetTypesRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDeployV1.ListCustomTargetTypesResponse {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: true,
        action: {
          (r: ListCustomTargetTypesRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleCloudDeployV1.ListCustomTargetTypesResponse
          in
          return try await self.inner.listCustomTargetTypes(request: r, options: o)
        })
    }

    public func getCustomTargetType(
      request: GetCustomTargetTypeRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDeployV1.CustomTargetType {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: true,
        action: {
          (r: GetCustomTargetTypeRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleCloudDeployV1.CustomTargetType
          in
          return try await self.inner.getCustomTargetType(request: r, options: o)
        })
    }

    public func createCustomTargetType(
      request: CreateCustomTargetTypeRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: false,
        action: {
          (r: CreateCustomTargetTypeRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleLongRunning.Operation
          in
          return try await self.inner.createCustomTargetType(request: r, options: o)
        })
    }

    public func updateCustomTargetType(
      request: UpdateCustomTargetTypeRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: false,
        action: {
          (r: UpdateCustomTargetTypeRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleLongRunning.Operation
          in
          return try await self.inner.updateCustomTargetType(request: r, options: o)
        })
    }

    public func deleteCustomTargetType(
      request: DeleteCustomTargetTypeRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: false,
        action: {
          (r: DeleteCustomTargetTypeRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleLongRunning.Operation
          in
          return try await self.inner.deleteCustomTargetType(request: r, options: o)
        })
    }

    public func listReleases(
      request: ListReleasesRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDeployV1.ListReleasesResponse {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: true,
        action: {
          (r: ListReleasesRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleCloudDeployV1.ListReleasesResponse
          in
          return try await self.inner.listReleases(request: r, options: o)
        })
    }

    public func getRelease(
      request: GetReleaseRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDeployV1.Release {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: true,
        action: {
          (r: GetReleaseRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleCloudDeployV1.Release
          in
          return try await self.inner.getRelease(request: r, options: o)
        })
    }

    public func createRelease(
      request: CreateReleaseRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: false,
        action: {
          (r: CreateReleaseRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleLongRunning.Operation
          in
          return try await self.inner.createRelease(request: r, options: o)
        })
    }

    public func abandonRelease(
      request: AbandonReleaseRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDeployV1.AbandonReleaseResponse {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: false,
        action: {
          (r: AbandonReleaseRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleCloudDeployV1.AbandonReleaseResponse
          in
          return try await self.inner.abandonRelease(request: r, options: o)
        })
    }

    public func createDeployPolicy(
      request: CreateDeployPolicyRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: false,
        action: {
          (r: CreateDeployPolicyRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleLongRunning.Operation
          in
          return try await self.inner.createDeployPolicy(request: r, options: o)
        })
    }

    public func updateDeployPolicy(
      request: UpdateDeployPolicyRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: false,
        action: {
          (r: UpdateDeployPolicyRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleLongRunning.Operation
          in
          return try await self.inner.updateDeployPolicy(request: r, options: o)
        })
    }

    public func deleteDeployPolicy(
      request: DeleteDeployPolicyRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: false,
        action: {
          (r: DeleteDeployPolicyRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleLongRunning.Operation
          in
          return try await self.inner.deleteDeployPolicy(request: r, options: o)
        })
    }

    public func listDeployPolicies(
      request: ListDeployPoliciesRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDeployV1.ListDeployPoliciesResponse {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: true,
        action: {
          (r: ListDeployPoliciesRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleCloudDeployV1.ListDeployPoliciesResponse
          in
          return try await self.inner.listDeployPolicies(request: r, options: o)
        })
    }

    public func getDeployPolicy(
      request: GetDeployPolicyRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDeployV1.DeployPolicy {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: true,
        action: {
          (r: GetDeployPolicyRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleCloudDeployV1.DeployPolicy
          in
          return try await self.inner.getDeployPolicy(request: r, options: o)
        })
    }

    public func approveRollout(
      request: ApproveRolloutRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDeployV1.ApproveRolloutResponse {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: false,
        action: {
          (r: ApproveRolloutRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleCloudDeployV1.ApproveRolloutResponse
          in
          return try await self.inner.approveRollout(request: r, options: o)
        })
    }

    public func advanceRollout(
      request: AdvanceRolloutRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDeployV1.AdvanceRolloutResponse {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: false,
        action: {
          (r: AdvanceRolloutRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleCloudDeployV1.AdvanceRolloutResponse
          in
          return try await self.inner.advanceRollout(request: r, options: o)
        })
    }

    public func cancelRollout(
      request: CancelRolloutRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDeployV1.CancelRolloutResponse {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: false,
        action: {
          (r: CancelRolloutRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleCloudDeployV1.CancelRolloutResponse
          in
          return try await self.inner.cancelRollout(request: r, options: o)
        })
    }

    public func listRollouts(
      request: ListRolloutsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDeployV1.ListRolloutsResponse {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: true,
        action: {
          (r: ListRolloutsRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleCloudDeployV1.ListRolloutsResponse
          in
          return try await self.inner.listRollouts(request: r, options: o)
        })
    }

    public func getRollout(
      request: GetRolloutRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDeployV1.Rollout {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: true,
        action: {
          (r: GetRolloutRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleCloudDeployV1.Rollout
          in
          return try await self.inner.getRollout(request: r, options: o)
        })
    }

    public func createRollout(
      request: CreateRolloutRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: false,
        action: {
          (r: CreateRolloutRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleLongRunning.Operation
          in
          return try await self.inner.createRollout(request: r, options: o)
        })
    }

    public func ignoreJob(
      request: IgnoreJobRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDeployV1.IgnoreJobResponse {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: false,
        action: {
          (r: IgnoreJobRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleCloudDeployV1.IgnoreJobResponse
          in
          return try await self.inner.ignoreJob(request: r, options: o)
        })
    }

    public func retryJob(
      request: RetryJobRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDeployV1.RetryJobResponse {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: false,
        action: {
          (r: RetryJobRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleCloudDeployV1.RetryJobResponse
          in
          return try await self.inner.retryJob(request: r, options: o)
        })
    }

    public func listJobRuns(
      request: ListJobRunsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDeployV1.ListJobRunsResponse {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: true,
        action: {
          (r: ListJobRunsRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleCloudDeployV1.ListJobRunsResponse
          in
          return try await self.inner.listJobRuns(request: r, options: o)
        })
    }

    public func getJobRun(
      request: GetJobRunRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDeployV1.JobRun {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: true,
        action: {
          (r: GetJobRunRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleCloudDeployV1.JobRun
          in
          return try await self.inner.getJobRun(request: r, options: o)
        })
    }

    public func terminateJobRun(
      request: TerminateJobRunRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDeployV1.TerminateJobRunResponse {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: false,
        action: {
          (r: TerminateJobRunRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleCloudDeployV1.TerminateJobRunResponse
          in
          return try await self.inner.terminateJobRun(request: r, options: o)
        })
    }

    public func getConfig(
      request: GetConfigRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDeployV1.Config {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: true,
        action: {
          (r: GetConfigRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleCloudDeployV1.Config
          in
          return try await self.inner.getConfig(request: r, options: o)
        })
    }

    public func createAutomation(
      request: CreateAutomationRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: false,
        action: {
          (r: CreateAutomationRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleLongRunning.Operation
          in
          return try await self.inner.createAutomation(request: r, options: o)
        })
    }

    public func updateAutomation(
      request: UpdateAutomationRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: false,
        action: {
          (r: UpdateAutomationRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleLongRunning.Operation
          in
          return try await self.inner.updateAutomation(request: r, options: o)
        })
    }

    public func deleteAutomation(
      request: DeleteAutomationRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: false,
        action: {
          (r: DeleteAutomationRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleLongRunning.Operation
          in
          return try await self.inner.deleteAutomation(request: r, options: o)
        })
    }

    public func getAutomation(
      request: GetAutomationRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDeployV1.Automation {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: true,
        action: {
          (r: GetAutomationRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleCloudDeployV1.Automation
          in
          return try await self.inner.getAutomation(request: r, options: o)
        })
    }

    public func listAutomations(
      request: ListAutomationsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDeployV1.ListAutomationsResponse {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: true,
        action: {
          (r: ListAutomationsRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleCloudDeployV1.ListAutomationsResponse
          in
          return try await self.inner.listAutomations(request: r, options: o)
        })
    }

    public func getAutomationRun(
      request: GetAutomationRunRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDeployV1.AutomationRun {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: true,
        action: {
          (r: GetAutomationRunRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleCloudDeployV1.AutomationRun
          in
          return try await self.inner.getAutomationRun(request: r, options: o)
        })
    }

    public func listAutomationRuns(
      request: ListAutomationRunsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDeployV1.ListAutomationRunsResponse {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: true,
        action: {
          (r: ListAutomationRunsRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleCloudDeployV1.ListAutomationRunsResponse
          in
          return try await self.inner.listAutomationRuns(request: r, options: o)
        })
    }

    public func cancelAutomationRun(
      request: CancelAutomationRunRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudDeployV1.CancelAutomationRunResponse {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: false,
        action: {
          (r: CancelAutomationRunRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleCloudDeployV1.CancelAutomationRunResponse
          in
          return try await self.inner.cancelAutomationRun(request: r, options: o)
        })
    }

    public func listLocations(
      request: GoogleCloudLocation.ListLocationsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudLocation.ListLocationsResponse {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: true,
        action: {
          (r: GoogleCloudLocation.ListLocationsRequest, o: GoogleCloudGax.RequestOptions)
            async throws -> GoogleCloudLocation.ListLocationsResponse
          in
          return try await self.inner.listLocations(request: r, options: o)
        })
    }

    public func getLocation(
      request: GoogleCloudLocation.GetLocationRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudLocation.Location {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: true,
        action: {
          (r: GoogleCloudLocation.GetLocationRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleCloudLocation.Location
          in
          return try await self.inner.getLocation(request: r, options: o)
        })
    }

    public func setIamPolicy(
      request: GoogleIAMV1.SetIamPolicyRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleIAMV1.Policy {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: false,
        action: {
          (r: GoogleIAMV1.SetIamPolicyRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleIAMV1.Policy
          in
          return try await self.inner.setIamPolicy(request: r, options: o)
        })
    }

    public func getIamPolicy(
      request: GoogleIAMV1.GetIamPolicyRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleIAMV1.Policy {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: true,
        action: {
          (r: GoogleIAMV1.GetIamPolicyRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleIAMV1.Policy
          in
          return try await self.inner.getIamPolicy(request: r, options: o)
        })
    }

    public func testIamPermissions(
      request: GoogleIAMV1.TestIamPermissionsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleIAMV1.TestIamPermissionsResponse {
      try await self._intercept(
        request: request,
        options: options,
        idempotent: false,
        action: {
          (r: GoogleIAMV1.TestIamPermissionsRequest, o: GoogleCloudGax.RequestOptions) async throws
            -> GoogleIAMV1.TestIamPermissionsResponse
          in
          return try await self.inner.testIamPermissions(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,
        idempotent: true,
        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,
        idempotent: true,
        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,
        idempotent: false,
        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,
        idempotent: false,
        action: {
          (r: GoogleLongRunning.CancelOperationRequest, o: GoogleCloudGax.RequestOptions)
            async throws -> Void in
          return try await self.inner.cancelOperation(request: r, options: o)
        })
    }
  }
}
