xet-client 1.5.2

Client library for communicating with Hugging Face Xet storage servers. Use through the hf-xet crate.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
use std::ops::Range;
use std::sync::Arc;
use std::time::Duration;

use async_trait::async_trait;
use bytes::Bytes;
use http::header::HeaderMap;
use xet_core_structures::merklehash::MerkleHash;
use xet_core_structures::xorb_object::XorbObject;

use super::simulation_types::{
    FetchTermDataRequest, FetchTermDataResponse, FileShardsEntry, FileSizeResponse, XorbExistsResponse,
    XorbLengthResponse, XorbRangesRequest, XorbRangesResponse, XorbRawLengthResponse,
};
use crate::cas_client::RemoteClient;
use crate::cas_client::interface::Client;
use crate::cas_client::simulation::xorb_utils::duration_to_expiration_secs_ceil;
use crate::cas_client::simulation::{DeletionControlableClient, DirectAccessClient};
use crate::cas_types::{FileRange, HexMerkleHash, QueryReconstructionResponseV2, XorbReconstructionFetchInfo};
use crate::error::{ClientError, Result};

const CONFIG_POST_MAX_ATTEMPTS: usize = 4;
const CONFIG_POST_RETRY_DELAY_MS: u64 = 40;

/// A client that connects to a `LocalTestServer` via HTTP and provides access
/// to both `DirectAccessClient` and `DeletionControlableClient` operations
/// through the `/simulation/` routes.
///
/// Standard `Client` trait methods are delegated to an internal `RemoteClient`
/// that uses the regular CAS API routes.
pub struct SimulationControlClient {
    endpoint: String,
    http_client: reqwest::Client,
    remote_client: Arc<RemoteClient>,
}

impl SimulationControlClient {
    /// Creates a new client connected to the given server endpoint URL.
    pub fn new(endpoint: &str) -> Self {
        let mut headers = HeaderMap::new();
        headers.insert(http::header::USER_AGENT, http::header::HeaderValue::from_static("simulation-control-client"));
        let remote_client = RemoteClient::new(endpoint, &None, "simulation-session", false, Some(Arc::new(headers)));

        Self {
            endpoint: endpoint.to_string(),
            http_client: reqwest::Client::new(),
            remote_client,
        }
    }

    /// Constructs a full URL for a `/simulation/` endpoint path.
    fn sim_url(&self, path: &str) -> String {
        format!("{}/simulation{}", self.endpoint, path)
    }

    /// Posts a config key-value pair to the `/simulation/set_config` endpoint.
    fn post_config(&self, config: &str, value: &str) {
        let url = format!(
            "{}/simulation/set_config?config={}&value={}",
            self.endpoint,
            urlencoding::encode(config),
            urlencoding::encode(value),
        );
        let client = self.http_client.clone();
        let config_name = config.to_string();
        let config_value = value.to_string();
        tokio::spawn(async move {
            for attempt in 1..=CONFIG_POST_MAX_ATTEMPTS {
                match client.post(&url).send().await {
                    Ok(response) if response.status().is_success() => return,
                    Ok(response) => {
                        let status = response.status();
                        let body = response.text().await.unwrap_or_default();

                        if !status.is_server_error() || attempt == CONFIG_POST_MAX_ATTEMPTS {
                            tracing::warn!(
                                "simulation config apply failed: config={} value={} attempt={}/{} status={} body={}",
                                config_name,
                                config_value,
                                attempt,
                                CONFIG_POST_MAX_ATTEMPTS,
                                status,
                                body
                            );
                            return;
                        }

                        tracing::warn!(
                            "simulation config apply retrying: config={} value={} attempt={}/{} status={} body={}",
                            config_name,
                            config_value,
                            attempt,
                            CONFIG_POST_MAX_ATTEMPTS,
                            status,
                            body
                        );
                    },
                    Err(error) => {
                        if attempt == CONFIG_POST_MAX_ATTEMPTS {
                            tracing::warn!(
                                "simulation config apply failed after retries: config={} value={} attempt={}/{} error={}",
                                config_name,
                                config_value,
                                attempt,
                                CONFIG_POST_MAX_ATTEMPTS,
                                error
                            );
                            return;
                        }

                        tracing::warn!(
                            "simulation config apply retrying after transport error: config={} value={} attempt={}/{} error={}",
                            config_name,
                            config_value,
                            attempt,
                            CONFIG_POST_MAX_ATTEMPTS,
                            error
                        );
                    },
                }

                let delay_ms = CONFIG_POST_RETRY_DELAY_MS.saturating_mul(attempt as u64);
                tokio::time::sleep(tokio::time::Duration::from_millis(delay_ms)).await;
            }
        });
    }

