Skip to main content

Client

Struct Client 

Source
pub struct Client { /* private fields */ }
Expand description

HTTP клиент для GitVerse API

Implementations§

Source§

impl Client

Source

pub fn new(config: ClientConfig) -> Result<Self, Error>

Создаёт новый клиент GitVerse API

Source

pub fn set_token(&mut self, token: impl Into<String>)

Устанавливает токен авторизации

Source§

impl Client

Source

pub async fn list_org_runners( &self, org: &str, opts: Option<&QueryOptions>, ) -> Result<ActionRunners, Error>

Returns a list of self-hosted runners for an organization

Source

pub async fn create_org_runner_registration_token( &self, org: &str, ) -> Result<RegistrationToken, Error>

Creates a registration token for an organization runner

Source

pub async fn get_org_runner( &self, org: &str, runner_id: f64, ) -> Result<ActionRunner, Error>

Gets a specific self-hosted runner for an organization

Source

pub async fn delete_org_runner( &self, org: &str, runner_id: f64, ) -> Result<(), Error>

Deletes a specific self-hosted runner from the organization

Source

pub async fn list_org_variables( &self, org: &str, opts: Option<&QueryOptions>, ) -> Result<VariableList, Error>

List organization variables

Source

pub async fn create_org_variable( &self, org: &str, params: &CreateVariableParams, ) -> Result<(), Error>

Create an organization variable

Source

pub async fn get_org_variable( &self, org: &str, name: &str, ) -> Result<Variable, Error>

Get an organization variable

Source

pub async fn update_org_variable( &self, org: &str, name: &str, params: &CreateVariableParams, ) -> Result<(), Error>

Update an organization variable

Source

pub async fn delete_org_variable( &self, org: &str, name: &str, ) -> Result<(), Error>

Delete an organization variable

Source

pub async fn list_artifacts( &self, owner: &str, repo: &str, opts: Option<&QueryOptions>, ) -> Result<ActionArtifactList, Error>

Returns a list of artifacts in the repository

Source

pub async fn get_artifact( &self, owner: &str, repo: &str, artifact_id: &str, ) -> Result<ActionArtifact, Error>

Returns a specific artifact from the repository

Source

pub async fn delete_artifact( &self, owner: &str, repo: &str, artifact_id: &str, ) -> Result<(), Error>

Deletes a specific artifact

Source

pub async fn download_artifact( &self, owner: &str, repo: &str, artifact_id: &str, ) -> Result<(), Error>

Downloads a specific artifact as a ZIP archive

Source

pub async fn download_artifact_raw( &self, owner: &str, repo: &str, artifact_id: &str, ) -> Result<String, Error>

Downloads the artifact ZIP archive directly

Source

pub async fn get_workflow_job( &self, owner: &str, repo: &str, job_id: f64, ) -> Result<ActionRunJob, Error>

Get a workflow run job

Source

pub async fn get_workflow_job_logs( &self, owner: &str, repo: &str, job_id: f64, ) -> Result<(), Error>

Get workflow run job logs

Adds a link to an action run

Source

pub async fn list_repo_runners( &self, owner: &str, repo: &str, opts: Option<&QueryOptions>, ) -> Result<ActionRunners, Error>

Returns a list of runners for the repository

Source

pub async fn create_repo_runner_registration_token( &self, owner: &str, repo: &str, ) -> Result<RegistrationToken, Error>

Creates a registration token for a repository runner

Source

pub async fn get_repo_runner( &self, owner: &str, repo: &str, runner_id: f64, ) -> Result<ActionRunner, Error>

Gets a specific runner for a repository

Source

pub async fn delete_repo_runner( &self, owner: &str, repo: &str, runner_id: f64, ) -> Result<(), Error>

Deletes a specific self-hosted runner from the repository

Source

pub async fn list_workflow_runs( &self, owner: &str, repo: &str, opts: Option<&QueryOptions>, ) -> Result<RunsResponse, Error>

List workflow runs

Source

pub async fn get_workflow_run_by_index( &self, owner: &str, repo: &str, run_index: f64, ) -> Result<ActionRun, Error>

Get a workflow run by index

Source

pub async fn list_workflow_run_jobs_by_index( &self, owner: &str, repo: &str, run_index: f64, opts: Option<&QueryOptions>, ) -> Result<JobsResponse, Error>

