Asset

Struct Asset 

Source
pub struct Asset {
Show 15 fields pub id: i64, pub name: String, pub external_id: Option<String>, pub parent_id: Option<i64>, pub parent_external_id: Option<String>, pub description: Option<String>, pub metadata: Option<HashMap<String, String>>, pub source: Option<String>, pub created_time: i64, pub last_updated_time: i64, pub root_id: Option<i64>, pub aggregates: Option<AssetAggregate>, pub data_set_id: Option<i64>, pub labels: Option<Vec<CogniteExternalId>>, pub geo_location: Option<GeoLocation>,
}
Expand description

A CDF asset, representing some entity.

Fields§

§id: i64

Server-generated ID of the asset.

§name: String

Name of the asset.

§external_id: Option<String>

Unique user-provided external ID.

§parent_id: Option<i64>

ID of the parent node.

§parent_external_id: Option<String>

External ID of the parent node.

§description: Option<String>

Description of the asset.

§metadata: Option<HashMap<String, String>>

Custom, application specific metadata. String key -> String value. Limits: Maximum length of key is 128 bytes, value 10240 bytes, up to 256 key-value pairs, of total size at most 10240.

§source: Option<String>

Source of the asset.

§created_time: i64

Time this asset was created, in milliseconds since epoch.

§last_updated_time: i64

Time this assset was last updated, in milliseconds since epoch.

§root_id: Option<i64>

ID of the root asset.

§aggregates: Option<AssetAggregate>

Aggregated metrics computed on this asset.

§data_set_id: Option<i64>

ID of the data set this asset belongs to.

§labels: Option<Vec<CogniteExternalId>>

List of the labels associated with this asset.

§geo_location: Option<GeoLocation>

Geographic metadata.

Implementations§

Source§

impl Asset

Source

pub fn new( name: &str, description: &str, external_id: Option<String>, parent_id: Option<i64>, metadata: Option<HashMap<String, String>>, source: Option<String>, ) -> Asset

Create an asset

§Arguments
  • name - Name of the asset.
  • description - Description of the asset.
  • external_id - External ID of the asset, must be unique.
  • parent_id - ID of the parent of this asset.
  • metadata - Optional application specific metadata.
  • source - Source of this asset.

Trait Implementations§

Source§

impl CleanResource<Asset> for AssetsResource

Source§

async fn clean_resource(&self, resources: Vec<Asset>) -> Result<(), Error>

Delete the provided resources.
Source§

impl Clone for Asset

Source§

fn clone(&self) -> Asset

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Create<AddAsset, Asset> for AssetsResource

Source§

fn create( &self, creates: &[TCreate], ) -> impl Future<Output = Result<Vec<TResponse>>> + Send

Create a list of resources. Read more
Source§

fn create_from( &self, creates: &[impl Into<TCreate> + Sync + Clone], ) -> impl Future<Output = Result<Vec<TResponse>>> + Send

Create a list of resources, converting from a different type. Read more
Source§

fn create_ignore_duplicates( &self, creates: &[TCreate], ) -> impl Future<Output = Result<Vec<TResponse>>> + Send
where TCreate: EqIdentity,

Create a list of resources, ignoring any that fail with general “conflict” errors. Read more
Source§

