pub struct XmlStreamConfig {
pub base_url: String,
pub path: String,
pub method: Method,
pub auth: AuthSpec<XmlAuth>,
pub headers: HeaderMap,
pub body: Option<String>,
pub records_element_path: Option<String>,
pub pagination: Option<XmlPagination>,
pub max_pages: Option<usize>,
pub query_params: HashMap<String, String>,
pub batch_size: usize,
}Expand description
Configuration for the XML source.
Fields§
§base_url: StringBase URL of the API.
path: StringRequest path (appended to base_url).
method: MethodHTTP method (GET or POST for SOAP).
auth: AuthSpec<XmlAuth>Authentication: either inline ({ type, config }) or a { ref: <name> }
pointer to a shared provider in the CLI’s top-level auth: catalog.
headers: HeaderMapAdditional request headers.
body: Option<String>Optional request body (e.g. SOAP envelope).
records_element_path: Option<String>Dot-separated path to the repeating element in the XML response
(e.g. "Envelope.Body.GetUsersResponse.Users.User").
pagination: Option<XmlPagination>Pagination configuration.
max_pages: Option<usize>Maximum number of pages to fetch.
query_params: HashMap<String, String>Query parameters to include in every request.
batch_size: usizeRecords per emitted StreamPage. The
event-driven XML parser accumulates matched subtrees into a buffer
and yields whenever the buffer reaches this size. Defaults to
DEFAULT_BATCH_SIZE.
batch_size = 0 is the “no batching” sentinel: the document is
drained end-to-end and the entire result set is emitted in a single
page. Useful for small lookup payloads or for sinks (e.g. SQL COPY,
BigQuery load jobs) that prefer one large request to many small ones.
Implementations§
Source§impl XmlStreamConfig
impl XmlStreamConfig
Sourcepub fn new(base_url: impl Into<String>, path: impl Into<String>) -> Self
pub fn new(base_url: impl Into<String>, path: impl Into<String>) -> Self
Create a new config with required fields.
Sourcepub fn records_element_path(self, path: impl Into<String>) -> Self
pub fn records_element_path(self, path: impl Into<String>) -> Self
Set the dot-separated path to the repeating element.
Sourcepub fn pagination(self, pagination: XmlPagination) -> Self
pub fn pagination(self, pagination: XmlPagination) -> Self
Set pagination configuration.
Sourcepub fn query_param(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn query_param( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Add a query parameter.
Sourcepub fn with_batch_size(self, batch_size: usize) -> Self
pub fn with_batch_size(self, batch_size: usize) -> Self
Set the per-page record count for
Source::stream_pages.
Pass 0 to opt out of batching — the entire document is drained and
emitted in a single StreamPage.
Trait Implementations§
Source§impl Clone for XmlStreamConfig
impl Clone for XmlStreamConfig
Source§fn clone(&self) -> XmlStreamConfig
fn clone(&self) -> XmlStreamConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for XmlStreamConfig
impl Debug for XmlStreamConfig
Source§impl<'de> Deserialize<'de> for XmlStreamConfig
impl<'de> Deserialize<'de> for XmlStreamConfig
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>,
Source§impl JsonSchema for XmlStreamConfig
impl JsonSchema for XmlStreamConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more