/// Request to create video segments for channel-based ingestion. Internal use only.
#[derive(
    Debug,
    Clone,
    conjure_object::serde::Serialize,
    conjure_object::serde::Deserialize,
    conjure_object::private::DeriveWith
)]
#[serde(crate = "conjure_object::serde")]
#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct CreateSegmentsV2Request {
    #[serde(rename = "datasetRid")]
    dataset_rid: conjure_object::ResourceIdentifier,
    #[serde(rename = "datasetFileId")]
    dataset_file_id: conjure_object::Uuid,
    #[builder(default, list(item(type = super::CreateSegment)))]
    #[serde(rename = "requests", skip_serializing_if = "Vec::is_empty", default)]
    requests: Vec<super::CreateSegment>,
    #[serde(rename = "seriesUuid")]
    series_uuid: conjure_object::Uuid,
    #[builder(default, into)]
    #[serde(
        rename = "overWriteSegments",
        skip_serializing_if = "Option::is_none",
        default
    )]
    over_write_segments: Option<bool>,
}
impl CreateSegmentsV2Request {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(
        dataset_rid: conjure_object::ResourceIdentifier,
        dataset_file_id: conjure_object::Uuid,
        series_uuid: conjure_object::Uuid,
    ) -> Self {
        Self::builder()
            .dataset_rid(dataset_rid)
            .dataset_file_id(dataset_file_id)
            .series_uuid(series_uuid)
            .build()
    }
    #[inline]
    pub fn dataset_rid(&self) -> &conjure_object::ResourceIdentifier {
        &self.dataset_rid
    }
    #[inline]
    pub fn dataset_file_id(&self) -> conjure_object::Uuid {
        self.dataset_file_id
    }
    #[inline]
    pub fn requests(&self) -> &[super::CreateSegment] {
        &*self.requests
    }
    #[inline]
    pub fn series_uuid(&self) -> conjure_object::Uuid {
        self.series_uuid
    }
    /// If true, overlapping segments from other dataset files within the same series will be deleted
    /// before inserting new segments. The cached segment metadata for affected files will be recomputed.
    #[inline]
    pub fn over_write_segments(&self) -> Option<bool> {
        self.over_write_segments.as_ref().map(|o| *o)
    }
}
