//! Generated by `trust-tasks-codegen` — do not edit by hand.
//!
//! Spec slug: `rooms/info`. Version: `0.3`.
#[allow(unused_imports)]
use serde::{Deserialize, Serialize};
/// Error types.
pub mod error {
/// Error from a `TryFrom` or `FromStr` implementation.
pub struct ConversionError(::std::borrow::Cow<'static, str>);
impl ::std::error::Error for ConversionError {}
impl ::std::fmt::Display for ConversionError {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> {
::std::fmt::Display::fmt(&self.0, f)
}
}
impl ::std::fmt::Debug for ConversionError {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> {
::std::fmt::Debug::fmt(&self.0, f)
}
}
impl From<&'static str> for ConversionError {
fn from(value: &'static str) -> Self {
Self(value.into())
}
}
impl From<String> for ConversionError {
fn from(value: String) -> Self {
Self(value.into())
}
}
}
/**
What a party presents to act on a room. Carries the whole authority chain: a host MUST NOT dereference an authority credential's `parent` to fetch a link it was not given. Resolving over the network would make verification depend on availability, turn every identifier into a request the host can be induced to make against an address the holder chooses, and signal credential use to whoever hosts the identifier. A host MUST bind the presenter to the chain's leaf. A chain that verifies is evidence that authority was conferred on somebody; it is not evidence that the party presenting it is that somebody. The leaf's subject MUST equal the party the host authenticated for this request — an identity the transport established or a document `proof` proved, never one named in a payload. A host that omits this check authorizes every captured presentation, and the omission is silent, because the chain still verifies.
**Every credential is its issuer's attestation, and only its issuer's.** For the membership credential and for every link of `authority`, a host MUST verify the credential's `proof` with a key that the credential's own `issuer` lists for `assertionMethod` in its DID document, and MUST refuse a credential whose proof names a verification method that is not its issuer's. A proof that verifies under some other party's key is that party's statement, not the issuer's, and confers nothing. The same binding holds for every other document a room signs, such as a `RevocationList`.
**A chain that verifies may still be revoked.** A host that has accepted a `RevocationList` for the room (`rooms/revocations/put`) MUST, from the moment it accepted it, refuse every presentation in which the membership credential or any link of `authority` is revoked by that list, under every task and every version of every task it serves for the room. A chain from which any link is revoked is refused whole: a credential delegated from a revoked one confers nothing, however it was attenuated. The refusal is the same `permissionDenied` as any other failed presentation.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "AuthorityPresentation",
/// "description": "What a party presents to act on a room. Carries the whole authority chain: a host MUST NOT dereference an authority credential's `parent` to fetch a link it was not given. Resolving over the network would make verification depend on availability, turn every identifier into a request the host can be induced to make against an address the holder chooses, and signal credential use to whoever hosts the identifier. A host MUST bind the presenter to the chain's leaf. A chain that verifies is evidence that authority was conferred on somebody; it is not evidence that the party presenting it is that somebody. The leaf's subject MUST equal the party the host authenticated for this request — an identity the transport established or a document `proof` proved, never one named in a payload. A host that omits this check authorizes every captured presentation, and the omission is silent, because the chain still verifies.\n\n**Every credential is its issuer's attestation, and only its issuer's.** For the membership credential and for every link of `authority`, a host MUST verify the credential's `proof` with a key that the credential's own `issuer` lists for `assertionMethod` in its DID document, and MUST refuse a credential whose proof names a verification method that is not its issuer's. A proof that verifies under some other party's key is that party's statement, not the issuer's, and confers nothing. The same binding holds for every other document a room signs, such as a `RevocationList`.\n\n**A chain that verifies may still be revoked.** A host that has accepted a `RevocationList` for the room (`rooms/revocations/put`) MUST, from the moment it accepted it, refuse every presentation in which the membership credential or any link of `authority` is revoked by that list, under every task and every version of every task it serves for the room. A chain from which any link is revoked is refused whole: a credential delegated from a revoked one confers nothing, however it was attenuated. The refusal is the same `permissionDenied` as any other failed presentation.",
/// "type": "object",
/// "required": [
/// "authority",
/// "membership"
/// ],
/// "properties": {
/// "authority": {
/// "description": "The authority chain, LEAF FIRST: the first element is the credential being relied on and the last MUST be one issued by the room itself. Every link the presenter relies on is present, because the host will not fetch one. Capped at 8: verification is linear in chain length and runs on every operation, so an unbounded chain is a denial-of-service surface against the host. The known uses need 2 to 3 — a person attenuating to an agent, and that agent to a sub-agent.",
/// "type": "array",
/// "items": {
/// "type": "string"
/// },
/// "maxItems": 8,
/// "minItems": 1
/// },
/// "membership": {
/// "description": "The presenter's membership credential for this room, or — on a `private` room — a zero-knowledge presentation of it. Serialized per the governing profile.",
/// "type": "string"
/// },
/// "subjectBinding": {
/// "description": "REQUIRED on a `private` room, where the subject identifier is withheld: a proof that the membership credential and the authority chain's leaf describe the SAME subject. Without it two parties pool credentials — one contributes membership, the other authority — and the combination verifies as a single party holding both. A host MUST refuse a private-room presentation that omits this.",
/// "type": "string"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
#[non_exhaustive]
pub struct AuthorityPresentation {
///The authority chain, LEAF FIRST: the first element is the credential being relied on and the last MUST be one issued by the room itself. Every link the presenter relies on is present, because the host will not fetch one. Capped at 8: verification is linear in chain length and runs on every operation, so an unbounded chain is a denial-of-service surface against the host. The known uses need 2 to 3 — a person attenuating to an agent, and that agent to a sub-agent.
pub authority: ::std::vec::Vec<::std::string::String>,
///The presenter's membership credential for this room, or — on a `private` room — a zero-knowledge presentation of it. Serialized per the governing profile.
pub membership: ::std::string::String,
///REQUIRED on a `private` room, where the subject identifier is withheld: a proof that the membership credential and the authority chain's leaf describe the SAME subject. Without it two parties pool credentials — one contributes membership, the other authority — and the combination verifies as a single party holding both. A host MUST refuse a private-room presentation that omits this.
#[serde(
rename = "subjectBinding",
default,
skip_serializing_if = "::std::option::Option::is_none"
)]
pub subject_binding: ::std::option::Option<::std::string::String>,
}
impl AuthorityPresentation {
pub fn builder() -> builder::AuthorityPresentation {
Default::default()
}
}
///Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "Ext",
/// "description": "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.",
/// "type": "object",
/// "minProperties": 1,
/// "additionalProperties": true,
/// "propertyNames": {
/// "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct Ext(pub ::std::collections::HashMap<ExtKey, ::serde_json::Value>);
impl ::std::ops::Deref for Ext {
type Target = ::std::collections::HashMap<ExtKey, ::serde_json::Value>;
fn deref(&self) -> &::std::collections::HashMap<ExtKey, ::serde_json::Value> {
&self.0
}
}
impl ::std::convert::From<Ext> for ::std::collections::HashMap<ExtKey, ::serde_json::Value> {
fn from(value: Ext) -> Self {
value.0
}
}
impl ::std::convert::From<::std::collections::HashMap<ExtKey, ::serde_json::Value>> for Ext {
fn from(value: ::std::collections::HashMap<ExtKey, ::serde_json::Value>) -> Self {
Self(value)
}
}
///`ExtKey`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ExtKey(::std::string::String);
impl ::std::ops::Deref for ExtKey {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<ExtKey> for ::std::string::String {
fn from(value: ExtKey) -> Self {
value.0
}
}
impl ::std::str::FromStr for ExtKey {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
::std::sync::LazyLock::new(|| {
::regress::Regex::new("^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$").unwrap()
});
if PATTERN.find(value).is_none() {
return Err("doesn't match pattern \"^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$\"".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for ExtKey {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ExtKey {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ExtKey {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for ExtKey {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///A member asks a room's host what it holds about the room: its tier, its current epoch, how long it keeps its records and when it last pruned them, the limits the host applies to its files, and how much of them the room and the member have used.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "$id": "https://trusttasks.org/spec/rooms/info/0.3",
/// "title": "Payload",
/// "description": "A member asks a room's host what it holds about the room: its tier, its current epoch, how long it keeps its records and when it last pruned them, the limits the host applies to its files, and how much of them the room and the member have used.",
/// "type": "object",
/// "required": [
/// "presentation",
/// "roomId"
/// ],
/// "properties": {
/// "ext": {
/// "description": "Ecosystem-defined extension members per SPEC.md §4.5.1.",
/// "$ref": "#/definitions/Ext"
/// },
/// "presentation": {
/// "description": "Must confer the `read` action at this room's scope.",
/// "$ref": "#/definitions/AuthorityPresentation"
/// },
/// "roomId": {
/// "description": "The room's identifier. The host verifies the presentation against credentials issued by this identifier, never against a member list of its own.",
/// "type": "string"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
#[non_exhaustive]
pub struct Payload {
///Ecosystem-defined extension members per SPEC.md §4.5.1.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub ext: ::std::option::Option<Ext>,
///Must confer the `read` action at this room's scope.
pub presentation: AuthorityPresentation,
///The room's identifier. The host verifies the presentation against credentials issued by this identifier, never against a member list of its own.
#[serde(rename = "roomId")]
pub room_id: ::std::string::String,
}
impl Payload {
pub fn builder() -> builder::Payload {
Default::default()
}
}
/**
The mark a prune leaves: **that** records were removed, when, and how many — never which, and never anything they said.
A prune removes records outright, tombstones included, so the room's record tree loses leaves and an incremental reader has nothing left to learn the removal from. This is what it learns from instead. A host keeps the latest one per room and serves it with every listing that can carry it (`rooms/records/list` 0.3, as `lastPrune`); a reader whose own copy of the room was synchronised to a version below `version` MUST rebuild that copy from a full listing — no `sinceVersion` — and drop every record the full listing no longer holds. Without that, a record the room removed lives on in every cache that synchronised before the prune, and a record retracted while the reader was away comes back as current.
**What a host keeps and what it does not.** A host keeps this marker, and in its audit trail the prune's `reason`, its requester where the tier discloses one, and the retention it was made under. It MUST NOT keep anything a pruned record said — body, ciphertext, cleartext, title, description, file or blob — and SHOULD NOT keep pruned records' keys: the count is the audit, and a list of keys on an `open` room, where keys may be descriptive, is content by another name.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "RecordPrune",
/// "description": "The mark a prune leaves: **that** records were removed, when, and how many — never which, and never anything they said.\n\nA prune removes records outright, tombstones included, so the room's record tree loses leaves and an incremental reader has nothing left to learn the removal from. This is what it learns from instead. A host keeps the latest one per room and serves it with every listing that can carry it (`rooms/records/list` 0.3, as `lastPrune`); a reader whose own copy of the room was synchronised to a version below `version` MUST rebuild that copy from a full listing — no `sinceVersion` — and drop every record the full listing no longer holds. Without that, a record the room removed lives on in every cache that synchronised before the prune, and a record retracted while the reader was away comes back as current.\n\n**What a host keeps and what it does not.** A host keeps this marker, and in its audit trail the prune's `reason`, its requester where the tier discloses one, and the retention it was made under. It MUST NOT keep anything a pruned record said — body, ciphertext, cleartext, title, description, file or blob — and SHOULD NOT keep pruned records' keys: the count is the audit, and a list of keys on an `open` room, where keys may be descriptive, is content by another name.",
/// "type": "object",
/// "required": [
/// "prunedAt",
/// "removed",
/// "version"
/// ],
/// "properties": {
/// "prunedAt": {
/// "description": "When the host performed it.",
/// "type": "string",
/// "format": "date-time"
/// },
/// "removed": {
/// "description": "How many records were removed, tombstones included. A prune that removed nothing leaves no mark.",
/// "type": "integer",
/// "minimum": 1.0
/// },
/// "version": {
/// "description": "The version the prune took from the room's counter, as a put or a curation would. No record carries it; it is what moves `HeadVersion` past the removal, so that a root taken before and a root taken after are never labelled with one version.",
/// "type": "integer",
/// "minimum": 1.0
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
#[non_exhaustive]
pub struct RecordPrune {
///When the host performed it.
#[serde(rename = "prunedAt")]
pub pruned_at: ::chrono::DateTime<::chrono::offset::Utc>,
///How many records were removed, tombstones included. A prune that removed nothing leaves no mark.
pub removed: ::std::num::NonZeroU64,
///The version the prune took from the room's counter, as a put or a curation would. No record carries it; it is what moves `HeadVersion` past the removal, so that a root taken before and a root taken after are never labelled with one version.
pub version: ::std::num::NonZeroU64,
}
impl RecordPrune {
pub fn builder() -> builder::RecordPrune {
Default::default()
}
}
/**
How long a room keeps its records, by age: the room's **record retention**. Records older than it states become **eligible** to be removed by `rooms/records/prune`; nothing is removed until a holder of `admin` asks for a prune, and nothing a prune removes can be brought back.
**Not `retentionPolicy`, and not `retentionDays`.** Both names are taken in this family and mean other things. `retentionPolicy` (`RetentionPolicy`) is whether a room's *key chain* lets a member read epochs from before they joined, fixed at creation because key material either exists for an epoch or it does not. `retentionDays` (`rooms/create`) is how long a host keeps a whole room after it lapses unrenewed. This is a third question — how long the room keeps its *records* while it is live — and unlike the first it is a decision a room revisits, so it is changeable (`rooms/records/retention/set`). A name sharing either's would invite a reader to apply one's rules to the other.
**Age is the host's to measure, so age is `updatedAt`.** On the sealed tiers a host can read nothing of a record but its key, version, status, pinning and when it last changed, so a policy the host applies can only be stated in those terms. That is also why it cannot use a record's own `validUntil`, which is sealed: expiry is a reader's rule, retention a host's. A curation is a change, so it restarts a record's age — a retraction starts a tombstone's.
**Absent, or `{}`, means no record is ever eligible by age**, and that is the reading a host MUST apply whenever it cannot read a policy: removing data under a rule nobody stated is the failure this member exists to prevent. Every member can read the policy in force (`rooms/info`), so a record is never removed under a rule its readers could not have known.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "RecordRetention",
/// "description": "How long a room keeps its records, by age: the room's **record retention**. Records older than it states become **eligible** to be removed by `rooms/records/prune`; nothing is removed until a holder of `admin` asks for a prune, and nothing a prune removes can be brought back.\n\n**Not `retentionPolicy`, and not `retentionDays`.** Both names are taken in this family and mean other things. `retentionPolicy` (`RetentionPolicy`) is whether a room's *key chain* lets a member read epochs from before they joined, fixed at creation because key material either exists for an epoch or it does not. `retentionDays` (`rooms/create`) is how long a host keeps a whole room after it lapses unrenewed. This is a third question — how long the room keeps its *records* while it is live — and unlike the first it is a decision a room revisits, so it is changeable (`rooms/records/retention/set`). A name sharing either's would invite a reader to apply one's rules to the other.\n\n**Age is the host's to measure, so age is `updatedAt`.** On the sealed tiers a host can read nothing of a record but its key, version, status, pinning and when it last changed, so a policy the host applies can only be stated in those terms. That is also why it cannot use a record's own `validUntil`, which is sealed: expiry is a reader's rule, retention a host's. A curation is a change, so it restarts a record's age — a retraction starts a tombstone's.\n\n**Absent, or `{}`, means no record is ever eligible by age**, and that is the reading a host MUST apply whenever it cannot read a policy: removing data under a rule nobody stated is the failure this member exists to prevent. Every member can read the policy in force (`rooms/info`), so a record is never removed under a rule its readers could not have known.",
/// "type": "object",
/// "properties": {
/// "ext": {
/// "description": "Ecosystem-defined extension members per SPEC.md §4.5.1. A host MUST NOT treat a member here as making more records eligible: a removal rule a member's reader cannot understand is one they were never told about.",
/// "$ref": "#/definitions/Ext"
/// },
/// "recordDays": {
/// "description": "Days a record is kept after it last changed, whatever its standing. A record — `active`, `deprecated` or `retracted` — whose `updatedAt` is more than this long ago is eligible, **unless it is pinned**: pinning says what matters in the room, and a room that wants a pinned record gone unpins it first. Absent means records are never eligible by age.",
/// "type": "integer",
/// "maximum": 36500.0,
/// "minimum": 1.0
/// },
/// "tombstoneDays": {
/// "description": "Days a retracted record's tombstone is kept after its retraction. A tombstone whose `updatedAt` is more than this long ago is eligible. Tombstones exist so that a member syncing incrementally learns of a retraction (`rooms/records/curate`); this is how long a member may stay away and still learn of one that way rather than by rebuilding their copy of the room. Absent means tombstones are never eligible.",
/// "type": "integer",
/// "maximum": 36500.0,
/// "minimum": 1.0
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
#[non_exhaustive]
pub struct RecordRetention {
///Ecosystem-defined extension members per SPEC.md §4.5.1. A host MUST NOT treat a member here as making more records eligible: a removal rule a member's reader cannot understand is one they were never told about.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub ext: ::std::option::Option<Ext>,
///Days a record is kept after it last changed, whatever its standing. A record — `active`, `deprecated` or `retracted` — whose `updatedAt` is more than this long ago is eligible, **unless it is pinned**: pinning says what matters in the room, and a room that wants a pinned record gone unpins it first. Absent means records are never eligible by age.
#[serde(
rename = "recordDays",
default,
skip_serializing_if = "::std::option::Option::is_none"
)]
pub record_days: ::std::option::Option<::std::num::NonZeroU64>,
///Days a retracted record's tombstone is kept after its retraction. A tombstone whose `updatedAt` is more than this long ago is eligible. Tombstones exist so that a member syncing incrementally learns of a retraction (`rooms/records/curate`); this is how long a member may stay away and still learn of one that way rather than by rebuilding their copy of the room. Absent means tombstones are never eligible.
#[serde(
rename = "tombstoneDays",
default,
skip_serializing_if = "::std::option::Option::is_none"
)]
pub tombstone_days: ::std::option::Option<::std::num::NonZeroU64>,
}
impl ::std::default::Default for RecordRetention {
fn default() -> Self {
Self {
ext: Default::default(),
record_days: Default::default(),
tombstone_days: Default::default(),
}
}
}
impl RecordRetention {
pub fn builder() -> builder::RecordRetention {
Default::default()
}
}
///Success response to rooms/info. Type https://trusttasks.org/spec/rooms/info/0.3#response.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "Response",
/// "description": "Success response to rooms/info. Type https://trusttasks.org/spec/rooms/info/0.3#response.",
/// "type": "object",
/// "required": [
/// "epoch",
/// "limits",
/// "roomId",
/// "usage",
/// "visibility"
/// ],
/// "properties": {
/// "epoch": {
/// "description": "The room's current epoch as the host knows it: the one a record or file must be sealed under to be accepted now.",
/// "type": "integer",
/// "minimum": 1.0
/// },
/// "ext": {
/// "$ref": "#/definitions/Ext"
/// },
/// "lastPrune": {
/// "description": "The room's latest record prune: when, how many, and the version it took. Absent when the room's records have never been pruned. A reader whose copy of the room was synchronised below `lastPrune.version` rebuilds it (`RecordPrune`).",
/// "$ref": "#/definitions/RecordPrune"
/// },
/// "limits": {
/// "description": "The limits the host applies to this room, after any override for the room and capped by the host-wide ceiling. `member` here is the room's default per-member allowance; the presenter's own, which may differ, is under `usage.member.limits`.",
/// "$ref": "#/definitions/RoomLimits"
/// },
/// "recordRetention": {
/// "description": "The room's record retention in force: which records `rooms/records/prune` may remove, by age. Absent means none — no record is eligible by age. Served to every member who may read the room, because a record is never to be removed under a rule its readers could not have read.",
/// "$ref": "#/definitions/RecordRetention"
/// },
/// "retentionPolicy": {
/// "description": "Absent means `chained`, as everywhere in this family.",
/// "$ref": "#/definitions/RetentionPolicy"
/// },
/// "roomId": {
/// "description": "The room this describes, echoed so a response cannot be mistaken for another room's.",
/// "type": "string"
/// },
/// "usage": {
/// "type": "object",
/// "required": [
/// "room"
/// ],
/// "properties": {
/// "member": {
/// "description": "The presenter's own use and allowance: charged to the subject at the root of the presented chain, so an agent sees its member's figures. Absent on a `private` room, where the host does not know which member is asking.",
/// "type": "object",
/// "required": [
/// "limits",
/// "usage"
/// ],
/// "properties": {
/// "limits": {
/// "description": "The limits that apply to this member in this room: an override set for them by the host's administrators if there is one, else the room's per-member default.",
/// "$ref": "#/definitions/ScopeLimits"
/// },
/// "usage": {
/// "$ref": "#/definitions/Usage"
/// }
/// },
/// "additionalProperties": false
/// },
/// "room": {
/// "description": "The room as a whole.",
/// "$ref": "#/definitions/Usage"
/// }
/// },
/// "additionalProperties": false
/// },
/// "visibility": {
/// "$ref": "#/definitions/Visibility"
/// }
/// },
/// "additionalProperties": false,
/// "$anchor": "response"
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
#[non_exhaustive]
pub struct Response {
///The room's current epoch as the host knows it: the one a record or file must be sealed under to be accepted now.
pub epoch: ::std::num::NonZeroU64,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub ext: ::std::option::Option<Ext>,
///The room's latest record prune: when, how many, and the version it took. Absent when the room's records have never been pruned. A reader whose copy of the room was synchronised below `lastPrune.version` rebuilds it (`RecordPrune`).
#[serde(
rename = "lastPrune",
default,
skip_serializing_if = "::std::option::Option::is_none"
)]
pub last_prune: ::std::option::Option<RecordPrune>,
///The limits the host applies to this room, after any override for the room and capped by the host-wide ceiling. `member` here is the room's default per-member allowance; the presenter's own, which may differ, is under `usage.member.limits`.
pub limits: RoomLimits,
///The room's record retention in force: which records `rooms/records/prune` may remove, by age. Absent means none — no record is eligible by age. Served to every member who may read the room, because a record is never to be removed under a rule its readers could not have read.
#[serde(
rename = "recordRetention",
default,
skip_serializing_if = "::std::option::Option::is_none"
)]
pub record_retention: ::std::option::Option<RecordRetention>,
///Absent means `chained`, as everywhere in this family.
#[serde(
rename = "retentionPolicy",
default,
skip_serializing_if = "::std::option::Option::is_none"
)]
pub retention_policy: ::std::option::Option<RetentionPolicy>,
///The room this describes, echoed so a response cannot be mistaken for another room's.
#[serde(rename = "roomId")]
pub room_id: ::std::string::String,
pub usage: ResponseUsage,
pub visibility: Visibility,
}
impl Response {
pub fn builder() -> builder::Response {
Default::default()
}
}
///`ResponseUsage`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "room"
/// ],
/// "properties": {
/// "member": {
/// "description": "The presenter's own use and allowance: charged to the subject at the root of the presented chain, so an agent sees its member's figures. Absent on a `private` room, where the host does not know which member is asking.",
/// "type": "object",
/// "required": [
/// "limits",
/// "usage"
/// ],
/// "properties": {
/// "limits": {
/// "description": "The limits that apply to this member in this room: an override set for them by the host's administrators if there is one, else the room's per-member default.",
/// "$ref": "#/definitions/ScopeLimits"
/// },
/// "usage": {
/// "$ref": "#/definitions/Usage"
/// }
/// },
/// "additionalProperties": false
/// },
/// "room": {
/// "description": "The room as a whole.",
/// "$ref": "#/definitions/Usage"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
#[non_exhaustive]
pub struct ResponseUsage {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub member: ::std::option::Option<ResponseUsageMember>,
///The room as a whole.
pub room: Usage,
}
impl ResponseUsage {
pub fn builder() -> builder::ResponseUsage {
Default::default()
}
}
///The presenter's own use and allowance: charged to the subject at the root of the presented chain, so an agent sees its member's figures. Absent on a `private` room, where the host does not know which member is asking.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The presenter's own use and allowance: charged to the subject at the root of the presented chain, so an agent sees its member's figures. Absent on a `private` room, where the host does not know which member is asking.",
/// "type": "object",
/// "required": [
/// "limits",
/// "usage"
/// ],
/// "properties": {
/// "limits": {
/// "description": "The limits that apply to this member in this room: an override set for them by the host's administrators if there is one, else the room's per-member default.",
/// "$ref": "#/definitions/ScopeLimits"
/// },
/// "usage": {
/// "$ref": "#/definitions/Usage"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
#[non_exhaustive]
pub struct ResponseUsageMember {
///The limits that apply to this member in this room: an override set for them by the host's administrators if there is one, else the room's per-member default.
pub limits: ScopeLimits,
pub usage: Usage,
}
impl ResponseUsageMember {
pub fn builder() -> builder::ResponseUsageMember {
Default::default()
}
}
///Whether a room keeps its history readable across a membership change, fixed at creation and immutable thereafter — like `Visibility`, and for the same reason: the rungs of an epoch key chain either exist for an epoch or they do not, and no later change of mind can seal key material that was never sealed or unseal what was already severed. `chained`: each advance produces an `EpochLink`, so every member reads the room's whole retained history however long they have been in it — what a **library** wants, at the cost of post-compromise security for record content, since a compromised current key then reaches every retained epoch. `fromJoin`: no rungs are produced, so a member reads only from the epoch their group state is at — what a **stream** wants, and what a room under a strict forward-secrecy obligation wants, at the cost that a joining member finds an empty-looking room and nobody can reread a record once their group state has moved past the epoch it was sealed under. Absent means `chained`; see the prose on why the absent case is the readable one.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "RetentionPolicy",
/// "description": "Whether a room keeps its history readable across a membership change, fixed at creation and immutable thereafter — like `Visibility`, and for the same reason: the rungs of an epoch key chain either exist for an epoch or they do not, and no later change of mind can seal key material that was never sealed or unseal what was already severed. `chained`: each advance produces an `EpochLink`, so every member reads the room's whole retained history however long they have been in it — what a **library** wants, at the cost of post-compromise security for record content, since a compromised current key then reaches every retained epoch. `fromJoin`: no rungs are produced, so a member reads only from the epoch their group state is at — what a **stream** wants, and what a room under a strict forward-secrecy obligation wants, at the cost that a joining member finds an empty-looking room and nobody can reread a record once their group state has moved past the epoch it was sealed under. Absent means `chained`; see the prose on why the absent case is the readable one.",
/// "type": "string",
/// "enum": [
/// "chained",
/// "fromJoin"
/// ],
/// "$comment": "Deliberately no JSON Schema `default`. A declared default is materialised by the generated bindings — the member becomes non-optional with a serde default — so an absent value would reappear as an explicit one on re-serialisation and break round-trip idempotence for every document written before this member existed. The meaning of absence is stated in prose, where a binding cannot act on it."
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
#[non_exhaustive]
pub enum RetentionPolicy {
#[serde(rename = "chained")]
Chained,
#[serde(rename = "fromJoin")]
FromJoin,
}
impl ::std::fmt::Display for RetentionPolicy {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Chained => f.write_str("chained"),
Self::FromJoin => f.write_str("fromJoin"),
}
}
}
impl ::std::str::FromStr for RetentionPolicy {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"chained" => Ok(Self::Chained),
"fromJoin" => Ok(Self::FromJoin),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for RetentionPolicy {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for RetentionPolicy {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for RetentionPolicy {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///How much a host is willing to store for one room, at the room and per member. A hosting decision, set by the host and never by anything in the room's credentials. An upload must fit every scope at once: the object against the smallest `maxFileBytes` that applies, and the member and the room with the file added.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "RoomLimits",
/// "description": "How much a host is willing to store for one room, at the room and per member. A hosting decision, set by the host and never by anything in the room's credentials. An upload must fit every scope at once: the object against the smallest `maxFileBytes` that applies, and the member and the room with the file added.",
/// "type": "object",
/// "required": [
/// "filesEnabled"
/// ],
/// "properties": {
/// "filesEnabled": {
/// "description": "False refuses every rooms/blobs/* upload for the room. Reads of blobs already stored continue.",
/// "type": "boolean"
/// },
/// "member": {
/// "description": "Limits on each member's own uploads in this room, unless that member has an override. A member is the subject at the root of the authority chain they present, never the key that signed, so an agent acting on an attenuated chain spends its member's allowance. Not applied on a `private` room, where the host cannot tell members apart; the room and object limits still hold there.",
/// "$ref": "#/definitions/ScopeLimits"
/// },
/// "room": {
/// "description": "Limits on the room as a whole.",
/// "$ref": "#/definitions/ScopeLimits"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
#[non_exhaustive]
pub struct RoomLimits {
///False refuses every rooms/blobs/* upload for the room. Reads of blobs already stored continue.
#[serde(rename = "filesEnabled")]
pub files_enabled: bool,
///Limits on each member's own uploads in this room, unless that member has an override. A member is the subject at the root of the authority chain they present, never the key that signed, so an agent acting on an attenuated chain spends its member's allowance. Not applied on a `private` room, where the host cannot tell members apart; the room and object limits still hold there.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub member: ::std::option::Option<ScopeLimits>,
///Limits on the room as a whole.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub room: ::std::option::Option<ScopeLimits>,
}
impl RoomLimits {
pub fn builder() -> builder::RoomLimits {
Default::default()
}
}
///Limits at one scope. Every member is optional: an absent member means the scope sets no limit of that kind, and the next wider scope's limit, or the host's ceiling, governs. All sizes are ciphertext bytes.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "ScopeLimits",
/// "description": "Limits at one scope. Every member is optional: an absent member means the scope sets no limit of that kind, and the next wider scope's limit, or the host's ceiling, governs. All sizes are ciphertext bytes.",
/// "type": "object",
/// "properties": {
/// "maxBytes": {
/// "description": "The total size of the committed and reserved blobs the scope may hold.",
/// "type": "integer",
/// "minimum": 0.0
/// },
/// "maxFileBytes": {
/// "description": "The largest single blob the scope accepts. Never above 1 GiB, the transfer ceiling (BlobManifest).",
/// "type": "integer",
/// "maximum": 1073741824.0,
/// "minimum": 0.0
/// },
/// "maxFiles": {
/// "description": "The number of committed blobs the scope may hold. 0 refuses every upload at this scope.",
/// "type": "integer",
/// "minimum": 0.0
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
#[non_exhaustive]
pub struct ScopeLimits {
///The total size of the committed and reserved blobs the scope may hold.
#[serde(
rename = "maxBytes",
default,
skip_serializing_if = "::std::option::Option::is_none"
)]
pub max_bytes: ::std::option::Option<u64>,
///The largest single blob the scope accepts. Never above 1 GiB, the transfer ceiling (BlobManifest).
#[serde(
rename = "maxFileBytes",
default,
skip_serializing_if = "::std::option::Option::is_none"
)]
pub max_file_bytes: ::std::option::Option<i64>,
///The number of committed blobs the scope may hold. 0 refuses every upload at this scope.
#[serde(
rename = "maxFiles",
default,
skip_serializing_if = "::std::option::Option::is_none"
)]
pub max_files: ::std::option::Option<u64>,
}
impl ::std::default::Default for ScopeLimits {
fn default() -> Self {
Self {
max_bytes: Default::default(),
max_file_bytes: Default::default(),
max_files: Default::default(),
}
}
}
impl ScopeLimits {
pub fn builder() -> builder::ScopeLimits {
Default::default()
}
}
///What one scope holds now. Ciphertext bytes throughout.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "Usage",
/// "description": "What one scope holds now. Ciphertext bytes throughout.",
/// "type": "object",
/// "required": [
/// "bytes",
/// "files",
/// "reservedBytes"
/// ],
/// "properties": {
/// "bytes": {
/// "description": "Their total size. A blob stops counting the moment it is orphaned (its last record dropped it or was retracted), not when the host finally deletes it, so a member who deletes a file has the room back at once.",
/// "type": "integer",
/// "minimum": 0.0
/// },
/// "files": {
/// "description": "Committed blobs that are not orphaned.",
/// "type": "integer",
/// "minimum": 0.0
/// },
/// "reservedBytes": {
/// "description": "Bytes reserved by uploads begun and not yet committed, aborted or expired. Counted against `maxBytes`, so two concurrent uploads cannot both fit under a limit only one of them fits.",
/// "type": "integer",
/// "minimum": 0.0
/// },
/// "reservedFiles": {
/// "description": "Uploads begun and not yet committed, aborted or expired. Counted against `maxFiles`.",
/// "type": "integer",
/// "minimum": 0.0
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
#[non_exhaustive]
pub struct Usage {
///Their total size. A blob stops counting the moment it is orphaned (its last record dropped it or was retracted), not when the host finally deletes it, so a member who deletes a file has the room back at once.
pub bytes: u64,
///Committed blobs that are not orphaned.
pub files: u64,
///Bytes reserved by uploads begun and not yet committed, aborted or expired. Counted against `maxBytes`, so two concurrent uploads cannot both fit under a limit only one of them fits.
#[serde(rename = "reservedBytes")]
pub reserved_bytes: u64,
///Uploads begun and not yet committed, aborted or expired. Counted against `maxFiles`.
#[serde(
rename = "reservedFiles",
default,
skip_serializing_if = "::std::option::Option::is_none"
)]
pub reserved_files: ::std::option::Option<u64>,
}
impl Usage {
pub fn builder() -> builder::Usage {
Default::default()
}
}
///How much of a room its host can see, fixed at creation and immutable thereafter. `open`: records are cleartext, searchable and fully audited. `attributed`: record content is sealed, and the host still learns which member acted. `private`: content is sealed and membership is presented in zero knowledge, so the host verifies that a member acted without learning which. Immutable because a downgrade cannot un-see cleartext and an upgrade would protect only what came after while presenting as though it protected everything.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "Visibility",
/// "description": "How much of a room its host can see, fixed at creation and immutable thereafter. `open`: records are cleartext, searchable and fully audited. `attributed`: record content is sealed, and the host still learns which member acted. `private`: content is sealed and membership is presented in zero knowledge, so the host verifies that a member acted without learning which. Immutable because a downgrade cannot un-see cleartext and an upgrade would protect only what came after while presenting as though it protected everything.",
/// "type": "string",
/// "enum": [
/// "open",
/// "attributed",
/// "private"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
#[non_exhaustive]
pub enum Visibility {
#[serde(rename = "open")]
Open,
#[serde(rename = "attributed")]
Attributed,
#[serde(rename = "private")]
Private,
}
impl ::std::fmt::Display for Visibility {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Open => f.write_str("open"),
Self::Attributed => f.write_str("attributed"),
Self::Private => f.write_str("private"),
}
}
}
impl ::std::str::FromStr for Visibility {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"open" => Ok(Self::Open),
"attributed" => Ok(Self::Attributed),
"private" => Ok(Self::Private),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for Visibility {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for Visibility {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for Visibility {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
/// Types for composing complex structures.
pub mod builder {
#[derive(Clone, Debug)]
pub struct AuthorityPresentation {
authority:
::std::result::Result<::std::vec::Vec<::std::string::String>, ::std::string::String>,
membership: ::std::result::Result<::std::string::String, ::std::string::String>,
subject_binding: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
}
impl ::std::default::Default for AuthorityPresentation {
fn default() -> Self {
Self {
authority: Err("no value supplied for authority".to_string()),
membership: Err("no value supplied for membership".to_string()),
subject_binding: Ok(Default::default()),
}
}
}
impl AuthorityPresentation {
pub fn authority<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.authority = value
.try_into()
.map_err(|e| format!("error converting supplied value for authority: {e}"));
self
}
pub fn membership<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.membership = value
.try_into()
.map_err(|e| format!("error converting supplied value for membership: {e}"));
self
}
pub fn subject_binding<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.subject_binding = value
.try_into()
.map_err(|e| format!("error converting supplied value for subject_binding: {e}"));
self
}
}
impl ::std::convert::TryFrom<AuthorityPresentation> for super::AuthorityPresentation {
type Error = super::error::ConversionError;
fn try_from(
value: AuthorityPresentation,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
authority: value.authority?,
membership: value.membership?,
subject_binding: value.subject_binding?,
})
}
}
impl ::std::convert::From<super::AuthorityPresentation> for AuthorityPresentation {
fn from(value: super::AuthorityPresentation) -> Self {
Self {
authority: Ok(value.authority),
membership: Ok(value.membership),
subject_binding: Ok(value.subject_binding),
}
}
}
#[derive(Clone, Debug)]
pub struct Payload {
ext: ::std::result::Result<::std::option::Option<super::Ext>, ::std::string::String>,
presentation: ::std::result::Result<super::AuthorityPresentation, ::std::string::String>,
room_id: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for Payload {
fn default() -> Self {
Self {
ext: Ok(Default::default()),
presentation: Err("no value supplied for presentation".to_string()),
room_id: Err("no value supplied for room_id".to_string()),
}
}
}
impl Payload {
pub fn ext<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::Ext>>,
T::Error: ::std::fmt::Display,
{
self.ext = value
.try_into()
.map_err(|e| format!("error converting supplied value for ext: {e}"));
self
}
pub fn presentation<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::AuthorityPresentation>,
T::Error: ::std::fmt::Display,
{
self.presentation = value
.try_into()
.map_err(|e| format!("error converting supplied value for presentation: {e}"));
self
}
pub fn room_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.room_id = value
.try_into()
.map_err(|e| format!("error converting supplied value for room_id: {e}"));
self
}
}
impl ::std::convert::TryFrom<Payload> for super::Payload {
type Error = super::error::ConversionError;
fn try_from(value: Payload) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
ext: value.ext?,
presentation: value.presentation?,
room_id: value.room_id?,
})
}
}
impl ::std::convert::From<super::Payload> for Payload {
fn from(value: super::Payload) -> Self {
Self {
ext: Ok(value.ext),
presentation: Ok(value.presentation),
room_id: Ok(value.room_id),
}
}
}
#[derive(Clone, Debug)]
pub struct RecordPrune {
pruned_at:
::std::result::Result<::chrono::DateTime<::chrono::offset::Utc>, ::std::string::String>,
removed: ::std::result::Result<::std::num::NonZeroU64, ::std::string::String>,
version: ::std::result::Result<::std::num::NonZeroU64, ::std::string::String>,
}
impl ::std::default::Default for RecordPrune {
fn default() -> Self {
Self {
pruned_at: Err("no value supplied for pruned_at".to_string()),
removed: Err("no value supplied for removed".to_string()),
version: Err("no value supplied for version".to_string()),
}
}
}
impl RecordPrune {
pub fn pruned_at<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::chrono::DateTime<::chrono::offset::Utc>>,
T::Error: ::std::fmt::Display,
{
self.pruned_at = value
.try_into()
.map_err(|e| format!("error converting supplied value for pruned_at: {e}"));
self
}
pub fn removed<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::num::NonZeroU64>,
T::Error: ::std::fmt::Display,
{
self.removed = value
.try_into()
.map_err(|e| format!("error converting supplied value for removed: {e}"));
self
}
pub fn version<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::num::NonZeroU64>,
T::Error: ::std::fmt::Display,
{
self.version = value
.try_into()
.map_err(|e| format!("error converting supplied value for version: {e}"));
self
}
}
impl ::std::convert::TryFrom<RecordPrune> for super::RecordPrune {
type Error = super::error::ConversionError;
fn try_from(
value: RecordPrune,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
pruned_at: value.pruned_at?,
removed: value.removed?,
version: value.version?,
})
}
}
impl ::std::convert::From<super::RecordPrune> for RecordPrune {
fn from(value: super::RecordPrune) -> Self {
Self {
pruned_at: Ok(value.pruned_at),
removed: Ok(value.removed),
version: Ok(value.version),
}
}
}
#[derive(Clone, Debug)]
pub struct RecordRetention {
ext: ::std::result::Result<::std::option::Option<super::Ext>, ::std::string::String>,
record_days: ::std::result::Result<
::std::option::Option<::std::num::NonZeroU64>,
::std::string::String,
>,
tombstone_days: ::std::result::Result<
::std::option::Option<::std::num::NonZeroU64>,
::std::string::String,
>,
}
impl ::std::default::Default for RecordRetention {
fn default() -> Self {
Self {
ext: Ok(Default::default()),
record_days: Ok(Default::default()),
tombstone_days: Ok(Default::default()),
}
}
}
impl RecordRetention {
pub fn ext<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::Ext>>,
T::Error: ::std::fmt::Display,
{
self.ext = value
.try_into()
.map_err(|e| format!("error converting supplied value for ext: {e}"));
self
}
pub fn record_days<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::num::NonZeroU64>>,
T::Error: ::std::fmt::Display,
{
self.record_days = value
.try_into()
.map_err(|e| format!("error converting supplied value for record_days: {e}"));
self
}
pub fn tombstone_days<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::num::NonZeroU64>>,
T::Error: ::std::fmt::Display,
{
self.tombstone_days = value
.try_into()
.map_err(|e| format!("error converting supplied value for tombstone_days: {e}"));
self
}
}
impl ::std::convert::TryFrom<RecordRetention> for super::RecordRetention {
type Error = super::error::ConversionError;
fn try_from(
value: RecordRetention,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
ext: value.ext?,
record_days: value.record_days?,
tombstone_days: value.tombstone_days?,
})
}
}
impl ::std::convert::From<super::RecordRetention> for RecordRetention {
fn from(value: super::RecordRetention) -> Self {
Self {
ext: Ok(value.ext),
record_days: Ok(value.record_days),
tombstone_days: Ok(value.tombstone_days),
}
}
}
#[derive(Clone, Debug)]
pub struct Response {
epoch: ::std::result::Result<::std::num::NonZeroU64, ::std::string::String>,
ext: ::std::result::Result<::std::option::Option<super::Ext>, ::std::string::String>,
last_prune:
::std::result::Result<::std::option::Option<super::RecordPrune>, ::std::string::String>,
limits: ::std::result::Result<super::RoomLimits, ::std::string::String>,
record_retention: ::std::result::Result<
::std::option::Option<super::RecordRetention>,
::std::string::String,
>,
retention_policy: ::std::result::Result<
::std::option::Option<super::RetentionPolicy>,
::std::string::String,
>,
room_id: ::std::result::Result<::std::string::String, ::std::string::String>,
usage: ::std::result::Result<super::ResponseUsage, ::std::string::String>,
visibility: ::std::result::Result<super::Visibility, ::std::string::String>,
}
impl ::std::default::Default for Response {
fn default() -> Self {
Self {
epoch: Err("no value supplied for epoch".to_string()),
ext: Ok(Default::default()),
last_prune: Ok(Default::default()),
limits: Err("no value supplied for limits".to_string()),
record_retention: Ok(Default::default()),
retention_policy: Ok(Default::default()),
room_id: Err("no value supplied for room_id".to_string()),
usage: Err("no value supplied for usage".to_string()),
visibility: Err("no value supplied for visibility".to_string()),
}
}
}
impl Response {
pub fn epoch<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::num::NonZeroU64>,
T::Error: ::std::fmt::Display,
{
self.epoch = value
.try_into()
.map_err(|e| format!("error converting supplied value for epoch: {e}"));
self
}
pub fn ext<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::Ext>>,
T::Error: ::std::fmt::Display,
{
self.ext = value
.try_into()
.map_err(|e| format!("error converting supplied value for ext: {e}"));
self
}
pub fn last_prune<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::RecordPrune>>,
T::Error: ::std::fmt::Display,
{
self.last_prune = value
.try_into()
.map_err(|e| format!("error converting supplied value for last_prune: {e}"));
self
}
pub fn limits<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::RoomLimits>,
T::Error: ::std::fmt::Display,
{
self.limits = value
.try_into()
.map_err(|e| format!("error converting supplied value for limits: {e}"));
self
}
pub fn record_retention<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::RecordRetention>>,
T::Error: ::std::fmt::Display,
{
self.record_retention = value
.try_into()
.map_err(|e| format!("error converting supplied value for record_retention: {e}"));
self
}
pub fn retention_policy<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::RetentionPolicy>>,
T::Error: ::std::fmt::Display,
{
self.retention_policy = value
.try_into()
.map_err(|e| format!("error converting supplied value for retention_policy: {e}"));
self
}
pub fn room_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.room_id = value
.try_into()
.map_err(|e| format!("error converting supplied value for room_id: {e}"));
self
}
pub fn usage<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::ResponseUsage>,
T::Error: ::std::fmt::Display,
{
self.usage = value
.try_into()
.map_err(|e| format!("error converting supplied value for usage: {e}"));
self
}
pub fn visibility<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Visibility>,
T::Error: ::std::fmt::Display,
{
self.visibility = value
.try_into()
.map_err(|e| format!("error converting supplied value for visibility: {e}"));
self
}
}
impl ::std::convert::TryFrom<Response> for super::Response {
type Error = super::error::ConversionError;
fn try_from(value: Response) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
epoch: value.epoch?,
ext: value.ext?,
last_prune: value.last_prune?,
limits: value.limits?,
record_retention: value.record_retention?,
retention_policy: value.retention_policy?,
room_id: value.room_id?,
usage: value.usage?,
visibility: value.visibility?,
})
}
}
impl ::std::convert::From<super::Response> for Response {
fn from(value: super::Response) -> Self {
Self {
epoch: Ok(value.epoch),
ext: Ok(value.ext),
last_prune: Ok(value.last_prune),
limits: Ok(value.limits),
record_retention: Ok(value.record_retention),
retention_policy: Ok(value.retention_policy),
room_id: Ok(value.room_id),
usage: Ok(value.usage),
visibility: Ok(value.visibility),
}
}
}
#[derive(Clone, Debug)]
pub struct ResponseUsage {
member: ::std::result::Result<
::std::option::Option<super::ResponseUsageMember>,
::std::string::String,
>,
room: ::std::result::Result<super::Usage, ::std::string::String>,
}
impl ::std::default::Default for ResponseUsage {
fn default() -> Self {
Self {
member: Ok(Default::default()),
room: Err("no value supplied for room".to_string()),
}
}
}
impl ResponseUsage {
pub fn member<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::ResponseUsageMember>>,
T::Error: ::std::fmt::Display,
{
self.member = value
.try_into()
.map_err(|e| format!("error converting supplied value for member: {e}"));
self
}
pub fn room<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Usage>,
T::Error: ::std::fmt::Display,
{
self.room = value
.try_into()
.map_err(|e| format!("error converting supplied value for room: {e}"));
self
}
}
impl ::std::convert::TryFrom<ResponseUsage> for super::ResponseUsage {
type Error = super::error::ConversionError;
fn try_from(
value: ResponseUsage,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
member: value.member?,
room: value.room?,
})
}
}
impl ::std::convert::From<super::ResponseUsage> for ResponseUsage {
fn from(value: super::ResponseUsage) -> Self {
Self {
member: Ok(value.member),
room: Ok(value.room),
}
}
}
#[derive(Clone, Debug)]
pub struct ResponseUsageMember {
limits: ::std::result::Result<super::ScopeLimits, ::std::string::String>,
usage: ::std::result::Result<super::Usage, ::std::string::String>,
}
impl ::std::default::Default for ResponseUsageMember {
fn default() -> Self {
Self {
limits: Err("no value supplied for limits".to_string()),
usage: Err("no value supplied for usage".to_string()),
}
}
}
impl ResponseUsageMember {
pub fn limits<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::ScopeLimits>,
T::Error: ::std::fmt::Display,
{
self.limits = value
.try_into()
.map_err(|e| format!("error converting supplied value for limits: {e}"));
self
}
pub fn usage<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Usage>,
T::Error: ::std::fmt::Display,
{
self.usage = value
.try_into()
.map_err(|e| format!("error converting supplied value for usage: {e}"));
self
}
}
impl ::std::convert::TryFrom<ResponseUsageMember> for super::ResponseUsageMember {
type Error = super::error::ConversionError;
fn try_from(
value: ResponseUsageMember,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
limits: value.limits?,
usage: value.usage?,
})
}
}
impl ::std::convert::From<super::ResponseUsageMember> for ResponseUsageMember {
fn from(value: super::ResponseUsageMember) -> Self {
Self {
limits: Ok(value.limits),
usage: Ok(value.usage),
}
}
}
#[derive(Clone, Debug)]
pub struct RoomLimits {
files_enabled: ::std::result::Result<bool, ::std::string::String>,
member:
::std::result::Result<::std::option::Option<super::ScopeLimits>, ::std::string::String>,
room:
::std::result::Result<::std::option::Option<super::ScopeLimits>, ::std::string::String>,
}
impl ::std::default::Default for RoomLimits {
fn default() -> Self {
Self {
files_enabled: Err("no value supplied for files_enabled".to_string()),
member: Ok(Default::default()),
room: Ok(Default::default()),
}
}
}
impl RoomLimits {
pub fn files_enabled<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.files_enabled = value
.try_into()
.map_err(|e| format!("error converting supplied value for files_enabled: {e}"));
self
}
pub fn member<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::ScopeLimits>>,
T::Error: ::std::fmt::Display,
{
self.member = value
.try_into()
.map_err(|e| format!("error converting supplied value for member: {e}"));
self
}
pub fn room<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::ScopeLimits>>,
T::Error: ::std::fmt::Display,
{
self.room = value
.try_into()
.map_err(|e| format!("error converting supplied value for room: {e}"));
self
}
}
impl ::std::convert::TryFrom<RoomLimits> for super::RoomLimits {
type Error = super::error::ConversionError;
fn try_from(
value: RoomLimits,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
files_enabled: value.files_enabled?,
member: value.member?,
room: value.room?,
})
}
}
impl ::std::convert::From<super::RoomLimits> for RoomLimits {
fn from(value: super::RoomLimits) -> Self {
Self {
files_enabled: Ok(value.files_enabled),
member: Ok(value.member),
room: Ok(value.room),
}
}
}
#[derive(Clone, Debug)]
pub struct ScopeLimits {
max_bytes: ::std::result::Result<::std::option::Option<u64>, ::std::string::String>,
max_file_bytes: ::std::result::Result<::std::option::Option<i64>, ::std::string::String>,
max_files: ::std::result::Result<::std::option::Option<u64>, ::std::string::String>,
}
impl ::std::default::Default for ScopeLimits {
fn default() -> Self {
Self {
max_bytes: Ok(Default::default()),
max_file_bytes: Ok(Default::default()),
max_files: Ok(Default::default()),
}
}
}
impl ScopeLimits {
pub fn max_bytes<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u64>>,
T::Error: ::std::fmt::Display,
{
self.max_bytes = value
.try_into()
.map_err(|e| format!("error converting supplied value for max_bytes: {e}"));
self
}
pub fn max_file_bytes<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.max_file_bytes = value
.try_into()
.map_err(|e| format!("error converting supplied value for max_file_bytes: {e}"));
self
}
pub fn max_files<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u64>>,
T::Error: ::std::fmt::Display,
{
self.max_files = value
.try_into()
.map_err(|e| format!("error converting supplied value for max_files: {e}"));
self
}
}
impl ::std::convert::TryFrom<ScopeLimits> for super::ScopeLimits {
type Error = super::error::ConversionError;
fn try_from(
value: ScopeLimits,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
max_bytes: value.max_bytes?,
max_file_bytes: value.max_file_bytes?,
max_files: value.max_files?,
})
}
}
impl ::std::convert::From<super::ScopeLimits> for ScopeLimits {
fn from(value: super::ScopeLimits) -> Self {
Self {
max_bytes: Ok(value.max_bytes),
max_file_bytes: Ok(value.max_file_bytes),
max_files: Ok(value.max_files),
}
}
}
#[derive(Clone, Debug)]
pub struct Usage {
bytes: ::std::result::Result<u64, ::std::string::String>,
files: ::std::result::Result<u64, ::std::string::String>,
reserved_bytes: ::std::result::Result<u64, ::std::string::String>,
reserved_files: ::std::result::Result<::std::option::Option<u64>, ::std::string::String>,
}
impl ::std::default::Default for Usage {
fn default() -> Self {
Self {
bytes: Err("no value supplied for bytes".to_string()),
files: Err("no value supplied for files".to_string()),
reserved_bytes: Err("no value supplied for reserved_bytes".to_string()),
reserved_files: Ok(Default::default()),
}
}
}
impl Usage {
pub fn bytes<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.bytes = value
.try_into()
.map_err(|e| format!("error converting supplied value for bytes: {e}"));
self
}
pub fn files<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.files = value
.try_into()
.map_err(|e| format!("error converting supplied value for files: {e}"));
self
}
pub fn reserved_bytes<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.reserved_bytes = value
.try_into()
.map_err(|e| format!("error converting supplied value for reserved_bytes: {e}"));
self
}
pub fn reserved_files<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u64>>,
T::Error: ::std::fmt::Display,
{
self.reserved_files = value
.try_into()
.map_err(|e| format!("error converting supplied value for reserved_files: {e}"));
self
}
}
impl ::std::convert::TryFrom<Usage> for super::Usage {
type Error = super::error::ConversionError;
fn try_from(value: Usage) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
bytes: value.bytes?,
files: value.files?,
reserved_bytes: value.reserved_bytes?,
reserved_files: value.reserved_files?,
})
}
}
impl ::std::convert::From<super::Usage> for Usage {
fn from(value: super::Usage) -> Self {
Self {
bytes: Ok(value.bytes),
files: Ok(value.files),
reserved_bytes: Ok(value.reserved_bytes),
reserved_files: Ok(value.reserved_files),
}
}
}
}
impl crate::Payload for Payload {
const TYPE_URI: &'static str = "https://trusttasks.org/spec/rooms/info/0.3";
const IS_PROOF_REQUIRED: bool = true;
const IS_RECIPIENT_REQUIRED: bool = true;
const PAYLOAD_SCHEMA: Option<&'static str> = Some(
"{\n \"$defs\": {\n \"AuthorityPresentation\": {\n \"additionalProperties\": false,\n \"description\": \"What a party presents to act on a room. Carries the whole authority chain: a host MUST NOT dereference an authority credential's `parent` to fetch a link it was not given. Resolving over the network would make verification depend on availability, turn every identifier into a request the host can be induced to make against an address the holder chooses, and signal credential use to whoever hosts the identifier. A host MUST bind the presenter to the chain's leaf. A chain that verifies is evidence that authority was conferred on somebody; it is not evidence that the party presenting it is that somebody. The leaf's subject MUST equal the party the host authenticated for this request — an identity the transport established or a document `proof` proved, never one named in a payload. A host that omits this check authorizes every captured presentation, and the omission is silent, because the chain still verifies.\\n\\n**Every credential is its issuer's attestation, and only its issuer's.** For the membership credential and for every link of `authority`, a host MUST verify the credential's `proof` with a key that the credential's own `issuer` lists for `assertionMethod` in its DID document, and MUST refuse a credential whose proof names a verification method that is not its issuer's. A proof that verifies under some other party's key is that party's statement, not the issuer's, and confers nothing. The same binding holds for every other document a room signs, such as a `RevocationList`.\\n\\n**A chain that verifies may still be revoked.** A host that has accepted a `RevocationList` for the room (`rooms/revocations/put`) MUST, from the moment it accepted it, refuse every presentation in which the membership credential or any link of `authority` is revoked by that list, under every task and every version of every task it serves for the room. A chain from which any link is revoked is refused whole: a credential delegated from a revoked one confers nothing, however it was attenuated. The refusal is the same `permissionDenied` as any other failed presentation.\",\n \"properties\": {\n \"authority\": {\n \"description\": \"The authority chain, LEAF FIRST: the first element is the credential being relied on and the last MUST be one issued by the room itself. Every link the presenter relies on is present, because the host will not fetch one. Capped at 8: verification is linear in chain length and runs on every operation, so an unbounded chain is a denial-of-service surface against the host. The known uses need 2 to 3 — a person attenuating to an agent, and that agent to a sub-agent.\",\n \"items\": {\n \"type\": \"string\"\n },\n \"maxItems\": 8,\n \"minItems\": 1,\n \"type\": \"array\"\n },\n \"membership\": {\n \"description\": \"The presenter's membership credential for this room, or — on a `private` room — a zero-knowledge presentation of it. Serialized per the governing profile.\",\n \"type\": \"string\"\n },\n \"subjectBinding\": {\n \"description\": \"REQUIRED on a `private` room, where the subject identifier is withheld: a proof that the membership credential and the authority chain's leaf describe the SAME subject. Without it two parties pool credentials — one contributes membership, the other authority — and the combination verifies as a single party holding both. A host MUST refuse a private-room presentation that omits this.\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"membership\",\n \"authority\"\n ],\n \"title\": \"AuthorityPresentation\",\n \"type\": \"object\"\n },\n \"Ext\": {\n \"additionalProperties\": true,\n \"description\": \"Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.\",\n \"minProperties\": 1,\n \"propertyNames\": {\n \"pattern\": \"^[a-z][a-z0-9-]*(\\\\.[a-z0-9-]+)+$\"\n },\n \"title\": \"Ext\",\n \"type\": \"object\"\n },\n \"RecordPrune\": {\n \"additionalProperties\": false,\n \"description\": \"The mark a prune leaves: **that** records were removed, when, and how many — never which, and never anything they said.\\n\\nA prune removes records outright, tombstones included, so the room's record tree loses leaves and an incremental reader has nothing left to learn the removal from. This is what it learns from instead. A host keeps the latest one per room and serves it with every listing that can carry it (`rooms/records/list` 0.3, as `lastPrune`); a reader whose own copy of the room was synchronised to a version below `version` MUST rebuild that copy from a full listing — no `sinceVersion` — and drop every record the full listing no longer holds. Without that, a record the room removed lives on in every cache that synchronised before the prune, and a record retracted while the reader was away comes back as current.\\n\\n**What a host keeps and what it does not.** A host keeps this marker, and in its audit trail the prune's `reason`, its requester where the tier discloses one, and the retention it was made under. It MUST NOT keep anything a pruned record said — body, ciphertext, cleartext, title, description, file or blob — and SHOULD NOT keep pruned records' keys: the count is the audit, and a list of keys on an `open` room, where keys may be descriptive, is content by another name.\",\n \"properties\": {\n \"prunedAt\": {\n \"description\": \"When the host performed it.\",\n \"format\": \"date-time\",\n \"type\": \"string\"\n },\n \"removed\": {\n \"description\": \"How many records were removed, tombstones included. A prune that removed nothing leaves no mark.\",\n \"minimum\": 1,\n \"type\": \"integer\"\n },\n \"version\": {\n \"description\": \"The version the prune took from the room's counter, as a put or a curation would. No record carries it; it is what moves `HeadVersion` past the removal, so that a root taken before and a root taken after are never labelled with one version.\",\n \"minimum\": 1,\n \"type\": \"integer\"\n }\n },\n \"required\": [\n \"version\",\n \"prunedAt\",\n \"removed\"\n ],\n \"title\": \"RecordPrune\",\n \"type\": \"object\"\n },\n \"RecordRetention\": {\n \"additionalProperties\": false,\n \"description\": \"How long a room keeps its records, by age: the room's **record retention**. Records older than it states become **eligible** to be removed by `rooms/records/prune`; nothing is removed until a holder of `admin` asks for a prune, and nothing a prune removes can be brought back.\\n\\n**Not `retentionPolicy`, and not `retentionDays`.** Both names are taken in this family and mean other things. `retentionPolicy` (`RetentionPolicy`) is whether a room's *key chain* lets a member read epochs from before they joined, fixed at creation because key material either exists for an epoch or it does not. `retentionDays` (`rooms/create`) is how long a host keeps a whole room after it lapses unrenewed. This is a third question — how long the room keeps its *records* while it is live — and unlike the first it is a decision a room revisits, so it is changeable (`rooms/records/retention/set`). A name sharing either's would invite a reader to apply one's rules to the other.\\n\\n**Age is the host's to measure, so age is `updatedAt`.** On the sealed tiers a host can read nothing of a record but its key, version, status, pinning and when it last changed, so a policy the host applies can only be stated in those terms. That is also why it cannot use a record's own `validUntil`, which is sealed: expiry is a reader's rule, retention a host's. A curation is a change, so it restarts a record's age — a retraction starts a tombstone's.\\n\\n**Absent, or `{}`, means no record is ever eligible by age**, and that is the reading a host MUST apply whenever it cannot read a policy: removing data under a rule nobody stated is the failure this member exists to prevent. Every member can read the policy in force (`rooms/info`), so a record is never removed under a rule its readers could not have known.\",\n \"properties\": {\n \"ext\": {\n \"$ref\": \"#/$defs/Ext\",\n \"description\": \"Ecosystem-defined extension members per SPEC.md §4.5.1. A host MUST NOT treat a member here as making more records eligible: a removal rule a member's reader cannot understand is one they were never told about.\"\n },\n \"recordDays\": {\n \"description\": \"Days a record is kept after it last changed, whatever its standing. A record — `active`, `deprecated` or `retracted` — whose `updatedAt` is more than this long ago is eligible, **unless it is pinned**: pinning says what matters in the room, and a room that wants a pinned record gone unpins it first. Absent means records are never eligible by age.\",\n \"maximum\": 36500,\n \"minimum\": 1,\n \"type\": \"integer\"\n },\n \"tombstoneDays\": {\n \"description\": \"Days a retracted record's tombstone is kept after its retraction. A tombstone whose `updatedAt` is more than this long ago is eligible. Tombstones exist so that a member syncing incrementally learns of a retraction (`rooms/records/curate`); this is how long a member may stay away and still learn of one that way rather than by rebuilding their copy of the room. Absent means tombstones are never eligible.\",\n \"maximum\": 36500,\n \"minimum\": 1,\n \"type\": \"integer\"\n }\n },\n \"title\": \"RecordRetention\",\n \"type\": \"object\"\n },\n \"Response\": {\n \"$anchor\": \"response\",\n \"additionalProperties\": false,\n \"description\": \"Success response to rooms/info. Type https://trusttasks.org/spec/rooms/info/0.3#response.\",\n \"properties\": {\n \"epoch\": {\n \"description\": \"The room's current epoch as the host knows it: the one a record or file must be sealed under to be accepted now.\",\n \"minimum\": 1,\n \"type\": \"integer\"\n },\n \"ext\": {\n \"$ref\": \"#/$defs/Ext\"\n },\n \"lastPrune\": {\n \"$ref\": \"#/$defs/RecordPrune\",\n \"description\": \"The room's latest record prune: when, how many, and the version it took. Absent when the room's records have never been pruned. A reader whose copy of the room was synchronised below `lastPrune.version` rebuilds it (`RecordPrune`).\"\n },\n \"limits\": {\n \"$ref\": \"#/$defs/RoomLimits\",\n \"description\": \"The limits the host applies to this room, after any override for the room and capped by the host-wide ceiling. `member` here is the room's default per-member allowance; the presenter's own, which may differ, is under `usage.member.limits`.\"\n },\n \"recordRetention\": {\n \"$ref\": \"#/$defs/RecordRetention\",\n \"description\": \"The room's record retention in force: which records `rooms/records/prune` may remove, by age. Absent means none — no record is eligible by age. Served to every member who may read the room, because a record is never to be removed under a rule its readers could not have read.\"\n },\n \"retentionPolicy\": {\n \"$ref\": \"#/$defs/RetentionPolicy\",\n \"description\": \"Absent means `chained`, as everywhere in this family.\"\n },\n \"roomId\": {\n \"description\": \"The room this describes, echoed so a response cannot be mistaken for another room's.\",\n \"type\": \"string\"\n },\n \"usage\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"member\": {\n \"additionalProperties\": false,\n \"description\": \"The presenter's own use and allowance: charged to the subject at the root of the presented chain, so an agent sees its member's figures. Absent on a `private` room, where the host does not know which member is asking.\",\n \"properties\": {\n \"limits\": {\n \"$ref\": \"#/$defs/ScopeLimits\",\n \"description\": \"The limits that apply to this member in this room: an override set for them by the host's administrators if there is one, else the room's per-member default.\"\n },\n \"usage\": {\n \"$ref\": \"#/$defs/Usage\"\n }\n },\n \"required\": [\n \"usage\",\n \"limits\"\n ],\n \"type\": \"object\"\n },\n \"room\": {\n \"$ref\": \"#/$defs/Usage\",\n \"description\": \"The room as a whole.\"\n }\n },\n \"required\": [\n \"room\"\n ],\n \"type\": \"object\"\n },\n \"visibility\": {\n \"$ref\": \"#/$defs/Visibility\"\n }\n },\n \"required\": [\n \"roomId\",\n \"visibility\",\n \"epoch\",\n \"limits\",\n \"usage\"\n ],\n \"title\": \"Rooms Info — response payload\",\n \"type\": \"object\"\n },\n \"RetentionPolicy\": {\n \"$comment\": \"Deliberately no JSON Schema `default`. A declared default is materialised by the generated bindings — the member becomes non-optional with a serde default — so an absent value would reappear as an explicit one on re-serialisation and break round-trip idempotence for every document written before this member existed. The meaning of absence is stated in prose, where a binding cannot act on it.\",\n \"description\": \"Whether a room keeps its history readable across a membership change, fixed at creation and immutable thereafter — like `Visibility`, and for the same reason: the rungs of an epoch key chain either exist for an epoch or they do not, and no later change of mind can seal key material that was never sealed or unseal what was already severed. `chained`: each advance produces an `EpochLink`, so every member reads the room's whole retained history however long they have been in it — what a **library** wants, at the cost of post-compromise security for record content, since a compromised current key then reaches every retained epoch. `fromJoin`: no rungs are produced, so a member reads only from the epoch their group state is at — what a **stream** wants, and what a room under a strict forward-secrecy obligation wants, at the cost that a joining member finds an empty-looking room and nobody can reread a record once their group state has moved past the epoch it was sealed under. Absent means `chained`; see the prose on why the absent case is the readable one.\",\n \"enum\": [\n \"chained\",\n \"fromJoin\"\n ],\n \"title\": \"RetentionPolicy\",\n \"type\": \"string\"\n },\n \"RoomLimits\": {\n \"additionalProperties\": false,\n \"description\": \"How much a host is willing to store for one room, at the room and per member. A hosting decision, set by the host and never by anything in the room's credentials. An upload must fit every scope at once: the object against the smallest `maxFileBytes` that applies, and the member and the room with the file added.\",\n \"properties\": {\n \"filesEnabled\": {\n \"description\": \"False refuses every rooms/blobs/* upload for the room. Reads of blobs already stored continue.\",\n \"type\": \"boolean\"\n },\n \"member\": {\n \"$ref\": \"#/$defs/ScopeLimits\",\n \"description\": \"Limits on each member's own uploads in this room, unless that member has an override. A member is the subject at the root of the authority chain they present, never the key that signed, so an agent acting on an attenuated chain spends its member's allowance. Not applied on a `private` room, where the host cannot tell members apart; the room and object limits still hold there.\"\n },\n \"room\": {\n \"$ref\": \"#/$defs/ScopeLimits\",\n \"description\": \"Limits on the room as a whole.\"\n }\n },\n \"required\": [\n \"filesEnabled\"\n ],\n \"title\": \"RoomLimits\",\n \"type\": \"object\"\n },\n \"ScopeLimits\": {\n \"additionalProperties\": false,\n \"description\": \"Limits at one scope. Every member is optional: an absent member means the scope sets no limit of that kind, and the next wider scope's limit, or the host's ceiling, governs. All sizes are ciphertext bytes.\",\n \"properties\": {\n \"maxBytes\": {\n \"description\": \"The total size of the committed and reserved blobs the scope may hold.\",\n \"minimum\": 0,\n \"type\": \"integer\"\n },\n \"maxFileBytes\": {\n \"description\": \"The largest single blob the scope accepts. Never above 1 GiB, the transfer ceiling (BlobManifest).\",\n \"maximum\": 1073741824,\n \"minimum\": 0,\n \"type\": \"integer\"\n },\n \"maxFiles\": {\n \"description\": \"The number of committed blobs the scope may hold. 0 refuses every upload at this scope.\",\n \"minimum\": 0,\n \"type\": \"integer\"\n }\n },\n \"title\": \"ScopeLimits\",\n \"type\": \"object\"\n },\n \"Usage\": {\n \"additionalProperties\": false,\n \"description\": \"What one scope holds now. Ciphertext bytes throughout.\",\n \"properties\": {\n \"bytes\": {\n \"description\": \"Their total size. A blob stops counting the moment it is orphaned (its last record dropped it or was retracted), not when the host finally deletes it, so a member who deletes a file has the room back at once.\",\n \"minimum\": 0,\n \"type\": \"integer\"\n },\n \"files\": {\n \"description\": \"Committed blobs that are not orphaned.\",\n \"minimum\": 0,\n \"type\": \"integer\"\n },\n \"reservedBytes\": {\n \"description\": \"Bytes reserved by uploads begun and not yet committed, aborted or expired. Counted against `maxBytes`, so two concurrent uploads cannot both fit under a limit only one of them fits.\",\n \"minimum\": 0,\n \"type\": \"integer\"\n },\n \"reservedFiles\": {\n \"description\": \"Uploads begun and not yet committed, aborted or expired. Counted against `maxFiles`.\",\n \"minimum\": 0,\n \"type\": \"integer\"\n }\n },\n \"required\": [\n \"files\",\n \"bytes\",\n \"reservedBytes\"\n ],\n \"title\": \"Usage\",\n \"type\": \"object\"\n },\n \"Visibility\": {\n \"description\": \"How much of a room its host can see, fixed at creation and immutable thereafter. `open`: records are cleartext, searchable and fully audited. `attributed`: record content is sealed, and the host still learns which member acted. `private`: content is sealed and membership is presented in zero knowledge, so the host verifies that a member acted without learning which. Immutable because a downgrade cannot un-see cleartext and an upgrade would protect only what came after while presenting as though it protected everything.\",\n \"enum\": [\n \"open\",\n \"attributed\",\n \"private\"\n ],\n \"title\": \"Visibility\",\n \"type\": \"string\"\n }\n },\n \"$id\": \"https://trusttasks.org/spec/rooms/info/0.3\",\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"additionalProperties\": false,\n \"description\": \"A member asks a room's host what it holds about the room: its tier, its current epoch, how long it keeps its records and when it last pruned them, the limits the host applies to its files, and how much of them the room and the member have used.\",\n \"properties\": {\n \"ext\": {\n \"$ref\": \"#/$defs/Ext\",\n \"description\": \"Ecosystem-defined extension members per SPEC.md §4.5.1.\"\n },\n \"presentation\": {\n \"$ref\": \"#/$defs/AuthorityPresentation\",\n \"description\": \"Must confer the `read` action at this room's scope.\"\n },\n \"roomId\": {\n \"description\": \"The room's identifier. The host verifies the presentation against credentials issued by this identifier, never against a member list of its own.\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"roomId\",\n \"presentation\"\n ],\n \"title\": \"Rooms Info — payload\",\n \"type\": \"object\"\n}\n",
);
}
impl crate::Payload for Response {
const TYPE_URI: &'static str = "https://trusttasks.org/spec/rooms/info/0.3#response";
const IS_PROOF_REQUIRED: bool = true;
const IS_RECIPIENT_REQUIRED: bool = true;
const PAYLOAD_SCHEMA: Option<&'static str> = Some(
"{\n \"$defs\": {\n \"AuthorityPresentation\": {\n \"additionalProperties\": false,\n \"description\": \"What a party presents to act on a room. Carries the whole authority chain: a host MUST NOT dereference an authority credential's `parent` to fetch a link it was not given. Resolving over the network would make verification depend on availability, turn every identifier into a request the host can be induced to make against an address the holder chooses, and signal credential use to whoever hosts the identifier. A host MUST bind the presenter to the chain's leaf. A chain that verifies is evidence that authority was conferred on somebody; it is not evidence that the party presenting it is that somebody. The leaf's subject MUST equal the party the host authenticated for this request — an identity the transport established or a document `proof` proved, never one named in a payload. A host that omits this check authorizes every captured presentation, and the omission is silent, because the chain still verifies.\\n\\n**Every credential is its issuer's attestation, and only its issuer's.** For the membership credential and for every link of `authority`, a host MUST verify the credential's `proof` with a key that the credential's own `issuer` lists for `assertionMethod` in its DID document, and MUST refuse a credential whose proof names a verification method that is not its issuer's. A proof that verifies under some other party's key is that party's statement, not the issuer's, and confers nothing. The same binding holds for every other document a room signs, such as a `RevocationList`.\\n\\n**A chain that verifies may still be revoked.** A host that has accepted a `RevocationList` for the room (`rooms/revocations/put`) MUST, from the moment it accepted it, refuse every presentation in which the membership credential or any link of `authority` is revoked by that list, under every task and every version of every task it serves for the room. A chain from which any link is revoked is refused whole: a credential delegated from a revoked one confers nothing, however it was attenuated. The refusal is the same `permissionDenied` as any other failed presentation.\",\n \"properties\": {\n \"authority\": {\n \"description\": \"The authority chain, LEAF FIRST: the first element is the credential being relied on and the last MUST be one issued by the room itself. Every link the presenter relies on is present, because the host will not fetch one. Capped at 8: verification is linear in chain length and runs on every operation, so an unbounded chain is a denial-of-service surface against the host. The known uses need 2 to 3 — a person attenuating to an agent, and that agent to a sub-agent.\",\n \"items\": {\n \"type\": \"string\"\n },\n \"maxItems\": 8,\n \"minItems\": 1,\n \"type\": \"array\"\n },\n \"membership\": {\n \"description\": \"The presenter's membership credential for this room, or — on a `private` room — a zero-knowledge presentation of it. Serialized per the governing profile.\",\n \"type\": \"string\"\n },\n \"subjectBinding\": {\n \"description\": \"REQUIRED on a `private` room, where the subject identifier is withheld: a proof that the membership credential and the authority chain's leaf describe the SAME subject. Without it two parties pool credentials — one contributes membership, the other authority — and the combination verifies as a single party holding both. A host MUST refuse a private-room presentation that omits this.\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"membership\",\n \"authority\"\n ],\n \"title\": \"AuthorityPresentation\",\n \"type\": \"object\"\n },\n \"Ext\": {\n \"additionalProperties\": true,\n \"description\": \"Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.\",\n \"minProperties\": 1,\n \"propertyNames\": {\n \"pattern\": \"^[a-z][a-z0-9-]*(\\\\.[a-z0-9-]+)+$\"\n },\n \"title\": \"Ext\",\n \"type\": \"object\"\n },\n \"RecordPrune\": {\n \"additionalProperties\": false,\n \"description\": \"The mark a prune leaves: **that** records were removed, when, and how many — never which, and never anything they said.\\n\\nA prune removes records outright, tombstones included, so the room's record tree loses leaves and an incremental reader has nothing left to learn the removal from. This is what it learns from instead. A host keeps the latest one per room and serves it with every listing that can carry it (`rooms/records/list` 0.3, as `lastPrune`); a reader whose own copy of the room was synchronised to a version below `version` MUST rebuild that copy from a full listing — no `sinceVersion` — and drop every record the full listing no longer holds. Without that, a record the room removed lives on in every cache that synchronised before the prune, and a record retracted while the reader was away comes back as current.\\n\\n**What a host keeps and what it does not.** A host keeps this marker, and in its audit trail the prune's `reason`, its requester where the tier discloses one, and the retention it was made under. It MUST NOT keep anything a pruned record said — body, ciphertext, cleartext, title, description, file or blob — and SHOULD NOT keep pruned records' keys: the count is the audit, and a list of keys on an `open` room, where keys may be descriptive, is content by another name.\",\n \"properties\": {\n \"prunedAt\": {\n \"description\": \"When the host performed it.\",\n \"format\": \"date-time\",\n \"type\": \"string\"\n },\n \"removed\": {\n \"description\": \"How many records were removed, tombstones included. A prune that removed nothing leaves no mark.\",\n \"minimum\": 1,\n \"type\": \"integer\"\n },\n \"version\": {\n \"description\": \"The version the prune took from the room's counter, as a put or a curation would. No record carries it; it is what moves `HeadVersion` past the removal, so that a root taken before and a root taken after are never labelled with one version.\",\n \"minimum\": 1,\n \"type\": \"integer\"\n }\n },\n \"required\": [\n \"version\",\n \"prunedAt\",\n \"removed\"\n ],\n \"title\": \"RecordPrune\",\n \"type\": \"object\"\n },\n \"RecordRetention\": {\n \"additionalProperties\": false,\n \"description\": \"How long a room keeps its records, by age: the room's **record retention**. Records older than it states become **eligible** to be removed by `rooms/records/prune`; nothing is removed until a holder of `admin` asks for a prune, and nothing a prune removes can be brought back.\\n\\n**Not `retentionPolicy`, and not `retentionDays`.** Both names are taken in this family and mean other things. `retentionPolicy` (`RetentionPolicy`) is whether a room's *key chain* lets a member read epochs from before they joined, fixed at creation because key material either exists for an epoch or it does not. `retentionDays` (`rooms/create`) is how long a host keeps a whole room after it lapses unrenewed. This is a third question — how long the room keeps its *records* while it is live — and unlike the first it is a decision a room revisits, so it is changeable (`rooms/records/retention/set`). A name sharing either's would invite a reader to apply one's rules to the other.\\n\\n**Age is the host's to measure, so age is `updatedAt`.** On the sealed tiers a host can read nothing of a record but its key, version, status, pinning and when it last changed, so a policy the host applies can only be stated in those terms. That is also why it cannot use a record's own `validUntil`, which is sealed: expiry is a reader's rule, retention a host's. A curation is a change, so it restarts a record's age — a retraction starts a tombstone's.\\n\\n**Absent, or `{}`, means no record is ever eligible by age**, and that is the reading a host MUST apply whenever it cannot read a policy: removing data under a rule nobody stated is the failure this member exists to prevent. Every member can read the policy in force (`rooms/info`), so a record is never removed under a rule its readers could not have known.\",\n \"properties\": {\n \"ext\": {\n \"$ref\": \"#/$defs/Ext\",\n \"description\": \"Ecosystem-defined extension members per SPEC.md §4.5.1. A host MUST NOT treat a member here as making more records eligible: a removal rule a member's reader cannot understand is one they were never told about.\"\n },\n \"recordDays\": {\n \"description\": \"Days a record is kept after it last changed, whatever its standing. A record — `active`, `deprecated` or `retracted` — whose `updatedAt` is more than this long ago is eligible, **unless it is pinned**: pinning says what matters in the room, and a room that wants a pinned record gone unpins it first. Absent means records are never eligible by age.\",\n \"maximum\": 36500,\n \"minimum\": 1,\n \"type\": \"integer\"\n },\n \"tombstoneDays\": {\n \"description\": \"Days a retracted record's tombstone is kept after its retraction. A tombstone whose `updatedAt` is more than this long ago is eligible. Tombstones exist so that a member syncing incrementally learns of a retraction (`rooms/records/curate`); this is how long a member may stay away and still learn of one that way rather than by rebuilding their copy of the room. Absent means tombstones are never eligible.\",\n \"maximum\": 36500,\n \"minimum\": 1,\n \"type\": \"integer\"\n }\n },\n \"title\": \"RecordRetention\",\n \"type\": \"object\"\n },\n \"Response\": {\n \"$anchor\": \"response\",\n \"additionalProperties\": false,\n \"description\": \"Success response to rooms/info. Type https://trusttasks.org/spec/rooms/info/0.3#response.\",\n \"properties\": {\n \"epoch\": {\n \"description\": \"The room's current epoch as the host knows it: the one a record or file must be sealed under to be accepted now.\",\n \"minimum\": 1,\n \"type\": \"integer\"\n },\n \"ext\": {\n \"$ref\": \"#/$defs/Ext\"\n },\n \"lastPrune\": {\n \"$ref\": \"#/$defs/RecordPrune\",\n \"description\": \"The room's latest record prune: when, how many, and the version it took. Absent when the room's records have never been pruned. A reader whose copy of the room was synchronised below `lastPrune.version` rebuilds it (`RecordPrune`).\"\n },\n \"limits\": {\n \"$ref\": \"#/$defs/RoomLimits\",\n \"description\": \"The limits the host applies to this room, after any override for the room and capped by the host-wide ceiling. `member` here is the room's default per-member allowance; the presenter's own, which may differ, is under `usage.member.limits`.\"\n },\n \"recordRetention\": {\n \"$ref\": \"#/$defs/RecordRetention\",\n \"description\": \"The room's record retention in force: which records `rooms/records/prune` may remove, by age. Absent means none — no record is eligible by age. Served to every member who may read the room, because a record is never to be removed under a rule its readers could not have read.\"\n },\n \"retentionPolicy\": {\n \"$ref\": \"#/$defs/RetentionPolicy\",\n \"description\": \"Absent means `chained`, as everywhere in this family.\"\n },\n \"roomId\": {\n \"description\": \"The room this describes, echoed so a response cannot be mistaken for another room's.\",\n \"type\": \"string\"\n },\n \"usage\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"member\": {\n \"additionalProperties\": false,\n \"description\": \"The presenter's own use and allowance: charged to the subject at the root of the presented chain, so an agent sees its member's figures. Absent on a `private` room, where the host does not know which member is asking.\",\n \"properties\": {\n \"limits\": {\n \"$ref\": \"#/$defs/ScopeLimits\",\n \"description\": \"The limits that apply to this member in this room: an override set for them by the host's administrators if there is one, else the room's per-member default.\"\n },\n \"usage\": {\n \"$ref\": \"#/$defs/Usage\"\n }\n },\n \"required\": [\n \"usage\",\n \"limits\"\n ],\n \"type\": \"object\"\n },\n \"room\": {\n \"$ref\": \"#/$defs/Usage\",\n \"description\": \"The room as a whole.\"\n }\n },\n \"required\": [\n \"room\"\n ],\n \"type\": \"object\"\n },\n \"visibility\": {\n \"$ref\": \"#/$defs/Visibility\"\n }\n },\n \"required\": [\n \"roomId\",\n \"visibility\",\n \"epoch\",\n \"limits\",\n \"usage\"\n ],\n \"title\": \"Rooms Info — response payload\",\n \"type\": \"object\"\n },\n \"RetentionPolicy\": {\n \"$comment\": \"Deliberately no JSON Schema `default`. A declared default is materialised by the generated bindings — the member becomes non-optional with a serde default — so an absent value would reappear as an explicit one on re-serialisation and break round-trip idempotence for every document written before this member existed. The meaning of absence is stated in prose, where a binding cannot act on it.\",\n \"description\": \"Whether a room keeps its history readable across a membership change, fixed at creation and immutable thereafter — like `Visibility`, and for the same reason: the rungs of an epoch key chain either exist for an epoch or they do not, and no later change of mind can seal key material that was never sealed or unseal what was already severed. `chained`: each advance produces an `EpochLink`, so every member reads the room's whole retained history however long they have been in it — what a **library** wants, at the cost of post-compromise security for record content, since a compromised current key then reaches every retained epoch. `fromJoin`: no rungs are produced, so a member reads only from the epoch their group state is at — what a **stream** wants, and what a room under a strict forward-secrecy obligation wants, at the cost that a joining member finds an empty-looking room and nobody can reread a record once their group state has moved past the epoch it was sealed under. Absent means `chained`; see the prose on why the absent case is the readable one.\",\n \"enum\": [\n \"chained\",\n \"fromJoin\"\n ],\n \"title\": \"RetentionPolicy\",\n \"type\": \"string\"\n },\n \"RoomLimits\": {\n \"additionalProperties\": false,\n \"description\": \"How much a host is willing to store for one room, at the room and per member. A hosting decision, set by the host and never by anything in the room's credentials. An upload must fit every scope at once: the object against the smallest `maxFileBytes` that applies, and the member and the room with the file added.\",\n \"properties\": {\n \"filesEnabled\": {\n \"description\": \"False refuses every rooms/blobs/* upload for the room. Reads of blobs already stored continue.\",\n \"type\": \"boolean\"\n },\n \"member\": {\n \"$ref\": \"#/$defs/ScopeLimits\",\n \"description\": \"Limits on each member's own uploads in this room, unless that member has an override. A member is the subject at the root of the authority chain they present, never the key that signed, so an agent acting on an attenuated chain spends its member's allowance. Not applied on a `private` room, where the host cannot tell members apart; the room and object limits still hold there.\"\n },\n \"room\": {\n \"$ref\": \"#/$defs/ScopeLimits\",\n \"description\": \"Limits on the room as a whole.\"\n }\n },\n \"required\": [\n \"filesEnabled\"\n ],\n \"title\": \"RoomLimits\",\n \"type\": \"object\"\n },\n \"ScopeLimits\": {\n \"additionalProperties\": false,\n \"description\": \"Limits at one scope. Every member is optional: an absent member means the scope sets no limit of that kind, and the next wider scope's limit, or the host's ceiling, governs. All sizes are ciphertext bytes.\",\n \"properties\": {\n \"maxBytes\": {\n \"description\": \"The total size of the committed and reserved blobs the scope may hold.\",\n \"minimum\": 0,\n \"type\": \"integer\"\n },\n \"maxFileBytes\": {\n \"description\": \"The largest single blob the scope accepts. Never above 1 GiB, the transfer ceiling (BlobManifest).\",\n \"maximum\": 1073741824,\n \"minimum\": 0,\n \"type\": \"integer\"\n },\n \"maxFiles\": {\n \"description\": \"The number of committed blobs the scope may hold. 0 refuses every upload at this scope.\",\n \"minimum\": 0,\n \"type\": \"integer\"\n }\n },\n \"title\": \"ScopeLimits\",\n \"type\": \"object\"\n },\n \"Usage\": {\n \"additionalProperties\": false,\n \"description\": \"What one scope holds now. Ciphertext bytes throughout.\",\n \"properties\": {\n \"bytes\": {\n \"description\": \"Their total size. A blob stops counting the moment it is orphaned (its last record dropped it or was retracted), not when the host finally deletes it, so a member who deletes a file has the room back at once.\",\n \"minimum\": 0,\n \"type\": \"integer\"\n },\n \"files\": {\n \"description\": \"Committed blobs that are not orphaned.\",\n \"minimum\": 0,\n \"type\": \"integer\"\n },\n \"reservedBytes\": {\n \"description\": \"Bytes reserved by uploads begun and not yet committed, aborted or expired. Counted against `maxBytes`, so two concurrent uploads cannot both fit under a limit only one of them fits.\",\n \"minimum\": 0,\n \"type\": \"integer\"\n },\n \"reservedFiles\": {\n \"description\": \"Uploads begun and not yet committed, aborted or expired. Counted against `maxFiles`.\",\n \"minimum\": 0,\n \"type\": \"integer\"\n }\n },\n \"required\": [\n \"files\",\n \"bytes\",\n \"reservedBytes\"\n ],\n \"title\": \"Usage\",\n \"type\": \"object\"\n },\n \"Visibility\": {\n \"description\": \"How much of a room its host can see, fixed at creation and immutable thereafter. `open`: records are cleartext, searchable and fully audited. `attributed`: record content is sealed, and the host still learns which member acted. `private`: content is sealed and membership is presented in zero knowledge, so the host verifies that a member acted without learning which. Immutable because a downgrade cannot un-see cleartext and an upgrade would protect only what came after while presenting as though it protected everything.\",\n \"enum\": [\n \"open\",\n \"attributed\",\n \"private\"\n ],\n \"title\": \"Visibility\",\n \"type\": \"string\"\n }\n },\n \"$ref\": \"#/$defs/Response\",\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\"\n}\n",
);
}
impl crate::RequestPayload for Payload {
type Response = Response;
}
/// The extended error codes this specification declares (SPEC §7.3 item 9,
/// §8.5), in declaration order. Empty when it declares none.
pub const ERROR_CODES: &[crate::DeclaredErrorCode] = &[
error_codes::CHAIN_TOO_DEEP,
error_codes::SUBJECT_BINDING_MISSING,
];
/// One constant per extended error code this specification declares
/// (SPEC §7.3 item 9), named for its local part.
///
/// Emit these rather than a string literal: the code is read from the
/// specification, so it cannot name a code the specification never
/// declared.
pub mod error_codes {
/// `rooms/info:chainTooDeep`
///
/// The authority chain exceeds the maximum of 8 links.
///
/// Declared `retryable: false`.
pub const CHAIN_TOO_DEEP: crate::DeclaredErrorCode = crate::DeclaredErrorCode {
code: "rooms/info:chainTooDeep",
retryable: false,
details_schema: ::core::option::Option::None,
};
/// `rooms/info:subjectBindingMissing`
///
/// A `private` room presentation omitted the required same-subject proof.
///
/// Declared `retryable: false`.
pub const SUBJECT_BINDING_MISSING: crate::DeclaredErrorCode = crate::DeclaredErrorCode {
code: "rooms/info:subjectBindingMissing",
retryable: false,
details_schema: ::core::option::Option::None,
};
}