Struct roctogen::endpoints::codespaces::Codespaces[][src]

pub struct Codespaces<'api> { /* fields omitted */ }

Implementations


Add a selected repository to a user secret

Adds a repository to the selected repositories for a user’s codespace secret. You must authenticate using an access token with the user or read:user scope to use this endpoint. User must have Codespaces access to use this endpoint.

GitHub API docs for add_repository_for_secret_for_authenticated_user



Add a selected repository to a user secret

Adds a repository to the selected repositories for a user’s codespace secret. You must authenticate using an access token with the user or read:user scope to use this endpoint. User must have Codespaces access to use this endpoint.

GitHub API docs for add_repository_for_secret_for_authenticated_user



List machine types for a codespace

List the machine types a codespace can transition to use.

You must authenticate using an access token with the codespace scope to use this endpoint.

GitHub API docs for codespace_machines_for_authenticated_user



List machine types for a codespace

List the machine types a codespace can transition to use.

You must authenticate using an access token with the codespace scope to use this endpoint.

GitHub API docs for codespace_machines_for_authenticated_user



Create a codespace for the authenticated user

Creates a new codespace, owned by the authenticated user.

This endpoint requires either a repository_id OR a pull_request but not both.

You must authenticate using an access token with the codespace scope to use this endpoint.

GitHub API docs for create_for_authenticated_user



Create a codespace for the authenticated user

Creates a new codespace, owned by the authenticated user.

This endpoint requires either a repository_id OR a pull_request but not both.

You must authenticate using an access token with the codespace scope to use this endpoint.

GitHub API docs for create_for_authenticated_user



Create or update a secret for the authenticated user

Creates or updates a secret for a user’s codespace with an encrypted value. Encrypt your secret using LibSodium. You must authenticate using an access token with the user scope to use this endpoint. User must also have Codespaces access to use this endpoint.

Example encrypting a secret using Node.js

Encrypt your secret using the tweetsodium library.

const sodium = require('tweetsodium');
 
const key = "base64-encoded-public-key";
const value = "plain-text-secret";
 
// Convert the message and key to Uint8Array's (Buffer implements that interface)
const messageBytes = Buffer.from(value);
const keyBytes = Buffer.from(key, 'base64');
 
// Encrypt using LibSodium.
const encryptedBytes = sodium.seal(messageBytes, keyBytes);
 
// Base64 the encrypted secret
const encrypted = Buffer.from(encryptedBytes).toString('base64');
 
console.log(encrypted);
Example encrypting a secret using Python

Encrypt your secret using pynacl with Python 3.

from base64 import b64encode
from nacl import encoding, public
 
def encrypt(public_key: str, secret_value: str) -> str:
  """Encrypt a Unicode string using the public key."""
  public_key = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder())
  sealed_box = public.SealedBox(public_key)
  encrypted = sealed_box.encrypt(secret_value.encode("utf-8"))
  return b64encode(encrypted).decode("utf-8")
Example encrypting a secret using C#

Encrypt your secret using the Sodium.Core package.

var secretValue = System.Text.Encoding.UTF8.GetBytes("mySecret");
var publicKey = Convert.FromBase64String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU=");
 
var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey);
 
Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox));
Example encrypting a secret using Ruby

Encrypt your secret using the rbnacl gem.

require "rbnacl"
require "base64"
 
key = Base64.decode64("+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=")
public_key = RbNaCl::PublicKey.new(key)
 
box = RbNaCl::Boxes::Sealed.from_public_key(public_key)
encrypted_secret = box.encrypt("my_secret")
 
puts Base64.strict_encode64(encrypted_secret)

GitHub API docs for create_or_update_secret_for_authenticated_user



Create or update a secret for the authenticated user

Creates or updates a secret for a user’s codespace with an encrypted value. Encrypt your secret using LibSodium. You must authenticate using an access token with the user scope to use this endpoint. User must also have Codespaces access to use this endpoint.

Example encrypting a secret using Node.js

Encrypt your secret using the tweetsodium library.

const sodium = require('tweetsodium');
 
const key = "base64-encoded-public-key";
const value = "plain-text-secret";
 
// Convert the message and key to Uint8Array's (Buffer implements that interface)
const messageBytes = Buffer.from(value);
const keyBytes = Buffer.from(key, 'base64');
 
// Encrypt using LibSodium.
const encryptedBytes = sodium.seal(messageBytes, keyBytes);
 
// Base64 the encrypted secret
const encrypted = Buffer.from(encryptedBytes).toString('base64');
 
console.log(encrypted);
Example encrypting a secret using Python

