// 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 GoogleCloudWkt
import GoogleIAMV1
import GoogleCloudGax

/// Creates and manages Identity and Access Management (IAM) resources.
///
/// You can use this service to work with all of the following resources:
///
/// * **Service accounts**, which identify an application or a virtual machine
///   (VM) instance rather than a person
/// * **Service account keys**, which service accounts use to authenticate with
///   Google APIs
/// * **IAM policies for service accounts**, which specify the roles that a
///   principal has for the service account
/// * **IAM custom roles**, which help you limit the number of permissions that
///   you grant to principals
///
/// In addition, you can use this service to complete the following tasks, among
/// others:
///
/// * Test whether a service account can use specific permissions
/// * Check which roles you can grant for a specific resource
/// * Lint, or validate, condition expressions in an IAM policy
///
/// When you read data from the IAM API, each read is eventually consistent. In
/// other words, if you write data with the IAM API, then immediately read that
/// data, the read operation might return an older version of the data. To deal
/// with this behavior, your application can retry the request with truncated
/// exponential backoff.
///
/// In contrast, writing data to the IAM API is sequentially consistent. In other
/// words, write operations are always processed in the order in which they were
/// received.
///
/// @Snippet(path: "IAMQuickstart")
public class IAMClient: Clients.IAMProtocol {
  let inner: any Clients.IAMStub

  /// Creates a new `IAMClient` instance.
  public init(_ options: GoogleCloudGax.ClientOptions = .init()) throws {
    var inner: any Clients.IAMStub = try Clients.IAMTransport(options)
    inner = Clients.IAMRetry(inner, options: options)
    if let logger = options.logger {
      inner = Clients.IAMLogging(inner, logger: logger)
    }
    self.inner = inner
  }

