pub struct CodebergClient(/* private fields */);
Implementations§
Source§impl CodebergClient
impl CodebergClient
pub async fn patch_body<B, T>(&self, api_endpoint: Url, body: B) -> Result<T>
Source§impl CodebergClient
impl CodebergClient
pub async fn post_body<B: Serialize, T: DeserializeOwned + Debug>( &self, api_endpoint: Url, body: B, ) -> Result<T>
pub async fn post_query_body<Q: Serialize, B: Serialize, T: DeserializeOwned + Debug>( &self, api_endpoint: Url, body: B, query: Q, ) -> Result<T>
Source§impl CodebergClient
impl CodebergClient
pub async fn get_user_info(&self) -> Result<User>
pub async fn get_all_repos_info(&self) -> Result<Vec<Repository>>
pub async fn get_repo_info(&self) -> Result<Repository>
pub async fn get_repo_labels( &self, maybe_limit: Option<usize>, ) -> Result<Vec<Label>>
pub async fn get_state_limit_list<T>(
&self,
maybe_state: Option<StateType>,
maybe_limit: Option<usize>,
api: Url,
) -> Result<T>where
T: DeserializeOwned + Debug,
pub async fn get_repo_milestones( &self, maybe_state: Option<StateType>, maybe_limit: Option<usize>, ) -> Result<Vec<Milestone>>
pub async fn get_repo_issues( &self, maybe_state: Option<StateType>, maybe_limit: Option<usize>, ) -> Result<Vec<Issue>>
pub async fn get_repo_prs( &self, maybe_state: Option<StateType>, maybe_limit: Option<usize>, ) -> Result<Vec<PullRequest>>
pub async fn get_repo_assignees(&self) -> Result<Vec<User>>
pub async fn search_for_user( &self, username: &str, ) -> Result<SearchResults<Vec<User>>>
pub async fn search_for_repo( &self, reponame: &str, user_id: usize, ) -> Result<SearchResults<Vec<Repository>>>
pub async fn fork_repo( &self, ownername: &str, reponame: &str, ) -> Result<Repository>
pub async fn get_comments_for_id( &self, issue_or_pr_id: usize, ) -> Result<Vec<Comment>>
pub async fn post_comment_for_id( &self, issue_id: usize, comment: CreateCommentOption, ) -> Result<Comment>
pub async fn delete_label(&self, label_id: usize) -> Result<()>
pub async fn get_repo_branches(&self) -> Result<Vec<Branch>>
pub async fn get_user_repos(&self, username: String) -> Result<Vec<Repository>>
pub async fn get_org_repos(&self, orgname: String) -> Result<Vec<Repository>>
pub async fn get_user_or_org_repos( &self, name: String, ) -> Result<Vec<Repository>>
pub async fn replace_labels( &self, issue_id: usize, issue_labels_option: IssueLabelsOption, ) -> Result<Vec<Label>>
pub async fn get_all_notifications_unfiltered( &self, all: bool, ) -> Result<Vec<NotificationThread>>
pub async fn get_all_notifications_filtered( &self, all: bool, since: Option<DateTime<Utc>>, before: Option<DateTime<Utc>>, status_types: Vec<NotificationStateType>, subject_type: Option<NotificationSubjectType>, page: usize, limit: usize, ) -> Result<Vec<NotificationThread>>
pub async fn get_notification_thread( &self, thread_id: usize, ) -> Result<NotificationThread>
Methods from Deref<Target = Client>§
Sourcepub fn get<U>(&self, url: U) -> RequestBuilderwhere
U: IntoUrl,
pub fn get<U>(&self, url: U) -> RequestBuilderwhere
U: IntoUrl,
Convenience method to make a GET
request to a URL.
§Errors
This method fails whenever the supplied Url
cannot be parsed.
Sourcepub fn post<U>(&self, url: U) -> RequestBuilderwhere
U: IntoUrl,
pub fn post<U>(&self, url: U) -> RequestBuilderwhere
U: IntoUrl,
Convenience method to make a POST
request to a URL.
§Errors
This method fails whenever the supplied Url
cannot be parsed.
Sourcepub fn put<U>(&self, url: U) -> RequestBuilderwhere
U: IntoUrl,
pub fn put<U>(&self, url: U) -> RequestBuilderwhere
U: IntoUrl,
Convenience method to make a PUT
request to a URL.
§Errors
This method fails whenever the supplied Url
cannot be parsed.
Sourcepub fn patch<U>(&self, url: U) -> RequestBuilderwhere
U: IntoUrl,
pub fn patch<U>(&self, url: U) -> RequestBuilderwhere
U: IntoUrl,
Convenience method to make a PATCH
request to a URL.
§Errors
This method fails whenever the supplied Url
cannot be parsed.
Sourcepub fn delete<U>(&self, url: U) -> RequestBuilderwhere
U: IntoUrl,
pub fn delete<U>(&self, url: U) -> RequestBuilderwhere
U: IntoUrl,
Convenience method to make a DELETE
request to a URL.
§Errors
This method fails whenever the supplied Url
cannot be parsed.
Sourcepub fn head<U>(&self, url: U) -> RequestBuilderwhere
U: IntoUrl,
pub fn head<U>(&self, url: U) -> RequestBuilderwhere
U: IntoUrl,
Convenience method to make a HEAD
request to a URL.
§Errors
This method fails whenever the supplied Url
cannot be parsed.
Sourcepub fn request<U>(&self, method: Method, url: U) -> RequestBuilderwhere
U: IntoUrl,
pub fn request<U>(&self, method: Method, url: U) -> RequestBuilderwhere
U: IntoUrl,
Start building a Request
with the Method
and Url
.
Returns a RequestBuilder
, which will allow setting headers and
the request body before sending.
§Errors
This method fails whenever the supplied Url
cannot be parsed.
Sourcepub fn execute(
&self,
request: Request,
) -> impl Future<Output = Result<Response, Error>>
pub fn execute( &self, request: Request, ) -> impl Future<Output = Result<Response, Error>>
Executes a Request
.
A Request
can be built manually with Request::new()
or obtained
from a RequestBuilder with RequestBuilder::build()
.
You should prefer to use the RequestBuilder
and
RequestBuilder::send()
.
§Errors
This method fails if there was an error while sending request, redirect loop was detected or redirect limit was exhausted.
Trait Implementations§
Source§impl Clone for CodebergClient
impl Clone for CodebergClient
Source§fn clone(&self) -> CodebergClient
fn clone(&self) -> CodebergClient
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more