makegov-tango 0.4.0

Official Rust SDK for the Tango federal-contracting data API
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
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
//! `GET /api/sbir/` — SBIR/STTR topics and DoD DSIP solicitation cycles.
//!
//! `activity` (open/closed) is derived at query time from the close or end date; there is no stored flag.

use crate::client::Client;
use crate::error::{Error, Result};
use crate::internal::{apply_pagination, push_opt, push_opt_bool};
use crate::pagination::{FetchFn, Page, PageStream};
use crate::resources::agencies::urlencoding;
use crate::Record;
use bon::Builder;
use std::collections::BTreeMap;
use std::sync::Arc;

/// Options for [`Client::list_sbir_topics`] and [`Client::iterate_sbir_topics`].
#[derive(Debug, Clone, Default, Builder, PartialEq, Eq)]
#[non_exhaustive]
pub struct ListSbirTopicsOptions {
    /// 1-based page number.
    #[builder(into)]
    pub page: Option<u32>,
    /// Page size (server caps at 100).
    #[builder(into)]
    pub limit: Option<u32>,
    /// Keyset cursor.
    #[builder(into)]
    pub cursor: Option<String>,
    /// Comma-separated field selector. Use [`SHAPE_SBIR_TOPICS_MINIMAL`](crate::SHAPE_SBIR_TOPICS_MINIMAL) or roll your own.
    #[builder(into)]
    pub shape: Option<String>,
    /// Collapse nested objects into dot-separated keys.
    #[builder(default)]
    pub flat: bool,
    /// When [`flat`](Self::flat) is also true, flatten list-valued fields.
    #[builder(default)]
    pub flat_lists: bool,

    /// Whether the topic is accepting proposals today: `open`, `closed`, or `unknown` (no close date and no parent solicitation to inherit one from).
    #[builder(into)]
    pub activity: Option<String>,
    /// Agency name, abbreviation or code (e.g. `HHS`), matched against the topic's resolved organization and rolled up the hierarchy, so `HHS` includes NIH topics. OR several with `|`. A token that does not resolve falls back to a partial, case-insensitive match on the raw agency text.
    #[builder(into)]
    pub agency: Option<String>,
    /// Topic number.
    #[builder(into)]
    pub topic_number: Option<String>,
    /// Exact DoD DSIP cycle name, e.g. `DOD_SBIR_2026_P1_CBZ` (Tango API 5.3.1). Only topics fed from DSIP carry one.
    #[builder(into)]
    pub cycle_name: Option<String>,
    /// Parent solicitation number.
    #[builder(into)]
    pub solicitation_number: Option<String>,
    /// Solicitation year.
    #[builder(into)]
    pub year: Option<String>,
    /// Document source.
    #[builder(into)]
    pub doc_source: Option<String>,
    /// Close date on or after (`YYYY-MM-DD`).
    #[builder(into)]
    pub close_date_after: Option<String>,
    /// Close date on or before (`YYYY-MM-DD`).
    #[builder(into)]
    pub close_date_before: Option<String>,
    /// Open date on or after (`YYYY-MM-DD`).
    #[builder(into)]
    pub open_date_after: Option<String>,
    /// Open date on or before (`YYYY-MM-DD`).
    #[builder(into)]
    pub open_date_before: Option<String>,
    /// Release date on or after (`YYYY-MM-DD`).
    #[builder(into)]
    pub release_date_after: Option<String>,
    /// Release date on or before (`YYYY-MM-DD`).
    #[builder(into)]
    pub release_date_before: Option<String>,
    /// Case-insensitive substring match across title, description, and topic number.
    #[builder(into)]
    pub search: Option<String>,
    /// One of `activity`, `close_date`, `open_date`, `release_date`, `year`, `modified`, each optionally `-` prefixed.
    #[builder(into)]
    pub ordering: Option<String>,

    /// Escape hatch for filter keys not yet first-classed on this struct.
    #[builder(default)]
    pub extra: BTreeMap<String, String>,
}

