// Code generated by sidekick. DO NOT EDIT.
//
// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import Foundation
#if canImport(FoundationNetworking)
  import FoundationNetworking
#endif
import GoogleCloudLocation
import GoogleCloudWkt
import GoogleIAMV1
import GoogleLongRunning
import GoogleRpc
import GoogleCloudGax

/// Provides interfaces for using [Cloud KMS
/// Autokey](https://cloud.google.com/kms/help/autokey) to provision new
/// [CryptoKeys][google.cloud.kms.v1.CryptoKey], ready for Customer Managed
/// Encryption Key (CMEK) use, on-demand. To support certain client tooling, this
/// feature is modeled around a [KeyHandle][google.cloud.kms.v1.KeyHandle]
/// resource: creating a [KeyHandle][google.cloud.kms.v1.KeyHandle] in a resource
/// project and given location triggers Cloud KMS Autokey to provision a
/// [CryptoKey][google.cloud.kms.v1.CryptoKey] in the configured key project and
/// the same location.
///
/// Prior to use in a given resource project,
/// [UpdateAutokeyConfig][google.cloud.kms.v1.AutokeyAdmin.UpdateAutokeyConfig]
/// should have been called on an ancestor folder, setting the key project where
/// Cloud KMS Autokey should create new
/// [CryptoKeys][google.cloud.kms.v1.CryptoKey]. See documentation for additional
/// prerequisites. To check what key project, if any, is currently configured on
/// a resource project's ancestor folder, see
/// [ShowEffectiveAutokeyConfig][google.cloud.kms.v1.AutokeyAdmin.ShowEffectiveAutokeyConfig].
///
/// [google.cloud.kms.v1.AutokeyAdmin.ShowEffectiveAutokeyConfig]: <doc:AutokeyAdmin/showEffectiveAutokeyConfig(request:)>
/// [google.cloud.kms.v1.AutokeyAdmin.UpdateAutokeyConfig]: <doc:AutokeyAdmin/updateAutokeyConfig(request:)>
/// [google.cloud.kms.v1.CryptoKey]: <doc:CryptoKey>
/// [google.cloud.kms.v1.KeyHandle]: <doc:KeyHandle>
///
/// @Snippet(path: "AutokeyQuickstart")
public class AutokeyClient: Clients.AutokeyProtocol {
  let inner: any Clients.AutokeyStub
  let pollingErrorPolicy: GoogleCloudGax.PollingErrorPolicy
  let pollingBackoffPolicy: GoogleCloudGax.BackoffPolicy

  /// Creates a new `AutokeyClient` instance.
  public init(_ options: GoogleCloudGax.ClientOptions = .init()) throws {
    var inner: any Clients.AutokeyStub = try Clients.AutokeyTransport(options)
    inner = Clients.AutokeyRetry(inner, options: options)
    if let logger = options.logger {
      inner = Clients.AutokeyLogging(inner, logger: logger)
    }
    self.inner = inner
    self.pollingErrorPolicy = options.pollingErrorPolicy
    self.pollingBackoffPolicy = options.pollingBackoffPolicy
  }