    /// Checks an HTTP response status, mapping errors to `ClientError`.
    async fn check_status(response: reqwest::Response) -> Result<reqwest::Response> {
        let status = response.status();
        if status.is_success() {
            Ok(response)
        } else if status == reqwest::StatusCode::NOT_IMPLEMENTED {
            Err(ClientError::Other("Deletion controls not available for this server backend".to_string()))
        } else if status == reqwest::StatusCode::RANGE_NOT_SATISFIABLE {
            Err(ClientError::InvalidRange)
        } else {
            let body = response.text().await.unwrap_or_default();
            Err(ClientError::Other(format!("HTTP {status}: {body}")))
        }
    }

    /// Like `check_status`, but maps 404 to `ClientError::XORBNotFound` for XORB endpoints.
    async fn check_xorb_status(response: reqwest::Response, hash: &MerkleHash) -> Result<reqwest::Response> {
        let status = response.status();
        if status == reqwest::StatusCode::NOT_FOUND {
            Err(ClientError::XORBNotFound(*hash))
        } else {
            Self::check_status(response).await
        }
    }
}

#[async_trait]
impl Client for SimulationControlClient {
    /// Delegates file reconstruction info lookup to the internal `RemoteClient`.
    async fn get_file_reconstruction_info(
        &self,
        file_hash: &MerkleHash,
    ) -> Result<Option<(xet_core_structures::metadata_shard::file_structs::MDBFileInfo, Option<MerkleHash>)>> {
        self.remote_client.get_file_reconstruction_info(file_hash).await
    }

    /// Delegates reconstruction query to the internal `RemoteClient`.
    async fn get_reconstruction(
        &self,
        file_id: &MerkleHash,
        bytes_range: Option<FileRange>,
    ) -> Result<Option<QueryReconstructionResponseV2>> {
        self.remote_client.get_reconstruction(file_id, bytes_range).await
    }

    /// Delegates batch reconstruction query to the internal `RemoteClient`.
    async fn batch_get_reconstruction(
        &self,
        file_ids: &[MerkleHash],
    ) -> Result<crate::cas_types::BatchQueryReconstructionResponse> {
        self.remote_client.batch_get_reconstruction(file_ids).await
    }

    /// Delegates download permit acquisition to the internal `RemoteClient`.
    async fn acquire_download_permit(&self) -> Result<crate::cas_client::adaptive_concurrency::ConnectionPermit> {
        self.remote_client.acquire_download_permit().await
    }

    /// Delegates file term data download to the internal `RemoteClient`.
    async fn get_file_term_data(
        &self,
        url_info: Box<dyn crate::cas_client::interface::URLProvider>,
        download_permit: crate::cas_client::adaptive_concurrency::ConnectionPermit,
        progress_callback: Option<crate::cas_client::ProgressCallback>,
        uncompressed_size_if_known: Option<usize>,
    ) -> Result<(Bytes, Vec<u32>)> {
        self.remote_client
            .get_file_term_data(url_info, download_permit, progress_callback, uncompressed_size_if_known)
            .await
    }

    /// Delegates global dedup shard query to the internal `RemoteClient`.
    async fn query_for_global_dedup_shard(&self, prefix: &str, chunk_hash: &MerkleHash) -> Result<Option<Bytes>> {
        self.remote_client.query_for_global_dedup_shard(prefix, chunk_hash).await
    }

    /// Delegates upload permit acquisition to the internal `RemoteClient`.
    async fn acquire_upload_permit(&self) -> Result<crate::cas_client::adaptive_concurrency::ConnectionPermit> {
        self.remote_client.acquire_upload_permit().await
    }

    /// Delegates shard upload to the internal `RemoteClient`.
    async fn upload_shard(
        &self,
        shard_data: Bytes,
        upload_permit: crate::cas_client::adaptive_concurrency::ConnectionPermit,
    ) -> Result<bool> {
        self.remote_client.upload_shard(shard_data, upload_permit).await
    }

    /// Delegates XORB upload to the internal `RemoteClient`.
    async fn upload_xorb(
        &self,
        prefix: &str,
        serialized_xorb_object: xet_core_structures::xorb_object::SerializedXorbObject,
        progress_callback: Option<crate::cas_client::ProgressCallback>,
        upload_permit: crate::cas_client::adaptive_concurrency::ConnectionPermit,
    ) -> Result<u64> {
        self.remote_client
            .upload_xorb(prefix, serialized_xorb_object, progress_callback, upload_permit)
            .await
    }
}

