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

  /// Service for the `organizationSecurityPolicies` resource.
  ///
  /// @Snippet(path: "organizationSecurityPoliciesQuickstart")
  public class OrganizationSecurityPoliciesClient: Clients.OrganizationSecurityPoliciesProtocol {
    let inner: any Clients.OrganizationSecurityPoliciesStub
    let pollingErrorPolicy: GoogleCloudGax.PollingErrorPolicy
    let pollingBackoffPolicy: GoogleCloudGax.BackoffPolicy

    /// Creates a new `OrganizationSecurityPoliciesClient` instance.
    public init(_ options: GoogleCloudGax.ClientOptions = .init()) throws {
      var inner: any Clients.OrganizationSecurityPoliciesStub =
        try Clients.OrganizationSecurityPoliciesTransport(options)
      inner = Clients.OrganizationSecurityPoliciesRetry(inner, options: options)
      if let logger = options.logger {
        inner = Clients.OrganizationSecurityPoliciesLogging(inner, logger: logger)
      }
      self.inner = inner
      self.pollingErrorPolicy = options.pollingErrorPolicy
      self.pollingBackoffPolicy = options.pollingBackoffPolicy
    }

    /// Inserts an association for the specified security policy.
    ///
    /// This has billing implications.  Projects in the hierarchy with effective
    /// hierarchical security policies will be automatically enrolled into Cloud
    /// Armor Enterprise if not already enrolled.
    ///
    /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
    /// versions of this API were used to modify firewall policies. This usage is
    /// now disabled for most organizations. Use firewallPolicies.addAssociation
    /// instead.
    ///
    /// @Snippet(path: "organizationSecurityPolicies_addAssociation")
    public func addAssociation(
      request: OrganizationSecurityPoliciesClient.AddAssociationRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      try await self.inner.addAssociation(request: request, options: options)
    }

    /// Inserts an association for the specified security policy.
    ///
    /// This has billing implications.  Projects in the hierarchy with effective
    /// hierarchical security policies will be automatically enrolled into Cloud
    /// Armor Enterprise if not already enrolled.
    ///
    /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
    /// versions of this API were used to modify firewall policies. This usage is
    /// now disabled for most organizations. Use firewallPolicies.addAssociation
    /// instead.
    ///
    /// @Snippet(path: "organizationSecurityPolicies_addAssociation")
    public func addAssociation(
      withPolling: OrganizationSecurityPoliciesClient.AddAssociationRequest,
      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.addAssociation(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()
          }, options: options)
        return try extractStatus(op)
      }
      return GoogleCloudGax._PollableOperationImpl(
        initialState: initialState,
        polling: options.pollingErrorPolicy ?? self.pollingErrorPolicy,
        backoff: options.pollingBackoffPolicy ?? self.pollingBackoffPolicy,
        poll: poll
      )
    }

    /// Inserts a rule into a security policy.
    ///
    /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
    /// versions of this API were used to modify firewall policies. This usage is
    /// now disabled for most organizations. Use firewallPolicies.addRule instead.
    ///
    /// @Snippet(path: "organizationSecurityPolicies_addRule")
    public func addRule(
      request: OrganizationSecurityPoliciesClient.AddRuleRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      try await self.inner.addRule(request: request, options: options)
    }

    /// Inserts a rule into a security policy.
    ///
    /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
    /// versions of this API were used to modify firewall policies. This usage is
    /// now disabled for most organizations. Use firewallPolicies.addRule instead.
    ///
    /// @Snippet(path: "organizationSecurityPolicies_addRule")
    public func addRule(
      withPolling: OrganizationSecurityPoliciesClient.AddRuleRequest,
      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.addRule(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()
          }, options: options)
        return try extractStatus(op)
      }
      return GoogleCloudGax._PollableOperationImpl(
        initialState: initialState,
        polling: options.pollingErrorPolicy ?? self.pollingErrorPolicy,
        backoff: options.pollingBackoffPolicy ?? self.pollingBackoffPolicy,
        poll: poll
      )
    }

    /// Copies rules to the specified security policy.
    ///
    /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
    /// versions of this API were used to modify firewall policies. This usage is
    /// now disabled for most organizations. Use firewallPolicies.cloneRules
    /// instead.
    ///
    /// @Snippet(path: "organizationSecurityPolicies_copyRules")
    public func copyRules(
      request: OrganizationSecurityPoliciesClient.CopyRulesRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      try await self.inner.copyRules(request: request, options: options)
    }

    /// Copies rules to the specified security policy.
    ///
    /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
    /// versions of this API were used to modify firewall policies. This usage is
    /// now disabled for most organizations. Use firewallPolicies.cloneRules
    /// instead.
    ///
    /// @Snippet(path: "organizationSecurityPolicies_copyRules")
    public func copyRules(
      withPolling: OrganizationSecurityPoliciesClient.CopyRulesRequest,
      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.copyRules(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()
          }, options: options)
        return try extractStatus(op)
      }
      return GoogleCloudGax._PollableOperationImpl(
        initialState: initialState,
        polling: options.pollingErrorPolicy ?? self.pollingErrorPolicy,
        backoff: options.pollingBackoffPolicy ?? self.pollingBackoffPolicy,
        poll: poll
      )
    }

    /// Deletes the specified policy.
    ///
    /// Use this API to remove Cloud Armor policies. Previously, alpha and beta
    /// versions of this API were used to remove firewall policies. This usage is
    /// now disabled for most organizations. Use firewallPolicies.delete instead.
    ///
    /// @Snippet(path: "organizationSecurityPolicies_delete")
    public func delete(
      request: OrganizationSecurityPoliciesClient.DeleteRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      try await self.inner.delete(request: request, options: options)
    }

    /// Deletes the specified policy.
    ///
    /// Use this API to remove Cloud Armor policies. Previously, alpha and beta
    /// versions of this API were used to remove firewall policies. This usage is
    /// now disabled for most organizations. Use firewallPolicies.delete instead.
    ///
    /// @Snippet(path: "organizationSecurityPolicies_delete")
    public func delete(
      withPolling: OrganizationSecurityPoliciesClient.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()
          }, options: options)
        return try extractStatus(op)
      }
      return GoogleCloudGax._PollableOperationImpl(
        initialState: initialState,
        polling: options.pollingErrorPolicy ?? self.pollingErrorPolicy,
        backoff: options.pollingBackoffPolicy ?? self.pollingBackoffPolicy,
        poll: poll
      )
    }

    /// List all of the ordered rules present in a single specified policy.
    ///
    /// Use this API to read Cloud Armor policies. Previously, alpha and beta
    /// versions of this API were used to read firewall policies. This usage is now
    /// disabled for most organizations. Use firewallPolicies.get instead.
    ///
    /// @Snippet(path: "organizationSecurityPolicies_get")
    public func `get`(
      request: OrganizationSecurityPoliciesClient.GetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.SecurityPolicy {
      try await self.inner.`get`(request: request, options: options)
    }

    /// Gets an association with the specified name.
    ///
    /// Use this API to read Cloud Armor policies. Previously, alpha and beta
    /// versions of this API were used to read firewall policies. This usage is
    /// now disabled for most organizations. Use firewallPolicies.getAssociation
    /// instead.
    ///
    /// @Snippet(path: "organizationSecurityPolicies_getAssociation")
    public func getAssociation(
      request: OrganizationSecurityPoliciesClient.GetAssociationRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.SecurityPolicyAssociation {
      try await self.inner.getAssociation(request: request, options: options)
    }

    /// Gets a rule at the specified priority.
    ///
    /// Use this API to read Cloud Armor policies. Previously, alpha and beta
    /// versions of this API were used to read firewall policies. This usage is now
    /// disabled for most organizations. Use firewallPolicies.getRule instead.
    ///
    /// @Snippet(path: "organizationSecurityPolicies_getRule")
    public func getRule(
      request: OrganizationSecurityPoliciesClient.GetRuleRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.SecurityPolicyRule {
      try await self.inner.getRule(request: request, options: options)
    }

    /// Creates a new policy in the specified organization using the data included
    /// in the request.
    ///
    /// Use this API to add Cloud Armor policies. Previously, alpha and beta
    /// versions of this API were used to add firewall policies. This usage is now
    /// disabled for most organizations. Use firewallPolicies.insert instead.
    ///
    /// @Snippet(path: "organizationSecurityPolicies_insert")
    public func insert(
      request: OrganizationSecurityPoliciesClient.InsertRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      try await self.inner.insert(request: request, options: options)
    }

    /// Creates a new policy in the specified organization using the data included
    /// in the request.
    ///
    /// Use this API to add Cloud Armor policies. Previously, alpha and beta
    /// versions of this API were used to add firewall policies. This usage is now
    /// disabled for most organizations. Use firewallPolicies.insert instead.
    ///
    /// @Snippet(path: "organizationSecurityPolicies_insert")
    public func insert(
      withPolling: OrganizationSecurityPoliciesClient.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()
          }, options: options)
        return try extractStatus(op)
      }
      return GoogleCloudGax._PollableOperationImpl(
        initialState: initialState,
        polling: options.pollingErrorPolicy ?? self.pollingErrorPolicy,
        backoff: options.pollingBackoffPolicy ?? self.pollingBackoffPolicy,
        poll: poll
      )
    }

    /// List all the policies that have been configured for the specified
    /// organization.
    ///
    /// Use this API to read Cloud Armor policies. Previously, alpha and beta
    /// versions of this API were used to read firewall policies. This usage is now
    /// disabled for most organizations. Use firewallPolicies.list instead.
    ///
    /// @Snippet(path: "organizationSecurityPolicies_list")
    public func list(
      request: OrganizationSecurityPoliciesClient.ListRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.SecurityPolicyList {
      try await self.inner.list(request: request, options: options)
    }

    /// List all the policies that have been configured for the specified
    /// organization.
    ///
    /// Use this API to read Cloud Armor policies. Previously, alpha and beta
    /// versions of this API were used to read firewall policies. This usage is now
    /// disabled for most organizations. Use firewallPolicies.list instead.
    ///
    /// @Snippet(path: "organizationSecurityPolicies_list")
    public func list(
      byItem: OrganizationSecurityPoliciesClient.ListRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<SecurityPolicy, Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws -> GoogleCloudComputeV1.SecurityPolicyList in
        var request = byItem
        request.pageToken = token
        return try await self.list(request: request, options: options)
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

    /// Lists associations of a specified target, i.e., organization or folder.
    ///
    /// Use this API to read Cloud Armor policies. Previously, alpha and beta
    /// versions of this API were used to read firewall policies. This usage is
    /// now disabled for most organizations. Use firewallPolicies.listAssociations
    /// instead.
    ///
    /// @Snippet(path: "organizationSecurityPolicies_listAssociations")
    public func listAssociations(
      request: OrganizationSecurityPoliciesClient.ListAssociationsRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.OrganizationSecurityPoliciesListAssociationsResponse {
      try await self.inner.listAssociations(request: request, options: options)
    }

    /// Gets the current list of preconfigured Web Application Firewall (WAF)
    /// expressions.
    ///
    /// @Snippet(path: "organizationSecurityPolicies_listPreconfiguredExpressionSets")
    public func listPreconfiguredExpressionSets(
      request: OrganizationSecurityPoliciesClient.ListPreconfiguredExpressionSetsRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.SecurityPoliciesListPreconfiguredExpressionSetsResponse {
      try await self.inner.listPreconfiguredExpressionSets(request: request, options: options)
    }

    /// Moves the specified security policy.
    ///
    /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
    /// versions of this API were used to modify firewall policies. This usage is
    /// now disabled for most organizations. Use firewallPolicies.move instead.
    ///
    /// @Snippet(path: "organizationSecurityPolicies_move")
    public func move(
      request: OrganizationSecurityPoliciesClient.MoveRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      try await self.inner.move(request: request, options: options)
    }

    /// Moves the specified security policy.
    ///
    /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
    /// versions of this API were used to modify firewall policies. This usage is
    /// now disabled for most organizations. Use firewallPolicies.move instead.
    ///
    /// @Snippet(path: "organizationSecurityPolicies_move")
    public func move(
      withPolling: OrganizationSecurityPoliciesClient.MoveRequest,
      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.move(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()
          }, options: options)
        return try extractStatus(op)
      }
      return GoogleCloudGax._PollableOperationImpl(
        initialState: initialState,
        polling: options.pollingErrorPolicy ?? self.pollingErrorPolicy,
        backoff: options.pollingBackoffPolicy ?? self.pollingBackoffPolicy,
        poll: poll
      )
    }

    /// Patches the specified policy with the data included in the request.
    ///
    /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
    /// versions of this API were used to modify firewall policies. This usage is
    /// now disabled for most organizations. Use firewallPolicies.patch instead.
    ///
    /// @Snippet(path: "organizationSecurityPolicies_patch")
    public func patch(
      request: OrganizationSecurityPoliciesClient.PatchRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      try await self.inner.patch(request: request, options: options)
    }

    /// Patches the specified policy with the data included in the request.
    ///
    /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
    /// versions of this API were used to modify firewall policies. This usage is
    /// now disabled for most organizations. Use firewallPolicies.patch instead.
    ///
    /// @Snippet(path: "organizationSecurityPolicies_patch")
    public func patch(
      withPolling: OrganizationSecurityPoliciesClient.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()
          }, options: options)
        return try extractStatus(op)
      }
      return GoogleCloudGax._PollableOperationImpl(
        initialState: initialState,
        polling: options.pollingErrorPolicy ?? self.pollingErrorPolicy,
        backoff: options.pollingBackoffPolicy ?? self.pollingBackoffPolicy,
        poll: poll
      )
    }

    /// Patches a rule at the specified priority.
    ///
    /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
    /// versions of this API were used to modify firewall policies. This usage is
    /// now disabled for most organizations. Use firewallPolicies.patchRule
    /// instead.
    ///
    /// @Snippet(path: "organizationSecurityPolicies_patchRule")
    public func patchRule(
      request: OrganizationSecurityPoliciesClient.PatchRuleRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      try await self.inner.patchRule(request: request, options: options)
    }

    /// Patches a rule at the specified priority.
    ///
    /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
    /// versions of this API were used to modify firewall policies. This usage is
    /// now disabled for most organizations. Use firewallPolicies.patchRule
    /// instead.
    ///
    /// @Snippet(path: "organizationSecurityPolicies_patchRule")
    public func patchRule(
      withPolling: OrganizationSecurityPoliciesClient.PatchRuleRequest,
      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.patchRule(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()
          }, options: options)
        return try extractStatus(op)
      }
      return GoogleCloudGax._PollableOperationImpl(
        initialState: initialState,
        polling: options.pollingErrorPolicy ?? self.pollingErrorPolicy,
        backoff: options.pollingBackoffPolicy ?? self.pollingBackoffPolicy,
        poll: poll
      )
    }

    /// Removes an association for the specified security policy.
    ///
    /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
    /// versions of this API were used to modify firewall policies. This usage is
    /// now disabled for most organizations. Use firewallPolicies.removeAssociation
    /// instead.
    ///
    /// @Snippet(path: "organizationSecurityPolicies_removeAssociation")
    public func removeAssociation(
      request: OrganizationSecurityPoliciesClient.RemoveAssociationRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      try await self.inner.removeAssociation(request: request, options: options)
    }

    /// Removes an association for the specified security policy.
    ///
    /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
    /// versions of this API were used to modify firewall policies. This usage is
    /// now disabled for most organizations. Use firewallPolicies.removeAssociation
    /// instead.
    ///
    /// @Snippet(path: "organizationSecurityPolicies_removeAssociation")
    public func removeAssociation(
      withPolling: OrganizationSecurityPoliciesClient.RemoveAssociationRequest,
      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.removeAssociation(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()
          }, options: options)
        return try extractStatus(op)
      }
      return GoogleCloudGax._PollableOperationImpl(
        initialState: initialState,
        polling: options.pollingErrorPolicy ?? self.pollingErrorPolicy,
        backoff: options.pollingBackoffPolicy ?? self.pollingBackoffPolicy,
        poll: poll
      )
    }

    /// Deletes a rule at the specified priority.
    ///
    /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
    /// versions of this API were used to modify firewall policies. This usage is
    /// now disabled for most organizations. Use firewallPolicies.removeRule
    /// instead.
    ///
    /// @Snippet(path: "organizationSecurityPolicies_removeRule")
    public func removeRule(
      request: OrganizationSecurityPoliciesClient.RemoveRuleRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      try await self.inner.removeRule(request: request, options: options)
    }

    /// Deletes a rule at the specified priority.
    ///
    /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
    /// versions of this API were used to modify firewall policies. This usage is
    /// now disabled for most organizations. Use firewallPolicies.removeRule
    /// instead.
    ///
    /// @Snippet(path: "organizationSecurityPolicies_removeRule")
    public func removeRule(
      withPolling: OrganizationSecurityPoliciesClient.RemoveRuleRequest,
      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.removeRule(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()
          }, options: options)
        return try extractStatus(op)
      }
      return GoogleCloudGax._PollableOperationImpl(
        initialState: initialState,
        polling: options.pollingErrorPolicy ?? self.pollingErrorPolicy,
        backoff: options.pollingBackoffPolicy ?? self.pollingBackoffPolicy,
        poll: poll
      )
    }

    /// Retrieves the specified Operations resource. Gets a list of operations
    /// by making a `list()` request.
    ///
    /// @Snippet(path: "organizationSecurityPolicies_getOperation")
    func getOperation(
      request: GlobalOrganizationOperationsClient.GetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      try await self.inner.getOperation(request: request, options: options)
    }
  }

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

      /// See `OrganizationSecurityPoliciesClient.addRule`.
      func addRule(request: OrganizationSecurityPoliciesClient.AddRuleRequest) async throws
        -> GoogleCloudComputeV1.Operation

      /// See `OrganizationSecurityPoliciesClient.copyRules`.
      func copyRules(request: OrganizationSecurityPoliciesClient.CopyRulesRequest) async throws
        -> GoogleCloudComputeV1.Operation

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

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

      /// See `OrganizationSecurityPoliciesClient.`get``.
      func `get`(
        securityPolicy: Swift.String,
      ) async throws -> GoogleCloudComputeV1.SecurityPolicy

      /// See `OrganizationSecurityPoliciesClient.getAssociation`.
      func getAssociation(request: OrganizationSecurityPoliciesClient.GetAssociationRequest)
        async throws -> GoogleCloudComputeV1.SecurityPolicyAssociation

      /// See `OrganizationSecurityPoliciesClient.getAssociation`.
      func getAssociation(
        securityPolicy: Swift.String,
      ) async throws -> GoogleCloudComputeV1.SecurityPolicyAssociation

      /// See `OrganizationSecurityPoliciesClient.getRule`.
      func getRule(request: OrganizationSecurityPoliciesClient.GetRuleRequest) async throws
        -> GoogleCloudComputeV1.SecurityPolicyRule

      /// See `OrganizationSecurityPoliciesClient.getRule`.
      func getRule(
        securityPolicy: Swift.String,
      ) async throws -> GoogleCloudComputeV1.SecurityPolicyRule

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

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

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

      /// See `OrganizationSecurityPoliciesClient.listAssociations`.
      func listAssociations(request: OrganizationSecurityPoliciesClient.ListAssociationsRequest)
        async throws -> GoogleCloudComputeV1.OrganizationSecurityPoliciesListAssociationsResponse

      /// See `OrganizationSecurityPoliciesClient.listPreconfiguredExpressionSets`.
      func listPreconfiguredExpressionSets(
        request: OrganizationSecurityPoliciesClient.ListPreconfiguredExpressionSetsRequest
      ) async throws -> GoogleCloudComputeV1.SecurityPoliciesListPreconfiguredExpressionSetsResponse

      /// See `OrganizationSecurityPoliciesClient.move`.
      func move(request: OrganizationSecurityPoliciesClient.MoveRequest) async throws
        -> GoogleCloudComputeV1.Operation

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

      /// See `OrganizationSecurityPoliciesClient.patchRule`.
      func patchRule(request: OrganizationSecurityPoliciesClient.PatchRuleRequest) async throws
        -> GoogleCloudComputeV1.Operation

      /// See `OrganizationSecurityPoliciesClient.removeAssociation`.
      func removeAssociation(request: OrganizationSecurityPoliciesClient.RemoveAssociationRequest)
        async throws -> GoogleCloudComputeV1.Operation

      /// See `OrganizationSecurityPoliciesClient.removeRule`.
      func removeRule(request: OrganizationSecurityPoliciesClient.RemoveRuleRequest) async throws
        -> GoogleCloudComputeV1.Operation

      /// See `OrganizationSecurityPoliciesClient.addAssociation`.
      func addAssociation(
        request: OrganizationSecurityPoliciesClient.AddAssociationRequest,
        options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation

      /// See `OrganizationSecurityPoliciesClient.addRule`.
      func addRule(
        request: OrganizationSecurityPoliciesClient.AddRuleRequest,
        options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation

      /// See `OrganizationSecurityPoliciesClient.copyRules`.
      func copyRules(
        request: OrganizationSecurityPoliciesClient.CopyRulesRequest,
        options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation

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

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

      /// See `OrganizationSecurityPoliciesClient.getAssociation`.
      func getAssociation(
        request: OrganizationSecurityPoliciesClient.GetAssociationRequest,
        options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.SecurityPolicyAssociation

      /// See `OrganizationSecurityPoliciesClient.getRule`.
      func getRule(
        request: OrganizationSecurityPoliciesClient.GetRuleRequest,
        options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.SecurityPolicyRule

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

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

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

      /// See `OrganizationSecurityPoliciesClient.listAssociations`.
      func listAssociations(
        request: OrganizationSecurityPoliciesClient.ListAssociationsRequest,
        options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.OrganizationSecurityPoliciesListAssociationsResponse

      /// See `OrganizationSecurityPoliciesClient.listPreconfiguredExpressionSets`.
      func listPreconfiguredExpressionSets(
        request: OrganizationSecurityPoliciesClient.ListPreconfiguredExpressionSetsRequest,
        options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.SecurityPoliciesListPreconfiguredExpressionSetsResponse

      /// See `OrganizationSecurityPoliciesClient.move`.
      func move(
        request: OrganizationSecurityPoliciesClient.MoveRequest,
        options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation

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

      /// See `OrganizationSecurityPoliciesClient.patchRule`.
      func patchRule(
        request: OrganizationSecurityPoliciesClient.PatchRuleRequest,
        options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation

      /// See `OrganizationSecurityPoliciesClient.removeAssociation`.
      func removeAssociation(
        request: OrganizationSecurityPoliciesClient.RemoveAssociationRequest,
        options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation

      /// See `OrganizationSecurityPoliciesClient.removeRule`.
      func removeRule(
        request: OrganizationSecurityPoliciesClient.RemoveRuleRequest,
        options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation
    }
  }

  // Default implementations
  extension Clients.OrganizationSecurityPoliciesProtocol {
    public func addAssociation(request: OrganizationSecurityPoliciesClient.AddAssociationRequest)
      async throws -> GoogleCloudComputeV1.Operation
    {
      try await self.addAssociation(request: request, options: .init())
    }

    public func addAssociation(
      request: OrganizationSecurityPoliciesClient.AddAssociationRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      throw GoogleCloudGax.RequestError.unimplemented
    }

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

    public func addAssociation(
      withPolling: OrganizationSecurityPoliciesClient.AddAssociationRequest,
      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 addAssociation(
      securityPolicy: Swift.String,
      body: SecurityPolicyAssociation?,
    ) async throws -> any GoogleCloudGax.PollableOperation<GoogleCloudComputeV1.Operation> {
      let request = OrganizationSecurityPoliciesClient.AddAssociationRequest().with {
        $0.securityPolicy = securityPolicy
        $0.body = body
      }
      return try await self.addAssociation(withPolling: request)
    }

    public func addRule(request: OrganizationSecurityPoliciesClient.AddRuleRequest) async throws
      -> GoogleCloudComputeV1.Operation
    {
      try await self.addRule(request: request, options: .init())
    }

    public func addRule(
      request: OrganizationSecurityPoliciesClient.AddRuleRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      throw GoogleCloudGax.RequestError.unimplemented
    }

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

    public func addRule(
      withPolling: OrganizationSecurityPoliciesClient.AddRuleRequest,
      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 addRule(
      securityPolicy: Swift.String,
      body: SecurityPolicyRule?,
    ) async throws -> any GoogleCloudGax.PollableOperation<GoogleCloudComputeV1.Operation> {
      let request = OrganizationSecurityPoliciesClient.AddRuleRequest().with {
        $0.securityPolicy = securityPolicy
        $0.body = body
      }
      return try await self.addRule(withPolling: request)
    }

    public func copyRules(request: OrganizationSecurityPoliciesClient.CopyRulesRequest) async throws
      -> GoogleCloudComputeV1.Operation
    {
      try await self.copyRules(request: request, options: .init())
    }

    public func copyRules(
      request: OrganizationSecurityPoliciesClient.CopyRulesRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      throw GoogleCloudGax.RequestError.unimplemented
    }

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

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

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

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

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

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

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

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

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

    public func getAssociation(request: OrganizationSecurityPoliciesClient.GetAssociationRequest)
      async throws -> GoogleCloudComputeV1.SecurityPolicyAssociation
    {
      try await self.getAssociation(request: request, options: .init())
    }

    public func getAssociation(
      request: OrganizationSecurityPoliciesClient.GetAssociationRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.SecurityPolicyAssociation {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func getAssociation(
      securityPolicy: Swift.String,
    ) async throws -> GoogleCloudComputeV1.SecurityPolicyAssociation {
      let request = OrganizationSecurityPoliciesClient.GetAssociationRequest().with {
        $0.securityPolicy = securityPolicy
      }
      return try await self.getAssociation(request: request)
    }

    public func getRule(request: OrganizationSecurityPoliciesClient.GetRuleRequest) async throws
      -> GoogleCloudComputeV1.SecurityPolicyRule
    {
      try await self.getRule(request: request, options: .init())
    }

    public func getRule(
      request: OrganizationSecurityPoliciesClient.GetRuleRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.SecurityPolicyRule {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func getRule(
      securityPolicy: Swift.String,
    ) async throws -> GoogleCloudComputeV1.SecurityPolicyRule {
      let request = OrganizationSecurityPoliciesClient.GetRuleRequest().with {
        $0.securityPolicy = securityPolicy
      }
      return try await self.getRule(request: request)
    }

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

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

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

    public func insert(
      withPolling: OrganizationSecurityPoliciesClient.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 list(request: OrganizationSecurityPoliciesClient.ListRequest) async throws
      -> GoogleCloudComputeV1.SecurityPolicyList
    {
      try await self.list(request: request, options: .init())
    }

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

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

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

    public func listAssociations(
      request: OrganizationSecurityPoliciesClient.ListAssociationsRequest
    ) async throws -> GoogleCloudComputeV1.OrganizationSecurityPoliciesListAssociationsResponse {
      try await self.listAssociations(request: request, options: .init())
    }

    public func listAssociations(
      request: OrganizationSecurityPoliciesClient.ListAssociationsRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.OrganizationSecurityPoliciesListAssociationsResponse {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func listPreconfiguredExpressionSets(
      request: OrganizationSecurityPoliciesClient.ListPreconfiguredExpressionSetsRequest
    ) async throws -> GoogleCloudComputeV1.SecurityPoliciesListPreconfiguredExpressionSetsResponse {
      try await self.listPreconfiguredExpressionSets(request: request, options: .init())
    }

    public func listPreconfiguredExpressionSets(
      request: OrganizationSecurityPoliciesClient.ListPreconfiguredExpressionSetsRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.SecurityPoliciesListPreconfiguredExpressionSetsResponse {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func move(request: OrganizationSecurityPoliciesClient.MoveRequest) async throws
      -> GoogleCloudComputeV1.Operation
    {
      try await self.move(request: request, options: .init())
    }

    public func move(
      request: OrganizationSecurityPoliciesClient.MoveRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      throw GoogleCloudGax.RequestError.unimplemented
    }

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

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

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

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

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

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

    public func patchRule(request: OrganizationSecurityPoliciesClient.PatchRuleRequest) async throws
      -> GoogleCloudComputeV1.Operation
    {
      try await self.patchRule(request: request, options: .init())
    }

    public func patchRule(
      request: OrganizationSecurityPoliciesClient.PatchRuleRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      throw GoogleCloudGax.RequestError.unimplemented
    }

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

    public func patchRule(
      withPolling: OrganizationSecurityPoliciesClient.PatchRuleRequest,
      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 patchRule(
      securityPolicy: Swift.String,
      body: SecurityPolicyRule?,
    ) async throws -> any GoogleCloudGax.PollableOperation<GoogleCloudComputeV1.Operation> {
      let request = OrganizationSecurityPoliciesClient.PatchRuleRequest().with {
        $0.securityPolicy = securityPolicy
        $0.body = body
      }
      return try await self.patchRule(withPolling: request)
    }

    public func removeAssociation(
      request: OrganizationSecurityPoliciesClient.RemoveAssociationRequest
    ) async throws -> GoogleCloudComputeV1.Operation {
      try await self.removeAssociation(request: request, options: .init())
    }

    public func removeAssociation(
      request: OrganizationSecurityPoliciesClient.RemoveAssociationRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      throw GoogleCloudGax.RequestError.unimplemented
    }

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

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

    public func removeRule(request: OrganizationSecurityPoliciesClient.RemoveRuleRequest)
      async throws -> GoogleCloudComputeV1.Operation
    {
      try await self.removeRule(request: request, options: .init())
    }

    public func removeRule(
      request: OrganizationSecurityPoliciesClient.RemoveRuleRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      throw GoogleCloudGax.RequestError.unimplemented
    }

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

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

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

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