Skip to main content

nominal_api/conjure/errors/scout/compute/api/
invalid_field_name.rs

1/// Struct field names cannot contain '.'
2#[derive(
3    Debug,
4    Clone,
5    conjure_object::serde::Serialize,
6    conjure_object::serde::Deserialize,
7    PartialEq,
8    Eq,
9    PartialOrd,
10    Ord,
11    Hash
12)]
13#[serde(crate = "conjure_object::serde")]
14#[conjure_object::private::staged_builder::staged_builder]
15#[builder(crate = conjure_object::private::staged_builder, update, inline)]
16pub struct InvalidFieldName {
17    #[builder(into)]
18    #[serde(rename = "fieldName")]
19    field_name: String,
20}
21impl InvalidFieldName {
22    /// Constructs a new instance of the type.
23    #[inline]
24    pub fn new(field_name: impl Into<String>) -> Self {
25        Self::builder().field_name(field_name).build()
26    }
27    #[inline]
28    pub fn field_name(&self) -> &str {
29        &*self.field_name
30    }
31}
32impl conjure_error::ErrorType for InvalidFieldName {
33    #[inline]
34    fn code() -> conjure_error::ErrorCode {
35        conjure_error::ErrorCode::InvalidArgument
36    }
37    #[inline]
38    fn name() -> &'static str {
39        "Compute:InvalidFieldName"
40    }
41    #[inline]
42    fn safe_args() -> &'static [&'static str] {
43        &[]
44    }
45}