#[async_trait]
impl DirectAccessClient for SimulationControlClient {
    fn set_global_dedup_shard_expiration(&self, expiration: Option<Duration>) {
        self.post_config("global_dedup_shard_expiration", &duration_to_expiration_secs_ceil(expiration).to_string());
    }

    fn set_fetch_term_url_expiration(&self, expiration: Duration) {
        self.post_config("url_expiration", &(expiration.as_millis() as u64).to_string());
    }

    async fn apply_api_delay(&self) {
        // No-op: delays are applied server-side via set_api_delay_range
    }

    fn set_max_ranges_per_fetch(&self, max_ranges: usize) {
        self.post_config("max_ranges_per_fetch", &max_ranges.to_string());
    }

    fn disable_v2_reconstruction(&self, status_code: u16) {
        self.post_config("disable_v2_reconstruction", &status_code.to_string());
    }

    async fn get_reconstruction_v1(
        &self,
        file_id: &MerkleHash,
        bytes_range: Option<FileRange>,
    ) -> Result<Option<crate::cas_types::QueryReconstructionResponse>> {
        self.remote_client.get_reconstruction_v1(file_id, bytes_range).await
    }

    async fn get_reconstruction_v2(
        &self,
        file_id: &MerkleHash,
        bytes_range: Option<FileRange>,
    ) -> Result<Option<QueryReconstructionResponseV2>> {
        self.remote_client.get_reconstruction_v2(file_id, bytes_range).await
    }

    fn set_api_delay_range(&self, delay_range: Option<Range<Duration>>) {
        match delay_range {
            Some(range) => {
                let value = format!("({}ms, {}ms)", range.start.as_millis(), range.end.as_millis());
                self.post_config("api_delay", &value);
            },
            None => {
                self.post_config("api_delay", "(0ms, 0ms)");
            },
        }
    }

    /// Lists all XORB hashes via the `/simulation/xorbs` endpoint.
    async fn list_xorbs(&self) -> Result<Vec<MerkleHash>> {
        let resp = self
            .http_client
            .get(self.sim_url("/xorbs"))
            .send()
            .await
            .map_err(|e| ClientError::Other(e.to_string()))?;
        let resp = Self::check_status(resp).await?;
        resp.json().await.map_err(|e| ClientError::Other(e.to_string()))
    }

    /// Deletes a XORB by hash via the `/simulation/xorbs/{hash}` endpoint.
    async fn delete_xorb(&self, hash: &MerkleHash) {
        let hex = HexMerkleHash::from(*hash);
        let url = self.sim_url(&format!("/xorbs/{hex}"));
        let _ = self.http_client.delete(&url).send().await;
    }

    /// Retrieves the full XORB contents by hash via the `/simulation/xorbs/{hash}` endpoint.
    async fn get_full_xorb(&self, hash: &MerkleHash) -> Result<Bytes> {
        let hex = HexMerkleHash::from(*hash);
        let url = self.sim_url(&format!("/xorbs/{hex}"));
        let resp = self
            .http_client
            .get(&url)
            .send()
            .await
            .map_err(|e| ClientError::Other(e.to_string()))?;
        let resp = Self::check_xorb_status(resp, hash).await?;
        resp.bytes().await.map_err(|e| ClientError::Other(e.to_string()))
    }

    /// Retrieves specific chunk ranges from a XORB via the `/simulation/xorbs/{hash}/ranges` endpoint.
    async fn get_xorb_ranges(&self, hash: &MerkleHash, chunk_ranges: Vec<(u32, u32)>) -> Result<Vec<Bytes>> {
        let hex = HexMerkleHash::from(*hash);
        let url = self.sim_url(&format!("/xorbs/{hex}/ranges"));
        let body = XorbRangesRequest { ranges: chunk_ranges };
        let resp = self
            .http_client
            .post(&url)
            .json(&body)
            .send()
            .await
            .map_err(|e| ClientError::Other(e.to_string()))?;
        let resp = Self::check_xorb_status(resp, hash).await?;
        let result: XorbRangesResponse = resp.json().await.map_err(|e| ClientError::Other(e.to_string()))?;
        Ok(result.data.into_iter().map(Bytes::from).collect())
    }

    /// Returns the chunk count of a XORB via the `/simulation/xorbs/{hash}/length` endpoint.
    async fn xorb_length(&self, hash: &MerkleHash) -> Result<u32> {
        let hex = HexMerkleHash::from(*hash);
        let url = self.sim_url(&format!("/xorbs/{hex}/length"));
        let resp = self
            .http_client
            .get(&url)
            .send()
            .await
            .map_err(|e| ClientError::Other(e.to_string()))?;
        let resp = Self::check_xorb_status(resp, hash).await?;
        let result: XorbLengthResponse = resp.json().await.map_err(|e| ClientError::Other(e.to_string()))?;
        Ok(result.length)
    }

