Skip to main content

rustfs_madmin/
group.rs

1// Copyright 2024 RustFS Team
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15use serde::Deserialize;
16use serde::Serialize;
17use time::OffsetDateTime;
18
19#[derive(Debug, Serialize, Deserialize, Default)]
20#[serde(rename_all = "lowercase")]
21pub enum GroupStatus {
22    #[default]
23    Enabled,
24    Disabled,
25}
26
27#[derive(Debug, Serialize, Deserialize, Default)]
28pub struct GroupAddRemove {
29    pub group: String,
30    pub members: Vec<String>,
31    #[serde(rename = "groupStatus")]
32    pub status: GroupStatus,
33    #[serde(rename = "isRemove")]
34    pub is_remove: bool,
35}
36
37#[derive(Debug, Serialize, Deserialize, Default)]
38pub struct GroupDesc {
39    pub name: String,
40    pub status: String,
41    pub members: Vec<String>,
42    pub policy: String,
43    #[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")]
44    pub updated_at: Option<OffsetDateTime>,
45}