@@ -1673,9 +1673,55 @@ static Models.Token Convert(Dictionary<string, object> it) =>
16731673 ///
16741674 /// </para>
16751675 /// </summary>
1676+ public Task < Models . Token > CreateEmailVerification ( string url )
1677+ {
1678+ var apiPath = "/account/verifications/email" ;
1679+
1680+ var apiParameters = new Dictionary < string , object ? > ( )
1681+ {
1682+ { "url" , url }
1683+ } ;
1684+
1685+ var apiHeaders = new Dictionary < string , string > ( )
1686+ {
1687+ { "content-type" , "application/json" }
1688+ } ;
1689+
1690+
1691+ static Models . Token Convert ( Dictionary < string , object > it ) =>
1692+ Models . Token . From ( map : it ) ;
1693+
1694+ return _client . Call < Models . Token > (
1695+ method : "POST" ,
1696+ path : apiPath ,
1697+ headers : apiHeaders ,
1698+ parameters : apiParameters . Where ( it => it . Value != null ) . ToDictionary ( it => it . Key , it => it . Value ) ! ,
1699+ convert : Convert ) ;
1700+
1701+ }
1702+
1703+ /// <para>
1704+ /// Use this endpoint to send a verification message to your user email address
1705+ /// to confirm they are the valid owners of that address. Both the **userId**
1706+ /// and **secret** arguments will be passed as query parameters to the URL you
1707+ /// have provided to be attached to the verification email. The provided URL
1708+ /// should redirect the user back to your app and allow you to complete the
1709+ /// verification process by verifying both the **userId** and **secret**
1710+ /// parameters. Learn more about how to [complete the verification
1711+ /// process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification).
1712+ /// The verification link sent to the user's email address is valid for 7 days.
1713+ ///
1714+ /// Please note that in order to avoid a [Redirect
1715+ /// Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md),
1716+ /// the only valid redirect URLs are the ones from domains you have set when
1717+ /// adding your platforms in the console interface.
1718+ ///
1719+ /// </para>
1720+ /// </summary>
1721+ [ Obsolete ( "This API has been deprecated since 1.8.0. Please use `Account.createEmailVerification` instead." ) ]
16761722 public Task < Models . Token > CreateVerification ( string url )
16771723 {
1678- var apiPath = "/account/verification " ;
1724+ var apiPath = "/account/verifications/email " ;
16791725
16801726 var apiParameters = new Dictionary < string , object ? > ( )
16811727 {
@@ -1707,9 +1753,45 @@ static Models.Token Convert(Dictionary<string, object> it) =>
17071753 /// 200 status code.
17081754 /// </para>
17091755 /// </summary>
1756+ public Task < Models . Token > UpdateEmailVerification ( string userId , string secret )
1757+ {
1758+ var apiPath = "/account/verifications/email" ;
1759+
1760+ var apiParameters = new Dictionary < string , object ? > ( )
1761+ {
1762+ { "userId" , userId } ,
1763+ { "secret" , secret }
1764+ } ;
1765+
1766+ var apiHeaders = new Dictionary < string , string > ( )
1767+ {
1768+ { "content-type" , "application/json" }
1769+ } ;
1770+
1771+
1772+ static Models . Token Convert ( Dictionary < string , object > it ) =>
1773+ Models . Token . From ( map : it ) ;
1774+
1775+ return _client . Call < Models . Token > (
1776+ method : "PUT" ,
1777+ path : apiPath ,
1778+ headers : apiHeaders ,
1779+ parameters : apiParameters . Where ( it => it . Value != null ) . ToDictionary ( it => it . Key , it => it . Value ) ! ,
1780+ convert : Convert ) ;
1781+
1782+ }
1783+
1784+ /// <para>
1785+ /// Use this endpoint to complete the user email verification process. Use both
1786+ /// the **userId** and **secret** parameters that were attached to your app URL
1787+ /// to verify the user email ownership. If confirmed this route will return a
1788+ /// 200 status code.
1789+ /// </para>
1790+ /// </summary>
1791+ [ Obsolete ( "This API has been deprecated since 1.8.0. Please use `Account.updateEmailVerification` instead." ) ]
17101792 public Task < Models . Token > UpdateVerification ( string userId , string secret )
17111793 {
1712- var apiPath = "/account/verification " ;
1794+ var apiPath = "/account/verifications/email " ;
17131795
17141796 var apiParameters = new Dictionary < string , object ? > ( )
17151797 {
@@ -1748,7 +1830,7 @@ static Models.Token Convert(Dictionary<string, object> it) =>
17481830 /// </summary>
17491831 public Task < Models . Token > CreatePhoneVerification ( )
17501832 {
1751- var apiPath = "/account/verification /phone" ;
1833+ var apiPath = "/account/verifications /phone" ;
17521834
17531835 var apiParameters = new Dictionary < string , object ? > ( )
17541836 {
@@ -1781,7 +1863,7 @@ static Models.Token Convert(Dictionary<string, object> it) =>
17811863 /// </summary>
17821864 public Task < Models . Token > UpdatePhoneVerification ( string userId , string secret )
17831865 {
1784- var apiPath = "/account/verification /phone" ;
1866+ var apiPath = "/account/verifications /phone" ;
17851867
17861868 var apiParameters = new Dictionary < string , object ? > ( )
17871869 {
0 commit comments