1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
pub mod issues;
pub mod repos;
pub mod users;

pub struct Search;

impl Search {
    /// Searches for repositories based on the given search options.
    /// All fields in the [SearchRepositoriesOption] are optional.
    /// This method will return a list of repositories that match the search criteria.
    ///
    /// # Example
    /// ```
    /// # use gitea_sdk::{Client, Auth};
    /// # async fn search_repos() {
    /// let client = Client::new(
    ///     "https://gitea.example.com",
    ///     Auth::Token("your-token")
    /// );
    /// let repo = client
    ///     .search()
    ///     .repos()
    ///     .query("my-repo")
    ///     .send(&client)
    ///     .await
    ///     .unwrap();
    /// # }
    /// ```
    /// This will search for repositories matching the keyword "my-repo".
    /// The search will include the repository description and will return the first page of
    /// result.
    pub fn repos(&self) -> repos::SearchRepositoriesBuilder {
        repos::SearchRepositoriesBuilder::new()
    }

    /// Searches for users based on the given search options.
    /// This method will return a list of users that match the search criteria.
    ///
    /// # Example
    /// ```
    /// # use gitea_sdk::{Client, Auth};
    /// # async fn search_users() {
    /// let client = Client::new(
    ///    "https://gitea.example.com",
    ///    Auth::Token("your-token")
    /// );
    /// let users = client
    ///    .search()
    ///    .users()
    ///    .query("my-user")
    ///    .send(&client)
    ///    .await
    ///    .unwrap();
    /// # }
    /// ```
    pub fn users(&self) -> users::SearchUsersBuilder {
        users::SearchUsersBuilder::new()
    }

    /// Searches for issues based on the given search options.
    /// This method will return a list of issues that match the search criteria.
    ///
    /// # Example
    /// ```
    /// # use gitea_sdk::{Client, Auth};
    /// # async fn search_issues() {
    /// let client = Client::new(
    ///   "https://gitea.example.com",
    ///   Auth::Token("your-token")
    /// );
    /// let issues = client
    ///     .search()
    ///     .issues()
    ///     .query("my-issue")
    ///     .send(&client)
    ///     .await
    ///     .unwrap();
    /// # }
    /// ```
    /// This will search for issues matching the keyword "my-issue".
    pub fn issues(&self) -> issues::SearchIssuesBuilder {
        issues::SearchIssuesBuilder::new()
    }
}