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