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

  /// Service for the `regionAutoscalers` resource.
  ///
  /// @Snippet(path: "regionAutoscalersQuickstart")
  public class RegionAutoscalersClient: Clients.RegionAutoscalersProtocol {
    let inner: any Clients.RegionAutoscalersStub
    let pollingErrorPolicy: GoogleCloudGax.PollingErrorPolicy
    let pollingBackoffPolicy: GoogleCloudGax.BackoffPolicy

    /// Creates a new `RegionAutoscalersClient` instance.
    public init(_ options: GoogleCloudGax.ClientOptions = .init()) throws {
      var inner: any Clients.RegionAutoscalersStub = try Clients.RegionAutoscalersTransport(options)
      inner = Clients.RegionAutoscalersRetry(inner, options: options)
      if let logger = options.logger {
        inner = Clients.RegionAutoscalersLogging(inner, logger: logger)
      }
      self.inner = inner
      self.pollingErrorPolicy = options.pollingErrorPolicy
      self.pollingBackoffPolicy = options.pollingBackoffPolicy
    }

    /// Deletes the specified autoscaler.
    ///
    /// @Snippet(path: "regionAutoscalers_delete")
    public func delete(
      request: RegionAutoscalersClient.DeleteRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      try await self.inner.delete(request: request, options: options)
    }

    /// Deletes the specified autoscaler.
    ///
    /// @Snippet(path: "regionAutoscalers_delete")
    public func delete(
      withPolling: RegionAutoscalersClient.DeleteRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<GoogleCloudComputeV1.Operation> {
      let extractStatus = {
        (op: GoogleCloudComputeV1.Operation) throws
          -> GoogleCloudGax._PollableOperationImpl<GoogleCloudComputeV1.Operation>.State in
        guard op._done() else {
          return .init(done: false, result: nil)
        }

        do {
          try op._detectErrors()
        } catch let e as GoogleCloudGax.RequestError {
          return .init(done: true, result: .failure(e))
        }
        return .init(done: true, result: .success(op))
      }
      let rawOp = try await self.delete(request: withPolling, options: options)
      let initialState = try extractStatus(rawOp)
      let poll = {
        () async throws
          -> GoogleCloudGax._PollableOperationImpl<GoogleCloudComputeV1.Operation>.State in
        let op = try await self.getOperation(
          request: .init().with {
            $0.operation = rawOp._name()
            $0.project = withPolling.project
            $0.region = withPolling.region
          }, options: options)
        return try extractStatus(op)
      }
      return GoogleCloudGax._PollableOperationImpl(
        initialState: initialState,
        polling: options.pollingErrorPolicy ?? self.pollingErrorPolicy,
        backoff: options.pollingBackoffPolicy ?? self.pollingBackoffPolicy,
        poll: poll
      )
    }

    /// Returns the specified autoscaler.
    ///
    /// @Snippet(path: "regionAutoscalers_get")
    public func `get`(
      request: RegionAutoscalersClient.GetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Autoscaler {
      try await self.inner.`get`(request: request, options: options)
    }

    /// Creates an autoscaler in the specified project using
    /// the data included in the request.
    ///
    /// @Snippet(path: "regionAutoscalers_insert")
    public func insert(
      request: RegionAutoscalersClient.InsertRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      try await self.inner.insert(request: request, options: options)
    }

    /// Creates an autoscaler in the specified project using
    /// the data included in the request.
    ///
    /// @Snippet(path: "regionAutoscalers_insert")
    public func insert(
      withPolling: RegionAutoscalersClient.InsertRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<GoogleCloudComputeV1.Operation> {
      let extractStatus = {
        (op: GoogleCloudComputeV1.Operation) throws
          -> GoogleCloudGax._PollableOperationImpl<GoogleCloudComputeV1.Operation>.State in
        guard op._done() else {
          return .init(done: false, result: nil)
        }

        do {
          try op._detectErrors()
        } catch let e as GoogleCloudGax.RequestError {
          return .init(done: true, result: .failure(e))
        }
        return .init(done: true, result: .success(op))
      }
      let rawOp = try await self.insert(request: withPolling, options: options)
      let initialState = try extractStatus(rawOp)
      let poll = {
        () async throws
          -> GoogleCloudGax._PollableOperationImpl<GoogleCloudComputeV1.Operation>.State in
        let op = try await self.getOperation(
          request: .init().with {
            $0.operation = rawOp._name()
            $0.project = withPolling.project
            $0.region = withPolling.region
          }, options: options)
        return try extractStatus(op)
      }
      return GoogleCloudGax._PollableOperationImpl(
        initialState: initialState,
        polling: options.pollingErrorPolicy ?? self.pollingErrorPolicy,
        backoff: options.pollingBackoffPolicy ?? self.pollingBackoffPolicy,
        poll: poll
      )
    }

    /// Retrieves a list of autoscalers contained within
    /// the specified region.
    ///
    /// @Snippet(path: "regionAutoscalers_list")
    public func list(
      request: RegionAutoscalersClient.ListRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.RegionAutoscalerList {
      try await self.inner.list(request: request, options: options)
    }

    /// Retrieves a list of autoscalers contained within
    /// the specified region.
    ///
    /// @Snippet(path: "regionAutoscalers_list")
    public func list(
      byItem: RegionAutoscalersClient.ListRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<Autoscaler, Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws -> GoogleCloudComputeV1.RegionAutoscalerList in
        var request = byItem
        request.pageToken = token
        return try await self.list(request: request, options: options)
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

    /// Updates an autoscaler in the specified project using
    /// the data included in the request. This method supportsPATCH
    /// semantics and uses theJSON merge
    /// patch format and processing rules.
    ///
    /// @Snippet(path: "regionAutoscalers_patch")
    public func patch(
      request: RegionAutoscalersClient.PatchRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      try await self.inner.patch(request: request, options: options)
    }

    /// Updates an autoscaler in the specified project using
    /// the data included in the request. This method supportsPATCH
    /// semantics and uses theJSON merge
    /// patch format and processing rules.
    ///
    /// @Snippet(path: "regionAutoscalers_patch")
    public func patch(
      withPolling: RegionAutoscalersClient.PatchRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<GoogleCloudComputeV1.Operation> {
      let extractStatus = {
        (op: GoogleCloudComputeV1.Operation) throws
          -> GoogleCloudGax._PollableOperationImpl<GoogleCloudComputeV1.Operation>.State in
        guard op._done() else {
          return .init(done: false, result: nil)
        }

        do {
          try op._detectErrors()
        } catch let e as GoogleCloudGax.RequestError {
          return .init(done: true, result: .failure(e))
        }
        return .init(done: true, result: .success(op))
      }
      let rawOp = try await self.patch(request: withPolling, options: options)
      let initialState = try extractStatus(rawOp)
      let poll = {
        () async throws
          -> GoogleCloudGax._PollableOperationImpl<GoogleCloudComputeV1.Operation>.State in
        let op = try await self.getOperation(
          request: .init().with {
            $0.operation = rawOp._name()
            $0.project = withPolling.project
            $0.region = withPolling.region
          }, options: options)
        return try extractStatus(op)
      }
      return GoogleCloudGax._PollableOperationImpl(
        initialState: initialState,
        polling: options.pollingErrorPolicy ?? self.pollingErrorPolicy,
        backoff: options.pollingBackoffPolicy ?? self.pollingBackoffPolicy,
        poll: poll
      )
    }

    /// Returns permissions that a caller has on the specified resource.
    ///
    /// @Snippet(path: "regionAutoscalers_testIamPermissions")
    public func testIamPermissions(
      request: RegionAutoscalersClient.TestIamPermissionsRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.TestPermissionsResponse {
      try await self.inner.testIamPermissions(request: request, options: options)
    }

    /// Updates an autoscaler in the specified project using
    /// the data included in the request.
    ///
    /// @Snippet(path: "regionAutoscalers_update")
    public func update(
      request: RegionAutoscalersClient.UpdateRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      try await self.inner.update(request: request, options: options)
    }

    /// Updates an autoscaler in the specified project using
    /// the data included in the request.
    ///
    /// @Snippet(path: "regionAutoscalers_update")
    public func update(
      withPolling: RegionAutoscalersClient.UpdateRequest, 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.update(request: withPolling, options: options)
      let initialState = try extractStatus(rawOp)
      let poll = {
        () async throws
          -> GoogleCloudGax._PollableOperationImpl<GoogleCloudComputeV1.Operation>.State in
        let op = try await self.getOperation(
          request: .init().with {
            $0.operation = rawOp._name()
            $0.project = withPolling.project
            $0.region = withPolling.region
          }, 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 region-specific Operations resource.
    ///
    /// @Snippet(path: "regionAutoscalers_getOperation")
    func getOperation(
      request: RegionOperationsClient.GetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      try await self.inner.getOperation(request: request, options: options)
    }
  }

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

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

      /// See `RegionAutoscalersClient.`get``.
      func `get`(
        project: Swift.String,
        region: Swift.String,
        autoscaler: Swift.String,
      ) async throws -> GoogleCloudComputeV1.Autoscaler

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

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

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

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

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

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

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

      /// See `RegionAutoscalersClient.update`.
      func update(request: RegionAutoscalersClient.UpdateRequest) async throws
        -> GoogleCloudComputeV1.Operation

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

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

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

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

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

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

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

      /// See `RegionAutoscalersClient.update`.
      func update(
        request: RegionAutoscalersClient.UpdateRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation
    }
  }

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

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

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

    public func delete(
      withPolling: RegionAutoscalersClient.DeleteRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<GoogleCloudComputeV1.Operation> {
      let poll = {
        () async throws
          -> GoogleCloudGax._PollableOperationImpl<GoogleCloudComputeV1.Operation>.State in
        throw GoogleCloudGax.RequestError.unimplemented
      }
      return GoogleCloudGax._PollableOperationImpl(
        initialState: .init(done: false, result: nil), poll: poll)
    }

    public func delete(
      project: Swift.String,
      region: Swift.String,
      autoscaler: Swift.String,
    ) async throws -> any GoogleCloudGax.PollableOperation<GoogleCloudComputeV1.Operation> {
      let request = RegionAutoscalersClient.DeleteRequest().with {
        $0.project = project
        $0.region = region
        $0.autoscaler = autoscaler
      }
      return try await self.delete(withPolling: request)
    }

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

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

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

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

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

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

    public func insert(
      withPolling: RegionAutoscalersClient.InsertRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<GoogleCloudComputeV1.Operation> {
      let poll = {
        () async throws
          -> GoogleCloudGax._PollableOperationImpl<GoogleCloudComputeV1.Operation>.State in
        throw GoogleCloudGax.RequestError.unimplemented
      }
      return GoogleCloudGax._PollableOperationImpl(
        initialState: .init(done: false, result: nil), poll: poll)
    }

    public func insert(
      project: Swift.String,
      region: Swift.String,
      body: Autoscaler?,
    ) async throws -> any GoogleCloudGax.PollableOperation<GoogleCloudComputeV1.Operation> {
      let request = RegionAutoscalersClient.InsertRequest().with {
        $0.project = project
        $0.region = region
        $0.body = body
      }
      return try await self.insert(withPolling: request)
    }

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

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

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

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

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

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

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

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

    public func patch(
      withPolling: RegionAutoscalersClient.PatchRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<GoogleCloudComputeV1.Operation> {
      let poll = {
        () async throws
          -> GoogleCloudGax._PollableOperationImpl<GoogleCloudComputeV1.Operation>.State in
        throw GoogleCloudGax.RequestError.unimplemented
      }
      return GoogleCloudGax._PollableOperationImpl(
        initialState: .init(done: false, result: nil), poll: poll)
    }

    public func patch(
      project: Swift.String,
      region: Swift.String,
      body: Autoscaler?,
    ) async throws -> any GoogleCloudGax.PollableOperation<GoogleCloudComputeV1.Operation> {
      let request = RegionAutoscalersClient.PatchRequest().with {
        $0.project = project
        $0.region = region
        $0.body = body
      }
      return try await self.patch(withPolling: request)
    }

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

    public func testIamPermissions(
      request: RegionAutoscalersClient.TestIamPermissionsRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.TestPermissionsResponse {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func testIamPermissions(
      project: Swift.String,
      region: Swift.String,
      resource: Swift.String,
      body: TestPermissionsRequest?,
    ) async throws -> GoogleCloudComputeV1.TestPermissionsResponse {
      let request = RegionAutoscalersClient.TestIamPermissionsRequest().with {
        $0.project = project
        $0.region = region
        $0.resource = resource
        $0.body = body
      }
      return try await self.testIamPermissions(request: request)
    }

    public func update(request: RegionAutoscalersClient.UpdateRequest) async throws
      -> GoogleCloudComputeV1.Operation
    {
      try await self.update(request: request, options: .init())
    }

    public func update(
      request: RegionAutoscalersClient.UpdateRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      throw GoogleCloudGax.RequestError.unimplemented
    }

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

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

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

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