fn create_from_ignore_duplicates<'a, T: 'a>( &self, creates: &'a [impl Into<TCreate> + Sync + Clone], ) -> impl Future<Output = Result<Vec<TResponse>>> + Send
where TCreate: EqIdentity,

Create a list of resources, converting from a different type, and ignoring any that fail with general “conflict” errors. Read more
Source§

impl Debug for Asset

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for Asset

Source§

fn default() -> Asset

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Asset

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl FilterWithRequest<FilterAssetsRequest, Asset> for AssetsResource

Source§

fn filter( &self, filter: TFilter, ) -> impl Future<Output = Result<ItemsVec<TResponse, Cursor>>> + Send

Filter resources. Read more
Source§

fn filter_all( &self, filter: TFilter, ) -> impl Future<Output = Result<Vec<TResponse>>> + Send
where TFilter: SetCursor, TResponse: Send,

Filter resources, following cursors until they are exhausted. Read more
Source§

fn filter_all_stream( &self, filter: TFilter, ) -> impl TryStream<Ok = TResponse, Error = Error, Item = Result<TResponse>> + Send
where TFilter: SetCursor, TResponse: Send + 'static,

Filter resources, following cursors. This returns a stream, you can abort the stream whenever you want and only resources retrieved up to that point will be returned. Read more
Source§

fn filter_all_partitioned( &self, filter: TFilter, num_partitions: u32, ) -> impl Future<Output = Result<Vec<TResponse>>> + Send
where TFilter: SetCursor + WithPartition, TResponse: Send,

Filter resources using partitioned reads, following cursors until all partitions are exhausted. Read more
Source§

fn filter_all_partitioned_stream( &self, filter: TFilter, num_partitions: u32, ) -> impl TryStream<Ok = TResponse, Error = Error, Item = Result<TResponse>> + Send
where TFilter: SetCursor + WithPartition, TResponse: Send + 'static,

Filter resources using partitioned reads, following cursors until all partitions are exhausted. This returns a stream. Read more
Source§

impl From<Asset> for AddAsset

Source§

fn from(asset: Asset) -> AddAsset

Converts to this type from the input type.
Source§

impl From<Asset> for Patch<PatchAsset>

Source§

fn from(value: Asset) -> Self

Converts to this type from the input type.
Source§

impl IntoPatch<Patch<PatchAsset>> for Asset

Source§

fn patch(self, options: &UpsertOptions) -> Patch<PatchAsset>

Convert self into a patch, optionally ignoring null values.
Source§

impl List<AssetQuery, Asset> for AssetsResource

Source§

fn list( &self, params: Option<TParams>, ) -> impl Future<Output = Result<ItemsVec<TResponse, Cursor>>> + Send

Query a resource with optional query parameters. Read more
Source§

fn list_all( &self, params: TParams, ) -> impl Future<Output = Result<Vec<TResponse>>> + Send
where TParams: SetCursor + Clone, TResponse: Send,

Query a resource with query parameters, continuing until the cursor is exhausted. Read more
Source§

fn list_all_stream( &self, params: TParams, ) -> impl TryStream<Ok = TResponse, Error = Error, Item = Result<TResponse>> + Send
where TParams: SetCursor + Clone, TResponse: Send + 'static,

List resources, following cursors. This returns a stream, you can abort the stream whenever you want and only resources retrieved up to that point will be returned. Read more
Source§

impl SearchItems<'_, AssetFilter, AssetSearch, Asset> for AssetsResource

Source§

fn search( &'a self, filter: TFilter, search: TSearch, limit: Option<u32>, ) -> impl Future<Output = Result<Vec<TResponse>>> + Send

Fuzzy search resources. Read more
Source§

impl Serialize for Asset

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Update<Patch<PatchAsset>, Asset> for AssetsResource

Source§

fn update( &self, updates: &[TUpdate], ) -> impl Future<Output = Result<Vec<TResponse>>> + Send

Update a list of resources. Read more
Source§

fn update_from<'a, T>( &self, updates: &'a [T], ) -> impl Future<Output = Result<Vec<TResponse>>> + Send
where T: Sync + Clone + 'a, TUpdate: From<T>,

Update a list of resources by converting to the update from a different type. Read more
Source§

fn update_ignore_unknown_ids( &self, updates: &[TUpdate], ) -> impl Future<Output = Result<Vec<TResponse>>> + Send
where TUpdate: EqIdentity, TResponse: Send,

Update a list of resources, ignoring any that fail due to items missing in CDF. Read more
Source§

fn update_from_ignore_unknown_ids<'a, T>( &self, updates: &'a [T], ) -> impl Future<Output = Result<Vec<TResponse>>> + Send
where T: Sync + Clone + 'a, TUpdate: From<T> + EqIdentity, TResponse: Send,

Update a list of resources by converting from a different type, ignoring any that fail due items missing in CDF. Read more

Auto Trait Implementations§

§

impl Freeze for Asset

§

impl RefUnwindSafe for Asset

§

impl Send for Asset

§

impl Sync for Asset

§

impl Unpin for Asset

§

impl UnwindSafe for Asset

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> IntoPatchItem<UpdateSet<T>> for T

Source§

fn patch(self, _options: &UpsertOptions) -> Option<UpdateSet<T>>

Convert self into a patch, optionally ignoring null values.
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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<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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,