//! resources — One module per top-level area of the API.

pub mod availability;
pub mod billing;
pub mod catalog;
pub mod datastreams;
pub mod export_schemas;
pub mod exports;
pub mod subscriptions;

use crate::client::Client;

impl Client {
    /// Returns the exchanges accessor: exchange list and per-exchange instrument queries.
    ///
    /// # Examples
    ///
    /// ```no_run
    /// # async fn example() -> ticksupply::Result<()> {
    /// let client = ticksupply::Client::new()?;
    /// let exchanges = client.exchanges().list().await?;
    /// # let _ = exchanges;
    /// # Ok(()) }
    /// ```
    pub fn exchanges(&self) -> catalog::ExchangesResource<'_> {
        catalog::ExchangesResource { client: self }
    }

    /// Returns the datastreams accessor.
    ///
    /// # Examples
    ///
    /// ```no_run
    /// # async fn example() -> ticksupply::Result<()> {
    /// let client = ticksupply::Client::new()?;
    /// let page = client.datastreams().list().exchange("binance").send().await?;
    /// # let _ = page;
    /// # Ok(()) }
    /// ```
    pub fn datastreams(&self) -> datastreams::DatastreamsResource<'_> {
        datastreams::DatastreamsResource { client: self }
    }

    /// Returns the subscriptions accessor.
    ///
    /// # Examples
    ///
    /// ```no_run
    /// # async fn example() -> ticksupply::Result<()> {
    /// let client = ticksupply::Client::new()?;
    /// let page = client.subscriptions().list().send().await?;
    /// # let _ = page;
    /// # Ok(()) }
    /// ```
    pub fn subscriptions(&self) -> subscriptions::SubscriptionsResource<'_> {
        subscriptions::SubscriptionsResource { client: self }
    }

    /// Returns the exports accessor.
    ///
    /// # Examples
    ///
    /// ```no_run
    /// # async fn example() -> ticksupply::Result<()> {
    /// let client = ticksupply::Client::new()?;
    /// let page = client.exports().list().send().await?;
    /// # let _ = page;
    /// # Ok(()) }
    /// ```
    pub fn exports(&self) -> exports::ExportsResource<'_> {
        exports::ExportsResource { client: self }
    }

    /// Returns the availability accessor.
    ///
    /// # Examples
    ///
    /// ```no_run
    /// # async fn example() -> ticksupply::Result<()> {
    /// let client = ticksupply::Client::new()?;
    /// let avail = client.availability().get(12345).await?;
    /// # let _ = avail;
    /// # Ok(()) }
    /// ```
    pub fn availability(&self) -> availability::AvailabilityResource<'_> {
        availability::AvailabilityResource { client: self }
    }

    /// Returns the export schemas accessor.
    ///
    /// # Examples
    ///
    /// ```no_run
    /// # async fn example() -> ticksupply::Result<()> {
    /// let client = ticksupply::Client::new()?;
    /// let schemas = client.export_schemas().list().await?;
    /// # let _ = schemas;
    /// # Ok(()) }
    /// ```
    pub fn export_schemas(&self) -> export_schemas::ExportSchemasResource<'_> {
        export_schemas::ExportSchemasResource { client: self }
    }

    /// Returns the billing accessor.
    ///
    /// # Examples
    ///
    /// ```no_run
    /// # async fn example() -> ticksupply::Result<()> {
    /// let client = ticksupply::Client::new()?;
    /// let summary = client.billing().summary().await?;
    /// # let _ = summary;
    /// # Ok(()) }
    /// ```
    pub fn billing(&self) -> billing::BillingResource<'_> {
        billing::BillingResource { client: self }
    }
}
