Skip to content

Commit

Permalink
Add InfoResponse structure (#187)
Browse files Browse the repository at this point in the history
Signed-off-by: samuel orji <[email protected]>
  • Loading branch information
samuelorji authored Oct 11, 2023
1 parent 5c5a52d commit 94e7b72
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
## [Unreleased]

### Added

- Added InfoResponse structure ([#187](https://github.com/opensearch-project/opensearch-rs/pull/187))
### Dependencies
- Bumps `sysinfo` from 0.28.0 to 0.29.0
- Bumps `serde_with` from ~2 to ~3
Expand Down
1 change: 1 addition & 0 deletions opensearch/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@ mod readme {
pub mod auth;
pub mod cert;
pub mod http;
pub mod models;
pub mod params;

// GENERATED-BEGIN:namespace-modules
Expand Down
25 changes: 25 additions & 0 deletions opensearch/src/models/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
use serde::Deserialize;

#[derive(Deserialize, Debug)]
#[doc = "Cluster information"]
pub struct InfoResponse {
name: String,

Check warning on line 6 in opensearch/src/models/mod.rs

View workflow job for this annotation

GitHub Actions / clippy

fields `name`, `cluster_name`, `cluster_uuid`, `version`, and `tag_line` are never read

warning: fields `name`, `cluster_name`, `cluster_uuid`, `version`, and `tag_line` are never read --> opensearch/src/models/mod.rs:6:5 | 5 | pub struct InfoResponse { | ------------ fields in this struct 6 | name: String, | ^^^^ 7 | cluster_name: String, | ^^^^^^^^^^^^ 8 | cluster_uuid: String, | ^^^^^^^^^^^^ 9 | version: OpenSearchVersionInfo, | ^^^^^^^ 10 | #[serde(rename = "tagline")] 11 | tag_line: String, | ^^^^^^^^ | = note: `InfoResponse` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis = note: `#[warn(dead_code)]` on by default
cluster_name: String,
cluster_uuid: String,
version: OpenSearchVersionInfo,
#[serde(rename = "tagline")]
tag_line: String,
}

#[derive(Deserialize, Debug)]
pub struct OpenSearchVersionInfo {
distribution: String,

Check warning on line 16 in opensearch/src/models/mod.rs

View workflow job for this annotation

GitHub Actions / clippy

multiple fields are never read

warning: multiple fields are never read --> opensearch/src/models/mod.rs:16:5 | 15 | pub struct OpenSearchVersionInfo { | --------------------- fields in this struct 16 | distribution: String, | ^^^^^^^^^^^^ 17 | number: String, | ^^^^^^ 18 | build_type: String, | ^^^^^^^^^^ 19 | build_hash: String, | ^^^^^^^^^^ 20 | build_date: String, | ^^^^^^^^^^ 21 | build_snapshot: bool, | ^^^^^^^^^^^^^^ 22 | lucene_version: String, | ^^^^^^^^^^^^^^ 23 | minimum_wire_compatibility_version: String, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 24 | minimum_index_compatibility_version: String, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `OpenSearchVersionInfo` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
number: String,
build_type: String,
build_hash: String,
build_date: String,
build_snapshot: bool,
lucene_version: String,
minimum_wire_compatibility_version: String,
minimum_index_compatibility_version: String,
}

0 comments on commit 94e7b72

Please sign in to comment.