rivet_kv/
input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2use std::fmt::Write;
3/// See [`DeleteInput`](crate::input::DeleteInput)
4pub mod delete_input {
5	/// A builder for [`DeleteInput`](crate::input::DeleteInput)
6	#[non_exhaustive]
7	#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
8	pub struct Builder {
9		pub(crate) key: std::option::Option<std::string::String>,
10		pub(crate) namespace_id: std::option::Option<std::string::String>,
11	}
12	impl Builder {
13		/// A string reprenting a key in the key-value database. Key path components are split by a slash (e.g. `a/b/c` has the path components `["a", "b", "c"]`). Slashes can be escaped by using a forward slash (e.g. `a/b\/c/d` has the path components `["a", "b/c", "d"]`). See `rivet.api.kv.common#KeyComponents` for the structure of a `rivet.api.kv.common#Key` split by `/`.
14		pub fn key(mut self, input: impl Into<std::string::String>) -> Self {
15			self.key = Some(input.into());
16			self
17		}
18		/// A string reprenting a key in the key-value database. Key path components are split by a slash (e.g. `a/b/c` has the path components `["a", "b", "c"]`). Slashes can be escaped by using a forward slash (e.g. `a/b\/c/d` has the path components `["a", "b/c", "d"]`). See `rivet.api.kv.common#KeyComponents` for the structure of a `rivet.api.kv.common#Key` split by `/`.
19		pub fn set_key(mut self, input: std::option::Option<std::string::String>) -> Self {
20			self.key = input;
21			self
22		}
23		/// A universally unique identifier.
24		pub fn namespace_id(mut self, input: impl Into<std::string::String>) -> Self {
25			self.namespace_id = Some(input.into());
26			self
27		}
28		/// A universally unique identifier.
29		pub fn set_namespace_id(mut self, input: std::option::Option<std::string::String>) -> Self {
30			self.namespace_id = input;
31			self
32		}
33		/// Consumes the builder and constructs a [`DeleteInput`](crate::input::DeleteInput)
34		pub fn build(
35			self,
36		) -> std::result::Result<crate::input::DeleteInput, aws_smithy_http::operation::BuildError>
37		{
38			Ok(crate::input::DeleteInput {
39				key: self.key,
40				namespace_id: self.namespace_id,
41			})
42		}
43	}
44}
45#[doc(hidden)]
46pub type DeleteInputOperationOutputAlias = crate::operation::Delete;
47#[doc(hidden)]
48pub type DeleteInputOperationRetryAlias = ();
49impl DeleteInput {
50	/// Consumes the builder and constructs an Operation<[`Delete`](crate::operation::Delete)>
51	#[allow(unused_mut)]
52	#[allow(clippy::let_and_return)]
53	#[allow(clippy::needless_borrow)]
54	pub async fn make_operation(
55		&self,
56		_config: &crate::config::Config,
57	) -> std::result::Result<
58		aws_smithy_http::operation::Operation<crate::operation::Delete, ()>,
59		aws_smithy_http::operation::BuildError,
60	> {
61		let mut request = {
62			fn uri_base(
63				_input: &crate::input::DeleteInput,
64				output: &mut String,
65			) -> Result<(), aws_smithy_http::operation::BuildError> {
66				write!(output, "/entries").expect("formatting should succeed");
67				Ok(())
68			}
69			fn uri_query(
70				_input: &crate::input::DeleteInput,
71				mut output: &mut String,
72			) -> Result<(), aws_smithy_http::operation::BuildError> {
73				let mut query = aws_smithy_http::query::Writer::new(&mut output);
74				if let Some(inner_1) = &_input.key {
75					query.push_kv("key", &aws_smithy_http::query::fmt_string(&inner_1));
76				}
77				if let Some(inner_2) = &_input.namespace_id {
78					query.push_kv(
79						"namespace_id",
80						&aws_smithy_http::query::fmt_string(&inner_2),
81					);
82				}
83				Ok(())
84			}
85			#[allow(clippy::unnecessary_wraps)]
86			fn update_http_builder(
87				input: &crate::input::DeleteInput,
88				_config: &crate::config::Config,
89				builder: http::request::Builder,
90			) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
91			{
92				let mut _uri = String::new();
93				_uri = format!("{}{}", _config.uri.clone(), _uri);
94				uri_base(input, &mut _uri)?;
95				uri_query(input, &mut _uri)?;
96				Ok(builder.method("DELETE").uri(_uri))
97			}
98			let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?;
99			let mut builder = if let Some(auth) = &_config.auth {
100				builder.header(http::header::AUTHORIZATION, auth.clone())
101			} else {
102				builder
103			};
104			builder
105		};
106		let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
107		#[allow(clippy::useless_conversion)]
108		let body = aws_smithy_http::body::SdkBody::from("");
109		let request = request.body(body).expect("should be valid request");
110		let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
111		request
112			.properties_mut()
113			.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
114		let op =
115			aws_smithy_http::operation::Operation::new(request, crate::operation::Delete::new())
116				.with_metadata(aws_smithy_http::operation::Metadata::new(
117					"Delete",
118					"KvService",
119				));
120		Ok(op)
121	}
122	/// Creates a new builder-style object to manufacture [`DeleteInput`](crate::input::DeleteInput)
123	pub fn builder() -> crate::input::delete_input::Builder {
124		crate::input::delete_input::Builder::default()
125	}
126}
127
128/// See [`DeleteBatchInput`](crate::input::DeleteBatchInput)
129pub mod delete_batch_input {
130	/// A builder for [`DeleteBatchInput`](crate::input::DeleteBatchInput)
131	#[non_exhaustive]
132	#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
133	pub struct Builder {
134		pub(crate) keys: std::option::Option<std::vec::Vec<std::string::String>>,
135		pub(crate) namespace_id: std::option::Option<std::string::String>,
136	}
137	impl Builder {
138		/// Appends an item to `keys`.
139		///
140		/// To override the contents of this collection use [`set_keys`](Self::set_keys).
141		///
142		/// A list of keys.
143		pub fn keys(mut self, input: impl Into<std::string::String>) -> Self {
144			let mut v = self.keys.unwrap_or_default();
145			v.push(input.into());
146			self.keys = Some(v);
147			self
148		}
149		/// A list of keys.
150		pub fn set_keys(
151			mut self,
152			input: std::option::Option<std::vec::Vec<std::string::String>>,
153		) -> Self {
154			self.keys = input;
155			self
156		}
157		/// A universally unique identifier.
158		pub fn namespace_id(mut self, input: impl Into<std::string::String>) -> Self {
159			self.namespace_id = Some(input.into());
160			self
161		}
162		/// A universally unique identifier.
163		pub fn set_namespace_id(mut self, input: std::option::Option<std::string::String>) -> Self {
164			self.namespace_id = input;
165			self
166		}
167		/// Consumes the builder and constructs a [`DeleteBatchInput`](crate::input::DeleteBatchInput)
168		pub fn build(
169			self,
170		) -> std::result::Result<
171			crate::input::DeleteBatchInput,
172			aws_smithy_http::operation::BuildError,
173		> {
174			Ok(crate::input::DeleteBatchInput {
175				keys: self.keys,
176				namespace_id: self.namespace_id,
177			})
178		}
179	}
180}
181#[doc(hidden)]
182pub type DeleteBatchInputOperationOutputAlias = crate::operation::DeleteBatch;
183#[doc(hidden)]
184pub type DeleteBatchInputOperationRetryAlias = ();
185impl DeleteBatchInput {
186	/// Consumes the builder and constructs an Operation<[`DeleteBatch`](crate::operation::DeleteBatch)>
187	#[allow(unused_mut)]
188	#[allow(clippy::let_and_return)]
189	#[allow(clippy::needless_borrow)]
190	pub async fn make_operation(
191		&self,
192		_config: &crate::config::Config,
193	) -> std::result::Result<
194		aws_smithy_http::operation::Operation<crate::operation::DeleteBatch, ()>,
195		aws_smithy_http::operation::BuildError,
196	> {
197		let mut request = {
198			fn uri_base(
199				_input: &crate::input::DeleteBatchInput,
200				output: &mut String,
201			) -> Result<(), aws_smithy_http::operation::BuildError> {
202				write!(output, "/entries/batch").expect("formatting should succeed");
203				Ok(())
204			}
205			fn uri_query(
206				_input: &crate::input::DeleteBatchInput,
207				mut output: &mut String,
208			) -> Result<(), aws_smithy_http::operation::BuildError> {
209				let mut query = aws_smithy_http::query::Writer::new(&mut output);
210				if let Some(inner_3) = &_input.keys {
211					for inner_4 in inner_3 {
212						query.push_kv("keys", &aws_smithy_http::query::fmt_string(&inner_4));
213					}
214				}
215				if let Some(inner_5) = &_input.namespace_id {
216					query.push_kv(
217						"namespace_id",
218						&aws_smithy_http::query::fmt_string(&inner_5),
219					);
220				}
221				Ok(())
222			}
223			#[allow(clippy::unnecessary_wraps)]
224			fn update_http_builder(
225				input: &crate::input::DeleteBatchInput,
226				_config: &crate::config::Config,
227				builder: http::request::Builder,
228			) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
229			{
230				let mut _uri = String::new();
231				_uri = format!("{}{}", _config.uri.clone(), _uri);
232				uri_base(input, &mut _uri)?;
233				uri_query(input, &mut _uri)?;
234				Ok(builder.method("DELETE").uri(_uri))
235			}
236			let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?;
237			let mut builder = if let Some(auth) = &_config.auth {
238				builder.header(http::header::AUTHORIZATION, auth.clone())
239			} else {
240				builder
241			};
242			builder
243		};
244		let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
245		#[allow(clippy::useless_conversion)]
246		let body = aws_smithy_http::body::SdkBody::from("");
247		let request = request.body(body).expect("should be valid request");
248		let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
249		request
250			.properties_mut()
251			.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
252		let op = aws_smithy_http::operation::Operation::new(
253			request,
254			crate::operation::DeleteBatch::new(),
255		)
256		.with_metadata(aws_smithy_http::operation::Metadata::new(
257			"DeleteBatch",
258			"KvService",
259		));
260		Ok(op)
261	}
262	/// Creates a new builder-style object to manufacture [`DeleteBatchInput`](crate::input::DeleteBatchInput)
263	pub fn builder() -> crate::input::delete_batch_input::Builder {
264		crate::input::delete_batch_input::Builder::default()
265	}
266}
267
268/// See [`GetInput`](crate::input::GetInput)
269pub mod get_input {
270	/// A builder for [`GetInput`](crate::input::GetInput)
271	#[non_exhaustive]
272	#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
273	pub struct Builder {
274		pub(crate) key: std::option::Option<std::string::String>,
275		pub(crate) watch_index: std::option::Option<std::string::String>,
276		pub(crate) namespace_id: std::option::Option<std::string::String>,
277	}
278	impl Builder {
279		/// A string reprenting a key in the key-value database. Key path components are split by a slash (e.g. `a/b/c` has the path components `["a", "b", "c"]`). Slashes can be escaped by using a forward slash (e.g. `a/b\/c/d` has the path components `["a", "b/c", "d"]`). See `rivet.api.kv.common#KeyComponents` for the structure of a `rivet.api.kv.common#Key` split by `/`.
280		pub fn key(mut self, input: impl Into<std::string::String>) -> Self {
281			self.key = Some(input.into());
282			self
283		}
284		/// A string reprenting a key in the key-value database. Key path components are split by a slash (e.g. `a/b/c` has the path components `["a", "b", "c"]`). Slashes can be escaped by using a forward slash (e.g. `a/b\/c/d` has the path components `["a", "b/c", "d"]`). See `rivet.api.kv.common#KeyComponents` for the structure of a `rivet.api.kv.common#Key` split by `/`.
285		pub fn set_key(mut self, input: std::option::Option<std::string::String>) -> Self {
286			self.key = input;
287			self
288		}
289		/// A query parameter denoting the requests watch index.
290		pub fn watch_index(mut self, input: impl Into<std::string::String>) -> Self {
291			self.watch_index = Some(input.into());
292			self
293		}
294		/// A query parameter denoting the requests watch index.
295		pub fn set_watch_index(mut self, input: std::option::Option<std::string::String>) -> Self {
296			self.watch_index = input;
297			self
298		}
299		/// A universally unique identifier.
300		pub fn namespace_id(mut self, input: impl Into<std::string::String>) -> Self {
301			self.namespace_id = Some(input.into());
302			self
303		}
304		/// A universally unique identifier.
305		pub fn set_namespace_id(mut self, input: std::option::Option<std::string::String>) -> Self {
306			self.namespace_id = input;
307			self
308		}
309		/// Consumes the builder and constructs a [`GetInput`](crate::input::GetInput)
310		pub fn build(
311			self,
312		) -> std::result::Result<crate::input::GetInput, aws_smithy_http::operation::BuildError> {
313			Ok(crate::input::GetInput {
314				key: self.key,
315				watch_index: self.watch_index,
316				namespace_id: self.namespace_id,
317			})
318		}
319	}
320}
321#[doc(hidden)]
322pub type GetInputOperationOutputAlias = crate::operation::Get;
323#[doc(hidden)]
324pub type GetInputOperationRetryAlias = ();
325impl GetInput {
326	/// Consumes the builder and constructs an Operation<[`Get`](crate::operation::Get)>
327	#[allow(unused_mut)]
328	#[allow(clippy::let_and_return)]
329	#[allow(clippy::needless_borrow)]
330	pub async fn make_operation(
331		&self,
332		_config: &crate::config::Config,
333	) -> std::result::Result<
334		aws_smithy_http::operation::Operation<crate::operation::Get, ()>,
335		aws_smithy_http::operation::BuildError,
336	> {
337		let mut request = {
338			fn uri_base(
339				_input: &crate::input::GetInput,
340				output: &mut String,
341			) -> Result<(), aws_smithy_http::operation::BuildError> {
342				write!(output, "/entries").expect("formatting should succeed");
343				Ok(())
344			}
345			fn uri_query(
346				_input: &crate::input::GetInput,
347				mut output: &mut String,
348			) -> Result<(), aws_smithy_http::operation::BuildError> {
349				let mut query = aws_smithy_http::query::Writer::new(&mut output);
350				if let Some(inner_6) = &_input.key {
351					query.push_kv("key", &aws_smithy_http::query::fmt_string(&inner_6));
352				}
353				if let Some(inner_7) = &_input.watch_index {
354					query.push_kv("watch_index", &aws_smithy_http::query::fmt_string(&inner_7));
355				}
356				if let Some(inner_8) = &_input.namespace_id {
357					query.push_kv(
358						"namespace_id",
359						&aws_smithy_http::query::fmt_string(&inner_8),
360					);
361				}
362				Ok(())
363			}
364			#[allow(clippy::unnecessary_wraps)]
365			fn update_http_builder(
366				input: &crate::input::GetInput,
367				_config: &crate::config::Config,
368				builder: http::request::Builder,
369			) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
370			{
371				let mut _uri = String::new();
372				_uri = format!("{}{}", _config.uri.clone(), _uri);
373				uri_base(input, &mut _uri)?;
374				uri_query(input, &mut _uri)?;
375				Ok(builder.method("GET").uri(_uri))
376			}
377			let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?;
378			let mut builder = if let Some(auth) = &_config.auth {
379				builder.header(http::header::AUTHORIZATION, auth.clone())
380			} else {
381				builder
382			};
383			builder
384		};
385		let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
386		#[allow(clippy::useless_conversion)]
387		let body = aws_smithy_http::body::SdkBody::from("");
388		let request = request.body(body).expect("should be valid request");
389		let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
390		request
391			.properties_mut()
392			.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
393		let op = aws_smithy_http::operation::Operation::new(request, crate::operation::Get::new())
394			.with_metadata(aws_smithy_http::operation::Metadata::new(
395				"Get",
396				"KvService",
397			));
398		Ok(op)
399	}
400	/// Creates a new builder-style object to manufacture [`GetInput`](crate::input::GetInput)
401	pub fn builder() -> crate::input::get_input::Builder {
402		crate::input::get_input::Builder::default()
403	}
404}
405
406/// See [`GetBatchInput`](crate::input::GetBatchInput)
407pub mod get_batch_input {
408	/// A builder for [`GetBatchInput`](crate::input::GetBatchInput)
409	#[non_exhaustive]
410	#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
411	pub struct Builder {
412		pub(crate) keys: std::option::Option<std::vec::Vec<std::string::String>>,
413		pub(crate) watch_index: std::option::Option<std::string::String>,
414		pub(crate) namespace_id: std::option::Option<std::string::String>,
415	}
416	impl Builder {
417		/// Appends an item to `keys`.
418		///
419		/// To override the contents of this collection use [`set_keys`](Self::set_keys).
420		///
421		/// A list of keys.
422		pub fn keys(mut self, input: impl Into<std::string::String>) -> Self {
423			let mut v = self.keys.unwrap_or_default();
424			v.push(input.into());
425			self.keys = Some(v);
426			self
427		}
428		/// A list of keys.
429		pub fn set_keys(
430			mut self,
431			input: std::option::Option<std::vec::Vec<std::string::String>>,
432		) -> Self {
433			self.keys = input;
434			self
435		}
436		/// A query parameter denoting the requests watch index.
437		pub fn watch_index(mut self, input: impl Into<std::string::String>) -> Self {
438			self.watch_index = Some(input.into());
439			self
440		}
441		/// A query parameter denoting the requests watch index.
442		pub fn set_watch_index(mut self, input: std::option::Option<std::string::String>) -> Self {
443			self.watch_index = input;
444			self
445		}
446		/// A universally unique identifier.
447		pub fn namespace_id(mut self, input: impl Into<std::string::String>) -> Self {
448			self.namespace_id = Some(input.into());
449			self
450		}
451		/// A universally unique identifier.
452		pub fn set_namespace_id(mut self, input: std::option::Option<std::string::String>) -> Self {
453			self.namespace_id = input;
454			self
455		}
456		/// Consumes the builder and constructs a [`GetBatchInput`](crate::input::GetBatchInput)
457		pub fn build(
458			self,
459		) -> std::result::Result<crate::input::GetBatchInput, aws_smithy_http::operation::BuildError>
460		{
461			Ok(crate::input::GetBatchInput {
462				keys: self.keys,
463				watch_index: self.watch_index,
464				namespace_id: self.namespace_id,
465			})
466		}
467	}
468}
469#[doc(hidden)]
470pub type GetBatchInputOperationOutputAlias = crate::operation::GetBatch;
471#[doc(hidden)]
472pub type GetBatchInputOperationRetryAlias = ();
473impl GetBatchInput {
474	/// Consumes the builder and constructs an Operation<[`GetBatch`](crate::operation::GetBatch)>
475	#[allow(unused_mut)]
476	#[allow(clippy::let_and_return)]
477	#[allow(clippy::needless_borrow)]
478	pub async fn make_operation(
479		&self,
480		_config: &crate::config::Config,
481	) -> std::result::Result<
482		aws_smithy_http::operation::Operation<crate::operation::GetBatch, ()>,
483		aws_smithy_http::operation::BuildError,
484	> {
485		let mut request = {
486			fn uri_base(
487				_input: &crate::input::GetBatchInput,
488				output: &mut String,
489			) -> Result<(), aws_smithy_http::operation::BuildError> {
490				write!(output, "/entries/batch").expect("formatting should succeed");
491				Ok(())
492			}
493			fn uri_query(
494				_input: &crate::input::GetBatchInput,
495				mut output: &mut String,
496			) -> Result<(), aws_smithy_http::operation::BuildError> {
497				let mut query = aws_smithy_http::query::Writer::new(&mut output);
498				if let Some(inner_9) = &_input.keys {
499					for inner_10 in inner_9 {
500						query.push_kv("keys", &aws_smithy_http::query::fmt_string(&inner_10));
501					}
502				}
503				if let Some(inner_11) = &_input.watch_index {
504					query.push_kv(
505						"watch_index",
506						&aws_smithy_http::query::fmt_string(&inner_11),
507					);
508				}
509				if let Some(inner_12) = &_input.namespace_id {
510					query.push_kv(
511						"namespace_id",
512						&aws_smithy_http::query::fmt_string(&inner_12),
513					);
514				}
515				Ok(())
516			}
517			#[allow(clippy::unnecessary_wraps)]
518			fn update_http_builder(
519				input: &crate::input::GetBatchInput,
520				_config: &crate::config::Config,
521				builder: http::request::Builder,
522			) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
523			{
524				let mut _uri = String::new();
525				_uri = format!("{}{}", _config.uri.clone(), _uri);
526				uri_base(input, &mut _uri)?;
527				uri_query(input, &mut _uri)?;
528				Ok(builder.method("GET").uri(_uri))
529			}
530			let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?;
531			let mut builder = if let Some(auth) = &_config.auth {
532				builder.header(http::header::AUTHORIZATION, auth.clone())
533			} else {
534				builder
535			};
536			builder
537		};
538		let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
539		#[allow(clippy::useless_conversion)]
540		let body = aws_smithy_http::body::SdkBody::from("");
541		let request = request.body(body).expect("should be valid request");
542		let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
543		request
544			.properties_mut()
545			.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
546		let op =
547			aws_smithy_http::operation::Operation::new(request, crate::operation::GetBatch::new())
548				.with_metadata(aws_smithy_http::operation::Metadata::new(
549					"GetBatch",
550					"KvService",
551				));
552		Ok(op)
553	}
554	/// Creates a new builder-style object to manufacture [`GetBatchInput`](crate::input::GetBatchInput)
555	pub fn builder() -> crate::input::get_batch_input::Builder {
556		crate::input::get_batch_input::Builder::default()
557	}
558}
559
560/// See [`PutInput`](crate::input::PutInput)
561pub mod put_input {
562	/// A builder for [`PutInput`](crate::input::PutInput)
563	#[non_exhaustive]
564	#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
565	pub struct Builder {
566		pub(crate) namespace_id: std::option::Option<std::string::String>,
567		pub(crate) key: std::option::Option<std::string::String>,
568		pub(crate) value: std::option::Option<aws_smithy_types::Document>,
569	}
570	impl Builder {
571		/// A universally unique identifier.
572		pub fn namespace_id(mut self, input: impl Into<std::string::String>) -> Self {
573			self.namespace_id = Some(input.into());
574			self
575		}
576		/// A universally unique identifier.
577		pub fn set_namespace_id(mut self, input: std::option::Option<std::string::String>) -> Self {
578			self.namespace_id = input;
579			self
580		}
581		/// Any JSON value to set the key to.
582		pub fn key(mut self, input: impl Into<std::string::String>) -> Self {
583			self.key = Some(input.into());
584			self
585		}
586		/// Any JSON value to set the key to.
587		pub fn set_key(mut self, input: std::option::Option<std::string::String>) -> Self {
588			self.key = input;
589			self
590		}
591		#[allow(missing_docs)] // documentation missing in model
592		pub fn value(mut self, input: aws_smithy_types::Document) -> Self {
593			self.value = Some(input);
594			self
595		}
596		#[allow(missing_docs)] // documentation missing in model
597		pub fn set_value(mut self, input: std::option::Option<aws_smithy_types::Document>) -> Self {
598			self.value = input;
599			self
600		}
601		/// Consumes the builder and constructs a [`PutInput`](crate::input::PutInput)
602		pub fn build(
603			self,
604		) -> std::result::Result<crate::input::PutInput, aws_smithy_http::operation::BuildError> {
605			Ok(crate::input::PutInput {
606				namespace_id: self.namespace_id,
607				key: self.key,
608				value: self.value,
609			})
610		}
611	}
612}
613#[doc(hidden)]
614pub type PutInputOperationOutputAlias = crate::operation::Put;
615#[doc(hidden)]
616pub type PutInputOperationRetryAlias = ();
617impl PutInput {
618	/// Consumes the builder and constructs an Operation<[`Put`](crate::operation::Put)>
619	#[allow(unused_mut)]
620	#[allow(clippy::let_and_return)]
621	#[allow(clippy::needless_borrow)]
622	pub async fn make_operation(
623		&self,
624		_config: &crate::config::Config,
625	) -> std::result::Result<
626		aws_smithy_http::operation::Operation<crate::operation::Put, ()>,
627		aws_smithy_http::operation::BuildError,
628	> {
629		let mut request = {
630			fn uri_base(
631				_input: &crate::input::PutInput,
632				output: &mut String,
633			) -> Result<(), aws_smithy_http::operation::BuildError> {
634				write!(output, "/entries").expect("formatting should succeed");
635				Ok(())
636			}
637			#[allow(clippy::unnecessary_wraps)]
638			fn update_http_builder(
639				input: &crate::input::PutInput,
640				_config: &crate::config::Config,
641				builder: http::request::Builder,
642			) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
643			{
644				let mut _uri = String::new();
645				_uri = format!("{}{}", _config.uri.clone(), _uri);
646				uri_base(input, &mut _uri)?;
647				Ok(builder.method("PUT").uri(_uri))
648			}
649			let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?;
650			let mut builder = if let Some(auth) = &_config.auth {
651				builder.header(http::header::AUTHORIZATION, auth.clone())
652			} else {
653				builder
654			};
655			builder = aws_smithy_http::header::set_request_header_if_absent(
656				builder,
657				http::header::CONTENT_TYPE,
658				"application/json",
659			);
660			builder
661		};
662		let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
663		#[allow(clippy::useless_conversion)]
664		let body = aws_smithy_http::body::SdkBody::from(
665			crate::operation_ser::serialize_operation_crate_operation_put(&self)?,
666		);
667		if let Some(content_length) = body.content_length() {
668			request = aws_smithy_http::header::set_request_header_if_absent(
669				request,
670				http::header::CONTENT_LENGTH,
671				content_length,
672			);
673		}
674		let request = request.body(body).expect("should be valid request");
675		let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
676		request
677			.properties_mut()
678			.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
679		let op = aws_smithy_http::operation::Operation::new(request, crate::operation::Put::new())
680			.with_metadata(aws_smithy_http::operation::Metadata::new(
681				"Put",
682				"KvService",
683			));
684		Ok(op)
685	}
686	/// Creates a new builder-style object to manufacture [`PutInput`](crate::input::PutInput)
687	pub fn builder() -> crate::input::put_input::Builder {
688		crate::input::put_input::Builder::default()
689	}
690}
691
692/// See [`PutBatchInput`](crate::input::PutBatchInput)
693pub mod put_batch_input {
694	/// A builder for [`PutBatchInput`](crate::input::PutBatchInput)
695	#[non_exhaustive]
696	#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
697	pub struct Builder {
698		pub(crate) namespace_id: std::option::Option<std::string::String>,
699		pub(crate) entries: std::option::Option<std::vec::Vec<crate::model::PutEntry>>,
700	}
701	impl Builder {
702		/// A universally unique identifier.
703		pub fn namespace_id(mut self, input: impl Into<std::string::String>) -> Self {
704			self.namespace_id = Some(input.into());
705			self
706		}
707		/// A universally unique identifier.
708		pub fn set_namespace_id(mut self, input: std::option::Option<std::string::String>) -> Self {
709			self.namespace_id = input;
710			self
711		}
712		/// Appends an item to `entries`.
713		///
714		/// To override the contents of this collection use [`set_entries`](Self::set_entries).
715		///
716		/// A list of entries to insert.
717		pub fn entries(mut self, input: crate::model::PutEntry) -> Self {
718			let mut v = self.entries.unwrap_or_default();
719			v.push(input);
720			self.entries = Some(v);
721			self
722		}
723		/// A list of entries to insert.
724		pub fn set_entries(
725			mut self,
726			input: std::option::Option<std::vec::Vec<crate::model::PutEntry>>,
727		) -> Self {
728			self.entries = input;
729			self
730		}
731		/// Consumes the builder and constructs a [`PutBatchInput`](crate::input::PutBatchInput)
732		pub fn build(
733			self,
734		) -> std::result::Result<crate::input::PutBatchInput, aws_smithy_http::operation::BuildError>
735		{
736			Ok(crate::input::PutBatchInput {
737				namespace_id: self.namespace_id,
738				entries: self.entries,
739			})
740		}
741	}
742}
743#[doc(hidden)]
744pub type PutBatchInputOperationOutputAlias = crate::operation::PutBatch;
745#[doc(hidden)]
746pub type PutBatchInputOperationRetryAlias = ();
747impl PutBatchInput {
748	/// Consumes the builder and constructs an Operation<[`PutBatch`](crate::operation::PutBatch)>
749	#[allow(unused_mut)]
750	#[allow(clippy::let_and_return)]
751	#[allow(clippy::needless_borrow)]
752	pub async fn make_operation(
753		&self,
754		_config: &crate::config::Config,
755	) -> std::result::Result<
756		aws_smithy_http::operation::Operation<crate::operation::PutBatch, ()>,
757		aws_smithy_http::operation::BuildError,
758	> {
759		let mut request = {
760			fn uri_base(
761				_input: &crate::input::PutBatchInput,
762				output: &mut String,
763			) -> Result<(), aws_smithy_http::operation::BuildError> {
764				write!(output, "/entries/batch").expect("formatting should succeed");
765				Ok(())
766			}
767			#[allow(clippy::unnecessary_wraps)]
768			fn update_http_builder(
769				input: &crate::input::PutBatchInput,
770				_config: &crate::config::Config,
771				builder: http::request::Builder,
772			) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
773			{
774				let mut _uri = String::new();
775				_uri = format!("{}{}", _config.uri.clone(), _uri);
776				uri_base(input, &mut _uri)?;
777				Ok(builder.method("PUT").uri(_uri))
778			}
779			let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?;
780			let mut builder = if let Some(auth) = &_config.auth {
781				builder.header(http::header::AUTHORIZATION, auth.clone())
782			} else {
783				builder
784			};
785			builder = aws_smithy_http::header::set_request_header_if_absent(
786				builder,
787				http::header::CONTENT_TYPE,
788				"application/json",
789			);
790			builder
791		};
792		let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
793		#[allow(clippy::useless_conversion)]
794		let body = aws_smithy_http::body::SdkBody::from(
795			crate::operation_ser::serialize_operation_crate_operation_put_batch(&self)?,
796		);
797		if let Some(content_length) = body.content_length() {
798			request = aws_smithy_http::header::set_request_header_if_absent(
799				request,
800				http::header::CONTENT_LENGTH,
801				content_length,
802			);
803		}
804		let request = request.body(body).expect("should be valid request");
805		let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
806		request
807			.properties_mut()
808			.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
809		let op =
810			aws_smithy_http::operation::Operation::new(request, crate::operation::PutBatch::new())
811				.with_metadata(aws_smithy_http::operation::Metadata::new(
812					"PutBatch",
813					"KvService",
814				));
815		Ok(op)
816	}
817	/// Creates a new builder-style object to manufacture [`PutBatchInput`](crate::input::PutBatchInput)
818	pub fn builder() -> crate::input::put_batch_input::Builder {
819		crate::input::put_batch_input::Builder::default()
820	}
821}
822
823#[allow(missing_docs)] // documentation missing in model
824#[non_exhaustive]
825#[derive(std::clone::Clone, std::cmp::PartialEq)]
826pub struct PutBatchInput {
827	/// A universally unique identifier.
828	pub namespace_id: std::option::Option<std::string::String>,
829	/// A list of entries to insert.
830	pub entries: std::option::Option<std::vec::Vec<crate::model::PutEntry>>,
831}
832impl PutBatchInput {
833	/// A universally unique identifier.
834	pub fn namespace_id(&self) -> std::option::Option<&str> {
835		self.namespace_id.as_deref()
836	}
837	/// A list of entries to insert.
838	pub fn entries(&self) -> std::option::Option<&[crate::model::PutEntry]> {
839		self.entries.as_deref()
840	}
841}
842impl std::fmt::Debug for PutBatchInput {
843	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
844		let mut formatter = f.debug_struct("PutBatchInput");
845		formatter.field("namespace_id", &self.namespace_id);
846		formatter.field("entries", &self.entries);
847		formatter.finish()
848	}
849}
850
851#[allow(missing_docs)] // documentation missing in model
852#[non_exhaustive]
853#[derive(std::clone::Clone, std::cmp::PartialEq)]
854pub struct DeleteBatchInput {
855	/// A list of keys.
856	pub keys: std::option::Option<std::vec::Vec<std::string::String>>,
857	/// A universally unique identifier.
858	pub namespace_id: std::option::Option<std::string::String>,
859}
860impl DeleteBatchInput {
861	/// A list of keys.
862	pub fn keys(&self) -> std::option::Option<&[std::string::String]> {
863		self.keys.as_deref()
864	}
865	/// A universally unique identifier.
866	pub fn namespace_id(&self) -> std::option::Option<&str> {
867		self.namespace_id.as_deref()
868	}
869}
870impl std::fmt::Debug for DeleteBatchInput {
871	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
872		let mut formatter = f.debug_struct("DeleteBatchInput");
873		formatter.field("keys", &self.keys);
874		formatter.field("namespace_id", &self.namespace_id);
875		formatter.finish()
876	}
877}
878
879#[allow(missing_docs)] // documentation missing in model
880#[non_exhaustive]
881#[derive(std::clone::Clone, std::cmp::PartialEq)]
882pub struct GetBatchInput {
883	/// A list of keys.
884	pub keys: std::option::Option<std::vec::Vec<std::string::String>>,
885	/// A query parameter denoting the requests watch index.
886	pub watch_index: std::option::Option<std::string::String>,
887	/// A universally unique identifier.
888	pub namespace_id: std::option::Option<std::string::String>,
889}
890impl GetBatchInput {
891	/// A list of keys.
892	pub fn keys(&self) -> std::option::Option<&[std::string::String]> {
893		self.keys.as_deref()
894	}
895	/// A query parameter denoting the requests watch index.
896	pub fn watch_index(&self) -> std::option::Option<&str> {
897		self.watch_index.as_deref()
898	}
899	/// A universally unique identifier.
900	pub fn namespace_id(&self) -> std::option::Option<&str> {
901		self.namespace_id.as_deref()
902	}
903}
904impl std::fmt::Debug for GetBatchInput {
905	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
906		let mut formatter = f.debug_struct("GetBatchInput");
907		formatter.field("keys", &self.keys);
908		formatter.field("watch_index", &self.watch_index);
909		formatter.field("namespace_id", &self.namespace_id);
910		formatter.finish()
911	}
912}
913
914#[allow(missing_docs)] // documentation missing in model
915#[non_exhaustive]
916#[derive(std::clone::Clone, std::cmp::PartialEq)]
917pub struct PutInput {
918	/// A universally unique identifier.
919	pub namespace_id: std::option::Option<std::string::String>,
920	/// Any JSON value to set the key to.
921	pub key: std::option::Option<std::string::String>,
922	#[allow(missing_docs)] // documentation missing in model
923	pub value: std::option::Option<aws_smithy_types::Document>,
924}
925impl PutInput {
926	/// A universally unique identifier.
927	pub fn namespace_id(&self) -> std::option::Option<&str> {
928		self.namespace_id.as_deref()
929	}
930	/// Any JSON value to set the key to.
931	pub fn key(&self) -> std::option::Option<&str> {
932		self.key.as_deref()
933	}
934	#[allow(missing_docs)] // documentation missing in model
935	pub fn value(&self) -> std::option::Option<&aws_smithy_types::Document> {
936		self.value.as_ref()
937	}
938}
939impl std::fmt::Debug for PutInput {
940	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
941		let mut formatter = f.debug_struct("PutInput");
942		formatter.field("namespace_id", &self.namespace_id);
943		formatter.field("key", &self.key);
944		formatter.field("value", &self.value);
945		formatter.finish()
946	}
947}
948
949#[allow(missing_docs)] // documentation missing in model
950#[non_exhaustive]
951#[derive(std::clone::Clone, std::cmp::PartialEq)]
952pub struct DeleteInput {
953	/// A string reprenting a key in the key-value database. Key path components are split by a slash (e.g. `a/b/c` has the path components `["a", "b", "c"]`). Slashes can be escaped by using a forward slash (e.g. `a/b\/c/d` has the path components `["a", "b/c", "d"]`). See `rivet.api.kv.common#KeyComponents` for the structure of a `rivet.api.kv.common#Key` split by `/`.
954	pub key: std::option::Option<std::string::String>,
955	/// A universally unique identifier.
956	pub namespace_id: std::option::Option<std::string::String>,
957}
958impl DeleteInput {
959	/// A string reprenting a key in the key-value database. Key path components are split by a slash (e.g. `a/b/c` has the path components `["a", "b", "c"]`). Slashes can be escaped by using a forward slash (e.g. `a/b\/c/d` has the path components `["a", "b/c", "d"]`). See `rivet.api.kv.common#KeyComponents` for the structure of a `rivet.api.kv.common#Key` split by `/`.
960	pub fn key(&self) -> std::option::Option<&str> {
961		self.key.as_deref()
962	}
963	/// A universally unique identifier.
964	pub fn namespace_id(&self) -> std::option::Option<&str> {
965		self.namespace_id.as_deref()
966	}
967}
968impl std::fmt::Debug for DeleteInput {
969	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
970		let mut formatter = f.debug_struct("DeleteInput");
971		formatter.field("key", &self.key);
972		formatter.field("namespace_id", &self.namespace_id);
973		formatter.finish()
974	}
975}
976
977#[allow(missing_docs)] // documentation missing in model
978#[non_exhaustive]
979#[derive(std::clone::Clone, std::cmp::PartialEq)]
980pub struct GetInput {
981	/// A string reprenting a key in the key-value database. Key path components are split by a slash (e.g. `a/b/c` has the path components `["a", "b", "c"]`). Slashes can be escaped by using a forward slash (e.g. `a/b\/c/d` has the path components `["a", "b/c", "d"]`). See `rivet.api.kv.common#KeyComponents` for the structure of a `rivet.api.kv.common#Key` split by `/`.
982	pub key: std::option::Option<std::string::String>,
983	/// A query parameter denoting the requests watch index.
984	pub watch_index: std::option::Option<std::string::String>,
985	/// A universally unique identifier.
986	pub namespace_id: std::option::Option<std::string::String>,
987}
988impl GetInput {
989	/// A string reprenting a key in the key-value database. Key path components are split by a slash (e.g. `a/b/c` has the path components `["a", "b", "c"]`). Slashes can be escaped by using a forward slash (e.g. `a/b\/c/d` has the path components `["a", "b/c", "d"]`). See `rivet.api.kv.common#KeyComponents` for the structure of a `rivet.api.kv.common#Key` split by `/`.
990	pub fn key(&self) -> std::option::Option<&str> {
991		self.key.as_deref()
992	}
993	/// A query parameter denoting the requests watch index.
994	pub fn watch_index(&self) -> std::option::Option<&str> {
995		self.watch_index.as_deref()
996	}
997	/// A universally unique identifier.
998	pub fn namespace_id(&self) -> std::option::Option<&str> {
999		self.namespace_id.as_deref()
1000	}
1001}
1002impl std::fmt::Debug for GetInput {
1003	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1004		let mut formatter = f.debug_struct("GetInput");
1005		formatter.field("key", &self.key);
1006		formatter.field("watch_index", &self.watch_index);
1007		formatter.field("namespace_id", &self.namespace_id);
1008		formatter.finish()
1009	}
1010}