VolvoCarsConfig
Volvo API client configuration.
Supports two authentication modes:
1. OAuth2 with automatic refresh (recommended):
VolvoCarsConfig(
apiKey = "your-vcc-api-key",
oauth = OAuthConfig(
accessToken = storedAccessToken,
refreshToken = storedRefreshToken,
clientId = "your-client-id",
clientSecret = "your-client-secret",
onTokensRefreshed = { access, refresh -> save(access, refresh) }
)
)2. Static token (for testing or short-lived scripts):
VolvoCarsConfig(
apiKey = "your-vcc-api-key",
token = "your-access-token"
)Throws
Constructors
Properties
VCC API key from the Volvo Developer Portal
Optional circuit breaker to stop retries after sustained failures. When open, requests fail immediately without hitting the server. See CircuitBreakerConfig.
Additional Ktor HttpClient configuration block for advanced customization
HTTP request/response logging configuration
OAuth2 configuration with automatic token refresh. Mutually exclusive with token.
Proxy configuration (ProxyConfig.Http or ProxyConfig.Socks)
Retry strategy with exponential backoff for transient errors (429, 5xx). Honors Retry-After headers from 429 responses when present.