List workflow run jobs by index

Source

pub async fn get_workflow_run( &self, owner: &str, repo: &str, run_id: f64, ) -> Result<ActionRun, Error>

Get a workflow run

Source

pub async fn list_workflow_run_jobs( &self, owner: &str, repo: &str, run_id: f64, opts: Option<&QueryOptions>, ) -> Result<JobsResponse, Error>

List workflow run jobs

Source

pub async fn list_repo_variables( &self, owner: &str, repo: &str, opts: Option<&QueryOptions>, ) -> Result<VariableList, Error>

List repository variables

Source

pub async fn create_repo_variable( &self, owner: &str, repo: &str, params: &CreateVariableParams, ) -> Result<(), Error>

Create a repository variable

Source

pub async fn get_repo_variable( &self, owner: &str, repo: &str, name: &str, ) -> Result<Variable, Error>

Get a repository variable

Source

pub async fn update_repo_variable( &self, owner: &str, repo: &str, name: &str, params: &CreateVariableParams, ) -> Result<(), Error>

Update a repository variable

Source

pub async fn delete_repo_variable( &self, owner: &str, repo: &str, name: &str, ) -> Result<(), Error>

Delete a repository variable

Source

pub async fn get_workflow_dispatch_inputs( &self, owner: &str, repo: &str, workflow: &str, opts: Option<&QueryOptions>, ) -> Result<WorkflowDispatchInputList, Error>

Get workflow_dispatch parameters

Source

pub async fn dispatch_workflow( &self, owner: &str, repo: &str, workflow: &str, params: &Value, _opts: Option<&QueryOptions>, ) -> Result<(), Error>

Trigger workflow_dispatch

Source§

impl Client

Source

pub async fn list_emails( &self, opts: Option<&QueryOptions>, ) -> Result<Vec<Email>, Error>

Get user email addresses

Source

pub async fn create_emails( &self, params: &CreateEmailParams, ) -> Result<Vec<Email>, Error>

Add email addresses

Source

pub async fn delete_emails( &self, params: &DeleteEmailParams, ) -> Result<(), Error>

Delete email addresses

Source§

impl Client

Source

pub async fn list_issues( &self, owner: &str, repo: &str, opts: Option<&QueryOptions>, ) -> Result<Vec<Issue>, Error>

List issues and pull requests

Source

pub async fn get_comment( &self, owner: &str, repo: &str, id: f64, ) -> Result<Comment, Error>

Get a specific issue comment

Source

pub async fn get_issues( &self, owner: &str, repo: &str, index: f64, ) -> Result<Issue, Error>

Get issue or pull request

Source

pub async fn list_comments( &self, owner: &str, repo: &str, index: f64, opts: Option<&QueryOptions>, ) -> Result<Vec<Comment>, Error>

List issue comments

Source

pub async fn create_comment( &self, owner: &str, repo: &str, index: f64, params: &CreateIssueCommentParams, ) -> Result<Comment, Error>

Create issue comment

Source

pub async fn update_comment( &self, owner: &str, repo: &str, index: f64, comment_id: f64, params: &UpdateIssueCommentParams, ) -> Result<(), Error>

Update issue comment

Source

pub async fn delete_comment( &self, owner: &str, repo: &str, index: f64, comment_id: f64, ) -> Result<(), Error>

Delete issue comment

Source

pub async fn create_comment_reaction( &self, owner: &str, repo: &str, index: f64, comment_id: f64, params: &CreateIssueCommentReactionParams, ) -> Result<Reaction, Error>

Create reaction to issue comment

Source

pub async fn delete_comment_reaction( &self, owner: &str, repo: &str, index: f64, comment_id: f64, reaction_id: f64, ) -> Result<(), Error>

Delete reaction from issue comment

Source

pub async fn list_labels( &self, owner: &str, repo: &str, index: f64, ) -> Result<Vec<Label>, Error>

List issue labels

Source

pub async fn list_timeline( &self, owner: &str, repo: &str, index: f64, opts: Option<&QueryOptions>, ) -> Result<Vec<TimelineComment>, Error>

List issue comments and timeline events

Source§

impl Client

Source

pub async fn list_org_secrets( &self, org: &str, opts: Option<&QueryOptions>, ) -> Result<SecretList, Error>