impl ListSbirTopicsOptions {
    pub(crate) fn to_query(&self) -> Vec<(String, String)> {
        let mut q = Vec::new();
        apply_pagination(
            &mut q,
            self.page,
            self.limit,
            self.cursor.as_deref(),
            self.shape.as_deref(),
            self.flat,
            self.flat_lists,
        );
        push_opt(&mut q, "activity", self.activity.as_deref());
        push_opt(&mut q, "agency", self.agency.as_deref());
        push_opt(&mut q, "topic_number", self.topic_number.as_deref());
        push_opt(&mut q, "cycle_name", self.cycle_name.as_deref());
        push_opt(
            &mut q,
            "solicitation_number",
            self.solicitation_number.as_deref(),
        );
        push_opt(&mut q, "year", self.year.as_deref());
        push_opt(&mut q, "doc_source", self.doc_source.as_deref());
        push_opt(&mut q, "close_date_after", self.close_date_after.as_deref());
        push_opt(
            &mut q,
            "close_date_before",
            self.close_date_before.as_deref(),
        );
        push_opt(&mut q, "open_date_after", self.open_date_after.as_deref());
        push_opt(&mut q, "open_date_before", self.open_date_before.as_deref());
        push_opt(
            &mut q,
            "release_date_after",
            self.release_date_after.as_deref(),
        );
        push_opt(
            &mut q,
            "release_date_before",
            self.release_date_before.as_deref(),
        );
        push_opt(&mut q, "search", self.search.as_deref());
        push_opt(&mut q, "ordering", self.ordering.as_deref());
        for (k, v) in &self.extra {
            if !v.is_empty() {
                q.push((k.clone(), v.clone()));
            }
        }
        q
    }
}

/// Options for [`Client::list_sbir_solicitations`] and [`Client::iterate_sbir_solicitations`].
#[derive(Debug, Clone, Default, Builder, PartialEq, Eq)]
#[non_exhaustive]
pub struct ListSbirSolicitationsOptions {
    /// 1-based page number.
    #[builder(into)]
    pub page: Option<u32>,
    /// Page size (server caps at 100).
    #[builder(into)]
    pub limit: Option<u32>,
    /// Keyset cursor.
    #[builder(into)]
    pub cursor: Option<String>,
    /// Comma-separated field selector. Use [`SHAPE_SBIR_SOLICITATIONS_MINIMAL`](crate::SHAPE_SBIR_SOLICITATIONS_MINIMAL) or roll your own.
    #[builder(into)]
    pub shape: Option<String>,
    /// Collapse nested objects into dot-separated keys.
    #[builder(default)]
    pub flat: bool,
    /// When [`flat`](Self::flat) is also true, flatten list-valued fields.
    #[builder(default)]
    pub flat_lists: bool,

    /// Whether the cycle is open today: `open` or `closed`.
    #[builder(into)]
    pub activity: Option<String>,
    /// Program (`SBIR` or `STTR`).
    #[builder(into)]
    pub program: Option<String>,
    /// Solicitation number.
    #[builder(into)]
    pub solicitation_number: Option<String>,
    /// Cycle name.
    #[builder(into)]
    pub cycle_name: Option<String>,
    /// Raw feed status.
    #[builder(into)]
    pub solicitation_status: Option<String>,
    /// Out-of-cycle solicitation flag. `Some(false)` reaches the server as a filter value.
    pub out_of_cycle: Option<bool>,
    /// Solicitation year.
    #[builder(into)]
    pub year: Option<String>,
    /// Cycle start date on or after (`YYYY-MM-DD`).
    #[builder(into)]
    pub start_date_after: Option<String>,
    /// Cycle start date on or before (`YYYY-MM-DD`).
    #[builder(into)]
    pub start_date_before: Option<String>,
    /// Cycle end date on or after (`YYYY-MM-DD`).
    #[builder(into)]
    pub end_date_after: Option<String>,
    /// Cycle end date on or before (`YYYY-MM-DD`).
    #[builder(into)]
    pub end_date_before: Option<String>,
    /// Case-insensitive substring match across title and solicitation number.
    #[builder(into)]
    pub search: Option<String>,
    /// One of `activity`, `start_date`, `end_date`, `year`, `modified`, each optionally `-` prefixed.
    #[builder(into)]
    pub ordering: Option<String>,

    /// Escape hatch for filter keys not yet first-classed on this struct.
    #[builder(default)]
    pub extra: BTreeMap<String, String>,
}

