Skip to main content

DataverseSourceBuilder

Struct DataverseSourceBuilder 

Source
pub struct DataverseSourceBuilder { /* private fields */ }
Expand description

Builder for DataverseSource instances.

Provides a fluent API for constructing Dataverse sources with sensible defaults. The builder takes the source ID at construction and returns a fully constructed DataverseSource from build().

§Example

let source = DataverseSource::builder("dv-source")
    .with_environment_url("https://myorg.crm.dynamics.com")
    .with_tenant_id("tenant-id")
    .with_client_id("client-id")
    .with_client_secret("client-secret")
    .with_entities(vec!["account".to_string()])
    .build()?;

Implementations§

Source§

impl DataverseSourceBuilder

Source

pub fn new(id: impl Into<String>) -> Self

Create a new builder with the given source ID.

Source

pub fn with_environment_url(self, url: impl Into<String>) -> Self

Set the Dataverse environment URL.

Source

pub fn with_tenant_id(self, tenant_id: impl Into<String>) -> Self

Set the Azure AD tenant ID.

Source

pub fn with_client_id(self, client_id: impl Into<String>) -> Self

Set the Azure AD client ID.

Source

pub fn with_client_secret(self, client_secret: impl Into<String>) -> Self

Set the Azure AD client secret.

Source

pub fn with_identity_provider( self, provider: impl IdentityProvider + 'static, ) -> Self

Set an identity provider for token acquisition.

When an identity provider is set, it takes precedence over tenant_id/client_id/client_secret. The provider’s get_credentials() must return Credentials::Token.

This enables using any of the platform’s identity providers, including:

  • AzureIdentityProvider::with_client_secret(...) for client credentials
  • AzureIdentityProvider::with_default_credentials(...) for managed identity
  • AzureIdentityProvider::with_developer_tools(...) for local dev (CLI, azd, PS)
  • AzureIdentityProvider::with_workload_identity(...) for Kubernetes workloads
§Example
use drasi_lib::identity::AzureIdentityProvider;
use drasi_source_dataverse::DataverseSource;

let provider = AzureIdentityProvider::with_client_secret(
    "tenant-id", "client-id", "client-secret", "dataverse",
)?
.with_scope("https://myorg.crm.dynamics.com/.default");

let source = DataverseSource::builder("dv-source")
    .with_environment_url("https://myorg.crm.dynamics.com")
    .with_entities(vec!["account".to_string()])
    .with_identity_provider(provider)
    .build()?;
Source

pub fn with_entities(self, entities: Vec<String>) -> Self

Set the list of entity logical names to monitor.

Source

pub fn with_entity(self, entity: impl Into<String>) -> Self

Add a single entity to monitor.

Source

pub fn with_entity_set_override( self, entity_name: impl Into<String>, entity_set_name: impl Into<String>, ) -> Self

Override the entity set name for a specific entity.

Source

pub fn with_entity_columns( self, entity: impl Into<String>, columns: Vec<String>, ) -> Self

Set column selection for a specific entity.

Source

pub fn with_min_interval_ms(self, ms: u64) -> Self

Set the minimum adaptive polling interval in milliseconds.

Source

pub fn with_max_interval_seconds(self, seconds: u64) -> Self

Set the maximum adaptive polling interval in seconds.

Source

pub fn with_api_version(self, version: impl Into<String>) -> Self

Set the Dataverse Web API version.

Source

pub fn with_dispatch_mode(self, mode: DispatchMode) -> Self

Set the dispatch mode.

Source

pub fn with_dispatch_buffer_capacity(self, capacity: usize) -> Self

Set the dispatch buffer capacity.

Source

pub fn with_bootstrap_provider( self, provider: impl BootstrapProvider + 'static, ) -> Self

Set the bootstrap provider for initial data delivery.

Source

pub fn with_auto_start(self, auto_start: bool) -> Self

Set whether this source should auto-start when DrasiLib starts.

Source

pub fn build(self) -> Result<DataverseSource>

Build the DataverseSource instance.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more