Gets a list of organization secrets

Source

pub async fn get_org_secret( &self, org: &str, secretname: &str, ) -> Result<Secret, Error>

Gets the metadata of a secret (without value) in an organization

Source

pub async fn create_or_update_org_secret( &self, org: &str, secretname: &str, _opts: Option<&QueryOptions>, ) -> Result<Secret, Error>

Creates or updates a secret in the organization

Source

pub async fn delete_org_secret( &self, org: &str, secretname: &str, ) -> Result<(), Error>

Removes a secret from an organization

Source

pub async fn is_member(&self, org: &str, username: &str) -> Result<(), Error>

Check organization membership for a user

Source

pub async fn list_org_repositories( &self, org: &str, opts: Option<&QueryOptions>, ) -> Result<Vec<Repository>, Error>

List organization repositories

Source

pub async fn create_repository( &self, org: &str, params: &CreateOrgRepositoryParams, ) -> Result<Repository, Error>

Create organization repository

Source§

impl Client

Source

pub async fn delete_org_package( &self, org: &str, package_type: &str, package_name: &str, ) -> Result<(), Error>

Delete package for organization

Source

pub async fn list_org_package_versions( &self, org: &str, package_type: &str, package_name: &str, opts: Option<&QueryOptions>, ) -> Result<Vec<PackageVersion>, Error>

Get package versions for organization

Source

pub async fn delete_org_package_version( &self, org: &str, package_type: &str, package_name: &str, package_version_id: &str, ) -> Result<(), Error>

Delete package version for organization

Source

pub async fn delete_user_package( &self, username: &str, package_type: &str, package_name: &str, ) -> Result<(), Error>

Delete package for user

Source

pub async fn list_user_package_versions( &self, username: &str, package_type: &str, package_name: &str, opts: Option<&QueryOptions>, ) -> Result<Vec<PackageVersion>, Error>

Get package versions for user

Source

pub async fn delete_user_package_version( &self, username: &str, package_type: &str, package_name: &str, package_version_id: &str, ) -> Result<(), Error>

Delete a package version for the authenticated user

Source§

impl Client

Source

pub async fn create_deployment( &self, owner: &str, repo: &str, params: &CreatePagesDeploymentParams, ) -> Result<PagesDeployment, Error>

Creates a deployment for GitVerse Pages

Source

pub async fn get_deployment_status( &self, owner: &str, repo: &str, pages_deployment_id: &str, ) -> Result<PagesDeploymentStatus, Error>

Gets the status of a GitVerse Pages deployment

Source§

impl Client

Source

pub async fn create( &self, owner: &str, repo: &str, params: &CreatePullRequestParams, ) -> Result<PullRequest, Error>

Create a pull request

Source

pub async fn list_commits_pull_requests( &self, owner: &str, repo: &str, pull_number: f64, opts: Option<&QueryOptions>, ) -> Result<Vec<Commit>, Error>

List pull request commits

Source

pub async fn list_files( &self, owner: &str, repo: &str, pull_number: f64, opts: Option<&QueryOptions>, ) -> Result<Vec<CommitFiles>, Error>

List pull request files

Source

pub async fn is_merged( &self, owner: &str, repo: &str, pull_number: f64, ) -> Result<(), Error>

Checks if a pull request has been merged into the base branch.

Source

pub async fn update_branch( &self, owner: &str, repo: &str, pull_number: f64, params: &UpdateBranchParams, ) -> Result<UpdateBranchResponse, Error>

Update a pull request branch

Source§

impl Client

Source

pub async fn list_releases( &self, owner: &str, repo: &str, opts: Option<&QueryOptions>, ) -> Result<Vec<Release>, Error>

Returns a list of releases

Source

pub async fn create_releases( &self, owner: &str, repo: &str, params: &CreateReleaseParams, ) -> Result<Release, Error>

Create a release

Source

pub async fn get_by_tag( &self, owner: &str, repo: &str, tag: &str, ) -> Result<Release, Error>

Gets a release by its tag name

Source

pub async fn delete_by_tag( &self, owner: &str, repo: &str, tag: &str, ) -> Result<(), Error>

Deletes a release by its tag name

Source

pub async fn get_releases( &self, owner: &str, repo: &str, release_id: &str, ) -> Result<Release, Error>

