pub struct Issues { /* private fields */ }
Implementations§
Source§impl Issues
impl Issues
Sourcepub fn create(&self, title: impl ToString) -> CreateIssueBuilder
pub fn create(&self, title: impl ToString) -> CreateIssueBuilder
Create an issue.
If using deadline only the date will be taken into account, and time of day ignored.
The only required field in the [CreateIssueOption] is title
. All other fields are
optional.
This method will return the created issue.
§Example
let client = Client::new(
"https://gitea.example.com",
Auth::Token("your-token")
);
let issue = client
.issues("owner", "repo")
.create("my-new-issue")
.send(&client)
.await
.unwrap();
This will create a new issue with the title “my-new-issue” in the repository “owner/repo”.
Sourcepub fn delete(&self, issue_number: i64) -> DeleteIssueBuilder
pub fn delete(&self, issue_number: i64) -> DeleteIssueBuilder
Delete an issue. This will delete the issue with the given issue number. WARNING: This is irreversible and will not ask for confirmation. Use with caution.
This method will return a 204 status code if the issue was successfully deleted. If the issue does not exist, this method will return a 404 status code. If the user is not authorized to delete the issue, this method will return a 403 status code.
§Example
let client = Client::new(
"https://gitea.example.com",
Auth::Token("your-token")
);
client
.issues("owner", "repo")
.delete(1)
.send(&client)
.await
.unwrap();
This will delete the issue #1 in the repository “owner/repo”.
Sourcepub fn get(&self, issue_number: i64) -> GetIssueBuilder
pub fn get(&self, issue_number: i64) -> GetIssueBuilder
Get an issue. This will return the issue with the given issue number.
§Example
let client = Client::new(
"https://gitea.example.com",
Auth::Token("your-token")
);
let issue = client
.issues("owner", "repo")
.get(1)
.send(&client)
.await
.unwrap();
This will get the issue #1 in the repository “owner/repo”.
Sourcepub fn edit(&self, issue_number: i64) -> EditIssueBuilder
pub fn edit(&self, issue_number: i64) -> EditIssueBuilder
Edit an issue.
§Example
let client = Client::new(
"https://gitea.example.com",
Auth::Token("your-token")
);
client
.issues("owner", "repo")
.edit(1)
.title("new-title")
.send(&client)
.await
.unwrap();
Sourcepub fn list(&self) -> ListIssuesBuilder
pub fn list(&self) -> ListIssuesBuilder
List a repository’s issues. The [GetIssuesOption] struct provides a number of optional fields to filter the results, but all fields are entirely optional. If you don’t set any fields, you will get the most recent issues for the repository.
§Example
let client = Client::new(
"https://gitea.example.com",
Auth::Token("your-token")
);
let issues = client
.issues("owner", "repo")
.list()
.state(State::Open)
.send(&client)
.await
.unwrap();
This will get all open issues in the repository “owner/repo”.