Skip to content

Commit 8f6a9a3

Browse files
ci-stytchStytch Codegen Bot
andauthored
Add delivery method option to member email update (#126)
Co-authored-by: Stytch Codegen Bot <[email protected]>
1 parent 8229221 commit 8f6a9a3

File tree

4 files changed

+47
-17
lines changed

4 files changed

+47
-17
lines changed

stytch/src/main/kotlin/com/stytch/java/b2b/api/organizationsmembers/OrganizationsMembers.kt

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -451,13 +451,18 @@ public interface Members {
451451
* [unlinked](https://stytch.com/docs/b2b/api/unlink-retired-member-email))
452452
* - Must not be updating for another member (i.e. two members cannot attempt to update to the same email at once)
453453
*
454-
* The member will receive an Email Magic Link that expires in 5 minutes. If they do not verify their new email address in
455-
* that timeframe, the email
454+
* The member will receive an Email Magic Link (or Email OTP Code, if `EMAIL_OTP` is specified as the delivery method)
455+
* that expires in 5 minutes. If they do not verify their new email address in that timeframe, the email
456456
* will be freed up for other members to use.
457457
*
458-
* The Magic Link will redirect to your `login_redirect_url` (or the configured default if one isn't provided), and you
459-
* should invoke the [Authenticate Magic Link](https://stytch.com/docs/b2b/api/authenticate-magic-link) endpoint as normal
460-
* to complete the flow.
458+
* If using Email Magic Links, the magic link will redirect to your `login_redirect_url` (or the configured default if one
459+
* isn't provided), and you should invoke the
460+
* [Authenticate Magic Link](https://stytch.com/docs/b2b/api/authenticate-magic-link) endpoint as normal to complete the
461+
* flow.
462+
*
463+
* If using Email OTP Codes, you should invoke the
464+
* [Authenticate Email OTP Code](https://stytch.com/docs/b2b/api/authenticate-email-otp) endpoint as normal to complete
465+
* the flow. Make sure to pass the new email address to the endpoint.
461466
*/
462467
public suspend fun startEmailUpdate(
463468
data: StartEmailUpdateRequest,
@@ -474,13 +479,18 @@ public interface Members {
474479
* [unlinked](https://stytch.com/docs/b2b/api/unlink-retired-member-email))
475480
* - Must not be updating for another member (i.e. two members cannot attempt to update to the same email at once)
476481
*
477-
* The member will receive an Email Magic Link that expires in 5 minutes. If they do not verify their new email address in
478-
* that timeframe, the email
482+
* The member will receive an Email Magic Link (or Email OTP Code, if `EMAIL_OTP` is specified as the delivery method)
483+
* that expires in 5 minutes. If they do not verify their new email address in that timeframe, the email
479484
* will be freed up for other members to use.
480485
*
481-
* The Magic Link will redirect to your `login_redirect_url` (or the configured default if one isn't provided), and you
482-
* should invoke the [Authenticate Magic Link](https://stytch.com/docs/b2b/api/authenticate-magic-link) endpoint as normal
483-
* to complete the flow.
486+
* If using Email Magic Links, the magic link will redirect to your `login_redirect_url` (or the configured default if one
487+
* isn't provided), and you should invoke the
488+
* [Authenticate Magic Link](https://stytch.com/docs/b2b/api/authenticate-magic-link) endpoint as normal to complete the
489+
* flow.
490+
*
491+
* If using Email OTP Codes, you should invoke the
492+
* [Authenticate Email OTP Code](https://stytch.com/docs/b2b/api/authenticate-email-otp) endpoint as normal to complete
493+
* the flow. Make sure to pass the new email address to the endpoint.
484494
*/
485495
public fun startEmailUpdate(
486496
data: StartEmailUpdateRequest,
@@ -498,13 +508,18 @@ public interface Members {
498508
* [unlinked](https://stytch.com/docs/b2b/api/unlink-retired-member-email))
499509
* - Must not be updating for another member (i.e. two members cannot attempt to update to the same email at once)
500510
*
501-
* The member will receive an Email Magic Link that expires in 5 minutes. If they do not verify their new email address in
502-
* that timeframe, the email
511+
* The member will receive an Email Magic Link (or Email OTP Code, if `EMAIL_OTP` is specified as the delivery method)
512+
* that expires in 5 minutes. If they do not verify their new email address in that timeframe, the email
503513
* will be freed up for other members to use.
504514
*
505-
* The Magic Link will redirect to your `login_redirect_url` (or the configured default if one isn't provided), and you
506-
* should invoke the [Authenticate Magic Link](https://stytch.com/docs/b2b/api/authenticate-magic-link) endpoint as normal
507-
* to complete the flow.
515+
* If using Email Magic Links, the magic link will redirect to your `login_redirect_url` (or the configured default if one
516+
* isn't provided), and you should invoke the
517+
* [Authenticate Magic Link](https://stytch.com/docs/b2b/api/authenticate-magic-link) endpoint as normal to complete the
518+
* flow.
519+
*
520+
* If using Email OTP Codes, you should invoke the
521+
* [Authenticate Email OTP Code](https://stytch.com/docs/b2b/api/authenticate-email-otp) endpoint as normal to complete
522+
* the flow. Make sure to pass the new email address to the endpoint.
508523
*/
509524
public fun startEmailUpdateCompletable(
510525
data: StartEmailUpdateRequest,

stytch/src/main/kotlin/com/stytch/java/b2b/models/organizationsmembers/OrganizationsMembers.kt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@ import com.stytch.java.b2b.models.organizations.ResultsMetadata
1616
import com.stytch.java.b2b.models.organizations.SearchQuery
1717
import com.stytch.java.common.methodoptions.Authorization
1818

19+
@JsonClass(generateAdapter = false)
20+
public enum class StartEmailUpdateRequestDeliveryMethod {
21+
@Json(name = "EMAIL_MAGIC_LINK")
22+
EMAIL_MAGIC_LINK,
23+
24+
@Json(name = "EMAIL_OTP")
25+
EMAIL_OTP,
26+
}
27+
1928
@JsonClass(generateAdapter = false)
2029
public enum class StartEmailUpdateRequestLocale {
2130
@Json(name = "en")
@@ -947,6 +956,12 @@ public data class StartEmailUpdateRequest
947956
*/
948957
@Json(name = "login_template_id")
949958
val loginTemplateId: String? = null,
959+
/**
960+
* The method that should be used to verify a member's new email address. The options are `EMAIL_MAGIC_LINK` or
961+
* `EMAIL_OTP`. This field is optional, if no value is provided, `EMAIL_MAGIC_LINK` will be used.
962+
*/
963+
@Json(name = "delivery_method")
964+
val deliveryMethod: StartEmailUpdateRequestDeliveryMethod? = null,
950965
)
951966

952967
/**
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
package com.stytch.java.common
22

3-
internal const val VERSION = "7.31.0"
3+
internal const val VERSION = "7.32.0"

version.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version = "7.31.0"
1+
version = "7.32.0"

0 commit comments

Comments
 (0)