Encrypt your secret using pynacl with Python 3.

from base64 import b64encode
from nacl import encoding, public
 
def encrypt(public_key: str, secret_value: str) -> str:
  """Encrypt a Unicode string using the public key."""
  public_key = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder())
  sealed_box = public.SealedBox(public_key)
  encrypted = sealed_box.encrypt(secret_value.encode("utf-8"))
  return b64encode(encrypted).decode("utf-8")
Example encrypting a secret using C#

Encrypt your secret using the Sodium.Core package.

var secretValue = System.Text.Encoding.UTF8.GetBytes("mySecret");
var publicKey = Convert.FromBase64String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU=");
 
var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey);
 
Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox));
Example encrypting a secret using Ruby

Encrypt your secret using the rbnacl gem.

require "rbnacl"
require "base64"
 
key = Base64.decode64("+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=")
public_key = RbNaCl::PublicKey.new(key)
 
box = RbNaCl::Boxes::Sealed.from_public_key(public_key)
encrypted_secret = box.encrypt("my_secret")
 
puts Base64.strict_encode64(encrypted_secret)

GitHub API docs for create_or_update_secret_for_authenticated_user



Create a codespace from a pull request

Creates a codespace owned by the authenticated user for the specified pull request.

You must authenticate using an access token with the codespace scope to use this endpoint.

GitHub API docs for create_with_pr_for_authenticated_user



Create a codespace from a pull request

Creates a codespace owned by the authenticated user for the specified pull request.

You must authenticate using an access token with the codespace scope to use this endpoint.

GitHub API docs for create_with_pr_for_authenticated_user



Create a codespace in a repository

Creates a codespace owned by the authenticated user in the specified repository.

You must authenticate using an access token with the codespace scope to use this endpoint.

GitHub API docs for create_with_repo_for_authenticated_user



Create a codespace in a repository

Creates a codespace owned by the authenticated user in the specified repository.

You must authenticate using an access token with the codespace scope to use this endpoint.

GitHub API docs for create_with_repo_for_authenticated_user



Delete a codespace for the authenticated user

Deletes a user’s codespace.

You must authenticate using an access token with the codespace scope to use this endpoint.

GitHub API docs for delete_for_authenticated_user



Delete a codespace for the authenticated user

Deletes a user’s codespace.

You must authenticate using an access token with the codespace scope to use this endpoint.

GitHub API docs for delete_for_authenticated_user



Delete a secret for the authenticated user

Deletes a secret from a user’s codespaces using the secret name. Deleting the secret will remove access from all codespaces that were allowed to access the secret. You must authenticate using an access token with the user scope to use this endpoint. User must have Codespaces access to use this endpoint.

GitHub API docs for delete_secret_for_authenticated_user



Delete a secret for the authenticated user

Deletes a secret from a user’s codespaces using the secret name. Deleting the secret will remove access from all codespaces that were allowed to access the secret. You must authenticate using an access token with the user scope to use this endpoint. User must have Codespaces access to use this endpoint.

GitHub API docs for delete_secret_for_authenticated_user



Get a codespace for the authenticated user

Gets information about a user’s codespace.

You must authenticate using an access token with the codespace scope to use this endpoint.

GitHub API docs for get_for_authenticated_user



Get a codespace for the authenticated user

Gets information about a user’s codespace.

You must authenticate using an access token with the codespace scope to use this endpoint.

GitHub API docs for get_for_authenticated_user



Get public key for the authenticated user

Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. Anyone with one of the ‘read:user’ or ‘user’ scopes in their personal access token. User must have Codespaces access to use this endpoint.

GitHub API docs for get_public_key_for_authenticated_user



Get public key for the authenticated user

Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. Anyone with one of the ‘read:user’ or ‘user’ scopes in their personal access token. User must have Codespaces access to use this endpoint.

GitHub API docs for get_public_key_for_authenticated_user



Get a secret for the authenticated user

Gets a secret available to a user’s codespaces without revealing its encrypted value. You must authenticate using an access token with the user or read:user scope to use this endpoint. User must have Codespaces access to use this endpoint.

GitHub API docs for get_secret_for_authenticated_user



Get a secret for the authenticated user

Gets a secret available to a user’s codespaces without revealing its encrypted value. You must authenticate using an access token with the user or read:user scope to use this endpoint. User must have Codespaces access to use this endpoint.

GitHub API docs for get_secret_for_authenticated_user



List codespaces for the authenticated user

Lists the authenticated user’s codespaces.

You must authenticate using an access token with the codespace scope to use this endpoint.

GitHub API docs for list_for_authenticated_user



List codespaces for the authenticated user

