/*
* Trieve API
*
* Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
*
* The version of the OpenAPI document: 0.11.7
* Contact: developers@trieve.ai
* Generated by: https://openapi-generator.tech
*/
use crate::models;
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct UpdateUserOrgRoleData {
/// The id of the organization to update the user for.
#[serde(rename = "organization_id")]
pub organization_id: uuid::Uuid,
/// 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.
#[serde(rename = "role")]
pub role: i32,
/// 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.
#[serde(rename = "user_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub user_id: Option<Option<uuid::Uuid>>,
}
impl UpdateUserOrgRoleData {
pub fn new(organization_id: uuid::Uuid, role: i32) -> UpdateUserOrgRoleData {
UpdateUserOrgRoleData {
organization_id,
role,
user_id: None,
}
}
}