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

  /// Service for the `globalVmExtensionPolicies` resource.
  ///
  /// @Snippet(path: "globalVmExtensionPoliciesQuickstart")
  public class GlobalVmExtensionPoliciesClient: Clients.GlobalVmExtensionPoliciesProtocol {
    let inner: any Clients.GlobalVmExtensionPoliciesStub
    let pollingErrorPolicy: GoogleCloudGax.PollingErrorPolicy
    let pollingBackoffPolicy: GoogleCloudGax.BackoffPolicy

    /// Creates a new `GlobalVmExtensionPoliciesClient` instance.
    public init(_ options: GoogleCloudGax.ClientOptions = .init()) throws {
      var inner: any Clients.GlobalVmExtensionPoliciesStub =
        try Clients.GlobalVmExtensionPoliciesTransport(options)
      inner = Clients.GlobalVmExtensionPoliciesRetry(inner, options: options)
      if let logger = options.logger {
        inner = Clients.GlobalVmExtensionPoliciesLogging(inner, logger: logger)
      }
      self.inner = inner
      self.pollingErrorPolicy = options.pollingErrorPolicy
      self.pollingBackoffPolicy = options.pollingBackoffPolicy
    }

    /// Retrieves the list of all VM Extension Policy resources
    /// available to the specified project.
    ///
    /// To prevent failure, it's recommended that you set the
    /// `returnPartialSuccess` parameter to `true`.
    ///
    /// @Snippet(path: "globalVmExtensionPolicies_aggregatedList")
    public func aggregatedList(
      request: GlobalVmExtensionPoliciesClient.AggregatedListRequest,
      options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.VmExtensionPolicyAggregatedListResponse {
      try await self.inner.aggregatedList(request: request, options: options)
    }

    /// Retrieves the list of all VM Extension Policy resources
    /// available to the specified project.
    ///
    /// To prevent failure, it's recommended that you set the
    /// `returnPartialSuccess` parameter to `true`.
    ///
    /// @Snippet(path: "globalVmExtensionPolicies_aggregatedList")
    public func aggregatedList(
      byItem: GlobalVmExtensionPoliciesClient.AggregatedListRequest,
      options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<(Swift.String, VmExtensionPoliciesScopedList), Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws
          -> GoogleCloudComputeV1.VmExtensionPolicyAggregatedListResponse in
        var request = byItem
        request.pageToken = token
        return try await self.aggregatedList(request: request, options: options)
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

    /// Purge scoped resources (zonal policies) from a global VM extension
    /// policy, and then delete the global VM extension policy. Purge of the scoped
    /// resources is a pre-condition of the global VM extension policy deletion.
    /// The deletion of the global VM extension policy happens after the purge
    /// rollout is done, so it's not a part of the LRO. It's an automatic process
    /// that triggers in the backend.
    ///
    /// @Snippet(path: "globalVmExtensionPolicies_delete")
    public func delete(
      request: GlobalVmExtensionPoliciesClient.DeleteRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      try await self.inner.delete(request: request, options: options)
    }

    /// Purge scoped resources (zonal policies) from a global VM extension
    /// policy, and then delete the global VM extension policy. Purge of the scoped
    /// resources is a pre-condition of the global VM extension policy deletion.
    /// The deletion of the global VM extension policy happens after the purge
    /// rollout is done, so it's not a part of the LRO. It's an automatic process
    /// that triggers in the backend.
    ///
    /// @Snippet(path: "globalVmExtensionPolicies_delete")
    public func delete(
      withPolling: GlobalVmExtensionPoliciesClient.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
          }, options: options)
        return try extractStatus(op)
      }
      return GoogleCloudGax._PollableOperationImpl(
        initialState: initialState,
        polling: options.pollingErrorPolicy ?? self.pollingErrorPolicy,
        backoff: options.pollingBackoffPolicy ?? self.pollingBackoffPolicy,
        poll: poll
      )
    }

    /// Gets details of a global VM extension policy.
    ///
    /// @Snippet(path: "globalVmExtensionPolicies_get")
    public func `get`(
      request: GlobalVmExtensionPoliciesClient.GetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.GlobalVmExtensionPolicy {
      try await self.inner.`get`(request: request, options: options)
    }

    /// Creates a new project level GlobalVmExtensionPolicy.
    ///
    /// @Snippet(path: "globalVmExtensionPolicies_insert")
    public func insert(
      request: GlobalVmExtensionPoliciesClient.InsertRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      try await self.inner.insert(request: request, options: options)
    }

    /// Creates a new project level GlobalVmExtensionPolicy.
    ///
    /// @Snippet(path: "globalVmExtensionPolicies_insert")
    public func insert(
      withPolling: GlobalVmExtensionPoliciesClient.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
          }, options: options)
        return try extractStatus(op)
      }
      return GoogleCloudGax._PollableOperationImpl(
        initialState: initialState,
        polling: options.pollingErrorPolicy ?? self.pollingErrorPolicy,
        backoff: options.pollingBackoffPolicy ?? self.pollingBackoffPolicy,
        poll: poll
      )
    }

    /// Lists global VM extension policies.
    ///
    /// @Snippet(path: "globalVmExtensionPolicies_list")
    public func list(
      request: GlobalVmExtensionPoliciesClient.ListRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.GlobalVmExtensionPolicyList {
      try await self.inner.list(request: request, options: options)
    }

    /// Lists global VM extension policies.
    ///
    /// @Snippet(path: "globalVmExtensionPolicies_list")
    public func list(
      byItem: GlobalVmExtensionPoliciesClient.ListRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<GlobalVmExtensionPolicy, Swift.Error> {
      let listRpc = {
        (token: Swift.String) async throws -> GoogleCloudComputeV1.GlobalVmExtensionPolicyList in
        var request = byItem
        request.pageToken = token
        return try await self.list(request: request, options: options)
      }
      return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
    }

    /// Updates a global VM extension policy.
    ///
    /// @Snippet(path: "globalVmExtensionPolicies_update")
    public func update(
      request: GlobalVmExtensionPoliciesClient.UpdateRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      try await self.inner.update(request: request, options: options)
    }

    /// Updates a global VM extension policy.
    ///
    /// @Snippet(path: "globalVmExtensionPolicies_update")
    public func update(
      withPolling: GlobalVmExtensionPoliciesClient.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
          }, 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.
    ///
    /// @Snippet(path: "globalVmExtensionPolicies_getOperation")
    func getOperation(
      request: GlobalOperationsClient.GetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.Operation {
      try await self.inner.getOperation(request: request, options: options)
    }
  }

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

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

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

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

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

      /// See `GlobalVmExtensionPoliciesClient.`get``.
      func `get`(
        project: Swift.String,
        globalVmExtensionPolicy: Swift.String,
      ) async throws -> GoogleCloudComputeV1.GlobalVmExtensionPolicy

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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