feat: added agent rust client generation
This commit is contained in:
10
public/agent-client/src/models/mod.rs
Normal file
10
public/agent-client/src/models/mod.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
pub mod status_resp;
|
||||
pub use self::status_resp::StatusResp;
|
||||
pub mod validate_and_reload_body;
|
||||
pub use self::validate_and_reload_body::ValidateAndReloadBody;
|
||||
pub mod validate_and_reload_resp;
|
||||
pub use self::validate_and_reload_resp::ValidateAndReloadResp;
|
||||
pub mod validate_body;
|
||||
pub use self::validate_body::ValidateBody;
|
||||
pub mod write_config_body;
|
||||
pub use self::write_config_body::WriteConfigBody;
|
||||
27
public/agent-client/src/models/status_resp.rs
Normal file
27
public/agent-client/src/models/status_resp.rs
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* yanpm-agent
|
||||
*
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
use crate::models;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct StatusResp {
|
||||
#[serde(rename = "ok")]
|
||||
pub ok: bool,
|
||||
}
|
||||
|
||||
impl StatusResp {
|
||||
pub fn new(ok: bool) -> StatusResp {
|
||||
StatusResp {
|
||||
ok,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
30
public/agent-client/src/models/validate_and_reload_body.rs
Normal file
30
public/agent-client/src/models/validate_and_reload_body.rs
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* yanpm-agent
|
||||
*
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
use crate::models;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct ValidateAndReloadBody {
|
||||
#[serde(rename = "config_name")]
|
||||
pub config_name: String,
|
||||
#[serde(rename = "timestamp")]
|
||||
pub timestamp: i64,
|
||||
}
|
||||
|
||||
impl ValidateAndReloadBody {
|
||||
pub fn new(config_name: String, timestamp: i64) -> ValidateAndReloadBody {
|
||||
ValidateAndReloadBody {
|
||||
config_name,
|
||||
timestamp,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
30
public/agent-client/src/models/validate_and_reload_resp.rs
Normal file
30
public/agent-client/src/models/validate_and_reload_resp.rs
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* yanpm-agent
|
||||
*
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
use crate::models;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct ValidateAndReloadResp {
|
||||
#[serde(rename = "rc")]
|
||||
pub rc: i32,
|
||||
#[serde(rename = "ro")]
|
||||
pub ro: String,
|
||||
}
|
||||
|
||||
impl ValidateAndReloadResp {
|
||||
pub fn new(rc: i32, ro: String) -> ValidateAndReloadResp {
|
||||
ValidateAndReloadResp {
|
||||
rc,
|
||||
ro,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
30
public/agent-client/src/models/validate_body.rs
Normal file
30
public/agent-client/src/models/validate_body.rs
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* yanpm-agent
|
||||
*
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
use crate::models;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct ValidateBody {
|
||||
#[serde(rename = "config_name")]
|
||||
pub config_name: String,
|
||||
#[serde(rename = "timestamp")]
|
||||
pub timestamp: i64,
|
||||
}
|
||||
|
||||
impl ValidateBody {
|
||||
pub fn new(config_name: String, timestamp: i64) -> ValidateBody {
|
||||
ValidateBody {
|
||||
config_name,
|
||||
timestamp,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
33
public/agent-client/src/models/write_config_body.rs
Normal file
33
public/agent-client/src/models/write_config_body.rs
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* yanpm-agent
|
||||
*
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
use crate::models;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct WriteConfigBody {
|
||||
#[serde(rename = "config_name")]
|
||||
pub config_name: String,
|
||||
#[serde(rename = "content")]
|
||||
pub content: String,
|
||||
#[serde(rename = "timestamp")]
|
||||
pub timestamp: i64,
|
||||
}
|
||||
|
||||
impl WriteConfigBody {
|
||||
pub fn new(config_name: String, content: String, timestamp: i64) -> WriteConfigBody {
|
||||
WriteConfigBody {
|
||||
config_name,
|
||||
content,
|
||||
timestamp,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user