pub struct CodespacesHandler<'octo> { /* private fields */ }Expand description
Handler for GitHub’s Codespaces API.
Created with Octocrab::codespaces.
Implementations§
Source§impl<'octo> CodespacesHandler<'octo>
impl<'octo> CodespacesHandler<'octo>
Sourcepub fn list(&self) -> ListCodespacesBuilder<'octo, '_>
pub fn list(&self) -> ListCodespacesBuilder<'octo, '_>
Lists codespaces for the authenticated user.
See: GitHub REST API Documentation
§Examples
let codespaces = octocrab.codespaces().list().send().await?;Sourcepub async fn create(&self, body: &CreateUserCodespace) -> Result<Codespace>
pub async fn create(&self, body: &CreateUserCodespace) -> Result<Codespace>
Creates a codespace for the authenticated user.
See: GitHub REST API Documentation
§Examples
use octocrab::models::codespaces::CreateUserCodespace;
let body = CreateUserCodespace::default();
let codespace = octocrab.codespaces().create(&body).await?;Sourcepub async fn get(&self, codespace_name: impl AsRef<str>) -> Result<Codespace>
pub async fn get(&self, codespace_name: impl AsRef<str>) -> Result<Codespace>
Gets a codespace for the authenticated user.
See: GitHub REST API Documentation
§Examples
let codespace = octocrab.codespaces().get("my-codespace").await?;Sourcepub async fn update(
&self,
codespace_name: impl AsRef<str>,
patch: &UpdateCodespace,
) -> Result<Codespace>
pub async fn update( &self, codespace_name: impl AsRef<str>, patch: &UpdateCodespace, ) -> Result<Codespace>
Updates a codespace for the authenticated user.
See: GitHub REST API Documentation
§Examples
use octocrab::models::codespaces::UpdateCodespace;
let patch = UpdateCodespace::default();
let codespace = octocrab.codespaces().update("my-codespace", &patch).await?;Sourcepub async fn delete(&self, codespace_name: impl AsRef<str>) -> Result<()>
pub async fn delete(&self, codespace_name: impl AsRef<str>) -> Result<()>
Deletes a codespace for the authenticated user.
See: GitHub REST API Documentation
§Examples
octocrab.codespaces().delete("my-codespace").await?;Sourcepub async fn start(&self, codespace_name: impl AsRef<str>) -> Result<Codespace>
pub async fn start(&self, codespace_name: impl AsRef<str>) -> Result<Codespace>
Starts a codespace for the authenticated user.
See: GitHub REST API Documentation
§Examples
let codespace = octocrab.codespaces().start("my-codespace").await?;Sourcepub async fn stop(&self, codespace_name: impl AsRef<str>) -> Result<Codespace>
pub async fn stop(&self, codespace_name: impl AsRef<str>) -> Result<Codespace>
Stops a codespace for the authenticated user.
See: GitHub REST API Documentation
§Examples
let codespace = octocrab.codespaces().stop("my-codespace").await?;Sourcepub async fn publish(
&self,
codespace_name: impl AsRef<str>,
body: &PublishCodespace,
) -> Result<Codespace>
pub async fn publish( &self, codespace_name: impl AsRef<str>, body: &PublishCodespace, ) -> Result<Codespace>
Creates a repository from an unpublished codespace.
See: GitHub REST API Documentation
§Examples
use octocrab::models::codespaces::PublishCodespace;
let body = PublishCodespace::default();
let codespace = octocrab.codespaces().publish("my-codespace", &body).await?;Sourcepub async fn export(
&self,
codespace_name: impl AsRef<str>,
) -> Result<CodespaceExportDetails>
pub async fn export( &self, codespace_name: impl AsRef<str>, ) -> Result<CodespaceExportDetails>
Triggers an export of a codespace for the authenticated user.
See: GitHub REST API Documentation
§Examples
let export = octocrab.codespaces().export("my-codespace").await?;Sourcepub async fn get_export(
&self,
codespace_name: impl AsRef<str>,
export_id: impl AsRef<str>,
) -> Result<CodespaceExportDetails>
pub async fn get_export( &self, codespace_name: impl AsRef<str>, export_id: impl AsRef<str>, ) -> Result<CodespaceExportDetails>
Gets details about a codespace export.
See: GitHub REST API Documentation
§Examples
let export = octocrab.codespaces().get_export("my-codespace", "export-id").await?;Sourcepub async fn machines(
&self,
codespace_name: impl AsRef<str>,
) -> Result<Page<CodespaceMachine>>
pub async fn machines( &self, codespace_name: impl AsRef<str>, ) -> Result<Page<CodespaceMachine>>
Lists machine types available for a codespace.
See: GitHub REST API Documentation
§Examples
let machines = octocrab.codespaces().machines("my-codespace").await?;Sourcepub fn secrets(&self) -> UserCodespacesSecretsHandler<'octo>
pub fn secrets(&self) -> UserCodespacesSecretsHandler<'octo>
Handler for managing user-scoped Codespaces secrets.
§Examples
let secrets = octocrab.codespaces().secrets().list().send().await?;