pub struct Pulls { /* private fields */ }
Implementations§
Source§impl Pulls
impl Pulls
Sourcepub fn create(
&self,
head: impl ToString,
base: impl ToString,
title: impl ToString,
) -> CreatePullRequestBuilder
pub fn create( &self, head: impl ToString, base: impl ToString, title: impl ToString, ) -> CreatePullRequestBuilder
Create a Pull Request in a repository.
§Example
let client = Client::new(
"https://gitea.example.com",
Auth::Token("your-token")
);
let pr = client
.pulls("owner", "repo")
.create("my-branch", "main", "My PR")
.body("This is my PR")
.send(&client)
.await
.unwrap();
This will create a pull request with the title “My PR” and body “This is my PR” from the branch “my-branch” to the branch “main” in the repository “owner/repo”.
Sourcepub fn edit(&self, id: i64) -> EditPullRequestBuilder
pub fn edit(&self, id: i64) -> EditPullRequestBuilder
Edit a Pull Request in a repository.
§Example
let client = Client::new(
"https://gitea.example.com",
Auth::Token("your-token")
);
client
.pulls("owner", "repo")
.edit(1)
.title("My PR")
.body("This is my PR")
.send(&client)
.await
.unwrap();
This will edit the pull request with the ID 1 in the repository “owner/repo” to have the title “My PR” and body “This is my PR”.
Sourcepub fn get_by_branches(
&self,
head: impl ToString,
base: impl ToString,
) -> GetPullRequestByBranchesBuilder
pub fn get_by_branches( &self, head: impl ToString, base: impl ToString, ) -> GetPullRequestByBranchesBuilder
Get a Pull Request by its head and base branches.
§Example
let client = Client::new(
"https://gitea.example.com",
Auth::Token("your-token")
);
let pr = client
.pulls("owner", "repo")
.get_by_branches("my-branch", "main")
.send(&client)
.await
.unwrap();
This will get the pull request from the branch “my-branch” to the branch “main” in the repository “owner/repo”.
Sourcepub fn get(&self, id: i64) -> GetPullRequestByIdBuilder
pub fn get(&self, id: i64) -> GetPullRequestByIdBuilder
Get a Pull Request by its ID.
§Example
let client = Client::new(
"https://gitea.example.com",
Auth::Token("your-token")
);
let pr = client
.pulls("owner", "repo")
.get(1)
.send(&client)
.await
.unwrap();
This will get the pull request with the ID 1 in the repository “owner/repo”.
Sourcepub fn list(&self) -> ListPullRequestsBuilder
pub fn list(&self) -> ListPullRequestsBuilder
List a repository’s Pull Requests.
§Example
let client = Client::new(
"https://gitea.example.com",
Auth::Token("your-token")
);
let issues = client
.pulls("owner", "repo")
.list()
.state(State::Open)
.send(&client)
.await
.unwrap();
This will get all open issues in the repository “owner/repo”.
Sourcepub fn pinned(&self) -> PinnedPullRequestsBuilder
pub fn pinned(&self) -> PinnedPullRequestsBuilder
Get a list of pinned Pull Requests in a repository.
§Example
let client = Client::new(
"https://gitea.example.com",
Auth::Token("your-token")
);
let pinned_prs = client
.pulls("owner", "repo")
.pinned()
.send(&client)
.await
.unwrap();
This will get all pinned pull requests in the repository “owner/repo”.