ORE Studio 0.0.4
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
list_accounts_response Struct Referencefinal

Response containing accounts with pagination metadata. More...

#include <account_protocol.hpp>

Collaboration diagram for list_accounts_response:
Collaboration graph

Public Member Functions

std::vector< std::byte > serialize () const
 Serialize response to bytes.
 

Static Public Member Functions

static std::expected< list_accounts_response, comms::messaging::error_code > deserialize (std::span< const std::byte > data)
 Deserialize response from bytes.
 

Public Attributes

std::vector< domain::accountaccounts
 
std::uint32_t total_available_count = 0
 Total number of accounts available (not just in this page)
 

Detailed Description

Response containing accounts with pagination metadata.

Member Function Documentation

◆ serialize()

std::vector< std::byte > serialize ( ) const

Serialize response to bytes.

Format:

  • 4 bytes: total_available_count (uint32_t)
  • 4 bytes: count (number of accounts in this response)
  • For each account:
    • 4 bytes: version
    • 2 bytes: recorded_by length
    • N bytes: recorded_by (UTF-8)
    • 16 bytes: id (UUID)
    • 2 bytes: username length
    • N bytes: username (UTF-8)
    • 2 bytes: password_hash length
    • N bytes: password_hash (UTF-8)
    • 2 bytes: password_salt length
    • N bytes: password_salt (UTF-8)
    • 2 bytes: totp_secret length
    • N bytes: totp_secret (UTF-8)
    • 2 bytes: email length
    • N bytes: email (UTF-8)
    • 1 byte: is_admin (boolean)