impl ListSbirSolicitationsOptions {
    pub(crate) fn to_query(&self) -> Vec<(String, String)> {
        let mut q = Vec::new();
        apply_pagination(
            &mut q,
            self.page,
            self.limit,
            self.cursor.as_deref(),
            self.shape.as_deref(),
            self.flat,
            self.flat_lists,
        );
        push_opt(&mut q, "activity", self.activity.as_deref());
        push_opt(&mut q, "program", self.program.as_deref());
        push_opt(
            &mut q,
            "solicitation_number",
            self.solicitation_number.as_deref(),
        );
        push_opt(&mut q, "cycle_name", self.cycle_name.as_deref());
        push_opt(
            &mut q,
            "solicitation_status",
            self.solicitation_status.as_deref(),
        );
        push_opt_bool(&mut q, "out_of_cycle", self.out_of_cycle);
        push_opt(&mut q, "year", self.year.as_deref());
        push_opt(&mut q, "start_date_after", self.start_date_after.as_deref());
        push_opt(
            &mut q,
            "start_date_before",
            self.start_date_before.as_deref(),
        );
        push_opt(&mut q, "end_date_after", self.end_date_after.as_deref());
        push_opt(&mut q, "end_date_before", self.end_date_before.as_deref());
        push_opt(&mut q, "search", self.search.as_deref());
        push_opt(&mut q, "ordering", self.ordering.as_deref());
        for (k, v) in &self.extra {
            if !v.is_empty() {
                q.push((k.clone(), v.clone()));
            }
        }
        q
    }
}

/// Options for [`Client::get_sbir_topic`], [`Client::get_sbir_solicitation`].
#[derive(Debug, Clone, Default, Builder, PartialEq, Eq)]
#[non_exhaustive]
pub struct GetSbirOptions {
    /// Shape selector. When empty, the server returns its default detail shape.
    #[builder(into)]
    pub shape: Option<String>,
    /// Flatten nested objects into dot-separated keys.
    #[builder(default)]
    pub flat: bool,
    /// When `flat=true`, also flatten list-valued nested fields.
    #[builder(default)]
    pub flat_lists: bool,
}

impl GetSbirOptions {
    pub(crate) fn to_query(&self) -> Vec<(String, String)> {
        let mut q = Vec::new();
        push_opt(&mut q, "shape", self.shape.as_deref());
        if self.flat {
            q.push(("flat".into(), "true".into()));
        }
        if self.flat_lists {
            q.push(("flat_lists".into(), "true".into()));
        }
        q
    }
}

impl Client {
    /// `GET /api/sbir/topics/` — one page of SBIR/STTR topic records.
    pub async fn list_sbir_topics(&self, opts: ListSbirTopicsOptions) -> Result<Page<Record>> {
        let q = opts.to_query();
        self.get_page("/api/sbir/topics/", &q).await
    }

    /// `GET /api/sbir/topics/{topic_id}/` — a single SBIR/STTR topic.
    pub async fn get_sbir_topic(
        &self,
        topic_id: &str,
        opts: Option<GetSbirOptions>,
    ) -> Result<Record> {
        if topic_id.is_empty() {
            return Err(Error::Validation {
                message: "get_sbir_topic: topic_id is required".into(),
                response: None,
            });
        }
        let q = opts.unwrap_or_default().to_query();
        let path = format!("/api/sbir/topics/{}/", urlencoding(topic_id));
        self.get_json::<Record>(&path, &q).await
    }

    /// Stream every SBIR/STTR topic matching `opts`.
    pub fn iterate_sbir_topics(&self, opts: ListSbirTopicsOptions) -> PageStream<Record> {
        let opts = Arc::new(opts);
        let fetch: FetchFn<Record> = Box::new(move |client, page, cursor| {
            let mut next = (*opts).clone();
            next.page = page;
            next.cursor = cursor;
            Box::pin(async move { client.list_sbir_topics(next).await })
        });
        PageStream::new(self.clone(), fetch)
    }

    /// `GET /api/sbir/solicitations/` — one page of DoD DSIP solicitation cycle records.
    pub async fn list_sbir_solicitations(
        &self,
        opts: ListSbirSolicitationsOptions,
    ) -> Result<Page<Record>> {
        let q = opts.to_query();
        self.get_page("/api/sbir/solicitations/", &q).await
    }

    /// `GET /api/sbir/solicitations/{solicitation_id}/` — a single DoD DSIP solicitation cycle.
    pub async fn get_sbir_solicitation(
        &self,
        solicitation_id: &str,
        opts: Option<GetSbirOptions>,
    ) -> Result<Record> {
        if solicitation_id.is_empty() {
            return Err(Error::Validation {
                message: "get_sbir_solicitation: solicitation_id is required".into(),
                response: None,
            });
        }
        let q = opts.unwrap_or_default().to_query();
        let path = format!("/api/sbir/solicitations/{}/", urlencoding(solicitation_id));
        self.get_json::<Record>(&path, &q).await
    }

    /// Stream every DoD DSIP solicitation cycle matching `opts`.
    pub fn iterate_sbir_solicitations(
        &self,
        opts: ListSbirSolicitationsOptions,
    ) -> PageStream<Record> {
        let opts = Arc::new(opts);
        let fetch: FetchFn<Record> = Box::new(move |client, page, cursor| {
            let mut next = (*opts).clone();
            next.page = page;
            next.cursor = cursor;
            Box::pin(async move { client.list_sbir_solicitations(next).await })
        });
        PageStream::new(self.clone(), fetch)
    }
}