Lists the authenticated user’s codespaces.

You must authenticate using an access token with the codespace scope to use this endpoint.

GitHub API docs for list_for_authenticated_user



List codespaces in a repository for the authenticated user

Lists the codespaces associated to a specified repository and the authenticated user.

You must authenticate using an access token with the codespace scope to use this endpoint.

GitHub API docs for list_in_repository_for_authenticated_user



List codespaces in a repository for the authenticated user

Lists the codespaces associated to a specified repository and the authenticated user.

You must authenticate using an access token with the codespace scope to use this endpoint.

GitHub API docs for list_in_repository_for_authenticated_user



List selected repositories for a user secret

List the repositories that have been granted the ability to use a user’s codespace secret. You must authenticate using an access token with the user or read:user scope to use this endpoint. User must have Codespaces access to use this endpoint.

GitHub API docs for list_repositories_for_secret_for_authenticated_user



List selected repositories for a user secret

List the repositories that have been granted the ability to use a user’s codespace secret. You must authenticate using an access token with the user or read:user scope to use this endpoint. User must have Codespaces access to use this endpoint.

GitHub API docs for list_repositories_for_secret_for_authenticated_user



List secrets for the authenticated user

Lists all secrets available for a user’s Codespaces without revealing their encrypted values. You must authenticate using an access token with the user or read:user scope to use this endpoint. User must have Codespaces access to use this endpoint.

GitHub API docs for list_secrets_for_authenticated_user



List secrets for the authenticated user

Lists all secrets available for a user’s Codespaces without revealing their encrypted values. You must authenticate using an access token with the user or read:user scope to use this endpoint. User must have Codespaces access to use this endpoint.

GitHub API docs for list_secrets_for_authenticated_user



Remove a selected repository from a user secret

Removes a repository from the selected repositories for a user’s codespace secret. You must authenticate using an access token with the user or read:user scope to use this endpoint. User must have Codespaces access to use this endpoint.

GitHub API docs for remove_repository_for_secret_for_authenticated_user



Remove a selected repository from a user secret

Removes a repository from the selected repositories for a user’s codespace secret. You must authenticate using an access token with the user or read:user scope to use this endpoint. User must have Codespaces access to use this endpoint.

GitHub API docs for remove_repository_for_secret_for_authenticated_user



List available machine types for a repository

List the machine types available for a given repository based on its configuration.

Location is required.

You must authenticate using an access token with the codespace scope to use this endpoint.

GitHub API docs for repo_machines_for_authenticated_user



List available machine types for a repository

List the machine types available for a given repository based on its configuration.

Location is required.

You must authenticate using an access token with the codespace scope to use this endpoint.

GitHub API docs for repo_machines_for_authenticated_user



Set selected repositories for a user secret

Select the repositories that will use a user’s codespace secret. You must authenticate using an access token with the user or read:user scope to use this endpoint. User must have Codespaces access to use this endpoint.

GitHub API docs for set_repositories_for_secret_for_authenticated_user



Set selected repositories for a user secret

Select the repositories that will use a user’s codespace secret. You must authenticate using an access token with the user or read:user scope to use this endpoint. User must have Codespaces access to use this endpoint.

GitHub API docs for set_repositories_for_secret_for_authenticated_user



Start a codespace for the authenticated user

Starts a user’s codespace.

You must authenticate using an access token with the codespace scope to use this endpoint.

GitHub API docs for start_for_authenticated_user



Start a codespace for the authenticated user

Starts a user’s codespace.

You must authenticate using an access token with the codespace scope to use this endpoint.

GitHub API docs for start_for_authenticated_user



Stop a codespace for the authenticated user

Stops a user’s codespace.

You must authenticate using an access token with the codespace scope to use this endpoint.

GitHub API docs for stop_for_authenticated_user



Stop a codespace for the authenticated user

Stops a user’s codespace.

You must authenticate using an access token with the codespace scope to use this endpoint.

GitHub API docs for stop_for_authenticated_user



Update a codespace for the authenticated user

Updates a codespace owned by the authenticated user. Currently only the codespace’s machine type can be modified using this endpoint.

Once you specify a new machine type it will be applied the next time your codespace is started.

You must authenticate using an access token with the codespace scope to use this endpoint.

GitHub API docs for update_for_authenticated_user



Update a codespace for the authenticated user

Updates a codespace owned by the authenticated user. Currently only the codespace’s machine type can be modified using this endpoint.

Once you specify a new machine type it will be applied the next time your codespace is started.

You must authenticate using an access token with the codespace scope to use this endpoint.

GitHub API docs for update_for_authenticated_user


Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.