@@ -61,17 +61,25 @@ use std::collections::HashMap;
6161// ============================================================================
6262
6363/// RedisLabs Account Subscription Databases information
64+ ///
65+ /// Response from GET /subscriptions/{subscriptionId}/databases
6466#[ derive( Debug , Clone , Serialize , Deserialize ) ]
6567#[ serde( rename_all = "camelCase" ) ]
6668pub struct AccountSubscriptionDatabases {
69+ /// Account ID
6770 #[ serde( skip_serializing_if = "Option::is_none" ) ]
6871 pub account_id : Option < i32 > ,
6972
70- /// HATEOAS links
73+ /// Subscription information with nested databases array
74+ /// Contains subscriptionId, numberOfDatabases, and databases array
75+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
76+ pub subscription : Option < Value > ,
77+
78+ /// HATEOAS links for API navigation
7179 #[ serde( skip_serializing_if = "Option::is_none" ) ]
7280 pub links : Option < Vec < HashMap < String , Value > > > ,
7381
74- /// Additional fields from the API
82+ /// Only for truly unknown/future API fields
7583 #[ serde( flatten) ]
7684 pub extra : Value ,
7785}
@@ -522,17 +530,176 @@ pub struct DatabaseBackupRequest {
522530}
523531
524532/// Database
533+ ///
534+ /// Represents a Redis Cloud database with all known API fields as first-class struct members.
535+ /// The `extra` field is reserved only for truly unknown/future fields that may be added to the API.
525536#[ derive( Debug , Clone , Serialize , Deserialize ) ]
526537#[ serde( rename_all = "camelCase" ) ]
527538pub struct Database {
539+ /// Database ID - always present in API responses
540+ pub database_id : i32 ,
541+
542+ /// Database name
528543 #[ serde( skip_serializing_if = "Option::is_none" ) ]
529- pub database_id : Option < i32 > ,
544+ pub name : Option < String > ,
530545
531- /// HATEOAS links
546+ /// Database status (e.g., "active", "pending", "error", "draft")
547+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
548+ pub status : Option < String > ,
549+
550+ /// Cloud provider (e.g., "AWS", "GCP", "Azure")
551+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
552+ pub provider : Option < String > ,
553+
554+ /// Cloud region (e.g., "us-east-1", "europe-west1")
555+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
556+ pub region : Option < String > ,
557+
558+ /// Redis version (e.g., "7.2", "7.0")
559+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
560+ pub redis_version : Option < String > ,
561+
562+ /// Redis Serialization Protocol version
563+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
564+ pub resp_version : Option < String > ,
565+
566+ /// Total memory limit in GB (including replication and overhead)
567+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
568+ pub memory_limit_in_gb : Option < f64 > ,
569+
570+ /// Dataset size in GB (actual data size, excluding replication)
571+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
572+ pub dataset_size_in_gb : Option < f64 > ,
573+
574+ /// Memory used in MB
575+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
576+ pub memory_used_in_mb : Option < f64 > ,
577+
578+ /// Private endpoint for database connections
579+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
580+ pub private_endpoint : Option < String > ,
581+
582+ /// Public endpoint for database connections (if enabled)
583+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
584+ pub public_endpoint : Option < String > ,
585+
586+ /// TCP port on which the database is available
587+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
588+ pub port : Option < i32 > ,
589+
590+ /// Data eviction policy (e.g., "volatile-lru", "allkeys-lru", "noeviction")
591+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
592+ pub data_eviction_policy : Option < String > ,
593+
594+ /// Data persistence setting (e.g., "aof-every-1-sec", "snapshot-every-1-hour", "none")
595+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
596+ pub data_persistence : Option < String > ,
597+
598+ /// Whether replication is enabled
599+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
600+ pub replication : Option < bool > ,
601+
602+ /// Protocol used (e.g., "redis", "memcached")
603+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
604+ pub protocol : Option < String > ,
605+
606+ /// Support for OSS Cluster API
607+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
608+ pub support_oss_cluster_api : Option < bool > ,
609+
610+ /// Use external endpoint for OSS Cluster API
611+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
612+ pub use_external_endpoint_for_oss_cluster_api : Option < bool > ,
613+
614+ /// Whether TLS is enabled for connections
615+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
616+ pub enable_tls : Option < bool > ,
617+
618+ /// Throughput measurement configuration
619+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
620+ pub throughput_measurement : Option < DatabaseThroughputSpec > ,
621+
622+ /// Local throughput measurement for Active-Active databases
623+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
624+ pub local_throughput_measurement : Option < Vec < LocalThroughput > > ,
625+
626+ /// Average item size in bytes (for Auto Tiering)
627+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
628+ pub average_item_size_in_bytes : Option < i64 > ,
629+
630+ /// Path to periodic backup storage location
631+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
632+ pub periodic_backup_path : Option < String > ,
633+
634+ /// Remote backup configuration
635+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
636+ pub remote_backup : Option < Value > ,
637+
638+ /// List of source IP addresses or subnet masks allowed to connect
639+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
640+ pub source_ip : Option < Vec < String > > ,
641+
642+ /// Client TLS/SSL certificate (deprecated, use client_tls_certificates)
643+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
644+ pub client_ssl_certificate : Option < String > ,
645+
646+ /// List of client TLS/SSL certificates for mTLS authentication
647+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
648+ pub client_tls_certificates : Option < Vec < Value > > ,
649+
650+ /// Database password (masked in responses for security)
651+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
652+ pub password : Option < String > ,
653+
654+ /// Memcached SASL username
655+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
656+ pub sasl_username : Option < String > ,
657+
658+ /// Memcached SASL password (masked in responses)
659+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
660+ pub sasl_password : Option < String > ,
661+
662+ /// Database alert configurations
663+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
664+ pub alerts : Option < Vec < Value > > ,
665+
666+ /// Redis modules/capabilities enabled on this database
667+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
668+ pub modules : Option < Vec < Value > > ,
669+
670+ /// Database hashing policy for clustering
671+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
672+ pub sharding_type : Option < String > ,
673+
674+ /// Query performance factor (for search and query databases)
675+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
676+ pub query_performance_factor : Option < String > ,
677+
678+ /// List of databases this database is a replica of
679+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
680+ pub replica_of : Option < Vec < String > > ,
681+
682+ /// Replica configuration
683+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
684+ pub replica : Option < Value > ,
685+
686+ /// Whether default Redis user is enabled
687+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
688+ pub enable_default_user : Option < bool > ,
689+
690+ /// Timestamp when database was activated
691+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
692+ pub activated : Option < String > ,
693+
694+ /// Timestamp of last modification
695+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
696+ pub last_modified : Option < String > ,
697+
698+ /// HATEOAS links for API navigation
532699 #[ serde( skip_serializing_if = "Option::is_none" ) ]
533700 pub links : Option < Vec < HashMap < String , Value > > > ,
534701
535- /// Additional fields from the API
702+ /// Only for truly unknown/future API fields. All documented fields should be first-class members above.
536703 #[ serde( flatten) ]
537704 pub extra : Value ,
538705}
0 commit comments