#[cfg(test)]
mod tests {
    use super::*;

    fn get_q(q: &[(String, String)], k: &str) -> Option<String> {
        q.iter().find(|(kk, _)| kk == k).map(|(_, v)| v.clone())
    }

    #[test]
    fn list_sbir_topics_all_filters_emit() {
        let opts = ListSbirTopicsOptions::builder()
            .activity("v-activity")
            .agency("v-agency")
            .topic_number("v-topic_number")
            .solicitation_number("v-solicitation_number")
            .year("v-year")
            .doc_source("v-doc_source")
            .close_date_after("v-close_date_after")
            .close_date_before("v-close_date_before")
            .open_date_after("v-open_date_after")
            .open_date_before("v-open_date_before")
            .release_date_after("v-release_date_after")
            .release_date_before("v-release_date_before")
            .search("v-search")
            .ordering("v-ordering")
            .build();
        let q = opts.to_query();
        assert_eq!(get_q(&q, "activity").as_deref(), Some("v-activity"));
        assert_eq!(get_q(&q, "agency").as_deref(), Some("v-agency"));
        assert_eq!(get_q(&q, "topic_number").as_deref(), Some("v-topic_number"));
        assert_eq!(
            get_q(&q, "solicitation_number").as_deref(),
            Some("v-solicitation_number")
        );
        assert_eq!(get_q(&q, "year").as_deref(), Some("v-year"));
        assert_eq!(get_q(&q, "doc_source").as_deref(), Some("v-doc_source"));
        assert_eq!(
            get_q(&q, "close_date_after").as_deref(),
            Some("v-close_date_after")
        );
        assert_eq!(
            get_q(&q, "close_date_before").as_deref(),
            Some("v-close_date_before")
        );
        assert_eq!(
            get_q(&q, "open_date_after").as_deref(),
            Some("v-open_date_after")
        );
        assert_eq!(
            get_q(&q, "open_date_before").as_deref(),
            Some("v-open_date_before")
        );
        assert_eq!(
            get_q(&q, "release_date_after").as_deref(),
            Some("v-release_date_after")
        );
        assert_eq!(
            get_q(&q, "release_date_before").as_deref(),
            Some("v-release_date_before")
        );
        assert_eq!(get_q(&q, "search").as_deref(), Some("v-search"));
        assert_eq!(get_q(&q, "ordering").as_deref(), Some("v-ordering"));
        assert_eq!(q.len(), 14);
    }

    #[test]
    fn list_sbir_topics_zero_value_omitted() {
        assert!(ListSbirTopicsOptions::builder()
            .build()
            .to_query()
            .is_empty());
    }

    #[test]
    fn list_sbir_topics_cursor_wins_over_page_and_shape_emits() {
        let opts = ListSbirTopicsOptions::builder()
            .page(3u32)
            .cursor("c0".to_string())
            .shape(crate::SHAPE_SBIR_TOPICS_MINIMAL)
            .build();
        let q = opts.to_query();
        assert_eq!(get_q(&q, "cursor").as_deref(), Some("c0"));
        assert_eq!(get_q(&q, "page"), None);
        assert_eq!(
            get_q(&q, "shape").as_deref(),
            Some(crate::SHAPE_SBIR_TOPICS_MINIMAL)
        );
    }

    #[test]
    fn list_sbir_topics_extra_emits() {
        let mut extra = BTreeMap::new();
        extra.insert("custom_x".to_string(), "xv".to_string());
        let q = ListSbirTopicsOptions::builder()
            .extra(extra)
            .build()
            .to_query();
        assert!(q.contains(&("custom_x".into(), "xv".into())));
    }

    #[tokio::test]
    async fn get_sbir_topic_validates_empty_topic_id() {
        let client = Client::builder().api_key("x").build().expect("client");
        let err = client.get_sbir_topic("", None).await.unwrap_err();
        match err {
            Error::Validation { message, .. } => {
                assert!(message.contains("topic_id is required"));
            }
            other => panic!("expected Validation, got {other:?}"),
        }
    }

