cognite/lib.rs
1#![warn(missing_docs)]
2#![doc = include_str!("../README.md")]
3mod cognite_client;
4
5mod api;
6mod auth;
7mod dto;
8mod error;
9mod retry;
10
11/// SDK library version.
12pub const VERSION: &str = env!("CARGO_PKG_VERSION");
13
14/// Utility methods and tooling.
15pub mod utils;
16
17mod send_helper;
18pub(crate) use send_helper::{CondBoxedStream, CondSend, CondSync};
19
20/// Common types for DTOs.
21pub mod dto_common {
22 pub use super::dto::core::common::*;
23}
24
25/// Assets represent objects or groups of objects from the physical world.
26/// Assets are organized in hierarchies. For example, a water pump asset can
27/// be part of a subsystem asset on an oil platform asset.
28pub mod assets {
29 pub use super::api::core::assets::*;
30 pub use super::dto::core::asset::*;
31}
32
33/// A time series consists of a sequence of data points connected to a single asset.
34/// For example, a water pump asset can have a temperature time series that records a data point in
35/// units of °C every second.
36pub mod time_series {
37 pub use super::api::core::time_series::*;
38 pub use super::dto::core::{datapoint::*, time_series::*};
39}
40
41/// Event objects store complex information about multiple assets over a time period.
42/// Typical types of events might include Alarms, Process Data, and Logs.
43///
44/// For storage of low volume, manually generated, schedulable activities such as
45/// maintenance schedules, work orders, or other "appointment" type activities. The Data Modelling
46/// service is now recommended.
47///
48/// For storage of very high volume discrete events, consider using time series.
49pub mod events {
50 pub use super::api::core::events::*;
51 pub use super::dto::core::event::*;
52}
53
54/// Files store documents, binary blobs, and other file data and relate it to assets.
55pub mod files {
56 pub use super::api::core::files::*;
57 pub use super::dto::core::files::*;
58}
59
60/// Raw is a NoSQL JSON store. Each project can have a variable number of databases,
61/// each of which will have a variable number of tables, each of which will have a variable
62/// number of key-value objects. Only queries on key are supported through this API.
63pub mod raw {
64 pub use super::api::data_ingestion::raw::*;
65 pub use super::dto::data_ingestion::raw::*;
66}
67
68/// Extraction pipelines represent applications and software running outside CDF.
69pub mod extpipes {
70 pub use super::api::data_ingestion::extpipes::*;
71 pub use super::dto::data_ingestion::extpipes::*;
72}
73
74/// Data sets let you document and track data lineage, as well as
75/// restrict access to data.
76///
77/// Data sets group and track data by its source.
78/// For example, a data set can contain all work orders originating from SAP.
79/// Typically, an organization will have one data set for each of its data ingestion pipelines in CDF.
80pub mod datasets {
81 pub use super::api::data_organization::datasets::*;
82 pub use super::dto::data_organization::datasets::*;
83}
84
85/// Labels let you annotate resources such as assets and time series.
86pub mod labels {
87 pub use super::api::data_organization::labels::*;
88 pub use super::dto::data_organization::labels::*;
89}
90
91/// Relationships lets you create custom links between different resources.
92pub mod relationships {
93 pub use super::api::data_organization::relationships::*;
94 pub use super::dto::data_organization::relationships::*;
95}
96
97/// A sequence stores a table with up to 400 columns indexed by row number. There can be at most
98/// 400 numeric columns and 200 string columns. Each of the columns has a pre-defined type:
99/// a string, integer, or floating point number.
100pub mod sequences {
101 pub use super::api::core::sequences::*;
102 pub use super::dto::core::sequences::*;
103}
104
105/// Data modeling lets you create complex data models to model industrial knowledge graphs.
106pub mod models {
107 pub use super::api::data_modeling::*;
108 /// A container represents a bag of properties, each property has a type.
109 /// Containers can have indexes, constraints, and default values.
110 pub mod containers {
111 pub use crate::dto::data_modeling::containers::*;
112 }
113 /// A data model is a collection of views. Use the data model to group and structure views into a
114 /// recognizable and understood model. The model represents a reusable collection of data.
115 pub mod data_models {
116 pub use crate::dto::data_modeling::data_models::*;
117 }
118 /// Instances are nodes and edges in a data model. These contain the actual data in the data model.
119 pub mod instances {
120 pub use crate::dto::data_modeling::instances::*;
121 pub use crate::dto::data_modeling::query::*;
122 }
123 /// Spaces group and namespace data modeling resources.
124 pub mod spaces {
125 pub use crate::dto::data_modeling::spaces::*;
126 }
127 /// Views provide a view into data in containers.
128 pub mod views {
129 pub use crate::dto::data_modeling::views::*;
130 }
131 pub use super::dto::data_modeling::common::*;
132 /// Structures and methods for creating complex data modeling filters.
133 pub mod filter {
134 pub use crate::dto::filter::filter_methods::*;
135 pub use crate::dto::filter::*;
136 }
137
138 /// Records are event-like items contained in a stream, but modelled using data modelling.
139 pub mod records {
140 pub use crate::dto::data_modeling::records::*;
141 pub use crate::dto::data_modeling::streams::*;
142 /// Aggregates on records.
143 pub mod aggregates {
144 pub use crate::dto::data_modeling::records::aggregates::*;
145 }
146 }
147}
148
149/// Groups are used to give principals the capabilities to access CDF resources. One principal
150/// can be a member of multiple groups, and one group can have multiple members.
151///
152/// Security categories can be used to
153/// restrict access to a resource. Applying a security category to a resource means that
154/// only principals (users or service accounts) that also have this security category
155/// can access the resource.
156///
157/// Sessions are used to maintain access to CDF resources for an extended period of time.
158pub mod iam {
159 pub use super::api::iam::{groups::*, security_categories::*, sessions::*};
160 pub use super::dto::iam::{group::*, security_category::*, session::*};
161}
162
163pub use self::{
164 api::{api_client::*, authenticator::*, request_builder::*, resource::*, utils::*},
165 auth::*,
166 cognite_client::*,
167 dto::{filter::*, filter_types::*, identity::*, items::*, params::*, patch_item::*, utils::*},
168 error::*,
169 retry::*,
170};
171
172/// Structures and methods for creating complex filters.
173pub mod filter {
174 pub use super::dto::filter::filter_methods::*;
175}
176
177/// Middleware used by the cognite HTTP client.
178pub mod middleware {
179 pub use crate::auth::AuthenticatorMiddleware;
180 pub use crate::retry::CustomRetryMiddleware;
181}
182
183/// Prelude containing common types and traits used when working with the SDK. This can be
184/// glob-imported for convenience.
185pub mod prelude {
186 pub use super::api::resource::*;
187 pub use super::cognite_client::*;
188 pub use super::dto::filter_types::*;
189 pub use super::dto::identity::*;
190 pub use super::dto::items::*;
191 pub use super::dto::patch_item::*;
192}