pub struct DiscoveryDoc {
pub issuer: String,
pub authorization_endpoint: String,
pub token_endpoint: String,
pub userinfo_endpoint: String,
pub revocation_endpoint: String,
pub jwks_uri: String,
pub response_types_supported: Vec<String>,
pub subject_types_supported: Vec<String>,
pub id_token_signing_alg_values_supported: Vec<String>,
pub scopes_supported: Vec<String>,
pub token_endpoint_auth_methods_supported: Vec<String>,
pub claims_supported: Vec<String>,
}Expand description
OAuth 2.0 discovery document for QuickBooks API.
Contains OAuth 2.0 endpoint URLs and supported capabilities discovered from
the QuickBooks OAuth discovery endpoint. This is automatically fetched when
creating a QBContext and used for authentication flows.
§Fields
issuer: The OAuth 2.0 issuer identifierauthorization_endpoint: URL for user authorizationtoken_endpoint: URL for token exchangeuserinfo_endpoint: URL for retrieving user informationrevocation_endpoint: URL for token revocationjwks_uri: URL for JSON Web Key Set- Various supported capabilities arrays
§Examples
use quick_oxibooks::{DiscoveryDoc, Environment};
use ureq::Agent;
let client = Agent::new_with_defaults();
let discovery = DiscoveryDoc::get(Environment::SANDBOX, &client).unwrap();
println!("Token endpoint: {}", discovery.token_endpoint);Fields§
§issuer: String§token_endpoint: String§userinfo_endpoint: String§revocation_endpoint: String§jwks_uri: String§response_types_supported: Vec<String>§subject_types_supported: Vec<String>§id_token_signing_alg_values_supported: Vec<String>§scopes_supported: Vec<String>§token_endpoint_auth_methods_supported: Vec<String>§claims_supported: Vec<String>Implementations§
Source§impl DiscoveryDoc
impl DiscoveryDoc
Sourcepub fn get(environment: Environment, client: &Agent) -> APIResult<Self>
pub fn get(environment: Environment, client: &Agent) -> APIResult<Self>
Fetches the OAuth 2.0 discovery document from QuickBooks.
This method makes an HTTP request to the QuickBooks discovery endpoint
to retrieve OAuth 2.0 configuration and supported capabilities.
§Parameters
environment: TheQuickBooksenvironment (sandbox or production)client: HTTP client for making the request
§Returns
Returns the parsed discovery document on success, or an APIError on failure.
§Errors
- Network errors when fetching the discovery document
- JSON parsing errors if the response format is invalid
- HTTP errors if the discovery endpoint returns an error response
§Examples
use quick_oxibooks::{DiscoveryDoc, Environment};
use ureq::Agent;
let client = Agent::new_with_defaults();
let discovery = DiscoveryDoc::get(Environment::SANDBOX, &client).unwrap();Trait Implementations§
Source§impl Clone for DiscoveryDoc
impl Clone for DiscoveryDoc
Source§fn clone(&self) -> DiscoveryDoc
fn clone(&self) -> DiscoveryDoc
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DiscoveryDoc
impl Debug for DiscoveryDoc
Source§impl<'de> Deserialize<'de> for DiscoveryDoc
impl<'de> Deserialize<'de> for DiscoveryDoc
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Hash for DiscoveryDoc
impl Hash for DiscoveryDoc
Source§impl Ord for DiscoveryDoc
impl Ord for DiscoveryDoc
Source§fn cmp(&self, other: &DiscoveryDoc) -> Ordering
fn cmp(&self, other: &DiscoveryDoc) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for DiscoveryDoc
impl PartialEq for DiscoveryDoc
Source§impl PartialOrd for DiscoveryDoc
impl PartialOrd for DiscoveryDoc
Source§impl Serialize for DiscoveryDoc
impl Serialize for DiscoveryDoc
impl Eq for DiscoveryDoc
impl StructuralPartialEq for DiscoveryDoc
Auto Trait Implementations§
impl Freeze for DiscoveryDoc
impl RefUnwindSafe for DiscoveryDoc
impl Send for DiscoveryDoc
impl Sync for DiscoveryDoc
impl Unpin for DiscoveryDoc
impl UnwindSafe for DiscoveryDoc
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more