# Cloud Source Repositories API

Accesses source code repositories hosted by Google.

- [REST Resource: v1.projects](https://docs.cloud.google.com/source-repositories/docs/reference/rest#v1.projects)
- [REST Resource: v1.projects.repos](https://docs.cloud.google.com/source-repositories/docs/reference/rest#v1.projects.repos)

## Service: sourcerepo.googleapis.com

To call this service, we recommend that you use the Google-provided [client libraries](https://cloud.google.com/apis/docs/client-libraries-explained). If your application needs to use your own libraries to call this service, use the following information when you make the API requests.

### Discovery document

A [Discovery Document](https://developers.google.com/discovery/v1/reference/apis) is a machine-readable specification for describing and consuming REST APIs. It is used to build client libraries, IDE plugins, and other tools that interact with Google APIs. One service may provide multiple discovery documents. This service provides the following discovery document:

- <https://sourcerepo.googleapis.com/$discovery/rest?version=v1>

### Service endpoint

A [service endpoint](https://cloud.google.com/apis/design/glossary#api_service_endpoint) is a base URL that specifies the network address of an API service. One service might have multiple service endpoints. This service has the following service endpoint and all URIs below are relative to this service endpoint:

- `https://sourcerepo.googleapis.com`

## REST Resource: [v1.projects](https://docs.cloud.google.com/source-repositories/docs/reference/rest/v1/projects)

| Methods ||
|---|---|
| `https://docs.cloud.google.com/source-repositories/docs/reference/rest/v1/projects/getConfig` | `GET /v1/{name=projects/*}/config` Returns the Cloud Source Repositories configuration of the project. |
| `https://docs.cloud.google.com/source-repositories/docs/reference/rest/v1/projects/updateConfig` | `PATCH /v1/{name=projects/*}/config` Updates the Cloud Source Repositories configuration of the project. |

## REST Resource: [v1.projects.repos](https://docs.cloud.google.com/source-repositories/docs/reference/rest/v1/projects.repos)

| Methods ||
|---|---|
| `https://docs.cloud.google.com/source-repositories/docs/reference/rest/v1/projects.repos/create` | `POST /v1/{parent=projects/*}/repos` Creates a repo in the given project with the given name. |
| `https://docs.cloud.google.com/source-repositories/docs/reference/rest/v1/projects.repos/delete` | `DELETE /v1/{name=projects/*/repos/**}` Deletes a repo. |
| `https://docs.cloud.google.com/source-repositories/docs/reference/rest/v1/projects.repos/get` | `GET /v1/{name=projects/*/repos/**}` Returns information about a repo. |
| `https://docs.cloud.google.com/source-repositories/docs/reference/rest/v1/projects.repos/getIamPolicy` | `GET /v1/{resource=projects/*/repos/**}:getIamPolicy` Gets the IAM policy policy for a resource. |
| `https://docs.cloud.google.com/source-repositories/docs/reference/rest/v1/projects.repos/list` | `GET /v1/{name=projects/*}/repos` Returns all repos belonging to a project. |
| `https://docs.cloud.google.com/source-repositories/docs/reference/rest/v1/projects.repos/patch` | `PATCH /v1/{name=projects/*/repos/**}` Updates information about a repo. |
| `https://docs.cloud.google.com/source-repositories/docs/reference/rest/v1/projects.repos/setIamPolicy` | `POST /v1/{resource=projects/*/repos/**}:setIamPolicy` Sets the IAM policy on the specified resource. |
| `https://docs.cloud.google.com/source-repositories/docs/reference/rest/v1/projects.repos/sync` | `POST /v1/{name=projects/*/repos/**}:sync` Synchronize a connected repo. |
| `https://docs.cloud.google.com/source-repositories/docs/reference/rest/v1/projects.repos/testIamPermissions` | `POST /v1/{resource=projects/*/repos/**}:testIamPermissions` Returns permissions that a caller has on the specified resource. |