MCPcopy Create free account
hub / github.com/chirpstack/chirpstack / list

Method list

chirpstack/src/api/user.rs:187–218  ·  view source on GitHub ↗
(
        &self,
        request: Request<api::ListUsersRequest>,
    )

Source from the content-addressed store, hash-verified

185 }
186
187 async fn list(
188 &self,
189 request: Request<api::ListUsersRequest>,
190 ) -> Result<Response<api::ListUsersResponse>, Status> {
191 let req = request.get_ref();
192 self.validator
193 .validate(
194 request.extensions(),
195 validator::ValidateUsersAccess::new(validator::Flag::List),
196 )
197 .await?;
198
199 let count = user::get_count().await.map_err(|e| e.status())?;
200 let items = user::list(req.limit as i64, req.offset as i64)
201 .await
202 .map_err(|e| e.status())?;
203
204 Ok(Response::new(api::ListUsersResponse {
205 total_count: count as u32,
206 result: items
207 .iter()
208 .map(|u| api::UserListItem {
209 id: u.id.to_string(),
210 created_at: Some(helpers::datetime_to_prost_timestamp(&u.created_at)),
211 updated_at: Some(helpers::datetime_to_prost_timestamp(&u.updated_at)),
212 email: u.email.clone(),
213 is_admin: u.is_admin,
214 is_active: u.is_active,
215 })
216 .collect(),
217 }))
218 }
219
220 async fn update_password(
221 &self,

Callers 15

test_userFunction · 0.45
getTenantOptionsFunction · 0.45
DeviceProfileSelectFunction · 0.45
loadDeviceProfileDataFunction · 0.45
UserStoreClass · 0.45
ApplicationStoreClass · 0.45
TenantStoreClass · 0.45
DeviceProfileStoreClass · 0.45
GatewayStoreClass · 0.45
DeviceStoreClass · 0.45
MulticastGroupStoreClass · 0.45
RelayStoreClass · 0.45

Calls 7

statusMethod · 0.80
iterMethod · 0.80
to_stringMethod · 0.80
get_countFunction · 0.50
listFunction · 0.50
validateMethod · 0.45

Tested by 1

test_userFunction · 0.36