/* Code generated by Azure.Iot.Operations.ProtocolCompilerLib v0.10.0.0; DO NOT EDIT. */
#![allow(unused_imports)]

use std::collections::HashMap;

use chrono::{DateTime, Utc};
use derive_builder::Builder;
use iso8601_duration::Duration;
use serde::{Deserialize, Serialize};
use uuid::Uuid;

use super::super::common_types::{b64::Bytes, date_only::Date, decimal::Decimal, time_only::Time};
use super::asset_event_schema_element_schema::AssetEventSchemaElementSchema;
use super::event_stream_destination::EventStreamDestination;

#[derive(Serialize, Deserialize, Debug, Clone, Builder)]
pub struct AssetEventGroupSchemaElementSchema {
    /// The address of the notifier of the event group in the asset (e.g. URL) so that a client can access the event group on the asset.
    #[serde(rename = "dataSource")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default = "None")]
    pub data_source: Option<String>,

    /// Default destinations for an event group.
    #[serde(rename = "defaultDestinations")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default = "None")]
    pub default_destinations: Option<Vec<EventStreamDestination>>,

    /// Stringified JSON that contains connector-specific configuration for the event group. For OPC UA, this could include configuration like, publishingInterval, samplingInterval, and queueSize.
    #[serde(rename = "eventGroupConfiguration")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default = "None")]
    pub event_group_configuration: Option<String>,

    /// Array of events that are part of the event group. Each event can have per-event configuration.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default = "None")]
    pub events: Option<Vec<AssetEventSchemaElementSchema>>,

    /// Name of the event group.
    pub name: String,

    /// URI or type definition ID.
    #[serde(rename = "typeRef")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default = "None")]
    pub type_ref: Option<String>,
}
