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

  /// Service for the `reservations` resource.
  ///
  /// @Snippet(path: "reservationsQuickstart")
  public class ReservationsClient: Clients.ReservationsProtocol {
    let inner: any Clients.ReservationsStub
    let pollingErrorPolicy: GoogleCloudGax.PollingErrorPolicy
    let pollingBackoffPolicy: GoogleCloudGax.BackoffPolicy

    /// Creates a new `ReservationsClient` instance.
    public init(_ options: GoogleCloudGax.ClientOptions = .init()) throws {
      var inner: any Clients.ReservationsStub = try Clients.ReservationsTransport(options)
      inner = Clients.ReservationsRetry(inner, options: options)
      if let logger = options.logger {
        inner = Clients.ReservationsLogging(inner, logger: logger)
      }
      self.inner = inner
      self.pollingErrorPolicy = options.pollingErrorPolicy
      self.pollingBackoffPolicy = options.pollingBackoffPolicy
    }

    /// Retrieves an aggregated list of reservations.
    ///
    /// To prevent failure, it is recommended that you set the
    /// `returnPartialSuccess` parameter to `true`.
    ///
    /// @Snippet(path: "reservations_aggregatedList")
    public func aggregatedList(
      request: ReservationsClient.AggregatedListRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.ReservationAggregatedList {
      try await self.inner.aggregatedList(request: request, options: options)
    }

    /// Retrieves an aggregated list of reservations.
    ///
    /// To prevent failure, it is recommended that you set the
    /// `returnPartialSuccess` parameter to `true`.
    ///
    /// @Snippet(path: "reservations_aggregatedList")
    public func aggregatedList(
      byItem: ReservationsClient.AggregatedListRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<(Swift.String, ReservationsScopedList), Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws -> GoogleCloudComputeV1.ReservationAggregatedList in
        var request = byItem
        request.pageToken = token
        return try await self.aggregatedList(request: request, options: options)
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

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

    /// Deletes the specified reservation.
    ///
    /// @Snippet(path: "reservations_delete")
    public func delete(
      withPolling: ReservationsClient.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.zone = withPolling.zone
          }, options: options)
        return try extractStatus(op)
      }
      return GoogleCloudGax._PollableOperationImpl(
        initialState: initialState,
        polling: options.pollingErrorPolicy ?? self.pollingErrorPolicy,
        backoff: options.pollingBackoffPolicy ?? self.pollingBackoffPolicy,
        poll: poll
      )
    }

    /// Retrieves information about the specified reservation.
    ///
    /// @Snippet(path: "reservations_get")
    public func `get`(
      request: ReservationsClient.GetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Reservation {
      try await self.inner.`get`(request: request, options: options)
    }

    /// Gets the access control policy for a resource. May be empty if no such
    /// policy or resource exists.
    ///
    /// @Snippet(path: "reservations_getIamPolicy")
    public func getIamPolicy(
      request: ReservationsClient.GetIamPolicyRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Policy {
      try await self.inner.getIamPolicy(request: request, options: options)
    }

    /// Creates a new reservation. For more information, readReserving zonal
    /// resources.
    ///
    /// @Snippet(path: "reservations_insert")
    public func insert(
      request: ReservationsClient.InsertRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      try await self.inner.insert(request: request, options: options)
    }

    /// Creates a new reservation. For more information, readReserving zonal
    /// resources.
    ///
    /// @Snippet(path: "reservations_insert")
    public func insert(
      withPolling: ReservationsClient.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.zone = withPolling.zone
          }, options: options)
        return try extractStatus(op)
      }
      return GoogleCloudGax._PollableOperationImpl(
        initialState: initialState,
        polling: options.pollingErrorPolicy ?? self.pollingErrorPolicy,
        backoff: options.pollingBackoffPolicy ?? self.pollingBackoffPolicy,
        poll: poll
      )
    }

    /// A list of all the reservations that have been configured for the
    /// specified project in specified zone.
    ///
    /// @Snippet(path: "reservations_list")
    public func list(
      request: ReservationsClient.ListRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.ReservationList {
      try await self.inner.list(request: request, options: options)
    }

    /// A list of all the reservations that have been configured for the
    /// specified project in specified zone.
    ///
    /// @Snippet(path: "reservations_list")
    public func list(
      byItem: ReservationsClient.ListRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<Reservation, Swift.Error> {
      let listRpc = { (token: Swift.String) async throws -> GoogleCloudComputeV1.ReservationList in
        var request = byItem
        request.pageToken = token
        return try await self.list(request: request, options: options)
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

    /// Perform maintenance on an extended reservation
    ///
    /// @Snippet(path: "reservations_performMaintenance")
    public func performMaintenance(
      request: ReservationsClient.PerformMaintenanceRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      try await self.inner.performMaintenance(request: request, options: options)
    }

    /// Perform maintenance on an extended reservation
    ///
    /// @Snippet(path: "reservations_performMaintenance")
    public func performMaintenance(
      withPolling: ReservationsClient.PerformMaintenanceRequest,
      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.performMaintenance(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.zone = withPolling.zone
          }, options: options)
        return try extractStatus(op)
      }
      return GoogleCloudGax._PollableOperationImpl(
        initialState: initialState,
        polling: options.pollingErrorPolicy ?? self.pollingErrorPolicy,
        backoff: options.pollingBackoffPolicy ?? self.pollingBackoffPolicy,
        poll: poll
      )
    }

    /// Resizes the reservation (applicable to standalone reservations only). For
    /// more information, readModifying
    /// reservations.
    ///
    /// @Snippet(path: "reservations_resize")
    public func resize(
      request: ReservationsClient.ResizeRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      try await self.inner.resize(request: request, options: options)
    }

    /// Resizes the reservation (applicable to standalone reservations only). For
    /// more information, readModifying
    /// reservations.
    ///
    /// @Snippet(path: "reservations_resize")
    public func resize(
      withPolling: ReservationsClient.ResizeRequest, 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.resize(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.zone = withPolling.zone
          }, options: options)
        return try extractStatus(op)
      }
      return GoogleCloudGax._PollableOperationImpl(
        initialState: initialState,
        polling: options.pollingErrorPolicy ?? self.pollingErrorPolicy,
        backoff: options.pollingBackoffPolicy ?? self.pollingBackoffPolicy,
        poll: poll
      )
    }

    /// Sets the access control policy on the specified resource.
    /// Replaces any existing policy.
    ///
    /// @Snippet(path: "reservations_setIamPolicy")
    public func setIamPolicy(
      request: ReservationsClient.SetIamPolicyRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Policy {
      try await self.inner.setIamPolicy(request: request, options: options)
    }

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

    /// Update share settings of the reservation.
    ///
    /// @Snippet(path: "reservations_update")
    public func update(
      request: ReservationsClient.UpdateRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      try await self.inner.update(request: request, options: options)
    }

    /// Update share settings of the reservation.
    ///
    /// @Snippet(path: "reservations_update")
    public func update(
      withPolling: ReservationsClient.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.zone = withPolling.zone
          }, 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 zone-specific Operations resource.
    ///
    /// @Snippet(path: "reservations_getOperation")
    func getOperation(
      request: ZoneOperationsClient.GetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      try await self.inner.getOperation(request: request, options: options)
    }
  }

  extension Clients {
    /// A Swift protocol to mock `ReservationsClient`.
    ///
    /// To mock `ReservationsClient` change your functions to receive
    /// `some ReservationsProtocol` or `any ReservationsProtocol`
    /// and pass a mock implementation in your tests.
    public protocol ReservationsProtocol {
      /// See `ReservationsClient.aggregatedList`.
      func aggregatedList(request: ReservationsClient.AggregatedListRequest) async throws
        -> GoogleCloudComputeV1.ReservationAggregatedList

      /// See `ReservationsClient.aggregatedList`.
      func aggregatedList(
        byItem: ReservationsClient.AggregatedListRequest
      ) throws -> any AsyncSequence<(Swift.String, ReservationsScopedList), Swift.Error>

      /// See `ReservationsClient.aggregatedList`.
      func aggregatedList(
        project: Swift.String,
      ) throws -> any AsyncSequence<(Swift.String, ReservationsScopedList), Swift.Error>

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

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

      /// See `ReservationsClient.`get``.
      func `get`(
        project: Swift.String,
        zone: Swift.String,
        reservation: Swift.String,
      ) async throws -> GoogleCloudComputeV1.Reservation

      /// See `ReservationsClient.getIamPolicy`.
      func getIamPolicy(request: ReservationsClient.GetIamPolicyRequest) async throws
        -> GoogleCloudComputeV1.Policy

      /// See `ReservationsClient.getIamPolicy`.
      func getIamPolicy(
        project: Swift.String,
        zone: Swift.String,
        resource: Swift.String,
      ) async throws -> GoogleCloudComputeV1.Policy

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

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

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

      /// See `ReservationsClient.list`.
      func list(
        project: Swift.String,
        zone: Swift.String,
      ) throws -> any AsyncSequence<Reservation, Swift.Error>

      /// See `ReservationsClient.performMaintenance`.
      func performMaintenance(request: ReservationsClient.PerformMaintenanceRequest) async throws
        -> GoogleCloudComputeV1.Operation

      /// See `ReservationsClient.resize`.
      func resize(request: ReservationsClient.ResizeRequest) async throws
        -> GoogleCloudComputeV1.Operation

      /// See `ReservationsClient.setIamPolicy`.
      func setIamPolicy(request: ReservationsClient.SetIamPolicyRequest) async throws
        -> GoogleCloudComputeV1.Policy

      /// See `ReservationsClient.setIamPolicy`.
      func setIamPolicy(
        project: Swift.String,
        zone: Swift.String,
        resource: Swift.String,
        body: ZoneSetPolicyRequest?,
      ) async throws -> GoogleCloudComputeV1.Policy

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

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

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

      /// See `ReservationsClient.aggregatedList`.
      func aggregatedList(
        request: ReservationsClient.AggregatedListRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.ReservationAggregatedList

      /// See `ReservationsClient.aggregatedList`.
      func aggregatedList(
        byItem: ReservationsClient.AggregatedListRequest, options: GoogleCloudGax.RequestOptions
      ) throws -> any AsyncSequence<(Swift.String, ReservationsScopedList), Swift.Error>

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

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

      /// See `ReservationsClient.getIamPolicy`.
      func getIamPolicy(
        request: ReservationsClient.GetIamPolicyRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Policy

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

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

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

      /// See `ReservationsClient.performMaintenance`.
      func performMaintenance(
        request: ReservationsClient.PerformMaintenanceRequest,
        options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation

      /// See `ReservationsClient.resize`.
      func resize(
        request: ReservationsClient.ResizeRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Operation

      /// See `ReservationsClient.setIamPolicy`.
      func setIamPolicy(
        request: ReservationsClient.SetIamPolicyRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.Policy

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

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

  // Default implementations
  extension Clients.ReservationsProtocol {
    public func aggregatedList(request: ReservationsClient.AggregatedListRequest) async throws
      -> GoogleCloudComputeV1.ReservationAggregatedList
    {
      try await self.aggregatedList(request: request, options: .init())
    }

    public func aggregatedList(
      request: ReservationsClient.AggregatedListRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.ReservationAggregatedList {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func aggregatedList(
      byItem: ReservationsClient.AggregatedListRequest
    ) throws -> any AsyncSequence<(Swift.String, ReservationsScopedList), Swift.Error> {
      try self.aggregatedList(byItem: byItem, options: .init())
    }

    public func aggregatedList(
      byItem: ReservationsClient.AggregatedListRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<(Swift.String, ReservationsScopedList), Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws -> GoogleCloudComputeV1.ReservationAggregatedList in
        throw GoogleCloudGax.RequestError.unimplemented
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

    public func aggregatedList(
      project: Swift.String,
    ) throws -> any AsyncSequence<(Swift.String, ReservationsScopedList), Swift.Error> {
      let request = ReservationsClient.AggregatedListRequest().with {
        $0.project = project
      }
      return try self.aggregatedList(byItem: request)
    }

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

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

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

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

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

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

    public func `get`(
      project: Swift.String,
      zone: Swift.String,
      reservation: Swift.String,
    ) async throws -> GoogleCloudComputeV1.Reservation {
      let request = ReservationsClient.GetRequest().with {
        $0.project = project
        $0.zone = zone
        $0.reservation = reservation
      }
      return try await self.`get`(request: request)
    }

    public func getIamPolicy(request: ReservationsClient.GetIamPolicyRequest) async throws
      -> GoogleCloudComputeV1.Policy
    {
      try await self.getIamPolicy(request: request, options: .init())
    }

    public func getIamPolicy(
      request: ReservationsClient.GetIamPolicyRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Policy {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func getIamPolicy(
      project: Swift.String,
      zone: Swift.String,
      resource: Swift.String,
    ) async throws -> GoogleCloudComputeV1.Policy {
      let request = ReservationsClient.GetIamPolicyRequest().with {
        $0.project = project
        $0.zone = zone
        $0.resource = resource
      }
      return try await self.getIamPolicy(request: request)
    }

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

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

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

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

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

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

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

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

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

    public func performMaintenance(request: ReservationsClient.PerformMaintenanceRequest)
      async throws -> GoogleCloudComputeV1.Operation
    {
      try await self.performMaintenance(request: request, options: .init())
    }

    public func performMaintenance(
      request: ReservationsClient.PerformMaintenanceRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      throw GoogleCloudGax.RequestError.unimplemented
    }

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

    public func performMaintenance(
      withPolling: ReservationsClient.PerformMaintenanceRequest,
      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 performMaintenance(
      project: Swift.String,
      zone: Swift.String,
      reservation: Swift.String,
      body: ReservationsPerformMaintenanceRequest?,
    ) async throws -> any GoogleCloudGax.PollableOperation<GoogleCloudComputeV1.Operation> {
      let request = ReservationsClient.PerformMaintenanceRequest().with {
        $0.project = project
        $0.zone = zone
        $0.reservation = reservation
        $0.body = body
      }
      return try await self.performMaintenance(withPolling: request)
    }

    public func resize(request: ReservationsClient.ResizeRequest) async throws
      -> GoogleCloudComputeV1.Operation
    {
      try await self.resize(request: request, options: .init())
    }

    public func resize(
      request: ReservationsClient.ResizeRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      throw GoogleCloudGax.RequestError.unimplemented
    }

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

    public func resize(
      withPolling: ReservationsClient.ResizeRequest, 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 resize(
      project: Swift.String,
      zone: Swift.String,
      reservation: Swift.String,
      body: ReservationsResizeRequest?,
    ) async throws -> any GoogleCloudGax.PollableOperation<GoogleCloudComputeV1.Operation> {
      let request = ReservationsClient.ResizeRequest().with {
        $0.project = project
        $0.zone = zone
        $0.reservation = reservation
        $0.body = body
      }
      return try await self.resize(withPolling: request)
    }

    public func setIamPolicy(request: ReservationsClient.SetIamPolicyRequest) async throws
      -> GoogleCloudComputeV1.Policy
    {
      try await self.setIamPolicy(request: request, options: .init())
    }

    public func setIamPolicy(
      request: ReservationsClient.SetIamPolicyRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Policy {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func setIamPolicy(
      project: Swift.String,
      zone: Swift.String,
      resource: Swift.String,
      body: ZoneSetPolicyRequest?,
    ) async throws -> GoogleCloudComputeV1.Policy {
      let request = ReservationsClient.SetIamPolicyRequest().with {
        $0.project = project
        $0.zone = zone
        $0.resource = resource
        $0.body = body
      }
      return try await self.setIamPolicy(request: request)
    }

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

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

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

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

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

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

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

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

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