#[derive(Clone, Debug, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
#[non_exhaustive]
pub struct RequestBody {
pub cursor: ::std::string::String,
}
impl RequestBody {
pub fn new(cursor: impl ::core::convert::Into<::std::string::String>) -> Self {
Self {
cursor: cursor.into(),
}
}
}
impl RequestBody {}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub struct Request {
pub body: ::core::option::Option<crate::clear_cursor::RequestBody>,
}
impl Request {
pub fn new() -> Self {
Self {
body: ::core::option::Option::None,
}
}
}
impl Request {
pub fn body(
mut self,
value: impl ::core::convert::Into<crate::clear_cursor::RequestBody>,
) -> Self {
self.body = ::core::option::Option::Some(value.into());
self
}
}
#[derive(Clone, Debug, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
#[non_exhaustive]
pub struct Response {
#[serde(skip_serializing_if = "::core::option::Option::is_none")]
pub succeeded: ::core::option::Option<bool>,
}
impl Response {
pub fn new(succeeded: bool) -> Self {
Self {
succeeded: ::core::option::Option::Some(succeeded.into()),
}
}
}
impl Response {}
impl ::oxsearch_core::Endpoint for Request {
type Response = crate::clear_cursor::Response;
fn name(&self) -> &'static str {
"sql.clear_cursor"
}
fn route(&self) -> ::core::result::Result<::oxsearch_core::Route, ::oxsearch_core::Error> {
::core::result::Result::Ok(::oxsearch_core::Route::new(
::oxsearch_core::Method::Post,
"/_sql/close",
))
}
fn query(
&self,
) -> ::core::result::Result<
::std::vec::Vec<(&'static str, ::std::string::String)>,
::oxsearch_core::Error,
> {
::core::result::Result::Ok(::std::vec::Vec::new())
}
fn body(
&self,
) -> ::core::result::Result<::core::option::Option<::oxsearch_core::Body>, ::oxsearch_core::Error>
{
self.body
.as_ref()
.map(|body| ::oxsearch_core::__private::json_body(body))
.transpose()
}
}