    /// Checks whether a XORB exists via the `/simulation/xorbs/{hash}/exists` endpoint.
    async fn xorb_exists(&self, hash: &MerkleHash) -> Result<bool> {
        let hex = HexMerkleHash::from(*hash);
        let url = self.sim_url(&format!("/xorbs/{hex}/exists"));
        let resp = self
            .http_client
            .get(&url)
            .send()
            .await
            .map_err(|e| ClientError::Other(e.to_string()))?;
        let resp = Self::check_status(resp).await?;
        let result: XorbExistsResponse = resp.json().await.map_err(|e| ClientError::Other(e.to_string()))?;
        Ok(result.exists)
    }

    /// Fetches the raw XORB bytes and deserializes the `XorbObject` footer locally.
    async fn xorb_footer(&self, hash: &MerkleHash) -> Result<XorbObject> {
        let raw_bytes = self.get_xorb_raw_bytes(hash, None).await?;
        XorbObject::deserialize(&mut std::io::Cursor::new(raw_bytes))
            .map_err(|e| ClientError::Other(format!("Failed to deserialize XorbObject footer: {e}")))
    }

    /// Returns the file size via the `/simulation/files/{hash}/size` endpoint.
    async fn get_file_size(&self, hash: &MerkleHash) -> Result<u64> {
        let hex = HexMerkleHash::from(*hash);
        let url = self.sim_url(&format!("/files/{hex}/size"));
        let resp = self
            .http_client
            .get(&url)
            .send()
            .await
            .map_err(|e| ClientError::Other(e.to_string()))?;
        let resp = Self::check_status(resp).await?;
        let result: FileSizeResponse = resp.json().await.map_err(|e| ClientError::Other(e.to_string()))?;
        Ok(result.size)
    }

    /// Retrieves file data, optionally with a byte range, via the `/simulation/files/{hash}/data` endpoint.
    async fn get_file_data(&self, hash: &MerkleHash, byte_range: Option<FileRange>) -> Result<Bytes> {
        let hex = HexMerkleHash::from(*hash);
        let url = self.sim_url(&format!("/files/{hex}/data"));
        let mut req = self.http_client.get(&url);
        if let Some(range) = byte_range {
            req = req.header(reqwest::header::RANGE, format!("bytes={}-{}", range.start, range.end.saturating_sub(1)));
        }
        let resp = req.send().await.map_err(|e| ClientError::Other(e.to_string()))?;
        let resp = Self::check_status(resp).await?;
        resp.bytes().await.map_err(|e| ClientError::Other(e.to_string()))
    }

    /// Retrieves raw XORB bytes, optionally with a byte range, via the `/simulation/xorbs/{hash}/raw` endpoint.
    async fn get_xorb_raw_bytes(&self, hash: &MerkleHash, byte_range: Option<FileRange>) -> Result<Bytes> {
        let hex = HexMerkleHash::from(*hash);
        let url = self.sim_url(&format!("/xorbs/{hex}/raw"));
        let mut req = self.http_client.get(&url);
        if let Some(range) = byte_range {
            req = req.header(reqwest::header::RANGE, format!("bytes={}-{}", range.start, range.end.saturating_sub(1)));
        }
        let resp = req.send().await.map_err(|e| ClientError::Other(e.to_string()))?;
        let resp = Self::check_xorb_status(resp, hash).await?;
        resp.bytes().await.map_err(|e| ClientError::Other(e.to_string()))
    }

    /// Returns the raw byte length of a XORB via the `/simulation/xorbs/{hash}/raw_length` endpoint.
    async fn xorb_raw_length(&self, hash: &MerkleHash) -> Result<u64> {
        let hex = HexMerkleHash::from(*hash);
        let url = self.sim_url(&format!("/xorbs/{hex}/raw_length"));
        let resp = self
            .http_client
            .get(&url)
            .send()
            .await
            .map_err(|e| ClientError::Other(e.to_string()))?;
        let resp = Self::check_xorb_status(resp, hash).await?;
        let result: XorbRawLengthResponse = resp.json().await.map_err(|e| ClientError::Other(e.to_string()))?;
        Ok(result.length)
    }

