pub struct RestClient { /* private fields */ }Expand description
A wrapper struct around a REST API client.
Underneath, the client may support various Git servers and CI platforms. Currently, the client supports GitHub and GitHub Actions.
Implementations§
Source§impl RestClient
impl RestClient
Sourcepub fn new() -> Result<Self, ClientError>
pub fn new() -> Result<Self, ClientError>
Initializes the REST API client and sets the UserAgent header.
See git_bot_feedback::client::init_client for details on possible errors during initialization.
Sourcepub fn client_kind(&self) -> String
pub fn client_kind(&self) -> String
Returns the kind of client being used.
Supported options include “local”, “github” and “gitea”.
Sourcepub async fn get_list_of_changed_files(
&self,
file_filter: &FileFilter,
lines_changed_only: &LinesChangedOnly,
base_diff: &Option<String>,
ignore_index: bool,
) -> Result<Vec<FileObj>, ClientError>
pub async fn get_list_of_changed_files( &self, file_filter: &FileFilter, lines_changed_only: &LinesChangedOnly, base_diff: &Option<String>, ignore_index: bool, ) -> Result<Vec<FileObj>, ClientError>
Gets a list of changed files.
Use the FileFilter and LinesChangedOnly to filter out files
that might be negligible.
Sourcepub fn is_debug_enabled(&self) -> bool
pub fn is_debug_enabled(&self) -> bool
Should debug logs be enabled?
Sourcepub fn start_log_group(&self, name: &str)
pub fn start_log_group(&self, name: &str)
Start a log group with the given name.
Sourcepub fn end_log_group(&self, name: &str)
pub fn end_log_group(&self, name: &str)
End a log group with the given name.
Sourcepub async fn post_feedback(
&mut self,
files: &[Arc<Mutex<FileObj>>],
feedback_inputs: FeedbackInput,
clang_versions: ClangVersions,
) -> Result<u64, ClientError>
pub async fn post_feedback( &mut self, files: &[Arc<Mutex<FileObj>>], feedback_inputs: FeedbackInput, clang_versions: ClangVersions, ) -> Result<u64, ClientError>
Post various forms of feedback.
Use FeedbackInput to configure feedback behavior.
The given ClangVersions is used in thread comments, step summaries, and PR reviews’ summary comment.
Sourcepub fn make_annotations(
files: &[Arc<Mutex<FileObj>>],
style: &str,
) -> Result<Vec<FileAnnotation>, ClientError>
pub fn make_annotations( files: &[Arc<Mutex<FileObj>>], style: &str, ) -> Result<Vec<FileAnnotation>, ClientError>
Post file annotations.