#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Prediction {
pub value: ::std::option::Option<::std::string::String>,
pub confidence: ::std::option::Option<f32>,
}
impl Prediction {
pub fn value(&self) -> ::std::option::Option<&str> {
self.value.as_deref()
}
pub fn confidence(&self) -> ::std::option::Option<f32> {
self.confidence
}
}
impl Prediction {
pub fn builder() -> crate::types::builders::PredictionBuilder {
crate::types::builders::PredictionBuilder::default()
}
}
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct PredictionBuilder {
pub(crate) value: ::std::option::Option<::std::string::String>,
pub(crate) confidence: ::std::option::Option<f32>,
}
impl PredictionBuilder {
pub fn value(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.value = ::std::option::Option::Some(input.into());
self
}
pub fn set_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.value = input;
self
}
pub fn get_value(&self) -> &::std::option::Option<::std::string::String> {
&self.value
}
pub fn confidence(mut self, input: f32) -> Self {
self.confidence = ::std::option::Option::Some(input);
self
}
pub fn set_confidence(mut self, input: ::std::option::Option<f32>) -> Self {
self.confidence = input;
self
}
pub fn get_confidence(&self) -> &::std::option::Option<f32> {
&self.confidence
}
pub fn build(self) -> crate::types::Prediction {
crate::types::Prediction {
value: self.value,
confidence: self.confidence,
}
}
}