pub struct Config {
pub client_id: String,
pub client_secret: String,
pub base_url: String,
pub callback_url: String,
pub da_nickname: Option<String>,
pub http_config: HttpClientConfig,
}Expand description
APS Configuration containing client credentials
Fields§
§client_id: StringAPS Client ID (from APS Developer Portal)
client_secret: StringAPS Client Secret (from APS Developer Portal)
base_url: StringBase URL for APS API (defaults to production)
callback_url: StringCallback URL for 3-legged OAuth
da_nickname: Option<String>Design Automation nickname (optional)
http_config: HttpClientConfigHTTP client configuration
Implementations§
Source§impl Config
impl Config
Sourcepub fn from_env() -> Result<Self>
pub fn from_env() -> Result<Self>
Load configuration with precedence: flags > env vars > active profile > defaults
Looks for:
- Environment variables (APS_CLIENT_ID, APS_CLIENT_SECRET, etc.)
- Active profile configuration (if set)
- Defaults
Sourcepub fn from_env_lenient() -> Result<Self>
pub fn from_env_lenient() -> Result<Self>
Load configuration leniently — missing client_id/client_secret default to empty strings. Useful for commands that don’t need API credentials (e.g., auth logout, auth status).
Sourcepub fn require_credentials(&self) -> Result<()>
pub fn require_credentials(&self) -> Result<()>
Validate that client credentials are configured.
Call this before any operation that requires client_id / client_secret
(2-legged auth, 3-legged login, token refresh). Returns a clear error
telling the user how to set the missing value(s).
Get the authorization URL for 3-legged OAuth
Sourcepub fn derivative_url(&self) -> String
pub fn derivative_url(&self) -> String
Get the Model Derivative API base URL
Sourcepub fn project_url(&self) -> String
pub fn project_url(&self) -> String
Get the Data Management API base URL (for hubs/projects)
Sourcepub fn webhooks_url(&self) -> String
pub fn webhooks_url(&self) -> String
Get the Webhooks API base URL
Sourcepub fn issues_url(&self) -> String
pub fn issues_url(&self) -> String
Get the ACC Issues API base URL
Sourcepub fn reality_capture_url(&self) -> String
pub fn reality_capture_url(&self) -> String
Get the Reality Capture API base URL
Sourcepub fn assets_url(&self) -> String
pub fn assets_url(&self) -> String
Get the Assets API base URL
Sourcepub fn submittals_url(&self) -> String
pub fn submittals_url(&self) -> String
Get the Submittals API base URL
Sourcepub fn checklists_url(&self) -> String
pub fn checklists_url(&self) -> String
Get the Checklists API base URL
Sourcepub fn aec_graphql_url(&self) -> String
pub fn aec_graphql_url(&self) -> String
Get the AEC Data Model GraphQL API endpoint