    #[test]
    fn list_sbir_solicitations_all_filters_emit() {
        let opts = ListSbirSolicitationsOptions::builder()
            .activity("v-activity")
            .program("v-program")
            .solicitation_number("v-solicitation_number")
            .cycle_name("v-cycle_name")
            .solicitation_status("v-solicitation_status")
            .out_of_cycle(true)
            .year("v-year")
            .start_date_after("v-start_date_after")
            .start_date_before("v-start_date_before")
            .end_date_after("v-end_date_after")
            .end_date_before("v-end_date_before")
            .search("v-search")
            .ordering("v-ordering")
            .build();
        let q = opts.to_query();
        assert_eq!(get_q(&q, "activity").as_deref(), Some("v-activity"));
        assert_eq!(get_q(&q, "program").as_deref(), Some("v-program"));
        assert_eq!(
            get_q(&q, "solicitation_number").as_deref(),
            Some("v-solicitation_number")
        );
        assert_eq!(get_q(&q, "cycle_name").as_deref(), Some("v-cycle_name"));
        assert_eq!(
            get_q(&q, "solicitation_status").as_deref(),
            Some("v-solicitation_status")
        );
        assert_eq!(get_q(&q, "out_of_cycle").as_deref(), Some("true"));
        assert_eq!(get_q(&q, "year").as_deref(), Some("v-year"));
        assert_eq!(
            get_q(&q, "start_date_after").as_deref(),
            Some("v-start_date_after")
        );
        assert_eq!(
            get_q(&q, "start_date_before").as_deref(),
            Some("v-start_date_before")
        );
        assert_eq!(
            get_q(&q, "end_date_after").as_deref(),
            Some("v-end_date_after")
        );
        assert_eq!(
            get_q(&q, "end_date_before").as_deref(),
            Some("v-end_date_before")
        );
        assert_eq!(get_q(&q, "search").as_deref(), Some("v-search"));
        assert_eq!(get_q(&q, "ordering").as_deref(), Some("v-ordering"));
        assert_eq!(q.len(), 13);
    }

    #[test]
    fn list_sbir_solicitations_out_of_cycle_false_is_a_filter_not_an_absence() {
        let opts = ListSbirSolicitationsOptions::builder()
            .out_of_cycle(false)
            .build();
        assert_eq!(
            get_q(&opts.to_query(), "out_of_cycle").as_deref(),
            Some("false")
        );
    }

    #[test]
    fn list_sbir_solicitations_zero_value_omitted() {
        assert!(ListSbirSolicitationsOptions::builder()
            .build()
            .to_query()
            .is_empty());
    }

    #[test]
    fn list_sbir_solicitations_cursor_wins_over_page_and_shape_emits() {
        let opts = ListSbirSolicitationsOptions::builder()
            .page(3u32)
            .cursor("c0".to_string())
            .shape(crate::SHAPE_SBIR_SOLICITATIONS_MINIMAL)
            .build();
        let q = opts.to_query();
        assert_eq!(get_q(&q, "cursor").as_deref(), Some("c0"));
        assert_eq!(get_q(&q, "page"), None);
        assert_eq!(
            get_q(&q, "shape").as_deref(),
            Some(crate::SHAPE_SBIR_SOLICITATIONS_MINIMAL)
        );
    }

    #[test]
    fn list_sbir_solicitations_extra_emits() {
        let mut extra = BTreeMap::new();
        extra.insert("custom_x".to_string(), "xv".to_string());
        let q = ListSbirSolicitationsOptions::builder()
            .extra(extra)
            .build()
            .to_query();
        assert!(q.contains(&("custom_x".into(), "xv".into())));
    }

    #[tokio::test]
    async fn get_sbir_solicitation_validates_empty_solicitation_id() {
        let client = Client::builder().api_key("x").build().expect("client");
        let err = client.get_sbir_solicitation("", None).await.unwrap_err();
        match err {
            Error::Validation { message, .. } => {
                assert!(message.contains("solicitation_id is required"));
            }
            other => panic!("expected Validation, got {other:?}"),
        }
    }

    #[test]
    fn get_options_emits() {
        let q = GetSbirOptions::builder()
            .shape("a,b")
            .flat(true)
            .flat_lists(true)
            .build()
            .to_query();
        assert_eq!(get_q(&q, "shape").as_deref(), Some("a,b"));
        assert_eq!(get_q(&q, "flat").as_deref(), Some("true"));
        assert_eq!(get_q(&q, "flat_lists").as_deref(), Some("true"));
    }

    #[test]
    fn list_sbir_topics_cycle_name_filter_emits() {
        let q = ListSbirTopicsOptions::builder()
            .cycle_name("DOD_SBIR_2026_P1_CBZ")
            .build()
            .to_query();
        assert_eq!(
            get_q(&q, "cycle_name").as_deref(),
            Some("DOD_SBIR_2026_P1_CBZ")
        );
    }
}