Struct reinfer_client::Client

source ·
pub struct Client { /* private fields */ }

Implementations§

source§

impl Client

source

pub fn new(config: Config) -> Result<Client>

Create a new API client.

source

pub fn base_url(&self) -> &Url

Get the base url for the client

source

pub fn get_sources(&self) -> Result<Vec<Source>>

List all visible sources.

source

pub fn get_user(&self, user: impl Into<UserIdentifier>) -> Result<User>

Get a source by either id or name.

source

pub fn get_source(&self, source: impl Into<SourceIdentifier>) -> Result<Source>

Get a source by either id or name.

source

pub fn create_source( &self, source_name: &SourceFullName, options: NewSource<'_> ) -> Result<Source>

Create a new source.

source

pub fn update_source( &self, source_name: &SourceFullName, options: UpdateSource<'_> ) -> Result<Source>

Update a source.

source

pub fn delete_source(&self, source: impl Into<SourceIdentifier>) -> Result<()>

Delete a source.

source

pub fn create_quota( &self, target_tenant_id: &TenantId, tenant_quota_kind: TenantQuotaKind, options: CreateQuota ) -> Result<()>

Set a quota

source

pub fn get_quotas(&self) -> Result<Vec<Quota>>

Get quotas for current tenant

source

pub fn delete_user(&self, user: impl Into<UserIdentifier>) -> Result<()>

Delete a user.

source

pub fn delete_comments( &self, source: impl Into<SourceIdentifier>, comments: &[CommentId] ) -> Result<()>

Delete comments by id in a source.

source

pub fn get_comments_iter_page( &self, source_name: &SourceFullName, continuation: Option<&ContinuationKind>, to_timestamp: Option<DateTime<Utc>>, limit: usize ) -> Result<CommentsIterPage>

Get a page of comments from a source.

source

pub fn get_dataset_query_iter<'a>( &'a self, dataset_name: &'a DatasetFullName, params: &'a mut QueryRequestParams ) -> DatasetQueryIter<'a>

Iterate through all comments for a given dataset query.

source

pub fn get_comments_iter<'a>( &'a self, source_name: &'a SourceFullName, page_size: Option<usize>, timerange: CommentsIterTimerange ) -> CommentsIter<'a>

Iterate through all comments in a source.

source

pub fn get_emails_iter_page( &self, bucket_name: &BucketFullName, continuation: Option<&EmailContinuation>, limit: usize ) -> Result<EmailsIterPage>

Get a page of comments from a source.

source

pub fn get_emails_iter<'a>( &'a self, bucket_name: &'a BucketFullName, page_size: Option<usize> ) -> EmailsIter<'a>

Iterate through all comments in a source.

source

pub fn get_comment<'a>( &'a self, source_name: &'a SourceFullName, comment_id: &'a CommentId ) -> Result<Comment>

Get a single comment by id.

source

pub fn post_integration( &self, name: &IntegrationFullName, integration: &NewIntegration ) -> Result<PostIntegrationResponse>

source

pub fn put_integration( &self, name: &IntegrationFullName, integration: &NewIntegration ) -> Result<PutIntegrationResponse>

source

pub fn put_comments( &self, source_name: &SourceFullName, comments: &[NewComment], no_charge: bool ) -> Result<PutCommentsResponse>

source

pub fn put_stream( &self, dataset_name: &DatasetFullName, stream: &NewStream ) -> Result<PutStreamResponse>

source

pub fn get_audit_events( &self, minimum_timestamp: Option<DateTime<Utc>>, maximum_timestamp: Option<DateTime<Utc>>, continuation: Option<Continuation> ) -> Result<AuditQueryResponse>

source

pub fn get_validation( &self, dataset_name: &DatasetFullName, model_version: &ModelVersion ) -> Result<ValidationResponse>

source

pub fn get_label_validation( &self, label: &LabelName, dataset_name: &DatasetFullName, model_version: &ModelVersion ) -> Result<LabelValidation>

source

pub fn sync_comments( &self, source_name: &SourceFullName, comments: &[NewComment], no_charge: bool ) -> Result<SyncCommentsResponse>

source

pub fn sync_raw_emails( &self, source_name: &SourceFullName, documents: &[Document], transform_tag: &TransformTag, include_comments: bool, no_charge: bool ) -> Result<SyncRawEmailsResponse>

source

pub fn put_emails( &self, bucket_name: &BucketFullName, emails: &[NewEmail], no_charge: bool ) -> Result<PutEmailsResponse>

source

pub fn post_user( &self, user_id: &UserId, user: UpdateUser ) -> Result<PostUserResponse>

source

pub fn put_comment_audio( &self, source_id: &SourceId, comment_id: &CommentId, audio_path: impl AsRef<Path> ) -> Result<()>

source

pub fn get_integrations(&self) -> Result<Vec<Integration>>

source

pub fn get_integration(&self, name: &IntegrationFullName) -> Result<Integration>

source

pub fn get_datasets(&self) -> Result<Vec<Dataset>>

source

pub fn get_dataset<IdentifierT>(&self, dataset: IdentifierT) -> Result<Dataset>
where IdentifierT: Into<DatasetIdentifier>,

source

