rivet_client_api_chat/
config.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// Service config.
3///
4pub struct Config {
5	pub(crate) auth: Option<String>,
6	pub(crate) uri: String,
7}
8impl std::fmt::Debug for Config {
9	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10		let mut config = f.debug_struct("Config");
11		config.finish()
12	}
13}
14impl Config {
15	/// Constructs a config builder.
16	pub fn builder() -> Builder {
17		Builder::default()
18	}
19}
20/// Builder for creating a `Config`.
21#[derive(Default)]
22pub struct Builder {
23	pub(crate) auth: Option<String>,
24	pub(crate) uri: Option<String>,
25}
26impl Builder {
27	/// Constructs a config builder.
28	pub fn new() -> Self {
29		Self::default()
30	}
31	/// Sets the bearer token to be used with the Smithy client.
32	pub fn set_bearer_token(mut self, bearer_token: impl std::fmt::Display) -> Self {
33		self.auth = Some(format!("Bearer {}", bearer_token));
34		self
35	}
36	/// Sets the base URI to be used with the Smithy client.
37	pub fn set_uri(mut self, uri: impl ToString) -> Self {
38		self.uri = Some(uri.to_string());
39		self
40	}
41	/// Builds a [`Config`].
42	pub fn build(self) -> Config {
43		Config {
44			auth: self.auth,
45			uri: self.uri.expect("No URI"),
46		}
47	}
48}