roblox_api/api/user_agreements/
v1.rs1use serde::{Deserialize, Serialize};
2
3use crate::endpoint;
4
5pub const URL: &str = "https://agreements.roblox.com/v1";
6
7#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
8#[serde(rename_all = "camelCase")]
9pub struct Agreement {
10 pub document_type: String,
11 pub is_accepted: bool,
12 pub created_at: Option<String>,
13 pub updated_at: Option<String>,
14 pub accepted_at: Option<String>,
15}
16
17#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
18#[serde(rename_all = "camelCase")]
19pub struct AgreementAcceptances {
20 pub acceptances: Vec<Agreement>,
21}
22
23endpoint! {
24 acceptances(agreements: &[&str]) -> AgreementAcceptances {
25 POST "{URL}/agreements/acceptances";
26
27 types {
28 Request<'a> {
29 agreements("agreements"): &'a [&'a str],
30 }
31 }
32
33 body_serialize {
34 Request { agreements }
35 }
36 }
37}