fundamentum_sdk_api/
lib.rs

1//! Rust HTTP client targeting Fundamentum IoT devices RestAPI.
2//!
3//! Here are some references to the official documentation for the targeted
4//! RestAPI:
5//!
6//! - [Production API latest][prod-api-latest-swagger]
7//! - [Develop API latest][dev-api-latest-swagger]
8//!
9//! [prod-api-latest-swagger]: https://devices.fundamentum-iot.com/api/v3/docs/
10//! [dev-api-latest-swagger]: https://devices.fundamentum-iot-dev.com/api/v3/docs/
11//!
12//! # Getting Started
13//!
14//! To get started with the SDK, you'll need to install Rust. You can follow the
15//! instructions on the official Rust website: [Install
16//! Rust](https://www.rust-lang.org/tools/install).
17//!
18//! ## Example
19//!
20//! ```ignore
21//! use fundamentum_sdk_api::client::{
22//!     api_version::V3,
23//!     config::{ApiConfig, ClientConfig},
24//!     sdk_api::SdkApi,
25//! };
26//!
27//! #[tokio::main]
28//! async fn main() {
29//!     let client_config = ClientConfig {
30//!         base_path: "http://devices-gateway.fundamentum.test".to_owned(),
31//!         ..ClientConfig::default()
32//!     };
33//!
34//!     let api_config = ApiConfig {
35//!         project_id: 1,
36//!         region_id: 2,
37//!         registry_id: 3,
38//!         access_token: "access_token".to_owned(),
39//!     };
40//!
41//!     let api: SdkApi<V3> = SdkApi::new(client_config, &api_config);
42//!     api.status().await.unwrap();
43//! }
44//! ```
45
46// clippy warning level lints
47#![warn(
48    missing_docs,
49    clippy::pedantic,
50    clippy::nursery,
51    clippy::dbg_macro,
52    clippy::unwrap_used,
53    clippy::map_err_ignore,
54    clippy::unimplemented,
55    clippy::unreachable,
56    clippy::clone_on_ref_ptr,
57    clippy::create_dir,
58    clippy::exit,
59    clippy::filetype_is_file,
60    clippy::float_cmp_const,
61    clippy::indexing_slicing,
62    clippy::let_underscore_must_use,
63    clippy::lossy_float_literal,
64    clippy::pattern_type_mismatch,
65    clippy::string_slice,
66    clippy::try_err
67)]
68// clippy deny/error level lints, they always have  quick fix that should be preferred
69#![deny(
70    clippy::multiple_inherent_impl,
71    clippy::rc_buffer,
72    clippy::rc_mutex,
73    clippy::rest_pat_in_fully_bound_structs,
74    clippy::same_name_method,
75    clippy::self_named_module_files,
76    clippy::separated_literal_suffix,
77    clippy::str_to_string,
78    clippy::string_add,
79    clippy::string_to_string,
80    clippy::unnecessary_self_imports,
81    clippy::unneeded_field_pattern,
82    clippy::verbose_file_reads
83)]
84#![allow(
85       // allowed rules
86       clippy::module_name_repetitions,
87       clippy::similar_names
88   )]
89
90pub mod client;
91pub mod models;