feature/smbcloud-deploy
claude/smbcloud-github-app-k9641p
development
feature/apps
feature/build-release
feature/ci-docs
feature/ci-ruby-gems
feature/cicd
feature/completion
feature/dist-nuget
feature/fix-ci-sdk-pypi-rubygem
feature/fix-clippy-on-stable-channel
feature/fix-deployment-script
feature/github-email
feature/gresiq-v1
feature/project-new-structure
feature/rsync-deploy
feature/ruby-runner
feature/sdk-npm
feature/sdk-workflows
feature/smbcloud-cli-release-npm
feature/smbcloud-deploy
feature/wasm
main
release/v0.7.4
| 1 | use serde::Serialize; |
| 2 | |
| 3 | #[derive(Debug, Serialize)] |
| 4 | pub struct Args { |
| 5 | pub user: Email, |
| 6 | } |
| 7 | |
| 8 | #[derive(Debug, Serialize)] |
| 9 | pub struct Email { |
| 10 | pub email: String, |
| 11 | } |
| 12 | |
| 13 | #[derive(Debug, Serialize)] |
| 14 | pub struct Param { |
| 15 | pub user: UserUpdatePassword, |
| 16 | } |
| 17 | |
| 18 | #[derive(Debug, Serialize)] |
| 19 | pub struct UserUpdatePassword { |
| 20 | pub reset_password_token: String, |
| 21 | pub password: String, |
| 22 | pub password_confirmation: String, |
| 23 | } |
| 24 | |
| 25 | #[cfg(test)] |
| 26 | mod tests { |
| 27 | use super::*; |
| 28 | use serde_json::json; |
| 29 | #[test] |
| 30 | fn test_update_password() { |
| 31 | let args = Args { |
| 32 | user: Email { |
| 33 | email: "test".to_owned(), |
| 34 | }, |
| 35 | }; |
| 36 | let json = json!({ |
| 37 | "user": { |
| 38 | "email": "test", |
| 39 | }, |
| 40 | }); |
| 41 | assert_eq!(serde_json::to_value(args).unwrap(), json); |
| 42 | } |
| 43 | } |