pub struct XmlStreamConfig {Show 14 fields
pub base_url: String,
pub path: String,
pub method: Method,
pub auth: AuthSpec<XmlAuth>,
pub headers: HeaderMap,
pub body: Option<String>,
pub soap: Option<SoapConfig>,
pub records_element_path: Option<String>,
pub pagination: Option<XmlPagination>,
pub max_pages: Option<usize>,
pub query_params: HashMap<String, String>,
pub decode: Vec<DecodeStep>,
pub batch_size: usize,
pub tls: Option<TlsClientConfig>,
}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. a raw SOAP envelope). Mutually exclusive
with SoapConfig::body_inner when a soap block is set.
soap: Option<SoapConfig>Optional first-class SOAP ergonomics block. When present, the source
assembles the SOAP envelope, injects the version-appropriate headers,
and (by default) resolves records_element_path relative to
Envelope.Body. Sugar over the raw body path — see SoapConfig.
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.
decode: Vec<DecodeStep>Response-decode pipeline (#540): a declarative chain applied to the raw
response body before record extraction (extract an element’s text →
base64/gunzip/unzip → parse csv/xlsx/xml/json). When non-empty,
records come from the decoded output instead of records_element_path.
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.
tls: Option<TlsClientConfig>Optional client-certificate (mutual TLS) config. When set, the source
presents a client certificate on every request (data + inline auth token
request). Requires the crate’s mtls feature.
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 decode(self, steps: Vec<DecodeStep>) -> Self
pub fn decode(self, steps: Vec<DecodeStep>) -> Self
Set the response-decode pipeline (#540).
Sourcepub fn tls(self, tls: TlsClientConfig) -> Self
pub fn tls(self, tls: TlsClientConfig) -> Self
Attach a mutual-TLS client identity (requires the mtls feature at build
time; otherwise XmlStream::try_new errors).
Sourcepub fn with_soap(self, soap: SoapConfig) -> Self
pub fn with_soap(self, soap: SoapConfig) -> Self
Attach a first-class SoapConfig ergonomics block.
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.
Sourcepub fn validate(&self) -> Result<(), FaucetError>
pub fn validate(&self) -> Result<(), FaucetError>
Validate the configuration, surfacing SOAP-specific conflicts as
FaucetError::Config before any request is made.
Rules:
- both the top-level
bodyandSoapConfig::body_innerset is ambiguous; - a
soapblock requiresmethod: POST(SOAP is a POST protocol).
A no-op (always Ok) when no soap block is present, so non-SOAP
configs are unaffected.
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