trieve_client/models/
update_user_org_role_data.rs

1/*
2 * Trieve API
3 *
4 * Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
5 *
6 * The version of the OpenAPI document: 0.11.7
7 * Contact: developers@trieve.ai
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12
13#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
14pub struct UpdateUserOrgRoleData {
15    /// The id of the organization to update the user for.
16    #[serde(rename = "organization_id")]
17    pub organization_id: uuid::Uuid,
18    /// Either 0 (user), 1 (admin), or 2 (owner). If not provided, the current role will be used. The auth'ed user must have a role greater than or equal to the role being assigned.
19    #[serde(rename = "role")]
20    pub role: i32,
21    /// The id of the user to update, if not provided, the auth'ed user will be updated. If provided, the role of the auth'ed user or api key must be an admin (1) or owner (2) of the organization.
22    #[serde(rename = "user_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
23    pub user_id: Option<Option<uuid::Uuid>>,
24}
25
26impl UpdateUserOrgRoleData {
27    pub fn new(organization_id: uuid::Uuid, role: i32) -> UpdateUserOrgRoleData {
28        UpdateUserOrgRoleData {
29            organization_id,
30            role,
31            user_id: None,
32        }
33    }
34}
35