- HTTP request
- Path parameters
- Query parameters
- Request body
- Response body
- Authorization scopes
- IAM Permissions
- TreeEntry
- ObjectType
Fetches a tree from a repository.
HTTP request
The URLs use gRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
repository |
Required. The format is |
Query parameters
Parameters | |
---|---|
ref |
Optional. |
recursive |
Optional. If true, include all subfolders and their files in the response. If false, only the immediate children are returned. |
pageSize |
Optional. Requested page size. Server may return fewer items than requested. If unspecified, at most 10,000 items will be returned. |
pageToken |
Optional. A token identifying a page of results the server should return. |
Request body
The request body must be empty.
Response body
Response message containing a list of TreeEntry objects.
If successful, the response body contains data with the following structure:
JSON representation |
---|
{
"treeEntries": [
{
object ( |
Fields | |
---|---|
treeEntries[] |
The list of TreeEntry objects. |
nextPageToken |
A token identifying a page of results the server should return. |
Authorization scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/cloud-platform
For more information, see the Authentication Overview.
IAM Permissions
Requires the following IAM permission on the repository
resource:
securesourcemanager.repositories.fetch
For more information, see the IAM documentation.
TreeEntry
Represents an entry within a tree structure (like a Git tree).
JSON representation |
---|
{
"type": enum ( |
Fields | |
---|---|
type |
Output only. The type of the object (TREE, BLOB, COMMIT). Output-only. |
sha |
Output only. The SHA-1 hash of the object (unique identifier). Output-only. |
path |
Output only. The path of the file or directory within the tree (e.g., "src/main/java/MyClass.java"). Output-only. |
mode |
Output only. The file mode as a string (e.g., "100644"). Indicates file type. Output-only. |
size |
Output only. The size of the object in bytes (only for blobs). Output-only. |
ObjectType
Defines the type of object the TreeEntry represents.
Enums | |
---|---|
OBJECT_TYPE_UNSPECIFIED |
Default value, indicating the object type is unspecified. |
TREE |
Represents a directory (folder). |
BLOB |
Represents a file (contains file data). |
COMMIT |
Represents a pointer to another repository (submodule). |