FileService

Struct FileService 

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

文件服务 - 处理除上传下载外的其他文件操作

Implementations§

Source§

impl FileService

Source

pub fn new(config: Config) -> Self

Source

pub async fn get_file_meta( &self, request: GetFileMetaRequest, option: Option<RequestOption>, ) -> SDKResult<GetFileMetaRespData>

获取文件元数据

该接口用于根据文件token获取文件的元数据信息。

https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/meta/batch_query

Source

pub async fn get_file_statistics( &self, request: GetFileStatisticsRequest, option: Option<RequestOption>, ) -> SDKResult<GetFileStatisticsRespData>

获取文件统计信息

该接口用于根据文件token获取文件的统计信息,如浏览次数等。

https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-statistics/get

Source

pub async fn list_file_view_records( &self, request: ListFileViewRecordsRequest, option: Option<RequestOption>, ) -> SDKResult<ListFileViewRecordsRespData>

获取文件访问记录

该接口用于获取文件的访问记录列表。

https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-view_record/list

Source

pub async fn create_file( &self, request: CreateFileRequest, option: Option<RequestOption>, ) -> SDKResult<CreateFileRespData>

新建文件

该接口用于在指定文件夹中新建文件。

https://open.feishu.cn/document/ukTMukTMukTM/uQTNzUjL0UzM14CN1MTN

Source

pub async fn copy_file( &self, request: CopyFileRequest, option: Option<RequestOption>, ) -> SDKResult<CopyFileRespData>

复制文件

该接口用于复制文件到指定文件夹。

https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/copy

Source

pub async fn delete_file( &self, request: DeleteFileRequest, option: Option<RequestOption>, ) -> SDKResult<DeleteFileRespData>

Source

pub async fn create_file_shortcut( &self, request: CreateFileShortcutRequest, option: Option<RequestOption>, ) -> SDKResult<CreateFileShortcutRespData>

创建文件快捷方式

该接口用于创建文件的快捷方式。

https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/create_shortcut

Source

pub async fn search_files( &self, request: SearchFilesRequest, option: Option<RequestOption>, ) -> SDKResult<SearchFilesRespData>

搜索文件

该接口用于搜索文件。

https://open.feishu.cn/document/ukTMukTMukTM/ugDM4UjL4ADO14COwgTN

Source

pub async fn upload_prepare( &self, request: FileUploadPrepareRequest, option: Option<RequestOption>, ) -> SDKResult<FileUploadPrepareRespData>

分片上传文件-预上传

该接口用于分片上传的预上传步骤,获取上传事务ID和分片信息。

https://open.feishu.cn/document/server-docs/docs/drive-v1/upload/multipart-upload-file-/upload_prepare

Source

pub async fn upload_part( &self, request: FileUploadPartRequest, option: Option<RequestOption>, ) -> SDKResult<FileUploadPartRespData>

分片上传文件-上传分片

该接口用于上传文件分片。

https://open.feishu.cn/document/server-docs/docs/drive-v1/upload/multipart-upload-file-/upload_part

Source

pub async fn upload_finish( &self, request: FileUploadFinishRequest, option: Option<RequestOption>, ) -> SDKResult<FileUploadFinishRespData>

分片上传文件-完成上传

该接口用于完成分片上传。

https://open.feishu.cn/document/server-docs/docs/drive-v1/upload/multipart-upload-file-/upload_finish

Source

pub async fn create_import_task( &self, request: CreateImportTaskRequest, option: Option<RequestOption>, ) -> SDKResult<CreateImportTaskRespData>

创建导入任务

该接口用于创建文档导入任务。

https://open.feishu.cn/document/server-docs/docs/drive-v1/import_task/create

Source

pub async fn get_import_task( &self, request: GetImportTaskRequest, option: Option<RequestOption>, ) -> SDKResult<GetImportTaskRespData>

查询导入任务结果

该接口用于查询导入任务的执行结果。

https://open.feishu.cn/document/server-docs/docs/drive-v1/import_task/get

Trait Implementations§

Source§

impl ExecutableBuilder<FileService, FileUploadPartRequest, FileUploadPartRespData> for FileUploadPartRequestBuilder

Source§

fn build(self) -> FileUploadPartRequest

构建请求对象
Source§

fn execute<'life0, 'async_trait>( self, service: &'life0 FileService, ) -> Pin<Box<dyn Future<Output = SDKResult<FileUploadPartRespData>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

执行请求并返回响应
Source§

fn execute_with_options<'life0, 'async_trait>( self, service: &'life0 FileService, option: RequestOption, ) -> Pin<Box<dyn Future<Output = SDKResult<FileUploadPartRespData>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

带选项执行请求
Source§

impl Service for FileService

Source§

fn config(&self) -> &Config

获取服务配置
Source§

fn service_name() -> &'static str

获取服务名称,用于日志和监控
Source§

fn service_version() -> &'static str

服务版本,用于 API 兼容性

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> 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
Source§

impl<T> ErasedDestructor for T
where T: 'static,