Skip to content

feat(api): manual updates #20

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 12, 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
8 changes: 4 additions & 4 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@ from gitpod.types import (
Principal,
RunsOn,
Subject,
Task,
TaskExecution,
TaskExecutionMetadata,
TaskExecutionPhase,
TaskExecutionSpec,
TaskExecutionStatus,
TaskMetadata,
TaskSpec,
UserStatus,
)
```
Expand Down Expand Up @@ -141,9 +144,6 @@ Types:

```python
from gitpod.types.environments.automations import (
Task,
TaskMetadata,
TaskSpec,
TaskCreateResponse,
TaskRetrieveResponse,
TaskUpdateResponse,
Expand All @@ -157,7 +157,7 @@ Methods:
- <code title="post /gitpod.v1.EnvironmentAutomationService/CreateTask">client.environments.automations.tasks.<a href="./src/gitpod/resources/environments/automations/tasks/tasks.py">create</a>(\*\*<a href="src/gitpod/types/environments/automations/task_create_params.py">params</a>) -> <a href="./src/gitpod/types/environments/automations/task_create_response.py">TaskCreateResponse</a></code>
- <code title="post /gitpod.v1.EnvironmentAutomationService/GetTask">client.environments.automations.tasks.<a href="./src/gitpod/resources/environments/automations/tasks/tasks.py">retrieve</a>(\*\*<a href="src/gitpod/types/environments/automations/task_retrieve_params.py">params</a>) -> <a href="./src/gitpod/types/environments/automations/task_retrieve_response.py">TaskRetrieveResponse</a></code>
- <code title="post /gitpod.v1.EnvironmentAutomationService/UpdateTask">client.environments.automations.tasks.<a href="./src/gitpod/resources/environments/automations/tasks/tasks.py">update</a>(\*\*<a href="src/gitpod/types/environments/automations/task_update_params.py">params</a>) -> <a href="./src/gitpod/types/environments/automations/task_update_response.py">object</a></code>
- <code title="post /gitpod.v1.EnvironmentAutomationService/ListTasks">client.environments.automations.tasks.<a href="./src/gitpod/resources/environments/automations/tasks/tasks.py">list</a>(\*\*<a href="src/gitpod/types/environments/automations/task_list_params.py">params</a>) -> <a href="./src/gitpod/types/environments/automations/task.py">SyncTasksPage[Task]</a></code>
- <code title="post /gitpod.v1.EnvironmentAutomationService/ListTasks">client.environments.automations.tasks.<a href="./src/gitpod/resources/environments/automations/tasks/tasks.py">list</a>(\*\*<a href="src/gitpod/types/environments/automations/task_list_params.py">params</a>) -> <a href="./src/gitpod/types/shared/task.py">SyncTasksPage[Task]</a></code>
- <code title="post /gitpod.v1.EnvironmentAutomationService/DeleteTask">client.environments.automations.tasks.<a href="./src/gitpod/resources/environments/automations/tasks/tasks.py">delete</a>(\*\*<a href="src/gitpod/types/environments/automations/task_delete_params.py">params</a>) -> <a href="./src/gitpod/types/environments/automations/task_delete_response.py">object</a></code>
- <code title="post /gitpod.v1.EnvironmentAutomationService/StartTask">client.environments.automations.tasks.<a href="./src/gitpod/resources/environments/automations/tasks/tasks.py">start</a>(\*\*<a href="src/gitpod/types/environments/automations/task_start_params.py">params</a>) -> <a href="./src/gitpod/types/environments/automations/task_start_response.py">TaskStartResponse</a></code>

Expand Down
14 changes: 7 additions & 7 deletions src/gitpod/resources/environments/automations/tasks/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
)
from .....pagination import SyncTasksPage, AsyncTasksPage
from ....._base_client import AsyncPaginator, make_request_options
from .....types.shared.task import Task
from .....types.shared_params.task_spec import TaskSpec
from .....types.environments.automations import (
task_list_params,
task_start_params,
Expand All @@ -37,9 +39,7 @@
task_update_params,
task_retrieve_params,
)
from .....types.environments.automations.task import Task
from .....types.environments.automations.task_spec_param import TaskSpecParam
from .....types.environments.automations.task_metadata_param import TaskMetadataParam
from .....types.shared_params.task_metadata import TaskMetadata
from .....types.environments.automations.task_start_response import TaskStartResponse
from .....types.environments.automations.task_create_response import TaskCreateResponse
from .....types.environments.automations.task_retrieve_response import TaskRetrieveResponse
Expand Down Expand Up @@ -76,8 +76,8 @@ def create(
*,
depends_on: List[str] | NotGiven = NOT_GIVEN,
environment_id: str | NotGiven = NOT_GIVEN,
metadata: TaskMetadataParam | NotGiven = NOT_GIVEN,
spec: TaskSpecParam | NotGiven = NOT_GIVEN,
metadata: TaskMetadata | NotGiven = NOT_GIVEN,
spec: TaskSpec | 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.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -344,8 +344,8 @@ async def create(
*,
depends_on: List[str] | NotGiven = NOT_GIVEN,
environment_id: str | NotGiven = NOT_GIVEN,
metadata: TaskMetadataParam | NotGiven = NOT_GIVEN,
spec: TaskSpecParam | NotGiven = NOT_GIVEN,
metadata: TaskMetadata | NotGiven = NOT_GIVEN,
spec: TaskSpec | 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.
extra_headers: Headers | None = None,
Expand Down
3 changes: 3 additions & 0 deletions src/gitpod/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@
from .runner import Runner as Runner
from .secret import Secret as Secret
from .shared import (
Task as Task,
RunsOn as RunsOn,
Subject as Subject,
TaskSpec as TaskSpec,
Principal as Principal,
FieldValue as FieldValue,
UserStatus as UserStatus,
TaskMetadata as TaskMetadata,
TaskExecution as TaskExecution,
EnvironmentClass as EnvironmentClass,
OrganizationRole as OrganizationRole,
Expand Down
5 changes: 0 additions & 5 deletions src/gitpod/types/environments/automations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,10 @@

from __future__ import annotations

from .task import Task as Task
from .service import Service as Service
from .task_spec import TaskSpec as TaskSpec
from .service_spec import ServiceSpec as ServiceSpec
from .service_phase import ServicePhase as ServicePhase
from .task_metadata import TaskMetadata as TaskMetadata
from .service_status import ServiceStatus as ServiceStatus
from .task_spec_param import TaskSpecParam as TaskSpecParam
from .service_metadata import ServiceMetadata as ServiceMetadata
from .task_list_params import TaskListParams as TaskListParams
from .task_start_params import TaskStartParams as TaskStartParams
Expand All @@ -19,7 +15,6 @@
from .task_update_params import TaskUpdateParams as TaskUpdateParams
from .service_list_params import ServiceListParams as ServiceListParams
from .service_stop_params import ServiceStopParams as ServiceStopParams
from .task_metadata_param import TaskMetadataParam as TaskMetadataParam
from .task_start_response import TaskStartResponse as TaskStartResponse
from .service_start_params import ServiceStartParams as ServiceStartParams
from .task_create_response import TaskCreateResponse as TaskCreateResponse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from typing_extensions import Annotated, TypedDict

from ...._utils import PropertyInfo
from .task_spec_param import TaskSpecParam
from .task_metadata_param import TaskMetadataParam
from ...shared_params.task_spec import TaskSpec
from ...shared_params.task_metadata import TaskMetadata

__all__ = ["TaskCreateParams"]

Expand All @@ -17,6 +17,6 @@ class TaskCreateParams(TypedDict, total=False):

environment_id: Annotated[str, PropertyInfo(alias="environmentId")]

metadata: TaskMetadataParam
metadata: TaskMetadata

spec: TaskSpecParam
spec: TaskSpec
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

from typing import Optional

from .task import Task
from ...._models import BaseModel
from ...shared.task import Task

__all__ = ["TaskCreateResponse"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

from typing import Optional

from .task import Task
from ...._models import BaseModel
from ...shared.task import Task

__all__ = ["TaskRetrieveResponse"]

Expand Down
3 changes: 3 additions & 0 deletions src/gitpod/types/shared/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from .task import Task as Task
from .runs_on import RunsOn as RunsOn
from .subject import Subject as Subject
from .principal import Principal as Principal
from .task_spec import TaskSpec as TaskSpec
from .field_value import FieldValue as FieldValue
from .user_status import UserStatus as UserStatus
from .task_metadata import TaskMetadata as TaskMetadata
from .task_execution import TaskExecution as TaskExecution
from .environment_class import EnvironmentClass as EnvironmentClass
from .organization_role import OrganizationRole as OrganizationRole
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

from pydantic import Field as FieldInfo

from ..._models import BaseModel
from .task_spec import TaskSpec
from ...._models import BaseModel
from .task_metadata import TaskMetadata

__all__ = ["Task"]
Expand Down
2 changes: 1 addition & 1 deletion src/gitpod/types/shared/task_execution_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from pydantic import Field as FieldInfo

from ..._models import BaseModel
from .task_spec import TaskSpec
from .task_execution_phase import TaskExecutionPhase
from ..environments.automations.task_spec import TaskSpec

__all__ = ["TaskExecutionSpec", "Plan", "PlanStep", "PlanStepTask"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

from pydantic import Field as FieldInfo

from ...._models import BaseModel
from ...shared.subject import Subject
from ...shared.automation_trigger import AutomationTrigger
from .subject import Subject
from ..._models import BaseModel
from .automation_trigger import AutomationTrigger

__all__ = ["TaskMetadata"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

from pydantic import Field as FieldInfo

from ...._models import BaseModel
from ...shared.runs_on import RunsOn
from .runs_on import RunsOn
from ..._models import BaseModel

__all__ = ["TaskSpec"]

Expand Down
2 changes: 2 additions & 0 deletions src/gitpod/types/shared_params/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
from .runs_on import RunsOn as RunsOn
from .subject import Subject as Subject
from .principal import Principal as Principal
from .task_spec import TaskSpec as TaskSpec
from .field_value import FieldValue as FieldValue
from .task_metadata import TaskMetadata as TaskMetadata
from .environment_class import EnvironmentClass as EnvironmentClass
from .organization_role import OrganizationRole as OrganizationRole
from .automation_trigger import AutomationTrigger as AutomationTrigger
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
from datetime import datetime
from typing_extensions import Annotated, TypedDict

from ...._utils import PropertyInfo
from ...shared_params.subject import Subject
from ...shared_params.automation_trigger import AutomationTrigger
from .subject import Subject
from ..._utils import PropertyInfo
from .automation_trigger import AutomationTrigger

__all__ = ["TaskMetadataParam"]
__all__ = ["TaskMetadata"]


class TaskMetadataParam(TypedDict, total=False):
class TaskMetadata(TypedDict, total=False):
created_at: Annotated[Union[str, datetime], PropertyInfo(alias="createdAt", format="iso8601")]
"""
A Timestamp represents a point in time independent of any time zone or local
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

from typing_extensions import Annotated, TypedDict

from ...._utils import PropertyInfo
from ...shared_params.runs_on import RunsOn
from .runs_on import RunsOn
from ..._utils import PropertyInfo

__all__ = ["TaskSpecParam"]
__all__ = ["TaskSpec"]


class TaskSpecParam(TypedDict, total=False):
class TaskSpec(TypedDict, total=False):
command: str
"""command contains the command the task should execute"""

Expand Down
2 changes: 1 addition & 1 deletion tests/api_resources/environments/automations/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
from tests.utils import assert_matches_type
from gitpod._utils import parse_datetime
from gitpod.pagination import SyncTasksPage, AsyncTasksPage
from gitpod.types.shared import Task
from gitpod.types.environments.automations import (
Task,
TaskStartResponse,
TaskCreateResponse,
TaskRetrieveResponse,
Expand Down