Skip to content

feat(api): manual updates #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 106
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-da4c36c6b1d973f481abb8eefdeb085d88eaf37eeaba30d276cb3daa405b6f0c.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-36f9d46890bf3667f5a6529bdb156fe1560834ad8187c4271aa0b0024de1adb5.yml
8 changes: 0 additions & 8 deletions src/gitpod/resources/environments/environments.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ def list(
token: str | NotGiven = NOT_GIVEN,
page_size: int | NotGiven = NOT_GIVEN,
filter: environment_list_params.Filter | NotGiven = NOT_GIVEN,
organization_id: str | NotGiven = NOT_GIVEN,
pagination: environment_list_params.Pagination | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand All @@ -261,8 +260,6 @@ def list(
ListEnvironments returns a list of environments that match the query.

Args:
organization_id: organization_id is the ID of the organization that contains the environments

pagination: pagination contains the pagination options for listing environments

extra_headers: Send extra headers
Expand All @@ -279,7 +276,6 @@ def list(
body=maybe_transform(
{
"filter": filter,
"organization_id": organization_id,
"pagination": pagination,
},
environment_list_params.EnvironmentListParams,
Expand Down Expand Up @@ -739,7 +735,6 @@ def list(
token: str | NotGiven = NOT_GIVEN,
page_size: int | NotGiven = NOT_GIVEN,
filter: environment_list_params.Filter | NotGiven = NOT_GIVEN,
organization_id: str | NotGiven = NOT_GIVEN,
pagination: environment_list_params.Pagination | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand All @@ -752,8 +747,6 @@ def list(
ListEnvironments returns a list of environments that match the query.

Args:
organization_id: organization_id is the ID of the organization that contains the environments

pagination: pagination contains the pagination options for listing environments

extra_headers: Send extra headers
Expand All @@ -770,7 +763,6 @@ def list(
body=maybe_transform(
{
"filter": filter,
"organization_id": organization_id,
"pagination": pagination,
},
environment_list_params.EnvironmentListParams,
Expand Down
18 changes: 18 additions & 0 deletions src/gitpod/resources/secrets.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def with_streaming_response(self) -> SecretsResourceWithStreamingResponse:
def create(
self,
*,
container_registry_basic_auth_host: str | NotGiven = NOT_GIVEN,
environment_variable: bool | NotGiven = NOT_GIVEN,
file_path: str | NotGiven = NOT_GIVEN,
name: str | NotGiven = NOT_GIVEN,
Expand All @@ -72,6 +73,13 @@ def create(
CreateSecret creates a new secret.

Args:
container_registry_basic_auth_host: secret will be mounted as a docker config in the environment VM, mount will have
the docker host value must be a valid registry hostname with optional port:

```
this.matches("^[a-zA-Z0-9][a-zA-Z0-9.-]*[a-zA-Z0-9](:[0-9]+)?$")
```

environment_variable: secret will be created as an Environment Variable with the same name as the
secret

Expand All @@ -98,6 +106,7 @@ def create(
"/gitpod.v1.SecretService/CreateSecret",
body=maybe_transform(
{
"container_registry_basic_auth_host": container_registry_basic_auth_host,
"environment_variable": environment_variable,
"file_path": file_path,
"name": name,
Expand Down Expand Up @@ -297,6 +306,7 @@ def with_streaming_response(self) -> AsyncSecretsResourceWithStreamingResponse:
async def create(
self,
*,
container_registry_basic_auth_host: str | NotGiven = NOT_GIVEN,
environment_variable: bool | NotGiven = NOT_GIVEN,
file_path: str | NotGiven = NOT_GIVEN,
name: str | NotGiven = NOT_GIVEN,
Expand All @@ -313,6 +323,13 @@ async def create(
CreateSecret creates a new secret.

Args:
container_registry_basic_auth_host: secret will be mounted as a docker config in the environment VM, mount will have
the docker host value must be a valid registry hostname with optional port:

```
this.matches("^[a-zA-Z0-9][a-zA-Z0-9.-]*[a-zA-Z0-9](:[0-9]+)?$")
```

environment_variable: secret will be created as an Environment Variable with the same name as the
secret

Expand All @@ -339,6 +356,7 @@ async def create(
"/gitpod.v1.SecretService/CreateSecret",
body=await async_maybe_transform(
{
"container_registry_basic_auth_host": container_registry_basic_auth_host,
"environment_variable": environment_variable,
"file_path": file_path,
"name": name,
Expand Down
3 changes: 0 additions & 3 deletions src/gitpod/types/environment_list_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ class EnvironmentListParams(TypedDict, total=False):

filter: Filter

organization_id: Annotated[str, PropertyInfo(alias="organizationId")]
"""organization_id is the ID of the organization that contains the environments"""

pagination: Pagination
"""pagination contains the pagination options for listing environments"""

Expand Down
6 changes: 6 additions & 0 deletions src/gitpod/types/environment_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ class Port(BaseModel):


class Secret(BaseModel):
container_registry_basic_auth_host: Optional[str] = FieldInfo(alias="containerRegistryBasicAuthHost", default=None)
"""
container_registry_basic_auth_host is the hostname of the container registry
that supports basic auth
"""

environment_variable: Optional[str] = FieldInfo(alias="environmentVariable", default=None)

file_path: Optional[str] = FieldInfo(alias="filePath", default=None)
Expand Down
6 changes: 6 additions & 0 deletions src/gitpod/types/environment_spec_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ class Port(TypedDict, total=False):


class Secret(TypedDict, total=False):
container_registry_basic_auth_host: Annotated[str, PropertyInfo(alias="containerRegistryBasicAuthHost")]
"""
container_registry_basic_auth_host is the hostname of the container registry
that supports basic auth
"""

environment_variable: Annotated[str, PropertyInfo(alias="environmentVariable")]

file_path: Annotated[str, PropertyInfo(alias="filePath")]
Expand Down
22 changes: 22 additions & 0 deletions src/gitpod/types/environments/class_list_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
from typing_extensions import Annotated, TypedDict

from ..._utils import PropertyInfo
from ..runner_kind import RunnerKind
from ..runner_provider import RunnerProvider

__all__ = ["ClassListParams", "Filter", "Pagination"]

Expand All @@ -22,6 +24,14 @@ class ClassListParams(TypedDict, total=False):


class Filter(TypedDict, total=False):
can_create_environments: Annotated[Optional[bool], PropertyInfo(alias="canCreateEnvironments")]
"""
can_create_environments filters the response to only environment classes that
can be used to create new environments by the caller. Unlike enabled, which
indicates general availability, this ensures the caller only sees environment
classes they are allowed to use.
"""

enabled: Optional[bool]
"""
enabled filters the response to only enabled or disabled environment classes. If
Expand All @@ -31,6 +41,18 @@ class Filter(TypedDict, total=False):
runner_ids: Annotated[List[str], PropertyInfo(alias="runnerIds")]
"""runner_ids filters the response to only EnvironmentClasses of these Runner IDs"""

runner_kinds: Annotated[List[RunnerKind], PropertyInfo(alias="runnerKinds")]
"""
runner_kind filters the response to only environment classes from runners of
these kinds.
"""

runner_providers: Annotated[List[RunnerProvider], PropertyInfo(alias="runnerProviders")]
"""
runner_providers filters the response to only environment classes from runners
of these providers.
"""


class Pagination(TypedDict, total=False):
token: str
Expand Down
4 changes: 3 additions & 1 deletion src/gitpod/types/projects/project_role.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@

__all__ = ["ProjectRole"]

ProjectRole: TypeAlias = Literal["PROJECT_ROLE_UNSPECIFIED", "PROJECT_ROLE_ADMIN", "PROJECT_ROLE_USER"]
ProjectRole: TypeAlias = Literal[
"PROJECT_ROLE_UNSPECIFIED", "PROJECT_ROLE_ADMIN", "PROJECT_ROLE_USER", "PROJECT_ROLE_EDITOR"
]
1 change: 1 addition & 0 deletions src/gitpod/types/resource_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@
"RESOURCE_TYPE_SERVICE_ACCOUNT",
"RESOURCE_TYPE_SECRET",
"RESOURCE_TYPE_SSO_CONFIG",
"RESOURCE_TYPE_DOMAIN_VERIFICATION",
]
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
from typing_extensions import Annotated, TypedDict

from ...._utils import PropertyInfo
from ...runner_kind import RunnerKind
from ...runner_provider import RunnerProvider

__all__ = ["EnvironmentClassListParams", "Filter", "Pagination"]

Expand All @@ -22,6 +24,14 @@ class EnvironmentClassListParams(TypedDict, total=False):


class Filter(TypedDict, total=False):
can_create_environments: Annotated[Optional[bool], PropertyInfo(alias="canCreateEnvironments")]
"""
can_create_environments filters the response to only environment classes that
can be used to create new environments by the caller. Unlike enabled, which
indicates general availability, this ensures the caller only sees environment
classes they are allowed to use.
"""

enabled: Optional[bool]
"""
enabled filters the response to only enabled or disabled environment classes. If
Expand All @@ -31,6 +41,18 @@ class Filter(TypedDict, total=False):
runner_ids: Annotated[List[str], PropertyInfo(alias="runnerIds")]
"""runner_ids filters the response to only EnvironmentClasses of these Runner IDs"""

runner_kinds: Annotated[List[RunnerKind], PropertyInfo(alias="runnerKinds")]
"""
runner_kind filters the response to only environment classes from runners of
these kinds.
"""

runner_providers: Annotated[List[RunnerProvider], PropertyInfo(alias="runnerProviders")]
"""
runner_providers filters the response to only environment classes from runners
of these providers.
"""


class Pagination(TypedDict, total=False):
token: str
Expand Down
3 changes: 3 additions & 0 deletions src/gitpod/types/secret.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
class Secret(BaseModel):
id: Optional[str] = None

container_registry_basic_auth_host: Optional[str] = FieldInfo(alias="containerRegistryBasicAuthHost", default=None)
"""secret will be mounted as a registry secret"""

created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None)
"""
A Timestamp represents a point in time independent of any time zone or local
Expand Down
10 changes: 10 additions & 0 deletions src/gitpod/types/secret_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@


class SecretCreateParams(TypedDict, total=False):
container_registry_basic_auth_host: Annotated[str, PropertyInfo(alias="containerRegistryBasicAuthHost")]
"""
secret will be mounted as a docker config in the environment VM, mount will have
the docker host value must be a valid registry hostname with optional port:

```
this.matches('^[a-zA-Z0-9][a-zA-Z0-9.-]*[a-zA-Z0-9](:[0-9]+)?$')
```
"""

environment_variable: Annotated[bool, PropertyInfo(alias="environmentVariable")]
"""
secret will be created as an Environment Variable with the same name as the
Expand Down
6 changes: 6 additions & 0 deletions tests/api_resources/environments/test_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None:
token="token",
page_size=0,
filter={
"can_create_environments": True,
"enabled": True,
"runner_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
"runner_kinds": ["RUNNER_KIND_UNSPECIFIED"],
"runner_providers": ["RUNNER_PROVIDER_UNSPECIFIED"],
},
pagination={
"token": "token",
Expand Down Expand Up @@ -80,8 +83,11 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N
token="token",
page_size=0,
filter={
"can_create_environments": True,
"enabled": True,
"runner_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
"runner_kinds": ["RUNNER_KIND_UNSPECIFIED"],
"runner_providers": ["RUNNER_PROVIDER_UNSPECIFIED"],
},
pagination={
"token": "token",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,11 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None:
token="token",
page_size=0,
filter={
"can_create_environments": True,
"enabled": True,
"runner_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
"runner_kinds": ["RUNNER_KIND_UNSPECIFIED"],
"runner_providers": ["RUNNER_PROVIDER_UNSPECIFIED"],
},
pagination={
"token": "token",
Expand Down Expand Up @@ -324,8 +327,11 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N
token="token",
page_size=0,
filter={
"can_create_environments": True,
"enabled": True,
"runner_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
"runner_kinds": ["RUNNER_KIND_UNSPECIFIED"],
"runner_providers": ["RUNNER_PROVIDER_UNSPECIFIED"],
},
pagination={
"token": "token",
Expand Down
6 changes: 4 additions & 2 deletions tests/api_resources/test_environments.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None:
],
"secrets": [
{
"container_registry_basic_auth_host": "containerRegistryBasicAuthHost",
"environment_variable": "environmentVariable",
"file_path": "filePath",
"git_credential_host": "gitCredentialHost",
Expand Down Expand Up @@ -256,7 +257,6 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None:
"runner_kinds": ["RUNNER_KIND_UNSPECIFIED"],
"status_phases": ["ENVIRONMENT_PHASE_UNSPECIFIED"],
},
organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
pagination={
"token": "token",
"page_size": 100,
Expand Down Expand Up @@ -377,6 +377,7 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non
],
"secrets": [
{
"container_registry_basic_auth_host": "containerRegistryBasicAuthHost",
"environment_variable": "environmentVariable",
"file_path": "filePath",
"git_credential_host": "gitCredentialHost",
Expand Down Expand Up @@ -625,6 +626,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) ->
],
"secrets": [
{
"container_registry_basic_auth_host": "containerRegistryBasicAuthHost",
"environment_variable": "environmentVariable",
"file_path": "filePath",
"git_credential_host": "gitCredentialHost",
Expand Down Expand Up @@ -803,7 +805,6 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N
"runner_kinds": ["RUNNER_KIND_UNSPECIFIED"],
"status_phases": ["ENVIRONMENT_PHASE_UNSPECIFIED"],
},
organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
pagination={
"token": "token",
"page_size": 100,
Expand Down Expand Up @@ -924,6 +925,7 @@ async def test_method_create_from_project_with_all_params(self, async_client: As
],
"secrets": [
{
"container_registry_basic_auth_host": "containerRegistryBasicAuthHost",
"environment_variable": "environmentVariable",
"file_path": "filePath",
"git_credential_host": "gitCredentialHost",
Expand Down
2 changes: 2 additions & 0 deletions tests/api_resources/test_secrets.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def test_method_create(self, client: Gitpod) -> None:
@parametrize
def test_method_create_with_all_params(self, client: Gitpod) -> None:
secret = client.secrets.create(
container_registry_basic_auth_host="containerRegistryBasicAuthHost",
environment_variable=True,
file_path="filePath",
name="name",
Expand Down Expand Up @@ -227,6 +228,7 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None:
@parametrize
async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None:
secret = await async_client.secrets.create(
container_registry_basic_auth_host="containerRegistryBasicAuthHost",
environment_variable=True,
file_path="filePath",
name="name",
Expand Down