Struct reinfer_client::Client
source · pub struct Client { /* private fields */ }
Implementations§
source§impl Client
impl Client
sourcepub fn get_sources(&self) -> Result<Vec<Source>>
pub fn get_sources(&self) -> Result<Vec<Source>>
List all visible sources.
sourcepub fn get_user(&self, user: impl Into<UserIdentifier>) -> Result<User>
pub fn get_user(&self, user: impl Into<UserIdentifier>) -> Result<User>
Get a source by either id or name.
sourcepub fn get_source(&self, source: impl Into<SourceIdentifier>) -> Result<Source>
pub fn get_source(&self, source: impl Into<SourceIdentifier>) -> Result<Source>
Get a source by either id or name.
sourcepub fn create_source(
&self,
source_name: &SourceFullName,
options: NewSource<'_>
) -> Result<Source>
pub fn create_source( &self, source_name: &SourceFullName, options: NewSource<'_> ) -> Result<Source>
Create a new source.
sourcepub fn update_source(
&self,
source_name: &SourceFullName,
options: UpdateSource<'_>
) -> Result<Source>
pub fn update_source( &self, source_name: &SourceFullName, options: UpdateSource<'_> ) -> Result<Source>
Update a source.
sourcepub fn delete_source(&self, source: impl Into<SourceIdentifier>) -> Result<()>
pub fn delete_source(&self, source: impl Into<SourceIdentifier>) -> Result<()>
Delete a source.
sourcepub fn create_quota(
&self,
target_tenant_id: &TenantId,
tenant_quota_kind: TenantQuotaKind,
options: CreateQuota
) -> Result<()>
pub fn create_quota( &self, target_tenant_id: &TenantId, tenant_quota_kind: TenantQuotaKind, options: CreateQuota ) -> Result<()>
Set a quota
sourcepub fn get_quotas(&self) -> Result<Vec<Quota>>
pub fn get_quotas(&self) -> Result<Vec<Quota>>
Get quotas for current tenant
sourcepub fn delete_user(&self, user: impl Into<UserIdentifier>) -> Result<()>
pub fn delete_user(&self, user: impl Into<UserIdentifier>) -> Result<()>
Delete a user.
sourcepub fn delete_comments(
&self,
source: impl Into<SourceIdentifier>,
comments: &[CommentId]
) -> Result<()>
pub fn delete_comments( &self, source: impl Into<SourceIdentifier>, comments: &[CommentId] ) -> Result<()>
Delete comments by id in a source.
sourcepub fn get_comments_iter_page(
&self,
source_name: &SourceFullName,
continuation: Option<&ContinuationKind>,
to_timestamp: Option<DateTime<Utc>>,
limit: usize
) -> Result<CommentsIterPage>
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.
sourcepub fn get_dataset_query_iter<'a>(
&'a self,
dataset_name: &'a DatasetFullName,
params: &'a mut QueryRequestParams
) -> DatasetQueryIter<'a> ⓘ
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.
sourcepub fn get_comments_iter<'a>(
&'a self,
source_name: &'a SourceFullName,
page_size: Option<usize>,
timerange: CommentsIterTimerange
) -> CommentsIter<'a> ⓘ
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.
sourcepub fn get_emails_iter_page(
&self,
bucket_name: &BucketFullName,
continuation: Option<&EmailContinuation>,
limit: usize
) -> Result<EmailsIterPage>
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.
sourcepub fn get_emails_iter<'a>(
&'a self,
bucket_name: &'a BucketFullName,
page_size: Option<usize>
) -> EmailsIter<'a> ⓘ
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.
sourcepub fn get_comment<'a>(
&'a self,
source_name: &'a SourceFullName,
comment_id: &'a CommentId
) -> Result<Comment>
pub fn get_comment<'a>( &'a self, source_name: &'a SourceFullName, comment_id: &'a CommentId ) -> Result<Comment>
Get a single comment by id.
pub fn post_integration( &self, name: &IntegrationFullName, integration: &NewIntegration ) -> Result<PostIntegrationResponse>
pub fn put_integration( &self, name: &IntegrationFullName, integration: &NewIntegration ) -> Result<PutIntegrationResponse>
pub fn put_comments( &self, source_name: &SourceFullName, comments: &[NewComment], no_charge: bool ) -> Result<PutCommentsResponse>
pub fn put_stream( &self, dataset_name: &DatasetFullName, stream: &NewStream ) -> Result<PutStreamResponse>
pub fn get_audit_events( &self, minimum_timestamp: Option<DateTime<Utc>>, maximum_timestamp: Option<DateTime<Utc>>, continuation: Option<Continuation> ) -> Result<AuditQueryResponse>
pub fn get_validation( &self, dataset_name: &DatasetFullName, model_version: &ModelVersion ) -> Result<ValidationResponse>
pub fn get_label_validation( &self, label: &LabelName, dataset_name: &DatasetFullName, model_version: &ModelVersion ) -> Result<LabelValidation>
pub fn sync_comments( &self, source_name: &SourceFullName, comments: &[NewComment], no_charge: bool ) -> Result<SyncCommentsResponse>
pub fn sync_raw_emails( &self, source_name: &SourceFullName, documents: &[Document], transform_tag: &TransformTag, include_comments: bool, no_charge: bool ) -> Result<SyncRawEmailsResponse>
pub fn put_emails( &self, bucket_name: &BucketFullName, emails: &[NewEmail], no_charge: bool ) -> Result<PutEmailsResponse>
pub fn post_user( &self, user_id: &UserId, user: UpdateUser ) -> Result<PostUserResponse>
pub fn put_comment_audio( &self, source_id: &SourceId, comment_id: &CommentId, audio_path: impl AsRef<Path> ) -> Result<()>
pub fn get_integrations(&self) -> Result<Vec<Integration>>
pub fn get_integration(&self, name: &IntegrationFullName) -> Result<Integration>
pub fn get_datasets(&self) -> Result<Vec<Dataset>>
pub fn get_dataset<IdentifierT>(&self, dataset: IdentifierT) -> Result<Dataset>where
IdentifierT: Into<DatasetIdentifier>,
sourcepub fn create_dataset(
&self,
dataset_name: &DatasetFullName,
options: NewDataset<'_>
) -> Result<Dataset>
pub fn create_dataset( &self, dataset_name: &DatasetFullName, options: NewDataset<'_> ) -> Result<Dataset>
Create a dataset.
sourcepub fn update_dataset(
&self,
dataset_name: &DatasetFullName,
options: UpdateDataset<'_>
) -> Result<Dataset>
pub fn update_dataset( &self, dataset_name: &DatasetFullName, options: UpdateDataset<'_> ) -> Result<Dataset>
Update a dataset.
pub fn delete_dataset<IdentifierT>(&self, dataset: IdentifierT) -> Result<()>where
IdentifierT: Into<DatasetIdentifier>,
sourcepub fn get_labellings<'a>(
&self,
dataset_name: &DatasetFullName,
comment_uids: impl Iterator<Item = &'a CommentUid>
) -> Result<Vec<AnnotatedComment>>
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.
sourcepub fn get_labellings_iter<'a>(
&'a self,
dataset_name: &'a DatasetFullName,
source_id: &'a SourceId,
return_predictions: bool,
limit: Option<usize>
) -> LabellingsIter<'a> ⓘ
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.
sourcepub fn get_labellings_in_bulk(
&self,
dataset_name: &DatasetFullName,
query_parameters: GetLabellingsInBulk<'_>
) -> Result<GetAnnotationsResponse>
pub fn get_labellings_in_bulk( &self, dataset_name: &DatasetFullName, query_parameters: GetLabellingsInBulk<'_> ) -> Result<GetAnnotationsResponse>
Get reviewed comments in bulk
sourcepub fn update_labelling(
&self,
dataset_name: &DatasetFullName,
comment_uid: &CommentUid,
labelling: Option<&[NewLabelling]>,
entities: Option<&NewEntities>,
moon_forms: Option<&[NewMoonForm]>
) -> Result<AnnotatedComment>
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.
sourcepub fn get_comment_predictions<'a>(
&self,
dataset_name: &DatasetFullName,
model_version: &ModelVersion,
comment_uids: impl Iterator<Item = &'a CommentUid>
) -> Result<Vec<Prediction>>
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.
pub fn get_streams(&self, dataset_name: &DatasetFullName) -> Result<Vec<Stream>>
pub fn get_recent_comments( &self, dataset_name: &DatasetFullName, filter: &CommentFilter, limit: usize, continuation: Option<&Continuation> ) -> Result<RecentCommentsPage>
pub fn get_current_user(&self) -> Result<User>
pub fn get_users(&self) -> Result<Vec<User>>
pub fn create_user(&self, user: NewUser<'_>) -> Result<User>
pub fn dataset_summary( &self, dataset_name: &DatasetFullName, params: &SummaryRequestParams ) -> Result<SummaryResponse>
pub fn query_dataset( &self, dataset_name: &DatasetFullName, params: &QueryRequestParams ) -> Result<QueryResponse>
pub fn send_welcome_email(&self, user_id: UserId) -> Result<()>
pub fn get_bucket_statistics( &self, bucket_name: &BucketFullName ) -> Result<BucketStatistics>
pub fn get_dataset_statistics( &self, dataset_name: &DatasetFullName, params: &DatasetStatisticsRequestParams ) -> Result<CommentStatistics>
pub fn get_source_statistics( &self, source_name: &SourceFullName, params: &SourceStatisticsRequestParams ) -> Result<CommentStatistics>
sourcepub fn create_bucket(
&self,
bucket_name: &BucketFullName,
options: NewBucket<'_>
) -> Result<Bucket>
pub fn create_bucket( &self, bucket_name: &BucketFullName, options: NewBucket<'_> ) -> Result<Bucket>
Create a new bucket.
pub fn get_buckets(&self) -> Result<Vec<Bucket>>
pub fn get_bucket<IdentifierT>(&self, bucket: IdentifierT) -> Result<Bucket>where
IdentifierT: Into<BucketIdentifier>,
pub fn delete_bucket<IdentifierT>(&self, bucket: IdentifierT) -> Result<()>where
IdentifierT: Into<BucketIdentifier>,
pub fn fetch_stream_comments( &self, stream_name: &StreamFullName, size: u32 ) -> Result<StreamBatch>
pub fn get_stream(&self, stream_name: &StreamFullName) -> Result<Stream>
pub fn advance_stream( &self, stream_name: &StreamFullName, sequence_id: StreamSequenceId ) -> Result<()>
pub fn reset_stream( &self, stream_name: &StreamFullName, to_comment_created_at: DateTime<Utc> ) -> Result<()>
pub fn tag_stream_exceptions( &self, stream_name: &StreamFullName, exceptions: &[StreamException<'_>] ) -> Result<()>
sourcepub fn get_project(&self, project_name: &ProjectName) -> Result<Project>
pub fn get_project(&self, project_name: &ProjectName) -> Result<Project>
Gets a project.
sourcepub fn get_projects(&self) -> Result<Vec<Project>>
pub fn get_projects(&self) -> Result<Vec<Project>>
Gets all projects.
sourcepub fn create_project(
&self,
project_name: &ProjectName,
options: NewProject<'_>,
user_ids: &[UserId]
) -> Result<Project>
pub fn create_project( &self, project_name: &ProjectName, options: NewProject<'_>, user_ids: &[UserId] ) -> Result<Project>
Creates a new project.
sourcepub fn update_project(
&self,
project_name: &ProjectName,
options: UpdateProject<'_>
) -> Result<Project>
pub fn update_project( &self, project_name: &ProjectName, options: UpdateProject<'_> ) -> Result<Project>
Updates an existing project.
sourcepub fn delete_project(
&self,
project_name: &ProjectName,
force_delete: ForceDeleteProject
) -> Result<()>
pub fn delete_project( &self, project_name: &ProjectName, force_delete: ForceDeleteProject ) -> Result<()>
Deletes an existing project.