1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
use actix_web::{HttpResponse, ResponseError};
use derive_more::Display;
use serde::{Deserialize, Serialize};
use validator::Validate;
#[derive(Serialize, Deserialize, Debug, Clone, Validate)]
pub struct GetListCompanySettingsBody {
pub is_ready: Option<bool>,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct GetListCompanySettingsResult {
pub list: Vec<CompanySettingsAggregation>,
}
#[derive(Serialize, Deserialize, Debug, Clone, Validate)]
pub struct CompanySettingsAggregation {
pub id: Option<String>,
pub is_ready: Option<bool>,
pub is_on_promise: Option<bool>,
pub urls: Option<CompanySettingsUrlsAggregation>,
pub server: Option<CompanySettingsServerAggregation>,
pub mailer: Option<CompanySettingsMailerAggregation>,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct CompanySettingsUrlsAggregation {
pub provider: Option<String>,
pub root_domain: Option<String>,
pub api_sub_domain: Option<String>,
pub admin_sub_domain: Option<String>,
pub manager_sub_domain: Option<String>,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct CompanySettingsServerAggregation {
pub provider: Option<String>,
pub ip_address: Option<String>,
pub ssh_user: Option<String>,
pub ssh_key: Option<String>,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct CompanySettingsMailerAggregation {
pub host: Option<String>,
pub username: Option<String>,
pub password: Option<String>,
pub no_reply_email: Option<String>,
pub company_name: Option<String>,
pub company_logo_url: Option<String>,
pub company_color: Option<String>,
}
#[derive(Debug, Display)]
pub enum GetListCompanySettingsError {
Default(String),
}
impl ResponseError for GetListCompanySettingsError {
fn error_response(&self) -> HttpResponse {
match self {
GetListCompanySettingsError::Default(error) => HttpResponse::BadRequest().body(error),
}
}
}