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
//! Runtime HTTP client configuration types
//!
//! These types are used by generated code at runtime and represent the actual
//! configuration that will be used by the HTTP client.
use std::collections::HashMap;
/// Runtime HTTP client configuration (used by generated code)
#[derive(Debug, Clone)]
pub struct HttpClientConfig {
/// Base URL for all API requests
pub base_url: Option<String>,
/// Request timeout in seconds
pub timeout_seconds: Option<u64>,
/// Default headers to include in all requests
pub default_headers: HashMap<String, String>,
}
/// Retry configuration for HTTP requests
#[derive(Debug, Clone)]
pub struct RetryConfig {
/// Maximum number of retry attempts
pub max_retries: u32,
/// Initial delay in milliseconds before first retry
pub initial_delay_ms: u64,
/// Maximum delay in milliseconds between retries
pub max_delay_ms: u64,
}
/// Authentication configuration
#[derive(Debug, Clone)]
pub enum AuthConfig {
/// Bearer token authentication (e.g., "Authorization: Bearer TOKEN")
Bearer {
/// Header name for the bearer token (default: "Authorization")
header_name: String,
},
/// API key authentication (e.g., "X-API-Key: YOUR_KEY")
ApiKey {
/// Header name for the API key
header_name: String,
},
/// Custom authentication with configurable header and prefix
Custom {
/// Header name for the authentication token
header_name: String,
/// Optional prefix for the header value (e.g., "Bearer ")
header_value_prefix: Option<String>,
},
}