  /// Creates a new [KeyHandle][google.cloud.kms.v1.KeyHandle], triggering the
  /// provisioning of a new [CryptoKey][google.cloud.kms.v1.CryptoKey] for CMEK
  /// use with the given resource type in the configured key project and the same
  /// location. [GetOperation][google.longrunning.Operations.GetOperation] should
  /// be used to resolve the resulting long-running operation and get the
  /// resulting [KeyHandle][google.cloud.kms.v1.KeyHandle] and
  /// [CryptoKey][google.cloud.kms.v1.CryptoKey].
  ///
  /// [google.cloud.kms.v1.CryptoKey]: <doc:CryptoKey>
  /// [google.cloud.kms.v1.KeyHandle]: <doc:KeyHandle>
  ///
  /// @Snippet(path: "Autokey_CreateKeyHandle")
  public func createKeyHandle(
    request: CreateKeyHandleRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleLongRunning.Operation {
    try await self.inner.createKeyHandle(request: request, options: options)
  }

  /// Creates a new [KeyHandle][google.cloud.kms.v1.KeyHandle], triggering the
  /// provisioning of a new [CryptoKey][google.cloud.kms.v1.CryptoKey] for CMEK
  /// use with the given resource type in the configured key project and the same
  /// location. [GetOperation][google.longrunning.Operations.GetOperation] should
  /// be used to resolve the resulting long-running operation and get the
  /// resulting [KeyHandle][google.cloud.kms.v1.KeyHandle] and
  /// [CryptoKey][google.cloud.kms.v1.CryptoKey].
  ///
  /// [google.cloud.kms.v1.CryptoKey]: <doc:CryptoKey>
  /// [google.cloud.kms.v1.KeyHandle]: <doc:KeyHandle>
  ///
  /// @Snippet(path: "Autokey_CreateKeyHandle")
  public func createKeyHandle(
    withPolling: CreateKeyHandleRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> any GoogleCloudGax.PollableOperation<KeyHandle> {
    let extractStatus = {
      (op: GoogleLongRunning.Operation) throws
        -> GoogleCloudGax._PollableOperationImpl<KeyHandle>.State in
      guard op.done else {
        return .init(done: false, result: nil)
      }

      switch op.result {
      case .response(let anyValue):
        guard let anyValueUnwrapped = anyValue else {
          return .init(
            done: true,
            result: .failure(
              GoogleCloudGax.RequestError.binding(
                "Operation completed but response value was missing")))
        }
        let response = try KeyHandle(fromAny: anyValueUnwrapped)
        return .init(done: true, result: .success(response))
      case .error(let status):
        guard let statusUnwrapped = status else {
          return .init(
            done: true,
            result: .failure(
              GoogleCloudGax.RequestError.binding("Operation completed but error value was missing")
            ))
        }
        let error = GoogleCloudGax.RequestError.service(
          GoogleCloudGax.ServiceError(
            code: GoogleRpc.Code(intValue: Int(statusUnwrapped.code)),
            message: statusUnwrapped.message))
        return .init(done: true, result: .failure(error))
      case .none:
        return .init(
          done: true,
          result: .failure(
            GoogleCloudGax.RequestError.binding("Operation completed but result was missing")))
      }
    }
    let rawOp = try await self.createKeyHandle(request: withPolling, options: options)
    let initialState = try extractStatus(rawOp)
    let poll = { () async throws -> GoogleCloudGax._PollableOperationImpl<KeyHandle>.State in
      let op = try await self.getOperation(
        request: .init().with { $0.name = 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,
    )
  }

  /// Returns the [KeyHandle][google.cloud.kms.v1.KeyHandle].
  ///
  /// [google.cloud.kms.v1.KeyHandle]: <doc:KeyHandle>
  ///
  /// @Snippet(path: "Autokey_GetKeyHandle")
  public func getKeyHandle(
    request: GetKeyHandleRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleCloudKMSV1.KeyHandle {
    try await self.inner.getKeyHandle(request: request, options: options)
  }

  /// Lists [KeyHandles][google.cloud.kms.v1.KeyHandle].
  ///
  /// [google.cloud.kms.v1.KeyHandle]: <doc:KeyHandle>
  ///
  /// @Snippet(path: "Autokey_ListKeyHandles")
  public func listKeyHandles(
    request: ListKeyHandlesRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleCloudKMSV1.ListKeyHandlesResponse {
    try await self.inner.listKeyHandles(request: request, options: options)
  }

  /// Lists [KeyHandles][google.cloud.kms.v1.KeyHandle].
  ///
  /// [google.cloud.kms.v1.KeyHandle]: <doc:KeyHandle>
  ///
  /// @Snippet(path: "Autokey_ListKeyHandles")
  public func listKeyHandles(
    byItem: ListKeyHandlesRequest, options: GoogleCloudGax.RequestOptions
  ) throws -> any AsyncSequence<KeyHandle, Swift.Error> {
    let listRpc = { (token: Swift.String) async throws -> GoogleCloudKMSV1.ListKeyHandlesResponse in
      var request = byItem
      request.pageToken = token
      return try await self.listKeyHandles(request: request, options: options)
    }
    return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
  }

  /// Lists information about the supported locations for this service.
  ///
  /// This method lists locations based on the resource scope provided in
  /// the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: *
  /// **Global locations**: If `name` is empty, the method lists the
  /// public locations available to all projects. * **Project-specific
  /// locations**: If `name` follows the format
  /// `projects/{project}`, the method lists locations visible to that
  /// specific project. This includes public, private, or other
  /// project-specific locations enabled for the project.
  ///
  /// For gRPC and client library implementations, the resource name is
  /// passed as the `name` field. For direct service calls, the resource
  /// name is
  /// incorporated into the request path based on the specific service
  /// implementation and version.
  ///
  /// [google.cloud.location.ListLocationsRequest.name]: https://www.google.com/search?q=Swift+google.cloud.location+GoogleCloudLocation.ListLocationsRequest/name
  ///
  /// @Snippet(path: "Autokey_ListLocations")
  public func listLocations(
    request: GoogleCloudLocation.ListLocationsRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleCloudLocation.ListLocationsResponse {
    try await self.inner.listLocations(request: request, options: options)
  }

  /// Lists information about the supported locations for this service.
  ///
  /// This method lists locations based on the resource scope provided in
  /// the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: *
  /// **Global locations**: If `name` is empty, the method lists the
  /// public locations available to all projects. * **Project-specific
  /// locations**: If `name` follows the format
  /// `projects/{project}`, the method lists locations visible to that
  /// specific project. This includes public, private, or other
  /// project-specific locations enabled for the project.
  ///
  /// For gRPC and client library implementations, the resource name is
  /// passed as the `name` field. For direct service calls, the resource
  /// name is
  /// incorporated into the request path based on the specific service
  /// implementation and version.
  ///
  /// [google.cloud.location.ListLocationsRequest.name]: https://www.google.com/search?q=Swift+google.cloud.location+GoogleCloudLocation.ListLocationsRequest/name
  ///
  /// @Snippet(path: "Autokey_ListLocations")
  public func listLocations(
    byItem: GoogleCloudLocation.ListLocationsRequest, options: GoogleCloudGax.RequestOptions
  ) throws -> any AsyncSequence<GoogleCloudLocation.Location, Swift.Error> {
    let listRpc = {
      (token: Swift.String) async throws -> GoogleCloudLocation.ListLocationsResponse in
      var request = byItem
      request.pageToken = token
      return try await self.listLocations(request: request, options: options)
    }
    return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
  }

  /// Gets information about a location.
  ///
  /// @Snippet(path: "Autokey_GetLocation")
  public func getLocation(
    request: GoogleCloudLocation.GetLocationRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleCloudLocation.Location {
    try await self.inner.getLocation(request: request, options: options)
  }

  /// Sets the access control policy on the specified resource. Replaces
  /// any existing policy.
  ///
  /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
  /// errors.
  ///
  /// @Snippet(path: "Autokey_SetIamPolicy")
  public func setIamPolicy(
    request: GoogleIAMV1.SetIamPolicyRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMV1.Policy {
    try await self.inner.setIamPolicy(request: request, options: options)
  }

  /// Gets the access control policy for a resource. Returns an empty policy
  /// if the resource exists and does not have a policy set.
  ///
  /// @Snippet(path: "Autokey_GetIamPolicy")
  public func getIamPolicy(
    request: GoogleIAMV1.GetIamPolicyRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMV1.Policy {
    try await self.inner.getIamPolicy(request: request, options: options)
  }

  /// Returns permissions that a caller has on the specified resource. If the
  /// resource does not exist, this will return an empty set of
  /// permissions, not a `NOT_FOUND` error.
  ///
  /// Note: This operation is designed to be used for building
  /// permission-aware UIs and command-line tools, not for authorization
  /// checking. This operation may "fail open" without warning.
  ///
  /// @Snippet(path: "Autokey_TestIamPermissions")
  public func testIamPermissions(
    request: GoogleIAMV1.TestIamPermissionsRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMV1.TestIamPermissionsResponse {
    try await self.inner.testIamPermissions(request: request, options: options)
  }

  /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
  ///
  /// [google.longrunning.Operations]: https://www.google.com/search?q=Swift+google.longrunning+Operations
  ///
  /// @Snippet(path: "Autokey_GetOperation")
  func getOperation(
    request: GoogleLongRunning.GetOperationRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleLongRunning.Operation {
    try await self.inner.getOperation(request: request, options: options)
  }
}

extension Clients {
  /// A Swift protocol to mock `AutokeyClient`.
  ///
  /// To mock `AutokeyClient` change your functions to receive
  /// `some AutokeyProtocol` or `any AutokeyProtocol`
  /// and pass a mock implementation in your tests.
  public protocol AutokeyProtocol {
    /// See `AutokeyClient.createKeyHandle`.
    func createKeyHandle(request: CreateKeyHandleRequest) async throws
      -> GoogleLongRunning.Operation

    /// See `AutokeyClient.createKeyHandle`.
    func createKeyHandle(withPolling: CreateKeyHandleRequest) async throws -> any GoogleCloudGax
      .PollableOperation<KeyHandle>

    /// See `AutokeyClient.createKeyHandle`.
    func createKeyHandle(
      parent: Swift.String,
      keyHandle: KeyHandle?,
      keyHandleId: Swift.String,
    ) async throws -> any GoogleCloudGax.PollableOperation<KeyHandle>

    /// See `AutokeyClient.getKeyHandle`.
    func getKeyHandle(request: GetKeyHandleRequest) async throws -> GoogleCloudKMSV1.KeyHandle

    /// See `AutokeyClient.getKeyHandle`.
    func getKeyHandle(
      name: Swift.String,
    ) async throws -> GoogleCloudKMSV1.KeyHandle

    /// See `AutokeyClient.listKeyHandles`.
    func listKeyHandles(request: ListKeyHandlesRequest) async throws
      -> GoogleCloudKMSV1.ListKeyHandlesResponse

    /// See `AutokeyClient.listKeyHandles`.
    func listKeyHandles(
      byItem: ListKeyHandlesRequest
    ) throws -> any AsyncSequence<KeyHandle, Swift.Error>

    /// See `AutokeyClient.listKeyHandles`.
    func listKeyHandles(
      parent: Swift.String,
    ) throws -> any AsyncSequence<KeyHandle, Swift.Error>

    /// See `AutokeyClient.listLocations`.
    func listLocations(request: GoogleCloudLocation.ListLocationsRequest) async throws
      -> GoogleCloudLocation.ListLocationsResponse

    /// See `AutokeyClient.listLocations`.
    func listLocations(
      byItem: GoogleCloudLocation.ListLocationsRequest
    ) throws -> any AsyncSequence<GoogleCloudLocation.Location, Swift.Error>

    /// See `AutokeyClient.getLocation`.
    func getLocation(request: GoogleCloudLocation.GetLocationRequest) async throws
      -> GoogleCloudLocation.Location

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

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

    /// See `AutokeyClient.testIamPermissions`.
    func testIamPermissions(request: GoogleIAMV1.TestIamPermissionsRequest) async throws
      -> GoogleIAMV1.TestIamPermissionsResponse

    /// See `AutokeyClient.createKeyHandle`.
    func createKeyHandle(
      request: CreateKeyHandleRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.Operation

    /// See `AutokeyClient.createKeyHandle`.
    func createKeyHandle(
      withPolling: CreateKeyHandleRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> any GoogleCloudGax.PollableOperation<KeyHandle>

    /// See `AutokeyClient.getKeyHandle`.
    func getKeyHandle(
      request: GetKeyHandleRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudKMSV1.KeyHandle

    /// See `AutokeyClient.listKeyHandles`.
    func listKeyHandles(
      request: ListKeyHandlesRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudKMSV1.ListKeyHandlesResponse

    /// See `AutokeyClient.listKeyHandles`.
    func listKeyHandles(
      byItem: ListKeyHandlesRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<KeyHandle, Swift.Error>

    /// See `AutokeyClient.listLocations`.
    func listLocations(
      request: GoogleCloudLocation.ListLocationsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudLocation.ListLocationsResponse

    /// See `AutokeyClient.listLocations`.
    func listLocations(
      byItem: GoogleCloudLocation.ListLocationsRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<GoogleCloudLocation.Location, Swift.Error>

    /// See `AutokeyClient.getLocation`.
    func getLocation(
      request: GoogleCloudLocation.GetLocationRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudLocation.Location

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

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

    /// See `AutokeyClient.testIamPermissions`.
    func testIamPermissions(
      request: GoogleIAMV1.TestIamPermissionsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleIAMV1.TestIamPermissionsResponse
  }
}

// Default implementations
extension Clients.AutokeyProtocol {
  public func createKeyHandle(request: CreateKeyHandleRequest) async throws
    -> GoogleLongRunning.Operation
  {
    try await self.createKeyHandle(request: request, options: .init())
  }

  public func createKeyHandle(
    request: CreateKeyHandleRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleLongRunning.Operation {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func createKeyHandle(withPolling: CreateKeyHandleRequest) async throws
    -> any GoogleCloudGax.PollableOperation<KeyHandle>
  {
    try await self.createKeyHandle(withPolling: withPolling, options: .init())
  }

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

  public func createKeyHandle(
    parent: Swift.String,
    keyHandle: KeyHandle?,
    keyHandleId: Swift.String,
  ) async throws -> any GoogleCloudGax.PollableOperation<KeyHandle> {
    let request = CreateKeyHandleRequest().with {
      $0.parent = parent
      $0.keyHandle = keyHandle
      $0.keyHandleId = keyHandleId
    }
    return try await self.createKeyHandle(withPolling: request)
  }

  public func getKeyHandle(request: GetKeyHandleRequest) async throws -> GoogleCloudKMSV1.KeyHandle
  {
    try await self.getKeyHandle(request: request, options: .init())
  }

  public func getKeyHandle(
    request: GetKeyHandleRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleCloudKMSV1.KeyHandle {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func getKeyHandle(
    name: Swift.String,
  ) async throws -> GoogleCloudKMSV1.KeyHandle {
    let request = GetKeyHandleRequest().with {
      $0.name = name
    }
    return try await self.getKeyHandle(request: request)
  }

  public func listKeyHandles(request: ListKeyHandlesRequest) async throws
    -> GoogleCloudKMSV1.ListKeyHandlesResponse
  {
    try await self.listKeyHandles(request: request, options: .init())
  }

  public func listKeyHandles(
    request: ListKeyHandlesRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleCloudKMSV1.ListKeyHandlesResponse {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func listKeyHandles(
    byItem: ListKeyHandlesRequest
  ) throws -> any AsyncSequence<KeyHandle, Swift.Error> {
    try self.listKeyHandles(byItem: byItem, options: .init())
  }

  public func listKeyHandles(
    byItem: ListKeyHandlesRequest, options: GoogleCloudGax.RequestOptions
  ) throws -> any AsyncSequence<KeyHandle, Swift.Error> {
    let listRpc = { (token: Swift.String) async throws -> GoogleCloudKMSV1.ListKeyHandlesResponse in
      throw GoogleCloudGax.RequestError.unimplemented
    }
    return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
  }

  public func listKeyHandles(
    parent: Swift.String,
  ) throws -> any AsyncSequence<KeyHandle, Swift.Error> {
    let request = ListKeyHandlesRequest().with {
      $0.parent = parent
    }
    return try self.listKeyHandles(byItem: request)
  }

  public func listLocations(request: GoogleCloudLocation.ListLocationsRequest) async throws
    -> GoogleCloudLocation.ListLocationsResponse
  {
    try await self.listLocations(request: request, options: .init())
  }

  public func listLocations(
    request: GoogleCloudLocation.ListLocationsRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleCloudLocation.ListLocationsResponse {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func listLocations(
    byItem: GoogleCloudLocation.ListLocationsRequest
  ) throws -> any AsyncSequence<GoogleCloudLocation.Location, Swift.Error> {
    try self.listLocations(byItem: byItem, options: .init())
  }

  public func listLocations(
    byItem: GoogleCloudLocation.ListLocationsRequest, options: GoogleCloudGax.RequestOptions
  ) throws -> any AsyncSequence<GoogleCloudLocation.Location, Swift.Error> {
    let listRpc = {
      (token: Swift.String) async throws -> GoogleCloudLocation.ListLocationsResponse in
      throw GoogleCloudGax.RequestError.unimplemented
    }
    return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
  }

  public func getLocation(request: GoogleCloudLocation.GetLocationRequest) async throws
    -> GoogleCloudLocation.Location
  {
    try await self.getLocation(request: request, options: .init())
  }

  public func getLocation(
    request: GoogleCloudLocation.GetLocationRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleCloudLocation.Location {
    throw GoogleCloudGax.RequestError.unimplemented
  }

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

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

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

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

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

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

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

  public func getOperation(
    request: GoogleLongRunning.GetOperationRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleLongRunning.Operation {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func getOperation(
    name: Swift.String,
  ) async throws -> GoogleLongRunning.Operation {
    let request = GoogleLongRunning.GetOperationRequest().with {
      $0.name = name
    }
    return try await self.getOperation(request: request)
  }
}
