# Projects ## CreateProjects `client.projects.bulkCreate(ProjectBulkCreateParamsbody, RequestOptionsoptions?): ProjectBulkCreateResponse` **post** `/gitpod.v1.ProjectService/CreateProjects` Creates multiple projects in a single request. Use this method to: - Onboard multiple repositories at once - Import a batch of projects during initial setup Returns successfully created projects and details about any failures. Each project in the request is processed independently — partial success is possible. ### Examples - Create multiple projects: Creates several projects in one request. ```yaml projects: - name: "Frontend" initializer: specs: - git: remoteUri: "https://github.com/org/frontend" - name: "Backend" initializer: specs: - git: remoteUri: "https://github.com/org/backend" ``` ### Parameters - `body: ProjectBulkCreateParams` - `projects?: Array` - `initializer: EnvironmentInitializer` initializer is the content initializer - `specs?: Array` - `contextUrl?: ContextURL` - `url?: string` url is the URL from which the environment is created - `git?: Git` - `checkoutLocation?: string` a path relative to the environment root in which the code will be checked out to - `cloneTarget?: string` the value for the clone target mode - use depends on the target mode - `remoteUri?: string` remote_uri is the Git remote origin - `targetMode?: "CLONE_TARGET_MODE_UNSPECIFIED" | "CLONE_TARGET_MODE_REMOTE_HEAD" | "CLONE_TARGET_MODE_REMOTE_COMMIT" | 3 more` the target mode determines what gets checked out - `"CLONE_TARGET_MODE_UNSPECIFIED"` - `"CLONE_TARGET_MODE_REMOTE_HEAD"` - `"CLONE_TARGET_MODE_REMOTE_COMMIT"` - `"CLONE_TARGET_MODE_REMOTE_BRANCH"` - `"CLONE_TARGET_MODE_LOCAL_BRANCH"` - `"CLONE_TARGET_MODE_REMOTE_TAG"` - `upstreamRemoteUri?: string` upstream_Remote_uri is the fork upstream of a repository - `automationsFilePath?: string` automations_file_path is the path to the automations file relative to the repo root path must not be absolute (start with a /): ``` this.matches('^$|^[^/].*') ``` - `devcontainerFilePath?: string` devcontainer_file_path is the path to the devcontainer file relative to the repo root path must not be absolute (start with a /): ``` this.matches('^$|^[^/].*') ``` - `name?: string` - `prebuildConfiguration?: ProjectPrebuildConfiguration` prebuild_configuration defines how prebuilds are created for this project. If not set, prebuilds are disabled for the project. - `enabled?: boolean` enabled controls whether prebuilds are created for this project. When disabled, no automatic prebuilds will be triggered. - `enableJetbrainsWarmup?: boolean` enable_jetbrains_warmup controls whether JetBrains IDE warmup runs during prebuilds. - `environmentClassIds?: Array` environment_class_ids specifies which environment classes should have prebuilds created. If empty, no prebuilds are created. - `executor?: Subject` executor specifies who runs prebuilds for this project. The executor's SCM credentials are used to clone the repository. If not set, defaults to the project creator. - `id?: string` id is the UUID of the subject - `principal?: Principal` Principal is the principal of the subject - `"PRINCIPAL_UNSPECIFIED"` - `"PRINCIPAL_ACCOUNT"` - `"PRINCIPAL_USER"` - `"PRINCIPAL_RUNNER"` - `"PRINCIPAL_ENVIRONMENT"` - `"PRINCIPAL_SERVICE_ACCOUNT"` - `"PRINCIPAL_RUNNER_MANAGER"` - `timeout?: string` timeout is the maximum duration allowed for a prebuild to complete. If not specified, defaults to 1 hour. Must be between 5 minutes and 2 hours. - `trigger?: Trigger` trigger defines when prebuilds should be created. - `dailySchedule: DailySchedule` daily_schedule triggers a prebuild once per day at the specified hour (UTC). The actual start time may vary slightly to distribute system load. - `hourUtc?: number` hour_utc is the hour of day (0-23) in UTC when the prebuild should start. The actual start time may be adjusted by a few minutes to balance system load. - `technicalDescription?: string` technical_description is a detailed technical description of the project This field is not returned by default in GetProject or ListProjects responses 8KB max ### Returns - `ProjectBulkCreateResponse` - `createdProjects?: Array` created_projects contains the successfully created projects - `environmentClass: ProjectEnvironmentClass` Use `environment_classes` instead. - `environmentClassId?: string` Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. - `localRunner?: boolean` Use a local runner for the user - `order?: number` order is the priority of this entry - `id?: string` id is the unique identifier for the project - `automationsFilePath?: string` automations_file_path is the path to the automations file relative to the repo root - `desiredPhase?: ProjectPhase` desired_phase is the desired phase of the project When set to DELETED, the project is pending deletion - `"PROJECT_PHASE_UNSPECIFIED"` - `"PROJECT_PHASE_ACTIVE"` - `"PROJECT_PHASE_DELETED"` - `devcontainerFilePath?: string` devcontainer_file_path is the path to the devcontainer file relative to the repo root - `environmentClasses?: Array` environment_classes is the list of environment classes for the project - `environmentClassId?: string` Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. - `localRunner?: boolean` Use a local runner for the user - `order?: number` order is the priority of this entry - `initializer?: EnvironmentInitializer` initializer is the content initializer - `specs?: Array` - `contextUrl?: ContextURL` - `url?: string` url is the URL from which the environment is created - `git?: Git` - `checkoutLocation?: string` a path relative to the environment root in which the code will be checked out to - `cloneTarget?: string` the value for the clone target mode - use depends on the target mode - `remoteUri?: string` remote_uri is the Git remote origin - `targetMode?: "CLONE_TARGET_MODE_UNSPECIFIED" | "CLONE_TARGET_MODE_REMOTE_HEAD" | "CLONE_TARGET_MODE_REMOTE_COMMIT" | 3 more` the target mode determines what gets checked out - `"CLONE_TARGET_MODE_UNSPECIFIED"` - `"CLONE_TARGET_MODE_REMOTE_HEAD"` - `"CLONE_TARGET_MODE_REMOTE_COMMIT"` - `"CLONE_TARGET_MODE_REMOTE_BRANCH"` - `"CLONE_TARGET_MODE_LOCAL_BRANCH"` - `"CLONE_TARGET_MODE_REMOTE_TAG"` - `upstreamRemoteUri?: string` upstream_Remote_uri is the fork upstream of a repository - `metadata?: ProjectMetadata` - `createdAt?: string` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `creator?: Subject` creator is the identity of the project creator - `id?: string` id is the UUID of the subject - `principal?: Principal` Principal is the principal of the subject - `"PRINCIPAL_UNSPECIFIED"` - `"PRINCIPAL_ACCOUNT"` - `"PRINCIPAL_USER"` - `"PRINCIPAL_RUNNER"` - `"PRINCIPAL_ENVIRONMENT"` - `"PRINCIPAL_SERVICE_ACCOUNT"` - `"PRINCIPAL_RUNNER_MANAGER"` - `name?: string` name is the human readable name of the project - `organizationId?: string` organization_id is the ID of the organization that contains the environment - `updatedAt?: string` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `prebuildConfiguration?: ProjectPrebuildConfiguration` prebuild_configuration defines how prebuilds are created for this project. - `enabled?: boolean` enabled controls whether prebuilds are created for this project. When disabled, no automatic prebuilds will be triggered. - `enableJetbrainsWarmup?: boolean` enable_jetbrains_warmup controls whether JetBrains IDE warmup runs during prebuilds. - `environmentClassIds?: Array` environment_class_ids specifies which environment classes should have prebuilds created. If empty, no prebuilds are created. - `executor?: Subject` executor specifies who runs prebuilds for this project. The executor's SCM credentials are used to clone the repository. If not set, defaults to the project creator. - `timeout?: string` timeout is the maximum duration allowed for a prebuild to complete. If not specified, defaults to 1 hour. Must be between 5 minutes and 2 hours. - `trigger?: Trigger` trigger defines when prebuilds should be created. - `dailySchedule: DailySchedule` daily_schedule triggers a prebuild once per day at the specified hour (UTC). The actual start time may vary slightly to distribute system load. - `hourUtc?: number` hour_utc is the hour of day (0-23) in UTC when the prebuild should start. The actual start time may be adjusted by a few minutes to balance system load. - `recommendedEditors?: RecommendedEditors` recommended_editors specifies the editors recommended for this project. - `editors?: Record` editors maps editor aliases to their recommended versions. Key is the editor alias (e.g., "intellij", "goland", "vscode"). Value contains the list of recommended versions for that editor. If versions list is empty, all available versions are recommended. Example: {"intellij": {versions: ["2025.1", "2024.3"]}, "goland": {}} - `versions?: Array` versions is the list of recommended versions for this editor. If empty, all available versions are recommended. Examples for JetBrains: ["2025.1", "2024.3"] - `technicalDescription?: string` technical_description is a detailed technical description of the project This field is not returned by default in GetProject or ListProjects responses - `usedBy?: UsedBy` - `subjects?: Array` Subjects are the 10 most recent subjects who have used the project to create an environment - `id?: string` id is the UUID of the subject - `principal?: Principal` Principal is the principal of the subject - `totalSubjects?: number` Total number of unique subjects who have used the project - `failedProjects?: Array` failed_projects contains details about projects that failed to create - `error?: string` error describes why the project creation failed - `index?: number` index is the position in the request array (0-based) - `name?: string` name is the project name that failed ### Example ```typescript import Gitpod from '@gitpod/sdk'; const client = new Gitpod({ bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted }); const response = await client.projects.bulkCreate({ projects: [ { initializer: { specs: [{ git: { remoteUri: 'https://github.com/org/frontend' } }] }, name: 'Frontend', }, { initializer: { specs: [{ git: { remoteUri: 'https://github.com/org/backend' } }] }, name: 'Backend', }, ], }); console.log(response.createdProjects); ``` #### Response ```json { "createdProjects": [ { "environmentClass": { "environmentClassId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "localRunner": true, "order": 0 }, "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "automationsFilePath": "automationsFilePath", "desiredPhase": "PROJECT_PHASE_UNSPECIFIED", "devcontainerFilePath": "devcontainerFilePath", "environmentClasses": [ { "environmentClassId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "localRunner": true, "order": 0 } ], "initializer": { "specs": [ { "contextUrl": { "url": "https://example.com" }, "git": { "checkoutLocation": "checkoutLocation", "cloneTarget": "cloneTarget", "remoteUri": "remoteUri", "targetMode": "CLONE_TARGET_MODE_UNSPECIFIED", "upstreamRemoteUri": "upstreamRemoteUri" } } ] }, "metadata": { "createdAt": "2019-12-27T18:11:19.117Z", "creator": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED" }, "name": "x", "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "updatedAt": "2019-12-27T18:11:19.117Z" }, "prebuildConfiguration": { "enabled": true, "enableJetbrainsWarmup": true, "environmentClassIds": [ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ], "executor": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED" }, "timeout": "+9125115.360s", "trigger": { "dailySchedule": { "hourUtc": 23 } } }, "recommendedEditors": { "editors": { "foo": { "versions": [ "string" ] } } }, "technicalDescription": "technicalDescription", "usedBy": { "subjects": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED" } ], "totalSubjects": 0 } } ], "failedProjects": [ { "error": "error", "index": 0, "name": "name" } ] } ``` ## DeleteProjects `client.projects.bulkDelete(ProjectBulkDeleteParamsbody, RequestOptionsoptions?): ProjectBulkDeleteResponse` **post** `/gitpod.v1.ProjectService/DeleteProjects` Deletes multiple projects in a single request. Use this method to: - Remove multiple unused projects at once - Clean up projects in batch Returns successfully deleted project IDs and details about any failures. Each project in the request is processed independently — partial success is possible. ### Examples - Delete multiple projects: Permanently removes several projects in one request. ```yaml projectIds: - "b0e12f6c-4c67-429d-a4a6-d9838b5da047" - "c1f23g7d-5d78-430e-b5b7-e0949c6eb158" ``` ### Parameters - `body: ProjectBulkDeleteParams` - `projectIds?: Array` ### Returns - `ProjectBulkDeleteResponse` - `deletedProjectIds?: Array` deleted_project_ids contains the IDs of successfully deleted projects - `failedProjects?: Array` failed_projects contains details about projects that failed to delete - `error?: string` error describes why the project deletion failed - `index?: number` index is the position in the request array (0-based) - `projectId?: string` project_id is the project ID that failed ### Example ```typescript import Gitpod from '@gitpod/sdk'; const client = new Gitpod({ bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted }); const response = await client.projects.bulkDelete({ projectIds: ['b0e12f6c-4c67-429d-a4a6-d9838b5da047', 'c1f23g7d-5d78-430e-b5b7-e0949c6eb158'], }); console.log(response.deletedProjectIds); ``` #### Response ```json { "deletedProjectIds": [ "string" ], "failedProjects": [ { "error": "error", "index": 0, "projectId": "projectId" } ] } ``` ## UpdateProjects `client.projects.bulkUpdate(ProjectBulkUpdateParamsbody, RequestOptionsoptions?): ProjectBulkUpdateResponse` **post** `/gitpod.v1.ProjectService/UpdateProjects` Updates multiple projects in a single request. Use this method to: - Modify settings across multiple projects at once - Apply configuration changes in batch Returns successfully updated projects and details about any failures. Each project in the request is processed independently — partial success is possible. ### Examples - Update multiple projects: Updates several projects in one request. ```yaml projects: - projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" name: "Updated Frontend" - projectId: "c1f23g7d-5d78-430e-b5b7-e0949c6eb158" name: "Updated Backend" ``` ### Parameters - `body: ProjectBulkUpdateParams` - `projects?: Array` - `automationsFilePath?: string | null` automations_file_path is the path to the automations file relative to the repo root path must not be absolute (start with a /): ``` this.matches('^$|^[^/].*') ``` - `devcontainerFilePath?: string | null` devcontainer_file_path is the path to the devcontainer file relative to the repo root path must not be absolute (start with a /): ``` this.matches('^$|^[^/].*') ``` - `initializer?: EnvironmentInitializer | null` initializer is the content initializer - `specs?: Array` - `contextUrl?: ContextURL` - `url?: string` url is the URL from which the environment is created - `git?: Git` - `checkoutLocation?: string` a path relative to the environment root in which the code will be checked out to - `cloneTarget?: string` the value for the clone target mode - use depends on the target mode - `remoteUri?: string` remote_uri is the Git remote origin - `targetMode?: "CLONE_TARGET_MODE_UNSPECIFIED" | "CLONE_TARGET_MODE_REMOTE_HEAD" | "CLONE_TARGET_MODE_REMOTE_COMMIT" | 3 more` the target mode determines what gets checked out - `"CLONE_TARGET_MODE_UNSPECIFIED"` - `"CLONE_TARGET_MODE_REMOTE_HEAD"` - `"CLONE_TARGET_MODE_REMOTE_COMMIT"` - `"CLONE_TARGET_MODE_REMOTE_BRANCH"` - `"CLONE_TARGET_MODE_LOCAL_BRANCH"` - `"CLONE_TARGET_MODE_REMOTE_TAG"` - `upstreamRemoteUri?: string` upstream_Remote_uri is the fork upstream of a repository - `name?: string | null` - `prebuildConfiguration?: ProjectPrebuildConfiguration | null` prebuild_configuration defines how prebuilds are created for this project. If not provided, the existing prebuild configuration is not modified. To disable prebuilds, set enabled to false. - `enabled?: boolean` enabled controls whether prebuilds are created for this project. When disabled, no automatic prebuilds will be triggered. - `enableJetbrainsWarmup?: boolean` enable_jetbrains_warmup controls whether JetBrains IDE warmup runs during prebuilds. - `environmentClassIds?: Array` environment_class_ids specifies which environment classes should have prebuilds created. If empty, no prebuilds are created. - `executor?: Subject` executor specifies who runs prebuilds for this project. The executor's SCM credentials are used to clone the repository. If not set, defaults to the project creator. - `id?: string` id is the UUID of the subject - `principal?: Principal` Principal is the principal of the subject - `"PRINCIPAL_UNSPECIFIED"` - `"PRINCIPAL_ACCOUNT"` - `"PRINCIPAL_USER"` - `"PRINCIPAL_RUNNER"` - `"PRINCIPAL_ENVIRONMENT"` - `"PRINCIPAL_SERVICE_ACCOUNT"` - `"PRINCIPAL_RUNNER_MANAGER"` - `timeout?: string` timeout is the maximum duration allowed for a prebuild to complete. If not specified, defaults to 1 hour. Must be between 5 minutes and 2 hours. - `trigger?: Trigger` trigger defines when prebuilds should be created. - `dailySchedule: DailySchedule` daily_schedule triggers a prebuild once per day at the specified hour (UTC). The actual start time may vary slightly to distribute system load. - `hourUtc?: number` hour_utc is the hour of day (0-23) in UTC when the prebuild should start. The actual start time may be adjusted by a few minutes to balance system load. - `projectId?: string` project_id specifies the project identifier - `recommendedEditors?: RecommendedEditors | null` recommended_editors specifies the editors recommended for this project. If not provided, the existing recommended editors are not modified. To clear all recommended editors, set to an empty RecommendedEditors message. - `editors?: Record` editors maps editor aliases to their recommended versions. Key is the editor alias (e.g., "intellij", "goland", "vscode"). Value contains the list of recommended versions for that editor. If versions list is empty, all available versions are recommended. Example: {"intellij": {versions: ["2025.1", "2024.3"]}, "goland": {}} - `versions?: Array` versions is the list of recommended versions for this editor. If empty, all available versions are recommended. Examples for JetBrains: ["2025.1", "2024.3"] - `technicalDescription?: string | null` technical_description is a detailed technical description of the project This field is not returned by default in GetProject or ListProjects responses 8KB max ### Returns - `ProjectBulkUpdateResponse` - `failedProjects?: Array` failed_projects contains details about projects that failed to update - `error?: string` error describes why the project update failed - `index?: number` index is the position in the request array (0-based) - `projectId?: string` project_id is the project ID that failed - `updatedProjects?: Array` updated_projects contains the successfully updated projects - `environmentClass: ProjectEnvironmentClass` Use `environment_classes` instead. - `environmentClassId?: string` Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. - `localRunner?: boolean` Use a local runner for the user - `order?: number` order is the priority of this entry - `id?: string` id is the unique identifier for the project - `automationsFilePath?: string` automations_file_path is the path to the automations file relative to the repo root - `desiredPhase?: ProjectPhase` desired_phase is the desired phase of the project When set to DELETED, the project is pending deletion - `"PROJECT_PHASE_UNSPECIFIED"` - `"PROJECT_PHASE_ACTIVE"` - `"PROJECT_PHASE_DELETED"` - `devcontainerFilePath?: string` devcontainer_file_path is the path to the devcontainer file relative to the repo root - `environmentClasses?: Array` environment_classes is the list of environment classes for the project - `environmentClassId?: string` Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. - `localRunner?: boolean` Use a local runner for the user - `order?: number` order is the priority of this entry - `initializer?: EnvironmentInitializer` initializer is the content initializer - `specs?: Array` - `contextUrl?: ContextURL` - `url?: string` url is the URL from which the environment is created - `git?: Git` - `checkoutLocation?: string` a path relative to the environment root in which the code will be checked out to - `cloneTarget?: string` the value for the clone target mode - use depends on the target mode - `remoteUri?: string` remote_uri is the Git remote origin - `targetMode?: "CLONE_TARGET_MODE_UNSPECIFIED" | "CLONE_TARGET_MODE_REMOTE_HEAD" | "CLONE_TARGET_MODE_REMOTE_COMMIT" | 3 more` the target mode determines what gets checked out - `"CLONE_TARGET_MODE_UNSPECIFIED"` - `"CLONE_TARGET_MODE_REMOTE_HEAD"` - `"CLONE_TARGET_MODE_REMOTE_COMMIT"` - `"CLONE_TARGET_MODE_REMOTE_BRANCH"` - `"CLONE_TARGET_MODE_LOCAL_BRANCH"` - `"CLONE_TARGET_MODE_REMOTE_TAG"` - `upstreamRemoteUri?: string` upstream_Remote_uri is the fork upstream of a repository - `metadata?: ProjectMetadata` - `createdAt?: string` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `creator?: Subject` creator is the identity of the project creator - `id?: string` id is the UUID of the subject - `principal?: Principal` Principal is the principal of the subject - `"PRINCIPAL_UNSPECIFIED"` - `"PRINCIPAL_ACCOUNT"` - `"PRINCIPAL_USER"` - `"PRINCIPAL_RUNNER"` - `"PRINCIPAL_ENVIRONMENT"` - `"PRINCIPAL_SERVICE_ACCOUNT"` - `"PRINCIPAL_RUNNER_MANAGER"` - `name?: string` name is the human readable name of the project - `organizationId?: string` organization_id is the ID of the organization that contains the environment - `updatedAt?: string` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `prebuildConfiguration?: ProjectPrebuildConfiguration` prebuild_configuration defines how prebuilds are created for this project. - `enabled?: boolean` enabled controls whether prebuilds are created for this project. When disabled, no automatic prebuilds will be triggered. - `enableJetbrainsWarmup?: boolean` enable_jetbrains_warmup controls whether JetBrains IDE warmup runs during prebuilds. - `environmentClassIds?: Array` environment_class_ids specifies which environment classes should have prebuilds created. If empty, no prebuilds are created. - `executor?: Subject` executor specifies who runs prebuilds for this project. The executor's SCM credentials are used to clone the repository. If not set, defaults to the project creator. - `timeout?: string` timeout is the maximum duration allowed for a prebuild to complete. If not specified, defaults to 1 hour. Must be between 5 minutes and 2 hours. - `trigger?: Trigger` trigger defines when prebuilds should be created. - `dailySchedule: DailySchedule` daily_schedule triggers a prebuild once per day at the specified hour (UTC). The actual start time may vary slightly to distribute system load. - `hourUtc?: number` hour_utc is the hour of day (0-23) in UTC when the prebuild should start. The actual start time may be adjusted by a few minutes to balance system load. - `recommendedEditors?: RecommendedEditors` recommended_editors specifies the editors recommended for this project. - `editors?: Record` editors maps editor aliases to their recommended versions. Key is the editor alias (e.g., "intellij", "goland", "vscode"). Value contains the list of recommended versions for that editor. If versions list is empty, all available versions are recommended. Example: {"intellij": {versions: ["2025.1", "2024.3"]}, "goland": {}} - `versions?: Array` versions is the list of recommended versions for this editor. If empty, all available versions are recommended. Examples for JetBrains: ["2025.1", "2024.3"] - `technicalDescription?: string` technical_description is a detailed technical description of the project This field is not returned by default in GetProject or ListProjects responses - `usedBy?: UsedBy` - `subjects?: Array` Subjects are the 10 most recent subjects who have used the project to create an environment - `id?: string` id is the UUID of the subject - `principal?: Principal` Principal is the principal of the subject - `totalSubjects?: number` Total number of unique subjects who have used the project ### Example ```typescript import Gitpod from '@gitpod/sdk'; const client = new Gitpod({ bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted }); const response = await client.projects.bulkUpdate({ projects: [ { name: 'Updated Frontend', projectId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047' }, { name: 'Updated Backend', projectId: 'c1f23g7d-5d78-430e-b5b7-e0949c6eb158' }, ], }); console.log(response.failedProjects); ``` #### Response ```json { "failedProjects": [ { "error": "error", "index": 0, "projectId": "projectId" } ], "updatedProjects": [ { "environmentClass": { "environmentClassId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "localRunner": true, "order": 0 }, "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "automationsFilePath": "automationsFilePath", "desiredPhase": "PROJECT_PHASE_UNSPECIFIED", "devcontainerFilePath": "devcontainerFilePath", "environmentClasses": [ { "environmentClassId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "localRunner": true, "order": 0 } ], "initializer": { "specs": [ { "contextUrl": { "url": "https://example.com" }, "git": { "checkoutLocation": "checkoutLocation", "cloneTarget": "cloneTarget", "remoteUri": "remoteUri", "targetMode": "CLONE_TARGET_MODE_UNSPECIFIED", "upstreamRemoteUri": "upstreamRemoteUri" } } ] }, "metadata": { "createdAt": "2019-12-27T18:11:19.117Z", "creator": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED" }, "name": "x", "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "updatedAt": "2019-12-27T18:11:19.117Z" }, "prebuildConfiguration": { "enabled": true, "enableJetbrainsWarmup": true, "environmentClassIds": [ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ], "executor": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED" }, "timeout": "+9125115.360s", "trigger": { "dailySchedule": { "hourUtc": 23 } } }, "recommendedEditors": { "editors": { "foo": { "versions": [ "string" ] } } }, "technicalDescription": "technicalDescription", "usedBy": { "subjects": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED" } ], "totalSubjects": 0 } } ] } ``` ## CreateProject `client.projects.create(ProjectCreateParamsbody, RequestOptionsoptions?): ProjectCreateResponse` **post** `/gitpod.v1.ProjectService/CreateProject` Creates a new project with specified configuration. Use this method to: - Set up development projects - Configure project environments - Define project settings - Initialize project content ### Examples - Create basic project: Creates a project with minimal configuration. ```yaml name: "Web Application" initializer: specs: - git: remoteUri: "https://github.com/org/repo" ``` - Create project with devcontainer: Creates a project with custom development container. ```yaml name: "Backend Service" initializer: specs: - git: remoteUri: "https://github.com/org/backend" devcontainerFilePath: ".devcontainer/devcontainer.json" automationsFilePath: ".gitpod/automations.yaml" ``` ### Parameters - `body: ProjectCreateParams` - `initializer: EnvironmentInitializer` initializer is the content initializer - `specs?: Array` - `contextUrl?: ContextURL` - `url?: string` url is the URL from which the environment is created - `git?: Git` - `checkoutLocation?: string` a path relative to the environment root in which the code will be checked out to - `cloneTarget?: string` the value for the clone target mode - use depends on the target mode - `remoteUri?: string` remote_uri is the Git remote origin - `targetMode?: "CLONE_TARGET_MODE_UNSPECIFIED" | "CLONE_TARGET_MODE_REMOTE_HEAD" | "CLONE_TARGET_MODE_REMOTE_COMMIT" | 3 more` the target mode determines what gets checked out - `"CLONE_TARGET_MODE_UNSPECIFIED"` - `"CLONE_TARGET_MODE_REMOTE_HEAD"` - `"CLONE_TARGET_MODE_REMOTE_COMMIT"` - `"CLONE_TARGET_MODE_REMOTE_BRANCH"` - `"CLONE_TARGET_MODE_LOCAL_BRANCH"` - `"CLONE_TARGET_MODE_REMOTE_TAG"` - `upstreamRemoteUri?: string` upstream_Remote_uri is the fork upstream of a repository - `automationsFilePath?: string` automations_file_path is the path to the automations file relative to the repo root path must not be absolute (start with a /): ``` this.matches('^$|^[^/].*') ``` - `devcontainerFilePath?: string` devcontainer_file_path is the path to the devcontainer file relative to the repo root path must not be absolute (start with a /): ``` this.matches('^$|^[^/].*') ``` - `name?: string` - `prebuildConfiguration?: ProjectPrebuildConfiguration` prebuild_configuration defines how prebuilds are created for this project. If not set, prebuilds are disabled for the project. - `enabled?: boolean` enabled controls whether prebuilds are created for this project. When disabled, no automatic prebuilds will be triggered. - `enableJetbrainsWarmup?: boolean` enable_jetbrains_warmup controls whether JetBrains IDE warmup runs during prebuilds. - `environmentClassIds?: Array` environment_class_ids specifies which environment classes should have prebuilds created. If empty, no prebuilds are created. - `executor?: Subject` executor specifies who runs prebuilds for this project. The executor's SCM credentials are used to clone the repository. If not set, defaults to the project creator. - `id?: string` id is the UUID of the subject - `principal?: Principal` Principal is the principal of the subject - `"PRINCIPAL_UNSPECIFIED"` - `"PRINCIPAL_ACCOUNT"` - `"PRINCIPAL_USER"` - `"PRINCIPAL_RUNNER"` - `"PRINCIPAL_ENVIRONMENT"` - `"PRINCIPAL_SERVICE_ACCOUNT"` - `"PRINCIPAL_RUNNER_MANAGER"` - `timeout?: string` timeout is the maximum duration allowed for a prebuild to complete. If not specified, defaults to 1 hour. Must be between 5 minutes and 2 hours. - `trigger?: Trigger` trigger defines when prebuilds should be created. - `dailySchedule: DailySchedule` daily_schedule triggers a prebuild once per day at the specified hour (UTC). The actual start time may vary slightly to distribute system load. - `hourUtc?: number` hour_utc is the hour of day (0-23) in UTC when the prebuild should start. The actual start time may be adjusted by a few minutes to balance system load. - `technicalDescription?: string` technical_description is a detailed technical description of the project This field is not returned by default in GetProject or ListProjects responses 8KB max ### Returns - `ProjectCreateResponse` - `project?: Project` - `environmentClass: ProjectEnvironmentClass` Use `environment_classes` instead. - `environmentClassId?: string` Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. - `localRunner?: boolean` Use a local runner for the user - `order?: number` order is the priority of this entry - `id?: string` id is the unique identifier for the project - `automationsFilePath?: string` automations_file_path is the path to the automations file relative to the repo root - `desiredPhase?: ProjectPhase` desired_phase is the desired phase of the project When set to DELETED, the project is pending deletion - `"PROJECT_PHASE_UNSPECIFIED"` - `"PROJECT_PHASE_ACTIVE"` - `"PROJECT_PHASE_DELETED"` - `devcontainerFilePath?: string` devcontainer_file_path is the path to the devcontainer file relative to the repo root - `environmentClasses?: Array` environment_classes is the list of environment classes for the project - `environmentClassId?: string` Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. - `localRunner?: boolean` Use a local runner for the user - `order?: number` order is the priority of this entry - `initializer?: EnvironmentInitializer` initializer is the content initializer - `specs?: Array` - `contextUrl?: ContextURL` - `url?: string` url is the URL from which the environment is created - `git?: Git` - `checkoutLocation?: string` a path relative to the environment root in which the code will be checked out to - `cloneTarget?: string` the value for the clone target mode - use depends on the target mode - `remoteUri?: string` remote_uri is the Git remote origin - `targetMode?: "CLONE_TARGET_MODE_UNSPECIFIED" | "CLONE_TARGET_MODE_REMOTE_HEAD" | "CLONE_TARGET_MODE_REMOTE_COMMIT" | 3 more` the target mode determines what gets checked out - `"CLONE_TARGET_MODE_UNSPECIFIED"` - `"CLONE_TARGET_MODE_REMOTE_HEAD"` - `"CLONE_TARGET_MODE_REMOTE_COMMIT"` - `"CLONE_TARGET_MODE_REMOTE_BRANCH"` - `"CLONE_TARGET_MODE_LOCAL_BRANCH"` - `"CLONE_TARGET_MODE_REMOTE_TAG"` - `upstreamRemoteUri?: string` upstream_Remote_uri is the fork upstream of a repository - `metadata?: ProjectMetadata` - `createdAt?: string` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `creator?: Subject` creator is the identity of the project creator - `id?: string` id is the UUID of the subject - `principal?: Principal` Principal is the principal of the subject - `"PRINCIPAL_UNSPECIFIED"` - `"PRINCIPAL_ACCOUNT"` - `"PRINCIPAL_USER"` - `"PRINCIPAL_RUNNER"` - `"PRINCIPAL_ENVIRONMENT"` - `"PRINCIPAL_SERVICE_ACCOUNT"` - `"PRINCIPAL_RUNNER_MANAGER"` - `name?: string` name is the human readable name of the project - `organizationId?: string` organization_id is the ID of the organization that contains the environment - `updatedAt?: string` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `prebuildConfiguration?: ProjectPrebuildConfiguration` prebuild_configuration defines how prebuilds are created for this project. - `enabled?: boolean` enabled controls whether prebuilds are created for this project. When disabled, no automatic prebuilds will be triggered. - `enableJetbrainsWarmup?: boolean` enable_jetbrains_warmup controls whether JetBrains IDE warmup runs during prebuilds. - `environmentClassIds?: Array` environment_class_ids specifies which environment classes should have prebuilds created. If empty, no prebuilds are created. - `executor?: Subject` executor specifies who runs prebuilds for this project. The executor's SCM credentials are used to clone the repository. If not set, defaults to the project creator. - `timeout?: string` timeout is the maximum duration allowed for a prebuild to complete. If not specified, defaults to 1 hour. Must be between 5 minutes and 2 hours. - `trigger?: Trigger` trigger defines when prebuilds should be created. - `dailySchedule: DailySchedule` daily_schedule triggers a prebuild once per day at the specified hour (UTC). The actual start time may vary slightly to distribute system load. - `hourUtc?: number` hour_utc is the hour of day (0-23) in UTC when the prebuild should start. The actual start time may be adjusted by a few minutes to balance system load. - `recommendedEditors?: RecommendedEditors` recommended_editors specifies the editors recommended for this project. - `editors?: Record` editors maps editor aliases to their recommended versions. Key is the editor alias (e.g., "intellij", "goland", "vscode"). Value contains the list of recommended versions for that editor. If versions list is empty, all available versions are recommended. Example: {"intellij": {versions: ["2025.1", "2024.3"]}, "goland": {}} - `versions?: Array` versions is the list of recommended versions for this editor. If empty, all available versions are recommended. Examples for JetBrains: ["2025.1", "2024.3"] - `technicalDescription?: string` technical_description is a detailed technical description of the project This field is not returned by default in GetProject or ListProjects responses - `usedBy?: UsedBy` - `subjects?: Array` Subjects are the 10 most recent subjects who have used the project to create an environment - `id?: string` id is the UUID of the subject - `principal?: Principal` Principal is the principal of the subject - `totalSubjects?: number` Total number of unique subjects who have used the project ### Example ```typescript import Gitpod from '@gitpod/sdk'; const client = new Gitpod({ bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted }); const project = await client.projects.create({ initializer: { specs: [{ git: { remoteUri: 'https://github.com/org/repo' } }] }, name: 'Web Application', }); console.log(project.project); ``` #### Response ```json { "project": { "environmentClass": { "environmentClassId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "localRunner": true, "order": 0 }, "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "automationsFilePath": "automationsFilePath", "desiredPhase": "PROJECT_PHASE_UNSPECIFIED", "devcontainerFilePath": "devcontainerFilePath", "environmentClasses": [ { "environmentClassId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "localRunner": true, "order": 0 } ], "initializer": { "specs": [ { "contextUrl": { "url": "https://example.com" }, "git": { "checkoutLocation": "checkoutLocation", "cloneTarget": "cloneTarget", "remoteUri": "remoteUri", "targetMode": "CLONE_TARGET_MODE_UNSPECIFIED", "upstreamRemoteUri": "upstreamRemoteUri" } } ] }, "metadata": { "createdAt": "2019-12-27T18:11:19.117Z", "creator": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED" }, "name": "x", "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "updatedAt": "2019-12-27T18:11:19.117Z" }, "prebuildConfiguration": { "enabled": true, "enableJetbrainsWarmup": true, "environmentClassIds": [ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ], "executor": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED" }, "timeout": "+9125115.360s", "trigger": { "dailySchedule": { "hourUtc": 23 } } }, "recommendedEditors": { "editors": { "foo": { "versions": [ "string" ] } } }, "technicalDescription": "technicalDescription", "usedBy": { "subjects": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED" } ], "totalSubjects": 0 } } } ``` ## CreateProjectFromEnvironment `client.projects.createFromEnvironment(ProjectCreateFromEnvironmentParamsbody, RequestOptionsoptions?): ProjectCreateFromEnvironmentResponse` **post** `/gitpod.v1.ProjectService/CreateProjectFromEnvironment` Creates a new project using an existing environment as a template. Use this method to: - Clone environment configurations - Create projects from templates - Share environment setups ### Examples - Create from environment: Creates a project based on existing environment. ```yaml name: "Frontend Project" environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" ``` ### Parameters - `body: ProjectCreateFromEnvironmentParams` - `environmentId?: string` environment_id specifies the environment identifier - `name?: string` ### Returns - `ProjectCreateFromEnvironmentResponse` - `project?: Project` - `environmentClass: ProjectEnvironmentClass` Use `environment_classes` instead. - `environmentClassId?: string` Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. - `localRunner?: boolean` Use a local runner for the user - `order?: number` order is the priority of this entry - `id?: string` id is the unique identifier for the project - `automationsFilePath?: string` automations_file_path is the path to the automations file relative to the repo root - `desiredPhase?: ProjectPhase` desired_phase is the desired phase of the project When set to DELETED, the project is pending deletion - `"PROJECT_PHASE_UNSPECIFIED"` - `"PROJECT_PHASE_ACTIVE"` - `"PROJECT_PHASE_DELETED"` - `devcontainerFilePath?: string` devcontainer_file_path is the path to the devcontainer file relative to the repo root - `environmentClasses?: Array` environment_classes is the list of environment classes for the project - `environmentClassId?: string` Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. - `localRunner?: boolean` Use a local runner for the user - `order?: number` order is the priority of this entry - `initializer?: EnvironmentInitializer` initializer is the content initializer - `specs?: Array` - `contextUrl?: ContextURL` - `url?: string` url is the URL from which the environment is created - `git?: Git` - `checkoutLocation?: string` a path relative to the environment root in which the code will be checked out to - `cloneTarget?: string` the value for the clone target mode - use depends on the target mode - `remoteUri?: string` remote_uri is the Git remote origin - `targetMode?: "CLONE_TARGET_MODE_UNSPECIFIED" | "CLONE_TARGET_MODE_REMOTE_HEAD" | "CLONE_TARGET_MODE_REMOTE_COMMIT" | 3 more` the target mode determines what gets checked out - `"CLONE_TARGET_MODE_UNSPECIFIED"` - `"CLONE_TARGET_MODE_REMOTE_HEAD"` - `"CLONE_TARGET_MODE_REMOTE_COMMIT"` - `"CLONE_TARGET_MODE_REMOTE_BRANCH"` - `"CLONE_TARGET_MODE_LOCAL_BRANCH"` - `"CLONE_TARGET_MODE_REMOTE_TAG"` - `upstreamRemoteUri?: string` upstream_Remote_uri is the fork upstream of a repository - `metadata?: ProjectMetadata` - `createdAt?: string` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `creator?: Subject` creator is the identity of the project creator - `id?: string` id is the UUID of the subject - `principal?: Principal` Principal is the principal of the subject - `"PRINCIPAL_UNSPECIFIED"` - `"PRINCIPAL_ACCOUNT"` - `"PRINCIPAL_USER"` - `"PRINCIPAL_RUNNER"` - `"PRINCIPAL_ENVIRONMENT"` - `"PRINCIPAL_SERVICE_ACCOUNT"` - `"PRINCIPAL_RUNNER_MANAGER"` - `name?: string` name is the human readable name of the project - `organizationId?: string` organization_id is the ID of the organization that contains the environment - `updatedAt?: string` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `prebuildConfiguration?: ProjectPrebuildConfiguration` prebuild_configuration defines how prebuilds are created for this project. - `enabled?: boolean` enabled controls whether prebuilds are created for this project. When disabled, no automatic prebuilds will be triggered. - `enableJetbrainsWarmup?: boolean` enable_jetbrains_warmup controls whether JetBrains IDE warmup runs during prebuilds. - `environmentClassIds?: Array` environment_class_ids specifies which environment classes should have prebuilds created. If empty, no prebuilds are created. - `executor?: Subject` executor specifies who runs prebuilds for this project. The executor's SCM credentials are used to clone the repository. If not set, defaults to the project creator. - `timeout?: string` timeout is the maximum duration allowed for a prebuild to complete. If not specified, defaults to 1 hour. Must be between 5 minutes and 2 hours. - `trigger?: Trigger` trigger defines when prebuilds should be created. - `dailySchedule: DailySchedule` daily_schedule triggers a prebuild once per day at the specified hour (UTC). The actual start time may vary slightly to distribute system load. - `hourUtc?: number` hour_utc is the hour of day (0-23) in UTC when the prebuild should start. The actual start time may be adjusted by a few minutes to balance system load. - `recommendedEditors?: RecommendedEditors` recommended_editors specifies the editors recommended for this project. - `editors?: Record` editors maps editor aliases to their recommended versions. Key is the editor alias (e.g., "intellij", "goland", "vscode"). Value contains the list of recommended versions for that editor. If versions list is empty, all available versions are recommended. Example: {"intellij": {versions: ["2025.1", "2024.3"]}, "goland": {}} - `versions?: Array` versions is the list of recommended versions for this editor. If empty, all available versions are recommended. Examples for JetBrains: ["2025.1", "2024.3"] - `technicalDescription?: string` technical_description is a detailed technical description of the project This field is not returned by default in GetProject or ListProjects responses - `usedBy?: UsedBy` - `subjects?: Array` Subjects are the 10 most recent subjects who have used the project to create an environment - `id?: string` id is the UUID of the subject - `principal?: Principal` Principal is the principal of the subject - `totalSubjects?: number` Total number of unique subjects who have used the project ### Example ```typescript import Gitpod from '@gitpod/sdk'; const client = new Gitpod({ bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted }); const response = await client.projects.createFromEnvironment({ environmentId: '07e03a28-65a5-4d98-b532-8ea67b188048', name: 'Frontend Project', }); console.log(response.project); ``` #### Response ```json { "project": { "environmentClass": { "environmentClassId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "localRunner": true, "order": 0 }, "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "automationsFilePath": "automationsFilePath", "desiredPhase": "PROJECT_PHASE_UNSPECIFIED", "devcontainerFilePath": "devcontainerFilePath", "environmentClasses": [ { "environmentClassId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "localRunner": true, "order": 0 } ], "initializer": { "specs": [ { "contextUrl": { "url": "https://example.com" }, "git": { "checkoutLocation": "checkoutLocation", "cloneTarget": "cloneTarget", "remoteUri": "remoteUri", "targetMode": "CLONE_TARGET_MODE_UNSPECIFIED", "upstreamRemoteUri": "upstreamRemoteUri" } } ] }, "metadata": { "createdAt": "2019-12-27T18:11:19.117Z", "creator": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED" }, "name": "x", "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "updatedAt": "2019-12-27T18:11:19.117Z" }, "prebuildConfiguration": { "enabled": true, "enableJetbrainsWarmup": true, "environmentClassIds": [ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ], "executor": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED" }, "timeout": "+9125115.360s", "trigger": { "dailySchedule": { "hourUtc": 23 } } }, "recommendedEditors": { "editors": { "foo": { "versions": [ "string" ] } } }, "technicalDescription": "technicalDescription", "usedBy": { "subjects": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED" } ], "totalSubjects": 0 } } } ``` ## DeleteProject `client.projects.delete(ProjectDeleteParamsbody, RequestOptionsoptions?): ProjectDeleteResponse` **post** `/gitpod.v1.ProjectService/DeleteProject` Deletes a project permanently. Use this method to: - Remove unused projects - Clean up test projects - Delete obsolete configurations ### Examples - Delete project: Permanently removes a project. ```yaml projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" ``` ### Parameters - `body: ProjectDeleteParams` - `projectId?: string` project_id specifies the project identifier ### Returns - `ProjectDeleteResponse = unknown` ### Example ```typescript import Gitpod from '@gitpod/sdk'; const client = new Gitpod({ bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted }); const project = await client.projects.delete({ projectId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047' }); console.log(project); ``` #### Response ```json {} ``` ## ListProjects `client.projects.list(ProjectListParamsparams, RequestOptionsoptions?): ProjectsPage` **post** `/gitpod.v1.ProjectService/ListProjects` Lists projects with optional filtering. Use this method to: - View all accessible projects - Browse project configurations - Monitor project status ### Examples - List projects: Shows all projects with pagination. ```yaml pagination: pageSize: 20 ``` ### Parameters - `params: ProjectListParams` - `token?: string` Query param - `pageSize?: number` Query param - `filter?: Filter` Body param - `projectIds?: Array` project_ids filters the response to only projects with these IDs - `runnerIds?: Array` runner_ids filters the response to only projects that use environment classes from these runners - `runnerKinds?: Array` runner_kinds filters the response to only projects that use environment classes from runners of these kinds - `"RUNNER_KIND_UNSPECIFIED"` - `"RUNNER_KIND_LOCAL"` - `"RUNNER_KIND_REMOTE"` - `"RUNNER_KIND_LOCAL_CONFIGURATION"` - `search?: string` search performs case-insensitive search across project name, project ID, and repository name - `pagination?: Pagination` Body param: pagination contains the pagination options for listing organizations - `token?: string` Token for the next set of results that was returned as next_token of a PaginationResponse - `pageSize?: number` Page size is the maximum number of results to retrieve per page. Defaults to 25. Maximum 100. - `sort?: Sort` Body param: sort specifies the order of results. Defaults to popularity descending. Supported fields: - "id": Sort by project ID (UUID v7, effectively creation order). Produces a stable, deterministic result set suitable for consistent pagination. - "popularity": Sort by popularity — a precomputed score based on recent environment creation activity. Updated periodically by a background job. - `field?: string` Field name to sort by, in camelCase. - `order?: SortOrder` - `"SORT_ORDER_UNSPECIFIED"` - `"SORT_ORDER_ASC"` - `"SORT_ORDER_DESC"` ### Returns - `Project` - `environmentClass: ProjectEnvironmentClass` Use `environment_classes` instead. - `environmentClassId?: string` Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. - `localRunner?: boolean` Use a local runner for the user - `order?: number` order is the priority of this entry - `id?: string` id is the unique identifier for the project - `automationsFilePath?: string` automations_file_path is the path to the automations file relative to the repo root - `desiredPhase?: ProjectPhase` desired_phase is the desired phase of the project When set to DELETED, the project is pending deletion - `"PROJECT_PHASE_UNSPECIFIED"` - `"PROJECT_PHASE_ACTIVE"` - `"PROJECT_PHASE_DELETED"` - `devcontainerFilePath?: string` devcontainer_file_path is the path to the devcontainer file relative to the repo root - `environmentClasses?: Array` environment_classes is the list of environment classes for the project - `environmentClassId?: string` Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. - `localRunner?: boolean` Use a local runner for the user - `order?: number` order is the priority of this entry - `initializer?: EnvironmentInitializer` initializer is the content initializer - `specs?: Array` - `contextUrl?: ContextURL` - `url?: string` url is the URL from which the environment is created - `git?: Git` - `checkoutLocation?: string` a path relative to the environment root in which the code will be checked out to - `cloneTarget?: string` the value for the clone target mode - use depends on the target mode - `remoteUri?: string` remote_uri is the Git remote origin - `targetMode?: "CLONE_TARGET_MODE_UNSPECIFIED" | "CLONE_TARGET_MODE_REMOTE_HEAD" | "CLONE_TARGET_MODE_REMOTE_COMMIT" | 3 more` the target mode determines what gets checked out - `"CLONE_TARGET_MODE_UNSPECIFIED"` - `"CLONE_TARGET_MODE_REMOTE_HEAD"` - `"CLONE_TARGET_MODE_REMOTE_COMMIT"` - `"CLONE_TARGET_MODE_REMOTE_BRANCH"` - `"CLONE_TARGET_MODE_LOCAL_BRANCH"` - `"CLONE_TARGET_MODE_REMOTE_TAG"` - `upstreamRemoteUri?: string` upstream_Remote_uri is the fork upstream of a repository - `metadata?: ProjectMetadata` - `createdAt?: string` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `creator?: Subject` creator is the identity of the project creator - `id?: string` id is the UUID of the subject - `principal?: Principal` Principal is the principal of the subject - `"PRINCIPAL_UNSPECIFIED"` - `"PRINCIPAL_ACCOUNT"` - `"PRINCIPAL_USER"` - `"PRINCIPAL_RUNNER"` - `"PRINCIPAL_ENVIRONMENT"` - `"PRINCIPAL_SERVICE_ACCOUNT"` - `"PRINCIPAL_RUNNER_MANAGER"` - `name?: string` name is the human readable name of the project - `organizationId?: string` organization_id is the ID of the organization that contains the environment - `updatedAt?: string` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `prebuildConfiguration?: ProjectPrebuildConfiguration` prebuild_configuration defines how prebuilds are created for this project. - `enabled?: boolean` enabled controls whether prebuilds are created for this project. When disabled, no automatic prebuilds will be triggered. - `enableJetbrainsWarmup?: boolean` enable_jetbrains_warmup controls whether JetBrains IDE warmup runs during prebuilds. - `environmentClassIds?: Array` environment_class_ids specifies which environment classes should have prebuilds created. If empty, no prebuilds are created. - `executor?: Subject` executor specifies who runs prebuilds for this project. The executor's SCM credentials are used to clone the repository. If not set, defaults to the project creator. - `timeout?: string` timeout is the maximum duration allowed for a prebuild to complete. If not specified, defaults to 1 hour. Must be between 5 minutes and 2 hours. - `trigger?: Trigger` trigger defines when prebuilds should be created. - `dailySchedule: DailySchedule` daily_schedule triggers a prebuild once per day at the specified hour (UTC). The actual start time may vary slightly to distribute system load. - `hourUtc?: number` hour_utc is the hour of day (0-23) in UTC when the prebuild should start. The actual start time may be adjusted by a few minutes to balance system load. - `recommendedEditors?: RecommendedEditors` recommended_editors specifies the editors recommended for this project. - `editors?: Record` editors maps editor aliases to their recommended versions. Key is the editor alias (e.g., "intellij", "goland", "vscode"). Value contains the list of recommended versions for that editor. If versions list is empty, all available versions are recommended. Example: {"intellij": {versions: ["2025.1", "2024.3"]}, "goland": {}} - `versions?: Array` versions is the list of recommended versions for this editor. If empty, all available versions are recommended. Examples for JetBrains: ["2025.1", "2024.3"] - `technicalDescription?: string` technical_description is a detailed technical description of the project This field is not returned by default in GetProject or ListProjects responses - `usedBy?: UsedBy` - `subjects?: Array` Subjects are the 10 most recent subjects who have used the project to create an environment - `id?: string` id is the UUID of the subject - `principal?: Principal` Principal is the principal of the subject - `totalSubjects?: number` Total number of unique subjects who have used the project ### Example ```typescript import Gitpod from '@gitpod/sdk'; const client = new Gitpod({ bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const project of client.projects.list({ pagination: { pageSize: 20 } })) { console.log(project.id); } ``` #### Response ```json { "count": { "relation": "COUNT_RESPONSE_RELATION_UNSPECIFIED", "value": 0 }, "pagination": { "nextToken": "nextToken" }, "projects": [ { "environmentClass": { "environmentClassId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "localRunner": true, "order": 0 }, "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "automationsFilePath": "automationsFilePath", "desiredPhase": "PROJECT_PHASE_UNSPECIFIED", "devcontainerFilePath": "devcontainerFilePath", "environmentClasses": [ { "environmentClassId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "localRunner": true, "order": 0 } ], "initializer": { "specs": [ { "contextUrl": { "url": "https://example.com" }, "git": { "checkoutLocation": "checkoutLocation", "cloneTarget": "cloneTarget", "remoteUri": "remoteUri", "targetMode": "CLONE_TARGET_MODE_UNSPECIFIED", "upstreamRemoteUri": "upstreamRemoteUri" } } ] }, "metadata": { "createdAt": "2019-12-27T18:11:19.117Z", "creator": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED" }, "name": "x", "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "updatedAt": "2019-12-27T18:11:19.117Z" }, "prebuildConfiguration": { "enabled": true, "enableJetbrainsWarmup": true, "environmentClassIds": [ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ], "executor": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED" }, "timeout": "+9125115.360s", "trigger": { "dailySchedule": { "hourUtc": 23 } } }, "recommendedEditors": { "editors": { "foo": { "versions": [ "string" ] } } }, "technicalDescription": "technicalDescription", "usedBy": { "subjects": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED" } ], "totalSubjects": 0 } } ] } ``` ## GetProject `client.projects.retrieve(ProjectRetrieveParamsbody, RequestOptionsoptions?): ProjectRetrieveResponse` **post** `/gitpod.v1.ProjectService/GetProject` Gets details about a specific project. Use this method to: - View project configuration - Check project status - Get project metadata ### Examples - Get project details: Retrieves information about a specific project. ```yaml projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" ``` ### Parameters - `body: ProjectRetrieveParams` - `projectId?: string` project_id specifies the project identifier ### Returns - `ProjectRetrieveResponse` - `project?: Project` - `environmentClass: ProjectEnvironmentClass` Use `environment_classes` instead. - `environmentClassId?: string` Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. - `localRunner?: boolean` Use a local runner for the user - `order?: number` order is the priority of this entry - `id?: string` id is the unique identifier for the project - `automationsFilePath?: string` automations_file_path is the path to the automations file relative to the repo root - `desiredPhase?: ProjectPhase` desired_phase is the desired phase of the project When set to DELETED, the project is pending deletion - `"PROJECT_PHASE_UNSPECIFIED"` - `"PROJECT_PHASE_ACTIVE"` - `"PROJECT_PHASE_DELETED"` - `devcontainerFilePath?: string` devcontainer_file_path is the path to the devcontainer file relative to the repo root - `environmentClasses?: Array` environment_classes is the list of environment classes for the project - `environmentClassId?: string` Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. - `localRunner?: boolean` Use a local runner for the user - `order?: number` order is the priority of this entry - `initializer?: EnvironmentInitializer` initializer is the content initializer - `specs?: Array` - `contextUrl?: ContextURL` - `url?: string` url is the URL from which the environment is created - `git?: Git` - `checkoutLocation?: string` a path relative to the environment root in which the code will be checked out to - `cloneTarget?: string` the value for the clone target mode - use depends on the target mode - `remoteUri?: string` remote_uri is the Git remote origin - `targetMode?: "CLONE_TARGET_MODE_UNSPECIFIED" | "CLONE_TARGET_MODE_REMOTE_HEAD" | "CLONE_TARGET_MODE_REMOTE_COMMIT" | 3 more` the target mode determines what gets checked out - `"CLONE_TARGET_MODE_UNSPECIFIED"` - `"CLONE_TARGET_MODE_REMOTE_HEAD"` - `"CLONE_TARGET_MODE_REMOTE_COMMIT"` - `"CLONE_TARGET_MODE_REMOTE_BRANCH"` - `"CLONE_TARGET_MODE_LOCAL_BRANCH"` - `"CLONE_TARGET_MODE_REMOTE_TAG"` - `upstreamRemoteUri?: string` upstream_Remote_uri is the fork upstream of a repository - `metadata?: ProjectMetadata` - `createdAt?: string` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `creator?: Subject` creator is the identity of the project creator - `id?: string` id is the UUID of the subject - `principal?: Principal` Principal is the principal of the subject - `"PRINCIPAL_UNSPECIFIED"` - `"PRINCIPAL_ACCOUNT"` - `"PRINCIPAL_USER"` - `"PRINCIPAL_RUNNER"` - `"PRINCIPAL_ENVIRONMENT"` - `"PRINCIPAL_SERVICE_ACCOUNT"` - `"PRINCIPAL_RUNNER_MANAGER"` - `name?: string` name is the human readable name of the project - `organizationId?: string` organization_id is the ID of the organization that contains the environment - `updatedAt?: string` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `prebuildConfiguration?: ProjectPrebuildConfiguration` prebuild_configuration defines how prebuilds are created for this project. - `enabled?: boolean` enabled controls whether prebuilds are created for this project. When disabled, no automatic prebuilds will be triggered. - `enableJetbrainsWarmup?: boolean` enable_jetbrains_warmup controls whether JetBrains IDE warmup runs during prebuilds. - `environmentClassIds?: Array` environment_class_ids specifies which environment classes should have prebuilds created. If empty, no prebuilds are created. - `executor?: Subject` executor specifies who runs prebuilds for this project. The executor's SCM credentials are used to clone the repository. If not set, defaults to the project creator. - `timeout?: string` timeout is the maximum duration allowed for a prebuild to complete. If not specified, defaults to 1 hour. Must be between 5 minutes and 2 hours. - `trigger?: Trigger` trigger defines when prebuilds should be created. - `dailySchedule: DailySchedule` daily_schedule triggers a prebuild once per day at the specified hour (UTC). The actual start time may vary slightly to distribute system load. - `hourUtc?: number` hour_utc is the hour of day (0-23) in UTC when the prebuild should start. The actual start time may be adjusted by a few minutes to balance system load. - `recommendedEditors?: RecommendedEditors` recommended_editors specifies the editors recommended for this project. - `editors?: Record` editors maps editor aliases to their recommended versions. Key is the editor alias (e.g., "intellij", "goland", "vscode"). Value contains the list of recommended versions for that editor. If versions list is empty, all available versions are recommended. Example: {"intellij": {versions: ["2025.1", "2024.3"]}, "goland": {}} - `versions?: Array` versions is the list of recommended versions for this editor. If empty, all available versions are recommended. Examples for JetBrains: ["2025.1", "2024.3"] - `technicalDescription?: string` technical_description is a detailed technical description of the project This field is not returned by default in GetProject or ListProjects responses - `usedBy?: UsedBy` - `subjects?: Array` Subjects are the 10 most recent subjects who have used the project to create an environment - `id?: string` id is the UUID of the subject - `principal?: Principal` Principal is the principal of the subject - `totalSubjects?: number` Total number of unique subjects who have used the project ### Example ```typescript import Gitpod from '@gitpod/sdk'; const client = new Gitpod({ bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted }); const project = await client.projects.retrieve({ projectId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', }); console.log(project.project); ``` #### Response ```json { "project": { "environmentClass": { "environmentClassId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "localRunner": true, "order": 0 }, "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "automationsFilePath": "automationsFilePath", "desiredPhase": "PROJECT_PHASE_UNSPECIFIED", "devcontainerFilePath": "devcontainerFilePath", "environmentClasses": [ { "environmentClassId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "localRunner": true, "order": 0 } ], "initializer": { "specs": [ { "contextUrl": { "url": "https://example.com" }, "git": { "checkoutLocation": "checkoutLocation", "cloneTarget": "cloneTarget", "remoteUri": "remoteUri", "targetMode": "CLONE_TARGET_MODE_UNSPECIFIED", "upstreamRemoteUri": "upstreamRemoteUri" } } ] }, "metadata": { "createdAt": "2019-12-27T18:11:19.117Z", "creator": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED" }, "name": "x", "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "updatedAt": "2019-12-27T18:11:19.117Z" }, "prebuildConfiguration": { "enabled": true, "enableJetbrainsWarmup": true, "environmentClassIds": [ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ], "executor": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED" }, "timeout": "+9125115.360s", "trigger": { "dailySchedule": { "hourUtc": 23 } } }, "recommendedEditors": { "editors": { "foo": { "versions": [ "string" ] } } }, "technicalDescription": "technicalDescription", "usedBy": { "subjects": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED" } ], "totalSubjects": 0 } } } ``` ## UpdateProject `client.projects.update(ProjectUpdateParamsbody, RequestOptionsoptions?): ProjectUpdateResponse` **post** `/gitpod.v1.ProjectService/UpdateProject` Updates a project's configuration. Use this method to: - Modify project settings - Update environment class - Change project name - Configure initializers - Configure prebuild settings ### Examples - Update project name: Changes the project's display name. ```yaml projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" name: "New Project Name" ``` - Enable prebuilds with daily schedule: Configures prebuilds to run daily at 2 AM UTC. ```yaml projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" prebuildConfiguration: enabled: true environmentClassIds: - "b0e12f6c-4c67-429d-a4a6-d9838b5da041" timeout: "3600s" trigger: dailySchedule: hourUtc: 2 ``` ### Parameters - `body: ProjectUpdateParams` - `automationsFilePath?: string | null` automations_file_path is the path to the automations file relative to the repo root path must not be absolute (start with a /): ``` this.matches('^$|^[^/].*') ``` - `devcontainerFilePath?: string | null` devcontainer_file_path is the path to the devcontainer file relative to the repo root path must not be absolute (start with a /): ``` this.matches('^$|^[^/].*') ``` - `initializer?: EnvironmentInitializer | null` initializer is the content initializer - `specs?: Array` - `contextUrl?: ContextURL` - `url?: string` url is the URL from which the environment is created - `git?: Git` - `checkoutLocation?: string` a path relative to the environment root in which the code will be checked out to - `cloneTarget?: string` the value for the clone target mode - use depends on the target mode - `remoteUri?: string` remote_uri is the Git remote origin - `targetMode?: "CLONE_TARGET_MODE_UNSPECIFIED" | "CLONE_TARGET_MODE_REMOTE_HEAD" | "CLONE_TARGET_MODE_REMOTE_COMMIT" | 3 more` the target mode determines what gets checked out - `"CLONE_TARGET_MODE_UNSPECIFIED"` - `"CLONE_TARGET_MODE_REMOTE_HEAD"` - `"CLONE_TARGET_MODE_REMOTE_COMMIT"` - `"CLONE_TARGET_MODE_REMOTE_BRANCH"` - `"CLONE_TARGET_MODE_LOCAL_BRANCH"` - `"CLONE_TARGET_MODE_REMOTE_TAG"` - `upstreamRemoteUri?: string` upstream_Remote_uri is the fork upstream of a repository - `name?: string | null` - `prebuildConfiguration?: ProjectPrebuildConfiguration | null` prebuild_configuration defines how prebuilds are created for this project. If not provided, the existing prebuild configuration is not modified. To disable prebuilds, set enabled to false. - `enabled?: boolean` enabled controls whether prebuilds are created for this project. When disabled, no automatic prebuilds will be triggered. - `enableJetbrainsWarmup?: boolean` enable_jetbrains_warmup controls whether JetBrains IDE warmup runs during prebuilds. - `environmentClassIds?: Array` environment_class_ids specifies which environment classes should have prebuilds created. If empty, no prebuilds are created. - `executor?: Subject` executor specifies who runs prebuilds for this project. The executor's SCM credentials are used to clone the repository. If not set, defaults to the project creator. - `id?: string` id is the UUID of the subject - `principal?: Principal` Principal is the principal of the subject - `"PRINCIPAL_UNSPECIFIED"` - `"PRINCIPAL_ACCOUNT"` - `"PRINCIPAL_USER"` - `"PRINCIPAL_RUNNER"` - `"PRINCIPAL_ENVIRONMENT"` - `"PRINCIPAL_SERVICE_ACCOUNT"` - `"PRINCIPAL_RUNNER_MANAGER"` - `timeout?: string` timeout is the maximum duration allowed for a prebuild to complete. If not specified, defaults to 1 hour. Must be between 5 minutes and 2 hours. - `trigger?: Trigger` trigger defines when prebuilds should be created. - `dailySchedule: DailySchedule` daily_schedule triggers a prebuild once per day at the specified hour (UTC). The actual start time may vary slightly to distribute system load. - `hourUtc?: number` hour_utc is the hour of day (0-23) in UTC when the prebuild should start. The actual start time may be adjusted by a few minutes to balance system load. - `projectId?: string` project_id specifies the project identifier - `recommendedEditors?: RecommendedEditors | null` recommended_editors specifies the editors recommended for this project. If not provided, the existing recommended editors are not modified. To clear all recommended editors, set to an empty RecommendedEditors message. - `editors?: Record` editors maps editor aliases to their recommended versions. Key is the editor alias (e.g., "intellij", "goland", "vscode"). Value contains the list of recommended versions for that editor. If versions list is empty, all available versions are recommended. Example: {"intellij": {versions: ["2025.1", "2024.3"]}, "goland": {}} - `versions?: Array` versions is the list of recommended versions for this editor. If empty, all available versions are recommended. Examples for JetBrains: ["2025.1", "2024.3"] - `technicalDescription?: string | null` technical_description is a detailed technical description of the project This field is not returned by default in GetProject or ListProjects responses 8KB max ### Returns - `ProjectUpdateResponse` - `project?: Project` - `environmentClass: ProjectEnvironmentClass` Use `environment_classes` instead. - `environmentClassId?: string` Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. - `localRunner?: boolean` Use a local runner for the user - `order?: number` order is the priority of this entry - `id?: string` id is the unique identifier for the project - `automationsFilePath?: string` automations_file_path is the path to the automations file relative to the repo root - `desiredPhase?: ProjectPhase` desired_phase is the desired phase of the project When set to DELETED, the project is pending deletion - `"PROJECT_PHASE_UNSPECIFIED"` - `"PROJECT_PHASE_ACTIVE"` - `"PROJECT_PHASE_DELETED"` - `devcontainerFilePath?: string` devcontainer_file_path is the path to the devcontainer file relative to the repo root - `environmentClasses?: Array` environment_classes is the list of environment classes for the project - `environmentClassId?: string` Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. - `localRunner?: boolean` Use a local runner for the user - `order?: number` order is the priority of this entry - `initializer?: EnvironmentInitializer` initializer is the content initializer - `specs?: Array` - `contextUrl?: ContextURL` - `url?: string` url is the URL from which the environment is created - `git?: Git` - `checkoutLocation?: string` a path relative to the environment root in which the code will be checked out to - `cloneTarget?: string` the value for the clone target mode - use depends on the target mode - `remoteUri?: string` remote_uri is the Git remote origin - `targetMode?: "CLONE_TARGET_MODE_UNSPECIFIED" | "CLONE_TARGET_MODE_REMOTE_HEAD" | "CLONE_TARGET_MODE_REMOTE_COMMIT" | 3 more` the target mode determines what gets checked out - `"CLONE_TARGET_MODE_UNSPECIFIED"` - `"CLONE_TARGET_MODE_REMOTE_HEAD"` - `"CLONE_TARGET_MODE_REMOTE_COMMIT"` - `"CLONE_TARGET_MODE_REMOTE_BRANCH"` - `"CLONE_TARGET_MODE_LOCAL_BRANCH"` - `"CLONE_TARGET_MODE_REMOTE_TAG"` - `upstreamRemoteUri?: string` upstream_Remote_uri is the fork upstream of a repository - `metadata?: ProjectMetadata` - `createdAt?: string` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `creator?: Subject` creator is the identity of the project creator - `id?: string` id is the UUID of the subject - `principal?: Principal` Principal is the principal of the subject - `"PRINCIPAL_UNSPECIFIED"` - `"PRINCIPAL_ACCOUNT"` - `"PRINCIPAL_USER"` - `"PRINCIPAL_RUNNER"` - `"PRINCIPAL_ENVIRONMENT"` - `"PRINCIPAL_SERVICE_ACCOUNT"` - `"PRINCIPAL_RUNNER_MANAGER"` - `name?: string` name is the human readable name of the project - `organizationId?: string` organization_id is the ID of the organization that contains the environment - `updatedAt?: string` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `prebuildConfiguration?: ProjectPrebuildConfiguration` prebuild_configuration defines how prebuilds are created for this project. - `enabled?: boolean` enabled controls whether prebuilds are created for this project. When disabled, no automatic prebuilds will be triggered. - `enableJetbrainsWarmup?: boolean` enable_jetbrains_warmup controls whether JetBrains IDE warmup runs during prebuilds. - `environmentClassIds?: Array` environment_class_ids specifies which environment classes should have prebuilds created. If empty, no prebuilds are created. - `executor?: Subject` executor specifies who runs prebuilds for this project. The executor's SCM credentials are used to clone the repository. If not set, defaults to the project creator. - `timeout?: string` timeout is the maximum duration allowed for a prebuild to complete. If not specified, defaults to 1 hour. Must be between 5 minutes and 2 hours. - `trigger?: Trigger` trigger defines when prebuilds should be created. - `dailySchedule: DailySchedule` daily_schedule triggers a prebuild once per day at the specified hour (UTC). The actual start time may vary slightly to distribute system load. - `hourUtc?: number` hour_utc is the hour of day (0-23) in UTC when the prebuild should start. The actual start time may be adjusted by a few minutes to balance system load. - `recommendedEditors?: RecommendedEditors` recommended_editors specifies the editors recommended for this project. - `editors?: Record` editors maps editor aliases to their recommended versions. Key is the editor alias (e.g., "intellij", "goland", "vscode"). Value contains the list of recommended versions for that editor. If versions list is empty, all available versions are recommended. Example: {"intellij": {versions: ["2025.1", "2024.3"]}, "goland": {}} - `versions?: Array` versions is the list of recommended versions for this editor. If empty, all available versions are recommended. Examples for JetBrains: ["2025.1", "2024.3"] - `technicalDescription?: string` technical_description is a detailed technical description of the project This field is not returned by default in GetProject or ListProjects responses - `usedBy?: UsedBy` - `subjects?: Array` Subjects are the 10 most recent subjects who have used the project to create an environment - `id?: string` id is the UUID of the subject - `principal?: Principal` Principal is the principal of the subject - `totalSubjects?: number` Total number of unique subjects who have used the project ### Example ```typescript import Gitpod from '@gitpod/sdk'; const client = new Gitpod({ bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted }); const project = await client.projects.update({ prebuildConfiguration: { enabled: true, environmentClassIds: ['b0e12f6c-4c67-429d-a4a6-d9838b5da041'], timeout: '3600s', trigger: { dailySchedule: { hourUtc: 2 } }, }, projectId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', }); console.log(project.project); ``` #### Response ```json { "project": { "environmentClass": { "environmentClassId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "localRunner": true, "order": 0 }, "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "automationsFilePath": "automationsFilePath", "desiredPhase": "PROJECT_PHASE_UNSPECIFIED", "devcontainerFilePath": "devcontainerFilePath", "environmentClasses": [ { "environmentClassId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "localRunner": true, "order": 0 } ], "initializer": { "specs": [ { "contextUrl": { "url": "https://example.com" }, "git": { "checkoutLocation": "checkoutLocation", "cloneTarget": "cloneTarget", "remoteUri": "remoteUri", "targetMode": "CLONE_TARGET_MODE_UNSPECIFIED", "upstreamRemoteUri": "upstreamRemoteUri" } } ] }, "metadata": { "createdAt": "2019-12-27T18:11:19.117Z", "creator": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED" }, "name": "x", "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "updatedAt": "2019-12-27T18:11:19.117Z" }, "prebuildConfiguration": { "enabled": true, "enableJetbrainsWarmup": true, "environmentClassIds": [ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ], "executor": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED" }, "timeout": "+9125115.360s", "trigger": { "dailySchedule": { "hourUtc": 23 } } }, "recommendedEditors": { "editors": { "foo": { "versions": [ "string" ] } } }, "technicalDescription": "technicalDescription", "usedBy": { "subjects": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED" } ], "totalSubjects": 0 } } } ``` ## Domain Types ### Environment Initializer - `EnvironmentInitializer` EnvironmentInitializer specifies how an environment is to be initialized - `specs?: Array` - `contextUrl?: ContextURL` - `url?: string` url is the URL from which the environment is created - `git?: Git` - `checkoutLocation?: string` a path relative to the environment root in which the code will be checked out to - `cloneTarget?: string` the value for the clone target mode - use depends on the target mode - `remoteUri?: string` remote_uri is the Git remote origin - `targetMode?: "CLONE_TARGET_MODE_UNSPECIFIED" | "CLONE_TARGET_MODE_REMOTE_HEAD" | "CLONE_TARGET_MODE_REMOTE_COMMIT" | 3 more` the target mode determines what gets checked out - `"CLONE_TARGET_MODE_UNSPECIFIED"` - `"CLONE_TARGET_MODE_REMOTE_HEAD"` - `"CLONE_TARGET_MODE_REMOTE_COMMIT"` - `"CLONE_TARGET_MODE_REMOTE_BRANCH"` - `"CLONE_TARGET_MODE_LOCAL_BRANCH"` - `"CLONE_TARGET_MODE_REMOTE_TAG"` - `upstreamRemoteUri?: string` upstream_Remote_uri is the fork upstream of a repository ### Project - `Project` - `environmentClass: ProjectEnvironmentClass` Use `environment_classes` instead. - `environmentClassId?: string` Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. - `localRunner?: boolean` Use a local runner for the user - `order?: number` order is the priority of this entry - `id?: string` id is the unique identifier for the project - `automationsFilePath?: string` automations_file_path is the path to the automations file relative to the repo root - `desiredPhase?: ProjectPhase` desired_phase is the desired phase of the project When set to DELETED, the project is pending deletion - `"PROJECT_PHASE_UNSPECIFIED"` - `"PROJECT_PHASE_ACTIVE"` - `"PROJECT_PHASE_DELETED"` - `devcontainerFilePath?: string` devcontainer_file_path is the path to the devcontainer file relative to the repo root - `environmentClasses?: Array` environment_classes is the list of environment classes for the project - `environmentClassId?: string` Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. - `localRunner?: boolean` Use a local runner for the user - `order?: number` order is the priority of this entry - `initializer?: EnvironmentInitializer` initializer is the content initializer - `specs?: Array` - `contextUrl?: ContextURL` - `url?: string` url is the URL from which the environment is created - `git?: Git` - `checkoutLocation?: string` a path relative to the environment root in which the code will be checked out to - `cloneTarget?: string` the value for the clone target mode - use depends on the target mode - `remoteUri?: string` remote_uri is the Git remote origin - `targetMode?: "CLONE_TARGET_MODE_UNSPECIFIED" | "CLONE_TARGET_MODE_REMOTE_HEAD" | "CLONE_TARGET_MODE_REMOTE_COMMIT" | 3 more` the target mode determines what gets checked out - `"CLONE_TARGET_MODE_UNSPECIFIED"` - `"CLONE_TARGET_MODE_REMOTE_HEAD"` - `"CLONE_TARGET_MODE_REMOTE_COMMIT"` - `"CLONE_TARGET_MODE_REMOTE_BRANCH"` - `"CLONE_TARGET_MODE_LOCAL_BRANCH"` - `"CLONE_TARGET_MODE_REMOTE_TAG"` - `upstreamRemoteUri?: string` upstream_Remote_uri is the fork upstream of a repository - `metadata?: ProjectMetadata` - `createdAt?: string` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `creator?: Subject` creator is the identity of the project creator - `id?: string` id is the UUID of the subject - `principal?: Principal` Principal is the principal of the subject - `"PRINCIPAL_UNSPECIFIED"` - `"PRINCIPAL_ACCOUNT"` - `"PRINCIPAL_USER"` - `"PRINCIPAL_RUNNER"` - `"PRINCIPAL_ENVIRONMENT"` - `"PRINCIPAL_SERVICE_ACCOUNT"` - `"PRINCIPAL_RUNNER_MANAGER"` - `name?: string` name is the human readable name of the project - `organizationId?: string` organization_id is the ID of the organization that contains the environment - `updatedAt?: string` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `prebuildConfiguration?: ProjectPrebuildConfiguration` prebuild_configuration defines how prebuilds are created for this project. - `enabled?: boolean` enabled controls whether prebuilds are created for this project. When disabled, no automatic prebuilds will be triggered. - `enableJetbrainsWarmup?: boolean` enable_jetbrains_warmup controls whether JetBrains IDE warmup runs during prebuilds. - `environmentClassIds?: Array` environment_class_ids specifies which environment classes should have prebuilds created. If empty, no prebuilds are created. - `executor?: Subject` executor specifies who runs prebuilds for this project. The executor's SCM credentials are used to clone the repository. If not set, defaults to the project creator. - `timeout?: string` timeout is the maximum duration allowed for a prebuild to complete. If not specified, defaults to 1 hour. Must be between 5 minutes and 2 hours. - `trigger?: Trigger` trigger defines when prebuilds should be created. - `dailySchedule: DailySchedule` daily_schedule triggers a prebuild once per day at the specified hour (UTC). The actual start time may vary slightly to distribute system load. - `hourUtc?: number` hour_utc is the hour of day (0-23) in UTC when the prebuild should start. The actual start time may be adjusted by a few minutes to balance system load. - `recommendedEditors?: RecommendedEditors` recommended_editors specifies the editors recommended for this project. - `editors?: Record` editors maps editor aliases to their recommended versions. Key is the editor alias (e.g., "intellij", "goland", "vscode"). Value contains the list of recommended versions for that editor. If versions list is empty, all available versions are recommended. Example: {"intellij": {versions: ["2025.1", "2024.3"]}, "goland": {}} - `versions?: Array` versions is the list of recommended versions for this editor. If empty, all available versions are recommended. Examples for JetBrains: ["2025.1", "2024.3"] - `technicalDescription?: string` technical_description is a detailed technical description of the project This field is not returned by default in GetProject or ListProjects responses - `usedBy?: UsedBy` - `subjects?: Array` Subjects are the 10 most recent subjects who have used the project to create an environment - `id?: string` id is the UUID of the subject - `principal?: Principal` Principal is the principal of the subject - `totalSubjects?: number` Total number of unique subjects who have used the project ### Project Metadata - `ProjectMetadata` - `createdAt?: string` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `creator?: Subject` creator is the identity of the project creator - `id?: string` id is the UUID of the subject - `principal?: Principal` Principal is the principal of the subject - `"PRINCIPAL_UNSPECIFIED"` - `"PRINCIPAL_ACCOUNT"` - `"PRINCIPAL_USER"` - `"PRINCIPAL_RUNNER"` - `"PRINCIPAL_ENVIRONMENT"` - `"PRINCIPAL_SERVICE_ACCOUNT"` - `"PRINCIPAL_RUNNER_MANAGER"` - `name?: string` name is the human readable name of the project - `organizationId?: string` organization_id is the ID of the organization that contains the environment - `updatedAt?: string` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. ### Project Phase - `ProjectPhase = "PROJECT_PHASE_UNSPECIFIED" | "PROJECT_PHASE_ACTIVE" | "PROJECT_PHASE_DELETED"` - `"PROJECT_PHASE_UNSPECIFIED"` - `"PROJECT_PHASE_ACTIVE"` - `"PROJECT_PHASE_DELETED"` ### Project Prebuild Configuration - `ProjectPrebuildConfiguration` ProjectPrebuildConfiguration defines how prebuilds are created for a project. Prebuilds create environment snapshots that enable faster environment startup times. - `enabled?: boolean` enabled controls whether prebuilds are created for this project. When disabled, no automatic prebuilds will be triggered. - `enableJetbrainsWarmup?: boolean` enable_jetbrains_warmup controls whether JetBrains IDE warmup runs during prebuilds. - `environmentClassIds?: Array` environment_class_ids specifies which environment classes should have prebuilds created. If empty, no prebuilds are created. - `executor?: Subject` executor specifies who runs prebuilds for this project. The executor's SCM credentials are used to clone the repository. If not set, defaults to the project creator. - `id?: string` id is the UUID of the subject - `principal?: Principal` Principal is the principal of the subject - `"PRINCIPAL_UNSPECIFIED"` - `"PRINCIPAL_ACCOUNT"` - `"PRINCIPAL_USER"` - `"PRINCIPAL_RUNNER"` - `"PRINCIPAL_ENVIRONMENT"` - `"PRINCIPAL_SERVICE_ACCOUNT"` - `"PRINCIPAL_RUNNER_MANAGER"` - `timeout?: string` timeout is the maximum duration allowed for a prebuild to complete. If not specified, defaults to 1 hour. Must be between 5 minutes and 2 hours. - `trigger?: Trigger` trigger defines when prebuilds should be created. - `dailySchedule: DailySchedule` daily_schedule triggers a prebuild once per day at the specified hour (UTC). The actual start time may vary slightly to distribute system load. - `hourUtc?: number` hour_utc is the hour of day (0-23) in UTC when the prebuild should start. The actual start time may be adjusted by a few minutes to balance system load. ### Recommended Editors - `RecommendedEditors` RecommendedEditors contains the map of recommended editors and their versions. - `editors?: Record` editors maps editor aliases to their recommended versions. Key is the editor alias (e.g., "intellij", "goland", "vscode"). Value contains the list of recommended versions for that editor. If versions list is empty, all available versions are recommended. Example: {"intellij": {versions: ["2025.1", "2024.3"]}, "goland": {}} - `versions?: Array` versions is the list of recommended versions for this editor. If empty, all available versions are recommended. Examples for JetBrains: ["2025.1", "2024.3"] ### Project Bulk Create Response - `ProjectBulkCreateResponse` - `createdProjects?: Array` created_projects contains the successfully created projects - `environmentClass: ProjectEnvironmentClass` Use `environment_classes` instead. - `environmentClassId?: string` Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. - `localRunner?: boolean` Use a local runner for the user - `order?: number` order is the priority of this entry - `id?: string` id is the unique identifier for the project - `automationsFilePath?: string` automations_file_path is the path to the automations file relative to the repo root - `desiredPhase?: ProjectPhase` desired_phase is the desired phase of the project When set to DELETED, the project is pending deletion - `"PROJECT_PHASE_UNSPECIFIED"` - `"PROJECT_PHASE_ACTIVE"` - `"PROJECT_PHASE_DELETED"` - `devcontainerFilePath?: string` devcontainer_file_path is the path to the devcontainer file relative to the repo root - `environmentClasses?: Array` environment_classes is the list of environment classes for the project - `environmentClassId?: string` Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. - `localRunner?: boolean` Use a local runner for the user - `order?: number` order is the priority of this entry - `initializer?: EnvironmentInitializer` initializer is the content initializer - `specs?: Array` - `contextUrl?: ContextURL` - `url?: string` url is the URL from which the environment is created - `git?: Git` - `checkoutLocation?: string` a path relative to the environment root in which the code will be checked out to - `cloneTarget?: string` the value for the clone target mode - use depends on the target mode - `remoteUri?: string` remote_uri is the Git remote origin - `targetMode?: "CLONE_TARGET_MODE_UNSPECIFIED" | "CLONE_TARGET_MODE_REMOTE_HEAD" | "CLONE_TARGET_MODE_REMOTE_COMMIT" | 3 more` the target mode determines what gets checked out - `"CLONE_TARGET_MODE_UNSPECIFIED"` - `"CLONE_TARGET_MODE_REMOTE_HEAD"` - `"CLONE_TARGET_MODE_REMOTE_COMMIT"` - `"CLONE_TARGET_MODE_REMOTE_BRANCH"` - `"CLONE_TARGET_MODE_LOCAL_BRANCH"` - `"CLONE_TARGET_MODE_REMOTE_TAG"` - `upstreamRemoteUri?: string` upstream_Remote_uri is the fork upstream of a repository - `metadata?: ProjectMetadata` - `createdAt?: string` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `creator?: Subject` creator is the identity of the project creator - `id?: string` id is the UUID of the subject - `principal?: Principal` Principal is the principal of the subject - `"PRINCIPAL_UNSPECIFIED"` - `"PRINCIPAL_ACCOUNT"` - `"PRINCIPAL_USER"` - `"PRINCIPAL_RUNNER"` - `"PRINCIPAL_ENVIRONMENT"` - `"PRINCIPAL_SERVICE_ACCOUNT"` - `"PRINCIPAL_RUNNER_MANAGER"` - `name?: string` name is the human readable name of the project - `organizationId?: string` organization_id is the ID of the organization that contains the environment - `updatedAt?: string` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `prebuildConfiguration?: ProjectPrebuildConfiguration` prebuild_configuration defines how prebuilds are created for this project. - `enabled?: boolean` enabled controls whether prebuilds are created for this project. When disabled, no automatic prebuilds will be triggered. - `enableJetbrainsWarmup?: boolean` enable_jetbrains_warmup controls whether JetBrains IDE warmup runs during prebuilds. - `environmentClassIds?: Array` environment_class_ids specifies which environment classes should have prebuilds created. If empty, no prebuilds are created. - `executor?: Subject` executor specifies who runs prebuilds for this project. The executor's SCM credentials are used to clone the repository. If not set, defaults to the project creator. - `timeout?: string` timeout is the maximum duration allowed for a prebuild to complete. If not specified, defaults to 1 hour. Must be between 5 minutes and 2 hours. - `trigger?: Trigger` trigger defines when prebuilds should be created. - `dailySchedule: DailySchedule` daily_schedule triggers a prebuild once per day at the specified hour (UTC). The actual start time may vary slightly to distribute system load. - `hourUtc?: number` hour_utc is the hour of day (0-23) in UTC when the prebuild should start. The actual start time may be adjusted by a few minutes to balance system load. - `recommendedEditors?: RecommendedEditors` recommended_editors specifies the editors recommended for this project. - `editors?: Record` editors maps editor aliases to their recommended versions. Key is the editor alias (e.g., "intellij", "goland", "vscode"). Value contains the list of recommended versions for that editor. If versions list is empty, all available versions are recommended. Example: {"intellij": {versions: ["2025.1", "2024.3"]}, "goland": {}} - `versions?: Array` versions is the list of recommended versions for this editor. If empty, all available versions are recommended. Examples for JetBrains: ["2025.1", "2024.3"] - `technicalDescription?: string` technical_description is a detailed technical description of the project This field is not returned by default in GetProject or ListProjects responses - `usedBy?: UsedBy` - `subjects?: Array` Subjects are the 10 most recent subjects who have used the project to create an environment - `id?: string` id is the UUID of the subject - `principal?: Principal` Principal is the principal of the subject - `totalSubjects?: number` Total number of unique subjects who have used the project - `failedProjects?: Array` failed_projects contains details about projects that failed to create - `error?: string` error describes why the project creation failed - `index?: number` index is the position in the request array (0-based) - `name?: string` name is the project name that failed ### Project Bulk Delete Response - `ProjectBulkDeleteResponse` - `deletedProjectIds?: Array` deleted_project_ids contains the IDs of successfully deleted projects - `failedProjects?: Array` failed_projects contains details about projects that failed to delete - `error?: string` error describes why the project deletion failed - `index?: number` index is the position in the request array (0-based) - `projectId?: string` project_id is the project ID that failed ### Project Bulk Update Response - `ProjectBulkUpdateResponse` - `failedProjects?: Array` failed_projects contains details about projects that failed to update - `error?: string` error describes why the project update failed - `index?: number` index is the position in the request array (0-based) - `projectId?: string` project_id is the project ID that failed - `updatedProjects?: Array` updated_projects contains the successfully updated projects - `environmentClass: ProjectEnvironmentClass` Use `environment_classes` instead. - `environmentClassId?: string` Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. - `localRunner?: boolean` Use a local runner for the user - `order?: number` order is the priority of this entry - `id?: string` id is the unique identifier for the project - `automationsFilePath?: string` automations_file_path is the path to the automations file relative to the repo root - `desiredPhase?: ProjectPhase` desired_phase is the desired phase of the project When set to DELETED, the project is pending deletion - `"PROJECT_PHASE_UNSPECIFIED"` - `"PROJECT_PHASE_ACTIVE"` - `"PROJECT_PHASE_DELETED"` - `devcontainerFilePath?: string` devcontainer_file_path is the path to the devcontainer file relative to the repo root - `environmentClasses?: Array` environment_classes is the list of environment classes for the project - `environmentClassId?: string` Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. - `localRunner?: boolean` Use a local runner for the user - `order?: number` order is the priority of this entry - `initializer?: EnvironmentInitializer` initializer is the content initializer - `specs?: Array` - `contextUrl?: ContextURL` - `url?: string` url is the URL from which the environment is created - `git?: Git` - `checkoutLocation?: string` a path relative to the environment root in which the code will be checked out to - `cloneTarget?: string` the value for the clone target mode - use depends on the target mode - `remoteUri?: string` remote_uri is the Git remote origin - `targetMode?: "CLONE_TARGET_MODE_UNSPECIFIED" | "CLONE_TARGET_MODE_REMOTE_HEAD" | "CLONE_TARGET_MODE_REMOTE_COMMIT" | 3 more` the target mode determines what gets checked out - `"CLONE_TARGET_MODE_UNSPECIFIED"` - `"CLONE_TARGET_MODE_REMOTE_HEAD"` - `"CLONE_TARGET_MODE_REMOTE_COMMIT"` - `"CLONE_TARGET_MODE_REMOTE_BRANCH"` - `"CLONE_TARGET_MODE_LOCAL_BRANCH"` - `"CLONE_TARGET_MODE_REMOTE_TAG"` - `upstreamRemoteUri?: string` upstream_Remote_uri is the fork upstream of a repository - `metadata?: ProjectMetadata` - `createdAt?: string` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `creator?: Subject` creator is the identity of the project creator - `id?: string` id is the UUID of the subject - `principal?: Principal` Principal is the principal of the subject - `"PRINCIPAL_UNSPECIFIED"` - `"PRINCIPAL_ACCOUNT"` - `"PRINCIPAL_USER"` - `"PRINCIPAL_RUNNER"` - `"PRINCIPAL_ENVIRONMENT"` - `"PRINCIPAL_SERVICE_ACCOUNT"` - `"PRINCIPAL_RUNNER_MANAGER"` - `name?: string` name is the human readable name of the project - `organizationId?: string` organization_id is the ID of the organization that contains the environment - `updatedAt?: string` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `prebuildConfiguration?: ProjectPrebuildConfiguration` prebuild_configuration defines how prebuilds are created for this project. - `enabled?: boolean` enabled controls whether prebuilds are created for this project. When disabled, no automatic prebuilds will be triggered. - `enableJetbrainsWarmup?: boolean` enable_jetbrains_warmup controls whether JetBrains IDE warmup runs during prebuilds. - `environmentClassIds?: Array` environment_class_ids specifies which environment classes should have prebuilds created. If empty, no prebuilds are created. - `executor?: Subject` executor specifies who runs prebuilds for this project. The executor's SCM credentials are used to clone the repository. If not set, defaults to the project creator. - `timeout?: string` timeout is the maximum duration allowed for a prebuild to complete. If not specified, defaults to 1 hour. Must be between 5 minutes and 2 hours. - `trigger?: Trigger` trigger defines when prebuilds should be created. - `dailySchedule: DailySchedule` daily_schedule triggers a prebuild once per day at the specified hour (UTC). The actual start time may vary slightly to distribute system load. - `hourUtc?: number` hour_utc is the hour of day (0-23) in UTC when the prebuild should start. The actual start time may be adjusted by a few minutes to balance system load. - `recommendedEditors?: RecommendedEditors` recommended_editors specifies the editors recommended for this project. - `editors?: Record` editors maps editor aliases to their recommended versions. Key is the editor alias (e.g., "intellij", "goland", "vscode"). Value contains the list of recommended versions for that editor. If versions list is empty, all available versions are recommended. Example: {"intellij": {versions: ["2025.1", "2024.3"]}, "goland": {}} - `versions?: Array` versions is the list of recommended versions for this editor. If empty, all available versions are recommended. Examples for JetBrains: ["2025.1", "2024.3"] - `technicalDescription?: string` technical_description is a detailed technical description of the project This field is not returned by default in GetProject or ListProjects responses - `usedBy?: UsedBy` - `subjects?: Array` Subjects are the 10 most recent subjects who have used the project to create an environment - `id?: string` id is the UUID of the subject - `principal?: Principal` Principal is the principal of the subject - `totalSubjects?: number` Total number of unique subjects who have used the project ### Project Create Response - `ProjectCreateResponse` - `project?: Project` - `environmentClass: ProjectEnvironmentClass` Use `environment_classes` instead. - `environmentClassId?: string` Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. - `localRunner?: boolean` Use a local runner for the user - `order?: number` order is the priority of this entry - `id?: string` id is the unique identifier for the project - `automationsFilePath?: string` automations_file_path is the path to the automations file relative to the repo root - `desiredPhase?: ProjectPhase` desired_phase is the desired phase of the project When set to DELETED, the project is pending deletion - `"PROJECT_PHASE_UNSPECIFIED"` - `"PROJECT_PHASE_ACTIVE"` - `"PROJECT_PHASE_DELETED"` - `devcontainerFilePath?: string` devcontainer_file_path is the path to the devcontainer file relative to the repo root - `environmentClasses?: Array` environment_classes is the list of environment classes for the project - `environmentClassId?: string` Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. - `localRunner?: boolean` Use a local runner for the user - `order?: number` order is the priority of this entry - `initializer?: EnvironmentInitializer` initializer is the content initializer - `specs?: Array` - `contextUrl?: ContextURL` - `url?: string` url is the URL from which the environment is created - `git?: Git` - `checkoutLocation?: string` a path relative to the environment root in which the code will be checked out to - `cloneTarget?: string` the value for the clone target mode - use depends on the target mode - `remoteUri?: string` remote_uri is the Git remote origin - `targetMode?: "CLONE_TARGET_MODE_UNSPECIFIED" | "CLONE_TARGET_MODE_REMOTE_HEAD" | "CLONE_TARGET_MODE_REMOTE_COMMIT" | 3 more` the target mode determines what gets checked out - `"CLONE_TARGET_MODE_UNSPECIFIED"` - `"CLONE_TARGET_MODE_REMOTE_HEAD"` - `"CLONE_TARGET_MODE_REMOTE_COMMIT"` - `"CLONE_TARGET_MODE_REMOTE_BRANCH"` - `"CLONE_TARGET_MODE_LOCAL_BRANCH"` - `"CLONE_TARGET_MODE_REMOTE_TAG"` - `upstreamRemoteUri?: string` upstream_Remote_uri is the fork upstream of a repository - `metadata?: ProjectMetadata` - `createdAt?: string` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `creator?: Subject` creator is the identity of the project creator - `id?: string` id is the UUID of the subject - `principal?: Principal` Principal is the principal of the subject - `"PRINCIPAL_UNSPECIFIED"` - `"PRINCIPAL_ACCOUNT"` - `"PRINCIPAL_USER"` - `"PRINCIPAL_RUNNER"` - `"PRINCIPAL_ENVIRONMENT"` - `"PRINCIPAL_SERVICE_ACCOUNT"` - `"PRINCIPAL_RUNNER_MANAGER"` - `name?: string` name is the human readable name of the project - `organizationId?: string` organization_id is the ID of the organization that contains the environment - `updatedAt?: string` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `prebuildConfiguration?: ProjectPrebuildConfiguration` prebuild_configuration defines how prebuilds are created for this project. - `enabled?: boolean` enabled controls whether prebuilds are created for this project. When disabled, no automatic prebuilds will be triggered. - `enableJetbrainsWarmup?: boolean` enable_jetbrains_warmup controls whether JetBrains IDE warmup runs during prebuilds. - `environmentClassIds?: Array` environment_class_ids specifies which environment classes should have prebuilds created. If empty, no prebuilds are created. - `executor?: Subject` executor specifies who runs prebuilds for this project. The executor's SCM credentials are used to clone the repository. If not set, defaults to the project creator. - `timeout?: string` timeout is the maximum duration allowed for a prebuild to complete. If not specified, defaults to 1 hour. Must be between 5 minutes and 2 hours. - `trigger?: Trigger` trigger defines when prebuilds should be created. - `dailySchedule: DailySchedule` daily_schedule triggers a prebuild once per day at the specified hour (UTC). The actual start time may vary slightly to distribute system load. - `hourUtc?: number` hour_utc is the hour of day (0-23) in UTC when the prebuild should start. The actual start time may be adjusted by a few minutes to balance system load. - `recommendedEditors?: RecommendedEditors` recommended_editors specifies the editors recommended for this project. - `editors?: Record` editors maps editor aliases to their recommended versions. Key is the editor alias (e.g., "intellij", "goland", "vscode"). Value contains the list of recommended versions for that editor. If versions list is empty, all available versions are recommended. Example: {"intellij": {versions: ["2025.1", "2024.3"]}, "goland": {}} - `versions?: Array` versions is the list of recommended versions for this editor. If empty, all available versions are recommended. Examples for JetBrains: ["2025.1", "2024.3"] - `technicalDescription?: string` technical_description is a detailed technical description of the project This field is not returned by default in GetProject or ListProjects responses - `usedBy?: UsedBy` - `subjects?: Array` Subjects are the 10 most recent subjects who have used the project to create an environment - `id?: string` id is the UUID of the subject - `principal?: Principal` Principal is the principal of the subject - `totalSubjects?: number` Total number of unique subjects who have used the project ### Project Create From Environment Response - `ProjectCreateFromEnvironmentResponse` - `project?: Project` - `environmentClass: ProjectEnvironmentClass` Use `environment_classes` instead. - `environmentClassId?: string` Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. - `localRunner?: boolean` Use a local runner for the user - `order?: number` order is the priority of this entry - `id?: string` id is the unique identifier for the project - `automationsFilePath?: string` automations_file_path is the path to the automations file relative to the repo root - `desiredPhase?: ProjectPhase` desired_phase is the desired phase of the project When set to DELETED, the project is pending deletion - `"PROJECT_PHASE_UNSPECIFIED"` - `"PROJECT_PHASE_ACTIVE"` - `"PROJECT_PHASE_DELETED"` - `devcontainerFilePath?: string` devcontainer_file_path is the path to the devcontainer file relative to the repo root - `environmentClasses?: Array` environment_classes is the list of environment classes for the project - `environmentClassId?: string` Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. - `localRunner?: boolean` Use a local runner for the user - `order?: number` order is the priority of this entry - `initializer?: EnvironmentInitializer` initializer is the content initializer - `specs?: Array` - `contextUrl?: ContextURL` - `url?: string` url is the URL from which the environment is created - `git?: Git` - `checkoutLocation?: string` a path relative to the environment root in which the code will be checked out to - `cloneTarget?: string` the value for the clone target mode - use depends on the target mode - `remoteUri?: string` remote_uri is the Git remote origin - `targetMode?: "CLONE_TARGET_MODE_UNSPECIFIED" | "CLONE_TARGET_MODE_REMOTE_HEAD" | "CLONE_TARGET_MODE_REMOTE_COMMIT" | 3 more` the target mode determines what gets checked out - `"CLONE_TARGET_MODE_UNSPECIFIED"` - `"CLONE_TARGET_MODE_REMOTE_HEAD"` - `"CLONE_TARGET_MODE_REMOTE_COMMIT"` - `"CLONE_TARGET_MODE_REMOTE_BRANCH"` - `"CLONE_TARGET_MODE_LOCAL_BRANCH"` - `"CLONE_TARGET_MODE_REMOTE_TAG"` - `upstreamRemoteUri?: string` upstream_Remote_uri is the fork upstream of a repository - `metadata?: ProjectMetadata` - `createdAt?: string` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `creator?: Subject` creator is the identity of the project creator - `id?: string` id is the UUID of the subject - `principal?: Principal` Principal is the principal of the subject - `"PRINCIPAL_UNSPECIFIED"` - `"PRINCIPAL_ACCOUNT"` - `"PRINCIPAL_USER"` - `"PRINCIPAL_RUNNER"` - `"PRINCIPAL_ENVIRONMENT"` - `"PRINCIPAL_SERVICE_ACCOUNT"` - `"PRINCIPAL_RUNNER_MANAGER"` - `name?: string` name is the human readable name of the project - `organizationId?: string` organization_id is the ID of the organization that contains the environment - `updatedAt?: string` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `prebuildConfiguration?: ProjectPrebuildConfiguration` prebuild_configuration defines how prebuilds are created for this project. - `enabled?: boolean` enabled controls whether prebuilds are created for this project. When disabled, no automatic prebuilds will be triggered. - `enableJetbrainsWarmup?: boolean` enable_jetbrains_warmup controls whether JetBrains IDE warmup runs during prebuilds. - `environmentClassIds?: Array` environment_class_ids specifies which environment classes should have prebuilds created. If empty, no prebuilds are created. - `executor?: Subject` executor specifies who runs prebuilds for this project. The executor's SCM credentials are used to clone the repository. If not set, defaults to the project creator. - `timeout?: string` timeout is the maximum duration allowed for a prebuild to complete. If not specified, defaults to 1 hour. Must be between 5 minutes and 2 hours. - `trigger?: Trigger` trigger defines when prebuilds should be created. - `dailySchedule: DailySchedule` daily_schedule triggers a prebuild once per day at the specified hour (UTC). The actual start time may vary slightly to distribute system load. - `hourUtc?: number` hour_utc is the hour of day (0-23) in UTC when the prebuild should start. The actual start time may be adjusted by a few minutes to balance system load. - `recommendedEditors?: RecommendedEditors` recommended_editors specifies the editors recommended for this project. - `editors?: Record` editors maps editor aliases to their recommended versions. Key is the editor alias (e.g., "intellij", "goland", "vscode"). Value contains the list of recommended versions for that editor. If versions list is empty, all available versions are recommended. Example: {"intellij": {versions: ["2025.1", "2024.3"]}, "goland": {}} - `versions?: Array` versions is the list of recommended versions for this editor. If empty, all available versions are recommended. Examples for JetBrains: ["2025.1", "2024.3"] - `technicalDescription?: string` technical_description is a detailed technical description of the project This field is not returned by default in GetProject or ListProjects responses - `usedBy?: UsedBy` - `subjects?: Array` Subjects are the 10 most recent subjects who have used the project to create an environment - `id?: string` id is the UUID of the subject - `principal?: Principal` Principal is the principal of the subject - `totalSubjects?: number` Total number of unique subjects who have used the project ### Project Delete Response - `ProjectDeleteResponse = unknown` ### Project Retrieve Response - `ProjectRetrieveResponse` - `project?: Project` - `environmentClass: ProjectEnvironmentClass` Use `environment_classes` instead. - `environmentClassId?: string` Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. - `localRunner?: boolean` Use a local runner for the user - `order?: number` order is the priority of this entry - `id?: string` id is the unique identifier for the project - `automationsFilePath?: string` automations_file_path is the path to the automations file relative to the repo root - `desiredPhase?: ProjectPhase` desired_phase is the desired phase of the project When set to DELETED, the project is pending deletion - `"PROJECT_PHASE_UNSPECIFIED"` - `"PROJECT_PHASE_ACTIVE"` - `"PROJECT_PHASE_DELETED"` - `devcontainerFilePath?: string` devcontainer_file_path is the path to the devcontainer file relative to the repo root - `environmentClasses?: Array` environment_classes is the list of environment classes for the project - `environmentClassId?: string` Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. - `localRunner?: boolean` Use a local runner for the user - `order?: number` order is the priority of this entry - `initializer?: EnvironmentInitializer` initializer is the content initializer - `specs?: Array` - `contextUrl?: ContextURL` - `url?: string` url is the URL from which the environment is created - `git?: Git` - `checkoutLocation?: string` a path relative to the environment root in which the code will be checked out to - `cloneTarget?: string` the value for the clone target mode - use depends on the target mode - `remoteUri?: string` remote_uri is the Git remote origin - `targetMode?: "CLONE_TARGET_MODE_UNSPECIFIED" | "CLONE_TARGET_MODE_REMOTE_HEAD" | "CLONE_TARGET_MODE_REMOTE_COMMIT" | 3 more` the target mode determines what gets checked out - `"CLONE_TARGET_MODE_UNSPECIFIED"` - `"CLONE_TARGET_MODE_REMOTE_HEAD"` - `"CLONE_TARGET_MODE_REMOTE_COMMIT"` - `"CLONE_TARGET_MODE_REMOTE_BRANCH"` - `"CLONE_TARGET_MODE_LOCAL_BRANCH"` - `"CLONE_TARGET_MODE_REMOTE_TAG"` - `upstreamRemoteUri?: string` upstream_Remote_uri is the fork upstream of a repository - `metadata?: ProjectMetadata` - `createdAt?: string` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `creator?: Subject` creator is the identity of the project creator - `id?: string` id is the UUID of the subject - `principal?: Principal` Principal is the principal of the subject - `"PRINCIPAL_UNSPECIFIED"` - `"PRINCIPAL_ACCOUNT"` - `"PRINCIPAL_USER"` - `"PRINCIPAL_RUNNER"` - `"PRINCIPAL_ENVIRONMENT"` - `"PRINCIPAL_SERVICE_ACCOUNT"` - `"PRINCIPAL_RUNNER_MANAGER"` - `name?: string` name is the human readable name of the project - `organizationId?: string` organization_id is the ID of the organization that contains the environment - `updatedAt?: string` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `prebuildConfiguration?: ProjectPrebuildConfiguration` prebuild_configuration defines how prebuilds are created for this project. - `enabled?: boolean` enabled controls whether prebuilds are created for this project. When disabled, no automatic prebuilds will be triggered. - `enableJetbrainsWarmup?: boolean` enable_jetbrains_warmup controls whether JetBrains IDE warmup runs during prebuilds. - `environmentClassIds?: Array` environment_class_ids specifies which environment classes should have prebuilds created. If empty, no prebuilds are created. - `executor?: Subject` executor specifies who runs prebuilds for this project. The executor's SCM credentials are used to clone the repository. If not set, defaults to the project creator. - `timeout?: string` timeout is the maximum duration allowed for a prebuild to complete. If not specified, defaults to 1 hour. Must be between 5 minutes and 2 hours. - `trigger?: Trigger` trigger defines when prebuilds should be created. - `dailySchedule: DailySchedule` daily_schedule triggers a prebuild once per day at the specified hour (UTC). The actual start time may vary slightly to distribute system load. - `hourUtc?: number` hour_utc is the hour of day (0-23) in UTC when the prebuild should start. The actual start time may be adjusted by a few minutes to balance system load. - `recommendedEditors?: RecommendedEditors` recommended_editors specifies the editors recommended for this project. - `editors?: Record` editors maps editor aliases to their recommended versions. Key is the editor alias (e.g., "intellij", "goland", "vscode"). Value contains the list of recommended versions for that editor. If versions list is empty, all available versions are recommended. Example: {"intellij": {versions: ["2025.1", "2024.3"]}, "goland": {}} - `versions?: Array` versions is the list of recommended versions for this editor. If empty, all available versions are recommended. Examples for JetBrains: ["2025.1", "2024.3"] - `technicalDescription?: string` technical_description is a detailed technical description of the project This field is not returned by default in GetProject or ListProjects responses - `usedBy?: UsedBy` - `subjects?: Array` Subjects are the 10 most recent subjects who have used the project to create an environment - `id?: string` id is the UUID of the subject - `principal?: Principal` Principal is the principal of the subject - `totalSubjects?: number` Total number of unique subjects who have used the project ### Project Update Response - `ProjectUpdateResponse` - `project?: Project` - `environmentClass: ProjectEnvironmentClass` Use `environment_classes` instead. - `environmentClassId?: string` Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. - `localRunner?: boolean` Use a local runner for the user - `order?: number` order is the priority of this entry - `id?: string` id is the unique identifier for the project - `automationsFilePath?: string` automations_file_path is the path to the automations file relative to the repo root - `desiredPhase?: ProjectPhase` desired_phase is the desired phase of the project When set to DELETED, the project is pending deletion - `"PROJECT_PHASE_UNSPECIFIED"` - `"PROJECT_PHASE_ACTIVE"` - `"PROJECT_PHASE_DELETED"` - `devcontainerFilePath?: string` devcontainer_file_path is the path to the devcontainer file relative to the repo root - `environmentClasses?: Array` environment_classes is the list of environment classes for the project - `environmentClassId?: string` Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. - `localRunner?: boolean` Use a local runner for the user - `order?: number` order is the priority of this entry - `initializer?: EnvironmentInitializer` initializer is the content initializer - `specs?: Array` - `contextUrl?: ContextURL` - `url?: string` url is the URL from which the environment is created - `git?: Git` - `checkoutLocation?: string` a path relative to the environment root in which the code will be checked out to - `cloneTarget?: string` the value for the clone target mode - use depends on the target mode - `remoteUri?: string` remote_uri is the Git remote origin - `targetMode?: "CLONE_TARGET_MODE_UNSPECIFIED" | "CLONE_TARGET_MODE_REMOTE_HEAD" | "CLONE_TARGET_MODE_REMOTE_COMMIT" | 3 more` the target mode determines what gets checked out - `"CLONE_TARGET_MODE_UNSPECIFIED"` - `"CLONE_TARGET_MODE_REMOTE_HEAD"` - `"CLONE_TARGET_MODE_REMOTE_COMMIT"` - `"CLONE_TARGET_MODE_REMOTE_BRANCH"` - `"CLONE_TARGET_MODE_LOCAL_BRANCH"` - `"CLONE_TARGET_MODE_REMOTE_TAG"` - `upstreamRemoteUri?: string` upstream_Remote_uri is the fork upstream of a repository - `metadata?: ProjectMetadata` - `createdAt?: string` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `creator?: Subject` creator is the identity of the project creator - `id?: string` id is the UUID of the subject - `principal?: Principal` Principal is the principal of the subject - `"PRINCIPAL_UNSPECIFIED"` - `"PRINCIPAL_ACCOUNT"` - `"PRINCIPAL_USER"` - `"PRINCIPAL_RUNNER"` - `"PRINCIPAL_ENVIRONMENT"` - `"PRINCIPAL_SERVICE_ACCOUNT"` - `"PRINCIPAL_RUNNER_MANAGER"` - `name?: string` name is the human readable name of the project - `organizationId?: string` organization_id is the ID of the organization that contains the environment - `updatedAt?: string` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `prebuildConfiguration?: ProjectPrebuildConfiguration` prebuild_configuration defines how prebuilds are created for this project. - `enabled?: boolean` enabled controls whether prebuilds are created for this project. When disabled, no automatic prebuilds will be triggered. - `enableJetbrainsWarmup?: boolean` enable_jetbrains_warmup controls whether JetBrains IDE warmup runs during prebuilds. - `environmentClassIds?: Array` environment_class_ids specifies which environment classes should have prebuilds created. If empty, no prebuilds are created. - `executor?: Subject` executor specifies who runs prebuilds for this project. The executor's SCM credentials are used to clone the repository. If not set, defaults to the project creator. - `timeout?: string` timeout is the maximum duration allowed for a prebuild to complete. If not specified, defaults to 1 hour. Must be between 5 minutes and 2 hours. - `trigger?: Trigger` trigger defines when prebuilds should be created. - `dailySchedule: DailySchedule` daily_schedule triggers a prebuild once per day at the specified hour (UTC). The actual start time may vary slightly to distribute system load. - `hourUtc?: number` hour_utc is the hour of day (0-23) in UTC when the prebuild should start. The actual start time may be adjusted by a few minutes to balance system load. - `recommendedEditors?: RecommendedEditors` recommended_editors specifies the editors recommended for this project. - `editors?: Record` editors maps editor aliases to their recommended versions. Key is the editor alias (e.g., "intellij", "goland", "vscode"). Value contains the list of recommended versions for that editor. If versions list is empty, all available versions are recommended. Example: {"intellij": {versions: ["2025.1", "2024.3"]}, "goland": {}} - `versions?: Array` versions is the list of recommended versions for this editor. If empty, all available versions are recommended. Examples for JetBrains: ["2025.1", "2024.3"] - `technicalDescription?: string` technical_description is a detailed technical description of the project This field is not returned by default in GetProject or ListProjects responses - `usedBy?: UsedBy` - `subjects?: Array` Subjects are the 10 most recent subjects who have used the project to create an environment - `id?: string` id is the UUID of the subject - `principal?: Principal` Principal is the principal of the subject - `totalSubjects?: number` Total number of unique subjects who have used the project # Environment Clases ## ListProjectEnvironmentClasses `client.projects.environmentClases.list(EnvironmentClaseListParamsparams, RequestOptionsoptions?): ProjectEnvironmentClassesPage` **post** `/gitpod.v1.ProjectService/ListProjectEnvironmentClasses` Lists environment classes of a project. Use this method to: - View all environment classes of a project ### Examples - List project environment classes: Shows all environment classes of a project. ```yaml projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" pagination: pageSize: 20 ``` ### Parameters - `params: EnvironmentClaseListParams` - `token?: string` Query param - `pageSize?: number` Query param - `pagination?: Pagination` Body param: pagination contains the pagination options for listing project policies - `token?: string` Token for the next set of results that was returned as next_token of a PaginationResponse - `pageSize?: number` Page size is the maximum number of results to retrieve per page. Defaults to 25. Maximum 100. - `projectId?: string` Body param: project_id specifies the project identifier ### Returns - `ProjectEnvironmentClass` - `environmentClassId?: string` Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. - `localRunner?: boolean` Use a local runner for the user - `order?: number` order is the priority of this entry ### Example ```typescript import Gitpod from '@gitpod/sdk'; const client = new Gitpod({ bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const projectEnvironmentClass of client.projects.environmentClases.list({ pagination: { pageSize: 20 }, projectId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', })) { console.log(projectEnvironmentClass.environmentClassId); } ``` #### Response ```json { "pagination": { "nextToken": "nextToken" }, "projectEnvironmentClasses": [ { "environmentClassId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "localRunner": true, "order": 0 } ] } ``` ## UpdateProjectEnvironmentClasses `client.projects.environmentClases.update(EnvironmentClaseUpdateParamsbody, RequestOptionsoptions?): EnvironmentClaseUpdateResponse` **post** `/gitpod.v1.ProjectService/UpdateProjectEnvironmentClasses` Updates all environment classes of a project. Use this method to: - Modify all environment classea of a project ### Examples - Update project environment classes: Updates all environment classes for a project. ```yaml projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" projectEnvironmentClasses: - environmentClassId: "b0e12f6c-4c67-429d-a4a6-d9838b5da041" order: 0 - localRunner: true order: 1 ``` ### Parameters - `body: EnvironmentClaseUpdateParams` - `projectEnvironmentClasses?: Array` - `environmentClassId?: string` Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. - `localRunner?: boolean` Use a local runner for the user - `order?: number` order is the priority of this entry - `projectId?: string` project_id specifies the project identifier ### Returns - `EnvironmentClaseUpdateResponse = unknown` ### Example ```typescript import Gitpod from '@gitpod/sdk'; const client = new Gitpod({ bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted }); const environmentClase = await client.projects.environmentClases.update({ projectEnvironmentClasses: [ { environmentClassId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da041', order: 0 }, { localRunner: true, order: 1 }, ], projectId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', }); console.log(environmentClase); ``` #### Response ```json {} ``` ## Domain Types ### Environment Clase Update Response - `EnvironmentClaseUpdateResponse = unknown` # Policies ## CreateProjectPolicy `client.projects.policies.create(PolicyCreateParamsbody, RequestOptionsoptions?): PolicyCreateResponse` **post** `/gitpod.v1.ProjectService/CreateProjectPolicy` Creates a new policy for a project. Use this method to: - Set up access controls - Define group permissions - Configure role-based access ### Examples - Create admin policy: Grants admin access to a group. ```yaml projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" groupId: "f53d2330-3795-4c5d-a1f3-453121af9c60" role: PROJECT_ROLE_ADMIN ``` ### Parameters - `body: PolicyCreateParams` - `groupId?: string` group_id specifies the group_id identifier - `projectId?: string` project_id specifies the project identifier - `role?: ProjectRole` - `"PROJECT_ROLE_UNSPECIFIED"` - `"PROJECT_ROLE_ADMIN"` - `"PROJECT_ROLE_USER"` - `"PROJECT_ROLE_EDITOR"` ### Returns - `PolicyCreateResponse` - `policy?: ProjectPolicy` - `groupId?: string` - `role?: ProjectRole` role is the role assigned to the group - `"PROJECT_ROLE_UNSPECIFIED"` - `"PROJECT_ROLE_ADMIN"` - `"PROJECT_ROLE_USER"` - `"PROJECT_ROLE_EDITOR"` ### Example ```typescript import Gitpod from '@gitpod/sdk'; const client = new Gitpod({ bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted }); const policy = await client.projects.policies.create({ groupId: 'f53d2330-3795-4c5d-a1f3-453121af9c60', projectId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', role: 'PROJECT_ROLE_ADMIN', }); console.log(policy.policy); ``` #### Response ```json { "policy": { "groupId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "role": "PROJECT_ROLE_UNSPECIFIED" } } ``` ## DeleteProjectPolicy `client.projects.policies.delete(PolicyDeleteParamsbody, RequestOptionsoptions?): PolicyDeleteResponse` **post** `/gitpod.v1.ProjectService/DeleteProjectPolicy` Deletes a project policy. Use this method to: - Remove access controls - Revoke permissions - Clean up policies ### Examples - Delete policy: Removes a group's access policy. ```yaml projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" groupId: "f53d2330-3795-4c5d-a1f3-453121af9c60" ``` ### Parameters - `body: PolicyDeleteParams` - `groupId?: string` group_id specifies the group_id identifier - `projectId?: string` project_id specifies the project identifier ### Returns - `PolicyDeleteResponse = unknown` ### Example ```typescript import Gitpod from '@gitpod/sdk'; const client = new Gitpod({ bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted }); const policy = await client.projects.policies.delete({ groupId: 'f53d2330-3795-4c5d-a1f3-453121af9c60', projectId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', }); console.log(policy); ``` #### Response ```json {} ``` ## ListProjectPolicies `client.projects.policies.list(PolicyListParamsparams, RequestOptionsoptions?): PoliciesPage` **post** `/gitpod.v1.ProjectService/ListProjectPolicies` Lists policies for a project. Use this method to: - View access controls - Check policy configurations - Audit permissions ### Examples - List policies: Shows all policies for a project. ```yaml projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" pagination: pageSize: 20 ``` ### Parameters - `params: PolicyListParams` - `token?: string` Query param - `pageSize?: number` Query param - `pagination?: Pagination` Body param: pagination contains the pagination options for listing project policies - `token?: string` Token for the next set of results that was returned as next_token of a PaginationResponse - `pageSize?: number` Page size is the maximum number of results to retrieve per page. Defaults to 25. Maximum 100. - `projectId?: string` Body param: project_id specifies the project identifier ### Returns - `ProjectPolicy` - `groupId?: string` - `role?: ProjectRole` role is the role assigned to the group - `"PROJECT_ROLE_UNSPECIFIED"` - `"PROJECT_ROLE_ADMIN"` - `"PROJECT_ROLE_USER"` - `"PROJECT_ROLE_EDITOR"` ### Example ```typescript import Gitpod from '@gitpod/sdk'; const client = new Gitpod({ bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const projectPolicy of client.projects.policies.list({ pagination: { pageSize: 20 }, projectId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', })) { console.log(projectPolicy.groupId); } ``` #### Response ```json { "pagination": { "nextToken": "nextToken" }, "policies": [ { "groupId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "role": "PROJECT_ROLE_UNSPECIFIED" } ] } ``` ## UpdateProjectPolicy `client.projects.policies.update(PolicyUpdateParamsbody, RequestOptionsoptions?): PolicyUpdateResponse` **post** `/gitpod.v1.ProjectService/UpdateProjectPolicy` Updates an existing project policy. Use this method to: - Modify access levels - Change group roles - Update permissions ### Examples - Update policy role: Changes a group's access level. ```yaml projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" groupId: "f53d2330-3795-4c5d-a1f3-453121af9c60" role: PROJECT_ROLE_EDITOR ``` ### Parameters - `body: PolicyUpdateParams` - `groupId?: string` group_id specifies the group_id identifier - `projectId?: string` project_id specifies the project identifier - `role?: ProjectRole` - `"PROJECT_ROLE_UNSPECIFIED"` - `"PROJECT_ROLE_ADMIN"` - `"PROJECT_ROLE_USER"` - `"PROJECT_ROLE_EDITOR"` ### Returns - `PolicyUpdateResponse` - `policy?: ProjectPolicy` - `groupId?: string` - `role?: ProjectRole` role is the role assigned to the group - `"PROJECT_ROLE_UNSPECIFIED"` - `"PROJECT_ROLE_ADMIN"` - `"PROJECT_ROLE_USER"` - `"PROJECT_ROLE_EDITOR"` ### Example ```typescript import Gitpod from '@gitpod/sdk'; const client = new Gitpod({ bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted }); const policy = await client.projects.policies.update({ groupId: 'f53d2330-3795-4c5d-a1f3-453121af9c60', projectId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', role: 'PROJECT_ROLE_EDITOR', }); console.log(policy.policy); ``` #### Response ```json { "policy": { "groupId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "role": "PROJECT_ROLE_UNSPECIFIED" } } ``` ## Domain Types ### Project Policy - `ProjectPolicy` - `groupId?: string` - `role?: ProjectRole` role is the role assigned to the group - `"PROJECT_ROLE_UNSPECIFIED"` - `"PROJECT_ROLE_ADMIN"` - `"PROJECT_ROLE_USER"` - `"PROJECT_ROLE_EDITOR"` ### Project Role - `ProjectRole = "PROJECT_ROLE_UNSPECIFIED" | "PROJECT_ROLE_ADMIN" | "PROJECT_ROLE_USER" | "PROJECT_ROLE_EDITOR"` - `"PROJECT_ROLE_UNSPECIFIED"` - `"PROJECT_ROLE_ADMIN"` - `"PROJECT_ROLE_USER"` - `"PROJECT_ROLE_EDITOR"` ### Policy Create Response - `PolicyCreateResponse` - `policy?: ProjectPolicy` - `groupId?: string` - `role?: ProjectRole` role is the role assigned to the group - `"PROJECT_ROLE_UNSPECIFIED"` - `"PROJECT_ROLE_ADMIN"` - `"PROJECT_ROLE_USER"` - `"PROJECT_ROLE_EDITOR"` ### Policy Delete Response - `PolicyDeleteResponse = unknown` ### Policy Update Response - `PolicyUpdateResponse` - `policy?: ProjectPolicy` - `groupId?: string` - `role?: ProjectRole` role is the role assigned to the group - `"PROJECT_ROLE_UNSPECIFIED"` - `"PROJECT_ROLE_ADMIN"` - `"PROJECT_ROLE_USER"` - `"PROJECT_ROLE_EDITOR"`