/* Code generated by Azure.Iot.Operations.ProtocolCompilerLib v1.0.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::label::Label;

/// Request payload for listing xRegistry Resources, optionally filtered by Group type, Group, Resource type, and/or label.
#[derive(Serialize, Deserialize, Debug, Clone, Builder)]
pub struct ListResourcesRequestPayload {
    /// Group type. If not specified, Resources are listed across all Group types; in that case groupId must be specified explicitly or allGroups must be true, because the default Group only exists within a specific Group type.
    #[serde(rename = "groupType")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default = "None")]
    pub group_type: Option<String>,

    /// Group identifier. Ignored if allGroups is true. If not specified, the default Group of the specified groupType is used; this default is only valid when groupType is specified, so groupId must be provided when groupType is not.
    #[serde(rename = "groupId")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default = "None")]
    pub group_id: Option<String>,

    /// If true, lists Resources across all Groups (groupId is ignored). If false, lists within the Group specified by groupId, or — only when groupType is specified — the default Group of that type if groupId is unspecified.
    #[serde(rename = "allGroups")]
    pub all_groups: bool,

    /// Resource type. If specified, only Resources of this type are listed; when listing across all Groups, Resources of this type are matched across all Groups. Lists Resources across all Resource types if not specified.
    #[serde(rename = "resourceType")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default = "None")]
    pub resource_type: Option<String>,

    /// If specified, only Resources with this label are listed.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default = "None")]
    pub label: Option<Label>,
}
