shrike 0.1.6

AT Protocol library for Rust
Documentation
// Code generated by lexgen. DO NOT EDIT.

#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ReportQueryReportsParams {
    /// Filter by the DID of the moderator permanently assigned to the report.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub assigned_to: Option<String>,
    /// If specified, reports where the subject belongs to the given collections will be returned. When subjectType is set to 'account', this will be ignored.
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub collections: Vec<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub cursor: Option<String>,
    /// Filter to reports where the subject is this DID or any record owned by this DID. Unlike `subject` (which scopes to a specific account or record), this returns all reports tied to the DID across both account-level and record-level subjects.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub did: Option<String>,
    /// Filter by muted status. true returns only muted reports, false returns only unmuted reports. Defaults to false.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub is_muted: Option<bool>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub limit: Option<i64>,
    /// Filter by queue ID. Use -1 for unassigned reports.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub queue_id: Option<i64>,
    /// Filter by report types (fully qualified string in the format of com.atproto.moderation.defs#reason&lt;name&gt;).
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub report_types: Vec<String>,
    /// Retrieve reports created after a given timestamp
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub reported_after: Option<String>,
    /// Retrieve reports created before a given timestamp
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub reported_before: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub sort_direction: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub sort_field: Option<String>,
    /// Filter by report status.
    pub status: String,
    /// Filter by subject DID or AT-URI.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub subject: Option<String>,
    /// If specified, reports of the given type (account or record) will be returned.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub subject_type: Option<String>,
}

#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ReportQueryReportsOutput {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub cursor: Option<String>,
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub reports: Vec<crate::api::tools::ozone::ReportDefsReportView>,
    /// Extra fields not defined in the schema.
    #[serde(flatten)]
    pub extra: std::collections::HashMap<String, serde_json::Value>,
}

/// ReportQueryReports — View moderation reports. Reports are individual instances of content being reported, as opposed to subject statuses which aggregate reports at the subject level.
pub async fn report_query_reports(
    client: &crate::xrpc::Client,
    params: &ReportQueryReportsParams,
) -> Result<ReportQueryReportsOutput, crate::xrpc::Error> {
    client
        .query("tools.ozone.report.queryReports", params)
        .await
}