1 use smbcloud_network::environment::Environment;
2
3 /// API credentials for a GresIQ-managed database.
4 ///
5 /// Obtain these from the smbCloud console after registering a GresIQ app.
6 /// The `api_key` identifies the app; the `api_secret` authenticates it.
7 #[derive(Clone, Copy)]
8 pub struct GresiqCredentials<'a> {
9 pub api_key: &'a str,
10 pub api_secret: &'a str,
11 }
12
13 /// Resolve the GresIQ gateway base URL for the given environment.
14 ///
15 /// - **Dev** → `http://localhost:8088`
16 /// - **Production** → `https://api.smbcloud.xyz`
17 pub fn base_url(environment: &Environment) -> String {
18 format!(
19 "{}://{}",
20 environment.api_protocol(),
21 environment.api_host()
22 )
23 }