pub trait AssetService {
Show 18 methods
// Required methods
fn create_asset(
&self,
auth_: BearerToken,
details: CreateAssetRequest,
) -> Result<Asset, Error>;
fn update_asset(
&self,
auth_: BearerToken,
rid: AssetRid,
details: UpdateAssetRequest,
) -> Result<Asset, Error>;
fn add_data_scopes_to_asset(
&self,
auth_: BearerToken,
asset_rid: AssetRid,
request: AddDataScopesToAssetRequest,
) -> Result<Asset, Error>;
fn get_assets(
&self,
auth_: BearerToken,
rids: BTreeSet<AssetRid>,
) -> Result<BTreeMap<AssetRid, Asset>, Error>;
fn get_assets_by_data_source(
&self,
auth_: BearerToken,
data_source_rid: DataSourceRid,
) -> Result<BTreeSet<Asset>, Error>;
fn archive(
&self,
auth_: BearerToken,
rid: AssetRid,
include_linked_workbooks: Option<bool>,
) -> Result<(), Error>;
fn unarchive(
&self,
auth_: BearerToken,
rid: AssetRid,
include_linked_workbooks: Option<bool>,
) -> Result<(), Error>;
fn search_assets(
&self,
auth_: BearerToken,
search_assets_request: SearchAssetsRequest,
) -> Result<SearchAssetsResponse, Error>;
fn search_types(
&self,
auth_: BearerToken,
search_types_request: SearchTypesRequest,
) -> Result<SearchTypesResponse, Error>;
fn update_asset_attachments(
&self,
auth_: BearerToken,
rid: AssetRid,
request: UpdateAttachmentsRequest,
) -> Result<(), Error>;
fn update_asset_ref_names(
&self,
auth_: BearerToken,
rid: AssetRid,
request: UpdateAssetRefNamesRequest,
) -> Result<(), Error>;
fn create_type(
&self,
auth_: BearerToken,
request: CreateTypeRequest,
) -> Result<Type, Error>;
fn update_type(
&self,
auth_: BearerToken,
type_rid: TypeRid,
request: UpdateTypeRequest,
) -> Result<Type, Error>;
fn get_types(
&self,
auth_: BearerToken,
rids: BTreeSet<TypeRid>,
) -> Result<BTreeMap<TypeRid, Type>, Error>;
fn get_types_for_datasource(
&self,
auth_: BearerToken,
datasource_rid: DataSourceRid,
) -> Result<Vec<Type>, Error>;
fn delete_type(&self, auth_: BearerToken, rid: TypeRid) -> Result<(), Error>;
fn archive_type(
&self,
auth_: BearerToken,
rid: TypeRid,
) -> Result<(), Error>;
fn unarchive_type(
&self,
auth_: BearerToken,
rid: TypeRid,
) -> Result<(), Error>;
}
Expand description
An asset is a physical entity within an organization, such as a vehicle or ground station. Assets are comprised of some metadata about the data, as well as a set of data scopes that define the data belonging to the asset. API endpoints allow for CRUD operations on asset objects.
Required Methods§
fn create_asset( &self, auth_: BearerToken, details: CreateAssetRequest, ) -> Result<Asset, Error>
fn update_asset( &self, auth_: BearerToken, rid: AssetRid, details: UpdateAssetRequest, ) -> Result<Asset, Error>
Sourcefn add_data_scopes_to_asset(
&self,
auth_: BearerToken,
asset_rid: AssetRid,
request: AddDataScopesToAssetRequest,
) -> Result<Asset, Error>
fn add_data_scopes_to_asset( &self, auth_: BearerToken, asset_rid: AssetRid, request: AddDataScopesToAssetRequest, ) -> Result<Asset, Error>
Adds data scopes to an asset.
Throws if the asset already has data scopes with data scope names matching those in the request.
fn get_assets( &self, auth_: BearerToken, rids: BTreeSet<AssetRid>, ) -> Result<BTreeMap<AssetRid, Asset>, Error>
Sourcefn get_assets_by_data_source(
&self,
auth_: BearerToken,
data_source_rid: DataSourceRid,
) -> Result<BTreeSet<Asset>, Error>
fn get_assets_by_data_source( &self, auth_: BearerToken, data_source_rid: DataSourceRid, ) -> Result<BTreeSet<Asset>, Error>
Returns all assets with given data source as a data scope.
fn archive( &self, auth_: BearerToken, rid: AssetRid, include_linked_workbooks: Option<bool>, ) -> Result<(), Error>
fn unarchive( &self, auth_: BearerToken, rid: AssetRid, include_linked_workbooks: Option<bool>, ) -> Result<(), Error>
fn search_assets( &self, auth_: BearerToken, search_assets_request: SearchAssetsRequest, ) -> Result<SearchAssetsResponse, Error>
fn search_types( &self, auth_: BearerToken, search_types_request: SearchTypesRequest, ) -> Result<SearchTypesResponse, Error>
Sourcefn update_asset_attachments(
&self,
auth_: BearerToken,
rid: AssetRid,
request: UpdateAttachmentsRequest,
) -> Result<(), Error>
fn update_asset_attachments( &self, auth_: BearerToken, rid: AssetRid, request: UpdateAttachmentsRequest, ) -> Result<(), Error>
Update the attachments associated with an asset.
Sourcefn update_asset_ref_names(
&self,
auth_: BearerToken,
rid: AssetRid,
request: UpdateAssetRefNamesRequest,
) -> Result<(), Error>
fn update_asset_ref_names( &self, auth_: BearerToken, rid: AssetRid, request: UpdateAssetRefNamesRequest, ) -> Result<(), Error>
Update the ref names for the data scopes on the asset. This update will also be applied on all associated workbooks.
Sourcefn create_type(
&self,
auth_: BearerToken,
request: CreateTypeRequest,
) -> Result<Type, Error>
fn create_type( &self, auth_: BearerToken, request: CreateTypeRequest, ) -> Result<Type, Error>
Creates a new type.
Sourcefn update_type(
&self,
auth_: BearerToken,
type_rid: TypeRid,
request: UpdateTypeRequest,
) -> Result<Type, Error>
fn update_type( &self, auth_: BearerToken, type_rid: TypeRid, request: UpdateTypeRequest, ) -> Result<Type, Error>
Updates a type. Will throw unless all assets that reference the type pass the updated type check.
fn get_types( &self, auth_: BearerToken, rids: BTreeSet<TypeRid>, ) -> Result<BTreeMap<TypeRid, Type>, Error>
fn get_types_for_datasource( &self, auth_: BearerToken, datasource_rid: DataSourceRid, ) -> Result<Vec<Type>, Error>
Sourcefn delete_type(&self, auth_: BearerToken, rid: TypeRid) -> Result<(), Error>
fn delete_type(&self, auth_: BearerToken, rid: TypeRid) -> Result<(), Error>
Deletes a type. The type must not be referenced by any assets.