#[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 VisualCrossingLocator {
    #[serde(rename = "location")]
    location: super::LocationName,
    #[builder(default, into)]
    #[serde(rename = "endpoint", skip_serializing_if = "Option::is_none", default)]
    endpoint: Option<super::VisualCrossingEndpointUri>,
    #[serde(rename = "field")]
    field: super::FieldName,
    #[serde(rename = "type")]
    type_: super::VisualCrossingType,
}
impl VisualCrossingLocator {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(
        location: super::LocationName,
        field: super::FieldName,
        type_: super::VisualCrossingType,
    ) -> Self {
        Self::builder().location(location).field(field).type_(type_).build()
    }
    /// Location to fetch data from.  Can be any arbitrary string (i.e. name, abbreviation,
    /// zip code, lat/long, etc.) as remote endpoint performs location resolution.
    #[inline]
    pub fn location(&self) -> &super::LocationName {
        &self.location
    }
    /// Defaults to HISTORY.  Endpoint to fetch data from for this series.
    #[inline]
    pub fn endpoint(&self) -> Option<&super::VisualCrossingEndpointUri> {
        self.endpoint.as_ref().map(|o| &*o)
    }
    #[inline]
    pub fn field(&self) -> &super::FieldName {
        &self.field
    }
    #[inline]
    pub fn type_(&self) -> &super::VisualCrossingType {
        &self.type_
    }
}
