pub struct ContactClient { /* private fields */ }Expand description
Client for the Yuki Contact SOAP service.
Implementations§
Source§impl ContactClient
impl ContactClient
pub fn new() -> Self
Sourcepub fn with_client(http: Client) -> Self
pub fn with_client(http: Client) -> Self
Build over a caller-provided HTTP client, so a long-running consumer can share a single pooled client across all service clients.
Sourcepub async fn authenticate(&mut self, api_key: &str) -> Result<String, YukiError>
pub async fn authenticate(&mut self, api_key: &str) -> Result<String, YukiError>
Authenticate with the Yuki API and store the session ID.
Sourcepub async fn search_contacts(
&self,
query: &str,
) -> Result<Vec<Contact>, YukiError>
pub async fn search_contacts( &self, query: &str, ) -> Result<Vec<Contact>, YukiError>
Search for contacts matching a query string.
Sourcepub async fn get_suppliers_and_customers_page(
&self,
contact_type: &str,
page_number: u32,
) -> Result<Vec<Contact>, YukiError>
pub async fn get_suppliers_and_customers_page( &self, contact_type: &str, page_number: u32, ) -> Result<Vec<Contact>, YukiError>
Fetch one page of suppliers and customers. Pages are 1-based.
Sourcepub async fn get_suppliers_and_customers(
&self,
contact_type: &str,
) -> Result<Vec<Contact>, YukiError>
pub async fn get_suppliers_and_customers( &self, contact_type: &str, ) -> Result<Vec<Contact>, YukiError>
Retrieve every supplier and customer of the given type, following pagination.
The API returns a fixed-size page; without pageNumber only the first page is
ever returned, which silently truncates larger address books.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ContactClient
impl !UnwindSafe for ContactClient
impl Freeze for ContactClient
impl Send for ContactClient
impl Sync for ContactClient
impl Unpin for ContactClient
impl UnsafeUnpin for ContactClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more