couchbase_core/mgmtx/
options.rs

1/*
2 *
3 *  * Copyright (c) 2025 Couchbase, Inc.
4 *  *
5 *  * Licensed under the Apache License, Version 2.0 (the "License");
6 *  * you may not use this file except in compliance with the License.
7 *  * You may obtain a copy of the License at
8 *  *
9 *  *    http://www.apache.org/licenses/LICENSE-2.0
10 *  *
11 *  * Unless required by applicable law or agreed to in writing, software
12 *  * distributed under the License is distributed on an "AS IS" BASIS,
13 *  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 *  * See the License for the specific language governing permissions and
15 *  * limitations under the License.
16 *
17 */
18
19use crate::httpx::client::Client;
20use crate::httpx::request::OnBehalfOfInfo;
21use crate::mgmtx::bucket_settings::BucketSettings;
22use crate::mgmtx::node_target::NodeTarget;
23use crate::mgmtx::user::{Group, User};
24use std::sync::Arc;
25
26#[derive(Debug, Clone, Eq, PartialEq)]
27#[non_exhaustive]
28pub struct GetCollectionManifestOptions<'a> {
29    pub on_behalf_of_info: Option<&'a OnBehalfOfInfo>,
30    pub bucket_name: &'a str,
31}
32
33#[derive(Debug, Clone, Eq, PartialEq)]
34#[non_exhaustive]
35pub struct CreateScopeOptions<'a> {
36    pub on_behalf_of_info: Option<&'a OnBehalfOfInfo>,
37    pub bucket_name: &'a str,
38    pub scope_name: &'a str,
39}
40
41#[derive(Debug, Clone, Eq, PartialEq)]
42#[non_exhaustive]
43pub struct DeleteScopeOptions<'a> {
44    pub on_behalf_of_info: Option<&'a OnBehalfOfInfo>,
45    pub bucket_name: &'a str,
46    pub scope_name: &'a str,
47}
48
49#[derive(Debug, Clone, Eq, PartialEq)]
50#[non_exhaustive]
51pub struct CreateCollectionOptions<'a> {
52    pub on_behalf_of_info: Option<&'a OnBehalfOfInfo>,
53    pub bucket_name: &'a str,
54    pub scope_name: &'a str,
55    pub collection_name: &'a str,
56    pub max_ttl: Option<i32>,
57    pub history_enabled: Option<bool>,
58}
59
60#[derive(Debug, Clone, Eq, PartialEq)]
61#[non_exhaustive]
62pub struct UpdateCollectionOptions<'a> {
63    pub on_behalf_of_info: Option<&'a OnBehalfOfInfo>,
64    pub bucket_name: &'a str,
65    pub scope_name: &'a str,
66    pub collection_name: &'a str,
67    pub max_ttl: Option<i32>,
68    pub history_enabled: Option<bool>,
69}
70
71#[derive(Debug, Clone, Eq, PartialEq)]
72#[non_exhaustive]
73pub struct DeleteCollectionOptions<'a> {
74    pub on_behalf_of_info: Option<&'a OnBehalfOfInfo>,
75    pub bucket_name: &'a str,
76    pub scope_name: &'a str,
77    pub collection_name: &'a str,
78}
79
80#[derive(Debug, Clone, Eq, PartialEq)]
81#[non_exhaustive]
82pub struct GetTerseClusterConfigOptions<'a> {
83    pub on_behalf_of_info: Option<&'a OnBehalfOfInfo>,
84}
85
86#[derive(Debug, Clone, Eq, PartialEq)]
87#[non_exhaustive]
88pub struct GetTerseBucketConfigOptions<'a> {
89    pub on_behalf_of_info: Option<&'a OnBehalfOfInfo>,
90    pub bucket_name: &'a str,
91}
92
93#[derive(Debug, Clone, Eq, PartialEq)]
94pub struct EnsureManifestPollOptions<C: Client> {
95    pub client: Arc<C>,
96    pub targets: Vec<NodeTarget>,
97}
98
99#[derive(Debug, Clone, Eq, PartialEq)]
100#[non_exhaustive]
101pub struct GetAllBucketsOptions<'a> {
102    pub on_behalf_of_info: Option<&'a OnBehalfOfInfo>,
103}
104
105#[derive(Debug, Clone, Eq, PartialEq)]
106#[non_exhaustive]
107pub struct GetBucketOptions<'a> {
108    pub on_behalf_of_info: Option<&'a OnBehalfOfInfo>,
109    pub bucket_name: &'a str,
110}
111
112#[derive(Debug, Clone, Eq, PartialEq)]
113#[non_exhaustive]
114pub struct CreateBucketOptions<'a> {
115    pub on_behalf_of_info: Option<&'a OnBehalfOfInfo>,
116    pub bucket_name: &'a str,
117    pub bucket_settings: &'a BucketSettings,
118}
119
120#[derive(Debug, Clone, Eq, PartialEq)]
121#[non_exhaustive]
122pub struct UpdateBucketOptions<'a> {
123    pub on_behalf_of_info: Option<&'a OnBehalfOfInfo>,
124    pub bucket_name: &'a str,
125    pub bucket_settings: &'a BucketSettings,
126}
127
128#[derive(Debug, Clone, Eq, PartialEq)]
129#[non_exhaustive]
130pub struct DeleteBucketOptions<'a> {
131    pub on_behalf_of_info: Option<&'a OnBehalfOfInfo>,
132    pub bucket_name: &'a str,
133}
134
135#[derive(Debug, Clone, Eq, PartialEq)]
136#[non_exhaustive]
137pub struct FlushBucketOptions<'a> {
138    pub on_behalf_of_info: Option<&'a OnBehalfOfInfo>,
139    pub bucket_name: &'a str,
140}
141
142#[derive(Debug, Clone, Eq, PartialEq)]
143pub struct EnsureBucketPollOptions<C: Client> {
144    pub client: Arc<C>,
145    pub targets: Vec<NodeTarget>,
146}
147
148#[derive(Debug, Clone, Eq, PartialEq)]
149#[non_exhaustive]
150pub struct GetUserOptions<'a> {
151    pub on_behalf_of_info: Option<&'a OnBehalfOfInfo>,
152    pub username: &'a str,
153    pub auth_domain: &'a str,
154}
155
156#[derive(Debug, Clone, Eq, PartialEq)]
157#[non_exhaustive]
158pub struct GetAllUsersOptions<'a> {
159    pub on_behalf_of_info: Option<&'a OnBehalfOfInfo>,
160    pub auth_domain: &'a str,
161}
162
163#[derive(Debug, Clone, Eq, PartialEq)]
164#[non_exhaustive]
165pub struct UpsertUserOptions<'a> {
166    pub on_behalf_of_info: Option<&'a OnBehalfOfInfo>,
167    pub user: &'a User,
168    pub auth_domain: &'a str,
169}
170
171#[derive(Debug, Clone, Eq, PartialEq)]
172#[non_exhaustive]
173pub struct DeleteUserOptions<'a> {
174    pub on_behalf_of_info: Option<&'a OnBehalfOfInfo>,
175    pub username: &'a str,
176    pub auth_domain: &'a str,
177}
178
179#[derive(Debug, Clone, Eq, PartialEq)]
180#[non_exhaustive]
181pub struct GetRolesOptions<'a> {
182    pub on_behalf_of_info: Option<&'a OnBehalfOfInfo>,
183}
184
185#[derive(Debug, Clone, Eq, PartialEq)]
186#[non_exhaustive]
187pub struct GetGroupOptions<'a> {
188    pub on_behalf_of_info: Option<&'a OnBehalfOfInfo>,
189    pub group_name: &'a str,
190}
191
192#[derive(Debug, Clone, Eq, PartialEq)]
193#[non_exhaustive]
194pub struct GetAllGroupsOptions<'a> {
195    pub on_behalf_of_info: Option<&'a OnBehalfOfInfo>,
196}
197
198#[derive(Debug, Clone, Eq, PartialEq)]
199#[non_exhaustive]
200pub struct UpsertGroupOptions<'a> {
201    pub on_behalf_of_info: Option<&'a OnBehalfOfInfo>,
202    pub group: &'a Group,
203}
204
205#[derive(Debug, Clone, Eq, PartialEq)]
206#[non_exhaustive]
207pub struct DeleteGroupOptions<'a> {
208    pub on_behalf_of_info: Option<&'a OnBehalfOfInfo>,
209    pub group_name: &'a str,
210}
211
212#[derive(Debug, Clone, Eq, PartialEq)]
213#[non_exhaustive]
214pub struct ChangePasswordOptions<'a> {
215    pub on_behalf_of_info: Option<&'a OnBehalfOfInfo>,
216    pub new_password: &'a str,
217}
218
219#[derive(Debug, Clone, Eq, PartialEq)]
220pub struct EnsureUserPollOptions<C: Client> {
221    pub client: Arc<C>,
222    pub targets: Vec<NodeTarget>,
223}
224
225#[derive(Debug, Clone, Eq, PartialEq)]
226pub struct EnsureGroupPollOptions<C: Client> {
227    pub client: Arc<C>,
228    pub targets: Vec<NodeTarget>,
229}