class Stytch::Passwords

def migrate(

The type of this field is +Integer+.
The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.
status_code::
The type of this field is +User+ (+object+).
The `user` object affected by this API call. See the [Get user endpoint](https://stytch.com/docs/api/get-user) for complete response field details.
user::
The type of this field is +Boolean+.
In `login_or_create` endpoints, this field indicates whether or not a User was just created.
user_created::
The type of this field is +String+.
The unique ID of a specific email address.
email_id::
The type of this field is +String+.
The unique ID of the affected User.
user_id::
The type of this field is +String+.
Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue.
request_id::
An object with the following fields:
== Returns:

The type of this field is nilable +Name+ (+object+).
The name of the user. Each field in the name object is optional.
name::
The type of this field is nilable +object+.
The `untrusted_metadata` field contains an arbitrary JSON object of application-specific data. Untrusted metadata can be edited by end users directly via the SDK, and **cannot be used to store critical information.** See the [Metadata](https://stytch.com/docs/api/metadata) reference for complete field behavior details.
untrusted_metadata::
The type of this field is nilable +object+.
The `trusted_metadata` field contains an arbitrary JSON object of application-specific data. See the [Metadata](https://stytch.com/docs/api/metadata) reference for complete field behavior details.
trusted_metadata::
The type of this field is nilable +PBKDF2Config+ (+object+).
Required additional parameters for PBKDF2 hash keys.
pbkdf_2_config::
The type of this field is nilable +ScryptConfig+ (+object+).
Required parameters if the scrypt is not provided in a [PHC encoded form](https://github.com/P-H-C/phc-string-format/blob/master/phc-sf-spec.md#phc-string-format).
scrypt_config::
The type of this field is nilable +SHA1Config+ (+object+).
Optional parameters for SHA-1 hash types.
sha_1_config::
The type of this field is nilable +Argon2Config+ (+object+).
Required parameters if the argon2 hex form, as opposed to the encoded form, is supplied.
argon_2_config::
The type of this field is nilable +MD5Config+ (+object+).
Optional parameters for MD-5 hash types.
md_5_config::
The type of this field is +MigrateRequestHashType+ (string enum).
The password hash used. Currently `bcrypt`, `scrypt`, `argon_2i`, `argon_2id`, `md_5`, `sha_1`, and `pbkdf_2` are supported.
hash_type::
The type of this field is +String+.
The password hash. For a Scrypt or PBKDF2 hash, the hash needs to be a base64 encoded string.
hash::
The type of this field is +String+.
The email address of the end user.
email::
== Parameters:

Adds an existing password to a User's email that doesn't have a password yet. We support migrating users from passwords stored with `bcrypt`, `scrypt`, `argon2`, `MD-5`, `SHA-1`, or `PBKDF2`. This endpoint has a rate limit of 100 requests per second.
def migrate(
  email:,
  hash:,
  hash_type:,
  md_5_config: nil,
  argon_2_config: nil,
  sha_1_config: nil,
  scrypt_config: nil,
  pbkdf_2_config: nil,
  trusted_metadata: nil,
  untrusted_metadata: nil,
  name: nil
)
  request = {
    email: email,
    hash: hash,
    hash_type: hash_type
  }
  request[:md_5_config] = md_5_config unless md_5_config.nil?
  request[:argon_2_config] = argon_2_config unless argon_2_config.nil?
  request[:sha_1_config] = sha_1_config unless sha_1_config.nil?
  request[:scrypt_config] = scrypt_config unless scrypt_config.nil?
  request[:pbkdf_2_config] = pbkdf_2_config unless pbkdf_2_config.nil?
  request[:trusted_metadata] = trusted_metadata unless trusted_metadata.nil?
  request[:untrusted_metadata] = untrusted_metadata unless untrusted_metadata.nil?
  request[:name] = name unless name.nil?
  post_request('/v1/passwords/migrate', request)
end