  /// Lists every [ServiceAccount][google.iam.admin.v1.ServiceAccount] that belongs to a specific project.
  ///
  /// [google.iam.admin.v1.ServiceAccount]: <doc:ServiceAccount>
  ///
  /// @Snippet(path: "IAM_ListServiceAccounts")
  public func listServiceAccounts(
    request: ListServiceAccountsRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMAdminV1.ListServiceAccountsResponse {
    try await self.inner.listServiceAccounts(request: request, options: options)
  }

  /// Lists every [ServiceAccount][google.iam.admin.v1.ServiceAccount] that belongs to a specific project.
  ///
  /// [google.iam.admin.v1.ServiceAccount]: <doc:ServiceAccount>
  ///
  /// @Snippet(path: "IAM_ListServiceAccounts")
  public func listServiceAccounts(
    byItem: ListServiceAccountsRequest, options: GoogleCloudGax.RequestOptions
  ) throws -> any AsyncSequence<ServiceAccount, Swift.Error> {
    let listRpc = {
      (token: Swift.String) async throws -> GoogleIAMAdminV1.ListServiceAccountsResponse in
      var request = byItem
      request.pageToken = token
      return try await self.listServiceAccounts(request: request, options: options)
    }
    return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
  }

  /// Gets a [ServiceAccount][google.iam.admin.v1.ServiceAccount].
  ///
  /// [google.iam.admin.v1.ServiceAccount]: <doc:ServiceAccount>
  ///
  /// @Snippet(path: "IAM_GetServiceAccount")
  public func getServiceAccount(
    request: GetServiceAccountRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMAdminV1.ServiceAccount {
    try await self.inner.getServiceAccount(request: request, options: options)
  }

  /// Creates a [ServiceAccount][google.iam.admin.v1.ServiceAccount].
  ///
  /// [google.iam.admin.v1.ServiceAccount]: <doc:ServiceAccount>
  ///
  /// @Snippet(path: "IAM_CreateServiceAccount")
  public func createServiceAccount(
    request: CreateServiceAccountRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMAdminV1.ServiceAccount {
    try await self.inner.createServiceAccount(request: request, options: options)
  }

  /// **Note:** We are in the process of deprecating this method. Use
  /// [PatchServiceAccount][google.iam.admin.v1.IAM.PatchServiceAccount] instead.
  ///
  /// Updates a [ServiceAccount][google.iam.admin.v1.ServiceAccount].
  ///
  /// You can update only the `display_name` field.
  ///
  /// [google.iam.admin.v1.IAM.PatchServiceAccount]: <doc:IAM/patchServiceAccount(request:)>
  /// [google.iam.admin.v1.ServiceAccount]: <doc:ServiceAccount>
  ///
  /// @Snippet(path: "IAM_UpdateServiceAccount")
  public func updateServiceAccount(
    request: ServiceAccount, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMAdminV1.ServiceAccount {
    try await self.inner.updateServiceAccount(request: request, options: options)
  }

  /// Patches a [ServiceAccount][google.iam.admin.v1.ServiceAccount].
  ///
  /// [google.iam.admin.v1.ServiceAccount]: <doc:ServiceAccount>
  ///
  /// @Snippet(path: "IAM_PatchServiceAccount")
  public func patchServiceAccount(
    request: PatchServiceAccountRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMAdminV1.ServiceAccount {
    try await self.inner.patchServiceAccount(request: request, options: options)
  }

  /// Deletes a [ServiceAccount][google.iam.admin.v1.ServiceAccount].
  ///
  /// **Warning:** After you delete a service account, you might not be able to
  /// undelete it. If you know that you need to re-enable the service account in
  /// the future, use [DisableServiceAccount][google.iam.admin.v1.IAM.DisableServiceAccount] instead.
  ///
  /// If you delete a service account, IAM permanently removes the service
  /// account 30 days later. Google Cloud cannot recover the service account
  /// after it is permanently removed, even if you file a support request.
  ///
  /// To help avoid unplanned outages, we recommend that you disable the service
  /// account before you delete it. Use [DisableServiceAccount][google.iam.admin.v1.IAM.DisableServiceAccount] to disable the
  /// service account, then wait at least 24 hours and watch for unintended
  /// consequences. If there are no unintended consequences, you can delete the
  /// service account.
  ///
  /// [google.iam.admin.v1.IAM.DisableServiceAccount]: <doc:IAM/disableServiceAccount(request:)>
  /// [google.iam.admin.v1.ServiceAccount]: <doc:ServiceAccount>
  ///
  /// @Snippet(path: "IAM_DeleteServiceAccount")
  public func deleteServiceAccount(
    request: DeleteServiceAccountRequest, options: GoogleCloudGax.RequestOptions
  ) async throws {
    try await self.inner.deleteServiceAccount(request: request, options: options)
  }

  /// Restores a deleted [ServiceAccount][google.iam.admin.v1.ServiceAccount].
  ///
  /// **Important:** It is not always possible to restore a deleted service
  /// account. Use this method only as a last resort.
  ///
  /// After you delete a service account, IAM permanently removes the service
  /// account 30 days later. There is no way to restore a deleted service account
  /// that has been permanently removed.
  ///
  /// [google.iam.admin.v1.ServiceAccount]: <doc:ServiceAccount>
  ///
  /// @Snippet(path: "IAM_UndeleteServiceAccount")
  public func undeleteServiceAccount(
    request: UndeleteServiceAccountRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMAdminV1.UndeleteServiceAccountResponse {
    try await self.inner.undeleteServiceAccount(request: request, options: options)
  }

  /// Enables a [ServiceAccount][google.iam.admin.v1.ServiceAccount] that was disabled by
  /// [DisableServiceAccount][google.iam.admin.v1.IAM.DisableServiceAccount].
  ///
  /// If the service account is already enabled, then this method has no effect.
  ///
  /// If the service account was disabled by other means—for example, if Google
  /// disabled the service account because it was compromised—you cannot use this
  /// method to enable the service account.
  ///
  /// [google.iam.admin.v1.IAM.DisableServiceAccount]: <doc:IAM/disableServiceAccount(request:)>
  /// [google.iam.admin.v1.ServiceAccount]: <doc:ServiceAccount>
  ///
  /// @Snippet(path: "IAM_EnableServiceAccount")
  public func enableServiceAccount(
    request: EnableServiceAccountRequest, options: GoogleCloudGax.RequestOptions
  ) async throws {
    try await self.inner.enableServiceAccount(request: request, options: options)
  }

  /// Disables a [ServiceAccount][google.iam.admin.v1.ServiceAccount] immediately.
  ///
  /// If an application uses the service account to authenticate, that
  /// application can no longer call Google APIs or access Google Cloud
  /// resources. Existing access tokens for the service account are rejected, and
  /// requests for new access tokens will fail.
  ///
  /// To re-enable the service account, use [EnableServiceAccount][google.iam.admin.v1.IAM.EnableServiceAccount]. After you
  /// re-enable the service account, its existing access tokens will be accepted,
  /// and you can request new access tokens.
  ///
  /// To help avoid unplanned outages, we recommend that you disable the service
  /// account before you delete it. Use this method to disable the service
  /// account, then wait at least 24 hours and watch for unintended consequences.
  /// If there are no unintended consequences, you can delete the service account
  /// with [DeleteServiceAccount][google.iam.admin.v1.IAM.DeleteServiceAccount].
  ///
  /// [google.iam.admin.v1.IAM.DeleteServiceAccount]: <doc:IAM/deleteServiceAccount(request:)>
  /// [google.iam.admin.v1.IAM.EnableServiceAccount]: <doc:IAM/enableServiceAccount(request:)>
  /// [google.iam.admin.v1.ServiceAccount]: <doc:ServiceAccount>
  ///
  /// @Snippet(path: "IAM_DisableServiceAccount")
  public func disableServiceAccount(
    request: DisableServiceAccountRequest, options: GoogleCloudGax.RequestOptions
  ) async throws {
    try await self.inner.disableServiceAccount(request: request, options: options)
  }

  /// Lists every [ServiceAccountKey][google.iam.admin.v1.ServiceAccountKey] for a service account.
  ///
  /// [google.iam.admin.v1.ServiceAccountKey]: <doc:ServiceAccountKey>
  ///
  /// @Snippet(path: "IAM_ListServiceAccountKeys")
  public func listServiceAccountKeys(
    request: ListServiceAccountKeysRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMAdminV1.ListServiceAccountKeysResponse {
    try await self.inner.listServiceAccountKeys(request: request, options: options)
  }

  /// Gets a [ServiceAccountKey][google.iam.admin.v1.ServiceAccountKey].
  ///
  /// [google.iam.admin.v1.ServiceAccountKey]: <doc:ServiceAccountKey>
  ///
  /// @Snippet(path: "IAM_GetServiceAccountKey")
  public func getServiceAccountKey(
    request: GetServiceAccountKeyRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMAdminV1.ServiceAccountKey {
    try await self.inner.getServiceAccountKey(request: request, options: options)
  }

  /// Creates a [ServiceAccountKey][google.iam.admin.v1.ServiceAccountKey].
  ///
  /// [google.iam.admin.v1.ServiceAccountKey]: <doc:ServiceAccountKey>
  ///
  /// @Snippet(path: "IAM_CreateServiceAccountKey")
  public func createServiceAccountKey(
    request: CreateServiceAccountKeyRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMAdminV1.ServiceAccountKey {
    try await self.inner.createServiceAccountKey(request: request, options: options)
  }

  /// Uploads the public key portion of a key pair that you manage, and
  /// associates the public key with a [ServiceAccount][google.iam.admin.v1.ServiceAccount].
  ///
  /// After you upload the public key, you can use the private key from the key
  /// pair as a service account key.
  ///
  /// [google.iam.admin.v1.ServiceAccount]: <doc:ServiceAccount>
  ///
  /// @Snippet(path: "IAM_UploadServiceAccountKey")
  public func uploadServiceAccountKey(
    request: UploadServiceAccountKeyRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMAdminV1.ServiceAccountKey {
    try await self.inner.uploadServiceAccountKey(request: request, options: options)
  }

  /// Deletes a [ServiceAccountKey][google.iam.admin.v1.ServiceAccountKey]. Deleting a service account key does not
  /// revoke short-lived credentials that have been issued based on the service
  /// account key.
  ///
  /// [google.iam.admin.v1.ServiceAccountKey]: <doc:ServiceAccountKey>
  ///
  /// @Snippet(path: "IAM_DeleteServiceAccountKey")
  public func deleteServiceAccountKey(
    request: DeleteServiceAccountKeyRequest, options: GoogleCloudGax.RequestOptions
  ) async throws {
    try await self.inner.deleteServiceAccountKey(request: request, options: options)
  }

  /// Disable a [ServiceAccountKey][google.iam.admin.v1.ServiceAccountKey]. A disabled service account key can be
  /// re-enabled with [EnableServiceAccountKey][google.iam.admin.v1.IAM.EnableServiceAccountKey].
  ///
  /// [google.iam.admin.v1.IAM.EnableServiceAccountKey]: <doc:IAM/enableServiceAccountKey(request:)>
  /// [google.iam.admin.v1.ServiceAccountKey]: <doc:ServiceAccountKey>
  ///
  /// @Snippet(path: "IAM_DisableServiceAccountKey")
  public func disableServiceAccountKey(
    request: DisableServiceAccountKeyRequest, options: GoogleCloudGax.RequestOptions
  ) async throws {
    try await self.inner.disableServiceAccountKey(request: request, options: options)
  }

  /// Enable a [ServiceAccountKey][google.iam.admin.v1.ServiceAccountKey].
  ///
  /// [google.iam.admin.v1.ServiceAccountKey]: <doc:ServiceAccountKey>
  ///
  /// @Snippet(path: "IAM_EnableServiceAccountKey")
  public func enableServiceAccountKey(
    request: EnableServiceAccountKeyRequest, options: GoogleCloudGax.RequestOptions
  ) async throws {
    try await self.inner.enableServiceAccountKey(request: request, options: options)
  }

  /// **Note:** This method is deprecated. Use the
  /// [`signBlob`](https://cloud.google.com/iam/help/rest-credentials/v1/projects.serviceAccounts/signBlob)
  /// method in the IAM Service Account Credentials API instead. If you currently
  /// use this method, see the [migration
  /// guide](https://cloud.google.com/iam/help/credentials/migrate-api) for
  /// instructions.
  ///
  /// Signs a blob using the system-managed private key for a [ServiceAccount][google.iam.admin.v1.ServiceAccount].
  ///
  /// [google.iam.admin.v1.ServiceAccount]: <doc:ServiceAccount>
  ///
  /// @Snippet(path: "IAM_SignBlob")
  @available(*, deprecated)
  public func signBlob(
    request: SignBlobRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMAdminV1.SignBlobResponse {
    try await self.inner.signBlob(request: request, options: options)
  }

  /// **Note:** This method is deprecated. Use the
  /// [`signJwt`](https://cloud.google.com/iam/help/rest-credentials/v1/projects.serviceAccounts/signJwt)
  /// method in the IAM Service Account Credentials API instead. If you currently
  /// use this method, see the [migration
  /// guide](https://cloud.google.com/iam/help/credentials/migrate-api) for
  /// instructions.
  ///
  /// Signs a JSON Web Token (JWT) using the system-managed private key for a
  /// [ServiceAccount][google.iam.admin.v1.ServiceAccount].
  ///
  /// [google.iam.admin.v1.ServiceAccount]: <doc:ServiceAccount>
  ///
  /// @Snippet(path: "IAM_SignJwt")
  @available(*, deprecated)
  public func signJwt(
    request: SignJwtRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMAdminV1.SignJwtResponse {
    try await self.inner.signJwt(request: request, options: options)
  }

  /// Gets the IAM policy that is attached to a [ServiceAccount][google.iam.admin.v1.ServiceAccount]. This IAM
  /// policy specifies which principals have access to the service account.
  ///
  /// This method does not tell you whether the service account has been granted
  /// any roles on other resources. To check whether a service account has role
  /// grants on a resource, use the `getIamPolicy` method for that resource. For
  /// example, to view the role grants for a project, call the Resource Manager
  /// API's
  /// [`projects.getIamPolicy`](https://cloud.google.com/resource-manager/reference/rest/v1/projects/getIamPolicy)
  /// method.
  ///
  /// [google.iam.admin.v1.ServiceAccount]: <doc:ServiceAccount>
  ///
  /// @Snippet(path: "IAM_GetIamPolicy")
  public func getIamPolicy(
    request: GoogleIAMV1.GetIamPolicyRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMV1.Policy {
    try await self.inner.getIamPolicy(request: request, options: options)
  }

  /// Sets the IAM policy that is attached to a [ServiceAccount][google.iam.admin.v1.ServiceAccount].
  ///
  /// Use this method to grant or revoke access to the service account. For
  /// example, you could grant a principal the ability to impersonate the service
  /// account.
  ///
  /// This method does not enable the service account to access other resources.
  /// To grant roles to a service account on a resource, follow these steps:
  ///
  /// 1. Call the resource's `getIamPolicy` method to get its current IAM policy.
  /// 2. Edit the policy so that it binds the service account to an IAM role for
  /// the resource.
  /// 3. Call the resource's `setIamPolicy` method to update its IAM policy.
  ///
  /// For detailed instructions, see
  /// [Manage access to project, folders, and
  /// organizations](https://cloud.google.com/iam/help/service-accounts/granting-access-to-service-accounts)
  /// or [Manage access to other
  /// resources](https://cloud.google.com/iam/help/access/manage-other-resources).
  ///
  /// [google.iam.admin.v1.ServiceAccount]: <doc:ServiceAccount>
  ///
  /// @Snippet(path: "IAM_SetIamPolicy")
  public func setIamPolicy(
    request: GoogleIAMV1.SetIamPolicyRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMV1.Policy {
    try await self.inner.setIamPolicy(request: request, options: options)
  }

  /// Tests whether the caller has the specified permissions on a
  /// [ServiceAccount][google.iam.admin.v1.ServiceAccount].
  ///
  /// [google.iam.admin.v1.ServiceAccount]: <doc:ServiceAccount>
  ///
  /// @Snippet(path: "IAM_TestIamPermissions")
  public func testIamPermissions(
    request: GoogleIAMV1.TestIamPermissionsRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMV1.TestIamPermissionsResponse {
    try await self.inner.testIamPermissions(request: request, options: options)
  }

  /// Lists roles that can be granted on a Google Cloud resource. A role is
  /// grantable if the IAM policy for the resource can contain bindings to the
  /// role.
  ///
  /// @Snippet(path: "IAM_QueryGrantableRoles")
  public func queryGrantableRoles(
    request: QueryGrantableRolesRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMAdminV1.QueryGrantableRolesResponse {
    try await self.inner.queryGrantableRoles(request: request, options: options)
  }

  /// Lists roles that can be granted on a Google Cloud resource. A role is
  /// grantable if the IAM policy for the resource can contain bindings to the
  /// role.
  ///
  /// @Snippet(path: "IAM_QueryGrantableRoles")
  public func queryGrantableRoles(
    byItem: QueryGrantableRolesRequest, options: GoogleCloudGax.RequestOptions
  ) throws -> any AsyncSequence<Role, Swift.Error> {
    let listRpc = {
      (token: Swift.String) async throws -> GoogleIAMAdminV1.QueryGrantableRolesResponse in
      var request = byItem
      request.pageToken = token
      return try await self.queryGrantableRoles(request: request, options: options)
    }
    return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
  }

  /// Lists every predefined [Role][google.iam.admin.v1.Role] that IAM supports, or every custom role
  /// that is defined for an organization or project.
  ///
  /// [google.iam.admin.v1.Role]: <doc:Role>
  ///
  /// @Snippet(path: "IAM_ListRoles")
  public func listRoles(
    request: ListRolesRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMAdminV1.ListRolesResponse {
    try await self.inner.listRoles(request: request, options: options)
  }

  /// Lists every predefined [Role][google.iam.admin.v1.Role] that IAM supports, or every custom role
  /// that is defined for an organization or project.
  ///
  /// [google.iam.admin.v1.Role]: <doc:Role>
  ///
  /// @Snippet(path: "IAM_ListRoles")
  public func listRoles(
    byItem: ListRolesRequest, options: GoogleCloudGax.RequestOptions
  ) throws -> any AsyncSequence<Role, Swift.Error> {
    let listRpc = { (token: Swift.String) async throws -> GoogleIAMAdminV1.ListRolesResponse in
      var request = byItem
      request.pageToken = token
      return try await self.listRoles(request: request, options: options)
    }
    return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
  }

  /// Gets the definition of a [Role][google.iam.admin.v1.Role].
  ///
  /// [google.iam.admin.v1.Role]: <doc:Role>
  ///
  /// @Snippet(path: "IAM_GetRole")
  public func getRole(
    request: GetRoleRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMAdminV1.Role {
    try await self.inner.getRole(request: request, options: options)
  }

  /// Creates a new custom [Role][google.iam.admin.v1.Role].
  ///
  /// [google.iam.admin.v1.Role]: <doc:Role>
  ///
  /// @Snippet(path: "IAM_CreateRole")
  public func createRole(
    request: CreateRoleRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMAdminV1.Role {
    try await self.inner.createRole(request: request, options: options)
  }

  /// Updates the definition of a custom [Role][google.iam.admin.v1.Role].
  ///
  /// [google.iam.admin.v1.Role]: <doc:Role>
  ///
  /// @Snippet(path: "IAM_UpdateRole")
  public func updateRole(
    request: UpdateRoleRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMAdminV1.Role {
    try await self.inner.updateRole(request: request, options: options)
  }

  /// Deletes a custom [Role][google.iam.admin.v1.Role].
  ///
  /// When you delete a custom role, the following changes occur immediately:
  ///
  /// * You cannot bind a principal to the custom role in an IAM
  /// [Policy][google.iam.v1.Policy].
  /// * Existing bindings to the custom role are not changed, but they have no
  /// effect.
  /// * By default, the response from [ListRoles][google.iam.admin.v1.IAM.ListRoles] does not include the custom
  /// role.
  ///
  /// You have 7 days to undelete the custom role. After 7 days, the following
  /// changes occur:
  ///
  /// * The custom role is permanently deleted and cannot be recovered.
  /// * If an IAM policy contains a binding to the custom role, the binding is
  /// permanently removed.
  ///
  /// [google.iam.admin.v1.IAM.ListRoles]: <doc:IAM/listRoles(request:)>
  /// [google.iam.admin.v1.Role]: <doc:Role>
  /// [google.iam.v1.Policy]: https://www.google.com/search?q=Swift+google.iam.v1+GoogleIAMV1.Policy
  ///
  /// @Snippet(path: "IAM_DeleteRole")
  public func deleteRole(
    request: DeleteRoleRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMAdminV1.Role {
    try await self.inner.deleteRole(request: request, options: options)
  }

  /// Undeletes a custom [Role][google.iam.admin.v1.Role].
  ///
  /// [google.iam.admin.v1.Role]: <doc:Role>
  ///
  /// @Snippet(path: "IAM_UndeleteRole")
  public func undeleteRole(
    request: UndeleteRoleRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMAdminV1.Role {
    try await self.inner.undeleteRole(request: request, options: options)
  }

  /// Lists every permission that you can test on a resource. A permission is
  /// testable if you can check whether a principal has that permission on the
  /// resource.
  ///
  /// @Snippet(path: "IAM_QueryTestablePermissions")
  public func queryTestablePermissions(
    request: QueryTestablePermissionsRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMAdminV1.QueryTestablePermissionsResponse {
    try await self.inner.queryTestablePermissions(request: request, options: options)
  }

  /// Lists every permission that you can test on a resource. A permission is
  /// testable if you can check whether a principal has that permission on the
  /// resource.
  ///
  /// @Snippet(path: "IAM_QueryTestablePermissions")
  public func queryTestablePermissions(
    byItem: QueryTestablePermissionsRequest, options: GoogleCloudGax.RequestOptions
  ) throws -> any AsyncSequence<Permission, Swift.Error> {
    let listRpc = {
      (token: Swift.String) async throws -> GoogleIAMAdminV1.QueryTestablePermissionsResponse in
      var request = byItem
      request.pageToken = token
      return try await self.queryTestablePermissions(request: request, options: options)
    }
    return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
  }

  /// Returns a list of services that allow you to opt into audit logs that are
  /// not generated by default.
  ///
  /// To learn more about audit logs, see the [Logging
  /// documentation](https://cloud.google.com/logging/docs/audit).
  ///
  /// @Snippet(path: "IAM_QueryAuditableServices")
  public func queryAuditableServices(
    request: QueryAuditableServicesRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMAdminV1.QueryAuditableServicesResponse {
    try await self.inner.queryAuditableServices(request: request, options: options)
  }

  /// Lints, or validates, an IAM policy. Currently checks the
  /// [google.iam.v1.Binding.condition][google.iam.v1.Binding.condition] field, which contains a condition
  /// expression for a role binding.
  ///
  /// Successful calls to this method always return an HTTP `200 OK` status code,
  /// even if the linter detects an issue in the IAM policy.
  ///
  /// [google.iam.v1.Binding.condition]: https://www.google.com/search?q=Swift+google.iam.v1+GoogleIAMV1.Binding/condition
  ///
  /// @Snippet(path: "IAM_LintPolicy")
  public func lintPolicy(
    request: LintPolicyRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMAdminV1.LintPolicyResponse {
    try await self.inner.lintPolicy(request: request, options: options)
  }
}

extension Clients {
  /// A Swift protocol to mock `IAMClient`.
  ///
  /// To mock `IAMClient` change your functions to receive
  /// `some IAMProtocol` or `any IAMProtocol`
  /// and pass a mock implementation in your tests.
  public protocol IAMProtocol {
    /// See `IAMClient.listServiceAccounts`.
    func listServiceAccounts(request: ListServiceAccountsRequest) async throws
      -> GoogleIAMAdminV1.ListServiceAccountsResponse

    /// See `IAMClient.listServiceAccounts`.
    func listServiceAccounts(
      byItem: ListServiceAccountsRequest
    ) throws -> any AsyncSequence<ServiceAccount, Swift.Error>

    /// See `IAMClient.listServiceAccounts`.
    func listServiceAccounts(
      name: Swift.String,
    ) throws -> any AsyncSequence<ServiceAccount, Swift.Error>

    /// See `IAMClient.getServiceAccount`.
    func getServiceAccount(request: GetServiceAccountRequest) async throws
      -> GoogleIAMAdminV1.ServiceAccount

    /// See `IAMClient.getServiceAccount`.
    func getServiceAccount(
      name: Swift.String,
    ) async throws -> GoogleIAMAdminV1.ServiceAccount

    /// See `IAMClient.createServiceAccount`.
    func createServiceAccount(request: CreateServiceAccountRequest) async throws
      -> GoogleIAMAdminV1.ServiceAccount

    /// See `IAMClient.createServiceAccount`.
    func createServiceAccount(
      name: Swift.String,
      accountId: Swift.String,
      serviceAccount: ServiceAccount?,
    ) async throws -> GoogleIAMAdminV1.ServiceAccount

    /// See `IAMClient.updateServiceAccount`.
    func updateServiceAccount(request: ServiceAccount) async throws
      -> GoogleIAMAdminV1.ServiceAccount

    /// See `IAMClient.patchServiceAccount`.
    func patchServiceAccount(request: PatchServiceAccountRequest) async throws
      -> GoogleIAMAdminV1.ServiceAccount

    /// See `IAMClient.deleteServiceAccount`.
    func deleteServiceAccount(request: DeleteServiceAccountRequest) async throws

    /// See `IAMClient.deleteServiceAccount`.
    func deleteServiceAccount(
      name: Swift.String,
    ) async throws

    /// See `IAMClient.undeleteServiceAccount`.
    func undeleteServiceAccount(request: UndeleteServiceAccountRequest) async throws
      -> GoogleIAMAdminV1.UndeleteServiceAccountResponse

    /// See `IAMClient.enableServiceAccount`.
    func enableServiceAccount(request: EnableServiceAccountRequest) async throws

    /// See `IAMClient.disableServiceAccount`.
    func disableServiceAccount(request: DisableServiceAccountRequest) async throws

    /// See `IAMClient.listServiceAccountKeys`.
    func listServiceAccountKeys(request: ListServiceAccountKeysRequest) async throws
      -> GoogleIAMAdminV1.ListServiceAccountKeysResponse

    /// See `IAMClient.listServiceAccountKeys`.
    func listServiceAccountKeys(
      name: Swift.String,
      keyTypes: [ListServiceAccountKeysRequest.KeyType],
    ) async throws -> GoogleIAMAdminV1.ListServiceAccountKeysResponse

    /// See `IAMClient.getServiceAccountKey`.
    func getServiceAccountKey(request: GetServiceAccountKeyRequest) async throws
      -> GoogleIAMAdminV1.ServiceAccountKey

    /// See `IAMClient.getServiceAccountKey`.
    func getServiceAccountKey(
      name: Swift.String,
      publicKeyType: ServiceAccountPublicKeyType,
    ) async throws -> GoogleIAMAdminV1.ServiceAccountKey

    /// See `IAMClient.createServiceAccountKey`.
    func createServiceAccountKey(request: CreateServiceAccountKeyRequest) async throws
      -> GoogleIAMAdminV1.ServiceAccountKey

    /// See `IAMClient.createServiceAccountKey`.
    func createServiceAccountKey(
      name: Swift.String,
      privateKeyType: ServiceAccountPrivateKeyType,
      keyAlgorithm: ServiceAccountKeyAlgorithm,
    ) async throws -> GoogleIAMAdminV1.ServiceAccountKey

    /// See `IAMClient.uploadServiceAccountKey`.
    func uploadServiceAccountKey(request: UploadServiceAccountKeyRequest) async throws
      -> GoogleIAMAdminV1.ServiceAccountKey

    /// See `IAMClient.deleteServiceAccountKey`.
    func deleteServiceAccountKey(request: DeleteServiceAccountKeyRequest) async throws

    /// See `IAMClient.deleteServiceAccountKey`.
    func deleteServiceAccountKey(
      name: Swift.String,
    ) async throws

    /// See `IAMClient.disableServiceAccountKey`.
    func disableServiceAccountKey(request: DisableServiceAccountKeyRequest) async throws

    /// See `IAMClient.disableServiceAccountKey`.
    func disableServiceAccountKey(
      name: Swift.String,
    ) async throws

    /// See `IAMClient.enableServiceAccountKey`.
    func enableServiceAccountKey(request: EnableServiceAccountKeyRequest) async throws

    /// See `IAMClient.enableServiceAccountKey`.
    func enableServiceAccountKey(
      name: Swift.String,
    ) async throws

    /// See `IAMClient.signBlob`.
    @available(*, deprecated)
    func signBlob(request: SignBlobRequest) async throws -> GoogleIAMAdminV1.SignBlobResponse

    /// See `IAMClient.signBlob`.
    @available(*, deprecated)
    func signBlob(
      name: Swift.String,
      bytesToSign: Foundation.Data,
    ) async throws -> GoogleIAMAdminV1.SignBlobResponse

    /// See `IAMClient.signJwt`.
    @available(*, deprecated)
    func signJwt(request: SignJwtRequest) async throws -> GoogleIAMAdminV1.SignJwtResponse

    /// See `IAMClient.signJwt`.
    @available(*, deprecated)
    func signJwt(
      name: Swift.String,
      payload: Swift.String,
    ) async throws -> GoogleIAMAdminV1.SignJwtResponse

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

    /// See `IAMClient.getIamPolicy`.
    func getIamPolicy(
      resource: Swift.String,
    ) async throws -> GoogleIAMV1.Policy

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

    /// See `IAMClient.setIamPolicy`.
    func setIamPolicy(
      resource: Swift.String,
      policy: GoogleIAMV1.Policy?,
    ) async throws -> GoogleIAMV1.Policy

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

    /// See `IAMClient.testIamPermissions`.
    func testIamPermissions(
      resource: Swift.String,
      permissions: [Swift.String],
    ) async throws -> GoogleIAMV1.TestIamPermissionsResponse

    /// See `IAMClient.queryGrantableRoles`.
    func queryGrantableRoles(request: QueryGrantableRolesRequest) async throws
      -> GoogleIAMAdminV1.QueryGrantableRolesResponse

    /// See `IAMClient.queryGrantableRoles`.
    func queryGrantableRoles(
      byItem: QueryGrantableRolesRequest
    ) throws -> any AsyncSequence<Role, Swift.Error>

    /// See `IAMClient.queryGrantableRoles`.
    func queryGrantableRoles(
      fullResourceName: Swift.String,
    ) throws -> any AsyncSequence<Role, Swift.Error>

    /// See `IAMClient.listRoles`.
    func listRoles(request: ListRolesRequest) async throws -> GoogleIAMAdminV1.ListRolesResponse

    /// See `IAMClient.listRoles`.
    func listRoles(
      byItem: ListRolesRequest
    ) throws -> any AsyncSequence<Role, Swift.Error>

    /// See `IAMClient.getRole`.
    func getRole(request: GetRoleRequest) async throws -> GoogleIAMAdminV1.Role

    /// See `IAMClient.createRole`.
    func createRole(request: CreateRoleRequest) async throws -> GoogleIAMAdminV1.Role

    /// See `IAMClient.updateRole`.
    func updateRole(request: UpdateRoleRequest) async throws -> GoogleIAMAdminV1.Role

    /// See `IAMClient.deleteRole`.
    func deleteRole(request: DeleteRoleRequest) async throws -> GoogleIAMAdminV1.Role

    /// See `IAMClient.undeleteRole`.
    func undeleteRole(request: UndeleteRoleRequest) async throws -> GoogleIAMAdminV1.Role

    /// See `IAMClient.queryTestablePermissions`.
    func queryTestablePermissions(request: QueryTestablePermissionsRequest) async throws
      -> GoogleIAMAdminV1.QueryTestablePermissionsResponse

    /// See `IAMClient.queryTestablePermissions`.
    func queryTestablePermissions(
      byItem: QueryTestablePermissionsRequest
    ) throws -> any AsyncSequence<Permission, Swift.Error>

    /// See `IAMClient.queryAuditableServices`.
    func queryAuditableServices(request: QueryAuditableServicesRequest) async throws
      -> GoogleIAMAdminV1.QueryAuditableServicesResponse

    /// See `IAMClient.lintPolicy`.
    func lintPolicy(request: LintPolicyRequest) async throws -> GoogleIAMAdminV1.LintPolicyResponse

    /// See `IAMClient.listServiceAccounts`.
    func listServiceAccounts(
      request: ListServiceAccountsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleIAMAdminV1.ListServiceAccountsResponse

    /// See `IAMClient.listServiceAccounts`.
    func listServiceAccounts(
      byItem: ListServiceAccountsRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<ServiceAccount, Swift.Error>

    /// See `IAMClient.getServiceAccount`.
    func getServiceAccount(
      request: GetServiceAccountRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleIAMAdminV1.ServiceAccount

    /// See `IAMClient.createServiceAccount`.
    func createServiceAccount(
      request: CreateServiceAccountRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleIAMAdminV1.ServiceAccount

    /// See `IAMClient.updateServiceAccount`.
    func updateServiceAccount(
      request: ServiceAccount, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleIAMAdminV1.ServiceAccount

    /// See `IAMClient.patchServiceAccount`.
    func patchServiceAccount(
      request: PatchServiceAccountRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleIAMAdminV1.ServiceAccount

    /// See `IAMClient.deleteServiceAccount`.
    func deleteServiceAccount(
      request: DeleteServiceAccountRequest, options: GoogleCloudGax.RequestOptions
    ) async throws

    /// See `IAMClient.undeleteServiceAccount`.
    func undeleteServiceAccount(
      request: UndeleteServiceAccountRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleIAMAdminV1.UndeleteServiceAccountResponse

    /// See `IAMClient.enableServiceAccount`.
    func enableServiceAccount(
      request: EnableServiceAccountRequest, options: GoogleCloudGax.RequestOptions
    ) async throws

    /// See `IAMClient.disableServiceAccount`.
    func disableServiceAccount(
      request: DisableServiceAccountRequest, options: GoogleCloudGax.RequestOptions
    ) async throws

    /// See `IAMClient.listServiceAccountKeys`.
    func listServiceAccountKeys(
      request: ListServiceAccountKeysRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleIAMAdminV1.ListServiceAccountKeysResponse

    /// See `IAMClient.getServiceAccountKey`.
    func getServiceAccountKey(
      request: GetServiceAccountKeyRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleIAMAdminV1.ServiceAccountKey

    /// See `IAMClient.createServiceAccountKey`.
    func createServiceAccountKey(
      request: CreateServiceAccountKeyRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleIAMAdminV1.ServiceAccountKey

    /// See `IAMClient.uploadServiceAccountKey`.
    func uploadServiceAccountKey(
      request: UploadServiceAccountKeyRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleIAMAdminV1.ServiceAccountKey

    /// See `IAMClient.deleteServiceAccountKey`.
    func deleteServiceAccountKey(
      request: DeleteServiceAccountKeyRequest, options: GoogleCloudGax.RequestOptions
    ) async throws

    /// See `IAMClient.disableServiceAccountKey`.
    func disableServiceAccountKey(
      request: DisableServiceAccountKeyRequest, options: GoogleCloudGax.RequestOptions
    ) async throws

    /// See `IAMClient.enableServiceAccountKey`.
    func enableServiceAccountKey(
      request: EnableServiceAccountKeyRequest, options: GoogleCloudGax.RequestOptions
    ) async throws

    /// See `IAMClient.signBlob`.
    @available(*, deprecated)
    func signBlob(
      request: SignBlobRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleIAMAdminV1.SignBlobResponse

    /// See `IAMClient.signJwt`.
    @available(*, deprecated)
    func signJwt(
      request: SignJwtRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleIAMAdminV1.SignJwtResponse

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

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

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

    /// See `IAMClient.queryGrantableRoles`.
    func queryGrantableRoles(
      request: QueryGrantableRolesRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleIAMAdminV1.QueryGrantableRolesResponse

    /// See `IAMClient.queryGrantableRoles`.
    func queryGrantableRoles(
      byItem: QueryGrantableRolesRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<Role, Swift.Error>

    /// See `IAMClient.listRoles`.
    func listRoles(
      request: ListRolesRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleIAMAdminV1.ListRolesResponse

    /// See `IAMClient.listRoles`.
    func listRoles(
      byItem: ListRolesRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<Role, Swift.Error>

    /// See `IAMClient.getRole`.
    func getRole(
      request: GetRoleRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleIAMAdminV1.Role

    /// See `IAMClient.createRole`.
    func createRole(
      request: CreateRoleRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleIAMAdminV1.Role

    /// See `IAMClient.updateRole`.
    func updateRole(
      request: UpdateRoleRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleIAMAdminV1.Role

    /// See `IAMClient.deleteRole`.
    func deleteRole(
      request: DeleteRoleRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleIAMAdminV1.Role

    /// See `IAMClient.undeleteRole`.
    func undeleteRole(
      request: UndeleteRoleRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleIAMAdminV1.Role

    /// See `IAMClient.queryTestablePermissions`.
    func queryTestablePermissions(
      request: QueryTestablePermissionsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleIAMAdminV1.QueryTestablePermissionsResponse

    /// See `IAMClient.queryTestablePermissions`.
    func queryTestablePermissions(
      byItem: QueryTestablePermissionsRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<Permission, Swift.Error>

    /// See `IAMClient.queryAuditableServices`.
    func queryAuditableServices(
      request: QueryAuditableServicesRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleIAMAdminV1.QueryAuditableServicesResponse

    /// See `IAMClient.lintPolicy`.
    func lintPolicy(
      request: LintPolicyRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleIAMAdminV1.LintPolicyResponse
  }
}

// Default implementations
extension Clients.IAMProtocol {
  public func listServiceAccounts(request: ListServiceAccountsRequest) async throws
    -> GoogleIAMAdminV1.ListServiceAccountsResponse
  {
    try await self.listServiceAccounts(request: request, options: .init())
  }

  public func listServiceAccounts(
    request: ListServiceAccountsRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMAdminV1.ListServiceAccountsResponse {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func listServiceAccounts(
    byItem: ListServiceAccountsRequest
  ) throws -> any AsyncSequence<ServiceAccount, Swift.Error> {
    try self.listServiceAccounts(byItem: byItem, options: .init())
  }

  public func listServiceAccounts(
    byItem: ListServiceAccountsRequest, options: GoogleCloudGax.RequestOptions
  ) throws -> any AsyncSequence<ServiceAccount, Swift.Error> {
    let listRpc = {
      (token: Swift.String) async throws -> GoogleIAMAdminV1.ListServiceAccountsResponse in
      throw GoogleCloudGax.RequestError.unimplemented
    }
    return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
  }

  public func listServiceAccounts(
    name: Swift.String,
  ) throws -> any AsyncSequence<ServiceAccount, Swift.Error> {
    let request = ListServiceAccountsRequest().with {
      $0.name = name
    }
    return try self.listServiceAccounts(byItem: request)
  }

  public func getServiceAccount(request: GetServiceAccountRequest) async throws
    -> GoogleIAMAdminV1.ServiceAccount
  {
    try await self.getServiceAccount(request: request, options: .init())
  }

  public func getServiceAccount(
    request: GetServiceAccountRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMAdminV1.ServiceAccount {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func getServiceAccount(
    name: Swift.String,
  ) async throws -> GoogleIAMAdminV1.ServiceAccount {
    let request = GetServiceAccountRequest().with {
      $0.name = name
    }
    return try await self.getServiceAccount(request: request)
  }

  public func createServiceAccount(request: CreateServiceAccountRequest) async throws
    -> GoogleIAMAdminV1.ServiceAccount
  {
    try await self.createServiceAccount(request: request, options: .init())
  }

  public func createServiceAccount(
    request: CreateServiceAccountRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMAdminV1.ServiceAccount {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func createServiceAccount(
    name: Swift.String,
    accountId: Swift.String,
    serviceAccount: ServiceAccount?,
  ) async throws -> GoogleIAMAdminV1.ServiceAccount {
    let request = CreateServiceAccountRequest().with {
      $0.name = name
      $0.accountId = accountId
      $0.serviceAccount = serviceAccount
    }
    return try await self.createServiceAccount(request: request)
  }

  public func updateServiceAccount(request: ServiceAccount) async throws
    -> GoogleIAMAdminV1.ServiceAccount
  {
    try await self.updateServiceAccount(request: request, options: .init())
  }

  public func updateServiceAccount(
    request: ServiceAccount, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMAdminV1.ServiceAccount {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func patchServiceAccount(request: PatchServiceAccountRequest) async throws
    -> GoogleIAMAdminV1.ServiceAccount
  {
    try await self.patchServiceAccount(request: request, options: .init())
  }

  public func patchServiceAccount(
    request: PatchServiceAccountRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMAdminV1.ServiceAccount {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func deleteServiceAccount(request: DeleteServiceAccountRequest) async throws {
    try await self.deleteServiceAccount(request: request, options: .init())
  }

  public func deleteServiceAccount(
    request: DeleteServiceAccountRequest, options: GoogleCloudGax.RequestOptions
  ) async throws {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func deleteServiceAccount(
    name: Swift.String,
  ) async throws {
    let request = DeleteServiceAccountRequest().with {
      $0.name = name
    }
    try await self.deleteServiceAccount(request: request)
  }

  public func undeleteServiceAccount(request: UndeleteServiceAccountRequest) async throws
    -> GoogleIAMAdminV1.UndeleteServiceAccountResponse
  {
    try await self.undeleteServiceAccount(request: request, options: .init())
  }

  public func undeleteServiceAccount(
    request: UndeleteServiceAccountRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMAdminV1.UndeleteServiceAccountResponse {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func enableServiceAccount(request: EnableServiceAccountRequest) async throws {
    try await self.enableServiceAccount(request: request, options: .init())
  }

  public func enableServiceAccount(
    request: EnableServiceAccountRequest, options: GoogleCloudGax.RequestOptions
  ) async throws {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func disableServiceAccount(request: DisableServiceAccountRequest) async throws {
    try await self.disableServiceAccount(request: request, options: .init())
  }

  public func disableServiceAccount(
    request: DisableServiceAccountRequest, options: GoogleCloudGax.RequestOptions
  ) async throws {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func listServiceAccountKeys(request: ListServiceAccountKeysRequest) async throws
    -> GoogleIAMAdminV1.ListServiceAccountKeysResponse
  {
    try await self.listServiceAccountKeys(request: request, options: .init())
  }

  public func listServiceAccountKeys(
    request: ListServiceAccountKeysRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMAdminV1.ListServiceAccountKeysResponse {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func listServiceAccountKeys(
    name: Swift.String,
    keyTypes: [ListServiceAccountKeysRequest.KeyType],
  ) async throws -> GoogleIAMAdminV1.ListServiceAccountKeysResponse {
    let request = ListServiceAccountKeysRequest().with {
      $0.name = name
      $0.keyTypes = keyTypes
    }
    return try await self.listServiceAccountKeys(request: request)
  }

  public func getServiceAccountKey(request: GetServiceAccountKeyRequest) async throws
    -> GoogleIAMAdminV1.ServiceAccountKey
  {
    try await self.getServiceAccountKey(request: request, options: .init())
  }

  public func getServiceAccountKey(
    request: GetServiceAccountKeyRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMAdminV1.ServiceAccountKey {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func getServiceAccountKey(
    name: Swift.String,
    publicKeyType: ServiceAccountPublicKeyType,
  ) async throws -> GoogleIAMAdminV1.ServiceAccountKey {
    let request = GetServiceAccountKeyRequest().with {
      $0.name = name
      $0.publicKeyType = publicKeyType
    }
    return try await self.getServiceAccountKey(request: request)
  }

  public func createServiceAccountKey(request: CreateServiceAccountKeyRequest) async throws
    -> GoogleIAMAdminV1.ServiceAccountKey
  {
    try await self.createServiceAccountKey(request: request, options: .init())
  }

  public func createServiceAccountKey(
    request: CreateServiceAccountKeyRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMAdminV1.ServiceAccountKey {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func createServiceAccountKey(
    name: Swift.String,
    privateKeyType: ServiceAccountPrivateKeyType,
    keyAlgorithm: ServiceAccountKeyAlgorithm,
  ) async throws -> GoogleIAMAdminV1.ServiceAccountKey {
    let request = CreateServiceAccountKeyRequest().with {
      $0.name = name
      $0.privateKeyType = privateKeyType
      $0.keyAlgorithm = keyAlgorithm
    }
    return try await self.createServiceAccountKey(request: request)
  }

  public func uploadServiceAccountKey(request: UploadServiceAccountKeyRequest) async throws
    -> GoogleIAMAdminV1.ServiceAccountKey
  {
    try await self.uploadServiceAccountKey(request: request, options: .init())
  }

  public func uploadServiceAccountKey(
    request: UploadServiceAccountKeyRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMAdminV1.ServiceAccountKey {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func deleteServiceAccountKey(request: DeleteServiceAccountKeyRequest) async throws {
    try await self.deleteServiceAccountKey(request: request, options: .init())
  }

  public func deleteServiceAccountKey(
    request: DeleteServiceAccountKeyRequest, options: GoogleCloudGax.RequestOptions
  ) async throws {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func deleteServiceAccountKey(
    name: Swift.String,
  ) async throws {
    let request = DeleteServiceAccountKeyRequest().with {
      $0.name = name
    }
    try await self.deleteServiceAccountKey(request: request)
  }

  public func disableServiceAccountKey(request: DisableServiceAccountKeyRequest) async throws {
    try await self.disableServiceAccountKey(request: request, options: .init())
  }

  public func disableServiceAccountKey(
    request: DisableServiceAccountKeyRequest, options: GoogleCloudGax.RequestOptions
  ) async throws {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func disableServiceAccountKey(
    name: Swift.String,
  ) async throws {
    let request = DisableServiceAccountKeyRequest().with {
      $0.name = name
    }
    try await self.disableServiceAccountKey(request: request)
  }

  public func enableServiceAccountKey(request: EnableServiceAccountKeyRequest) async throws {
    try await self.enableServiceAccountKey(request: request, options: .init())
  }

  public func enableServiceAccountKey(
    request: EnableServiceAccountKeyRequest, options: GoogleCloudGax.RequestOptions
  ) async throws {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func enableServiceAccountKey(
    name: Swift.String,
  ) async throws {
    let request = EnableServiceAccountKeyRequest().with {
      $0.name = name
    }
    try await self.enableServiceAccountKey(request: request)
  }

  public func signBlob(request: SignBlobRequest) async throws -> GoogleIAMAdminV1.SignBlobResponse {
    try await self.signBlob(request: request, options: .init())
  }

  public func signBlob(
    request: SignBlobRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMAdminV1.SignBlobResponse {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func signBlob(
    name: Swift.String,
    bytesToSign: Foundation.Data,
  ) async throws -> GoogleIAMAdminV1.SignBlobResponse {
    let request = SignBlobRequest().with {
      $0.name = name
      $0.bytesToSign = bytesToSign
    }
    return try await self.signBlob(request: request)
  }

  public func signJwt(request: SignJwtRequest) async throws -> GoogleIAMAdminV1.SignJwtResponse {
    try await self.signJwt(request: request, options: .init())
  }

  public func signJwt(
    request: SignJwtRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMAdminV1.SignJwtResponse {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func signJwt(
    name: Swift.String,
    payload: Swift.String,
  ) async throws -> GoogleIAMAdminV1.SignJwtResponse {
    let request = SignJwtRequest().with {
      $0.name = name
      $0.payload = payload
    }
    return try await self.signJwt(request: request)
  }

  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 getIamPolicy(
    resource: Swift.String,
  ) async throws -> GoogleIAMV1.Policy {
    let request = GoogleIAMV1.GetIamPolicyRequest().with {
      $0.resource = resource
    }
    return try await self.getIamPolicy(request: request)
  }

  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 setIamPolicy(
    resource: Swift.String,
    policy: GoogleIAMV1.Policy?,
  ) async throws -> GoogleIAMV1.Policy {
    let request = GoogleIAMV1.SetIamPolicyRequest().with {
      $0.resource = resource
      $0.policy = policy
    }
    return try await self.setIamPolicy(request: request)
  }

  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 testIamPermissions(
    resource: Swift.String,
    permissions: [Swift.String],
  ) async throws -> GoogleIAMV1.TestIamPermissionsResponse {
    let request = GoogleIAMV1.TestIamPermissionsRequest().with {
      $0.resource = resource
      $0.permissions = permissions
    }
    return try await self.testIamPermissions(request: request)
  }

  public func queryGrantableRoles(request: QueryGrantableRolesRequest) async throws
    -> GoogleIAMAdminV1.QueryGrantableRolesResponse
  {
    try await self.queryGrantableRoles(request: request, options: .init())
  }

  public func queryGrantableRoles(
    request: QueryGrantableRolesRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMAdminV1.QueryGrantableRolesResponse {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func queryGrantableRoles(
    byItem: QueryGrantableRolesRequest
  ) throws -> any AsyncSequence<Role, Swift.Error> {
    try self.queryGrantableRoles(byItem: byItem, options: .init())
  }

  public func queryGrantableRoles(
    byItem: QueryGrantableRolesRequest, options: GoogleCloudGax.RequestOptions
  ) throws -> any AsyncSequence<Role, Swift.Error> {
    let listRpc = {
      (token: Swift.String) async throws -> GoogleIAMAdminV1.QueryGrantableRolesResponse in
      throw GoogleCloudGax.RequestError.unimplemented
    }
    return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
  }

  public func queryGrantableRoles(
    fullResourceName: Swift.String,
  ) throws -> any AsyncSequence<Role, Swift.Error> {
    let request = QueryGrantableRolesRequest().with {
      $0.fullResourceName = fullResourceName
    }
    return try self.queryGrantableRoles(byItem: request)
  }

  public func listRoles(request: ListRolesRequest) async throws
    -> GoogleIAMAdminV1.ListRolesResponse
  {
    try await self.listRoles(request: request, options: .init())
  }

  public func listRoles(
    request: ListRolesRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMAdminV1.ListRolesResponse {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func listRoles(
    byItem: ListRolesRequest
  ) throws -> any AsyncSequence<Role, Swift.Error> {
    try self.listRoles(byItem: byItem, options: .init())
  }

  public func listRoles(
    byItem: ListRolesRequest, options: GoogleCloudGax.RequestOptions
  ) throws -> any AsyncSequence<Role, Swift.Error> {
    let listRpc = { (token: Swift.String) async throws -> GoogleIAMAdminV1.ListRolesResponse in
      throw GoogleCloudGax.RequestError.unimplemented
    }
    return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
  }

  public func getRole(request: GetRoleRequest) async throws -> GoogleIAMAdminV1.Role {
    try await self.getRole(request: request, options: .init())
  }

  public func getRole(
    request: GetRoleRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMAdminV1.Role {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func createRole(request: CreateRoleRequest) async throws -> GoogleIAMAdminV1.Role {
    try await self.createRole(request: request, options: .init())
  }

  public func createRole(
    request: CreateRoleRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMAdminV1.Role {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func updateRole(request: UpdateRoleRequest) async throws -> GoogleIAMAdminV1.Role {
    try await self.updateRole(request: request, options: .init())
  }

  public func updateRole(
    request: UpdateRoleRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMAdminV1.Role {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func deleteRole(request: DeleteRoleRequest) async throws -> GoogleIAMAdminV1.Role {
    try await self.deleteRole(request: request, options: .init())
  }

  public func deleteRole(
    request: DeleteRoleRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMAdminV1.Role {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func undeleteRole(request: UndeleteRoleRequest) async throws -> GoogleIAMAdminV1.Role {
    try await self.undeleteRole(request: request, options: .init())
  }

  public func undeleteRole(
    request: UndeleteRoleRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMAdminV1.Role {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func queryTestablePermissions(request: QueryTestablePermissionsRequest) async throws
    -> GoogleIAMAdminV1.QueryTestablePermissionsResponse
  {
    try await self.queryTestablePermissions(request: request, options: .init())
  }

  public func queryTestablePermissions(
    request: QueryTestablePermissionsRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMAdminV1.QueryTestablePermissionsResponse {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func queryTestablePermissions(
    byItem: QueryTestablePermissionsRequest
  ) throws -> any AsyncSequence<Permission, Swift.Error> {
    try self.queryTestablePermissions(byItem: byItem, options: .init())
  }

  public func queryTestablePermissions(
    byItem: QueryTestablePermissionsRequest, options: GoogleCloudGax.RequestOptions
  ) throws -> any AsyncSequence<Permission, Swift.Error> {
    let listRpc = {
      (token: Swift.String) async throws -> GoogleIAMAdminV1.QueryTestablePermissionsResponse in
      throw GoogleCloudGax.RequestError.unimplemented
    }
    return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
  }

  public func queryAuditableServices(request: QueryAuditableServicesRequest) async throws
    -> GoogleIAMAdminV1.QueryAuditableServicesResponse
  {
    try await self.queryAuditableServices(request: request, options: .init())
  }

  public func queryAuditableServices(
    request: QueryAuditableServicesRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMAdminV1.QueryAuditableServicesResponse {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func lintPolicy(request: LintPolicyRequest) async throws
    -> GoogleIAMAdminV1.LintPolicyResponse
  {
    try await self.lintPolicy(request: request, options: .init())
  }

  public func lintPolicy(
    request: LintPolicyRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleIAMAdminV1.LintPolicyResponse {
    throw GoogleCloudGax.RequestError.unimplemented
  }
}