pub fn create_dataset( &self, dataset_name: &DatasetFullName, options: NewDataset<'_> ) -> Result<Dataset>

Create a dataset.

source

pub fn update_dataset( &self, dataset_name: &DatasetFullName, options: UpdateDataset<'_> ) -> Result<Dataset>

Update a dataset.

source

pub fn delete_dataset<IdentifierT>(&self, dataset: IdentifierT) -> Result<()>
where IdentifierT: Into<DatasetIdentifier>,

source

pub fn get_labellings<'a>( &self, dataset_name: &DatasetFullName, comment_uids: impl Iterator<Item = &'a CommentUid> ) -> Result<Vec<AnnotatedComment>>

Get labellings for a given a dataset and a list of comment UIDs.

source

pub fn get_labellings_iter<'a>( &'a self, dataset_name: &'a DatasetFullName, source_id: &'a SourceId, return_predictions: bool, limit: Option<usize> ) -> LabellingsIter<'a>

Iterate through all reviewed comments in a source.

source

pub fn get_labellings_in_bulk( &self, dataset_name: &DatasetFullName, query_parameters: GetLabellingsInBulk<'_> ) -> Result<GetAnnotationsResponse>

Get reviewed comments in bulk

source

pub fn update_labelling( &self, dataset_name: &DatasetFullName, comment_uid: &CommentUid, labelling: Option<&[NewLabelling]>, entities: Option<&NewEntities>, moon_forms: Option<&[NewMoonForm]> ) -> Result<AnnotatedComment>

Update labellings for a given a dataset and comment UID.

source

pub fn get_comment_predictions<'a>( &self, dataset_name: &DatasetFullName, model_version: &ModelVersion, comment_uids: impl Iterator<Item = &'a CommentUid> ) -> Result<Vec<Prediction>>

Get predictions for a given a dataset, a model version, and a list of comment UIDs.

source

pub fn get_streams(&self, dataset_name: &DatasetFullName) -> Result<Vec<Stream>>

source

pub fn get_recent_comments( &self, dataset_name: &DatasetFullName, filter: &CommentFilter, limit: usize, continuation: Option<&Continuation> ) -> Result<RecentCommentsPage>

source

pub fn get_current_user(&self) -> Result<User>

source

pub fn get_users(&self) -> Result<Vec<User>>

source

pub fn create_user(&self, user: NewUser<'_>) -> Result<User>

source

pub fn dataset_summary( &self, dataset_name: &DatasetFullName, params: &SummaryRequestParams ) -> Result<SummaryResponse>

source

pub fn query_dataset( &self, dataset_name: &DatasetFullName, params: &QueryRequestParams ) -> Result<QueryResponse>

source

pub fn send_welcome_email(&self, user_id: UserId) -> Result<()>

source

pub fn get_bucket_statistics( &self, bucket_name: &BucketFullName ) -> Result<BucketStatistics>

source

pub fn get_dataset_statistics( &self, dataset_name: &DatasetFullName, params: &DatasetStatisticsRequestParams ) -> Result<CommentStatistics>

source

pub fn get_source_statistics( &self, source_name: &SourceFullName, params: &SourceStatisticsRequestParams ) -> Result<CommentStatistics>

source

pub fn create_bucket( &self, bucket_name: &BucketFullName, options: NewBucket<'_> ) -> Result<Bucket>

Create a new bucket.

source

pub fn get_buckets(&self) -> Result<Vec<Bucket>>

source

pub fn get_bucket<IdentifierT>(&self, bucket: IdentifierT) -> Result<Bucket>
where IdentifierT: Into<BucketIdentifier>,

source

pub fn delete_bucket<IdentifierT>(&self, bucket: IdentifierT) -> Result<()>
where IdentifierT: Into<BucketIdentifier>,

source

pub fn fetch_stream_comments( &self, stream_name: &StreamFullName, size: u32 ) -> Result<StreamBatch>

source

pub fn get_stream(&self, stream_name: &StreamFullName) -> Result<Stream>

source

pub fn advance_stream( &self, stream_name: &StreamFullName, sequence_id: StreamSequenceId ) -> Result<()>

source

pub fn reset_stream( &self, stream_name: &StreamFullName, to_comment_created_at: DateTime<Utc> ) -> Result<()>

source

pub fn tag_stream_exceptions( &self, stream_name: &StreamFullName, exceptions: &[StreamException<'_>] ) -> Result<()>

source

pub fn get_project(&self, project_name: &ProjectName) -> Result<Project>

Gets a project.

source

pub fn get_projects(&self) -> Result<Vec<Project>>

Gets all projects.

source

pub fn create_project( &self, project_name: &ProjectName, options: NewProject<'_>, user_ids: &[UserId] ) -> Result<Project>

Creates a new project.

source

pub fn update_project( &self, project_name: &ProjectName, options: UpdateProject<'_> ) -> Result<Project>

Updates an existing project.

source

pub fn delete_project( &self, project_name: &ProjectName, force_delete: ForceDeleteProject ) -> Result<()>

Deletes an existing project.

Trait Implementations§

source§

impl Debug for Client

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !Freeze for Client

§

impl !RefUnwindSafe for Client

§

impl Send for Client

§

impl Sync for Client

§

impl Unpin for Client

§

impl !UnwindSafe for Client

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, U> TryFrom<U> for T
where U: Into<T>,

§

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

§

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