feature/build-release
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 crate::ar_date_format; |
| 2 | use chrono::{DateTime, Utc}; |
| 3 | use serde::{Deserialize, Serialize}; |
| 4 | |
| 5 | #[derive(Serialize, Deserialize, Debug)] |
| 6 | pub struct AuthApp { |
| 7 | pub id: String, |
| 8 | pub secret: Option<String>, |
| 9 | pub name: String, |
| 10 | #[serde(with = "ar_date_format")] |
| 11 | pub created_at: DateTime<Utc>, |
| 12 | #[serde(with = "ar_date_format")] |
| 13 | pub updated_at: DateTime<Utc>, |
| 14 | } |
| 15 | |
| 16 | #[derive(Serialize, Deserialize, Debug)] |
| 17 | pub struct AuthAppCreate { |
| 18 | pub name: String, |
| 19 | pub description: String, |
| 20 | } |
| 21 | |
| 22 | #[cfg(test)] |
| 23 | mod tests { |
| 24 | use super::*; |
| 25 | use serde_json::json; |
| 26 | #[test] |
| 27 | fn test_auth_app_create() { |
| 28 | let auth_app_create = AuthAppCreate { |
| 29 | name: "test".to_owned(), |
| 30 | description: "test".to_owned(), |
| 31 | }; |
| 32 | let json = json!({ |
| 33 | "name": "test", |
| 34 | "description": "test", |
| 35 | }); |
| 36 | assert_eq!(serde_json::to_value(auth_app_create).unwrap(), json); |
| 37 | } |
| 38 | } |