pub enum Environment {
PRODUCTION,
SANDBOX,
}Expand description
Represents the QuickBooks API environment.
QuickBooks provides two environments:
- SANDBOX: For development and testing, uses sandbox URLs and data
- PRODUCTION: For live applications, uses production URLs and real data
The environment determines which API endpoints are used for all operations.
§Examples
use quick_oxibooks::Environment;
// For development
let env = Environment::SANDBOX;
// For production
let env = Environment::PRODUCTION;
// Default is SANDBOX for safety
let default_env = Environment::default();
assert_eq!(default_env, Environment::SANDBOX);Variants§
PRODUCTION
Production environment for live QuickBooks data
SANDBOX
Sandbox environment for development and testing (default)
Implementations§
Source§impl Environment
impl Environment
Sourcepub fn discovery_url(&self) -> &'static str
pub fn discovery_url(&self) -> &'static str
Returns the OAuth 2.0 discovery URL for the environment.
The discovery URL provides OAuth endpoints and configuration for authentication.
§Returns
A static string containing the discovery URL for the environment.
Sourcepub fn migration_url(&self) -> &'static str
pub fn migration_url(&self) -> &'static str
Returns the token migration URL for the environment.
Used for migrating OAuth 1.0 tokens to OAuth 2.0.
§Returns
A static string containing the migration URL for the environment.
Sourcepub fn user_info_url(&self) -> &'static str
pub fn user_info_url(&self) -> &'static str
Returns the user info URL for the environment.
Used to retrieve user information from the OpenID Connect userinfo endpoint.
§Returns
A static string containing the user info URL for the environment.
Sourcepub fn endpoint_url(&self) -> &'static str
pub fn endpoint_url(&self) -> &'static str
Returns the base API endpoint URL for the environment.
This is the root URL for all QuickBooks API operations (CRUD, queries, reports, etc.).
§Returns
A static string containing the API endpoint URL for the environment.
Trait Implementations§
Source§impl Clone for Environment
impl Clone for Environment
Source§fn clone(&self) -> Environment
fn clone(&self) -> Environment
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more