kinetics 0.15.3

Kinetics is a hosting platform for Rust applications that allows you to deploy all types of workloads by writing **only Rust code**.
Documentation
use serde::{Deserialize, Serialize};

use crate::api::{orgs::validators, request::Validate};

#[derive(Debug, Serialize, Deserialize)]
pub struct Request {
    pub org: String,
    pub email: String,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct Response {
    pub success: bool,
}

impl Validate for Request {
    fn validate(&self) -> Option<Vec<String>> {
        let mut errors = Vec::new();

        if !validators::Name::validate(&self.org) {
            errors.push(validators::Name::message());
        }

        if !validators::Email::validate(&self.email) {
            errors.push(validators::Email::message());
        }

        if !errors.is_empty() {
            return Some(errors);
        }

        None
    }
}