Return a release

Source

pub async fn update_releases( &self, owner: &str, repo: &str, release_id: &str, params: &UpdateReleaseParams, ) -> Result<Release, Error>

Edit a release

Source

pub async fn delete_releases( &self, owner: &str, repo: &str, release_id: &str, ) -> Result<(), Error>

Delete a release

Source

pub async fn list_assets( &self, owner: &str, repo: &str, release_id: &str, opts: Option<&QueryOptions>, ) -> Result<Vec<Attachment>, Error>

Returns a list of assets (files) for a release

Source

pub async fn upload_asset( &self, owner: &str, repo: &str, release_id: &str, _opts: Option<&QueryOptions>, ) -> Result<Attachment, Error>

Upload asset to release

Source

pub async fn delete_assets( &self, owner: &str, repo: &str, release_id: &str, asset_id: &str, ) -> Result<(), Error>

Delete asset from release

Source§

impl Client

Source

pub async fn get(&self, owner: &str, repo: &str) -> Result<Repository, Error>

Get repository details

Source

pub async fn update( &self, owner: &str, repo: &str, params: &UpdateRepositoryParams, ) -> Result<Repository, Error>

Update repository

Source

pub async fn delete(&self, owner: &str, repo: &str) -> Result<(), Error>

Delete repository

Source

pub async fn list_repo_secrets( &self, owner: &str, repo: &str, opts: Option<&QueryOptions>, ) -> Result<SecretList, Error>

Gets a list of repository secrets

Source

pub async fn get_repo_secret( &self, owner: &str, repo: &str, secretname: &str, ) -> Result<Secret, Error>

Gets secrets metadata (without values) in repositories.

Source

pub async fn create_or_update_repo_secret( &self, owner: &str, repo: &str, secretname: &str, _opts: Option<&QueryOptions>, ) -> Result<Secret, Error>

Creates or updates a secret in the repository

Source

pub async fn delete_repo_secret( &self, owner: &str, repo: &str, secretname: &str, ) -> Result<(), Error>

Removes a secret from the repository

Source

pub async fn list_branches( &self, owner: &str, repo: &str, opts: Option<&QueryOptions>, ) -> Result<Vec<Branch>, Error>

List repository branches

Source

pub async fn list_collaborators( &self, owner: &str, repo: &str, opts: Option<&QueryOptions>, ) -> Result<Vec<Collaborator>, Error>

List repository collaborators

Source

pub async fn add_collaborator( &self, owner: &str, repo: &str, collaborator: &str, params: &AddCollaboratorParams, ) -> Result<CollaboratorInvitation, Error>

Add or update repository collaborator

Source

pub async fn list_commits( &self, owner: &str, repo: &str, opts: Option<&QueryOptions>, ) -> Result<Vec<Commit>, Error>

Retrieve a list of repository commits

Source

pub async fn get_commit( &self, owner: &str, repo: &str, sha: &str, ) -> Result<Commit, Error>

Retrieve commit information

Source

pub async fn compare_commits( &self, owner: &str, repo: &str, basehead: &str, opts: Option<&QueryOptions>, ) -> Result<CompareResponse, Error>

Compare two branches/tags/commits

Source

pub async fn get_content( &self, owner: &str, repo: &str, filepath: &str, opts: Option<&QueryOptions>, ) -> Result<ContentsResponse, Error>

Get file or directory contents

Source

pub async fn create_or_update_file( &self, owner: &str, repo: &str, filepath: &str, params: &CreateFileParams, ) -> Result<FileCreationResponse, Error>

Create or update file in repository

Source

pub async fn delete_file( &self, owner: &str, repo: &str, filepath: &str, params: &DeleteFileParams, ) -> Result<FileDeleteResponse, Error>

Delete file in repository

Source

pub async fn create_fork( &self, owner: &str, repo: &str, params: &CreateForkParams, ) -> Result<Repository, Error>

Fork a repository

Source

pub async fn create_commit( &self, owner: &str, repo: &str, params: &CreateCommitParams, ) -> Result<Commit, Error>

Create a Git commit

Source

pub async fn list_matching_refs( &self, owner: &str, repo: &str, ref: &str, ) -> Result<Vec<Reference>, Error>

List matching references

Source

pub async fn get_ref( &self, owner: &str, repo: &str, ref: &str, ) -> Result<Reference, Error>

