Skip to main content

browser_protocol/cachestorage/
mod.rs

1use serde::{Serialize, Deserialize};
2use serde_json::Value as JsonValue;
3use std::borrow::Cow;
4
5/// Unique identifier of the Cache object.
6
7pub type CacheId<'a> = Cow<'a, str>;
8
9/// type of HTTP response cached
10
11#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
12pub enum CachedResponseType {
13    #[default]
14    #[serde(rename = "basic")]
15    Basic,
16    #[serde(rename = "cors")]
17    Cors,
18    #[serde(rename = "default")]
19    Default,
20    #[serde(rename = "error")]
21    Error,
22    #[serde(rename = "opaqueResponse")]
23    OpaqueResponse,
24    #[serde(rename = "opaqueRedirect")]
25    OpaqueRedirect,
26}
27
28/// Data entry.
29
30#[derive(Debug, Clone, Serialize, Deserialize, Default)]
31#[serde(rename_all = "camelCase")]
32pub struct DataEntry<'a> {
33    /// Request URL.
34    #[serde(rename = "requestURL")]
35    request_url: Cow<'a, str>,
36    /// Request method.
37    #[serde(rename = "requestMethod")]
38    request_method: Cow<'a, str>,
39    /// Request headers
40    #[serde(rename = "requestHeaders")]
41    request_headers: Vec<Header<'a>>,
42    /// Number of seconds since epoch.
43    #[serde(rename = "responseTime")]
44    response_time: f64,
45    /// HTTP response status code.
46    #[serde(rename = "responseStatus")]
47    response_status: i64,
48    /// HTTP response status text.
49    #[serde(rename = "responseStatusText")]
50    response_status_text: Cow<'a, str>,
51    /// HTTP response type
52    #[serde(rename = "responseType")]
53    response_type: CachedResponseType,
54    /// Response headers
55    #[serde(rename = "responseHeaders")]
56    response_headers: Vec<Header<'a>>,
57}
58
59impl<'a> DataEntry<'a> {
60    /// Creates a builder for this type with the required parameters:
61    /// * `request_url`: Request URL.
62    /// * `request_method`: Request method.
63    /// * `request_headers`: Request headers
64    /// * `response_time`: Number of seconds since epoch.
65    /// * `response_status`: HTTP response status code.
66    /// * `response_status_text`: HTTP response status text.
67    /// * `response_type`: HTTP response type
68    /// * `response_headers`: Response headers
69    pub fn builder(request_url: impl Into<Cow<'a, str>>, request_method: impl Into<Cow<'a, str>>, request_headers: Vec<Header<'a>>, response_time: f64, response_status: i64, response_status_text: impl Into<Cow<'a, str>>, response_type: impl Into<CachedResponseType>, response_headers: Vec<Header<'a>>) -> DataEntryBuilder<'a> {
70        DataEntryBuilder {
71            request_url: request_url.into(),
72            request_method: request_method.into(),
73            request_headers: request_headers,
74            response_time: response_time,
75            response_status: response_status,
76            response_status_text: response_status_text.into(),
77            response_type: response_type.into(),
78            response_headers: response_headers,
79        }
80    }
81    /// Request URL.
82    pub fn request_url(&self) -> &str { self.request_url.as_ref() }
83    /// Request method.
84    pub fn request_method(&self) -> &str { self.request_method.as_ref() }
85    /// Request headers
86    pub fn request_headers(&self) -> &[Header<'a>] { &self.request_headers }
87    /// Number of seconds since epoch.
88    pub fn response_time(&self) -> f64 { self.response_time }
89    /// HTTP response status code.
90    pub fn response_status(&self) -> i64 { self.response_status }
91    /// HTTP response status text.
92    pub fn response_status_text(&self) -> &str { self.response_status_text.as_ref() }
93    /// HTTP response type
94    pub fn response_type(&self) -> &CachedResponseType { &self.response_type }
95    /// Response headers
96    pub fn response_headers(&self) -> &[Header<'a>] { &self.response_headers }
97}
98
99
100pub struct DataEntryBuilder<'a> {
101    request_url: Cow<'a, str>,
102    request_method: Cow<'a, str>,
103    request_headers: Vec<Header<'a>>,
104    response_time: f64,
105    response_status: i64,
106    response_status_text: Cow<'a, str>,
107    response_type: CachedResponseType,
108    response_headers: Vec<Header<'a>>,
109}
110
111impl<'a> DataEntryBuilder<'a> {
112    pub fn build(self) -> DataEntry<'a> {
113        DataEntry {
114            request_url: self.request_url,
115            request_method: self.request_method,
116            request_headers: self.request_headers,
117            response_time: self.response_time,
118            response_status: self.response_status,
119            response_status_text: self.response_status_text,
120            response_type: self.response_type,
121            response_headers: self.response_headers,
122        }
123    }
124}
125
126/// Cache identifier.
127
128#[derive(Debug, Clone, Serialize, Deserialize, Default)]
129#[serde(rename_all = "camelCase")]
130pub struct Cache<'a> {
131    /// An opaque unique id of the cache.
132    #[serde(rename = "cacheId")]
133    cache_id: CacheId<'a>,
134    /// Security origin of the cache.
135    #[serde(rename = "securityOrigin")]
136    security_origin: Cow<'a, str>,
137    /// Storage key of the cache.
138    #[serde(rename = "storageKey")]
139    storage_key: Cow<'a, str>,
140    /// Storage bucket of the cache.
141    #[serde(skip_serializing_if = "Option::is_none", rename = "storageBucket")]
142    storage_bucket: Option<crate::storage::StorageBucket<'a>>,
143    /// The name of the cache.
144    #[serde(rename = "cacheName")]
145    cache_name: Cow<'a, str>,
146}
147
148impl<'a> Cache<'a> {
149    /// Creates a builder for this type with the required parameters:
150    /// * `cache_id`: An opaque unique id of the cache.
151    /// * `security_origin`: Security origin of the cache.
152    /// * `storage_key`: Storage key of the cache.
153    /// * `cache_name`: The name of the cache.
154    pub fn builder(cache_id: impl Into<CacheId<'a>>, security_origin: impl Into<Cow<'a, str>>, storage_key: impl Into<Cow<'a, str>>, cache_name: impl Into<Cow<'a, str>>) -> CacheBuilder<'a> {
155        CacheBuilder {
156            cache_id: cache_id.into(),
157            security_origin: security_origin.into(),
158            storage_key: storage_key.into(),
159            storage_bucket: None,
160            cache_name: cache_name.into(),
161        }
162    }
163    /// An opaque unique id of the cache.
164    pub fn cache_id(&self) -> &CacheId<'a> { &self.cache_id }
165    /// Security origin of the cache.
166    pub fn security_origin(&self) -> &str { self.security_origin.as_ref() }
167    /// Storage key of the cache.
168    pub fn storage_key(&self) -> &str { self.storage_key.as_ref() }
169    /// Storage bucket of the cache.
170    pub fn storage_bucket(&self) -> Option<&crate::storage::StorageBucket<'a>> { self.storage_bucket.as_ref() }
171    /// The name of the cache.
172    pub fn cache_name(&self) -> &str { self.cache_name.as_ref() }
173}
174
175
176pub struct CacheBuilder<'a> {
177    cache_id: CacheId<'a>,
178    security_origin: Cow<'a, str>,
179    storage_key: Cow<'a, str>,
180    storage_bucket: Option<crate::storage::StorageBucket<'a>>,
181    cache_name: Cow<'a, str>,
182}
183
184impl<'a> CacheBuilder<'a> {
185    /// Storage bucket of the cache.
186    pub fn storage_bucket(mut self, storage_bucket: crate::storage::StorageBucket<'a>) -> Self { self.storage_bucket = Some(storage_bucket); self }
187    pub fn build(self) -> Cache<'a> {
188        Cache {
189            cache_id: self.cache_id,
190            security_origin: self.security_origin,
191            storage_key: self.storage_key,
192            storage_bucket: self.storage_bucket,
193            cache_name: self.cache_name,
194        }
195    }
196}
197
198
199#[derive(Debug, Clone, Serialize, Deserialize, Default)]
200#[serde(rename_all = "camelCase")]
201pub struct Header<'a> {
202    name: Cow<'a, str>,
203    value: Cow<'a, str>,
204}
205
206impl<'a> Header<'a> {
207    /// Creates a builder for this type with the required parameters:
208    /// * `name`: 
209    /// * `value`: 
210    pub fn builder(name: impl Into<Cow<'a, str>>, value: impl Into<Cow<'a, str>>) -> HeaderBuilder<'a> {
211        HeaderBuilder {
212            name: name.into(),
213            value: value.into(),
214        }
215    }
216    pub fn name(&self) -> &str { self.name.as_ref() }
217    pub fn value(&self) -> &str { self.value.as_ref() }
218}
219
220
221pub struct HeaderBuilder<'a> {
222    name: Cow<'a, str>,
223    value: Cow<'a, str>,
224}
225
226impl<'a> HeaderBuilder<'a> {
227    pub fn build(self) -> Header<'a> {
228        Header {
229            name: self.name,
230            value: self.value,
231        }
232    }
233}
234
235/// Cached response
236
237#[derive(Debug, Clone, Serialize, Deserialize, Default)]
238#[serde(rename_all = "camelCase")]
239pub struct CachedResponse<'a> {
240    /// Entry content, base64-encoded. (Encoded as a base64 string when passed over JSON)
241    body: Cow<'a, str>,
242}
243
244impl<'a> CachedResponse<'a> {
245    /// Creates a builder for this type with the required parameters:
246    /// * `body`: Entry content, base64-encoded. (Encoded as a base64 string when passed over JSON)
247    pub fn builder(body: impl Into<Cow<'a, str>>) -> CachedResponseBuilder<'a> {
248        CachedResponseBuilder {
249            body: body.into(),
250        }
251    }
252    /// Entry content, base64-encoded. (Encoded as a base64 string when passed over JSON)
253    pub fn body(&self) -> &str { self.body.as_ref() }
254}
255
256
257pub struct CachedResponseBuilder<'a> {
258    body: Cow<'a, str>,
259}
260
261impl<'a> CachedResponseBuilder<'a> {
262    pub fn build(self) -> CachedResponse<'a> {
263        CachedResponse {
264            body: self.body,
265        }
266    }
267}
268
269/// Deletes a cache.
270
271#[derive(Debug, Clone, Serialize, Deserialize, Default)]
272#[serde(rename_all = "camelCase")]
273pub struct DeleteCacheParams<'a> {
274    /// Id of cache for deletion.
275    #[serde(rename = "cacheId")]
276    cache_id: CacheId<'a>,
277}
278
279impl<'a> DeleteCacheParams<'a> {
280    /// Creates a builder for this type with the required parameters:
281    /// * `cache_id`: Id of cache for deletion.
282    pub fn builder(cache_id: impl Into<CacheId<'a>>) -> DeleteCacheParamsBuilder<'a> {
283        DeleteCacheParamsBuilder {
284            cache_id: cache_id.into(),
285        }
286    }
287    /// Id of cache for deletion.
288    pub fn cache_id(&self) -> &CacheId<'a> { &self.cache_id }
289}
290
291
292pub struct DeleteCacheParamsBuilder<'a> {
293    cache_id: CacheId<'a>,
294}
295
296impl<'a> DeleteCacheParamsBuilder<'a> {
297    pub fn build(self) -> DeleteCacheParams<'a> {
298        DeleteCacheParams {
299            cache_id: self.cache_id,
300        }
301    }
302}
303
304impl<'a> DeleteCacheParams<'a> { pub const METHOD: &'static str = "CacheStorage.deleteCache"; }
305
306impl<'a> crate::CdpCommand<'a> for DeleteCacheParams<'a> {
307    const METHOD: &'static str = "CacheStorage.deleteCache";
308    type Response = crate::EmptyReturns;
309}
310
311/// Deletes a cache entry.
312
313#[derive(Debug, Clone, Serialize, Deserialize, Default)]
314#[serde(rename_all = "camelCase")]
315pub struct DeleteEntryParams<'a> {
316    /// Id of cache where the entry will be deleted.
317    #[serde(rename = "cacheId")]
318    cache_id: CacheId<'a>,
319    /// URL spec of the request.
320    request: Cow<'a, str>,
321}
322
323impl<'a> DeleteEntryParams<'a> {
324    /// Creates a builder for this type with the required parameters:
325    /// * `cache_id`: Id of cache where the entry will be deleted.
326    /// * `request`: URL spec of the request.
327    pub fn builder(cache_id: impl Into<CacheId<'a>>, request: impl Into<Cow<'a, str>>) -> DeleteEntryParamsBuilder<'a> {
328        DeleteEntryParamsBuilder {
329            cache_id: cache_id.into(),
330            request: request.into(),
331        }
332    }
333    /// Id of cache where the entry will be deleted.
334    pub fn cache_id(&self) -> &CacheId<'a> { &self.cache_id }
335    /// URL spec of the request.
336    pub fn request(&self) -> &str { self.request.as_ref() }
337}
338
339
340pub struct DeleteEntryParamsBuilder<'a> {
341    cache_id: CacheId<'a>,
342    request: Cow<'a, str>,
343}
344
345impl<'a> DeleteEntryParamsBuilder<'a> {
346    pub fn build(self) -> DeleteEntryParams<'a> {
347        DeleteEntryParams {
348            cache_id: self.cache_id,
349            request: self.request,
350        }
351    }
352}
353
354impl<'a> DeleteEntryParams<'a> { pub const METHOD: &'static str = "CacheStorage.deleteEntry"; }
355
356impl<'a> crate::CdpCommand<'a> for DeleteEntryParams<'a> {
357    const METHOD: &'static str = "CacheStorage.deleteEntry";
358    type Response = crate::EmptyReturns;
359}
360
361/// Requests cache names.
362
363#[derive(Debug, Clone, Serialize, Deserialize, Default)]
364#[serde(rename_all = "camelCase")]
365pub struct RequestCacheNamesParams<'a> {
366    /// At least and at most one of securityOrigin, storageKey, storageBucket must be specified.
367    /// Security origin.
368    #[serde(skip_serializing_if = "Option::is_none", rename = "securityOrigin")]
369    security_origin: Option<Cow<'a, str>>,
370    /// Storage key.
371    #[serde(skip_serializing_if = "Option::is_none", rename = "storageKey")]
372    storage_key: Option<Cow<'a, str>>,
373    /// Storage bucket. If not specified, it uses the default bucket.
374    #[serde(skip_serializing_if = "Option::is_none", rename = "storageBucket")]
375    storage_bucket: Option<crate::storage::StorageBucket<'a>>,
376}
377
378impl<'a> RequestCacheNamesParams<'a> {
379    /// Creates a builder for this type.
380    pub fn builder() -> RequestCacheNamesParamsBuilder<'a> {
381        RequestCacheNamesParamsBuilder {
382            security_origin: None,
383            storage_key: None,
384            storage_bucket: None,
385        }
386    }
387    /// At least and at most one of securityOrigin, storageKey, storageBucket must be specified.
388    /// Security origin.
389    pub fn security_origin(&self) -> Option<&str> { self.security_origin.as_deref() }
390    /// Storage key.
391    pub fn storage_key(&self) -> Option<&str> { self.storage_key.as_deref() }
392    /// Storage bucket. If not specified, it uses the default bucket.
393    pub fn storage_bucket(&self) -> Option<&crate::storage::StorageBucket<'a>> { self.storage_bucket.as_ref() }
394}
395
396#[derive(Default)]
397pub struct RequestCacheNamesParamsBuilder<'a> {
398    security_origin: Option<Cow<'a, str>>,
399    storage_key: Option<Cow<'a, str>>,
400    storage_bucket: Option<crate::storage::StorageBucket<'a>>,
401}
402
403impl<'a> RequestCacheNamesParamsBuilder<'a> {
404    /// At least and at most one of securityOrigin, storageKey, storageBucket must be specified.
405    /// Security origin.
406    pub fn security_origin(mut self, security_origin: impl Into<Cow<'a, str>>) -> Self { self.security_origin = Some(security_origin.into()); self }
407    /// Storage key.
408    pub fn storage_key(mut self, storage_key: impl Into<Cow<'a, str>>) -> Self { self.storage_key = Some(storage_key.into()); self }
409    /// Storage bucket. If not specified, it uses the default bucket.
410    pub fn storage_bucket(mut self, storage_bucket: crate::storage::StorageBucket<'a>) -> Self { self.storage_bucket = Some(storage_bucket); self }
411    pub fn build(self) -> RequestCacheNamesParams<'a> {
412        RequestCacheNamesParams {
413            security_origin: self.security_origin,
414            storage_key: self.storage_key,
415            storage_bucket: self.storage_bucket,
416        }
417    }
418}
419
420/// Requests cache names.
421
422#[derive(Debug, Clone, Serialize, Deserialize, Default)]
423#[serde(rename_all = "camelCase")]
424pub struct RequestCacheNamesReturns<'a> {
425    /// Caches for the security origin.
426    caches: Vec<Cache<'a>>,
427}
428
429impl<'a> RequestCacheNamesReturns<'a> {
430    /// Creates a builder for this type with the required parameters:
431    /// * `caches`: Caches for the security origin.
432    pub fn builder(caches: Vec<Cache<'a>>) -> RequestCacheNamesReturnsBuilder<'a> {
433        RequestCacheNamesReturnsBuilder {
434            caches: caches,
435        }
436    }
437    /// Caches for the security origin.
438    pub fn caches(&self) -> &[Cache<'a>] { &self.caches }
439}
440
441
442pub struct RequestCacheNamesReturnsBuilder<'a> {
443    caches: Vec<Cache<'a>>,
444}
445
446impl<'a> RequestCacheNamesReturnsBuilder<'a> {
447    pub fn build(self) -> RequestCacheNamesReturns<'a> {
448        RequestCacheNamesReturns {
449            caches: self.caches,
450        }
451    }
452}
453
454impl<'a> RequestCacheNamesParams<'a> { pub const METHOD: &'static str = "CacheStorage.requestCacheNames"; }
455
456impl<'a> crate::CdpCommand<'a> for RequestCacheNamesParams<'a> {
457    const METHOD: &'static str = "CacheStorage.requestCacheNames";
458    type Response = RequestCacheNamesReturns<'a>;
459}
460
461/// Fetches cache entry.
462
463#[derive(Debug, Clone, Serialize, Deserialize, Default)]
464#[serde(rename_all = "camelCase")]
465pub struct RequestCachedResponseParams<'a> {
466    /// Id of cache that contains the entry.
467    #[serde(rename = "cacheId")]
468    cache_id: CacheId<'a>,
469    /// URL spec of the request.
470    #[serde(rename = "requestURL")]
471    request_url: Cow<'a, str>,
472    /// headers of the request.
473    #[serde(rename = "requestHeaders")]
474    request_headers: Vec<Header<'a>>,
475}
476
477impl<'a> RequestCachedResponseParams<'a> {
478    /// Creates a builder for this type with the required parameters:
479    /// * `cache_id`: Id of cache that contains the entry.
480    /// * `request_url`: URL spec of the request.
481    /// * `request_headers`: headers of the request.
482    pub fn builder(cache_id: impl Into<CacheId<'a>>, request_url: impl Into<Cow<'a, str>>, request_headers: Vec<Header<'a>>) -> RequestCachedResponseParamsBuilder<'a> {
483        RequestCachedResponseParamsBuilder {
484            cache_id: cache_id.into(),
485            request_url: request_url.into(),
486            request_headers: request_headers,
487        }
488    }
489    /// Id of cache that contains the entry.
490    pub fn cache_id(&self) -> &CacheId<'a> { &self.cache_id }
491    /// URL spec of the request.
492    pub fn request_url(&self) -> &str { self.request_url.as_ref() }
493    /// headers of the request.
494    pub fn request_headers(&self) -> &[Header<'a>] { &self.request_headers }
495}
496
497
498pub struct RequestCachedResponseParamsBuilder<'a> {
499    cache_id: CacheId<'a>,
500    request_url: Cow<'a, str>,
501    request_headers: Vec<Header<'a>>,
502}
503
504impl<'a> RequestCachedResponseParamsBuilder<'a> {
505    pub fn build(self) -> RequestCachedResponseParams<'a> {
506        RequestCachedResponseParams {
507            cache_id: self.cache_id,
508            request_url: self.request_url,
509            request_headers: self.request_headers,
510        }
511    }
512}
513
514/// Fetches cache entry.
515
516#[derive(Debug, Clone, Serialize, Deserialize, Default)]
517#[serde(rename_all = "camelCase")]
518pub struct RequestCachedResponseReturns<'a> {
519    /// Response read from the cache.
520    response: CachedResponse<'a>,
521}
522
523impl<'a> RequestCachedResponseReturns<'a> {
524    /// Creates a builder for this type with the required parameters:
525    /// * `response`: Response read from the cache.
526    pub fn builder(response: CachedResponse<'a>) -> RequestCachedResponseReturnsBuilder<'a> {
527        RequestCachedResponseReturnsBuilder {
528            response: response,
529        }
530    }
531    /// Response read from the cache.
532    pub fn response(&self) -> &CachedResponse<'a> { &self.response }
533}
534
535
536pub struct RequestCachedResponseReturnsBuilder<'a> {
537    response: CachedResponse<'a>,
538}
539
540impl<'a> RequestCachedResponseReturnsBuilder<'a> {
541    pub fn build(self) -> RequestCachedResponseReturns<'a> {
542        RequestCachedResponseReturns {
543            response: self.response,
544        }
545    }
546}
547
548impl<'a> RequestCachedResponseParams<'a> { pub const METHOD: &'static str = "CacheStorage.requestCachedResponse"; }
549
550impl<'a> crate::CdpCommand<'a> for RequestCachedResponseParams<'a> {
551    const METHOD: &'static str = "CacheStorage.requestCachedResponse";
552    type Response = RequestCachedResponseReturns<'a>;
553}
554
555/// Requests data from cache.
556
557#[derive(Debug, Clone, Serialize, Deserialize, Default)]
558#[serde(rename_all = "camelCase")]
559pub struct RequestEntriesParams<'a> {
560    /// ID of cache to get entries from.
561    #[serde(rename = "cacheId")]
562    cache_id: CacheId<'a>,
563    /// Number of records to skip.
564    #[serde(skip_serializing_if = "Option::is_none", rename = "skipCount")]
565    skip_count: Option<u64>,
566    /// Number of records to fetch.
567    #[serde(skip_serializing_if = "Option::is_none", rename = "pageSize")]
568    page_size: Option<u64>,
569    /// If present, only return the entries containing this substring in the path
570    #[serde(skip_serializing_if = "Option::is_none", rename = "pathFilter")]
571    path_filter: Option<Cow<'a, str>>,
572}
573
574impl<'a> RequestEntriesParams<'a> {
575    /// Creates a builder for this type with the required parameters:
576    /// * `cache_id`: ID of cache to get entries from.
577    pub fn builder(cache_id: impl Into<CacheId<'a>>) -> RequestEntriesParamsBuilder<'a> {
578        RequestEntriesParamsBuilder {
579            cache_id: cache_id.into(),
580            skip_count: None,
581            page_size: None,
582            path_filter: None,
583        }
584    }
585    /// ID of cache to get entries from.
586    pub fn cache_id(&self) -> &CacheId<'a> { &self.cache_id }
587    /// Number of records to skip.
588    pub fn skip_count(&self) -> Option<u64> { self.skip_count }
589    /// Number of records to fetch.
590    pub fn page_size(&self) -> Option<u64> { self.page_size }
591    /// If present, only return the entries containing this substring in the path
592    pub fn path_filter(&self) -> Option<&str> { self.path_filter.as_deref() }
593}
594
595
596pub struct RequestEntriesParamsBuilder<'a> {
597    cache_id: CacheId<'a>,
598    skip_count: Option<u64>,
599    page_size: Option<u64>,
600    path_filter: Option<Cow<'a, str>>,
601}
602
603impl<'a> RequestEntriesParamsBuilder<'a> {
604    /// Number of records to skip.
605    pub fn skip_count(mut self, skip_count: u64) -> Self { self.skip_count = Some(skip_count); self }
606    /// Number of records to fetch.
607    pub fn page_size(mut self, page_size: u64) -> Self { self.page_size = Some(page_size); self }
608    /// If present, only return the entries containing this substring in the path
609    pub fn path_filter(mut self, path_filter: impl Into<Cow<'a, str>>) -> Self { self.path_filter = Some(path_filter.into()); self }
610    pub fn build(self) -> RequestEntriesParams<'a> {
611        RequestEntriesParams {
612            cache_id: self.cache_id,
613            skip_count: self.skip_count,
614            page_size: self.page_size,
615            path_filter: self.path_filter,
616        }
617    }
618}
619
620/// Requests data from cache.
621
622#[derive(Debug, Clone, Serialize, Deserialize, Default)]
623#[serde(rename_all = "camelCase")]
624pub struct RequestEntriesReturns<'a> {
625    /// Array of object store data entries.
626    #[serde(rename = "cacheDataEntries")]
627    cache_data_entries: Vec<DataEntry<'a>>,
628    /// Count of returned entries from this storage. If pathFilter is empty, it
629    /// is the count of all entries from this storage.
630    #[serde(rename = "returnCount")]
631    return_count: f64,
632}
633
634impl<'a> RequestEntriesReturns<'a> {
635    /// Creates a builder for this type with the required parameters:
636    /// * `cache_data_entries`: Array of object store data entries.
637    /// * `return_count`: Count of returned entries from this storage. If pathFilter is empty, it is the count of all entries from this storage.
638    pub fn builder(cache_data_entries: Vec<DataEntry<'a>>, return_count: f64) -> RequestEntriesReturnsBuilder<'a> {
639        RequestEntriesReturnsBuilder {
640            cache_data_entries: cache_data_entries,
641            return_count: return_count,
642        }
643    }
644    /// Array of object store data entries.
645    pub fn cache_data_entries(&self) -> &[DataEntry<'a>] { &self.cache_data_entries }
646    /// Count of returned entries from this storage. If pathFilter is empty, it
647    /// is the count of all entries from this storage.
648    pub fn return_count(&self) -> f64 { self.return_count }
649}
650
651
652pub struct RequestEntriesReturnsBuilder<'a> {
653    cache_data_entries: Vec<DataEntry<'a>>,
654    return_count: f64,
655}
656
657impl<'a> RequestEntriesReturnsBuilder<'a> {
658    pub fn build(self) -> RequestEntriesReturns<'a> {
659        RequestEntriesReturns {
660            cache_data_entries: self.cache_data_entries,
661            return_count: self.return_count,
662        }
663    }
664}
665
666impl<'a> RequestEntriesParams<'a> { pub const METHOD: &'static str = "CacheStorage.requestEntries"; }
667
668impl<'a> crate::CdpCommand<'a> for RequestEntriesParams<'a> {
669    const METHOD: &'static str = "CacheStorage.requestEntries";
670    type Response = RequestEntriesReturns<'a>;
671}