ebbmem-client-generated 0.2.0

Production cognitive memory engine and multi-transport gateway for autonomous AI agents. Features continuous mass-dilated logarithmic decay, Hebbian co-activation networks, off-heap mmap storage, and unified enterprise security. Canonical public HTTP contract for Ebb client SDKs. Generated from the hosted FastAPI application. Excludes internal and admin routes (`/api/v1/admin/_**`, `/metrics`, `/mcp`). Protected operations require `Authorization: Bearer <token>` (security scheme `HTTPBearer`). The same routes accept an optional `X-API-Key` header and `X-Ebb-Namespace` to select a namespace. Error responses use the `ErrorResponse` envelope (`code`, `message`, `details`) plus FastAPI's `HTTPValidationError` for 422. SDK subset of the Ebb HTTP contract. Includes Memory, Tasks, Events, and Health. Omits admin, runtime config, provider probes, registration, password reset, and SSO.
Documentation
/*
 * Ebb Memory Engine API
 *
 * Production cognitive memory engine and multi-transport gateway for autonomous AI agents. Features continuous mass-dilated logarithmic decay, Hebbian co-activation networks, off-heap mmap storage, and unified enterprise security.  Canonical public HTTP contract for Ebb client SDKs. Generated from the hosted FastAPI application. Excludes internal and admin routes (`/api/v1/admin/_**`, `/metrics`, `/mcp`). Protected operations require `Authorization: Bearer <token>` (security scheme `HTTPBearer`). The same routes accept an optional `X-API-Key` header and `X-Ebb-Namespace` to select a namespace. Error responses use the `ErrorResponse` envelope (`code`, `message`, `details`) plus FastAPI's `HTTPValidationError` for 422.  SDK subset of the Ebb HTTP contract. Includes Memory, Tasks, Events, and Health. Omits admin, runtime config, provider probes, registration, password reset, and SSO.
 *
 * The version of the OpenAPI document: 0.2.0
 * Contact: maintainers@spectrayan.com
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// MemoryTableResponse : Paginated table response for memory browser with cursor support.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct MemoryTableResponse {
    /// Paginated memory row items
    #[serde(rename = "items", skip_serializing_if = "Option::is_none")]
    pub items: Option<Vec<models::MemoryRow>>,
    /// Alias for items (backward compatibility)
    #[serde(rename = "rows", skip_serializing_if = "Option::is_none")]
    pub rows: Option<Vec<models::MemoryRow>>,
    /// Total count of matching records
    #[serde(rename = "total", skip_serializing_if = "Option::is_none")]
    pub total: Option<i32>,
    /// Alias for total (backward compatibility)
    #[serde(rename = "total_count", skip_serializing_if = "Option::is_none")]
    pub total_count: Option<i32>,
    /// Whether more pages are available
    #[serde(rename = "has_more", skip_serializing_if = "Option::is_none")]
    pub has_more: Option<bool>,
    /// Opaque base64 cursor for next page
    #[serde(rename = "next_cursor", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub next_cursor: Option<Option<String>>,
    /// Page index (legacy pagination)
    #[serde(rename = "page", skip_serializing_if = "Option::is_none")]
    pub page: Option<i32>,
    /// Items per page (legacy pagination)
    #[serde(rename = "page_size", skip_serializing_if = "Option::is_none")]
    pub page_size: Option<i32>,
    /// Counts by tier
    #[serde(rename = "tier_counts", skip_serializing_if = "Option::is_none")]
    pub tier_counts: Option<std::collections::HashMap<String, i32>>,
    /// Tombstone ratios by tier
    #[serde(rename = "tombstone_ratios", skip_serializing_if = "Option::is_none")]
    pub tombstone_ratios: Option<std::collections::HashMap<String, f64>>,
}

impl MemoryTableResponse {
    /// Paginated table response for memory browser with cursor support.
    pub fn new() -> MemoryTableResponse {
        MemoryTableResponse {
            items: None,
            rows: None,
            total: None,
            total_count: None,
            has_more: None,
            next_cursor: None,
            page: None,
            page_size: None,
            tier_counts: None,
            tombstone_ratios: None,
        }
    }
}