#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub(crate) enum DescribeClientQuotaMatchRef<'a> {
Exact(&'a str),
Default,
AnySpecified,
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub(crate) struct DescribeClientQuotaFilterComponentRef<'a> {
entity_type: &'a str,
match_: DescribeClientQuotaMatchRef<'a>,
}
impl<'a> DescribeClientQuotaFilterComponentRef<'a> {
pub(crate) const fn new(entity_type: &'a str, match_: DescribeClientQuotaMatchRef<'a>) -> Self {
Self {
entity_type,
match_,
}
}
pub(crate) const fn entity_type(self) -> &'a str {
self.entity_type
}
pub(crate) const fn match_(self) -> DescribeClientQuotaMatchRef<'a> {
self.match_
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub(crate) struct DescribeClientQuotasFilterRef<'a> {
components: &'a [DescribeClientQuotaFilterComponentRef<'a>],
strict: bool,
}
impl<'a> DescribeClientQuotasFilterRef<'a> {
pub(crate) const fn new(
components: &'a [DescribeClientQuotaFilterComponentRef<'a>],
strict: bool,
) -> Self {
Self { components, strict }
}
pub(crate) const fn components(self) -> &'a [DescribeClientQuotaFilterComponentRef<'a>] {
self.components
}
pub(crate) const fn strict(self) -> bool {
self.strict
}
}
#[derive(Clone, Debug, Eq, PartialEq)]
pub(crate) struct NormalizedClientQuotaEntityComponent {
pub(super) entity_type: String,
pub(super) entity_name: Option<String>,
}
impl NormalizedClientQuotaEntityComponent {
pub(crate) fn into_parts(self) -> (String, Option<String>) {
(self.entity_type, self.entity_name)
}
}
#[derive(Clone, Debug, PartialEq)]
pub(crate) struct NormalizedClientQuotaValue {
pub(super) key: String,
pub(super) value: f64,
}
impl NormalizedClientQuotaValue {
pub(crate) fn into_parts(self) -> (String, f64) {
(self.key, self.value)
}
}
#[derive(Clone, Debug, PartialEq)]
pub(crate) struct NormalizedClientQuotaEntry {
pub(super) entity: Vec<NormalizedClientQuotaEntityComponent>,
pub(super) values: Vec<NormalizedClientQuotaValue>,
}
impl NormalizedClientQuotaEntry {
pub(crate) fn into_parts(
self,
) -> (
Vec<NormalizedClientQuotaEntityComponent>,
Vec<NormalizedClientQuotaValue>,
) {
(self.entity, self.values)
}
}
#[derive(Clone, Debug, PartialEq)]
pub(crate) struct NormalizedDescribeClientQuotasResponse {
pub(super) throttle_time_ms: u32,
pub(super) error_code: i16,
pub(super) error_message: Option<String>,
pub(super) error_message_truncated: bool,
pub(super) entries: Vec<NormalizedClientQuotaEntry>,
pub(super) retained_bytes: usize,
}
impl NormalizedDescribeClientQuotasResponse {
pub(crate) fn into_parts(
self,
) -> (
u32,
i16,
Option<String>,
bool,
Vec<NormalizedClientQuotaEntry>,
usize,
) {
(
self.throttle_time_ms,
self.error_code,
self.error_message,
self.error_message_truncated,
self.entries,
self.retained_bytes,
)
}
}