    /// Fetches reconstructed term data via the `/simulation/fetch_term_data` endpoint.
    async fn fetch_term_data(
        &self,
        hash: MerkleHash,
        fetch_term: XorbReconstructionFetchInfo,
    ) -> Result<(Bytes, Vec<u32>)> {
        let url = self.sim_url("/fetch_term_data");
        let body = FetchTermDataRequest { hash, fetch_term };
        let resp = self
            .http_client
            .post(&url)
            .json(&body)
            .send()
            .await
            .map_err(|e| ClientError::Other(e.to_string()))?;
        let resp = Self::check_status(resp).await?;
        let result: FetchTermDataResponse = resp.json().await.map_err(|e| ClientError::Other(e.to_string()))?;
        Ok((Bytes::from(result.data), result.chunk_byte_indices))
    }
}

#[async_trait]
impl DeletionControlableClient for SimulationControlClient {
    /// Lists all shard entry hashes via the `/simulation/shards` endpoint.
    async fn list_shard_entries(&self) -> Result<Vec<MerkleHash>> {
        let resp = self
            .http_client
            .get(self.sim_url("/shards"))
            .send()
            .await
            .map_err(|e| ClientError::Other(e.to_string()))?;
        let resp = Self::check_status(resp).await?;
        resp.json().await.map_err(|e| ClientError::Other(e.to_string()))
    }

    /// Retrieves raw shard bytes by hash via the `/simulation/shards/{hash}` endpoint.
    async fn get_shard_bytes(&self, hash: &MerkleHash) -> Result<Bytes> {
        let hex = HexMerkleHash::from(*hash);
        let url = self.sim_url(&format!("/shards/{hex}"));
        let resp = self
            .http_client
            .get(&url)
            .send()
            .await
            .map_err(|e| ClientError::Other(e.to_string()))?;
        let resp = Self::check_status(resp).await?;
        resp.bytes().await.map_err(|e| ClientError::Other(e.to_string()))
    }

    /// Deletes a shard entry by hash via the `/simulation/shards/{hash}` endpoint.
    async fn delete_shard_entry(&self, hash: &MerkleHash) -> Result<()> {
        let hex = HexMerkleHash::from(*hash);
        let url = self.sim_url(&format!("/shards/{hex}"));
        let resp = self
            .http_client
            .delete(&url)
            .send()
            .await
            .map_err(|e| ClientError::Other(e.to_string()))?;
        Self::check_status(resp).await?;
        Ok(())
    }

    /// Lists all (file_hash, shard_hash) pairs via the `/simulation/file_entries` endpoint.
    async fn list_file_shard_entries(&self) -> Result<Vec<(MerkleHash, MerkleHash)>> {
        let resp = self
            .http_client
            .get(self.sim_url("/file_entries"))
            .send()
            .await
            .map_err(|e| ClientError::Other(e.to_string()))?;
        let resp = Self::check_status(resp).await?;
        let entries: Vec<FileShardsEntry> = resp.json().await.map_err(|e| ClientError::Other(e.to_string()))?;
        Ok(entries.into_iter().map(|e| (e.file_hash, e.shard_hash)).collect())
    }

    /// Deletes a file entry by hash via the `/simulation/file_entries/{hash}` endpoint.
    async fn delete_file_entry(&self, file_hash: &MerkleHash) -> Result<()> {
        let hex = HexMerkleHash::from(*file_hash);
        let url = self.sim_url(&format!("/file_entries/{hex}"));
        let resp = self
            .http_client
            .delete(&url)
            .send()
            .await
            .map_err(|e| ClientError::Other(e.to_string()))?;
        Self::check_status(resp).await?;
        Ok(())
    }

    /// Removes all global-dedup table entries for a shard via `/simulation/shards/{hash}/dedup_entries`.
    async fn remove_shard_dedup_entries(&self, shard_hash: &MerkleHash) -> Result<()> {
        let hex = HexMerkleHash::from(*shard_hash);
        let url = self.sim_url(&format!("/shards/{hex}/dedup_entries"));
        let resp = self
            .http_client
            .delete(&url)
            .send()
            .await
            .map_err(|e| ClientError::Other(e.to_string()))?;
        Self::check_status(resp).await?;
        Ok(())
    }

    async fn verify_integrity(&self) -> Result<()> {
        let resp = self
            .http_client
            .post(self.sim_url("/verify_integrity"))
            .send()
            .await
            .map_err(|e| ClientError::Other(e.to_string()))?;
        Self::check_status(resp).await?;
        Ok(())
    }

    async fn verify_all_reachable(&self) -> Result<()> {
        let resp = self
            .http_client
            .post(self.sim_url("/verify_all_reachable"))
            .send()
            .await
            .map_err(|e| ClientError::Other(e.to_string()))?;
        Self::check_status(resp).await?;
        Ok(())
    }
}