Get a Git reference

Source

pub async fn create_ref( &self, owner: &str, repo: &str, params: &CreateReferenceParams, ) -> Result<Reference, Error>

Create a Git reference

Source

pub async fn delete_ref( &self, owner: &str, repo: &str, ref: &str, ) -> Result<(), Error>

Deletes the provided reference

Source

pub async fn create_tree( &self, owner: &str, repo: &str, params: &CreateTreeParams, ) -> Result<RepoTree, Error>

Creates new Git tree

Source

pub async fn get_tree( &self, owner: &str, repo: &str, sha: &str, opts: Option<&QueryOptions>, ) -> Result<GitTreeResponse, Error>

Get repository tree by SHA

Source

pub async fn list_languages( &self, owner: &str, repo: &str, ) -> Result<Value, Error>

Get repository languages

Source

pub async fn list_pulls( &self, owner: &str, repo: &str, opts: Option<&QueryOptions>, ) -> Result<Vec<PullRequest>, Error>

List pull requests

Source

pub async fn get_pull( &self, owner: &str, repo: &str, pull_number: f64, ) -> Result<PullRequest, Error>

Pull request details.

Source

pub async fn update_pull( &self, owner: &str, repo: &str, pull_number: f64, params: &UpdatePullRequestParams, ) -> Result<PullRequest, Error>

Update a pull request.

Source

pub async fn list_for_authenticated_user( &self, opts: Option<&QueryOptions>, ) -> Result<Vec<Repository>, Error>

Get authenticated user repositories

Source

pub async fn create_for_authenticated_user( &self, params: &CreateRepositoryParams, ) -> Result<Repository, Error>

Create repository

Source§

impl Client

Source

pub async fn get_assignment( &self, assignment_id: &str, ) -> Result<Assignment, Error>

Gets the assignment in smartclass

Source§

impl Client

Source

pub async fn list_favorites( &self, opts: Option<&QueryOptions>, ) -> Result<Vec<Repository>, Error>

Get list of favorites repositories of authenticated user

Source

pub async fn is_starred(&self, owner: &str, repo: &str) -> Result<(), Error>

Check if repository is in favorites

Source

pub async fn star(&self, owner: &str, repo: &str) -> Result<(), Error>

Add repository to favorites

Source

pub async fn unstar(&self, owner: &str, repo: &str) -> Result<(), Error>

Remove repository from favorites

Source§

impl Client

Source

pub async fn list( &self, org: &str, opts: Option<&QueryOptions>, ) -> Result<Vec<Team>, Error>

Lists teams

Source

pub async fn list_members( &self, org: &str, team: &str, opts: Option<&QueryOptions>, ) -> Result<Vec<User>, Error>

Lists team members

Source

pub async fn update_repos( &self, org: &str, team: &str, owner: &str, repo: &str, params: &TeamRepoPermissions, ) -> Result<(), Error>

Add or update team repository permissions

Source§

impl Client

Source

pub async fn list_users( &self, opts: Option<&QueryOptions>, ) -> Result<UserPrefsArray, Error>

Search users by query

Source

pub async fn get_authenticated(&self) -> Result<User, Error>

Get authenticated user information

Source

pub async fn get_users(&self, account_id: f64) -> Result<User, Error>

Get user information by ID

Source

pub async fn get_by_username(&self, username: &str) -> Result<User, Error>

Get user information by username

Source§

impl Client

Source

pub async fn list_webhooks( &self, owner: &str, repo: &str, opts: Option<&QueryOptions>, ) -> Result<Vec<Webhook>, Error>

Get repository webhooks list

Source

pub async fn create_webhook( &self, owner: &str, repo: &str, params: &CreateWebhookParams, ) -> Result<Webhook, Error>

Create repository webhook

Source

pub async fn get_webhook( &self, owner: &str, repo: &str, hook_id: f64, ) -> Result<Webhook, Error>

Get webhook information

Source

pub async fn update_webhook( &self, owner: &str, repo: &str, hook_id: f64, params: &UpdateWebhookParams, ) -> Result<Webhook, Error>

Update webhook

Source

pub async fn delete_webhook( &self, owner: &str, repo: &str, hook_id: f64, ) -> Result<(), Error>

Delete webhook

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more