roctogen/endpoints/
dependabot.rs

1//! Method, error and parameter types for the Dependabot endpoint.
2#![allow(
3    clippy::all
4)]
5/* 
6 * GitHub v3 REST API
7 *
8 * GitHub's v3 REST API.
9 *
10 * OpenAPI spec version: 1.1.4
11 * 
12 * Generated by: https://github.com/swagger-api/swagger-codegen.git
13 */
14
15use serde::Deserialize;
16
17use roctokit::adapters::{AdapterError, Client, GitHubRequest, GitHubResponseExt};
18use crate::models::*;
19
20use super::PerPage;
21
22use std::collections::HashMap;
23use serde_json::value::Value;
24
25pub struct Dependabot<'api, C: Client> where AdapterError: From<<C as Client>::Err> {
26    client: &'api C
27}
28
29pub fn new<C: Client>(client: &C) -> Dependabot<C> where AdapterError: From<<C as Client>::Err> {
30    Dependabot { client }
31}
32
33/// Errors for the [Add selected repository to an organization secret](Dependabot::add_selected_repo_to_org_secret_async()) endpoint.
34#[derive(Debug, thiserror::Error)]
35pub enum DependabotAddSelectedRepoToOrgSecretError {
36    #[error("Conflict when visibility type is not set to selected")]
37    Status409,
38    #[error("Status code: {}", code)]
39    Generic { code: u16 },
40}
41
42impl From<DependabotAddSelectedRepoToOrgSecretError> for AdapterError {
43    fn from(err: DependabotAddSelectedRepoToOrgSecretError) -> Self {
44        let (description, status_code) = match err {
45            DependabotAddSelectedRepoToOrgSecretError::Status409 => (String::from("Conflict when visibility type is not set to selected"), 409),
46            DependabotAddSelectedRepoToOrgSecretError::Generic { code } => (String::from("Generic"), code)
47        };
48
49        Self::Endpoint {
50            description,
51            status_code,
52            source: Some(Box::new(err))
53        }
54    }
55}
56
57/// Errors for the [Create or update an organization secret](Dependabot::create_or_update_org_secret_async()) endpoint.
58#[derive(Debug, thiserror::Error)]
59pub enum DependabotCreateOrUpdateOrgSecretError {
60    #[error("Response when updating a secret")]
61    Status204,
62    #[error("Status code: {}", code)]
63    Generic { code: u16 },
64}
65
66impl From<DependabotCreateOrUpdateOrgSecretError> for AdapterError {
67    fn from(err: DependabotCreateOrUpdateOrgSecretError) -> Self {
68        let (description, status_code) = match err {
69            DependabotCreateOrUpdateOrgSecretError::Status204 => (String::from("Response when updating a secret"), 204),
70            DependabotCreateOrUpdateOrgSecretError::Generic { code } => (String::from("Generic"), code)
71        };
72
73        Self::Endpoint {
74            description,
75            status_code,
76            source: Some(Box::new(err))
77        }
78    }
79}
80
81/// Errors for the [Create or update a repository secret](Dependabot::create_or_update_repo_secret_async()) endpoint.
82#[derive(Debug, thiserror::Error)]
83pub enum DependabotCreateOrUpdateRepoSecretError {
84    #[error("Response when updating a secret")]
85    Status204,
86    #[error("Status code: {}", code)]
87    Generic { code: u16 },
88}
89
90impl From<DependabotCreateOrUpdateRepoSecretError> for AdapterError {
91    fn from(err: DependabotCreateOrUpdateRepoSecretError) -> Self {
92        let (description, status_code) = match err {
93            DependabotCreateOrUpdateRepoSecretError::Status204 => (String::from("Response when updating a secret"), 204),
94            DependabotCreateOrUpdateRepoSecretError::Generic { code } => (String::from("Generic"), code)
95        };
96
97        Self::Endpoint {
98            description,
99            status_code,
100            source: Some(Box::new(err))
101        }
102    }
103}
104
105/// Errors for the [Delete an organization secret](Dependabot::delete_org_secret_async()) endpoint.
106#[derive(Debug, thiserror::Error)]
107pub enum DependabotDeleteOrgSecretError {
108    #[error("Status code: {}", code)]
109    Generic { code: u16 },
110}
111
112impl From<DependabotDeleteOrgSecretError> for AdapterError {
113    fn from(err: DependabotDeleteOrgSecretError) -> Self {
114        let (description, status_code) = match err {
115            DependabotDeleteOrgSecretError::Generic { code } => (String::from("Generic"), code)
116        };
117
118        Self::Endpoint {
119            description,
120            status_code,
121            source: Some(Box::new(err))
122        }
123    }
124}
125
126/// Errors for the [Delete a repository secret](Dependabot::delete_repo_secret_async()) endpoint.
127#[derive(Debug, thiserror::Error)]
128pub enum DependabotDeleteRepoSecretError {
129    #[error("Status code: {}", code)]
130    Generic { code: u16 },
131}
132
133impl From<DependabotDeleteRepoSecretError> for AdapterError {
134    fn from(err: DependabotDeleteRepoSecretError) -> Self {
135        let (description, status_code) = match err {
136            DependabotDeleteRepoSecretError::Generic { code } => (String::from("Generic"), code)
137        };
138
139        Self::Endpoint {
140            description,
141            status_code,
142            source: Some(Box::new(err))
143        }
144    }
145}
146
147/// Errors for the [Get a Dependabot alert](Dependabot::get_alert_async()) endpoint.
148#[derive(Debug, thiserror::Error)]
149pub enum DependabotGetAlertError {
150    #[error("Not modified")]
151    Status304,
152    #[error("Forbidden")]
153    Status403(BasicError),
154    #[error("Resource not found")]
155    Status404(BasicError),
156    #[error("Status code: {}", code)]
157    Generic { code: u16 },
158}
159
160impl From<DependabotGetAlertError> for AdapterError {
161    fn from(err: DependabotGetAlertError) -> Self {
162        let (description, status_code) = match err {
163            DependabotGetAlertError::Status304 => (String::from("Not modified"), 304),
164            DependabotGetAlertError::Status403(_) => (String::from("Forbidden"), 403),
165            DependabotGetAlertError::Status404(_) => (String::from("Resource not found"), 404),
166            DependabotGetAlertError::Generic { code } => (String::from("Generic"), code)
167        };
168
169        Self::Endpoint {
170            description,
171            status_code,
172            source: Some(Box::new(err))
173        }
174    }
175}
176
177/// Errors for the [Get an organization public key](Dependabot::get_org_public_key_async()) endpoint.
178#[derive(Debug, thiserror::Error)]
179pub enum DependabotGetOrgPublicKeyError {
180    #[error("Status code: {}", code)]
181    Generic { code: u16 },
182}
183
184impl From<DependabotGetOrgPublicKeyError> for AdapterError {
185    fn from(err: DependabotGetOrgPublicKeyError) -> Self {
186        let (description, status_code) = match err {
187            DependabotGetOrgPublicKeyError::Generic { code } => (String::from("Generic"), code)
188        };
189
190        Self::Endpoint {
191            description,
192            status_code,
193            source: Some(Box::new(err))
194        }
195    }
196}
197
198/// Errors for the [Get an organization secret](Dependabot::get_org_secret_async()) endpoint.
199#[derive(Debug, thiserror::Error)]
200pub enum DependabotGetOrgSecretError {
201    #[error("Status code: {}", code)]
202    Generic { code: u16 },
203}
204
205impl From<DependabotGetOrgSecretError> for AdapterError {
206    fn from(err: DependabotGetOrgSecretError) -> Self {
207        let (description, status_code) = match err {
208            DependabotGetOrgSecretError::Generic { code } => (String::from("Generic"), code)
209        };
210
211        Self::Endpoint {
212            description,
213            status_code,
214            source: Some(Box::new(err))
215        }
216    }
217}
218
219/// Errors for the [Get a repository public key](Dependabot::get_repo_public_key_async()) endpoint.
220#[derive(Debug, thiserror::Error)]
221pub enum DependabotGetRepoPublicKeyError {
222    #[error("Status code: {}", code)]
223    Generic { code: u16 },
224}
225
226impl From<DependabotGetRepoPublicKeyError> for AdapterError {
227    fn from(err: DependabotGetRepoPublicKeyError) -> Self {
228        let (description, status_code) = match err {
229            DependabotGetRepoPublicKeyError::Generic { code } => (String::from("Generic"), code)
230        };
231
232        Self::Endpoint {
233            description,
234            status_code,
235            source: Some(Box::new(err))
236        }
237    }
238}
239
240/// Errors for the [Get a repository secret](Dependabot::get_repo_secret_async()) endpoint.
241#[derive(Debug, thiserror::Error)]
242pub enum DependabotGetRepoSecretError {
243    #[error("Status code: {}", code)]
244    Generic { code: u16 },
245}
246
247impl From<DependabotGetRepoSecretError> for AdapterError {
248    fn from(err: DependabotGetRepoSecretError) -> Self {
249        let (description, status_code) = match err {
250            DependabotGetRepoSecretError::Generic { code } => (String::from("Generic"), code)
251        };
252
253        Self::Endpoint {
254            description,
255            status_code,
256            source: Some(Box::new(err))
257        }
258    }
259}
260
261/// Errors for the [List Dependabot alerts for an enterprise](Dependabot::list_alerts_for_enterprise_async()) endpoint.
262#[derive(Debug, thiserror::Error)]
263pub enum DependabotListAlertsForEnterpriseError {
264    #[error("Not modified")]
265    Status304,
266    #[error("Forbidden")]
267    Status403(BasicError),
268    #[error("Resource not found")]
269    Status404(BasicError),
270    #[error("Validation failed, or the endpoint has been spammed.")]
271    Status422(ValidationErrorSimple),
272    #[error("Status code: {}", code)]
273    Generic { code: u16 },
274}
275
276impl From<DependabotListAlertsForEnterpriseError> for AdapterError {
277    fn from(err: DependabotListAlertsForEnterpriseError) -> Self {
278        let (description, status_code) = match err {
279            DependabotListAlertsForEnterpriseError::Status304 => (String::from("Not modified"), 304),
280            DependabotListAlertsForEnterpriseError::Status403(_) => (String::from("Forbidden"), 403),
281            DependabotListAlertsForEnterpriseError::Status404(_) => (String::from("Resource not found"), 404),
282            DependabotListAlertsForEnterpriseError::Status422(_) => (String::from("Validation failed, or the endpoint has been spammed."), 422),
283            DependabotListAlertsForEnterpriseError::Generic { code } => (String::from("Generic"), code)
284        };
285
286        Self::Endpoint {
287            description,
288            status_code,
289            source: Some(Box::new(err))
290        }
291    }
292}
293
294/// Errors for the [List Dependabot alerts for an organization](Dependabot::list_alerts_for_org_async()) endpoint.
295#[derive(Debug, thiserror::Error)]
296pub enum DependabotListAlertsForOrgError {
297    #[error("Not modified")]
298    Status304,
299    #[error("Bad Request")]
300    Status400(BasicError),
301    #[error("Forbidden")]
302    Status403(BasicError),
303    #[error("Resource not found")]
304    Status404(BasicError),
305    #[error("Validation failed, or the endpoint has been spammed.")]
306    Status422(ValidationErrorSimple),
307    #[error("Status code: {}", code)]
308    Generic { code: u16 },
309}
310
311impl From<DependabotListAlertsForOrgError> for AdapterError {
312    fn from(err: DependabotListAlertsForOrgError) -> Self {
313        let (description, status_code) = match err {
314            DependabotListAlertsForOrgError::Status304 => (String::from("Not modified"), 304),
315            DependabotListAlertsForOrgError::Status400(_) => (String::from("Bad Request"), 400),
316            DependabotListAlertsForOrgError::Status403(_) => (String::from("Forbidden"), 403),
317            DependabotListAlertsForOrgError::Status404(_) => (String::from("Resource not found"), 404),
318            DependabotListAlertsForOrgError::Status422(_) => (String::from("Validation failed, or the endpoint has been spammed."), 422),
319            DependabotListAlertsForOrgError::Generic { code } => (String::from("Generic"), code)
320        };
321
322        Self::Endpoint {
323            description,
324            status_code,
325            source: Some(Box::new(err))
326        }
327    }
328}
329
330/// Errors for the [List Dependabot alerts for a repository](Dependabot::list_alerts_for_repo_async()) endpoint.
331#[derive(Debug, thiserror::Error)]
332pub enum DependabotListAlertsForRepoError {
333    #[error("Not modified")]
334    Status304,
335    #[error("Bad Request")]
336    Status400(BasicError),
337    #[error("Forbidden")]
338    Status403(BasicError),
339    #[error("Resource not found")]
340    Status404(BasicError),
341    #[error("Validation failed, or the endpoint has been spammed.")]
342    Status422(ValidationErrorSimple),
343    #[error("Status code: {}", code)]
344    Generic { code: u16 },
345}
346
347impl From<DependabotListAlertsForRepoError> for AdapterError {
348    fn from(err: DependabotListAlertsForRepoError) -> Self {
349        let (description, status_code) = match err {
350            DependabotListAlertsForRepoError::Status304 => (String::from("Not modified"), 304),
351            DependabotListAlertsForRepoError::Status400(_) => (String::from("Bad Request"), 400),
352            DependabotListAlertsForRepoError::Status403(_) => (String::from("Forbidden"), 403),
353            DependabotListAlertsForRepoError::Status404(_) => (String::from("Resource not found"), 404),
354            DependabotListAlertsForRepoError::Status422(_) => (String::from("Validation failed, or the endpoint has been spammed."), 422),
355            DependabotListAlertsForRepoError::Generic { code } => (String::from("Generic"), code)
356        };
357
358        Self::Endpoint {
359            description,
360            status_code,
361            source: Some(Box::new(err))
362        }
363    }
364}
365
366/// Errors for the [List organization secrets](Dependabot::list_org_secrets_async()) endpoint.
367#[derive(Debug, thiserror::Error)]
368pub enum DependabotListOrgSecretsError {
369    #[error("Status code: {}", code)]
370    Generic { code: u16 },
371}
372
373impl From<DependabotListOrgSecretsError> for AdapterError {
374    fn from(err: DependabotListOrgSecretsError) -> Self {
375        let (description, status_code) = match err {
376            DependabotListOrgSecretsError::Generic { code } => (String::from("Generic"), code)
377        };
378
379        Self::Endpoint {
380            description,
381            status_code,
382            source: Some(Box::new(err))
383        }
384    }
385}
386
387/// Errors for the [List repository secrets](Dependabot::list_repo_secrets_async()) endpoint.
388#[derive(Debug, thiserror::Error)]
389pub enum DependabotListRepoSecretsError {
390    #[error("Status code: {}", code)]
391    Generic { code: u16 },
392}
393
394impl From<DependabotListRepoSecretsError> for AdapterError {
395    fn from(err: DependabotListRepoSecretsError) -> Self {
396        let (description, status_code) = match err {
397            DependabotListRepoSecretsError::Generic { code } => (String::from("Generic"), code)
398        };
399
400        Self::Endpoint {
401            description,
402            status_code,
403            source: Some(Box::new(err))
404        }
405    }
406}
407
408/// Errors for the [List selected repositories for an organization secret](Dependabot::list_selected_repos_for_org_secret_async()) endpoint.
409#[derive(Debug, thiserror::Error)]
410pub enum DependabotListSelectedReposForOrgSecretError {
411    #[error("Status code: {}", code)]
412    Generic { code: u16 },
413}
414
415impl From<DependabotListSelectedReposForOrgSecretError> for AdapterError {
416    fn from(err: DependabotListSelectedReposForOrgSecretError) -> Self {
417        let (description, status_code) = match err {
418            DependabotListSelectedReposForOrgSecretError::Generic { code } => (String::from("Generic"), code)
419        };
420
421        Self::Endpoint {
422            description,
423            status_code,
424            source: Some(Box::new(err))
425        }
426    }
427}
428
429/// Errors for the [Remove selected repository from an organization secret](Dependabot::remove_selected_repo_from_org_secret_async()) endpoint.
430#[derive(Debug, thiserror::Error)]
431pub enum DependabotRemoveSelectedRepoFromOrgSecretError {
432    #[error("Conflict when visibility type not set to selected")]
433    Status409,
434    #[error("Status code: {}", code)]
435    Generic { code: u16 },
436}
437
438impl From<DependabotRemoveSelectedRepoFromOrgSecretError> for AdapterError {
439    fn from(err: DependabotRemoveSelectedRepoFromOrgSecretError) -> Self {
440        let (description, status_code) = match err {
441            DependabotRemoveSelectedRepoFromOrgSecretError::Status409 => (String::from("Conflict when visibility type not set to selected"), 409),
442            DependabotRemoveSelectedRepoFromOrgSecretError::Generic { code } => (String::from("Generic"), code)
443        };
444
445        Self::Endpoint {
446            description,
447            status_code,
448            source: Some(Box::new(err))
449        }
450    }
451}
452
453/// Errors for the [Lists the repositories Dependabot can access in an organization](Dependabot::repository_access_for_org_async()) endpoint.
454#[derive(Debug, thiserror::Error)]
455pub enum DependabotRepositoryAccessForOrgError {
456    #[error("Forbidden")]
457    Status403(BasicError),
458    #[error("Resource not found")]
459    Status404(BasicError),
460    #[error("Status code: {}", code)]
461    Generic { code: u16 },
462}
463
464impl From<DependabotRepositoryAccessForOrgError> for AdapterError {
465    fn from(err: DependabotRepositoryAccessForOrgError) -> Self {
466        let (description, status_code) = match err {
467            DependabotRepositoryAccessForOrgError::Status403(_) => (String::from("Forbidden"), 403),
468            DependabotRepositoryAccessForOrgError::Status404(_) => (String::from("Resource not found"), 404),
469            DependabotRepositoryAccessForOrgError::Generic { code } => (String::from("Generic"), code)
470        };
471
472        Self::Endpoint {
473            description,
474            status_code,
475            source: Some(Box::new(err))
476        }
477    }
478}
479
480/// Errors for the [Set the default repository access level for Dependabot](Dependabot::set_repository_access_default_level_async()) endpoint.
481#[derive(Debug, thiserror::Error)]
482pub enum DependabotSetRepositoryAccessDefaultLevelError {
483    #[error("Forbidden")]
484    Status403(BasicError),
485    #[error("Resource not found")]
486    Status404(BasicError),
487    #[error("Status code: {}", code)]
488    Generic { code: u16 },
489}
490
491impl From<DependabotSetRepositoryAccessDefaultLevelError> for AdapterError {
492    fn from(err: DependabotSetRepositoryAccessDefaultLevelError) -> Self {
493        let (description, status_code) = match err {
494            DependabotSetRepositoryAccessDefaultLevelError::Status403(_) => (String::from("Forbidden"), 403),
495            DependabotSetRepositoryAccessDefaultLevelError::Status404(_) => (String::from("Resource not found"), 404),
496            DependabotSetRepositoryAccessDefaultLevelError::Generic { code } => (String::from("Generic"), code)
497        };
498
499        Self::Endpoint {
500            description,
501            status_code,
502            source: Some(Box::new(err))
503        }
504    }
505}
506
507/// Errors for the [Set selected repositories for an organization secret](Dependabot::set_selected_repos_for_org_secret_async()) endpoint.
508#[derive(Debug, thiserror::Error)]
509pub enum DependabotSetSelectedReposForOrgSecretError {
510    #[error("Status code: {}", code)]
511    Generic { code: u16 },
512}
513
514impl From<DependabotSetSelectedReposForOrgSecretError> for AdapterError {
515    fn from(err: DependabotSetSelectedReposForOrgSecretError) -> Self {
516        let (description, status_code) = match err {
517            DependabotSetSelectedReposForOrgSecretError::Generic { code } => (String::from("Generic"), code)
518        };
519
520        Self::Endpoint {
521            description,
522            status_code,
523            source: Some(Box::new(err))
524        }
525    }
526}
527
528/// Errors for the [Update a Dependabot alert](Dependabot::update_alert_async()) endpoint.
529#[derive(Debug, thiserror::Error)]
530pub enum DependabotUpdateAlertError {
531    #[error("Bad Request")]
532    Status400(BasicError),
533    #[error("Forbidden")]
534    Status403(BasicError),
535    #[error("Resource not found")]
536    Status404(BasicError),
537    #[error("Conflict")]
538    Status409(BasicError),
539    #[error("Validation failed, or the endpoint has been spammed.")]
540    Status422(ValidationErrorSimple),
541    #[error("Status code: {}", code)]
542    Generic { code: u16 },
543}
544
545impl From<DependabotUpdateAlertError> for AdapterError {
546    fn from(err: DependabotUpdateAlertError) -> Self {
547        let (description, status_code) = match err {
548            DependabotUpdateAlertError::Status400(_) => (String::from("Bad Request"), 400),
549            DependabotUpdateAlertError::Status403(_) => (String::from("Forbidden"), 403),
550            DependabotUpdateAlertError::Status404(_) => (String::from("Resource not found"), 404),
551            DependabotUpdateAlertError::Status409(_) => (String::from("Conflict"), 409),
552            DependabotUpdateAlertError::Status422(_) => (String::from("Validation failed, or the endpoint has been spammed."), 422),
553            DependabotUpdateAlertError::Generic { code } => (String::from("Generic"), code)
554        };
555
556        Self::Endpoint {
557            description,
558            status_code,
559            source: Some(Box::new(err))
560        }
561    }
562}
563
564/// Errors for the [Updates Dependabot&#x27;s repository access list for an organization](Dependabot::update_repository_access_for_org_async()) endpoint.
565#[derive(Debug, thiserror::Error)]
566pub enum DependabotUpdateRepositoryAccessForOrgError {
567    #[error("Forbidden")]
568    Status403(BasicError),
569    #[error("Resource not found")]
570    Status404(BasicError),
571    #[error("Status code: {}", code)]
572    Generic { code: u16 },
573}
574
575impl From<DependabotUpdateRepositoryAccessForOrgError> for AdapterError {
576    fn from(err: DependabotUpdateRepositoryAccessForOrgError) -> Self {
577        let (description, status_code) = match err {
578            DependabotUpdateRepositoryAccessForOrgError::Status403(_) => (String::from("Forbidden"), 403),
579            DependabotUpdateRepositoryAccessForOrgError::Status404(_) => (String::from("Resource not found"), 404),
580            DependabotUpdateRepositoryAccessForOrgError::Generic { code } => (String::from("Generic"), code)
581        };
582
583        Self::Endpoint {
584            description,
585            status_code,
586            source: Some(Box::new(err))
587        }
588    }
589}
590
591
592/// Query parameters for the [List Dependabot alerts for an enterprise](Dependabot::list_alerts_for_enterprise_async()) endpoint.
593#[derive(Default, Serialize)]
594pub struct DependabotListAlertsForEnterpriseParams<'req> {
595    /// A comma-separated list of states. If specified, only alerts with these states will be returned.  Can be: `auto_dismissed`, `dismissed`, `fixed`, `open`
596    state: Option<&'req str>, 
597    /// A comma-separated list of severities. If specified, only alerts with these severities will be returned.  Can be: `low`, `medium`, `high`, `critical`
598    severity: Option<&'req str>, 
599    /// A comma-separated list of ecosystems. If specified, only alerts for these ecosystems will be returned.  Can be: `composer`, `go`, `maven`, `npm`, `nuget`, `pip`, `pub`, `rubygems`, `rust`
600    ecosystem: Option<&'req str>, 
601    /// A comma-separated list of package names. If specified, only alerts for these packages will be returned.
602    package: Option<&'req str>, 
603    /// CVE Exploit Prediction Scoring System (EPSS) percentage. Can be specified as: - An exact number (`n`) - Comparators such as `>n`, `<n`, `>=n`, `<=n` - A range like `n..n`, where `n` is a number from 0.0 to 1.0  Filters the list of alerts based on EPSS percentages. If specified, only alerts with the provided EPSS percentages will be returned.
604    epss_percentage: Option<&'req str>, 
605    /// Filters the list of alerts based on whether the alert has the given value. If specified, only alerts meeting this criterion will be returned. Multiple `has` filters can be passed to filter for alerts that have all of the values. Currently, only `patch` is supported.
606    has: Option<Has>, 
607    /// The scope of the vulnerable dependency. If specified, only alerts with this scope will be returned.
608    scope: Option<&'req str>, 
609    /// The property by which to sort the results. `created` means when the alert was created. `updated` means when the alert's state last changed. `epss_percentage` sorts alerts by the Exploit Prediction Scoring System (EPSS) percentage.
610    sort: Option<&'req str>, 
611    /// The direction to sort the results by.
612    direction: Option<&'req str>, 
613    /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
614    before: Option<&'req str>, 
615    /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
616    after: Option<&'req str>, 
617    /// **Deprecated**. The number of results per page (max 100), starting from the first matching result. This parameter must not be used in combination with `last`. Instead, use `per_page` in combination with `after` to fetch the first page of results.
618    first: Option<i32>, 
619    /// **Deprecated**. The number of results per page (max 100), starting from the last matching result. This parameter must not be used in combination with `first`. Instead, use `per_page` in combination with `before` to fetch the last page of results.
620    last: Option<i32>, 
621    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
622    per_page: Option<u16>
623}
624
625impl<'req> DependabotListAlertsForEnterpriseParams<'req> {
626    pub fn new() -> Self {
627        Self::default()
628    }
629
630    /// A comma-separated list of states. If specified, only alerts with these states will be returned.  Can be: `auto_dismissed`, `dismissed`, `fixed`, `open`
631    pub fn state(self, state: &'req str) -> Self {
632        Self {
633            state: Some(state),
634            severity: self.severity, 
635            ecosystem: self.ecosystem, 
636            package: self.package, 
637            epss_percentage: self.epss_percentage, 
638            has: self.has, 
639            scope: self.scope, 
640            sort: self.sort, 
641            direction: self.direction, 
642            before: self.before, 
643            after: self.after, 
644            first: self.first, 
645            last: self.last, 
646            per_page: self.per_page, 
647        }
648    }
649
650    /// A comma-separated list of severities. If specified, only alerts with these severities will be returned.  Can be: `low`, `medium`, `high`, `critical`
651    pub fn severity(self, severity: &'req str) -> Self {
652        Self {
653            state: self.state, 
654            severity: Some(severity),
655            ecosystem: self.ecosystem, 
656            package: self.package, 
657            epss_percentage: self.epss_percentage, 
658            has: self.has, 
659            scope: self.scope, 
660            sort: self.sort, 
661            direction: self.direction, 
662            before: self.before, 
663            after: self.after, 
664            first: self.first, 
665            last: self.last, 
666            per_page: self.per_page, 
667        }
668    }
669
670    /// A comma-separated list of ecosystems. If specified, only alerts for these ecosystems will be returned.  Can be: `composer`, `go`, `maven`, `npm`, `nuget`, `pip`, `pub`, `rubygems`, `rust`
671    pub fn ecosystem(self, ecosystem: &'req str) -> Self {
672        Self {
673            state: self.state, 
674            severity: self.severity, 
675            ecosystem: Some(ecosystem),
676            package: self.package, 
677            epss_percentage: self.epss_percentage, 
678            has: self.has, 
679            scope: self.scope, 
680            sort: self.sort, 
681            direction: self.direction, 
682            before: self.before, 
683            after: self.after, 
684            first: self.first, 
685            last: self.last, 
686            per_page: self.per_page, 
687        }
688    }
689
690    /// A comma-separated list of package names. If specified, only alerts for these packages will be returned.
691    pub fn package(self, package: &'req str) -> Self {
692        Self {
693            state: self.state, 
694            severity: self.severity, 
695            ecosystem: self.ecosystem, 
696            package: Some(package),
697            epss_percentage: self.epss_percentage, 
698            has: self.has, 
699            scope: self.scope, 
700            sort: self.sort, 
701            direction: self.direction, 
702            before: self.before, 
703            after: self.after, 
704            first: self.first, 
705            last: self.last, 
706            per_page: self.per_page, 
707        }
708    }
709
710    /// CVE Exploit Prediction Scoring System (EPSS) percentage. Can be specified as: - An exact number (`n`) - Comparators such as `>n`, `<n`, `>=n`, `<=n` - A range like `n..n`, where `n` is a number from 0.0 to 1.0  Filters the list of alerts based on EPSS percentages. If specified, only alerts with the provided EPSS percentages will be returned.
711    pub fn epss_percentage(self, epss_percentage: &'req str) -> Self {
712        Self {
713            state: self.state, 
714            severity: self.severity, 
715            ecosystem: self.ecosystem, 
716            package: self.package, 
717            epss_percentage: Some(epss_percentage),
718            has: self.has, 
719            scope: self.scope, 
720            sort: self.sort, 
721            direction: self.direction, 
722            before: self.before, 
723            after: self.after, 
724            first: self.first, 
725            last: self.last, 
726            per_page: self.per_page, 
727        }
728    }
729
730    /// Filters the list of alerts based on whether the alert has the given value. If specified, only alerts meeting this criterion will be returned. Multiple `has` filters can be passed to filter for alerts that have all of the values. Currently, only `patch` is supported.
731    pub fn has(self, has: Has) -> Self {
732        Self {
733            state: self.state, 
734            severity: self.severity, 
735            ecosystem: self.ecosystem, 
736            package: self.package, 
737            epss_percentage: self.epss_percentage, 
738            has: Some(has),
739            scope: self.scope, 
740            sort: self.sort, 
741            direction: self.direction, 
742            before: self.before, 
743            after: self.after, 
744            first: self.first, 
745            last: self.last, 
746            per_page: self.per_page, 
747        }
748    }
749
750    /// The scope of the vulnerable dependency. If specified, only alerts with this scope will be returned.
751    pub fn scope(self, scope: &'req str) -> Self {
752        Self {
753            state: self.state, 
754            severity: self.severity, 
755            ecosystem: self.ecosystem, 
756            package: self.package, 
757            epss_percentage: self.epss_percentage, 
758            has: self.has, 
759            scope: Some(scope),
760            sort: self.sort, 
761            direction: self.direction, 
762            before: self.before, 
763            after: self.after, 
764            first: self.first, 
765            last: self.last, 
766            per_page: self.per_page, 
767        }
768    }
769
770    /// The property by which to sort the results. `created` means when the alert was created. `updated` means when the alert's state last changed. `epss_percentage` sorts alerts by the Exploit Prediction Scoring System (EPSS) percentage.
771    pub fn sort(self, sort: &'req str) -> Self {
772        Self {
773            state: self.state, 
774            severity: self.severity, 
775            ecosystem: self.ecosystem, 
776            package: self.package, 
777            epss_percentage: self.epss_percentage, 
778            has: self.has, 
779            scope: self.scope, 
780            sort: Some(sort),
781            direction: self.direction, 
782            before: self.before, 
783            after: self.after, 
784            first: self.first, 
785            last: self.last, 
786            per_page: self.per_page, 
787        }
788    }
789
790    /// The direction to sort the results by.
791    pub fn direction(self, direction: &'req str) -> Self {
792        Self {
793            state: self.state, 
794            severity: self.severity, 
795            ecosystem: self.ecosystem, 
796            package: self.package, 
797            epss_percentage: self.epss_percentage, 
798            has: self.has, 
799            scope: self.scope, 
800            sort: self.sort, 
801            direction: Some(direction),
802            before: self.before, 
803            after: self.after, 
804            first: self.first, 
805            last: self.last, 
806            per_page: self.per_page, 
807        }
808    }
809
810    /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
811    pub fn before(self, before: &'req str) -> Self {
812        Self {
813            state: self.state, 
814            severity: self.severity, 
815            ecosystem: self.ecosystem, 
816            package: self.package, 
817            epss_percentage: self.epss_percentage, 
818            has: self.has, 
819            scope: self.scope, 
820            sort: self.sort, 
821            direction: self.direction, 
822            before: Some(before),
823            after: self.after, 
824            first: self.first, 
825            last: self.last, 
826            per_page: self.per_page, 
827        }
828    }
829
830    /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
831    pub fn after(self, after: &'req str) -> Self {
832        Self {
833            state: self.state, 
834            severity: self.severity, 
835            ecosystem: self.ecosystem, 
836            package: self.package, 
837            epss_percentage: self.epss_percentage, 
838            has: self.has, 
839            scope: self.scope, 
840            sort: self.sort, 
841            direction: self.direction, 
842            before: self.before, 
843            after: Some(after),
844            first: self.first, 
845            last: self.last, 
846            per_page: self.per_page, 
847        }
848    }
849
850    /// **Deprecated**. The number of results per page (max 100), starting from the first matching result. This parameter must not be used in combination with `last`. Instead, use `per_page` in combination with `after` to fetch the first page of results.
851    pub fn first(self, first: i32) -> Self {
852        Self {
853            state: self.state, 
854            severity: self.severity, 
855            ecosystem: self.ecosystem, 
856            package: self.package, 
857            epss_percentage: self.epss_percentage, 
858            has: self.has, 
859            scope: self.scope, 
860            sort: self.sort, 
861            direction: self.direction, 
862            before: self.before, 
863            after: self.after, 
864            first: Some(first),
865            last: self.last, 
866            per_page: self.per_page, 
867        }
868    }
869
870    /// **Deprecated**. The number of results per page (max 100), starting from the last matching result. This parameter must not be used in combination with `first`. Instead, use `per_page` in combination with `before` to fetch the last page of results.
871    pub fn last(self, last: i32) -> Self {
872        Self {
873            state: self.state, 
874            severity: self.severity, 
875            ecosystem: self.ecosystem, 
876            package: self.package, 
877            epss_percentage: self.epss_percentage, 
878            has: self.has, 
879            scope: self.scope, 
880            sort: self.sort, 
881            direction: self.direction, 
882            before: self.before, 
883            after: self.after, 
884            first: self.first, 
885            last: Some(last),
886            per_page: self.per_page, 
887        }
888    }
889
890    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
891    pub fn per_page(self, per_page: u16) -> Self {
892        Self {
893            state: self.state, 
894            severity: self.severity, 
895            ecosystem: self.ecosystem, 
896            package: self.package, 
897            epss_percentage: self.epss_percentage, 
898            has: self.has, 
899            scope: self.scope, 
900            sort: self.sort, 
901            direction: self.direction, 
902            before: self.before, 
903            after: self.after, 
904            first: self.first, 
905            last: self.last, 
906            per_page: Some(per_page),
907        }
908    }
909}
910
911/// Query parameters for the [List Dependabot alerts for an organization](Dependabot::list_alerts_for_org_async()) endpoint.
912#[derive(Default, Serialize)]
913pub struct DependabotListAlertsForOrgParams<'req> {
914    /// A comma-separated list of states. If specified, only alerts with these states will be returned.  Can be: `auto_dismissed`, `dismissed`, `fixed`, `open`
915    state: Option<&'req str>, 
916    /// A comma-separated list of severities. If specified, only alerts with these severities will be returned.  Can be: `low`, `medium`, `high`, `critical`
917    severity: Option<&'req str>, 
918    /// A comma-separated list of ecosystems. If specified, only alerts for these ecosystems will be returned.  Can be: `composer`, `go`, `maven`, `npm`, `nuget`, `pip`, `pub`, `rubygems`, `rust`
919    ecosystem: Option<&'req str>, 
920    /// A comma-separated list of package names. If specified, only alerts for these packages will be returned.
921    package: Option<&'req str>, 
922    /// CVE Exploit Prediction Scoring System (EPSS) percentage. Can be specified as: - An exact number (`n`) - Comparators such as `>n`, `<n`, `>=n`, `<=n` - A range like `n..n`, where `n` is a number from 0.0 to 1.0  Filters the list of alerts based on EPSS percentages. If specified, only alerts with the provided EPSS percentages will be returned.
923    epss_percentage: Option<&'req str>, 
924    /// Filters the list of alerts based on whether the alert has the given value. If specified, only alerts meeting this criterion will be returned. Multiple `has` filters can be passed to filter for alerts that have all of the values. Currently, only `patch` is supported.
925    has: Option<Has>, 
926    /// The scope of the vulnerable dependency. If specified, only alerts with this scope will be returned.
927    scope: Option<&'req str>, 
928    /// The property by which to sort the results. `created` means when the alert was created. `updated` means when the alert's state last changed. `epss_percentage` sorts alerts by the Exploit Prediction Scoring System (EPSS) percentage.
929    sort: Option<&'req str>, 
930    /// The direction to sort the results by.
931    direction: Option<&'req str>, 
932    /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
933    before: Option<&'req str>, 
934    /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
935    after: Option<&'req str>, 
936    /// **Deprecated**. The number of results per page (max 100), starting from the first matching result. This parameter must not be used in combination with `last`. Instead, use `per_page` in combination with `after` to fetch the first page of results.
937    first: Option<i32>, 
938    /// **Deprecated**. The number of results per page (max 100), starting from the last matching result. This parameter must not be used in combination with `first`. Instead, use `per_page` in combination with `before` to fetch the last page of results.
939    last: Option<i32>, 
940    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
941    per_page: Option<u16>
942}
943
944impl<'req> DependabotListAlertsForOrgParams<'req> {
945    pub fn new() -> Self {
946        Self::default()
947    }
948
949    /// A comma-separated list of states. If specified, only alerts with these states will be returned.  Can be: `auto_dismissed`, `dismissed`, `fixed`, `open`
950    pub fn state(self, state: &'req str) -> Self {
951        Self {
952            state: Some(state),
953            severity: self.severity, 
954            ecosystem: self.ecosystem, 
955            package: self.package, 
956            epss_percentage: self.epss_percentage, 
957            has: self.has, 
958            scope: self.scope, 
959            sort: self.sort, 
960            direction: self.direction, 
961            before: self.before, 
962            after: self.after, 
963            first: self.first, 
964            last: self.last, 
965            per_page: self.per_page, 
966        }
967    }
968
969    /// A comma-separated list of severities. If specified, only alerts with these severities will be returned.  Can be: `low`, `medium`, `high`, `critical`
970    pub fn severity(self, severity: &'req str) -> Self {
971        Self {
972            state: self.state, 
973            severity: Some(severity),
974            ecosystem: self.ecosystem, 
975            package: self.package, 
976            epss_percentage: self.epss_percentage, 
977            has: self.has, 
978            scope: self.scope, 
979            sort: self.sort, 
980            direction: self.direction, 
981            before: self.before, 
982            after: self.after, 
983            first: self.first, 
984            last: self.last, 
985            per_page: self.per_page, 
986        }
987    }
988
989    /// A comma-separated list of ecosystems. If specified, only alerts for these ecosystems will be returned.  Can be: `composer`, `go`, `maven`, `npm`, `nuget`, `pip`, `pub`, `rubygems`, `rust`
990    pub fn ecosystem(self, ecosystem: &'req str) -> Self {
991        Self {
992            state: self.state, 
993            severity: self.severity, 
994            ecosystem: Some(ecosystem),
995            package: self.package, 
996            epss_percentage: self.epss_percentage, 
997            has: self.has, 
998            scope: self.scope, 
999            sort: self.sort, 
1000            direction: self.direction, 
1001            before: self.before, 
1002            after: self.after, 
1003            first: self.first, 
1004            last: self.last, 
1005            per_page: self.per_page, 
1006        }
1007    }
1008
1009    /// A comma-separated list of package names. If specified, only alerts for these packages will be returned.
1010    pub fn package(self, package: &'req str) -> Self {
1011        Self {
1012            state: self.state, 
1013            severity: self.severity, 
1014            ecosystem: self.ecosystem, 
1015            package: Some(package),
1016            epss_percentage: self.epss_percentage, 
1017            has: self.has, 
1018            scope: self.scope, 
1019            sort: self.sort, 
1020            direction: self.direction, 
1021            before: self.before, 
1022            after: self.after, 
1023            first: self.first, 
1024            last: self.last, 
1025            per_page: self.per_page, 
1026        }
1027    }
1028
1029    /// CVE Exploit Prediction Scoring System (EPSS) percentage. Can be specified as: - An exact number (`n`) - Comparators such as `>n`, `<n`, `>=n`, `<=n` - A range like `n..n`, where `n` is a number from 0.0 to 1.0  Filters the list of alerts based on EPSS percentages. If specified, only alerts with the provided EPSS percentages will be returned.
1030    pub fn epss_percentage(self, epss_percentage: &'req str) -> Self {
1031        Self {
1032            state: self.state, 
1033            severity: self.severity, 
1034            ecosystem: self.ecosystem, 
1035            package: self.package, 
1036            epss_percentage: Some(epss_percentage),
1037            has: self.has, 
1038            scope: self.scope, 
1039            sort: self.sort, 
1040            direction: self.direction, 
1041            before: self.before, 
1042            after: self.after, 
1043            first: self.first, 
1044            last: self.last, 
1045            per_page: self.per_page, 
1046        }
1047    }
1048
1049    /// Filters the list of alerts based on whether the alert has the given value. If specified, only alerts meeting this criterion will be returned. Multiple `has` filters can be passed to filter for alerts that have all of the values. Currently, only `patch` is supported.
1050    pub fn has(self, has: Has) -> Self {
1051        Self {
1052            state: self.state, 
1053            severity: self.severity, 
1054            ecosystem: self.ecosystem, 
1055            package: self.package, 
1056            epss_percentage: self.epss_percentage, 
1057            has: Some(has),
1058            scope: self.scope, 
1059            sort: self.sort, 
1060            direction: self.direction, 
1061            before: self.before, 
1062            after: self.after, 
1063            first: self.first, 
1064            last: self.last, 
1065            per_page: self.per_page, 
1066        }
1067    }
1068
1069    /// The scope of the vulnerable dependency. If specified, only alerts with this scope will be returned.
1070    pub fn scope(self, scope: &'req str) -> Self {
1071        Self {
1072            state: self.state, 
1073            severity: self.severity, 
1074            ecosystem: self.ecosystem, 
1075            package: self.package, 
1076            epss_percentage: self.epss_percentage, 
1077            has: self.has, 
1078            scope: Some(scope),
1079            sort: self.sort, 
1080            direction: self.direction, 
1081            before: self.before, 
1082            after: self.after, 
1083            first: self.first, 
1084            last: self.last, 
1085            per_page: self.per_page, 
1086        }
1087    }
1088
1089    /// The property by which to sort the results. `created` means when the alert was created. `updated` means when the alert's state last changed. `epss_percentage` sorts alerts by the Exploit Prediction Scoring System (EPSS) percentage.
1090    pub fn sort(self, sort: &'req str) -> Self {
1091        Self {
1092            state: self.state, 
1093            severity: self.severity, 
1094            ecosystem: self.ecosystem, 
1095            package: self.package, 
1096            epss_percentage: self.epss_percentage, 
1097            has: self.has, 
1098            scope: self.scope, 
1099            sort: Some(sort),
1100            direction: self.direction, 
1101            before: self.before, 
1102            after: self.after, 
1103            first: self.first, 
1104            last: self.last, 
1105            per_page: self.per_page, 
1106        }
1107    }
1108
1109    /// The direction to sort the results by.
1110    pub fn direction(self, direction: &'req str) -> Self {
1111        Self {
1112            state: self.state, 
1113            severity: self.severity, 
1114            ecosystem: self.ecosystem, 
1115            package: self.package, 
1116            epss_percentage: self.epss_percentage, 
1117            has: self.has, 
1118            scope: self.scope, 
1119            sort: self.sort, 
1120            direction: Some(direction),
1121            before: self.before, 
1122            after: self.after, 
1123            first: self.first, 
1124            last: self.last, 
1125            per_page: self.per_page, 
1126        }
1127    }
1128
1129    /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
1130    pub fn before(self, before: &'req str) -> Self {
1131        Self {
1132            state: self.state, 
1133            severity: self.severity, 
1134            ecosystem: self.ecosystem, 
1135            package: self.package, 
1136            epss_percentage: self.epss_percentage, 
1137            has: self.has, 
1138            scope: self.scope, 
1139            sort: self.sort, 
1140            direction: self.direction, 
1141            before: Some(before),
1142            after: self.after, 
1143            first: self.first, 
1144            last: self.last, 
1145            per_page: self.per_page, 
1146        }
1147    }
1148
1149    /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
1150    pub fn after(self, after: &'req str) -> Self {
1151        Self {
1152            state: self.state, 
1153            severity: self.severity, 
1154            ecosystem: self.ecosystem, 
1155            package: self.package, 
1156            epss_percentage: self.epss_percentage, 
1157            has: self.has, 
1158            scope: self.scope, 
1159            sort: self.sort, 
1160            direction: self.direction, 
1161            before: self.before, 
1162            after: Some(after),
1163            first: self.first, 
1164            last: self.last, 
1165            per_page: self.per_page, 
1166        }
1167    }
1168
1169    /// **Deprecated**. The number of results per page (max 100), starting from the first matching result. This parameter must not be used in combination with `last`. Instead, use `per_page` in combination with `after` to fetch the first page of results.
1170    pub fn first(self, first: i32) -> Self {
1171        Self {
1172            state: self.state, 
1173            severity: self.severity, 
1174            ecosystem: self.ecosystem, 
1175            package: self.package, 
1176            epss_percentage: self.epss_percentage, 
1177            has: self.has, 
1178            scope: self.scope, 
1179            sort: self.sort, 
1180            direction: self.direction, 
1181            before: self.before, 
1182            after: self.after, 
1183            first: Some(first),
1184            last: self.last, 
1185            per_page: self.per_page, 
1186        }
1187    }
1188
1189    /// **Deprecated**. The number of results per page (max 100), starting from the last matching result. This parameter must not be used in combination with `first`. Instead, use `per_page` in combination with `before` to fetch the last page of results.
1190    pub fn last(self, last: i32) -> Self {
1191        Self {
1192            state: self.state, 
1193            severity: self.severity, 
1194            ecosystem: self.ecosystem, 
1195            package: self.package, 
1196            epss_percentage: self.epss_percentage, 
1197            has: self.has, 
1198            scope: self.scope, 
1199            sort: self.sort, 
1200            direction: self.direction, 
1201            before: self.before, 
1202            after: self.after, 
1203            first: self.first, 
1204            last: Some(last),
1205            per_page: self.per_page, 
1206        }
1207    }
1208
1209    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
1210    pub fn per_page(self, per_page: u16) -> Self {
1211        Self {
1212            state: self.state, 
1213            severity: self.severity, 
1214            ecosystem: self.ecosystem, 
1215            package: self.package, 
1216            epss_percentage: self.epss_percentage, 
1217            has: self.has, 
1218            scope: self.scope, 
1219            sort: self.sort, 
1220            direction: self.direction, 
1221            before: self.before, 
1222            after: self.after, 
1223            first: self.first, 
1224            last: self.last, 
1225            per_page: Some(per_page),
1226        }
1227    }
1228}
1229
1230/// Query parameters for the [List Dependabot alerts for a repository](Dependabot::list_alerts_for_repo_async()) endpoint.
1231#[derive(Default, Serialize)]
1232pub struct DependabotListAlertsForRepoParams<'req> {
1233    /// A comma-separated list of states. If specified, only alerts with these states will be returned.  Can be: `auto_dismissed`, `dismissed`, `fixed`, `open`
1234    state: Option<&'req str>, 
1235    /// A comma-separated list of severities. If specified, only alerts with these severities will be returned.  Can be: `low`, `medium`, `high`, `critical`
1236    severity: Option<&'req str>, 
1237    /// A comma-separated list of ecosystems. If specified, only alerts for these ecosystems will be returned.  Can be: `composer`, `go`, `maven`, `npm`, `nuget`, `pip`, `pub`, `rubygems`, `rust`
1238    ecosystem: Option<&'req str>, 
1239    /// A comma-separated list of package names. If specified, only alerts for these packages will be returned.
1240    package: Option<&'req str>, 
1241    /// A comma-separated list of full manifest paths. If specified, only alerts for these manifests will be returned.
1242    manifest: Option<&'req str>, 
1243    /// CVE Exploit Prediction Scoring System (EPSS) percentage. Can be specified as: - An exact number (`n`) - Comparators such as `>n`, `<n`, `>=n`, `<=n` - A range like `n..n`, where `n` is a number from 0.0 to 1.0  Filters the list of alerts based on EPSS percentages. If specified, only alerts with the provided EPSS percentages will be returned.
1244    epss_percentage: Option<&'req str>, 
1245    /// Filters the list of alerts based on whether the alert has the given value. If specified, only alerts meeting this criterion will be returned. Multiple `has` filters can be passed to filter for alerts that have all of the values. Currently, only `patch` is supported.
1246    has: Option<Has>, 
1247    /// The scope of the vulnerable dependency. If specified, only alerts with this scope will be returned.
1248    scope: Option<&'req str>, 
1249    /// The property by which to sort the results. `created` means when the alert was created. `updated` means when the alert's state last changed. `epss_percentage` sorts alerts by the Exploit Prediction Scoring System (EPSS) percentage.
1250    sort: Option<&'req str>, 
1251    /// The direction to sort the results by.
1252    direction: Option<&'req str>, 
1253    /// **Closing down notice**. Page number of the results to fetch. Use cursor-based pagination with `before` or `after` instead.
1254    page: Option<u16>, 
1255    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
1256    per_page: Option<u16>, 
1257    /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
1258    before: Option<&'req str>, 
1259    /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
1260    after: Option<&'req str>, 
1261    /// **Deprecated**. The number of results per page (max 100), starting from the first matching result. This parameter must not be used in combination with `last`. Instead, use `per_page` in combination with `after` to fetch the first page of results.
1262    first: Option<i32>, 
1263    /// **Deprecated**. The number of results per page (max 100), starting from the last matching result. This parameter must not be used in combination with `first`. Instead, use `per_page` in combination with `before` to fetch the last page of results.
1264    last: Option<i32>
1265}
1266
1267impl<'req> DependabotListAlertsForRepoParams<'req> {
1268    pub fn new() -> Self {
1269        Self::default()
1270    }
1271
1272    /// A comma-separated list of states. If specified, only alerts with these states will be returned.  Can be: `auto_dismissed`, `dismissed`, `fixed`, `open`
1273    pub fn state(self, state: &'req str) -> Self {
1274        Self {
1275            state: Some(state),
1276            severity: self.severity, 
1277            ecosystem: self.ecosystem, 
1278            package: self.package, 
1279            manifest: self.manifest, 
1280            epss_percentage: self.epss_percentage, 
1281            has: self.has, 
1282            scope: self.scope, 
1283            sort: self.sort, 
1284            direction: self.direction, 
1285            page: self.page, 
1286            per_page: self.per_page, 
1287            before: self.before, 
1288            after: self.after, 
1289            first: self.first, 
1290            last: self.last, 
1291        }
1292    }
1293
1294    /// A comma-separated list of severities. If specified, only alerts with these severities will be returned.  Can be: `low`, `medium`, `high`, `critical`
1295    pub fn severity(self, severity: &'req str) -> Self {
1296        Self {
1297            state: self.state, 
1298            severity: Some(severity),
1299            ecosystem: self.ecosystem, 
1300            package: self.package, 
1301            manifest: self.manifest, 
1302            epss_percentage: self.epss_percentage, 
1303            has: self.has, 
1304            scope: self.scope, 
1305            sort: self.sort, 
1306            direction: self.direction, 
1307            page: self.page, 
1308            per_page: self.per_page, 
1309            before: self.before, 
1310            after: self.after, 
1311            first: self.first, 
1312            last: self.last, 
1313        }
1314    }
1315
1316    /// A comma-separated list of ecosystems. If specified, only alerts for these ecosystems will be returned.  Can be: `composer`, `go`, `maven`, `npm`, `nuget`, `pip`, `pub`, `rubygems`, `rust`
1317    pub fn ecosystem(self, ecosystem: &'req str) -> Self {
1318        Self {
1319            state: self.state, 
1320            severity: self.severity, 
1321            ecosystem: Some(ecosystem),
1322            package: self.package, 
1323            manifest: self.manifest, 
1324            epss_percentage: self.epss_percentage, 
1325            has: self.has, 
1326            scope: self.scope, 
1327            sort: self.sort, 
1328            direction: self.direction, 
1329            page: self.page, 
1330            per_page: self.per_page, 
1331            before: self.before, 
1332            after: self.after, 
1333            first: self.first, 
1334            last: self.last, 
1335        }
1336    }
1337
1338    /// A comma-separated list of package names. If specified, only alerts for these packages will be returned.
1339    pub fn package(self, package: &'req str) -> Self {
1340        Self {
1341            state: self.state, 
1342            severity: self.severity, 
1343            ecosystem: self.ecosystem, 
1344            package: Some(package),
1345            manifest: self.manifest, 
1346            epss_percentage: self.epss_percentage, 
1347            has: self.has, 
1348            scope: self.scope, 
1349            sort: self.sort, 
1350            direction: self.direction, 
1351            page: self.page, 
1352            per_page: self.per_page, 
1353            before: self.before, 
1354            after: self.after, 
1355            first: self.first, 
1356            last: self.last, 
1357        }
1358    }
1359
1360    /// A comma-separated list of full manifest paths. If specified, only alerts for these manifests will be returned.
1361    pub fn manifest(self, manifest: &'req str) -> Self {
1362        Self {
1363            state: self.state, 
1364            severity: self.severity, 
1365            ecosystem: self.ecosystem, 
1366            package: self.package, 
1367            manifest: Some(manifest),
1368            epss_percentage: self.epss_percentage, 
1369            has: self.has, 
1370            scope: self.scope, 
1371            sort: self.sort, 
1372            direction: self.direction, 
1373            page: self.page, 
1374            per_page: self.per_page, 
1375            before: self.before, 
1376            after: self.after, 
1377            first: self.first, 
1378            last: self.last, 
1379        }
1380    }
1381
1382    /// CVE Exploit Prediction Scoring System (EPSS) percentage. Can be specified as: - An exact number (`n`) - Comparators such as `>n`, `<n`, `>=n`, `<=n` - A range like `n..n`, where `n` is a number from 0.0 to 1.0  Filters the list of alerts based on EPSS percentages. If specified, only alerts with the provided EPSS percentages will be returned.
1383    pub fn epss_percentage(self, epss_percentage: &'req str) -> Self {
1384        Self {
1385            state: self.state, 
1386            severity: self.severity, 
1387            ecosystem: self.ecosystem, 
1388            package: self.package, 
1389            manifest: self.manifest, 
1390            epss_percentage: Some(epss_percentage),
1391            has: self.has, 
1392            scope: self.scope, 
1393            sort: self.sort, 
1394            direction: self.direction, 
1395            page: self.page, 
1396            per_page: self.per_page, 
1397            before: self.before, 
1398            after: self.after, 
1399            first: self.first, 
1400            last: self.last, 
1401        }
1402    }
1403
1404    /// Filters the list of alerts based on whether the alert has the given value. If specified, only alerts meeting this criterion will be returned. Multiple `has` filters can be passed to filter for alerts that have all of the values. Currently, only `patch` is supported.
1405    pub fn has(self, has: Has) -> Self {
1406        Self {
1407            state: self.state, 
1408            severity: self.severity, 
1409            ecosystem: self.ecosystem, 
1410            package: self.package, 
1411            manifest: self.manifest, 
1412            epss_percentage: self.epss_percentage, 
1413            has: Some(has),
1414            scope: self.scope, 
1415            sort: self.sort, 
1416            direction: self.direction, 
1417            page: self.page, 
1418            per_page: self.per_page, 
1419            before: self.before, 
1420            after: self.after, 
1421            first: self.first, 
1422            last: self.last, 
1423        }
1424    }
1425
1426    /// The scope of the vulnerable dependency. If specified, only alerts with this scope will be returned.
1427    pub fn scope(self, scope: &'req str) -> Self {
1428        Self {
1429            state: self.state, 
1430            severity: self.severity, 
1431            ecosystem: self.ecosystem, 
1432            package: self.package, 
1433            manifest: self.manifest, 
1434            epss_percentage: self.epss_percentage, 
1435            has: self.has, 
1436            scope: Some(scope),
1437            sort: self.sort, 
1438            direction: self.direction, 
1439            page: self.page, 
1440            per_page: self.per_page, 
1441            before: self.before, 
1442            after: self.after, 
1443            first: self.first, 
1444            last: self.last, 
1445        }
1446    }
1447
1448    /// The property by which to sort the results. `created` means when the alert was created. `updated` means when the alert's state last changed. `epss_percentage` sorts alerts by the Exploit Prediction Scoring System (EPSS) percentage.
1449    pub fn sort(self, sort: &'req str) -> Self {
1450        Self {
1451            state: self.state, 
1452            severity: self.severity, 
1453            ecosystem: self.ecosystem, 
1454            package: self.package, 
1455            manifest: self.manifest, 
1456            epss_percentage: self.epss_percentage, 
1457            has: self.has, 
1458            scope: self.scope, 
1459            sort: Some(sort),
1460            direction: self.direction, 
1461            page: self.page, 
1462            per_page: self.per_page, 
1463            before: self.before, 
1464            after: self.after, 
1465            first: self.first, 
1466            last: self.last, 
1467        }
1468    }
1469
1470    /// The direction to sort the results by.
1471    pub fn direction(self, direction: &'req str) -> Self {
1472        Self {
1473            state: self.state, 
1474            severity: self.severity, 
1475            ecosystem: self.ecosystem, 
1476            package: self.package, 
1477            manifest: self.manifest, 
1478            epss_percentage: self.epss_percentage, 
1479            has: self.has, 
1480            scope: self.scope, 
1481            sort: self.sort, 
1482            direction: Some(direction),
1483            page: self.page, 
1484            per_page: self.per_page, 
1485            before: self.before, 
1486            after: self.after, 
1487            first: self.first, 
1488            last: self.last, 
1489        }
1490    }
1491
1492    /// **Closing down notice**. Page number of the results to fetch. Use cursor-based pagination with `before` or `after` instead.
1493    pub fn page(self, page: u16) -> Self {
1494        Self {
1495            state: self.state, 
1496            severity: self.severity, 
1497            ecosystem: self.ecosystem, 
1498            package: self.package, 
1499            manifest: self.manifest, 
1500            epss_percentage: self.epss_percentage, 
1501            has: self.has, 
1502            scope: self.scope, 
1503            sort: self.sort, 
1504            direction: self.direction, 
1505            page: Some(page),
1506            per_page: self.per_page, 
1507            before: self.before, 
1508            after: self.after, 
1509            first: self.first, 
1510            last: self.last, 
1511        }
1512    }
1513
1514    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
1515    pub fn per_page(self, per_page: u16) -> Self {
1516        Self {
1517            state: self.state, 
1518            severity: self.severity, 
1519            ecosystem: self.ecosystem, 
1520            package: self.package, 
1521            manifest: self.manifest, 
1522            epss_percentage: self.epss_percentage, 
1523            has: self.has, 
1524            scope: self.scope, 
1525            sort: self.sort, 
1526            direction: self.direction, 
1527            page: self.page, 
1528            per_page: Some(per_page),
1529            before: self.before, 
1530            after: self.after, 
1531            first: self.first, 
1532            last: self.last, 
1533        }
1534    }
1535
1536    /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
1537    pub fn before(self, before: &'req str) -> Self {
1538        Self {
1539            state: self.state, 
1540            severity: self.severity, 
1541            ecosystem: self.ecosystem, 
1542            package: self.package, 
1543            manifest: self.manifest, 
1544            epss_percentage: self.epss_percentage, 
1545            has: self.has, 
1546            scope: self.scope, 
1547            sort: self.sort, 
1548            direction: self.direction, 
1549            page: self.page, 
1550            per_page: self.per_page, 
1551            before: Some(before),
1552            after: self.after, 
1553            first: self.first, 
1554            last: self.last, 
1555        }
1556    }
1557
1558    /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
1559    pub fn after(self, after: &'req str) -> Self {
1560        Self {
1561            state: self.state, 
1562            severity: self.severity, 
1563            ecosystem: self.ecosystem, 
1564            package: self.package, 
1565            manifest: self.manifest, 
1566            epss_percentage: self.epss_percentage, 
1567            has: self.has, 
1568            scope: self.scope, 
1569            sort: self.sort, 
1570            direction: self.direction, 
1571            page: self.page, 
1572            per_page: self.per_page, 
1573            before: self.before, 
1574            after: Some(after),
1575            first: self.first, 
1576            last: self.last, 
1577        }
1578    }
1579
1580    /// **Deprecated**. The number of results per page (max 100), starting from the first matching result. This parameter must not be used in combination with `last`. Instead, use `per_page` in combination with `after` to fetch the first page of results.
1581    pub fn first(self, first: i32) -> Self {
1582        Self {
1583            state: self.state, 
1584            severity: self.severity, 
1585            ecosystem: self.ecosystem, 
1586            package: self.package, 
1587            manifest: self.manifest, 
1588            epss_percentage: self.epss_percentage, 
1589            has: self.has, 
1590            scope: self.scope, 
1591            sort: self.sort, 
1592            direction: self.direction, 
1593            page: self.page, 
1594            per_page: self.per_page, 
1595            before: self.before, 
1596            after: self.after, 
1597            first: Some(first),
1598            last: self.last, 
1599        }
1600    }
1601
1602    /// **Deprecated**. The number of results per page (max 100), starting from the last matching result. This parameter must not be used in combination with `first`. Instead, use `per_page` in combination with `before` to fetch the last page of results.
1603    pub fn last(self, last: i32) -> Self {
1604        Self {
1605            state: self.state, 
1606            severity: self.severity, 
1607            ecosystem: self.ecosystem, 
1608            package: self.package, 
1609            manifest: self.manifest, 
1610            epss_percentage: self.epss_percentage, 
1611            has: self.has, 
1612            scope: self.scope, 
1613            sort: self.sort, 
1614            direction: self.direction, 
1615            page: self.page, 
1616            per_page: self.per_page, 
1617            before: self.before, 
1618            after: self.after, 
1619            first: self.first, 
1620            last: Some(last),
1621        }
1622    }
1623}
1624
1625impl<'enc> From<&'enc PerPage> for DependabotListAlertsForRepoParams<'enc> {
1626    fn from(per_page: &'enc PerPage) -> Self {
1627        Self {
1628            per_page: Some(per_page.per_page),
1629            page: Some(per_page.page),
1630            ..Default::default()
1631        }
1632    }
1633}
1634/// Query parameters for the [List organization secrets](Dependabot::list_org_secrets_async()) endpoint.
1635#[derive(Default, Serialize)]
1636pub struct DependabotListOrgSecretsParams {
1637    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
1638    per_page: Option<u16>, 
1639    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
1640    page: Option<u16>
1641}
1642
1643impl DependabotListOrgSecretsParams {
1644    pub fn new() -> Self {
1645        Self::default()
1646    }
1647
1648    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
1649    pub fn per_page(self, per_page: u16) -> Self {
1650        Self {
1651            per_page: Some(per_page),
1652            page: self.page, 
1653        }
1654    }
1655
1656    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
1657    pub fn page(self, page: u16) -> Self {
1658        Self {
1659            per_page: self.per_page, 
1660            page: Some(page),
1661        }
1662    }
1663}
1664
1665impl<'enc> From<&'enc PerPage> for DependabotListOrgSecretsParams {
1666    fn from(per_page: &'enc PerPage) -> Self {
1667        Self {
1668            per_page: Some(per_page.per_page),
1669            page: Some(per_page.page),
1670            ..Default::default()
1671        }
1672    }
1673}
1674/// Query parameters for the [List repository secrets](Dependabot::list_repo_secrets_async()) endpoint.
1675#[derive(Default, Serialize)]
1676pub struct DependabotListRepoSecretsParams {
1677    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
1678    per_page: Option<u16>, 
1679    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
1680    page: Option<u16>
1681}
1682
1683impl DependabotListRepoSecretsParams {
1684    pub fn new() -> Self {
1685        Self::default()
1686    }
1687
1688    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
1689    pub fn per_page(self, per_page: u16) -> Self {
1690        Self {
1691            per_page: Some(per_page),
1692            page: self.page, 
1693        }
1694    }
1695
1696    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
1697    pub fn page(self, page: u16) -> Self {
1698        Self {
1699            per_page: self.per_page, 
1700            page: Some(page),
1701        }
1702    }
1703}
1704
1705impl<'enc> From<&'enc PerPage> for DependabotListRepoSecretsParams {
1706    fn from(per_page: &'enc PerPage) -> Self {
1707        Self {
1708            per_page: Some(per_page.per_page),
1709            page: Some(per_page.page),
1710            ..Default::default()
1711        }
1712    }
1713}
1714/// Query parameters for the [List selected repositories for an organization secret](Dependabot::list_selected_repos_for_org_secret_async()) endpoint.
1715#[derive(Default, Serialize)]
1716pub struct DependabotListSelectedReposForOrgSecretParams {
1717    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
1718    page: Option<u16>, 
1719    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
1720    per_page: Option<u16>
1721}
1722
1723impl DependabotListSelectedReposForOrgSecretParams {
1724    pub fn new() -> Self {
1725        Self::default()
1726    }
1727
1728    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
1729    pub fn page(self, page: u16) -> Self {
1730        Self {
1731            page: Some(page),
1732            per_page: self.per_page, 
1733        }
1734    }
1735
1736    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
1737    pub fn per_page(self, per_page: u16) -> Self {
1738        Self {
1739            page: self.page, 
1740            per_page: Some(per_page),
1741        }
1742    }
1743}
1744
1745impl<'enc> From<&'enc PerPage> for DependabotListSelectedReposForOrgSecretParams {
1746    fn from(per_page: &'enc PerPage) -> Self {
1747        Self {
1748            per_page: Some(per_page.per_page),
1749            page: Some(per_page.page),
1750            ..Default::default()
1751        }
1752    }
1753}
1754/// Query parameters for the [Lists the repositories Dependabot can access in an organization](Dependabot::repository_access_for_org_async()) endpoint.
1755#[derive(Default, Serialize)]
1756pub struct DependabotRepositoryAccessForOrgParams {
1757    /// The page number of results to fetch.
1758    page: Option<u16>, 
1759    /// Number of results per page.
1760    per_page: Option<u16>
1761}
1762
1763impl DependabotRepositoryAccessForOrgParams {
1764    pub fn new() -> Self {
1765        Self::default()
1766    }
1767
1768    /// The page number of results to fetch.
1769    pub fn page(self, page: u16) -> Self {
1770        Self {
1771            page: Some(page),
1772            per_page: self.per_page, 
1773        }
1774    }
1775
1776    /// Number of results per page.
1777    pub fn per_page(self, per_page: u16) -> Self {
1778        Self {
1779            page: self.page, 
1780            per_page: Some(per_page),
1781        }
1782    }
1783}
1784
1785impl<'enc> From<&'enc PerPage> for DependabotRepositoryAccessForOrgParams {
1786    fn from(per_page: &'enc PerPage) -> Self {
1787        Self {
1788            per_page: Some(per_page.per_page),
1789            page: Some(per_page.page),
1790            ..Default::default()
1791        }
1792    }
1793}
1794
1795impl<'api, C: Client> Dependabot<'api, C> where AdapterError: From<<C as Client>::Err> {
1796    /// ---
1797    ///
1798    /// # Add selected repository to an organization secret
1799    ///
1800    /// Adds a repository to an organization secret when the `visibility` for
1801    /// repository access is set to `selected`. The visibility is set when you [Create or
1802    /// update an organization secret](https://docs.github.com/rest/dependabot/secrets#create-or-update-an-organization-secret).
1803    /// 
1804    /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
1805    ///
1806    /// [GitHub API docs for add_selected_repo_to_org_secret](https://docs.github.com/rest/dependabot/secrets#add-selected-repository-to-an-organization-secret)
1807    ///
1808    /// ---
1809    pub async fn add_selected_repo_to_org_secret_async(&self, org: &str, secret_name: &str, repository_id: i32) -> Result<(), AdapterError> {
1810
1811        let request_uri = format!("{}/orgs/{}/dependabot/secrets/{}/repositories/{}", super::GITHUB_BASE_API_URL, org, secret_name, repository_id);
1812
1813
1814        let req = GitHubRequest {
1815            uri: request_uri,
1816            body: None::<C::Body>,
1817            method: "PUT",
1818            headers: vec![]
1819        };
1820
1821        let request = self.client.build(req)?;
1822
1823        // --
1824
1825        let github_response = self.client.fetch_async(request).await?;
1826
1827        // --
1828
1829        if github_response.is_success() {
1830            Ok(())
1831        } else {
1832            match github_response.status_code() {
1833                409 => Err(DependabotAddSelectedRepoToOrgSecretError::Status409.into()),
1834                code => Err(DependabotAddSelectedRepoToOrgSecretError::Generic { code }.into()),
1835            }
1836        }
1837    }
1838
1839    /// ---
1840    ///
1841    /// # Add selected repository to an organization secret
1842    ///
1843    /// Adds a repository to an organization secret when the `visibility` for
1844    /// repository access is set to `selected`. The visibility is set when you [Create or
1845    /// update an organization secret](https://docs.github.com/rest/dependabot/secrets#create-or-update-an-organization-secret).
1846    /// 
1847    /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
1848    ///
1849    /// [GitHub API docs for add_selected_repo_to_org_secret](https://docs.github.com/rest/dependabot/secrets#add-selected-repository-to-an-organization-secret)
1850    ///
1851    /// ---
1852    #[cfg(not(target_arch = "wasm32"))]
1853    pub fn add_selected_repo_to_org_secret(&self, org: &str, secret_name: &str, repository_id: i32) -> Result<(), AdapterError> {
1854
1855        let request_uri = format!("{}/orgs/{}/dependabot/secrets/{}/repositories/{}", super::GITHUB_BASE_API_URL, org, secret_name, repository_id);
1856
1857
1858        let req = GitHubRequest {
1859            uri: request_uri,
1860            body: None,
1861            method: "PUT",
1862            headers: vec![]
1863        };
1864
1865        let request = self.client.build(req)?;
1866
1867        // --
1868
1869        let github_response = self.client.fetch(request)?;
1870
1871        // --
1872
1873        if github_response.is_success() {
1874            Ok(())
1875        } else {
1876            match github_response.status_code() {
1877                409 => Err(DependabotAddSelectedRepoToOrgSecretError::Status409.into()),
1878                code => Err(DependabotAddSelectedRepoToOrgSecretError::Generic { code }.into()),
1879            }
1880        }
1881    }
1882
1883    /// ---
1884    ///
1885    /// # Create or update an organization secret
1886    ///
1887    /// Creates or updates an organization secret with an encrypted value. Encrypt your secret using
1888    /// [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."
1889    /// 
1890    /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
1891    ///
1892    /// [GitHub API docs for create_or_update_org_secret](https://docs.github.com/rest/dependabot/secrets#create-or-update-an-organization-secret)
1893    ///
1894    /// ---
1895    pub async fn create_or_update_org_secret_async(&self, org: &str, secret_name: &str, body: PutDependabotCreateOrUpdateOrgSecret) -> Result<EmptyObject, AdapterError> {
1896
1897        let request_uri = format!("{}/orgs/{}/dependabot/secrets/{}", super::GITHUB_BASE_API_URL, org, secret_name);
1898
1899
1900        let req = GitHubRequest {
1901            uri: request_uri,
1902            body: Some(C::from_json::<PutDependabotCreateOrUpdateOrgSecret>(body)?),
1903            method: "PUT",
1904            headers: vec![]
1905        };
1906
1907        let request = self.client.build(req)?;
1908
1909        // --
1910
1911        let github_response = self.client.fetch_async(request).await?;
1912
1913        // --
1914
1915        if github_response.is_success() {
1916            Ok(github_response.to_json_async().await?)
1917        } else {
1918            match github_response.status_code() {
1919                204 => Err(DependabotCreateOrUpdateOrgSecretError::Status204.into()),
1920                code => Err(DependabotCreateOrUpdateOrgSecretError::Generic { code }.into()),
1921            }
1922        }
1923    }
1924
1925    /// ---
1926    ///
1927    /// # Create or update an organization secret
1928    ///
1929    /// Creates or updates an organization secret with an encrypted value. Encrypt your secret using
1930    /// [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."
1931    /// 
1932    /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
1933    ///
1934    /// [GitHub API docs for create_or_update_org_secret](https://docs.github.com/rest/dependabot/secrets#create-or-update-an-organization-secret)
1935    ///
1936    /// ---
1937    #[cfg(not(target_arch = "wasm32"))]
1938    pub fn create_or_update_org_secret(&self, org: &str, secret_name: &str, body: PutDependabotCreateOrUpdateOrgSecret) -> Result<EmptyObject, AdapterError> {
1939
1940        let request_uri = format!("{}/orgs/{}/dependabot/secrets/{}", super::GITHUB_BASE_API_URL, org, secret_name);
1941
1942
1943        let req = GitHubRequest {
1944            uri: request_uri,
1945            body: Some(C::from_json::<PutDependabotCreateOrUpdateOrgSecret>(body)?),
1946            method: "PUT",
1947            headers: vec![]
1948        };
1949
1950        let request = self.client.build(req)?;
1951
1952        // --
1953
1954        let github_response = self.client.fetch(request)?;
1955
1956        // --
1957
1958        if github_response.is_success() {
1959            Ok(github_response.to_json()?)
1960        } else {
1961            match github_response.status_code() {
1962                204 => Err(DependabotCreateOrUpdateOrgSecretError::Status204.into()),
1963                code => Err(DependabotCreateOrUpdateOrgSecretError::Generic { code }.into()),
1964            }
1965        }
1966    }
1967
1968    /// ---
1969    ///
1970    /// # Create or update a repository secret
1971    ///
1972    /// Creates or updates a repository secret with an encrypted value. Encrypt your secret using
1973    /// [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."
1974    /// 
1975    /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
1976    ///
1977    /// [GitHub API docs for create_or_update_repo_secret](https://docs.github.com/rest/dependabot/secrets#create-or-update-a-repository-secret)
1978    ///
1979    /// ---
1980    pub async fn create_or_update_repo_secret_async(&self, owner: &str, repo: &str, secret_name: &str, body: PutDependabotCreateOrUpdateRepoSecret) -> Result<EmptyObject, AdapterError> {
1981
1982        let request_uri = format!("{}/repos/{}/{}/dependabot/secrets/{}", super::GITHUB_BASE_API_URL, owner, repo, secret_name);
1983
1984
1985        let req = GitHubRequest {
1986            uri: request_uri,
1987            body: Some(C::from_json::<PutDependabotCreateOrUpdateRepoSecret>(body)?),
1988            method: "PUT",
1989            headers: vec![]
1990        };
1991
1992        let request = self.client.build(req)?;
1993
1994        // --
1995
1996        let github_response = self.client.fetch_async(request).await?;
1997
1998        // --
1999
2000        if github_response.is_success() {
2001            Ok(github_response.to_json_async().await?)
2002        } else {
2003            match github_response.status_code() {
2004                204 => Err(DependabotCreateOrUpdateRepoSecretError::Status204.into()),
2005                code => Err(DependabotCreateOrUpdateRepoSecretError::Generic { code }.into()),
2006            }
2007        }
2008    }
2009
2010    /// ---
2011    ///
2012    /// # Create or update a repository secret
2013    ///
2014    /// Creates or updates a repository secret with an encrypted value. Encrypt your secret using
2015    /// [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."
2016    /// 
2017    /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
2018    ///
2019    /// [GitHub API docs for create_or_update_repo_secret](https://docs.github.com/rest/dependabot/secrets#create-or-update-a-repository-secret)
2020    ///
2021    /// ---
2022    #[cfg(not(target_arch = "wasm32"))]
2023    pub fn create_or_update_repo_secret(&self, owner: &str, repo: &str, secret_name: &str, body: PutDependabotCreateOrUpdateRepoSecret) -> Result<EmptyObject, AdapterError> {
2024
2025        let request_uri = format!("{}/repos/{}/{}/dependabot/secrets/{}", super::GITHUB_BASE_API_URL, owner, repo, secret_name);
2026
2027
2028        let req = GitHubRequest {
2029            uri: request_uri,
2030            body: Some(C::from_json::<PutDependabotCreateOrUpdateRepoSecret>(body)?),
2031            method: "PUT",
2032            headers: vec![]
2033        };
2034
2035        let request = self.client.build(req)?;
2036
2037        // --
2038
2039        let github_response = self.client.fetch(request)?;
2040
2041        // --
2042
2043        if github_response.is_success() {
2044            Ok(github_response.to_json()?)
2045        } else {
2046            match github_response.status_code() {
2047                204 => Err(DependabotCreateOrUpdateRepoSecretError::Status204.into()),
2048                code => Err(DependabotCreateOrUpdateRepoSecretError::Generic { code }.into()),
2049            }
2050        }
2051    }
2052
2053    /// ---
2054    ///
2055    /// # Delete an organization secret
2056    ///
2057    /// Deletes a secret in an organization using the secret name.
2058    /// 
2059    /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
2060    ///
2061    /// [GitHub API docs for delete_org_secret](https://docs.github.com/rest/dependabot/secrets#delete-an-organization-secret)
2062    ///
2063    /// ---
2064    pub async fn delete_org_secret_async(&self, org: &str, secret_name: &str) -> Result<(), AdapterError> {
2065
2066        let request_uri = format!("{}/orgs/{}/dependabot/secrets/{}", super::GITHUB_BASE_API_URL, org, secret_name);
2067
2068
2069        let req = GitHubRequest {
2070            uri: request_uri,
2071            body: None::<C::Body>,
2072            method: "DELETE",
2073            headers: vec![]
2074        };
2075
2076        let request = self.client.build(req)?;
2077
2078        // --
2079
2080        let github_response = self.client.fetch_async(request).await?;
2081
2082        // --
2083
2084        if github_response.is_success() {
2085            Ok(())
2086        } else {
2087            match github_response.status_code() {
2088                code => Err(DependabotDeleteOrgSecretError::Generic { code }.into()),
2089            }
2090        }
2091    }
2092
2093    /// ---
2094    ///
2095    /// # Delete an organization secret
2096    ///
2097    /// Deletes a secret in an organization using the secret name.
2098    /// 
2099    /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
2100    ///
2101    /// [GitHub API docs for delete_org_secret](https://docs.github.com/rest/dependabot/secrets#delete-an-organization-secret)
2102    ///
2103    /// ---
2104    #[cfg(not(target_arch = "wasm32"))]
2105    pub fn delete_org_secret(&self, org: &str, secret_name: &str) -> Result<(), AdapterError> {
2106
2107        let request_uri = format!("{}/orgs/{}/dependabot/secrets/{}", super::GITHUB_BASE_API_URL, org, secret_name);
2108
2109
2110        let req = GitHubRequest {
2111            uri: request_uri,
2112            body: None,
2113            method: "DELETE",
2114            headers: vec![]
2115        };
2116
2117        let request = self.client.build(req)?;
2118
2119        // --
2120
2121        let github_response = self.client.fetch(request)?;
2122
2123        // --
2124
2125        if github_response.is_success() {
2126            Ok(())
2127        } else {
2128            match github_response.status_code() {
2129                code => Err(DependabotDeleteOrgSecretError::Generic { code }.into()),
2130            }
2131        }
2132    }
2133
2134    /// ---
2135    ///
2136    /// # Delete a repository secret
2137    ///
2138    /// Deletes a secret in a repository using the secret name.
2139    /// 
2140    /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
2141    ///
2142    /// [GitHub API docs for delete_repo_secret](https://docs.github.com/rest/dependabot/secrets#delete-a-repository-secret)
2143    ///
2144    /// ---
2145    pub async fn delete_repo_secret_async(&self, owner: &str, repo: &str, secret_name: &str) -> Result<(), AdapterError> {
2146
2147        let request_uri = format!("{}/repos/{}/{}/dependabot/secrets/{}", super::GITHUB_BASE_API_URL, owner, repo, secret_name);
2148
2149
2150        let req = GitHubRequest {
2151            uri: request_uri,
2152            body: None::<C::Body>,
2153            method: "DELETE",
2154            headers: vec![]
2155        };
2156
2157        let request = self.client.build(req)?;
2158
2159        // --
2160
2161        let github_response = self.client.fetch_async(request).await?;
2162
2163        // --
2164
2165        if github_response.is_success() {
2166            Ok(())
2167        } else {
2168            match github_response.status_code() {
2169                code => Err(DependabotDeleteRepoSecretError::Generic { code }.into()),
2170            }
2171        }
2172    }
2173
2174    /// ---
2175    ///
2176    /// # Delete a repository secret
2177    ///
2178    /// Deletes a secret in a repository using the secret name.
2179    /// 
2180    /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
2181    ///
2182    /// [GitHub API docs for delete_repo_secret](https://docs.github.com/rest/dependabot/secrets#delete-a-repository-secret)
2183    ///
2184    /// ---
2185    #[cfg(not(target_arch = "wasm32"))]
2186    pub fn delete_repo_secret(&self, owner: &str, repo: &str, secret_name: &str) -> Result<(), AdapterError> {
2187
2188        let request_uri = format!("{}/repos/{}/{}/dependabot/secrets/{}", super::GITHUB_BASE_API_URL, owner, repo, secret_name);
2189
2190
2191        let req = GitHubRequest {
2192            uri: request_uri,
2193            body: None,
2194            method: "DELETE",
2195            headers: vec![]
2196        };
2197
2198        let request = self.client.build(req)?;
2199
2200        // --
2201
2202        let github_response = self.client.fetch(request)?;
2203
2204        // --
2205
2206        if github_response.is_success() {
2207            Ok(())
2208        } else {
2209            match github_response.status_code() {
2210                code => Err(DependabotDeleteRepoSecretError::Generic { code }.into()),
2211            }
2212        }
2213    }
2214
2215    /// ---
2216    ///
2217    /// # Get a Dependabot alert
2218    ///
2219    /// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead.
2220    ///
2221    /// [GitHub API docs for get_alert](https://docs.github.com/rest/dependabot/alerts#get-a-dependabot-alert)
2222    ///
2223    /// ---
2224    pub async fn get_alert_async(&self, owner: &str, repo: &str, alert_number: AlertNumber) -> Result<DependabotAlert, AdapterError> {
2225
2226        let request_uri = format!("{}/repos/{}/{}/dependabot/alerts/{}", super::GITHUB_BASE_API_URL, owner, repo, alert_number);
2227
2228
2229        let req = GitHubRequest {
2230            uri: request_uri,
2231            body: None::<C::Body>,
2232            method: "GET",
2233            headers: vec![]
2234        };
2235
2236        let request = self.client.build(req)?;
2237
2238        // --
2239
2240        let github_response = self.client.fetch_async(request).await?;
2241
2242        // --
2243
2244        if github_response.is_success() {
2245            Ok(github_response.to_json_async().await?)
2246        } else {
2247            match github_response.status_code() {
2248                304 => Err(DependabotGetAlertError::Status304.into()),
2249                403 => Err(DependabotGetAlertError::Status403(github_response.to_json_async().await?).into()),
2250                404 => Err(DependabotGetAlertError::Status404(github_response.to_json_async().await?).into()),
2251                code => Err(DependabotGetAlertError::Generic { code }.into()),
2252            }
2253        }
2254    }
2255
2256    /// ---
2257    ///
2258    /// # Get a Dependabot alert
2259    ///
2260    /// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead.
2261    ///
2262    /// [GitHub API docs for get_alert](https://docs.github.com/rest/dependabot/alerts#get-a-dependabot-alert)
2263    ///
2264    /// ---
2265    #[cfg(not(target_arch = "wasm32"))]
2266    pub fn get_alert(&self, owner: &str, repo: &str, alert_number: AlertNumber) -> Result<DependabotAlert, AdapterError> {
2267
2268        let request_uri = format!("{}/repos/{}/{}/dependabot/alerts/{}", super::GITHUB_BASE_API_URL, owner, repo, alert_number);
2269
2270
2271        let req = GitHubRequest {
2272            uri: request_uri,
2273            body: None,
2274            method: "GET",
2275            headers: vec![]
2276        };
2277
2278        let request = self.client.build(req)?;
2279
2280        // --
2281
2282        let github_response = self.client.fetch(request)?;
2283
2284        // --
2285
2286        if github_response.is_success() {
2287            Ok(github_response.to_json()?)
2288        } else {
2289            match github_response.status_code() {
2290                304 => Err(DependabotGetAlertError::Status304.into()),
2291                403 => Err(DependabotGetAlertError::Status403(github_response.to_json()?).into()),
2292                404 => Err(DependabotGetAlertError::Status404(github_response.to_json()?).into()),
2293                code => Err(DependabotGetAlertError::Generic { code }.into()),
2294            }
2295        }
2296    }
2297
2298    /// ---
2299    ///
2300    /// # Get an organization public key
2301    ///
2302    /// Gets your public key, which you need to encrypt secrets. You need to
2303    /// encrypt a secret before you can create or update secrets.
2304    /// 
2305    /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
2306    ///
2307    /// [GitHub API docs for get_org_public_key](https://docs.github.com/rest/dependabot/secrets#get-an-organization-public-key)
2308    ///
2309    /// ---
2310    pub async fn get_org_public_key_async(&self, org: &str) -> Result<DependabotPublicKey, AdapterError> {
2311
2312        let request_uri = format!("{}/orgs/{}/dependabot/secrets/public-key", super::GITHUB_BASE_API_URL, org);
2313
2314
2315        let req = GitHubRequest {
2316            uri: request_uri,
2317            body: None::<C::Body>,
2318            method: "GET",
2319            headers: vec![]
2320        };
2321
2322        let request = self.client.build(req)?;
2323
2324        // --
2325
2326        let github_response = self.client.fetch_async(request).await?;
2327
2328        // --
2329
2330        if github_response.is_success() {
2331            Ok(github_response.to_json_async().await?)
2332        } else {
2333            match github_response.status_code() {
2334                code => Err(DependabotGetOrgPublicKeyError::Generic { code }.into()),
2335            }
2336        }
2337    }
2338
2339    /// ---
2340    ///
2341    /// # Get an organization public key
2342    ///
2343    /// Gets your public key, which you need to encrypt secrets. You need to
2344    /// encrypt a secret before you can create or update secrets.
2345    /// 
2346    /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
2347    ///
2348    /// [GitHub API docs for get_org_public_key](https://docs.github.com/rest/dependabot/secrets#get-an-organization-public-key)
2349    ///
2350    /// ---
2351    #[cfg(not(target_arch = "wasm32"))]
2352    pub fn get_org_public_key(&self, org: &str) -> Result<DependabotPublicKey, AdapterError> {
2353
2354        let request_uri = format!("{}/orgs/{}/dependabot/secrets/public-key", super::GITHUB_BASE_API_URL, org);
2355
2356
2357        let req = GitHubRequest {
2358            uri: request_uri,
2359            body: None,
2360            method: "GET",
2361            headers: vec![]
2362        };
2363
2364        let request = self.client.build(req)?;
2365
2366        // --
2367
2368        let github_response = self.client.fetch(request)?;
2369
2370        // --
2371
2372        if github_response.is_success() {
2373            Ok(github_response.to_json()?)
2374        } else {
2375            match github_response.status_code() {
2376                code => Err(DependabotGetOrgPublicKeyError::Generic { code }.into()),
2377            }
2378        }
2379    }
2380
2381    /// ---
2382    ///
2383    /// # Get an organization secret
2384    ///
2385    /// Gets a single organization secret without revealing its encrypted value.
2386    /// 
2387    /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
2388    ///
2389    /// [GitHub API docs for get_org_secret](https://docs.github.com/rest/dependabot/secrets#get-an-organization-secret)
2390    ///
2391    /// ---
2392    pub async fn get_org_secret_async(&self, org: &str, secret_name: &str) -> Result<OrganizationDependabotSecret, AdapterError> {
2393
2394        let request_uri = format!("{}/orgs/{}/dependabot/secrets/{}", super::GITHUB_BASE_API_URL, org, secret_name);
2395
2396
2397        let req = GitHubRequest {
2398            uri: request_uri,
2399            body: None::<C::Body>,
2400            method: "GET",
2401            headers: vec![]
2402        };
2403
2404        let request = self.client.build(req)?;
2405
2406        // --
2407
2408        let github_response = self.client.fetch_async(request).await?;
2409
2410        // --
2411
2412        if github_response.is_success() {
2413            Ok(github_response.to_json_async().await?)
2414        } else {
2415            match github_response.status_code() {
2416                code => Err(DependabotGetOrgSecretError::Generic { code }.into()),
2417            }
2418        }
2419    }
2420
2421    /// ---
2422    ///
2423    /// # Get an organization secret
2424    ///
2425    /// Gets a single organization secret without revealing its encrypted value.
2426    /// 
2427    /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
2428    ///
2429    /// [GitHub API docs for get_org_secret](https://docs.github.com/rest/dependabot/secrets#get-an-organization-secret)
2430    ///
2431    /// ---
2432    #[cfg(not(target_arch = "wasm32"))]
2433    pub fn get_org_secret(&self, org: &str, secret_name: &str) -> Result<OrganizationDependabotSecret, AdapterError> {
2434
2435        let request_uri = format!("{}/orgs/{}/dependabot/secrets/{}", super::GITHUB_BASE_API_URL, org, secret_name);
2436
2437
2438        let req = GitHubRequest {
2439            uri: request_uri,
2440            body: None,
2441            method: "GET",
2442            headers: vec![]
2443        };
2444
2445        let request = self.client.build(req)?;
2446
2447        // --
2448
2449        let github_response = self.client.fetch(request)?;
2450
2451        // --
2452
2453        if github_response.is_success() {
2454            Ok(github_response.to_json()?)
2455        } else {
2456            match github_response.status_code() {
2457                code => Err(DependabotGetOrgSecretError::Generic { code }.into()),
2458            }
2459        }
2460    }
2461
2462    /// ---
2463    ///
2464    /// # Get a repository public key
2465    ///
2466    /// Gets your public key, which you need to encrypt secrets. You need to
2467    /// encrypt a secret before you can create or update secrets. Anyone with read access
2468    /// to the repository can use this endpoint.
2469    /// 
2470    /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint if the repository is private.
2471    ///
2472    /// [GitHub API docs for get_repo_public_key](https://docs.github.com/rest/dependabot/secrets#get-a-repository-public-key)
2473    ///
2474    /// ---
2475    pub async fn get_repo_public_key_async(&self, owner: &str, repo: &str) -> Result<DependabotPublicKey, AdapterError> {
2476
2477        let request_uri = format!("{}/repos/{}/{}/dependabot/secrets/public-key", super::GITHUB_BASE_API_URL, owner, repo);
2478
2479
2480        let req = GitHubRequest {
2481            uri: request_uri,
2482            body: None::<C::Body>,
2483            method: "GET",
2484            headers: vec![]
2485        };
2486
2487        let request = self.client.build(req)?;
2488
2489        // --
2490
2491        let github_response = self.client.fetch_async(request).await?;
2492
2493        // --
2494
2495        if github_response.is_success() {
2496            Ok(github_response.to_json_async().await?)
2497        } else {
2498            match github_response.status_code() {
2499                code => Err(DependabotGetRepoPublicKeyError::Generic { code }.into()),
2500            }
2501        }
2502    }
2503
2504    /// ---
2505    ///
2506    /// # Get a repository public key
2507    ///
2508    /// Gets your public key, which you need to encrypt secrets. You need to
2509    /// encrypt a secret before you can create or update secrets. Anyone with read access
2510    /// to the repository can use this endpoint.
2511    /// 
2512    /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint if the repository is private.
2513    ///
2514    /// [GitHub API docs for get_repo_public_key](https://docs.github.com/rest/dependabot/secrets#get-a-repository-public-key)
2515    ///
2516    /// ---
2517    #[cfg(not(target_arch = "wasm32"))]
2518    pub fn get_repo_public_key(&self, owner: &str, repo: &str) -> Result<DependabotPublicKey, AdapterError> {
2519
2520        let request_uri = format!("{}/repos/{}/{}/dependabot/secrets/public-key", super::GITHUB_BASE_API_URL, owner, repo);
2521
2522
2523        let req = GitHubRequest {
2524            uri: request_uri,
2525            body: None,
2526            method: "GET",
2527            headers: vec![]
2528        };
2529
2530        let request = self.client.build(req)?;
2531
2532        // --
2533
2534        let github_response = self.client.fetch(request)?;
2535
2536        // --
2537
2538        if github_response.is_success() {
2539            Ok(github_response.to_json()?)
2540        } else {
2541            match github_response.status_code() {
2542                code => Err(DependabotGetRepoPublicKeyError::Generic { code }.into()),
2543            }
2544        }
2545    }
2546
2547    /// ---
2548    ///
2549    /// # Get a repository secret
2550    ///
2551    /// Gets a single repository secret without revealing its encrypted value.
2552    /// 
2553    /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
2554    ///
2555    /// [GitHub API docs for get_repo_secret](https://docs.github.com/rest/dependabot/secrets#get-a-repository-secret)
2556    ///
2557    /// ---
2558    pub async fn get_repo_secret_async(&self, owner: &str, repo: &str, secret_name: &str) -> Result<DependabotSecret, AdapterError> {
2559
2560        let request_uri = format!("{}/repos/{}/{}/dependabot/secrets/{}", super::GITHUB_BASE_API_URL, owner, repo, secret_name);
2561
2562
2563        let req = GitHubRequest {
2564            uri: request_uri,
2565            body: None::<C::Body>,
2566            method: "GET",
2567            headers: vec![]
2568        };
2569
2570        let request = self.client.build(req)?;
2571
2572        // --
2573
2574        let github_response = self.client.fetch_async(request).await?;
2575
2576        // --
2577
2578        if github_response.is_success() {
2579            Ok(github_response.to_json_async().await?)
2580        } else {
2581            match github_response.status_code() {
2582                code => Err(DependabotGetRepoSecretError::Generic { code }.into()),
2583            }
2584        }
2585    }
2586
2587    /// ---
2588    ///
2589    /// # Get a repository secret
2590    ///
2591    /// Gets a single repository secret without revealing its encrypted value.
2592    /// 
2593    /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
2594    ///
2595    /// [GitHub API docs for get_repo_secret](https://docs.github.com/rest/dependabot/secrets#get-a-repository-secret)
2596    ///
2597    /// ---
2598    #[cfg(not(target_arch = "wasm32"))]
2599    pub fn get_repo_secret(&self, owner: &str, repo: &str, secret_name: &str) -> Result<DependabotSecret, AdapterError> {
2600
2601        let request_uri = format!("{}/repos/{}/{}/dependabot/secrets/{}", super::GITHUB_BASE_API_URL, owner, repo, secret_name);
2602
2603
2604        let req = GitHubRequest {
2605            uri: request_uri,
2606            body: None,
2607            method: "GET",
2608            headers: vec![]
2609        };
2610
2611        let request = self.client.build(req)?;
2612
2613        // --
2614
2615        let github_response = self.client.fetch(request)?;
2616
2617        // --
2618
2619        if github_response.is_success() {
2620            Ok(github_response.to_json()?)
2621        } else {
2622            match github_response.status_code() {
2623                code => Err(DependabotGetRepoSecretError::Generic { code }.into()),
2624            }
2625        }
2626    }
2627
2628    /// ---
2629    ///
2630    /// # List Dependabot alerts for an enterprise
2631    ///
2632    /// Lists Dependabot alerts for repositories that are owned by the specified enterprise.
2633    /// 
2634    /// The authenticated user must be a member of the enterprise to use this endpoint.
2635    /// 
2636    /// Alerts are only returned for organizations in the enterprise for which you are an organization owner or a security manager. For more information about security managers, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."
2637    /// 
2638    /// OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint.
2639    ///
2640    /// [GitHub API docs for list_alerts_for_enterprise](https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-an-enterprise)
2641    ///
2642    /// ---
2643    pub async fn list_alerts_for_enterprise_async(&self, enterprise: &str, query_params: Option<impl Into<DependabotListAlertsForEnterpriseParams<'api>>>) -> Result<Vec<DependabotAlertWithRepository>, AdapterError> {
2644
2645        let mut request_uri = format!("{}/enterprises/{}/dependabot/alerts", super::GITHUB_BASE_API_URL, enterprise);
2646
2647        if let Some(params) = query_params {
2648            request_uri.push_str("?");
2649            request_uri.push_str(&serde_urlencoded::to_string(params.into())?);
2650        }
2651
2652        let req = GitHubRequest {
2653            uri: request_uri,
2654            body: None::<C::Body>,
2655            method: "GET",
2656            headers: vec![]
2657        };
2658
2659        let request = self.client.build(req)?;
2660
2661        // --
2662
2663        let github_response = self.client.fetch_async(request).await?;
2664
2665        // --
2666
2667        if github_response.is_success() {
2668            Ok(github_response.to_json_async().await?)
2669        } else {
2670            match github_response.status_code() {
2671                304 => Err(DependabotListAlertsForEnterpriseError::Status304.into()),
2672                403 => Err(DependabotListAlertsForEnterpriseError::Status403(github_response.to_json_async().await?).into()),
2673                404 => Err(DependabotListAlertsForEnterpriseError::Status404(github_response.to_json_async().await?).into()),
2674                422 => Err(DependabotListAlertsForEnterpriseError::Status422(github_response.to_json_async().await?).into()),
2675                code => Err(DependabotListAlertsForEnterpriseError::Generic { code }.into()),
2676            }
2677        }
2678    }
2679
2680    /// ---
2681    ///
2682    /// # List Dependabot alerts for an enterprise
2683    ///
2684    /// Lists Dependabot alerts for repositories that are owned by the specified enterprise.
2685    /// 
2686    /// The authenticated user must be a member of the enterprise to use this endpoint.
2687    /// 
2688    /// Alerts are only returned for organizations in the enterprise for which you are an organization owner or a security manager. For more information about security managers, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."
2689    /// 
2690    /// OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint.
2691    ///
2692    /// [GitHub API docs for list_alerts_for_enterprise](https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-an-enterprise)
2693    ///
2694    /// ---
2695    #[cfg(not(target_arch = "wasm32"))]
2696    pub fn list_alerts_for_enterprise(&self, enterprise: &str, query_params: Option<impl Into<DependabotListAlertsForEnterpriseParams<'api>>>) -> Result<Vec<DependabotAlertWithRepository>, AdapterError> {
2697
2698        let mut request_uri = format!("{}/enterprises/{}/dependabot/alerts", super::GITHUB_BASE_API_URL, enterprise);
2699
2700        if let Some(params) = query_params {
2701            request_uri.push_str("?");
2702            let qp: DependabotListAlertsForEnterpriseParams = params.into();
2703            request_uri.push_str(&serde_urlencoded::to_string(qp)?);
2704        }
2705
2706        let req = GitHubRequest {
2707            uri: request_uri,
2708            body: None,
2709            method: "GET",
2710            headers: vec![]
2711        };
2712
2713        let request = self.client.build(req)?;
2714
2715        // --
2716
2717        let github_response = self.client.fetch(request)?;
2718
2719        // --
2720
2721        if github_response.is_success() {
2722            Ok(github_response.to_json()?)
2723        } else {
2724            match github_response.status_code() {
2725                304 => Err(DependabotListAlertsForEnterpriseError::Status304.into()),
2726                403 => Err(DependabotListAlertsForEnterpriseError::Status403(github_response.to_json()?).into()),
2727                404 => Err(DependabotListAlertsForEnterpriseError::Status404(github_response.to_json()?).into()),
2728                422 => Err(DependabotListAlertsForEnterpriseError::Status422(github_response.to_json()?).into()),
2729                code => Err(DependabotListAlertsForEnterpriseError::Generic { code }.into()),
2730            }
2731        }
2732    }
2733
2734    /// ---
2735    ///
2736    /// # List Dependabot alerts for an organization
2737    ///
2738    /// Lists Dependabot alerts for an organization.
2739    /// 
2740    /// The authenticated user must be an owner or security manager for the organization to use this endpoint.
2741    /// 
2742    /// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead.
2743    ///
2744    /// [GitHub API docs for list_alerts_for_org](https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-an-organization)
2745    ///
2746    /// ---
2747    pub async fn list_alerts_for_org_async(&self, org: &str, query_params: Option<impl Into<DependabotListAlertsForOrgParams<'api>>>) -> Result<Vec<DependabotAlertWithRepository>, AdapterError> {
2748
2749        let mut request_uri = format!("{}/orgs/{}/dependabot/alerts", super::GITHUB_BASE_API_URL, org);
2750
2751        if let Some(params) = query_params {
2752            request_uri.push_str("?");
2753            request_uri.push_str(&serde_urlencoded::to_string(params.into())?);
2754        }
2755
2756        let req = GitHubRequest {
2757            uri: request_uri,
2758            body: None::<C::Body>,
2759            method: "GET",
2760            headers: vec![]
2761        };
2762
2763        let request = self.client.build(req)?;
2764
2765        // --
2766
2767        let github_response = self.client.fetch_async(request).await?;
2768
2769        // --
2770
2771        if github_response.is_success() {
2772            Ok(github_response.to_json_async().await?)
2773        } else {
2774            match github_response.status_code() {
2775                304 => Err(DependabotListAlertsForOrgError::Status304.into()),
2776                400 => Err(DependabotListAlertsForOrgError::Status400(github_response.to_json_async().await?).into()),
2777                403 => Err(DependabotListAlertsForOrgError::Status403(github_response.to_json_async().await?).into()),
2778                404 => Err(DependabotListAlertsForOrgError::Status404(github_response.to_json_async().await?).into()),
2779                422 => Err(DependabotListAlertsForOrgError::Status422(github_response.to_json_async().await?).into()),
2780                code => Err(DependabotListAlertsForOrgError::Generic { code }.into()),
2781            }
2782        }
2783    }
2784
2785    /// ---
2786    ///
2787    /// # List Dependabot alerts for an organization
2788    ///
2789    /// Lists Dependabot alerts for an organization.
2790    /// 
2791    /// The authenticated user must be an owner or security manager for the organization to use this endpoint.
2792    /// 
2793    /// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead.
2794    ///
2795    /// [GitHub API docs for list_alerts_for_org](https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-an-organization)
2796    ///
2797    /// ---
2798    #[cfg(not(target_arch = "wasm32"))]
2799    pub fn list_alerts_for_org(&self, org: &str, query_params: Option<impl Into<DependabotListAlertsForOrgParams<'api>>>) -> Result<Vec<DependabotAlertWithRepository>, AdapterError> {
2800
2801        let mut request_uri = format!("{}/orgs/{}/dependabot/alerts", super::GITHUB_BASE_API_URL, org);
2802
2803        if let Some(params) = query_params {
2804            request_uri.push_str("?");
2805            let qp: DependabotListAlertsForOrgParams = params.into();
2806            request_uri.push_str(&serde_urlencoded::to_string(qp)?);
2807        }
2808
2809        let req = GitHubRequest {
2810            uri: request_uri,
2811            body: None,
2812            method: "GET",
2813            headers: vec![]
2814        };
2815
2816        let request = self.client.build(req)?;
2817
2818        // --
2819
2820        let github_response = self.client.fetch(request)?;
2821
2822        // --
2823
2824        if github_response.is_success() {
2825            Ok(github_response.to_json()?)
2826        } else {
2827            match github_response.status_code() {
2828                304 => Err(DependabotListAlertsForOrgError::Status304.into()),
2829                400 => Err(DependabotListAlertsForOrgError::Status400(github_response.to_json()?).into()),
2830                403 => Err(DependabotListAlertsForOrgError::Status403(github_response.to_json()?).into()),
2831                404 => Err(DependabotListAlertsForOrgError::Status404(github_response.to_json()?).into()),
2832                422 => Err(DependabotListAlertsForOrgError::Status422(github_response.to_json()?).into()),
2833                code => Err(DependabotListAlertsForOrgError::Generic { code }.into()),
2834            }
2835        }
2836    }
2837
2838    /// ---
2839    ///
2840    /// # List Dependabot alerts for a repository
2841    ///
2842    /// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead.
2843    ///
2844    /// [GitHub API docs for list_alerts_for_repo](https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-a-repository)
2845    ///
2846    /// ---
2847    pub async fn list_alerts_for_repo_async(&self, owner: &str, repo: &str, query_params: Option<impl Into<DependabotListAlertsForRepoParams<'api>>>) -> Result<Vec<DependabotAlert>, AdapterError> {
2848
2849        let mut request_uri = format!("{}/repos/{}/{}/dependabot/alerts", super::GITHUB_BASE_API_URL, owner, repo);
2850
2851        if let Some(params) = query_params {
2852            request_uri.push_str("?");
2853            request_uri.push_str(&serde_urlencoded::to_string(params.into())?);
2854        }
2855
2856        let req = GitHubRequest {
2857            uri: request_uri,
2858            body: None::<C::Body>,
2859            method: "GET",
2860            headers: vec![]
2861        };
2862
2863        let request = self.client.build(req)?;
2864
2865        // --
2866
2867        let github_response = self.client.fetch_async(request).await?;
2868
2869        // --
2870
2871        if github_response.is_success() {
2872            Ok(github_response.to_json_async().await?)
2873        } else {
2874            match github_response.status_code() {
2875                304 => Err(DependabotListAlertsForRepoError::Status304.into()),
2876                400 => Err(DependabotListAlertsForRepoError::Status400(github_response.to_json_async().await?).into()),
2877                403 => Err(DependabotListAlertsForRepoError::Status403(github_response.to_json_async().await?).into()),
2878                404 => Err(DependabotListAlertsForRepoError::Status404(github_response.to_json_async().await?).into()),
2879                422 => Err(DependabotListAlertsForRepoError::Status422(github_response.to_json_async().await?).into()),
2880                code => Err(DependabotListAlertsForRepoError::Generic { code }.into()),
2881            }
2882        }
2883    }
2884
2885    /// ---
2886    ///
2887    /// # List Dependabot alerts for a repository
2888    ///
2889    /// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead.
2890    ///
2891    /// [GitHub API docs for list_alerts_for_repo](https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-a-repository)
2892    ///
2893    /// ---
2894    #[cfg(not(target_arch = "wasm32"))]
2895    pub fn list_alerts_for_repo(&self, owner: &str, repo: &str, query_params: Option<impl Into<DependabotListAlertsForRepoParams<'api>>>) -> Result<Vec<DependabotAlert>, AdapterError> {
2896
2897        let mut request_uri = format!("{}/repos/{}/{}/dependabot/alerts", super::GITHUB_BASE_API_URL, owner, repo);
2898
2899        if let Some(params) = query_params {
2900            request_uri.push_str("?");
2901            let qp: DependabotListAlertsForRepoParams = params.into();
2902            request_uri.push_str(&serde_urlencoded::to_string(qp)?);
2903        }
2904
2905        let req = GitHubRequest {
2906            uri: request_uri,
2907            body: None,
2908            method: "GET",
2909            headers: vec![]
2910        };
2911
2912        let request = self.client.build(req)?;
2913
2914        // --
2915
2916        let github_response = self.client.fetch(request)?;
2917
2918        // --
2919
2920        if github_response.is_success() {
2921            Ok(github_response.to_json()?)
2922        } else {
2923            match github_response.status_code() {
2924                304 => Err(DependabotListAlertsForRepoError::Status304.into()),
2925                400 => Err(DependabotListAlertsForRepoError::Status400(github_response.to_json()?).into()),
2926                403 => Err(DependabotListAlertsForRepoError::Status403(github_response.to_json()?).into()),
2927                404 => Err(DependabotListAlertsForRepoError::Status404(github_response.to_json()?).into()),
2928                422 => Err(DependabotListAlertsForRepoError::Status422(github_response.to_json()?).into()),
2929                code => Err(DependabotListAlertsForRepoError::Generic { code }.into()),
2930            }
2931        }
2932    }
2933
2934    /// ---
2935    ///
2936    /// # List organization secrets
2937    ///
2938    /// Lists all secrets available in an organization without revealing their
2939    /// encrypted values.
2940    /// 
2941    /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
2942    ///
2943    /// [GitHub API docs for list_org_secrets](https://docs.github.com/rest/dependabot/secrets#list-organization-secrets)
2944    ///
2945    /// ---
2946    pub async fn list_org_secrets_async(&self, org: &str, query_params: Option<impl Into<DependabotListOrgSecretsParams>>) -> Result<GetDependabotListOrgSecretsResponse200, AdapterError> {
2947
2948        let mut request_uri = format!("{}/orgs/{}/dependabot/secrets", super::GITHUB_BASE_API_URL, org);
2949
2950        if let Some(params) = query_params {
2951            request_uri.push_str("?");
2952            request_uri.push_str(&serde_urlencoded::to_string(params.into())?);
2953        }
2954
2955        let req = GitHubRequest {
2956            uri: request_uri,
2957            body: None::<C::Body>,
2958            method: "GET",
2959            headers: vec![]
2960        };
2961
2962        let request = self.client.build(req)?;
2963
2964        // --
2965
2966        let github_response = self.client.fetch_async(request).await?;
2967
2968        // --
2969
2970        if github_response.is_success() {
2971            Ok(github_response.to_json_async().await?)
2972        } else {
2973            match github_response.status_code() {
2974                code => Err(DependabotListOrgSecretsError::Generic { code }.into()),
2975            }
2976        }
2977    }
2978
2979    /// ---
2980    ///
2981    /// # List organization secrets
2982    ///
2983    /// Lists all secrets available in an organization without revealing their
2984    /// encrypted values.
2985    /// 
2986    /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
2987    ///
2988    /// [GitHub API docs for list_org_secrets](https://docs.github.com/rest/dependabot/secrets#list-organization-secrets)
2989    ///
2990    /// ---
2991    #[cfg(not(target_arch = "wasm32"))]
2992    pub fn list_org_secrets(&self, org: &str, query_params: Option<impl Into<DependabotListOrgSecretsParams>>) -> Result<GetDependabotListOrgSecretsResponse200, AdapterError> {
2993
2994        let mut request_uri = format!("{}/orgs/{}/dependabot/secrets", super::GITHUB_BASE_API_URL, org);
2995
2996        if let Some(params) = query_params {
2997            request_uri.push_str("?");
2998            let qp: DependabotListOrgSecretsParams = params.into();
2999            request_uri.push_str(&serde_urlencoded::to_string(qp)?);
3000        }
3001
3002        let req = GitHubRequest {
3003            uri: request_uri,
3004            body: None,
3005            method: "GET",
3006            headers: vec![]
3007        };
3008
3009        let request = self.client.build(req)?;
3010
3011        // --
3012
3013        let github_response = self.client.fetch(request)?;
3014
3015        // --
3016
3017        if github_response.is_success() {
3018            Ok(github_response.to_json()?)
3019        } else {
3020            match github_response.status_code() {
3021                code => Err(DependabotListOrgSecretsError::Generic { code }.into()),
3022            }
3023        }
3024    }
3025
3026    /// ---
3027    ///
3028    /// # List repository secrets
3029    ///
3030    /// Lists all secrets available in a repository without revealing their encrypted
3031    /// values.
3032    /// 
3033    /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
3034    ///
3035    /// [GitHub API docs for list_repo_secrets](https://docs.github.com/rest/dependabot/secrets#list-repository-secrets)
3036    ///
3037    /// ---
3038    pub async fn list_repo_secrets_async(&self, owner: &str, repo: &str, query_params: Option<impl Into<DependabotListRepoSecretsParams>>) -> Result<GetDependabotListRepoSecretsResponse200, AdapterError> {
3039
3040        let mut request_uri = format!("{}/repos/{}/{}/dependabot/secrets", super::GITHUB_BASE_API_URL, owner, repo);
3041
3042        if let Some(params) = query_params {
3043            request_uri.push_str("?");
3044            request_uri.push_str(&serde_urlencoded::to_string(params.into())?);
3045        }
3046
3047        let req = GitHubRequest {
3048            uri: request_uri,
3049            body: None::<C::Body>,
3050            method: "GET",
3051            headers: vec![]
3052        };
3053
3054        let request = self.client.build(req)?;
3055
3056        // --
3057
3058        let github_response = self.client.fetch_async(request).await?;
3059
3060        // --
3061
3062        if github_response.is_success() {
3063            Ok(github_response.to_json_async().await?)
3064        } else {
3065            match github_response.status_code() {
3066                code => Err(DependabotListRepoSecretsError::Generic { code }.into()),
3067            }
3068        }
3069    }
3070
3071    /// ---
3072    ///
3073    /// # List repository secrets
3074    ///
3075    /// Lists all secrets available in a repository without revealing their encrypted
3076    /// values.
3077    /// 
3078    /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
3079    ///
3080    /// [GitHub API docs for list_repo_secrets](https://docs.github.com/rest/dependabot/secrets#list-repository-secrets)
3081    ///
3082    /// ---
3083    #[cfg(not(target_arch = "wasm32"))]
3084    pub fn list_repo_secrets(&self, owner: &str, repo: &str, query_params: Option<impl Into<DependabotListRepoSecretsParams>>) -> Result<GetDependabotListRepoSecretsResponse200, AdapterError> {
3085
3086        let mut request_uri = format!("{}/repos/{}/{}/dependabot/secrets", super::GITHUB_BASE_API_URL, owner, repo);
3087
3088        if let Some(params) = query_params {
3089            request_uri.push_str("?");
3090            let qp: DependabotListRepoSecretsParams = params.into();
3091            request_uri.push_str(&serde_urlencoded::to_string(qp)?);
3092        }
3093
3094        let req = GitHubRequest {
3095            uri: request_uri,
3096            body: None,
3097            method: "GET",
3098            headers: vec![]
3099        };
3100
3101        let request = self.client.build(req)?;
3102
3103        // --
3104
3105        let github_response = self.client.fetch(request)?;
3106
3107        // --
3108
3109        if github_response.is_success() {
3110            Ok(github_response.to_json()?)
3111        } else {
3112            match github_response.status_code() {
3113                code => Err(DependabotListRepoSecretsError::Generic { code }.into()),
3114            }
3115        }
3116    }
3117
3118    /// ---
3119    ///
3120    /// # List selected repositories for an organization secret
3121    ///
3122    /// Lists all repositories that have been selected when the `visibility`
3123    /// for repository access to a secret is set to `selected`.
3124    /// 
3125    /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
3126    ///
3127    /// [GitHub API docs for list_selected_repos_for_org_secret](https://docs.github.com/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret)
3128    ///
3129    /// ---
3130    pub async fn list_selected_repos_for_org_secret_async(&self, org: &str, secret_name: &str, query_params: Option<impl Into<DependabotListSelectedReposForOrgSecretParams>>) -> Result<GetCodespacesListRepositoriesForSecretForAuthenticatedUserResponse200, AdapterError> {
3131
3132        let mut request_uri = format!("{}/orgs/{}/dependabot/secrets/{}/repositories", super::GITHUB_BASE_API_URL, org, secret_name);
3133
3134        if let Some(params) = query_params {
3135            request_uri.push_str("?");
3136            request_uri.push_str(&serde_urlencoded::to_string(params.into())?);
3137        }
3138
3139        let req = GitHubRequest {
3140            uri: request_uri,
3141            body: None::<C::Body>,
3142            method: "GET",
3143            headers: vec![]
3144        };
3145
3146        let request = self.client.build(req)?;
3147
3148        // --
3149
3150        let github_response = self.client.fetch_async(request).await?;
3151
3152        // --
3153
3154        if github_response.is_success() {
3155            Ok(github_response.to_json_async().await?)
3156        } else {
3157            match github_response.status_code() {
3158                code => Err(DependabotListSelectedReposForOrgSecretError::Generic { code }.into()),
3159            }
3160        }
3161    }
3162
3163    /// ---
3164    ///
3165    /// # List selected repositories for an organization secret
3166    ///
3167    /// Lists all repositories that have been selected when the `visibility`
3168    /// for repository access to a secret is set to `selected`.
3169    /// 
3170    /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
3171    ///
3172    /// [GitHub API docs for list_selected_repos_for_org_secret](https://docs.github.com/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret)
3173    ///
3174    /// ---
3175    #[cfg(not(target_arch = "wasm32"))]
3176    pub fn list_selected_repos_for_org_secret(&self, org: &str, secret_name: &str, query_params: Option<impl Into<DependabotListSelectedReposForOrgSecretParams>>) -> Result<GetCodespacesListRepositoriesForSecretForAuthenticatedUserResponse200, AdapterError> {
3177
3178        let mut request_uri = format!("{}/orgs/{}/dependabot/secrets/{}/repositories", super::GITHUB_BASE_API_URL, org, secret_name);
3179
3180        if let Some(params) = query_params {
3181            request_uri.push_str("?");
3182            let qp: DependabotListSelectedReposForOrgSecretParams = params.into();
3183            request_uri.push_str(&serde_urlencoded::to_string(qp)?);
3184        }
3185
3186        let req = GitHubRequest {
3187            uri: request_uri,
3188            body: None,
3189            method: "GET",
3190            headers: vec![]
3191        };
3192
3193        let request = self.client.build(req)?;
3194
3195        // --
3196
3197        let github_response = self.client.fetch(request)?;
3198
3199        // --
3200
3201        if github_response.is_success() {
3202            Ok(github_response.to_json()?)
3203        } else {
3204            match github_response.status_code() {
3205                code => Err(DependabotListSelectedReposForOrgSecretError::Generic { code }.into()),
3206            }
3207        }
3208    }
3209
3210    /// ---
3211    ///
3212    /// # Remove selected repository from an organization secret
3213    ///
3214    /// Removes a repository from an organization secret when the `visibility`
3215    /// for repository access is set to `selected`. The visibility is set when you [Create
3216    /// or update an organization secret](https://docs.github.com/rest/dependabot/secrets#create-or-update-an-organization-secret).
3217    /// 
3218    /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
3219    ///
3220    /// [GitHub API docs for remove_selected_repo_from_org_secret](https://docs.github.com/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret)
3221    ///
3222    /// ---
3223    pub async fn remove_selected_repo_from_org_secret_async(&self, org: &str, secret_name: &str, repository_id: i32) -> Result<(), AdapterError> {
3224
3225        let request_uri = format!("{}/orgs/{}/dependabot/secrets/{}/repositories/{}", super::GITHUB_BASE_API_URL, org, secret_name, repository_id);
3226
3227
3228        let req = GitHubRequest {
3229            uri: request_uri,
3230            body: None::<C::Body>,
3231            method: "DELETE",
3232            headers: vec![]
3233        };
3234
3235        let request = self.client.build(req)?;
3236
3237        // --
3238
3239        let github_response = self.client.fetch_async(request).await?;
3240
3241        // --
3242
3243        if github_response.is_success() {
3244            Ok(())
3245        } else {
3246            match github_response.status_code() {
3247                409 => Err(DependabotRemoveSelectedRepoFromOrgSecretError::Status409.into()),
3248                code => Err(DependabotRemoveSelectedRepoFromOrgSecretError::Generic { code }.into()),
3249            }
3250        }
3251    }
3252
3253    /// ---
3254    ///
3255    /// # Remove selected repository from an organization secret
3256    ///
3257    /// Removes a repository from an organization secret when the `visibility`
3258    /// for repository access is set to `selected`. The visibility is set when you [Create
3259    /// or update an organization secret](https://docs.github.com/rest/dependabot/secrets#create-or-update-an-organization-secret).
3260    /// 
3261    /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
3262    ///
3263    /// [GitHub API docs for remove_selected_repo_from_org_secret](https://docs.github.com/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret)
3264    ///
3265    /// ---
3266    #[cfg(not(target_arch = "wasm32"))]
3267    pub fn remove_selected_repo_from_org_secret(&self, org: &str, secret_name: &str, repository_id: i32) -> Result<(), AdapterError> {
3268
3269        let request_uri = format!("{}/orgs/{}/dependabot/secrets/{}/repositories/{}", super::GITHUB_BASE_API_URL, org, secret_name, repository_id);
3270
3271
3272        let req = GitHubRequest {
3273            uri: request_uri,
3274            body: None,
3275            method: "DELETE",
3276            headers: vec![]
3277        };
3278
3279        let request = self.client.build(req)?;
3280
3281        // --
3282
3283        let github_response = self.client.fetch(request)?;
3284
3285        // --
3286
3287        if github_response.is_success() {
3288            Ok(())
3289        } else {
3290            match github_response.status_code() {
3291                409 => Err(DependabotRemoveSelectedRepoFromOrgSecretError::Status409.into()),
3292                code => Err(DependabotRemoveSelectedRepoFromOrgSecretError::Generic { code }.into()),
3293            }
3294        }
3295    }
3296
3297    /// ---
3298    ///
3299    /// # Lists the repositories Dependabot can access in an organization
3300    ///
3301    /// Lists repositories that organization admins have allowed Dependabot to access when updating dependencies.
3302    /// > [!NOTE]
3303    /// >    This operation supports both server-to-server and user-to-server access.
3304    /// Unauthorized users will not see the existence of this endpoint.
3305    ///
3306    /// [GitHub API docs for repository_access_for_org](https://docs.github.com/rest/dependabot/repository-access#lists-the-repositories-dependabot-can-access-in-an-organization)
3307    ///
3308    /// ---
3309    pub async fn repository_access_for_org_async(&self, org: &str, query_params: Option<impl Into<DependabotRepositoryAccessForOrgParams>>) -> Result<DependabotRepositoryAccessDetails, AdapterError> {
3310
3311        let mut request_uri = format!("{}/organizations/{}/dependabot/repository-access", super::GITHUB_BASE_API_URL, org);
3312
3313        if let Some(params) = query_params {
3314            request_uri.push_str("?");
3315            request_uri.push_str(&serde_urlencoded::to_string(params.into())?);
3316        }
3317
3318        let req = GitHubRequest {
3319            uri: request_uri,
3320            body: None::<C::Body>,
3321            method: "GET",
3322            headers: vec![]
3323        };
3324
3325        let request = self.client.build(req)?;
3326
3327        // --
3328
3329        let github_response = self.client.fetch_async(request).await?;
3330
3331        // --
3332
3333        if github_response.is_success() {
3334            Ok(github_response.to_json_async().await?)
3335        } else {
3336            match github_response.status_code() {
3337                403 => Err(DependabotRepositoryAccessForOrgError::Status403(github_response.to_json_async().await?).into()),
3338                404 => Err(DependabotRepositoryAccessForOrgError::Status404(github_response.to_json_async().await?).into()),
3339                code => Err(DependabotRepositoryAccessForOrgError::Generic { code }.into()),
3340            }
3341        }
3342    }
3343
3344    /// ---
3345    ///
3346    /// # Lists the repositories Dependabot can access in an organization
3347    ///
3348    /// Lists repositories that organization admins have allowed Dependabot to access when updating dependencies.
3349    /// > [!NOTE]
3350    /// >    This operation supports both server-to-server and user-to-server access.
3351    /// Unauthorized users will not see the existence of this endpoint.
3352    ///
3353    /// [GitHub API docs for repository_access_for_org](https://docs.github.com/rest/dependabot/repository-access#lists-the-repositories-dependabot-can-access-in-an-organization)
3354    ///
3355    /// ---
3356    #[cfg(not(target_arch = "wasm32"))]
3357    pub fn repository_access_for_org(&self, org: &str, query_params: Option<impl Into<DependabotRepositoryAccessForOrgParams>>) -> Result<DependabotRepositoryAccessDetails, AdapterError> {
3358
3359        let mut request_uri = format!("{}/organizations/{}/dependabot/repository-access", super::GITHUB_BASE_API_URL, org);
3360
3361        if let Some(params) = query_params {
3362            request_uri.push_str("?");
3363            let qp: DependabotRepositoryAccessForOrgParams = params.into();
3364            request_uri.push_str(&serde_urlencoded::to_string(qp)?);
3365        }
3366
3367        let req = GitHubRequest {
3368            uri: request_uri,
3369            body: None,
3370            method: "GET",
3371            headers: vec![]
3372        };
3373
3374        let request = self.client.build(req)?;
3375
3376        // --
3377
3378        let github_response = self.client.fetch(request)?;
3379
3380        // --
3381
3382        if github_response.is_success() {
3383            Ok(github_response.to_json()?)
3384        } else {
3385            match github_response.status_code() {
3386                403 => Err(DependabotRepositoryAccessForOrgError::Status403(github_response.to_json()?).into()),
3387                404 => Err(DependabotRepositoryAccessForOrgError::Status404(github_response.to_json()?).into()),
3388                code => Err(DependabotRepositoryAccessForOrgError::Generic { code }.into()),
3389            }
3390        }
3391    }
3392
3393    /// ---
3394    ///
3395    /// # Set the default repository access level for Dependabot
3396    ///
3397    /// Sets the default level of repository access Dependabot will have while performing an update.  Available values are:
3398    /// - 'public' - Dependabot will only have access to public repositories, unless access is explicitly granted to non-public repositories.
3399    /// - 'internal' - Dependabot will only have access to public and internal repositories, unless access is explicitly granted to private repositories.
3400    /// 
3401    /// Unauthorized users will not see the existence of this endpoint.
3402    /// 
3403    /// This operation supports both server-to-server and user-to-server access.
3404    ///
3405    /// [GitHub API docs for set_repository_access_default_level](https://docs.github.com/rest/dependabot/repository-access#set-the-default-repository-access-level-for-dependabot)
3406    ///
3407    /// ---
3408    pub async fn set_repository_access_default_level_async(&self, org: &str, body: PutDependabotSetRepositoryAccessDefaultLevel) -> Result<(), AdapterError> {
3409
3410        let request_uri = format!("{}/organizations/{}/dependabot/repository-access/default-level", super::GITHUB_BASE_API_URL, org);
3411
3412
3413        let req = GitHubRequest {
3414            uri: request_uri,
3415            body: Some(C::from_json::<PutDependabotSetRepositoryAccessDefaultLevel>(body)?),
3416            method: "PUT",
3417            headers: vec![]
3418        };
3419
3420        let request = self.client.build(req)?;
3421
3422        // --
3423
3424        let github_response = self.client.fetch_async(request).await?;
3425
3426        // --
3427
3428        if github_response.is_success() {
3429            Ok(())
3430        } else {
3431            match github_response.status_code() {
3432                403 => Err(DependabotSetRepositoryAccessDefaultLevelError::Status403(github_response.to_json_async().await?).into()),
3433                404 => Err(DependabotSetRepositoryAccessDefaultLevelError::Status404(github_response.to_json_async().await?).into()),
3434                code => Err(DependabotSetRepositoryAccessDefaultLevelError::Generic { code }.into()),
3435            }
3436        }
3437    }
3438
3439    /// ---
3440    ///
3441    /// # Set the default repository access level for Dependabot
3442    ///
3443    /// Sets the default level of repository access Dependabot will have while performing an update.  Available values are:
3444    /// - 'public' - Dependabot will only have access to public repositories, unless access is explicitly granted to non-public repositories.
3445    /// - 'internal' - Dependabot will only have access to public and internal repositories, unless access is explicitly granted to private repositories.
3446    /// 
3447    /// Unauthorized users will not see the existence of this endpoint.
3448    /// 
3449    /// This operation supports both server-to-server and user-to-server access.
3450    ///
3451    /// [GitHub API docs for set_repository_access_default_level](https://docs.github.com/rest/dependabot/repository-access#set-the-default-repository-access-level-for-dependabot)
3452    ///
3453    /// ---
3454    #[cfg(not(target_arch = "wasm32"))]
3455    pub fn set_repository_access_default_level(&self, org: &str, body: PutDependabotSetRepositoryAccessDefaultLevel) -> Result<(), AdapterError> {
3456
3457        let request_uri = format!("{}/organizations/{}/dependabot/repository-access/default-level", super::GITHUB_BASE_API_URL, org);
3458
3459
3460        let req = GitHubRequest {
3461            uri: request_uri,
3462            body: Some(C::from_json::<PutDependabotSetRepositoryAccessDefaultLevel>(body)?),
3463            method: "PUT",
3464            headers: vec![]
3465        };
3466
3467        let request = self.client.build(req)?;
3468
3469        // --
3470
3471        let github_response = self.client.fetch(request)?;
3472
3473        // --
3474
3475        if github_response.is_success() {
3476            Ok(())
3477        } else {
3478            match github_response.status_code() {
3479                403 => Err(DependabotSetRepositoryAccessDefaultLevelError::Status403(github_response.to_json()?).into()),
3480                404 => Err(DependabotSetRepositoryAccessDefaultLevelError::Status404(github_response.to_json()?).into()),
3481                code => Err(DependabotSetRepositoryAccessDefaultLevelError::Generic { code }.into()),
3482            }
3483        }
3484    }
3485
3486    /// ---
3487    ///
3488    /// # Set selected repositories for an organization secret
3489    ///
3490    /// Replaces all repositories for an organization secret when the `visibility`
3491    /// for repository access is set to `selected`. The visibility is set when you [Create
3492    /// or update an organization secret](https://docs.github.com/rest/dependabot/secrets#create-or-update-an-organization-secret).
3493    /// 
3494    /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
3495    ///
3496    /// [GitHub API docs for set_selected_repos_for_org_secret](https://docs.github.com/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret)
3497    ///
3498    /// ---
3499    pub async fn set_selected_repos_for_org_secret_async(&self, org: &str, secret_name: &str, body: PutDependabotSetSelectedReposForOrgSecret) -> Result<(), AdapterError> {
3500
3501        let request_uri = format!("{}/orgs/{}/dependabot/secrets/{}/repositories", super::GITHUB_BASE_API_URL, org, secret_name);
3502
3503
3504        let req = GitHubRequest {
3505            uri: request_uri,
3506            body: Some(C::from_json::<PutDependabotSetSelectedReposForOrgSecret>(body)?),
3507            method: "PUT",
3508            headers: vec![]
3509        };
3510
3511        let request = self.client.build(req)?;
3512
3513        // --
3514
3515        let github_response = self.client.fetch_async(request).await?;
3516
3517        // --
3518
3519        if github_response.is_success() {
3520            Ok(())
3521        } else {
3522            match github_response.status_code() {
3523                code => Err(DependabotSetSelectedReposForOrgSecretError::Generic { code }.into()),
3524            }
3525        }
3526    }
3527
3528    /// ---
3529    ///
3530    /// # Set selected repositories for an organization secret
3531    ///
3532    /// Replaces all repositories for an organization secret when the `visibility`
3533    /// for repository access is set to `selected`. The visibility is set when you [Create
3534    /// or update an organization secret](https://docs.github.com/rest/dependabot/secrets#create-or-update-an-organization-secret).
3535    /// 
3536    /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
3537    ///
3538    /// [GitHub API docs for set_selected_repos_for_org_secret](https://docs.github.com/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret)
3539    ///
3540    /// ---
3541    #[cfg(not(target_arch = "wasm32"))]
3542    pub fn set_selected_repos_for_org_secret(&self, org: &str, secret_name: &str, body: PutDependabotSetSelectedReposForOrgSecret) -> Result<(), AdapterError> {
3543
3544        let request_uri = format!("{}/orgs/{}/dependabot/secrets/{}/repositories", super::GITHUB_BASE_API_URL, org, secret_name);
3545
3546
3547        let req = GitHubRequest {
3548            uri: request_uri,
3549            body: Some(C::from_json::<PutDependabotSetSelectedReposForOrgSecret>(body)?),
3550            method: "PUT",
3551            headers: vec![]
3552        };
3553
3554        let request = self.client.build(req)?;
3555
3556        // --
3557
3558        let github_response = self.client.fetch(request)?;
3559
3560        // --
3561
3562        if github_response.is_success() {
3563            Ok(())
3564        } else {
3565            match github_response.status_code() {
3566                code => Err(DependabotSetSelectedReposForOrgSecretError::Generic { code }.into()),
3567            }
3568        }
3569    }
3570
3571    /// ---
3572    ///
3573    /// # Update a Dependabot alert
3574    ///
3575    /// The authenticated user must have access to security alerts for the repository to use this endpoint. For more information, see "[Granting access to security alerts](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-security-and-analysis-settings-for-your-repository#granting-access-to-security-alerts)."
3576    /// 
3577    /// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead.
3578    ///
3579    /// [GitHub API docs for update_alert](https://docs.github.com/rest/dependabot/alerts#update-a-dependabot-alert)
3580    ///
3581    /// ---
3582    pub async fn update_alert_async(&self, owner: &str, repo: &str, alert_number: AlertNumber, body: PatchDependabotUpdateAlert) -> Result<DependabotAlert, AdapterError> {
3583
3584        let request_uri = format!("{}/repos/{}/{}/dependabot/alerts/{}", super::GITHUB_BASE_API_URL, owner, repo, alert_number);
3585
3586
3587        let req = GitHubRequest {
3588            uri: request_uri,
3589            body: Some(C::from_json::<PatchDependabotUpdateAlert>(body)?),
3590            method: "PATCH",
3591            headers: vec![]
3592        };
3593
3594        let request = self.client.build(req)?;
3595
3596        // --
3597
3598        let github_response = self.client.fetch_async(request).await?;
3599
3600        // --
3601
3602        if github_response.is_success() {
3603            Ok(github_response.to_json_async().await?)
3604        } else {
3605            match github_response.status_code() {
3606                400 => Err(DependabotUpdateAlertError::Status400(github_response.to_json_async().await?).into()),
3607                403 => Err(DependabotUpdateAlertError::Status403(github_response.to_json_async().await?).into()),
3608                404 => Err(DependabotUpdateAlertError::Status404(github_response.to_json_async().await?).into()),
3609                409 => Err(DependabotUpdateAlertError::Status409(github_response.to_json_async().await?).into()),
3610                422 => Err(DependabotUpdateAlertError::Status422(github_response.to_json_async().await?).into()),
3611                code => Err(DependabotUpdateAlertError::Generic { code }.into()),
3612            }
3613        }
3614    }
3615
3616    /// ---
3617    ///
3618    /// # Update a Dependabot alert
3619    ///
3620    /// The authenticated user must have access to security alerts for the repository to use this endpoint. For more information, see "[Granting access to security alerts](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-security-and-analysis-settings-for-your-repository#granting-access-to-security-alerts)."
3621    /// 
3622    /// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead.
3623    ///
3624    /// [GitHub API docs for update_alert](https://docs.github.com/rest/dependabot/alerts#update-a-dependabot-alert)
3625    ///
3626    /// ---
3627    #[cfg(not(target_arch = "wasm32"))]
3628    pub fn update_alert(&self, owner: &str, repo: &str, alert_number: AlertNumber, body: PatchDependabotUpdateAlert) -> Result<DependabotAlert, AdapterError> {
3629
3630        let request_uri = format!("{}/repos/{}/{}/dependabot/alerts/{}", super::GITHUB_BASE_API_URL, owner, repo, alert_number);
3631
3632
3633        let req = GitHubRequest {
3634            uri: request_uri,
3635            body: Some(C::from_json::<PatchDependabotUpdateAlert>(body)?),
3636            method: "PATCH",
3637            headers: vec![]
3638        };
3639
3640        let request = self.client.build(req)?;
3641
3642        // --
3643
3644        let github_response = self.client.fetch(request)?;
3645
3646        // --
3647
3648        if github_response.is_success() {
3649            Ok(github_response.to_json()?)
3650        } else {
3651            match github_response.status_code() {
3652                400 => Err(DependabotUpdateAlertError::Status400(github_response.to_json()?).into()),
3653                403 => Err(DependabotUpdateAlertError::Status403(github_response.to_json()?).into()),
3654                404 => Err(DependabotUpdateAlertError::Status404(github_response.to_json()?).into()),
3655                409 => Err(DependabotUpdateAlertError::Status409(github_response.to_json()?).into()),
3656                422 => Err(DependabotUpdateAlertError::Status422(github_response.to_json()?).into()),
3657                code => Err(DependabotUpdateAlertError::Generic { code }.into()),
3658            }
3659        }
3660    }
3661
3662    /// ---
3663    ///
3664    /// # Updates Dependabot&#x27;s repository access list for an organization
3665    ///
3666    /// Updates repositories according to the list of repositories that organization admins have given Dependabot access to when they've updated dependencies.
3667    /// 
3668    /// > [!NOTE]
3669    /// >    This operation supports both server-to-server and user-to-server access.
3670    /// Unauthorized users will not see the existence of this endpoint.
3671    /// 
3672    /// **Example request body:**
3673    /// ```json,nocompile
3674    /// {
3675    ///   "repository_ids_to_add": [123, 456],
3676    ///   "repository_ids_to_remove": [789]
3677    /// }
3678    /// ```
3679    ///
3680    /// [GitHub API docs for update_repository_access_for_org](https://docs.github.com/rest/dependabot/repository-access#updates-dependabots-repository-access-list-for-an-organization)
3681    ///
3682    /// ---
3683    pub async fn update_repository_access_for_org_async(&self, org: &str, body: PatchDependabotUpdateRepositoryAccessForOrg) -> Result<(), AdapterError> {
3684
3685        let request_uri = format!("{}/organizations/{}/dependabot/repository-access", super::GITHUB_BASE_API_URL, org);
3686
3687
3688        let req = GitHubRequest {
3689            uri: request_uri,
3690            body: Some(C::from_json::<PatchDependabotUpdateRepositoryAccessForOrg>(body)?),
3691            method: "PATCH",
3692            headers: vec![]
3693        };
3694
3695        let request = self.client.build(req)?;
3696
3697        // --
3698
3699        let github_response = self.client.fetch_async(request).await?;
3700
3701        // --
3702
3703        if github_response.is_success() {
3704            Ok(())
3705        } else {
3706            match github_response.status_code() {
3707                403 => Err(DependabotUpdateRepositoryAccessForOrgError::Status403(github_response.to_json_async().await?).into()),
3708                404 => Err(DependabotUpdateRepositoryAccessForOrgError::Status404(github_response.to_json_async().await?).into()),
3709                code => Err(DependabotUpdateRepositoryAccessForOrgError::Generic { code }.into()),
3710            }
3711        }
3712    }
3713
3714    /// ---
3715    ///
3716    /// # Updates Dependabot&#x27;s repository access list for an organization
3717    ///
3718    /// Updates repositories according to the list of repositories that organization admins have given Dependabot access to when they've updated dependencies.
3719    /// 
3720    /// > [!NOTE]
3721    /// >    This operation supports both server-to-server and user-to-server access.
3722    /// Unauthorized users will not see the existence of this endpoint.
3723    /// 
3724    /// **Example request body:**
3725    /// ```json,nocompile
3726    /// {
3727    ///   "repository_ids_to_add": [123, 456],
3728    ///   "repository_ids_to_remove": [789]
3729    /// }
3730    /// ```
3731    ///
3732    /// [GitHub API docs for update_repository_access_for_org](https://docs.github.com/rest/dependabot/repository-access#updates-dependabots-repository-access-list-for-an-organization)
3733    ///
3734    /// ---
3735    #[cfg(not(target_arch = "wasm32"))]
3736    pub fn update_repository_access_for_org(&self, org: &str, body: PatchDependabotUpdateRepositoryAccessForOrg) -> Result<(), AdapterError> {
3737
3738        let request_uri = format!("{}/organizations/{}/dependabot/repository-access", super::GITHUB_BASE_API_URL, org);
3739
3740
3741        let req = GitHubRequest {
3742            uri: request_uri,
3743            body: Some(C::from_json::<PatchDependabotUpdateRepositoryAccessForOrg>(body)?),
3744            method: "PATCH",
3745            headers: vec![]
3746        };
3747
3748        let request = self.client.build(req)?;
3749
3750        // --
3751
3752        let github_response = self.client.fetch(request)?;
3753
3754        // --
3755
3756        if github_response.is_success() {
3757            Ok(())
3758        } else {
3759            match github_response.status_code() {
3760                403 => Err(DependabotUpdateRepositoryAccessForOrgError::Status403(github_response.to_json()?).into()),
3761                404 => Err(DependabotUpdateRepositoryAccessForOrgError::Status404(github_response.to_json()?).into()),
3762                code => Err(DependabotUpdateRepositoryAccessForOrgError::Generic { code }.into()),
3763            }
3764        }
3765    }
3766
3767}