Struct roctogen::endpoints::git::Git [−][src]
pub struct Git<'api> { /* fields omitted */ }
Implementations
pub async fn create_blob_async(
&self,
owner: &str,
repo: &str,
body: PostGitCreateBlob
) -> Result<ShortBlob, GitCreateBlobError>
pub async fn create_blob_async(
&self,
owner: &str,
repo: &str,
body: PostGitCreateBlob
) -> Result<ShortBlob, GitCreateBlobError>
pub fn create_blob(
&self,
owner: &str,
repo: &str,
body: PostGitCreateBlob
) -> Result<ShortBlob, GitCreateBlobError>
pub fn create_blob(
&self,
owner: &str,
repo: &str,
body: PostGitCreateBlob
) -> Result<ShortBlob, GitCreateBlobError>
pub async fn create_commit_async(
&self,
owner: &str,
repo: &str,
body: PostGitCreateCommit
) -> Result<GitCommit, GitCreateCommitError>
pub async fn create_commit_async(
&self,
owner: &str,
repo: &str,
body: PostGitCreateCommit
) -> Result<GitCommit, GitCreateCommitError>
Create a commit
Creates a new Git commit object.
Signature verification object
The response will include a verification
object that describes the result of verifying the commit’s signature. The following fields are included in the verification
object:
Name | Type | Description |
---|---|---|
verified | boolean | Indicates whether GitHub considers the signature in this commit to be verified. |
reason | string | The reason for verified value. Possible values and their meanings are enumerated in table below. |
signature | string | The signature that was extracted from the commit. |
payload | string | The value that was signed. |
These are the possible values for reason
in the verification
object:
Value | Description |
---|---|
expired_key | The key that made the signature is expired. |
not_signing_key | The “signing” flag is not among the usage flags in the GPG key that made the signature. |
gpgverify_error | There was an error communicating with the signature verification service. |
gpgverify_unavailable | The signature verification service is currently unavailable. |
unsigned | The object does not include a signature. |
unknown_signature_type | A non-PGP signature was found in the commit. |
no_user | No user was associated with the committer email address in the commit. |
unverified_email | The committer email address in the commit was associated with a user, but the email address is not verified on her/his account. |
bad_email | The committer email address in the commit is not included in the identities of the PGP key that made the signature. |
unknown_key | The key that made the signature has not been registered with any user’s account. |
malformed_signature | There was an error parsing the signature. |
invalid | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |
valid | None of the above errors applied, so the signature is considered to be verified. |
GitHub API docs for create_commit
pub fn create_commit(
&self,
owner: &str,
repo: &str,
body: PostGitCreateCommit
) -> Result<GitCommit, GitCreateCommitError>
pub fn create_commit(
&self,
owner: &str,
repo: &str,
body: PostGitCreateCommit
) -> Result<GitCommit, GitCreateCommitError>
Create a commit
Creates a new Git commit object.
Signature verification object
The response will include a verification
object that describes the result of verifying the commit’s signature. The following fields are included in the verification
object:
Name | Type | Description |
---|---|---|
verified | boolean | Indicates whether GitHub considers the signature in this commit to be verified. |
reason | string | The reason for verified value. Possible values and their meanings are enumerated in table below. |
signature | string | The signature that was extracted from the commit. |
payload | string | The value that was signed. |
These are the possible values for reason
in the verification
object:
Value | Description |
---|---|
expired_key | The key that made the signature is expired. |
not_signing_key | The “signing” flag is not among the usage flags in the GPG key that made the signature. |
gpgverify_error | There was an error communicating with the signature verification service. |
gpgverify_unavailable | The signature verification service is currently unavailable. |
unsigned | The object does not include a signature. |
unknown_signature_type | A non-PGP signature was found in the commit. |
no_user | No user was associated with the committer email address in the commit. |
unverified_email | The committer email address in the commit was associated with a user, but the email address is not verified on her/his account. |
bad_email | The committer email address in the commit is not included in the identities of the PGP key that made the signature. |
unknown_key | The key that made the signature has not been registered with any user’s account. |
malformed_signature | There was an error parsing the signature. |
invalid | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |
valid | None of the above errors applied, so the signature is considered to be verified. |
GitHub API docs for create_commit
pub async fn create_ref_async(
&self,
owner: &str,
repo: &str,
body: PostGitCreateRef
) -> Result<GitRef, GitCreateRefError>
pub async fn create_ref_async(
&self,
owner: &str,
repo: &str,
body: PostGitCreateRef
) -> Result<GitRef, GitCreateRefError>
Create a reference
Creates a reference for your repository. You are unable to create new references for empty repositories, even if the commit SHA-1 hash used exists. Empty repositories are repositories without branches.
GitHub API docs for create_ref
pub fn create_ref(
&self,
owner: &str,
repo: &str,
body: PostGitCreateRef
) -> Result<GitRef, GitCreateRefError>
pub fn create_ref(
&self,
owner: &str,
repo: &str,
body: PostGitCreateRef
) -> Result<GitRef, GitCreateRefError>
Create a reference
Creates a reference for your repository. You are unable to create new references for empty repositories, even if the commit SHA-1 hash used exists. Empty repositories are repositories without branches.
GitHub API docs for create_ref
pub async fn create_tag_async(
&self,
owner: &str,
repo: &str,
body: PostGitCreateTag
) -> Result<GitTag, GitCreateTagError>
pub async fn create_tag_async(
&self,
owner: &str,
repo: &str,
body: PostGitCreateTag
) -> Result<GitTag, GitCreateTagError>
Create a tag object
Note that creating a tag object does not create the reference that makes a tag in Git. If you want to create an annotated tag in Git, you have to do this call to create the tag object, and then create the refs/tags/[tag]
reference. If you want to create a lightweight tag, you only have to create the tag reference - this call would be unnecessary.
Signature verification object
The response will include a verification
object that describes the result of verifying the commit’s signature. The following fields are included in the verification
object:
Name | Type | Description |
---|---|---|
verified | boolean | Indicates whether GitHub considers the signature in this commit to be verified. |
reason | string | The reason for verified value. Possible values and their meanings are enumerated in table below. |
signature | string | The signature that was extracted from the commit. |
payload | string | The value that was signed. |
These are the possible values for reason
in the verification
object:
Value | Description |
---|---|
expired_key | The key that made the signature is expired. |
not_signing_key | The “signing” flag is not among the usage flags in the GPG key that made the signature. |
gpgverify_error | There was an error communicating with the signature verification service. |
gpgverify_unavailable | The signature verification service is currently unavailable. |
unsigned | The object does not include a signature. |
unknown_signature_type | A non-PGP signature was found in the commit. |
no_user | No user was associated with the committer email address in the commit. |
unverified_email | The committer email address in the commit was associated with a user, but the email address is not verified on her/his account. |
bad_email | The committer email address in the commit is not included in the identities of the PGP key that made the signature. |
unknown_key | The key that made the signature has not been registered with any user’s account. |
malformed_signature | There was an error parsing the signature. |
invalid | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |
valid | None of the above errors applied, so the signature is considered to be verified. |
GitHub API docs for create_tag
pub fn create_tag(
&self,
owner: &str,
repo: &str,
body: PostGitCreateTag
) -> Result<GitTag, GitCreateTagError>
pub fn create_tag(
&self,
owner: &str,
repo: &str,
body: PostGitCreateTag
) -> Result<GitTag, GitCreateTagError>
Create a tag object
Note that creating a tag object does not create the reference that makes a tag in Git. If you want to create an annotated tag in Git, you have to do this call to create the tag object, and then create the refs/tags/[tag]
reference. If you want to create a lightweight tag, you only have to create the tag reference - this call would be unnecessary.
Signature verification object
The response will include a verification
object that describes the result of verifying the commit’s signature. The following fields are included in the verification
object:
Name | Type | Description |
---|---|---|
verified | boolean | Indicates whether GitHub considers the signature in this commit to be verified. |
reason | string | The reason for verified value. Possible values and their meanings are enumerated in table below. |
signature | string | The signature that was extracted from the commit. |
payload | string | The value that was signed. |
These are the possible values for reason
in the verification
object:
Value | Description |
---|---|
expired_key | The key that made the signature is expired. |
not_signing_key | The “signing” flag is not among the usage flags in the GPG key that made the signature. |
gpgverify_error | There was an error communicating with the signature verification service. |
gpgverify_unavailable | The signature verification service is currently unavailable. |
unsigned | The object does not include a signature. |
unknown_signature_type | A non-PGP signature was found in the commit. |
no_user | No user was associated with the committer email address in the commit. |
unverified_email | The committer email address in the commit was associated with a user, but the email address is not verified on her/his account. |
bad_email | The committer email address in the commit is not included in the identities of the PGP key that made the signature. |
unknown_key | The key that made the signature has not been registered with any user’s account. |
malformed_signature | There was an error parsing the signature. |
invalid | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |
valid | None of the above errors applied, so the signature is considered to be verified. |
GitHub API docs for create_tag
pub async fn create_tree_async(
&self,
owner: &str,
repo: &str,
body: PostGitCreateTree
) -> Result<GitTree, GitCreateTreeError>
pub async fn create_tree_async(
&self,
owner: &str,
repo: &str,
body: PostGitCreateTree
) -> Result<GitTree, GitCreateTreeError>
Create a tree
The tree creation API accepts nested entries. If you specify both a tree and a nested path modifying that tree, this endpoint will overwrite the contents of the tree with the new path contents, and create a new tree structure.
If you use this endpoint to add, delete, or modify the file contents in a tree, you will need to commit the tree and then update a branch to point to the commit. For more information see “Create a commit” and “Update a reference.”
GitHub API docs for create_tree
pub fn create_tree(
&self,
owner: &str,
repo: &str,
body: PostGitCreateTree
) -> Result<GitTree, GitCreateTreeError>
pub fn create_tree(
&self,
owner: &str,
repo: &str,
body: PostGitCreateTree
) -> Result<GitTree, GitCreateTreeError>
Create a tree
The tree creation API accepts nested entries. If you specify both a tree and a nested path modifying that tree, this endpoint will overwrite the contents of the tree with the new path contents, and create a new tree structure.
If you use this endpoint to add, delete, or modify the file contents in a tree, you will need to commit the tree and then update a branch to point to the commit. For more information see “Create a commit” and “Update a reference.”
GitHub API docs for create_tree
pub async fn delete_ref_async(
&self,
owner: &str,
repo: &str,
git_ref: &str
) -> Result<(), GitDeleteRefError>
pub async fn delete_ref_async(
&self,
owner: &str,
repo: &str,
git_ref: &str
) -> Result<(), GitDeleteRefError>
pub fn delete_ref(
&self,
owner: &str,
repo: &str,
git_ref: &str
) -> Result<(), GitDeleteRefError>
pub fn delete_ref(
&self,
owner: &str,
repo: &str,
git_ref: &str
) -> Result<(), GitDeleteRefError>
pub async fn get_blob_async(
&self,
owner: &str,
repo: &str,
file_sha: &str
) -> Result<Blob, GitGetBlobError>
pub async fn get_blob_async(
&self,
owner: &str,
repo: &str,
file_sha: &str
) -> Result<Blob, GitGetBlobError>
Get a blob
The content
in the response will always be Base64 encoded.
Note: This API supports blobs up to 100 megabytes in size.
Get a blob
The content
in the response will always be Base64 encoded.
Note: This API supports blobs up to 100 megabytes in size.
pub async fn get_commit_async(
&self,
owner: &str,
repo: &str,
commit_sha: &str
) -> Result<GitCommit, GitGetCommitError>
pub async fn get_commit_async(
&self,
owner: &str,
repo: &str,
commit_sha: &str
) -> Result<GitCommit, GitGetCommitError>
Get a commit
Gets a Git commit object.
Signature verification object
The response will include a verification
object that describes the result of verifying the commit’s signature. The following fields are included in the verification
object:
Name | Type | Description |
---|---|---|
verified | boolean | Indicates whether GitHub considers the signature in this commit to be verified. |
reason | string | The reason for verified value. Possible values and their meanings are enumerated in table below. |
signature | string | The signature that was extracted from the commit. |
payload | string | The value that was signed. |
These are the possible values for reason
in the verification
object:
Value | Description |
---|---|
expired_key | The key that made the signature is expired. |
not_signing_key | The “signing” flag is not among the usage flags in the GPG key that made the signature. |
gpgverify_error | There was an error communicating with the signature verification service. |
gpgverify_unavailable | The signature verification service is currently unavailable. |
unsigned | The object does not include a signature. |
unknown_signature_type | A non-PGP signature was found in the commit. |
no_user | No user was associated with the committer email address in the commit. |
unverified_email | The committer email address in the commit was associated with a user, but the email address is not verified on her/his account. |
bad_email | The committer email address in the commit is not included in the identities of the PGP key that made the signature. |
unknown_key | The key that made the signature has not been registered with any user’s account. |
malformed_signature | There was an error parsing the signature. |
invalid | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |
valid | None of the above errors applied, so the signature is considered to be verified. |
GitHub API docs for get_commit
pub fn get_commit(
&self,
owner: &str,
repo: &str,
commit_sha: &str
) -> Result<GitCommit, GitGetCommitError>
pub fn get_commit(
&self,
owner: &str,
repo: &str,
commit_sha: &str
) -> Result<GitCommit, GitGetCommitError>
Get a commit
Gets a Git commit object.
Signature verification object
The response will include a verification
object that describes the result of verifying the commit’s signature. The following fields are included in the verification
object:
Name | Type | Description |
---|---|---|
verified | boolean | Indicates whether GitHub considers the signature in this commit to be verified. |
reason | string | The reason for verified value. Possible values and their meanings are enumerated in table below. |
signature | string | The signature that was extracted from the commit. |
payload | string | The value that was signed. |
These are the possible values for reason
in the verification
object:
Value | Description |
---|---|
expired_key | The key that made the signature is expired. |
not_signing_key | The “signing” flag is not among the usage flags in the GPG key that made the signature. |
gpgverify_error | There was an error communicating with the signature verification service. |
gpgverify_unavailable | The signature verification service is currently unavailable. |
unsigned | The object does not include a signature. |
unknown_signature_type | A non-PGP signature was found in the commit. |
no_user | No user was associated with the committer email address in the commit. |
unverified_email | The committer email address in the commit was associated with a user, but the email address is not verified on her/his account. |
bad_email | The committer email address in the commit is not included in the identities of the PGP key that made the signature. |
unknown_key | The key that made the signature has not been registered with any user’s account. |
malformed_signature | There was an error parsing the signature. |
invalid | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |
valid | None of the above errors applied, so the signature is considered to be verified. |
GitHub API docs for get_commit
pub async fn get_ref_async(
&self,
owner: &str,
repo: &str,
git_ref: &str
) -> Result<GitRef, GitGetRefError>
pub async fn get_ref_async(
&self,
owner: &str,
repo: &str,
git_ref: &str
) -> Result<GitRef, GitGetRefError>
Get a reference
Returns a single reference from your Git database. The :ref
in the URL must be formatted as heads/<branch name>
for branches and tags/<tag name>
for tags. If the :ref
doesn’t match an existing ref, a 404
is returned.
Note: You need to explicitly request a pull request to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see “Checking mergeability of pull requests”.
Get a reference
Returns a single reference from your Git database. The :ref
in the URL must be formatted as heads/<branch name>
for branches and tags/<tag name>
for tags. If the :ref
doesn’t match an existing ref, a 404
is returned.
Note: You need to explicitly request a pull request to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see “Checking mergeability of pull requests”.
pub async fn get_tag_async(
&self,
owner: &str,
repo: &str,
tag_sha: &str
) -> Result<GitTag, GitGetTagError>
pub async fn get_tag_async(
&self,
owner: &str,
repo: &str,
tag_sha: &str
) -> Result<GitTag, GitGetTagError>
Get a tag
Signature verification object
The response will include a verification
object that describes the result of verifying the commit’s signature. The following fields are included in the verification
object:
Name | Type | Description |
---|---|---|
verified | boolean | Indicates whether GitHub considers the signature in this commit to be verified. |
reason | string | The reason for verified value. Possible values and their meanings are enumerated in table below. |
signature | string | The signature that was extracted from the commit. |
payload | string | The value that was signed. |
These are the possible values for reason
in the verification
object:
Value | Description |
---|---|
expired_key | The key that made the signature is expired. |
not_signing_key | The “signing” flag is not among the usage flags in the GPG key that made the signature. |
gpgverify_error | There was an error communicating with the signature verification service. |
gpgverify_unavailable | The signature verification service is currently unavailable. |
unsigned | The object does not include a signature. |
unknown_signature_type | A non-PGP signature was found in the commit. |
no_user | No user was associated with the committer email address in the commit. |
unverified_email | The committer email address in the commit was associated with a user, but the email address is not verified on her/his account. |
bad_email | The committer email address in the commit is not included in the identities of the PGP key that made the signature. |
unknown_key | The key that made the signature has not been registered with any user’s account. |
malformed_signature | There was an error parsing the signature. |
invalid | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |
valid | None of the above errors applied, so the signature is considered to be verified. |
Get a tag
Signature verification object
The response will include a verification
object that describes the result of verifying the commit’s signature. The following fields are included in the verification
object:
Name | Type | Description |
---|---|---|
verified | boolean | Indicates whether GitHub considers the signature in this commit to be verified. |
reason | string | The reason for verified value. Possible values and their meanings are enumerated in table below. |
signature | string | The signature that was extracted from the commit. |
payload | string | The value that was signed. |
These are the possible values for reason
in the verification
object:
Value | Description |
---|---|
expired_key | The key that made the signature is expired. |
not_signing_key | The “signing” flag is not among the usage flags in the GPG key that made the signature. |
gpgverify_error | There was an error communicating with the signature verification service. |
gpgverify_unavailable | The signature verification service is currently unavailable. |
unsigned | The object does not include a signature. |
unknown_signature_type | A non-PGP signature was found in the commit. |
no_user | No user was associated with the committer email address in the commit. |
unverified_email | The committer email address in the commit was associated with a user, but the email address is not verified on her/his account. |
bad_email | The committer email address in the commit is not included in the identities of the PGP key that made the signature. |
unknown_key | The key that made the signature has not been registered with any user’s account. |
malformed_signature | There was an error parsing the signature. |
invalid | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |
valid | None of the above errors applied, so the signature is considered to be verified. |
pub async fn get_tree_async(
&self,
owner: &str,
repo: &str,
tree_sha: &str,
query_params: Option<impl Into<GitGetTreeParams<'api>>>
) -> Result<GitTree, GitGetTreeError>
pub async fn get_tree_async(
&self,
owner: &str,
repo: &str,
tree_sha: &str,
query_params: Option<impl Into<GitGetTreeParams<'api>>>
) -> Result<GitTree, GitGetTreeError>
Get a tree
Returns a single tree using the SHA1 value for that tree.
If truncated
is true
in the response then the number of items in the tree
array exceeded our maximum limit. If you need to fetch more items, use the non-recursive method of fetching trees, and fetch one sub-tree at a time.
Get a tree
Returns a single tree using the SHA1 value for that tree.
If truncated
is true
in the response then the number of items in the tree
array exceeded our maximum limit. If you need to fetch more items, use the non-recursive method of fetching trees, and fetch one sub-tree at a time.
pub async fn list_matching_refs_async(
&self,
owner: &str,
repo: &str,
git_ref: &str,
query_params: Option<impl Into<GitListMatchingRefsParams>>
) -> Result<Vec<GitRef>, GitListMatchingRefsError>
pub async fn list_matching_refs_async(
&self,
owner: &str,
repo: &str,
git_ref: &str,
query_params: Option<impl Into<GitListMatchingRefsParams>>
) -> Result<Vec<GitRef>, GitListMatchingRefsError>
List matching references
Returns an array of references from your Git database that match the supplied name. The :ref
in the URL must be formatted as heads/<branch name>
for branches and tags/<tag name>
for tags. If the :ref
doesn’t exist in the repository, but existing refs start with :ref
, they will be returned as an array.
When you use this endpoint without providing a :ref
, it will return an array of all the references from your Git database, including notes and stashes if they exist on the server. Anything in the namespace is returned, not just heads
and tags
.
Note: You need to explicitly request a pull request to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see “Checking mergeability of pull requests”.
If you request matching references for a branch named feature
but the branch feature
doesn’t exist, the response can still include other matching head refs that start with the word feature
, such as featureA
and featureB
.
GitHub API docs for list_matching_refs
pub fn list_matching_refs(
&self,
owner: &str,
repo: &str,
git_ref: &str,
query_params: Option<impl Into<GitListMatchingRefsParams>>
) -> Result<Vec<GitRef>, GitListMatchingRefsError>
pub fn list_matching_refs(
&self,
owner: &str,
repo: &str,
git_ref: &str,
query_params: Option<impl Into<GitListMatchingRefsParams>>
) -> Result<Vec<GitRef>, GitListMatchingRefsError>
List matching references
Returns an array of references from your Git database that match the supplied name. The :ref
in the URL must be formatted as heads/<branch name>
for branches and tags/<tag name>
for tags. If the :ref
doesn’t exist in the repository, but existing refs start with :ref
, they will be returned as an array.
When you use this endpoint without providing a :ref
, it will return an array of all the references from your Git database, including notes and stashes if they exist on the server. Anything in the namespace is returned, not just heads
and tags
.
Note: You need to explicitly request a pull request to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see “Checking mergeability of pull requests”.
If you request matching references for a branch named feature
but the branch feature
doesn’t exist, the response can still include other matching head refs that start with the word feature
, such as featureA
and featureB
.
GitHub API docs for list_matching_refs