pub(crate) mod batch;
#[cfg(feature = "composite_graph")]
pub(crate) mod graph;
#[cfg(feature = "composite")]
pub(crate) mod query_batch;
#[cfg(feature = "composite")]
pub(crate) mod soql_mass_op;
pub use batch::{BatchRequest, BatchResponse, BatchSubResponse};
#[cfg(feature = "composite_graph")]
pub use graph::{
CompositeGraphRequest, Graph, GraphErrorResponse, GraphRequest, GraphResponse, GraphResult,
GraphSubResponse,
};
#[cfg(feature = "composite")]
pub use query_batch::{BatchOp, BatchStats, QueryBatch};
#[cfg(feature = "composite")]
pub use soql_mass_op::SoqlMassOp;
use crate::auth::Authenticator;
use crate::session::Session;
use std::sync::Arc;
#[derive(Debug)]
pub struct CompositeHandler<A: Authenticator> {
pub(crate) inner: Arc<Session<A>>,
}
impl<A: Authenticator> Clone for CompositeHandler<A> {
fn clone(&self) -> Self {
Self {
inner: Arc::clone(&self.inner),
}
}
}
impl<A: Authenticator> CompositeHandler<A> {
#[must_use]
pub(crate) fn new(inner: Arc<Session<A>>) -> Self {
Self { inner }
}
#[must_use]
pub fn batch(&self) -> batch::BatchRequest<A> {
batch::BatchRequest::new(self.clone())
}
#[cfg(feature = "composite_graph")]
#[must_use]
pub fn graph(&self) -> graph::CompositeGraphRequest<A> {
graph::CompositeGraphRequest::new(self.clone())
}
}