/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */

import * as z from "zod/v3";

export type V2PermissionsDeleteRoleRequestBody = {
  /**
   * Unique identifier of the role to permanently delete from your workspace.
   *
   * @remarks
   * Must either be a valid role ID that begins with 'role_' or the given role name and exists within your workspace.
   *
   * WARNING: Deletion is immediate and irreversible with significant consequences:
   * - All API keys assigned this role will lose the associated permissions
   * - Access to resources protected by this role's permissions will be denied
   * - Any authorization logic depending on this role will start failing
   * - Historical analytics referencing this role remain intact
   *
   * Before deletion, ensure:
   * - You've updated any dependent authorization logic or code
   * - You've migrated any keys to use alternative roles or direct permissions
   * - You've notified relevant team members of the access changes
   */
  role: string;
};

/** @internal */
export type V2PermissionsDeleteRoleRequestBody$Outbound = {
  role: string;
};

/** @internal */
export const V2PermissionsDeleteRoleRequestBody$outboundSchema: z.ZodType<
  V2PermissionsDeleteRoleRequestBody$Outbound,
  z.ZodTypeDef,
  V2PermissionsDeleteRoleRequestBody
> = z.object({
  role: z.string(),
});

export function v2PermissionsDeleteRoleRequestBodyToJSON(
  v2PermissionsDeleteRoleRequestBody: V2PermissionsDeleteRoleRequestBody,
): string {
  return JSON.stringify(
    V2PermissionsDeleteRoleRequestBody$outboundSchema.parse(
      v2PermissionsDeleteRoleRequestBody,
    ),
  );
}
