/// A validation error with optional location information
#[derive(
    Debug,
    Clone,
    conjure_object::serde::Serialize,
    conjure_object::serde::Deserialize,
    PartialEq,
    Eq,
    PartialOrd,
    Ord,
    Hash
)]
#[serde(crate = "conjure_object::serde")]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct ValidationError {
    #[builder(into)]
    #[serde(rename = "message")]
    message: String,
    #[builder(default, into)]
    #[serde(rename = "line", skip_serializing_if = "Option::is_none", default)]
    line: Option<i32>,
    #[builder(default, into)]
    #[serde(rename = "column", skip_serializing_if = "Option::is_none", default)]
    column: Option<i32>,
}
impl ValidationError {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(message: impl Into<String>) -> Self {
        Self::builder().message(message).build()
    }
    /// Error message
    #[inline]
    pub fn message(&self) -> &str {
        &*self.message
    }
    /// Line number where error occurred
    #[inline]
    pub fn line(&self) -> Option<i32> {
        self.line.as_ref().map(|o| *o)
    }
    /// Column number where error occurred
    #[inline]
    pub fn column(&self) -> Option<i32> {
        self.column.as_ref().map(|o| *o)
    }
}
