oxsearch_sql/generated/
clear_cursor.rs1#[derive(Clone, Debug, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
6#[non_exhaustive]
7pub struct RequestBody {
8 pub cursor: ::std::string::String,
10}
11
12impl RequestBody {
13 pub fn new(cursor: impl ::core::convert::Into<::std::string::String>) -> Self {
15 Self {
16 cursor: cursor.into(),
17 }
18 }
19}
20
21impl RequestBody {}
22
23#[derive(Clone, Debug, PartialEq)]
25#[non_exhaustive]
26pub struct Request {
27 pub body: ::core::option::Option<crate::clear_cursor::RequestBody>,
29}
30
31impl Request {
32 pub fn new() -> Self {
34 Self {
35 body: ::core::option::Option::None,
36 }
37 }
38}
39
40impl Request {
41 pub fn body(
43 mut self,
44 value: impl ::core::convert::Into<crate::clear_cursor::RequestBody>,
45 ) -> Self {
46 self.body = ::core::option::Option::Some(value.into());
47 self
48 }
49}
50
51#[derive(Clone, Debug, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
52#[non_exhaustive]
53pub struct Response {
54 #[serde(skip_serializing_if = "::core::option::Option::is_none")]
55 pub succeeded: ::core::option::Option<bool>,
56}
57
58impl Response {
59 pub fn new(succeeded: bool) -> Self {
61 Self {
62 succeeded: ::core::option::Option::Some(succeeded.into()),
63 }
64 }
65}
66
67impl Response {}
68
69impl ::oxsearch_core::Endpoint for Request {
70 type Response = crate::clear_cursor::Response;
71
72 fn name(&self) -> &'static str {
73 "sql.clear_cursor"
74 }
75
76 fn route(&self) -> ::core::result::Result<::oxsearch_core::Route, ::oxsearch_core::Error> {
77 ::core::result::Result::Ok(::oxsearch_core::Route::new(
78 ::oxsearch_core::Method::Post,
79 "/_sql/close",
80 ))
81 }
82
83 fn query(
84 &self,
85 ) -> ::core::result::Result<
86 ::std::vec::Vec<(&'static str, ::std::string::String)>,
87 ::oxsearch_core::Error,
88 > {
89 ::core::result::Result::Ok(::std::vec::Vec::new())
90 }
91
92 fn body(
93 &self,
94 ) -> ::core::result::Result<::core::option::Option<::oxsearch_core::Body>, ::oxsearch_core::Error>
95 {
96 self.body
97 .as_ref()
98 .map(|body| ::oxsearch_core::__private::json_body(body))
99 .transpose()
100 }
101}