Skip to main content

OnspringClient

Struct OnspringClient 

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

Client for interacting with the Onspring API v2.

Implementations§

Source§

impl OnspringClient

Source

pub fn builder(api_key: impl Into<String>) -> OnspringClientBuilder

Creates a new OnspringClientBuilder.

Source§

impl OnspringClient

Source

pub async fn list_apps( &self, paging: Option<PagingRequest>, ) -> Result<PagedResponse<App>>

Gets all apps for the current client, with optional pagination.

Source

pub async fn get_app(&self, app_id: i32) -> Result<App>

Gets an app by its identifier.

Source

pub async fn batch_get_apps( &self, ids: &[i32], ) -> Result<CollectionResponse<App>>

Gets up to 100 apps by their identifiers.

Source§

impl OnspringClient

Source

pub async fn get_field(&self, field_id: i32) -> Result<Field>

Gets a field by its identifier.

Source

pub async fn batch_get_fields( &self, ids: &[i32], ) -> Result<CollectionResponse<Field>>

Gets up to 100 fields by their identifiers.

Source

pub async fn list_fields( &self, app_id: i32, paging: Option<PagingRequest>, ) -> Result<PagedResponse<Field>>

Gets a paginated list of fields for a given application.

Source§

impl OnspringClient

Source

pub async fn get_file_info( &self, record_id: i32, field_id: i32, file_id: i32, ) -> Result<FileInfo>

Gets a file’s metadata information.

Source

pub async fn get_file( &self, record_id: i32, field_id: i32, file_id: i32, ) -> Result<FileResponse>

Downloads a file’s content.

Source

pub async fn upload_file( &self, request: SaveFileRequest, ) -> Result<CreatedWithIdResponse>

Uploads a file attachment.

Source

pub async fn delete_file( &self, record_id: i32, field_id: i32, file_id: i32, ) -> Result<()>

Deletes a file attachment.

Source§

impl OnspringClient

Source

pub async fn save_list_item( &self, list_id: i32, request: SaveListItemRequest, ) -> Result<SaveListItemResponse>

Creates or updates a list item in the specified list.

Source

pub async fn delete_list_item(&self, list_id: i32, item_id: Uuid) -> Result<()>

Deletes a list item from the specified list.

Source§

impl OnspringClient

Source

pub async fn ping(&self) -> Result<()>

Checks if the Onspring API is reachable.

Source§

impl OnspringClient

Source

pub async fn list_records( &self, app_id: i32, paging: Option<PagingRequest>, field_ids: Option<&[i32]>, data_format: Option<DataFormat>, ) -> Result<PagedResponse<Record>>

Gets a paginated collection of records for a given app.

Source

pub async fn get_record( &self, app_id: i32, record_id: i32, field_ids: Option<&[i32]>, data_format: Option<DataFormat>, ) -> Result<Record>

Gets a record by its identifier.

Source

pub async fn save_record( &self, request: SaveRecordRequest, ) -> Result<SaveRecordResponse>

Creates or updates a record.

Source

pub async fn delete_record(&self, app_id: i32, record_id: i32) -> Result<()>

Deletes a record by its identifier.

Source

pub async fn batch_get_records( &self, request: BatchGetRecordsRequest, ) -> Result<CollectionResponse<Record>>

Gets a batch of records.

Source

pub async fn query_records( &self, request: QueryRecordsRequest, paging: Option<PagingRequest>, ) -> Result<PagedResponse<Record>>

Queries records using a filter expression.

Source

pub async fn batch_delete_records( &self, request: BatchDeleteRecordsRequest, ) -> Result<()>

Deletes a batch of records.

Source§

impl OnspringClient

Source

pub async fn get_report( &self, report_id: i32, data_format: Option<DataFormat>, data_type: Option<ReportDataType>, ) -> Result<ReportData>

Gets report data by report ID.

Source

pub async fn list_reports( &self, app_id: i32, paging: Option<PagingRequest>, ) -> Result<PagedResponse<ReportInfo>>

Gets a paginated list of reports for a given application.

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<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: 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: 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, 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<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