diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 0c02950d..2aca35ae 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.4.4" + ".": "0.5.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 9333247e..0fdb5b62 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 119 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-ca9a49ac7fbb63f55611fd7cd48a22a3ff8b38a797125c8513e891d9b7345550.yml -openapi_spec_hash: fd6ffbdfaefcc555e61ca1c565e05214 -config_hash: 7fb76543ceafd4a116473f647f8d63b1 +configured_endpoints: 159 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-d62ef4b9187c1f3d36f428abc4b31d8a09ffd36e93d39b8136c60c8f463c838e.yml +openapi_spec_hash: d7f01b6f24e88eb46d744ecd28061f26 +config_hash: 26e4a10dfc6ec809322e60d889d15414 diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a2ff48f..3ec85353 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.5.0 (2025-12-15) + +Full Changelog: [v0.4.4...v0.5.0](https://github.com/gitpod-io/gitpod-sdk-python/compare/v0.4.4...v0.5.0) + +### Features + +* **api:** RBAC APIs ([615e517](https://github.com/gitpod-io/gitpod-sdk-python/commit/615e517ec8e2b0f3e6816696dc3fe66e1f2ae99e)) + ## 0.4.4 (2025-12-15) Full Changelog: [v0.4.3...v0.4.4](https://github.com/gitpod-io/gitpod-sdk-python/compare/v0.4.3...v0.4.4) diff --git a/README.md b/README.md index 7721c369..9c57f502 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ It is generated with [Stainless](https://www.stainless.com/). ## Documentation -The REST API documentation can be found on [docs.ona.com](https://docs.ona.com). The full API of this library can be found in [api.md](api.md). +The REST API documentation can be found on [docs.gitpod.io](https://docs.gitpod.io). The full API of this library can be found in [api.md](api.md). ## Installation @@ -178,10 +178,10 @@ from gitpod import Gitpod client = Gitpod() -page = client.accounts.list_login_providers( - filter={}, +page = client.accounts.list_joinable_organizations( + pagination={}, ) -print(page.login_providers) +print(page.joinable_organizations) ``` ## Handling errors diff --git a/SECURITY.md b/SECURITY.md index 8975e827..efd90888 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -20,7 +20,7 @@ or products provided by Gitpod, please follow the respective company's security ### Gitpod Terms and Policies -Please contact dev-feedback@ona.com for any questions or concerns regarding the security of our services. +Please contact dev-feedback@gitpod.com for any questions or concerns regarding the security of our services. --- diff --git a/api.md b/api.md index d6b34b7f..54769280 100644 --- a/api.md +++ b/api.md @@ -4,12 +4,17 @@ from gitpod.types import ( AutomationTrigger, EnvironmentClass, + EnvironmentVariableItem, + EnvironmentVariableSource, ErrorCode, FieldValue, Gateway, OrganizationRole, Principal, + ProjectEnvironmentClass, + ResourceType, RunsOn, + SecretRef, Subject, Task, TaskExecution, @@ -35,7 +40,7 @@ from gitpod.types import ( LoginProvider, AccountRetrieveResponse, AccountGetSSOLoginURLResponse, - AccountListJoinableOrganizationsResponse, + AccountListSSOLoginsResponse, ) ``` @@ -44,15 +49,53 @@ Methods: - client.accounts.retrieve(\*\*params) -> AccountRetrieveResponse - client.accounts.delete(\*\*params) -> object - client.accounts.get_sso_login_url(\*\*params) -> AccountGetSSOLoginURLResponse -- client.accounts.list_joinable_organizations(\*\*params) -> AccountListJoinableOrganizationsResponse +- client.accounts.list_joinable_organizations(\*\*params) -> SyncJoinableOrganizationsPage[JoinableOrganization] - client.accounts.list_login_providers(\*\*params) -> SyncLoginProvidersPage[LoginProvider] +- client.accounts.list_sso_logins(\*\*params) -> SyncLoginsPage[AccountListSSOLoginsResponse] + +# Agents + +Types: + +```python +from gitpod.types import ( + AgentCodeContext, + AgentExecution, + AgentMode, + Prompt, + PromptMetadata, + PromptSpec, + UserInputBlock, + AgentCreateExecutionConversationTokenResponse, + AgentCreatePromptResponse, + AgentRetrieveExecutionResponse, + AgentRetrievePromptResponse, + AgentStartExecutionResponse, + AgentUpdatePromptResponse, +) +``` + +Methods: + +- client.agents.create_execution_conversation_token(\*\*params) -> AgentCreateExecutionConversationTokenResponse +- client.agents.create_prompt(\*\*params) -> AgentCreatePromptResponse +- client.agents.delete_execution(\*\*params) -> object +- client.agents.delete_prompt(\*\*params) -> object +- client.agents.list_executions(\*\*params) -> SyncAgentExecutionsPage[AgentExecution] +- client.agents.list_prompts(\*\*params) -> SyncPromptsPage[Prompt] +- client.agents.retrieve_execution(\*\*params) -> AgentRetrieveExecutionResponse +- client.agents.retrieve_prompt(\*\*params) -> AgentRetrievePromptResponse +- client.agents.send_to_execution(\*\*params) -> object +- client.agents.start_execution(\*\*params) -> AgentStartExecutionResponse +- client.agents.stop_execution(\*\*params) -> object +- client.agents.update_prompt(\*\*params) -> AgentUpdatePromptResponse # Editors Types: ```python -from gitpod.types import Editor, EditorRetrieveResponse, EditorResolveURLResponse +from gitpod.types import Editor, EditorVersion, EditorRetrieveResponse, EditorResolveURLResponse ``` Methods: @@ -72,6 +115,7 @@ from gitpod.types import ( EnvironmentActivitySignal, EnvironmentMetadata, EnvironmentPhase, + EnvironmentRole, EnvironmentSpec, EnvironmentStatus, EnvironmentCreateResponse, @@ -118,6 +162,7 @@ from gitpod.types.environments.automations import ( Service, ServiceMetadata, ServicePhase, + ServiceRole, ServiceSpec, ServiceStatus, ServiceCreateResponse, @@ -176,12 +221,32 @@ Methods: - client.environments.classes.list(\*\*params) -> SyncEnvironmentClassesPage[EnvironmentClass] +# Errors + +Types: + +```python +from gitpod.types import ( + Breadcrumb, + ErrorEvent, + ErrorLevel, + ExceptionInfo, + ExceptionMechanism, + RequestInfo, + StackFrame, +) +``` + +Methods: + +- client.errors.report_errors(\*\*params) -> object + # Events Types: ```python -from gitpod.types import ResourceOperation, ResourceType, EventListResponse, EventWatchResponse +from gitpod.types import ResourceOperation, EventListResponse, EventWatchResponse ``` Methods: @@ -200,12 +265,44 @@ Methods: Types: ```python -from gitpod.types import Group +from gitpod.types import Group, GroupCreateResponse, GroupRetrieveResponse, GroupUpdateResponse +``` + +Methods: + +- client.groups.create(\*\*params) -> GroupCreateResponse +- client.groups.retrieve(\*\*params) -> GroupRetrieveResponse +- client.groups.update(\*\*params) -> GroupUpdateResponse +- client.groups.list(\*\*params) -> SyncGroupsPage[Group] +- client.groups.delete(\*\*params) -> object + +## Memberships + +Types: + +```python +from gitpod.types.groups import GroupMembership, MembershipCreateResponse +``` + +Methods: + +- client.groups.memberships.create(\*\*params) -> MembershipCreateResponse +- client.groups.memberships.list(\*\*params) -> SyncMembersPage[GroupMembership] +- client.groups.memberships.delete(\*\*params) -> object + +## RoleAssignments + +Types: + +```python +from gitpod.types.groups import ResourceRole, RoleAssignment, RoleAssignmentCreateResponse ``` Methods: -- client.groups.list(\*\*params) -> SyncGroupsPage[Group] +- client.groups.role_assignments.create(\*\*params) -> RoleAssignmentCreateResponse +- client.groups.role_assignments.list(\*\*params) -> SyncAssignmentsPage[RoleAssignment] +- client.groups.role_assignments.delete(\*\*params) -> object # Identity @@ -254,6 +351,27 @@ Methods: - client.organizations.list_members(\*\*params) -> SyncMembersPage[OrganizationMember] - client.organizations.set_role(\*\*params) -> object +## CustomDomains + +Types: + +```python +from gitpod.types.organizations import ( + CustomDomain, + CustomDomainProvider, + CustomDomainCreateResponse, + CustomDomainRetrieveResponse, + CustomDomainUpdateResponse, +) +``` + +Methods: + +- client.organizations.custom_domains.create(\*\*params) -> CustomDomainCreateResponse +- client.organizations.custom_domains.retrieve(\*\*params) -> CustomDomainRetrieveResponse +- client.organizations.custom_domains.update(\*\*params) -> CustomDomainUpdateResponse +- client.organizations.custom_domains.delete(\*\*params) -> object + ## DomainVerifications Types: @@ -300,7 +418,13 @@ Methods: Types: ```python -from gitpod.types.organizations import OrganizationPolicies, PolicyRetrieveResponse +from gitpod.types.organizations import ( + AgentPolicy, + CrowdStrikeConfig, + OrganizationPolicies, + SecurityAgentPolicy, + PolicyRetrieveResponse, +) ``` Methods: @@ -330,6 +454,34 @@ Methods: - client.organizations.sso_configurations.list(\*\*params) -> SyncSSOConfigurationsPage[SSOConfiguration] - client.organizations.sso_configurations.delete(\*\*params) -> object +# Prebuilds + +Types: + +```python +from gitpod.types import ( + Prebuild, + PrebuildMetadata, + PrebuildPhase, + PrebuildSpec, + PrebuildStatus, + PrebuildTrigger, + PrebuildCreateResponse, + PrebuildRetrieveResponse, + PrebuildCancelResponse, + PrebuildCreateLogsTokenResponse, +) +``` + +Methods: + +- client.prebuilds.create(\*\*params) -> PrebuildCreateResponse +- client.prebuilds.retrieve(\*\*params) -> PrebuildRetrieveResponse +- client.prebuilds.list(\*\*params) -> SyncPrebuildsPage[Prebuild] +- client.prebuilds.delete(\*\*params) -> object +- client.prebuilds.cancel(\*\*params) -> PrebuildCancelResponse +- client.prebuilds.create_logs_token(\*\*params) -> PrebuildCreateLogsTokenResponse + # Projects Types: @@ -338,8 +490,9 @@ Types: from gitpod.types import ( EnvironmentInitializer, Project, - ProjectEnvironmentClass, ProjectMetadata, + ProjectPhase, + ProjectPrebuildConfiguration, ProjectCreateResponse, ProjectRetrieveResponse, ProjectUpdateResponse, @@ -356,6 +509,13 @@ Methods: - client.projects.delete(\*\*params) -> object - client.projects.create_from_environment(\*\*params) -> ProjectCreateFromEnvironmentResponse +## EnvironmentClases + +Methods: + +- client.projects.environment_clases.update(\*\*params) -> object +- client.projects.environment_clases.list(\*\*params) -> SyncProjectEnvironmentClassesPage[ProjectEnvironmentClass] + ## Policies Types: @@ -394,11 +554,15 @@ from gitpod.types import ( RunnerReleaseChannel, RunnerSpec, RunnerStatus, + RunnerVariant, + SearchMode, RunnerCreateResponse, RunnerRetrieveResponse, RunnerCheckAuthenticationForHostResponse, + RunnerCreateLogsTokenResponse, RunnerCreateRunnerTokenResponse, RunnerParseContextURLResponse, + RunnerSearchRepositoriesResponse, ) ``` @@ -410,8 +574,10 @@ Methods: - client.runners.list(\*\*params) -> SyncRunnersPage[Runner] - client.runners.delete(\*\*params) -> object - client.runners.check_authentication_for_host(\*\*params) -> RunnerCheckAuthenticationForHostResponse +- client.runners.create_logs_token(\*\*params) -> RunnerCreateLogsTokenResponse - client.runners.create_runner_token(\*\*params) -> RunnerCreateRunnerTokenResponse - client.runners.parse_context_url(\*\*params) -> RunnerParseContextURLResponse +- client.runners.search_repositories(\*\*params) -> RunnerSearchRepositoriesResponse ## Configurations @@ -555,12 +721,14 @@ Methods: Types: ```python -from gitpod.types import User, UserGetAuthenticatedUserResponse +from gitpod.types import User, UserGetAuthenticatedUserResponse, UserGetUserResponse ``` Methods: +- client.users.delete_user(\*\*params) -> object - client.users.get_authenticated_user(\*\*params) -> UserGetAuthenticatedUserResponse +- client.users.get_user(\*\*params) -> UserGetUserResponse - client.users.set_suspended(\*\*params) -> object ## Dotfiles diff --git a/pyproject.toml b/pyproject.toml index 7dfd5d00..429f79f3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,11 +1,11 @@ [project] name = "gitpod-sdk" -version = "0.4.4" +version = "0.5.0" description = "The official Python library for the gitpod API" dynamic = ["readme"] license = "Apache-2.0" authors = [ -{ name = "Gitpod", email = "dev-feedback@ona.com" }, +{ name = "Gitpod", email = "dev-feedback@gitpod.com" }, ] dependencies = [ diff --git a/src/gitpod/_client.py b/src/gitpod/_client.py index d3675ad8..40bb8763 100644 --- a/src/gitpod/_client.py +++ b/src/gitpod/_client.py @@ -21,7 +21,7 @@ ) from ._utils import is_given, get_async_library from ._version import __version__ -from .resources import usage, events, groups, editors, secrets, accounts, gateways, identity +from .resources import usage, agents, errors, events, editors, secrets, accounts, gateways, identity, prebuilds from ._streaming import Stream as Stream, AsyncStream as AsyncStream from ._exceptions import GitpodError, APIStatusError from ._base_client import ( @@ -30,6 +30,7 @@ AsyncAPIClient, ) from .resources.users import users +from .resources.groups import groups from .resources.runners import runners from .resources.projects import projects from .resources.environments import environments @@ -40,13 +41,16 @@ class Gitpod(SyncAPIClient): accounts: accounts.AccountsResource + agents: agents.AgentsResource editors: editors.EditorsResource environments: environments.EnvironmentsResource + errors: errors.ErrorsResource events: events.EventsResource gateways: gateways.GatewaysResource groups: groups.GroupsResource identity: identity.IdentityResource organizations: organizations.OrganizationsResource + prebuilds: prebuilds.PrebuildsResource projects: projects.ProjectsResource runners: runners.RunnersResource secrets: secrets.SecretsResource @@ -110,13 +114,16 @@ def __init__( ) self.accounts = accounts.AccountsResource(self) + self.agents = agents.AgentsResource(self) self.editors = editors.EditorsResource(self) self.environments = environments.EnvironmentsResource(self) + self.errors = errors.ErrorsResource(self) self.events = events.EventsResource(self) self.gateways = gateways.GatewaysResource(self) self.groups = groups.GroupsResource(self) self.identity = identity.IdentityResource(self) self.organizations = organizations.OrganizationsResource(self) + self.prebuilds = prebuilds.PrebuildsResource(self) self.projects = projects.ProjectsResource(self) self.runners = runners.RunnersResource(self) self.secrets = secrets.SecretsResource(self) @@ -232,13 +239,16 @@ def _make_status_error( class AsyncGitpod(AsyncAPIClient): accounts: accounts.AsyncAccountsResource + agents: agents.AsyncAgentsResource editors: editors.AsyncEditorsResource environments: environments.AsyncEnvironmentsResource + errors: errors.AsyncErrorsResource events: events.AsyncEventsResource gateways: gateways.AsyncGatewaysResource groups: groups.AsyncGroupsResource identity: identity.AsyncIdentityResource organizations: organizations.AsyncOrganizationsResource + prebuilds: prebuilds.AsyncPrebuildsResource projects: projects.AsyncProjectsResource runners: runners.AsyncRunnersResource secrets: secrets.AsyncSecretsResource @@ -302,13 +312,16 @@ def __init__( ) self.accounts = accounts.AsyncAccountsResource(self) + self.agents = agents.AsyncAgentsResource(self) self.editors = editors.AsyncEditorsResource(self) self.environments = environments.AsyncEnvironmentsResource(self) + self.errors = errors.AsyncErrorsResource(self) self.events = events.AsyncEventsResource(self) self.gateways = gateways.AsyncGatewaysResource(self) self.groups = groups.AsyncGroupsResource(self) self.identity = identity.AsyncIdentityResource(self) self.organizations = organizations.AsyncOrganizationsResource(self) + self.prebuilds = prebuilds.AsyncPrebuildsResource(self) self.projects = projects.AsyncProjectsResource(self) self.runners = runners.AsyncRunnersResource(self) self.secrets = secrets.AsyncSecretsResource(self) @@ -425,13 +438,16 @@ def _make_status_error( class GitpodWithRawResponse: def __init__(self, client: Gitpod) -> None: self.accounts = accounts.AccountsResourceWithRawResponse(client.accounts) + self.agents = agents.AgentsResourceWithRawResponse(client.agents) self.editors = editors.EditorsResourceWithRawResponse(client.editors) self.environments = environments.EnvironmentsResourceWithRawResponse(client.environments) + self.errors = errors.ErrorsResourceWithRawResponse(client.errors) self.events = events.EventsResourceWithRawResponse(client.events) self.gateways = gateways.GatewaysResourceWithRawResponse(client.gateways) self.groups = groups.GroupsResourceWithRawResponse(client.groups) self.identity = identity.IdentityResourceWithRawResponse(client.identity) self.organizations = organizations.OrganizationsResourceWithRawResponse(client.organizations) + self.prebuilds = prebuilds.PrebuildsResourceWithRawResponse(client.prebuilds) self.projects = projects.ProjectsResourceWithRawResponse(client.projects) self.runners = runners.RunnersResourceWithRawResponse(client.runners) self.secrets = secrets.SecretsResourceWithRawResponse(client.secrets) @@ -442,13 +458,16 @@ def __init__(self, client: Gitpod) -> None: class AsyncGitpodWithRawResponse: def __init__(self, client: AsyncGitpod) -> None: self.accounts = accounts.AsyncAccountsResourceWithRawResponse(client.accounts) + self.agents = agents.AsyncAgentsResourceWithRawResponse(client.agents) self.editors = editors.AsyncEditorsResourceWithRawResponse(client.editors) self.environments = environments.AsyncEnvironmentsResourceWithRawResponse(client.environments) + self.errors = errors.AsyncErrorsResourceWithRawResponse(client.errors) self.events = events.AsyncEventsResourceWithRawResponse(client.events) self.gateways = gateways.AsyncGatewaysResourceWithRawResponse(client.gateways) self.groups = groups.AsyncGroupsResourceWithRawResponse(client.groups) self.identity = identity.AsyncIdentityResourceWithRawResponse(client.identity) self.organizations = organizations.AsyncOrganizationsResourceWithRawResponse(client.organizations) + self.prebuilds = prebuilds.AsyncPrebuildsResourceWithRawResponse(client.prebuilds) self.projects = projects.AsyncProjectsResourceWithRawResponse(client.projects) self.runners = runners.AsyncRunnersResourceWithRawResponse(client.runners) self.secrets = secrets.AsyncSecretsResourceWithRawResponse(client.secrets) @@ -459,13 +478,16 @@ def __init__(self, client: AsyncGitpod) -> None: class GitpodWithStreamedResponse: def __init__(self, client: Gitpod) -> None: self.accounts = accounts.AccountsResourceWithStreamingResponse(client.accounts) + self.agents = agents.AgentsResourceWithStreamingResponse(client.agents) self.editors = editors.EditorsResourceWithStreamingResponse(client.editors) self.environments = environments.EnvironmentsResourceWithStreamingResponse(client.environments) + self.errors = errors.ErrorsResourceWithStreamingResponse(client.errors) self.events = events.EventsResourceWithStreamingResponse(client.events) self.gateways = gateways.GatewaysResourceWithStreamingResponse(client.gateways) self.groups = groups.GroupsResourceWithStreamingResponse(client.groups) self.identity = identity.IdentityResourceWithStreamingResponse(client.identity) self.organizations = organizations.OrganizationsResourceWithStreamingResponse(client.organizations) + self.prebuilds = prebuilds.PrebuildsResourceWithStreamingResponse(client.prebuilds) self.projects = projects.ProjectsResourceWithStreamingResponse(client.projects) self.runners = runners.RunnersResourceWithStreamingResponse(client.runners) self.secrets = secrets.SecretsResourceWithStreamingResponse(client.secrets) @@ -476,13 +498,16 @@ def __init__(self, client: Gitpod) -> None: class AsyncGitpodWithStreamedResponse: def __init__(self, client: AsyncGitpod) -> None: self.accounts = accounts.AsyncAccountsResourceWithStreamingResponse(client.accounts) + self.agents = agents.AsyncAgentsResourceWithStreamingResponse(client.agents) self.editors = editors.AsyncEditorsResourceWithStreamingResponse(client.editors) self.environments = environments.AsyncEnvironmentsResourceWithStreamingResponse(client.environments) + self.errors = errors.AsyncErrorsResourceWithStreamingResponse(client.errors) self.events = events.AsyncEventsResourceWithStreamingResponse(client.events) self.gateways = gateways.AsyncGatewaysResourceWithStreamingResponse(client.gateways) self.groups = groups.AsyncGroupsResourceWithStreamingResponse(client.groups) self.identity = identity.AsyncIdentityResourceWithStreamingResponse(client.identity) self.organizations = organizations.AsyncOrganizationsResourceWithStreamingResponse(client.organizations) + self.prebuilds = prebuilds.AsyncPrebuildsResourceWithStreamingResponse(client.prebuilds) self.projects = projects.AsyncProjectsResourceWithStreamingResponse(client.projects) self.runners = runners.AsyncRunnersResourceWithStreamingResponse(client.runners) self.secrets = secrets.AsyncSecretsResourceWithStreamingResponse(client.secrets) diff --git a/src/gitpod/_version.py b/src/gitpod/_version.py index fb7ab941..b934a8eb 100644 --- a/src/gitpod/_version.py +++ b/src/gitpod/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gitpod" -__version__ = "0.4.4" # x-release-please-version +__version__ = "0.5.0" # x-release-please-version diff --git a/src/gitpod/pagination.py b/src/gitpod/pagination.py index 647ccd9c..c8d007ff 100644 --- a/src/gitpod/pagination.py +++ b/src/gitpod/pagination.py @@ -9,6 +9,12 @@ from ._base_client import BasePage, PageInfo, BaseSyncPage, BaseAsyncPage __all__ = [ + "AgentExecutionsPagePagination", + "SyncAgentExecutionsPage", + "AsyncAgentExecutionsPage", + "AssignmentsPagePagination", + "SyncAssignmentsPage", + "AsyncAssignmentsPage", "DomainVerificationsPagePagination", "SyncDomainVerificationsPage", "AsyncDomainVerificationsPage", @@ -33,9 +39,15 @@ "IntegrationsPagePagination", "SyncIntegrationsPage", "AsyncIntegrationsPage", + "JoinableOrganizationsPagePagination", + "SyncJoinableOrganizationsPage", + "AsyncJoinableOrganizationsPage", "LoginProvidersPagePagination", "SyncLoginProvidersPage", "AsyncLoginProvidersPage", + "LoginsPagePagination", + "SyncLoginsPage", + "AsyncLoginsPage", "MembersPagePagination", "SyncMembersPage", "AsyncMembersPage", @@ -45,12 +57,24 @@ "PoliciesPagePagination", "SyncPoliciesPage", "AsyncPoliciesPage", + "PrebuildsPagePagination", + "SyncPrebuildsPage", + "AsyncPrebuildsPage", + "ProjectEnvironmentClassesPagePagination", + "SyncProjectEnvironmentClassesPage", + "AsyncProjectEnvironmentClassesPage", "ProjectsPagePagination", "SyncProjectsPage", "AsyncProjectsPage", + "PromptsPagePagination", + "SyncPromptsPage", + "AsyncPromptsPage", "RecordsPagePagination", "SyncRecordsPage", "AsyncRecordsPage", + "RepositoriesPagePagination", + "SyncRepositoriesPage", + "AsyncRepositoriesPage", "RunnersPagePagination", "SyncRunnersPage", "AsyncRunnersPage", @@ -77,6 +101,106 @@ _T = TypeVar("_T") +class AgentExecutionsPagePagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + +class SyncAgentExecutionsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + agent_executions: List[_T] = FieldInfo(alias="agentExecutions") + pagination: Optional[AgentExecutionsPagePagination] = None + + @override + def _get_page_items(self) -> List[_T]: + agent_executions = self.agent_executions + if not agent_executions: + return [] + return agent_executions + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncAgentExecutionsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + agent_executions: List[_T] = FieldInfo(alias="agentExecutions") + pagination: Optional[AgentExecutionsPagePagination] = None + + @override + def _get_page_items(self) -> List[_T]: + agent_executions = self.agent_executions + if not agent_executions: + return [] + return agent_executions + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AssignmentsPagePagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + +class SyncAssignmentsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + assignments: List[_T] + pagination: Optional[AssignmentsPagePagination] = None + + @override + def _get_page_items(self) -> List[_T]: + assignments = self.assignments + if not assignments: + return [] + return assignments + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncAssignmentsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + assignments: List[_T] + pagination: Optional[AssignmentsPagePagination] = None + + @override + def _get_page_items(self) -> List[_T]: + assignments = self.assignments + if not assignments: + return [] + return assignments + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + class DomainVerificationsPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) @@ -477,6 +601,56 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) +class JoinableOrganizationsPagePagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + +class SyncJoinableOrganizationsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + joinable_organizations: List[_T] = FieldInfo(alias="joinableOrganizations") + pagination: Optional[JoinableOrganizationsPagePagination] = None + + @override + def _get_page_items(self) -> List[_T]: + joinable_organizations = self.joinable_organizations + if not joinable_organizations: + return [] + return joinable_organizations + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncJoinableOrganizationsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + joinable_organizations: List[_T] = FieldInfo(alias="joinableOrganizations") + pagination: Optional[JoinableOrganizationsPagePagination] = None + + @override + def _get_page_items(self) -> List[_T]: + joinable_organizations = self.joinable_organizations + if not joinable_organizations: + return [] + return joinable_organizations + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + class LoginProvidersPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) @@ -527,6 +701,56 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) +class LoginsPagePagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + +class SyncLoginsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + logins: List[_T] + pagination: Optional[LoginsPagePagination] = None + + @override + def _get_page_items(self) -> List[_T]: + logins = self.logins + if not logins: + return [] + return logins + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncLoginsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + logins: List[_T] + pagination: Optional[LoginsPagePagination] = None + + @override + def _get_page_items(self) -> List[_T]: + logins = self.logins + if not logins: + return [] + return logins + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + class MembersPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) @@ -677,6 +901,106 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) +class PrebuildsPagePagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + +class SyncPrebuildsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[PrebuildsPagePagination] = None + prebuilds: List[_T] + + @override + def _get_page_items(self) -> List[_T]: + prebuilds = self.prebuilds + if not prebuilds: + return [] + return prebuilds + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncPrebuildsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[PrebuildsPagePagination] = None + prebuilds: List[_T] + + @override + def _get_page_items(self) -> List[_T]: + prebuilds = self.prebuilds + if not prebuilds: + return [] + return prebuilds + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class ProjectEnvironmentClassesPagePagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + +class SyncProjectEnvironmentClassesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[ProjectEnvironmentClassesPagePagination] = None + project_environment_classes: List[_T] = FieldInfo(alias="projectEnvironmentClasses") + + @override + def _get_page_items(self) -> List[_T]: + project_environment_classes = self.project_environment_classes + if not project_environment_classes: + return [] + return project_environment_classes + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncProjectEnvironmentClassesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[ProjectEnvironmentClassesPagePagination] = None + project_environment_classes: List[_T] = FieldInfo(alias="projectEnvironmentClasses") + + @override + def _get_page_items(self) -> List[_T]: + project_environment_classes = self.project_environment_classes + if not project_environment_classes: + return [] + return project_environment_classes + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + class ProjectsPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) @@ -727,6 +1051,56 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) +class PromptsPagePagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + +class SyncPromptsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[PromptsPagePagination] = None + prompts: List[_T] + + @override + def _get_page_items(self) -> List[_T]: + prompts = self.prompts + if not prompts: + return [] + return prompts + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncPromptsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[PromptsPagePagination] = None + prompts: List[_T] + + @override + def _get_page_items(self) -> List[_T]: + prompts = self.prompts + if not prompts: + return [] + return prompts + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + class RecordsPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) @@ -777,6 +1151,56 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"token": next_token}) +class RepositoriesPagePagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + +class SyncRepositoriesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[RepositoriesPagePagination] = None + repositories: List[_T] + + @override + def _get_page_items(self) -> List[_T]: + repositories = self.repositories + if not repositories: + return [] + return repositories + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + +class AsyncRepositoriesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + pagination: Optional[RepositoriesPagePagination] = None + repositories: List[_T] + + @override + def _get_page_items(self) -> List[_T]: + repositories = self.repositories + if not repositories: + return [] + return repositories + + @override + def next_page_info(self) -> Optional[PageInfo]: + next_token = None + if self.pagination is not None: + if self.pagination.next_token is not None: + next_token = self.pagination.next_token + if not next_token: + return None + + return PageInfo(params={"token": next_token}) + + class RunnersPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) diff --git a/src/gitpod/resources/__init__.py b/src/gitpod/resources/__init__.py index fe636120..d5baa12a 100644 --- a/src/gitpod/resources/__init__.py +++ b/src/gitpod/resources/__init__.py @@ -16,6 +16,22 @@ UsersResourceWithStreamingResponse, AsyncUsersResourceWithStreamingResponse, ) +from .agents import ( + AgentsResource, + AsyncAgentsResource, + AgentsResourceWithRawResponse, + AsyncAgentsResourceWithRawResponse, + AgentsResourceWithStreamingResponse, + AsyncAgentsResourceWithStreamingResponse, +) +from .errors import ( + ErrorsResource, + AsyncErrorsResource, + ErrorsResourceWithRawResponse, + AsyncErrorsResourceWithRawResponse, + ErrorsResourceWithStreamingResponse, + AsyncErrorsResourceWithStreamingResponse, +) from .events import ( EventsResource, AsyncEventsResource, @@ -88,6 +104,14 @@ ProjectsResourceWithStreamingResponse, AsyncProjectsResourceWithStreamingResponse, ) +from .prebuilds import ( + PrebuildsResource, + AsyncPrebuildsResource, + PrebuildsResourceWithRawResponse, + AsyncPrebuildsResourceWithRawResponse, + PrebuildsResourceWithStreamingResponse, + AsyncPrebuildsResourceWithStreamingResponse, +) from .environments import ( EnvironmentsResource, AsyncEnvironmentsResource, @@ -112,6 +136,12 @@ "AsyncAccountsResourceWithRawResponse", "AccountsResourceWithStreamingResponse", "AsyncAccountsResourceWithStreamingResponse", + "AgentsResource", + "AsyncAgentsResource", + "AgentsResourceWithRawResponse", + "AsyncAgentsResourceWithRawResponse", + "AgentsResourceWithStreamingResponse", + "AsyncAgentsResourceWithStreamingResponse", "EditorsResource", "AsyncEditorsResource", "EditorsResourceWithRawResponse", @@ -124,6 +154,12 @@ "AsyncEnvironmentsResourceWithRawResponse", "EnvironmentsResourceWithStreamingResponse", "AsyncEnvironmentsResourceWithStreamingResponse", + "ErrorsResource", + "AsyncErrorsResource", + "ErrorsResourceWithRawResponse", + "AsyncErrorsResourceWithRawResponse", + "ErrorsResourceWithStreamingResponse", + "AsyncErrorsResourceWithStreamingResponse", "EventsResource", "AsyncEventsResource", "EventsResourceWithRawResponse", @@ -154,6 +190,12 @@ "AsyncOrganizationsResourceWithRawResponse", "OrganizationsResourceWithStreamingResponse", "AsyncOrganizationsResourceWithStreamingResponse", + "PrebuildsResource", + "AsyncPrebuildsResource", + "PrebuildsResourceWithRawResponse", + "AsyncPrebuildsResourceWithRawResponse", + "PrebuildsResourceWithStreamingResponse", + "AsyncPrebuildsResourceWithStreamingResponse", "ProjectsResource", "AsyncProjectsResource", "ProjectsResourceWithRawResponse", diff --git a/src/gitpod/resources/accounts.py b/src/gitpod/resources/accounts.py index 664b3f80..69b48155 100644 --- a/src/gitpod/resources/accounts.py +++ b/src/gitpod/resources/accounts.py @@ -9,6 +9,7 @@ from ..types import ( account_delete_params, account_retrieve_params, + account_list_sso_logins_params, account_get_sso_login_url_params, account_list_login_providers_params, account_list_joinable_organizations_params, @@ -23,12 +24,20 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..pagination import SyncLoginProvidersPage, AsyncLoginProvidersPage +from ..pagination import ( + SyncLoginsPage, + AsyncLoginsPage, + SyncLoginProvidersPage, + AsyncLoginProvidersPage, + SyncJoinableOrganizationsPage, + AsyncJoinableOrganizationsPage, +) from .._base_client import AsyncPaginator, make_request_options from ..types.login_provider import LoginProvider +from ..types.joinable_organization import JoinableOrganization from ..types.account_retrieve_response import AccountRetrieveResponse +from ..types.account_list_sso_logins_response import AccountListSSOLoginsResponse from ..types.account_get_sso_login_url_response import AccountGetSSOLoginURLResponse -from ..types.account_list_joinable_organizations_response import AccountListJoinableOrganizationsResponse __all__ = ["AccountsResource", "AsyncAccountsResource"] @@ -106,6 +115,7 @@ def delete( self, *, account_id: str, + reason: Optional[str] | Omit = omit, # 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, @@ -135,6 +145,8 @@ def delete( ``` Args: + reason: reason is an optional field for the reason for account deletion + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -145,7 +157,13 @@ def delete( """ return self._post( "/gitpod.v1.AccountService/DeleteAccount", - body=maybe_transform({"account_id": account_id}, account_delete_params.AccountDeleteParams), + body=maybe_transform( + { + "account_id": account_id, + "reason": reason, + }, + account_delete_params.AccountDeleteParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -225,14 +243,14 @@ def list_joinable_organizations( *, token: str | Omit = omit, page_size: int | Omit = omit, - empty: bool | Omit = omit, + pagination: account_list_joinable_organizations_params.Pagination | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> AccountListJoinableOrganizationsResponse: + ) -> SyncJoinableOrganizationsPage[JoinableOrganization]: """ Lists organizations that the currently authenticated account can join. @@ -253,6 +271,8 @@ def list_joinable_organizations( ``` Args: + pagination: pagination contains the pagination options for listing joinable organizations + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -261,10 +281,12 @@ def list_joinable_organizations( timeout: Override the client-level default timeout for this request, in seconds """ - return self._post( + return self._get_api_list( "/gitpod.v1.AccountService/ListJoinableOrganizations", + page=SyncJoinableOrganizationsPage[JoinableOrganization], body=maybe_transform( - {"empty": empty}, account_list_joinable_organizations_params.AccountListJoinableOrganizationsParams + {"pagination": pagination}, + account_list_joinable_organizations_params.AccountListJoinableOrganizationsParams, ), options=make_request_options( extra_headers=extra_headers, @@ -279,7 +301,8 @@ def list_joinable_organizations( account_list_joinable_organizations_params.AccountListJoinableOrganizationsParams, ), ), - cast_to=AccountListJoinableOrganizationsResponse, + model=JoinableOrganization, + method="post", ) def list_login_providers( @@ -367,6 +390,67 @@ def list_login_providers( method="post", ) + def list_sso_logins( + self, + *, + email: str, + token: str | Omit = omit, + page_size: int | Omit = omit, + pagination: account_list_sso_logins_params.Pagination | Omit = omit, + return_to: Optional[str] | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncLoginsPage[AccountListSSOLoginsResponse]: + """ + ListSSOLogins + + Args: + email: email is the email the user wants to login with + + pagination: pagination contains the pagination options for listing SSO logins + + return_to: return_to is the URL the user will be redirected to after login + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.AccountService/ListSSOLogins", + page=SyncLoginsPage[AccountListSSOLoginsResponse], + body=maybe_transform( + { + "email": email, + "pagination": pagination, + "return_to": return_to, + }, + account_list_sso_logins_params.AccountListSSOLoginsParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + account_list_sso_logins_params.AccountListSSOLoginsParams, + ), + ), + model=AccountListSSOLoginsResponse, + method="post", + ) + class AsyncAccountsResource(AsyncAPIResource): @cached_property @@ -441,6 +525,7 @@ async def delete( self, *, account_id: str, + reason: Optional[str] | Omit = omit, # 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, @@ -470,6 +555,8 @@ async def delete( ``` Args: + reason: reason is an optional field for the reason for account deletion + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -480,7 +567,13 @@ async def delete( """ return await self._post( "/gitpod.v1.AccountService/DeleteAccount", - body=await async_maybe_transform({"account_id": account_id}, account_delete_params.AccountDeleteParams), + body=await async_maybe_transform( + { + "account_id": account_id, + "reason": reason, + }, + account_delete_params.AccountDeleteParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -555,19 +648,19 @@ async def get_sso_login_url( cast_to=AccountGetSSOLoginURLResponse, ) - async def list_joinable_organizations( + def list_joinable_organizations( self, *, token: str | Omit = omit, page_size: int | Omit = omit, - empty: bool | Omit = omit, + pagination: account_list_joinable_organizations_params.Pagination | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> AccountListJoinableOrganizationsResponse: + ) -> AsyncPaginator[JoinableOrganization, AsyncJoinableOrganizationsPage[JoinableOrganization]]: """ Lists organizations that the currently authenticated account can join. @@ -588,6 +681,8 @@ async def list_joinable_organizations( ``` Args: + pagination: pagination contains the pagination options for listing joinable organizations + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -596,17 +691,19 @@ async def list_joinable_organizations( timeout: Override the client-level default timeout for this request, in seconds """ - return await self._post( + return self._get_api_list( "/gitpod.v1.AccountService/ListJoinableOrganizations", - body=await async_maybe_transform( - {"empty": empty}, account_list_joinable_organizations_params.AccountListJoinableOrganizationsParams + page=AsyncJoinableOrganizationsPage[JoinableOrganization], + body=maybe_transform( + {"pagination": pagination}, + account_list_joinable_organizations_params.AccountListJoinableOrganizationsParams, ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform( + query=maybe_transform( { "token": token, "page_size": page_size, @@ -614,7 +711,8 @@ async def list_joinable_organizations( account_list_joinable_organizations_params.AccountListJoinableOrganizationsParams, ), ), - cast_to=AccountListJoinableOrganizationsResponse, + model=JoinableOrganization, + method="post", ) def list_login_providers( @@ -702,6 +800,67 @@ def list_login_providers( method="post", ) + def list_sso_logins( + self, + *, + email: str, + token: str | Omit = omit, + page_size: int | Omit = omit, + pagination: account_list_sso_logins_params.Pagination | Omit = omit, + return_to: Optional[str] | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[AccountListSSOLoginsResponse, AsyncLoginsPage[AccountListSSOLoginsResponse]]: + """ + ListSSOLogins + + Args: + email: email is the email the user wants to login with + + pagination: pagination contains the pagination options for listing SSO logins + + return_to: return_to is the URL the user will be redirected to after login + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.AccountService/ListSSOLogins", + page=AsyncLoginsPage[AccountListSSOLoginsResponse], + body=maybe_transform( + { + "email": email, + "pagination": pagination, + "return_to": return_to, + }, + account_list_sso_logins_params.AccountListSSOLoginsParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + account_list_sso_logins_params.AccountListSSOLoginsParams, + ), + ), + model=AccountListSSOLoginsResponse, + method="post", + ) + class AccountsResourceWithRawResponse: def __init__(self, accounts: AccountsResource) -> None: @@ -722,6 +881,9 @@ def __init__(self, accounts: AccountsResource) -> None: self.list_login_providers = to_raw_response_wrapper( accounts.list_login_providers, ) + self.list_sso_logins = to_raw_response_wrapper( + accounts.list_sso_logins, + ) class AsyncAccountsResourceWithRawResponse: @@ -743,6 +905,9 @@ def __init__(self, accounts: AsyncAccountsResource) -> None: self.list_login_providers = async_to_raw_response_wrapper( accounts.list_login_providers, ) + self.list_sso_logins = async_to_raw_response_wrapper( + accounts.list_sso_logins, + ) class AccountsResourceWithStreamingResponse: @@ -764,6 +929,9 @@ def __init__(self, accounts: AccountsResource) -> None: self.list_login_providers = to_streamed_response_wrapper( accounts.list_login_providers, ) + self.list_sso_logins = to_streamed_response_wrapper( + accounts.list_sso_logins, + ) class AsyncAccountsResourceWithStreamingResponse: @@ -785,3 +953,6 @@ def __init__(self, accounts: AsyncAccountsResource) -> None: self.list_login_providers = async_to_streamed_response_wrapper( accounts.list_login_providers, ) + self.list_sso_logins = async_to_streamed_response_wrapper( + accounts.list_sso_logins, + ) diff --git a/src/gitpod/resources/agents.py b/src/gitpod/resources/agents.py new file mode 100644 index 00000000..3fdedd49 --- /dev/null +++ b/src/gitpod/resources/agents.py @@ -0,0 +1,1516 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional + +import httpx + +from ..types import ( + AgentMode, + agent_list_prompts_params, + agent_create_prompt_params, + agent_delete_prompt_params, + agent_update_prompt_params, + agent_stop_execution_params, + agent_list_executions_params, + agent_retrieve_prompt_params, + agent_start_execution_params, + agent_delete_execution_params, + agent_send_to_execution_params, + agent_retrieve_execution_params, + agent_create_execution_conversation_token_params, +) +from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from .._utils import maybe_transform, async_maybe_transform +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..pagination import SyncPromptsPage, AsyncPromptsPage, SyncAgentExecutionsPage, AsyncAgentExecutionsPage +from .._base_client import AsyncPaginator, make_request_options +from ..types.prompt import Prompt +from ..types.agent_mode import AgentMode +from ..types.agent_execution import AgentExecution +from ..types.user_input_block_param import UserInputBlockParam +from ..types.agent_code_context_param import AgentCodeContextParam +from ..types.agent_create_prompt_response import AgentCreatePromptResponse +from ..types.agent_update_prompt_response import AgentUpdatePromptResponse +from ..types.agent_retrieve_prompt_response import AgentRetrievePromptResponse +from ..types.agent_start_execution_response import AgentStartExecutionResponse +from ..types.agent_retrieve_execution_response import AgentRetrieveExecutionResponse +from ..types.agent_create_execution_conversation_token_response import AgentCreateExecutionConversationTokenResponse + +__all__ = ["AgentsResource", "AsyncAgentsResource"] + + +class AgentsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> AgentsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return AgentsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AgentsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return AgentsResourceWithStreamingResponse(self) + + def create_execution_conversation_token( + self, + *, + agent_execution_id: str | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AgentCreateExecutionConversationTokenResponse: + """ + Creates a token for conversation access with a specific agent run. + + This method generates a temporary token that can be used to securely connect to + an ongoing agent conversation, for example in a web UI. + + ### Examples + + - Create a token to join an agent run conversation in a front-end application: + + ```yaml + agentExecutionId: "6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35" + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.AgentService/CreateAgentExecutionConversationToken", + body=maybe_transform( + {"agent_execution_id": agent_execution_id}, + agent_create_execution_conversation_token_params.AgentCreateExecutionConversationTokenParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AgentCreateExecutionConversationTokenResponse, + ) + + def create_prompt( + self, + *, + command: str | Omit = omit, + description: str | Omit = omit, + is_command: bool | Omit = omit, + is_template: bool | Omit = omit, + name: str | Omit = omit, + prompt: str | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AgentCreatePromptResponse: + """ + Creates a new prompt. + + Use this method to: + + - Define new prompts for templates or commands + - Set up organization-wide prompt libraries + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.AgentService/CreatePrompt", + body=maybe_transform( + { + "command": command, + "description": description, + "is_command": is_command, + "is_template": is_template, + "name": name, + "prompt": prompt, + }, + agent_create_prompt_params.AgentCreatePromptParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AgentCreatePromptResponse, + ) + + def delete_execution( + self, + *, + agent_execution_id: str | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Deletes an agent run. + + Use this method to: + + - Clean up agent runs that are no longer needed + + ### Examples + + - Delete an agent run by ID: + + ```yaml + agentExecutionId: "6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35" + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.AgentService/DeleteAgentExecution", + body=maybe_transform( + {"agent_execution_id": agent_execution_id}, agent_delete_execution_params.AgentDeleteExecutionParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def delete_prompt( + self, + *, + prompt_id: str | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Deletes a prompt. + + Use this method to: + + - Remove unused prompts + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.AgentService/DeletePrompt", + body=maybe_transform({"prompt_id": prompt_id}, agent_delete_prompt_params.AgentDeletePromptParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def list_executions( + self, + *, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: agent_list_executions_params.Filter | Omit = omit, + pagination: agent_list_executions_params.Pagination | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncAgentExecutionsPage[AgentExecution]: + """ + Lists all agent runs matching the specified filter. + + Use this method to track multiple agent runs and their associated resources. + Results are ordered by their creation time with the newest first. + + ### Examples + + - List agent runs by agent ID: + + ```yaml + filter: + agentIds: ["b8a64cfa-43e2-4b9d-9fb3-07edc63f5971"] + pagination: + pageSize: 10 + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.AgentService/ListAgentExecutions", + page=SyncAgentExecutionsPage[AgentExecution], + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + agent_list_executions_params.AgentListExecutionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + agent_list_executions_params.AgentListExecutionsParams, + ), + ), + model=AgentExecution, + method="post", + ) + + def list_prompts( + self, + *, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: agent_list_prompts_params.Filter | Omit = omit, + pagination: agent_list_prompts_params.Pagination | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncPromptsPage[Prompt]: + """ + Lists all prompts matching the specified criteria. + + Use this method to find and browse prompts across your organization. Results are + ordered by their creation time with the newest first. + + ### Examples + + - List all prompts: + + Retrieves all prompts with pagination. + + ```yaml + pagination: + pageSize: 10 + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.AgentService/ListPrompts", + page=SyncPromptsPage[Prompt], + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + agent_list_prompts_params.AgentListPromptsParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + agent_list_prompts_params.AgentListPromptsParams, + ), + ), + model=Prompt, + method="post", + ) + + def retrieve_execution( + self, + *, + agent_execution_id: str | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AgentRetrieveExecutionResponse: + """ + Gets details about a specific agent run, including its metadata, specification, + and status (phase, error messages, and usage statistics). + + Use this method to: + + - Monitor the run's progress + - Retrieve the agent's conversation URL + - Check if an agent run is actively producing output + + ### Examples + + - Get agent run details by ID: + + ```yaml + agentExecutionId: "6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35" + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.AgentService/GetAgentExecution", + body=maybe_transform( + {"agent_execution_id": agent_execution_id}, agent_retrieve_execution_params.AgentRetrieveExecutionParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AgentRetrieveExecutionResponse, + ) + + def retrieve_prompt( + self, + *, + prompt_id: str | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AgentRetrievePromptResponse: + """ + Gets details about a specific prompt including name, description, and prompt + content. + + Use this method to: + + - Retrieve prompt details for editing + - Get prompt content for execution + + ### Examples + + - Get prompt details: + + ```yaml + promptId: "07e03a28-65a5-4d98-b532-8ea67b188048" + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.AgentService/GetPrompt", + body=maybe_transform({"prompt_id": prompt_id}, agent_retrieve_prompt_params.AgentRetrievePromptParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AgentRetrievePromptResponse, + ) + + def send_to_execution( + self, + *, + agent_execution_id: str | Omit = omit, + user_input: UserInputBlockParam | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Sends user input to an active agent run. + + This method is used to provide interactive or conversation-based input to an + agent. The agent can respond with output blocks containing text, file changes, + or tool usage requests. + + ### Examples + + - Send a text message to an agent: + + ```yaml + agentExecutionId: "6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35" + userInput: + text: + content: "Generate a report based on the latest logs." + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.AgentService/SendToAgentExecution", + body=maybe_transform( + { + "agent_execution_id": agent_execution_id, + "user_input": user_input, + }, + agent_send_to_execution_params.AgentSendToExecutionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def start_execution( + self, + *, + agent_id: str | Omit = omit, + code_context: AgentCodeContextParam | Omit = omit, + mode: AgentMode | Omit = omit, + name: str | Omit = omit, + workflow_action_id: Optional[str] | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AgentStartExecutionResponse: + """ + Starts (or triggers) an agent run using a provided agent. + + Use this method to: + + - Launch an agent based on a known agent + + ### Examples + + - Start an agent with a project ID: + + ```yaml + agentId: "b8a64cfa-43e2-4b9d-9fb3-07edc63f5971" + codeContext: + projectId: "2d22e4eb-31da-467f-882c-27e21550992f" + ``` + + Args: + mode: mode specifies the operational mode for this agent execution If not specified, + defaults to AGENT_MODE_EXECUTION + + workflow_action_id: workflow_action_id is an optional reference to the workflow execution action + that created this agent execution. Used for tracking and event correlation. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.AgentService/StartAgent", + body=maybe_transform( + { + "agent_id": agent_id, + "code_context": code_context, + "mode": mode, + "name": name, + "workflow_action_id": workflow_action_id, + }, + agent_start_execution_params.AgentStartExecutionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AgentStartExecutionResponse, + ) + + def stop_execution( + self, + *, + agent_execution_id: str | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Stops an active agent execution. + + Use this method to: + + - Stop an agent that is currently running + - Prevent further processing or resource usage + + ### Examples + + - Stop an agent execution by ID: + + ```yaml + agentExecutionId: "6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35" + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.AgentService/StopAgentExecution", + body=maybe_transform( + {"agent_execution_id": agent_execution_id}, agent_stop_execution_params.AgentStopExecutionParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def update_prompt( + self, + *, + metadata: Optional[agent_update_prompt_params.Metadata] | Omit = omit, + prompt_id: str | Omit = omit, + spec: Optional[agent_update_prompt_params.Spec] | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AgentUpdatePromptResponse: + """ + Updates an existing prompt. + + Use this method to: + + - Modify prompt content or metadata + - Change prompt type (template/command) + + Args: + metadata: Metadata updates + + prompt_id: The ID of the prompt to update + + spec: Spec updates + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.AgentService/UpdatePrompt", + body=maybe_transform( + { + "metadata": metadata, + "prompt_id": prompt_id, + "spec": spec, + }, + agent_update_prompt_params.AgentUpdatePromptParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AgentUpdatePromptResponse, + ) + + +class AsyncAgentsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncAgentsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return AsyncAgentsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncAgentsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return AsyncAgentsResourceWithStreamingResponse(self) + + async def create_execution_conversation_token( + self, + *, + agent_execution_id: str | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AgentCreateExecutionConversationTokenResponse: + """ + Creates a token for conversation access with a specific agent run. + + This method generates a temporary token that can be used to securely connect to + an ongoing agent conversation, for example in a web UI. + + ### Examples + + - Create a token to join an agent run conversation in a front-end application: + + ```yaml + agentExecutionId: "6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35" + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.AgentService/CreateAgentExecutionConversationToken", + body=await async_maybe_transform( + {"agent_execution_id": agent_execution_id}, + agent_create_execution_conversation_token_params.AgentCreateExecutionConversationTokenParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AgentCreateExecutionConversationTokenResponse, + ) + + async def create_prompt( + self, + *, + command: str | Omit = omit, + description: str | Omit = omit, + is_command: bool | Omit = omit, + is_template: bool | Omit = omit, + name: str | Omit = omit, + prompt: str | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AgentCreatePromptResponse: + """ + Creates a new prompt. + + Use this method to: + + - Define new prompts for templates or commands + - Set up organization-wide prompt libraries + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.AgentService/CreatePrompt", + body=await async_maybe_transform( + { + "command": command, + "description": description, + "is_command": is_command, + "is_template": is_template, + "name": name, + "prompt": prompt, + }, + agent_create_prompt_params.AgentCreatePromptParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AgentCreatePromptResponse, + ) + + async def delete_execution( + self, + *, + agent_execution_id: str | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Deletes an agent run. + + Use this method to: + + - Clean up agent runs that are no longer needed + + ### Examples + + - Delete an agent run by ID: + + ```yaml + agentExecutionId: "6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35" + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.AgentService/DeleteAgentExecution", + body=await async_maybe_transform( + {"agent_execution_id": agent_execution_id}, agent_delete_execution_params.AgentDeleteExecutionParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def delete_prompt( + self, + *, + prompt_id: str | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Deletes a prompt. + + Use this method to: + + - Remove unused prompts + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.AgentService/DeletePrompt", + body=await async_maybe_transform( + {"prompt_id": prompt_id}, agent_delete_prompt_params.AgentDeletePromptParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def list_executions( + self, + *, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: agent_list_executions_params.Filter | Omit = omit, + pagination: agent_list_executions_params.Pagination | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[AgentExecution, AsyncAgentExecutionsPage[AgentExecution]]: + """ + Lists all agent runs matching the specified filter. + + Use this method to track multiple agent runs and their associated resources. + Results are ordered by their creation time with the newest first. + + ### Examples + + - List agent runs by agent ID: + + ```yaml + filter: + agentIds: ["b8a64cfa-43e2-4b9d-9fb3-07edc63f5971"] + pagination: + pageSize: 10 + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.AgentService/ListAgentExecutions", + page=AsyncAgentExecutionsPage[AgentExecution], + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + agent_list_executions_params.AgentListExecutionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + agent_list_executions_params.AgentListExecutionsParams, + ), + ), + model=AgentExecution, + method="post", + ) + + def list_prompts( + self, + *, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: agent_list_prompts_params.Filter | Omit = omit, + pagination: agent_list_prompts_params.Pagination | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[Prompt, AsyncPromptsPage[Prompt]]: + """ + Lists all prompts matching the specified criteria. + + Use this method to find and browse prompts across your organization. Results are + ordered by their creation time with the newest first. + + ### Examples + + - List all prompts: + + Retrieves all prompts with pagination. + + ```yaml + pagination: + pageSize: 10 + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.AgentService/ListPrompts", + page=AsyncPromptsPage[Prompt], + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + agent_list_prompts_params.AgentListPromptsParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + agent_list_prompts_params.AgentListPromptsParams, + ), + ), + model=Prompt, + method="post", + ) + + async def retrieve_execution( + self, + *, + agent_execution_id: str | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AgentRetrieveExecutionResponse: + """ + Gets details about a specific agent run, including its metadata, specification, + and status (phase, error messages, and usage statistics). + + Use this method to: + + - Monitor the run's progress + - Retrieve the agent's conversation URL + - Check if an agent run is actively producing output + + ### Examples + + - Get agent run details by ID: + + ```yaml + agentExecutionId: "6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35" + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.AgentService/GetAgentExecution", + body=await async_maybe_transform( + {"agent_execution_id": agent_execution_id}, agent_retrieve_execution_params.AgentRetrieveExecutionParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AgentRetrieveExecutionResponse, + ) + + async def retrieve_prompt( + self, + *, + prompt_id: str | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AgentRetrievePromptResponse: + """ + Gets details about a specific prompt including name, description, and prompt + content. + + Use this method to: + + - Retrieve prompt details for editing + - Get prompt content for execution + + ### Examples + + - Get prompt details: + + ```yaml + promptId: "07e03a28-65a5-4d98-b532-8ea67b188048" + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.AgentService/GetPrompt", + body=await async_maybe_transform( + {"prompt_id": prompt_id}, agent_retrieve_prompt_params.AgentRetrievePromptParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AgentRetrievePromptResponse, + ) + + async def send_to_execution( + self, + *, + agent_execution_id: str | Omit = omit, + user_input: UserInputBlockParam | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Sends user input to an active agent run. + + This method is used to provide interactive or conversation-based input to an + agent. The agent can respond with output blocks containing text, file changes, + or tool usage requests. + + ### Examples + + - Send a text message to an agent: + + ```yaml + agentExecutionId: "6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35" + userInput: + text: + content: "Generate a report based on the latest logs." + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.AgentService/SendToAgentExecution", + body=await async_maybe_transform( + { + "agent_execution_id": agent_execution_id, + "user_input": user_input, + }, + agent_send_to_execution_params.AgentSendToExecutionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def start_execution( + self, + *, + agent_id: str | Omit = omit, + code_context: AgentCodeContextParam | Omit = omit, + mode: AgentMode | Omit = omit, + name: str | Omit = omit, + workflow_action_id: Optional[str] | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AgentStartExecutionResponse: + """ + Starts (or triggers) an agent run using a provided agent. + + Use this method to: + + - Launch an agent based on a known agent + + ### Examples + + - Start an agent with a project ID: + + ```yaml + agentId: "b8a64cfa-43e2-4b9d-9fb3-07edc63f5971" + codeContext: + projectId: "2d22e4eb-31da-467f-882c-27e21550992f" + ``` + + Args: + mode: mode specifies the operational mode for this agent execution If not specified, + defaults to AGENT_MODE_EXECUTION + + workflow_action_id: workflow_action_id is an optional reference to the workflow execution action + that created this agent execution. Used for tracking and event correlation. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.AgentService/StartAgent", + body=await async_maybe_transform( + { + "agent_id": agent_id, + "code_context": code_context, + "mode": mode, + "name": name, + "workflow_action_id": workflow_action_id, + }, + agent_start_execution_params.AgentStartExecutionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AgentStartExecutionResponse, + ) + + async def stop_execution( + self, + *, + agent_execution_id: str | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Stops an active agent execution. + + Use this method to: + + - Stop an agent that is currently running + - Prevent further processing or resource usage + + ### Examples + + - Stop an agent execution by ID: + + ```yaml + agentExecutionId: "6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35" + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.AgentService/StopAgentExecution", + body=await async_maybe_transform( + {"agent_execution_id": agent_execution_id}, agent_stop_execution_params.AgentStopExecutionParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def update_prompt( + self, + *, + metadata: Optional[agent_update_prompt_params.Metadata] | Omit = omit, + prompt_id: str | Omit = omit, + spec: Optional[agent_update_prompt_params.Spec] | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AgentUpdatePromptResponse: + """ + Updates an existing prompt. + + Use this method to: + + - Modify prompt content or metadata + - Change prompt type (template/command) + + Args: + metadata: Metadata updates + + prompt_id: The ID of the prompt to update + + spec: Spec updates + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.AgentService/UpdatePrompt", + body=await async_maybe_transform( + { + "metadata": metadata, + "prompt_id": prompt_id, + "spec": spec, + }, + agent_update_prompt_params.AgentUpdatePromptParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AgentUpdatePromptResponse, + ) + + +class AgentsResourceWithRawResponse: + def __init__(self, agents: AgentsResource) -> None: + self._agents = agents + + self.create_execution_conversation_token = to_raw_response_wrapper( + agents.create_execution_conversation_token, + ) + self.create_prompt = to_raw_response_wrapper( + agents.create_prompt, + ) + self.delete_execution = to_raw_response_wrapper( + agents.delete_execution, + ) + self.delete_prompt = to_raw_response_wrapper( + agents.delete_prompt, + ) + self.list_executions = to_raw_response_wrapper( + agents.list_executions, + ) + self.list_prompts = to_raw_response_wrapper( + agents.list_prompts, + ) + self.retrieve_execution = to_raw_response_wrapper( + agents.retrieve_execution, + ) + self.retrieve_prompt = to_raw_response_wrapper( + agents.retrieve_prompt, + ) + self.send_to_execution = to_raw_response_wrapper( + agents.send_to_execution, + ) + self.start_execution = to_raw_response_wrapper( + agents.start_execution, + ) + self.stop_execution = to_raw_response_wrapper( + agents.stop_execution, + ) + self.update_prompt = to_raw_response_wrapper( + agents.update_prompt, + ) + + +class AsyncAgentsResourceWithRawResponse: + def __init__(self, agents: AsyncAgentsResource) -> None: + self._agents = agents + + self.create_execution_conversation_token = async_to_raw_response_wrapper( + agents.create_execution_conversation_token, + ) + self.create_prompt = async_to_raw_response_wrapper( + agents.create_prompt, + ) + self.delete_execution = async_to_raw_response_wrapper( + agents.delete_execution, + ) + self.delete_prompt = async_to_raw_response_wrapper( + agents.delete_prompt, + ) + self.list_executions = async_to_raw_response_wrapper( + agents.list_executions, + ) + self.list_prompts = async_to_raw_response_wrapper( + agents.list_prompts, + ) + self.retrieve_execution = async_to_raw_response_wrapper( + agents.retrieve_execution, + ) + self.retrieve_prompt = async_to_raw_response_wrapper( + agents.retrieve_prompt, + ) + self.send_to_execution = async_to_raw_response_wrapper( + agents.send_to_execution, + ) + self.start_execution = async_to_raw_response_wrapper( + agents.start_execution, + ) + self.stop_execution = async_to_raw_response_wrapper( + agents.stop_execution, + ) + self.update_prompt = async_to_raw_response_wrapper( + agents.update_prompt, + ) + + +class AgentsResourceWithStreamingResponse: + def __init__(self, agents: AgentsResource) -> None: + self._agents = agents + + self.create_execution_conversation_token = to_streamed_response_wrapper( + agents.create_execution_conversation_token, + ) + self.create_prompt = to_streamed_response_wrapper( + agents.create_prompt, + ) + self.delete_execution = to_streamed_response_wrapper( + agents.delete_execution, + ) + self.delete_prompt = to_streamed_response_wrapper( + agents.delete_prompt, + ) + self.list_executions = to_streamed_response_wrapper( + agents.list_executions, + ) + self.list_prompts = to_streamed_response_wrapper( + agents.list_prompts, + ) + self.retrieve_execution = to_streamed_response_wrapper( + agents.retrieve_execution, + ) + self.retrieve_prompt = to_streamed_response_wrapper( + agents.retrieve_prompt, + ) + self.send_to_execution = to_streamed_response_wrapper( + agents.send_to_execution, + ) + self.start_execution = to_streamed_response_wrapper( + agents.start_execution, + ) + self.stop_execution = to_streamed_response_wrapper( + agents.stop_execution, + ) + self.update_prompt = to_streamed_response_wrapper( + agents.update_prompt, + ) + + +class AsyncAgentsResourceWithStreamingResponse: + def __init__(self, agents: AsyncAgentsResource) -> None: + self._agents = agents + + self.create_execution_conversation_token = async_to_streamed_response_wrapper( + agents.create_execution_conversation_token, + ) + self.create_prompt = async_to_streamed_response_wrapper( + agents.create_prompt, + ) + self.delete_execution = async_to_streamed_response_wrapper( + agents.delete_execution, + ) + self.delete_prompt = async_to_streamed_response_wrapper( + agents.delete_prompt, + ) + self.list_executions = async_to_streamed_response_wrapper( + agents.list_executions, + ) + self.list_prompts = async_to_streamed_response_wrapper( + agents.list_prompts, + ) + self.retrieve_execution = async_to_streamed_response_wrapper( + agents.retrieve_execution, + ) + self.retrieve_prompt = async_to_streamed_response_wrapper( + agents.retrieve_prompt, + ) + self.send_to_execution = async_to_streamed_response_wrapper( + agents.send_to_execution, + ) + self.start_execution = async_to_streamed_response_wrapper( + agents.start_execution, + ) + self.stop_execution = async_to_streamed_response_wrapper( + agents.stop_execution, + ) + self.update_prompt = async_to_streamed_response_wrapper( + agents.update_prompt, + ) diff --git a/src/gitpod/resources/editors.py b/src/gitpod/resources/editors.py index a66b33f4..70fcbbf0 100644 --- a/src/gitpod/resources/editors.py +++ b/src/gitpod/resources/editors.py @@ -187,6 +187,7 @@ def resolve_url( editor_id: str, environment_id: str, organization_id: str, + version: str | Omit = omit, # 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, @@ -223,6 +224,11 @@ def resolve_url( organization_id: organizationId is the ID of the organization to resolve the URL for + version: version is the editor version to use If not provided, the latest version will be + installed + + Examples for JetBrains: 2025.2 + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -238,6 +244,7 @@ def resolve_url( "editor_id": editor_id, "environment_id": environment_id, "organization_id": organization_id, + "version": version, }, editor_resolve_url_params.EditorResolveURLParams, ), @@ -411,6 +418,7 @@ async def resolve_url( editor_id: str, environment_id: str, organization_id: str, + version: str | Omit = omit, # 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, @@ -447,6 +455,11 @@ async def resolve_url( organization_id: organizationId is the ID of the organization to resolve the URL for + version: version is the editor version to use If not provided, the latest version will be + installed + + Examples for JetBrains: 2025.2 + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -462,6 +475,7 @@ async def resolve_url( "editor_id": editor_id, "environment_id": environment_id, "organization_id": organization_id, + "version": version, }, editor_resolve_url_params.EditorResolveURLParams, ), diff --git a/src/gitpod/resources/errors.py b/src/gitpod/resources/errors.py new file mode 100644 index 00000000..220301f2 --- /dev/null +++ b/src/gitpod/resources/errors.py @@ -0,0 +1,199 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable + +import httpx + +from ..types import error_report_errors_params +from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from .._utils import maybe_transform, async_maybe_transform +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from .._base_client import make_request_options +from ..types.error_event_param import ErrorEventParam + +__all__ = ["ErrorsResource", "AsyncErrorsResource"] + + +class ErrorsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> ErrorsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return ErrorsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> ErrorsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return ErrorsResourceWithStreamingResponse(self) + + def report_errors( + self, + *, + events: Iterable[ErrorEventParam] | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + ReportErrors allows clients to report batches of errors that will be sent to + error reporting systems. The structure is fully compatible with Sentry's event + payload format. + + Use this method to: + + - Report client-side errors and exceptions + - Track application crashes and panics + - Send error context and metadata for debugging + + ### Examples + + - Report a JavaScript error with Sentry-compatible structure: The service + accepts events with comprehensive error information including stack traces, + identity context, breadcrumbs, and metadata that align with Sentry's event + payload format. + + Args: + events: Error events to be reported (batch) - now using Sentry-compatible structure + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.ErrorsService/ReportErrors", + body=maybe_transform({"events": events}, error_report_errors_params.ErrorReportErrorsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class AsyncErrorsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncErrorsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return AsyncErrorsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncErrorsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return AsyncErrorsResourceWithStreamingResponse(self) + + async def report_errors( + self, + *, + events: Iterable[ErrorEventParam] | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + ReportErrors allows clients to report batches of errors that will be sent to + error reporting systems. The structure is fully compatible with Sentry's event + payload format. + + Use this method to: + + - Report client-side errors and exceptions + - Track application crashes and panics + - Send error context and metadata for debugging + + ### Examples + + - Report a JavaScript error with Sentry-compatible structure: The service + accepts events with comprehensive error information including stack traces, + identity context, breadcrumbs, and metadata that align with Sentry's event + payload format. + + Args: + events: Error events to be reported (batch) - now using Sentry-compatible structure + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.ErrorsService/ReportErrors", + body=await async_maybe_transform({"events": events}, error_report_errors_params.ErrorReportErrorsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class ErrorsResourceWithRawResponse: + def __init__(self, errors: ErrorsResource) -> None: + self._errors = errors + + self.report_errors = to_raw_response_wrapper( + errors.report_errors, + ) + + +class AsyncErrorsResourceWithRawResponse: + def __init__(self, errors: AsyncErrorsResource) -> None: + self._errors = errors + + self.report_errors = async_to_raw_response_wrapper( + errors.report_errors, + ) + + +class ErrorsResourceWithStreamingResponse: + def __init__(self, errors: ErrorsResource) -> None: + self._errors = errors + + self.report_errors = to_streamed_response_wrapper( + errors.report_errors, + ) + + +class AsyncErrorsResourceWithStreamingResponse: + def __init__(self, errors: AsyncErrorsResource) -> None: + self._errors = errors + + self.report_errors = async_to_streamed_response_wrapper( + errors.report_errors, + ) diff --git a/src/gitpod/resources/groups.py b/src/gitpod/resources/groups.py deleted file mode 100644 index 36e2ed43..00000000 --- a/src/gitpod/resources/groups.py +++ /dev/null @@ -1,252 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..types import group_list_params -from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from .._utils import maybe_transform -from .._compat import cached_property -from .._resource import SyncAPIResource, AsyncAPIResource -from .._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..pagination import SyncGroupsPage, AsyncGroupsPage -from ..types.group import Group -from .._base_client import AsyncPaginator, make_request_options - -__all__ = ["GroupsResource", "AsyncGroupsResource"] - - -class GroupsResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> GroupsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers - """ - return GroupsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> GroupsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response - """ - return GroupsResourceWithStreamingResponse(self) - - def list( - self, - *, - token: str | Omit = omit, - page_size: int | Omit = omit, - pagination: group_list_params.Pagination | Omit = omit, - # 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, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> SyncGroupsPage[Group]: - """ - Lists groups with optional pagination. - - Use this method to: - - - View all groups - - Check group memberships - - Monitor group configurations - - Audit group access - - ### Examples - - - List all groups: - - Shows all groups with pagination. - - ```yaml - pagination: - pageSize: 20 - ``` - - - List with custom page size: - - Shows groups with specified page size. - - ```yaml - pagination: - pageSize: 50 - token: "next-page-token-from-previous-response" - ``` - - Args: - pagination: pagination contains the pagination options for listing groups - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return self._get_api_list( - "/gitpod.v1.GroupService/ListGroups", - page=SyncGroupsPage[Group], - body=maybe_transform({"pagination": pagination}, group_list_params.GroupListParams), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "token": token, - "page_size": page_size, - }, - group_list_params.GroupListParams, - ), - ), - model=Group, - method="post", - ) - - -class AsyncGroupsResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncGroupsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers - """ - return AsyncGroupsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncGroupsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response - """ - return AsyncGroupsResourceWithStreamingResponse(self) - - def list( - self, - *, - token: str | Omit = omit, - page_size: int | Omit = omit, - pagination: group_list_params.Pagination | Omit = omit, - # 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, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> AsyncPaginator[Group, AsyncGroupsPage[Group]]: - """ - Lists groups with optional pagination. - - Use this method to: - - - View all groups - - Check group memberships - - Monitor group configurations - - Audit group access - - ### Examples - - - List all groups: - - Shows all groups with pagination. - - ```yaml - pagination: - pageSize: 20 - ``` - - - List with custom page size: - - Shows groups with specified page size. - - ```yaml - pagination: - pageSize: 50 - token: "next-page-token-from-previous-response" - ``` - - Args: - pagination: pagination contains the pagination options for listing groups - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return self._get_api_list( - "/gitpod.v1.GroupService/ListGroups", - page=AsyncGroupsPage[Group], - body=maybe_transform({"pagination": pagination}, group_list_params.GroupListParams), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "token": token, - "page_size": page_size, - }, - group_list_params.GroupListParams, - ), - ), - model=Group, - method="post", - ) - - -class GroupsResourceWithRawResponse: - def __init__(self, groups: GroupsResource) -> None: - self._groups = groups - - self.list = to_raw_response_wrapper( - groups.list, - ) - - -class AsyncGroupsResourceWithRawResponse: - def __init__(self, groups: AsyncGroupsResource) -> None: - self._groups = groups - - self.list = async_to_raw_response_wrapper( - groups.list, - ) - - -class GroupsResourceWithStreamingResponse: - def __init__(self, groups: GroupsResource) -> None: - self._groups = groups - - self.list = to_streamed_response_wrapper( - groups.list, - ) - - -class AsyncGroupsResourceWithStreamingResponse: - def __init__(self, groups: AsyncGroupsResource) -> None: - self._groups = groups - - self.list = async_to_streamed_response_wrapper( - groups.list, - ) diff --git a/src/gitpod/resources/groups/__init__.py b/src/gitpod/resources/groups/__init__.py new file mode 100644 index 00000000..83c3111d --- /dev/null +++ b/src/gitpod/resources/groups/__init__.py @@ -0,0 +1,47 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .groups import ( + GroupsResource, + AsyncGroupsResource, + GroupsResourceWithRawResponse, + AsyncGroupsResourceWithRawResponse, + GroupsResourceWithStreamingResponse, + AsyncGroupsResourceWithStreamingResponse, +) +from .memberships import ( + MembershipsResource, + AsyncMembershipsResource, + MembershipsResourceWithRawResponse, + AsyncMembershipsResourceWithRawResponse, + MembershipsResourceWithStreamingResponse, + AsyncMembershipsResourceWithStreamingResponse, +) +from .role_assignments import ( + RoleAssignmentsResource, + AsyncRoleAssignmentsResource, + RoleAssignmentsResourceWithRawResponse, + AsyncRoleAssignmentsResourceWithRawResponse, + RoleAssignmentsResourceWithStreamingResponse, + AsyncRoleAssignmentsResourceWithStreamingResponse, +) + +__all__ = [ + "MembershipsResource", + "AsyncMembershipsResource", + "MembershipsResourceWithRawResponse", + "AsyncMembershipsResourceWithRawResponse", + "MembershipsResourceWithStreamingResponse", + "AsyncMembershipsResourceWithStreamingResponse", + "RoleAssignmentsResource", + "AsyncRoleAssignmentsResource", + "RoleAssignmentsResourceWithRawResponse", + "AsyncRoleAssignmentsResourceWithRawResponse", + "RoleAssignmentsResourceWithStreamingResponse", + "AsyncRoleAssignmentsResourceWithStreamingResponse", + "GroupsResource", + "AsyncGroupsResource", + "GroupsResourceWithRawResponse", + "AsyncGroupsResourceWithRawResponse", + "GroupsResourceWithStreamingResponse", + "AsyncGroupsResourceWithStreamingResponse", +] diff --git a/src/gitpod/resources/groups/groups.py b/src/gitpod/resources/groups/groups.py new file mode 100644 index 00000000..4a57994e --- /dev/null +++ b/src/gitpod/resources/groups/groups.py @@ -0,0 +1,843 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ...types import ( + group_list_params, + group_create_params, + group_delete_params, + group_update_params, + group_retrieve_params, +) +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ..._utils import maybe_transform, async_maybe_transform +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from .memberships import ( + MembershipsResource, + AsyncMembershipsResource, + MembershipsResourceWithRawResponse, + AsyncMembershipsResourceWithRawResponse, + MembershipsResourceWithStreamingResponse, + AsyncMembershipsResourceWithStreamingResponse, +) +from ...pagination import SyncGroupsPage, AsyncGroupsPage +from ...types.group import Group +from ..._base_client import AsyncPaginator, make_request_options +from .role_assignments import ( + RoleAssignmentsResource, + AsyncRoleAssignmentsResource, + RoleAssignmentsResourceWithRawResponse, + AsyncRoleAssignmentsResourceWithRawResponse, + RoleAssignmentsResourceWithStreamingResponse, + AsyncRoleAssignmentsResourceWithStreamingResponse, +) +from ...types.group_create_response import GroupCreateResponse +from ...types.group_update_response import GroupUpdateResponse +from ...types.group_retrieve_response import GroupRetrieveResponse + +__all__ = ["GroupsResource", "AsyncGroupsResource"] + + +class GroupsResource(SyncAPIResource): + @cached_property + def memberships(self) -> MembershipsResource: + return MembershipsResource(self._client) + + @cached_property + def role_assignments(self) -> RoleAssignmentsResource: + return RoleAssignmentsResource(self._client) + + @cached_property + def with_raw_response(self) -> GroupsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return GroupsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> GroupsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return GroupsResourceWithStreamingResponse(self) + + def create( + self, + *, + description: str | Omit = omit, + name: str | Omit = omit, + organization_id: str | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> GroupCreateResponse: + """ + Creates a new group within an organization. + + Use this method to: + + - Create teams for access control + - Organize users by department or function + - Set up role-based access groups + + ### Examples + + - Create a basic group: + + Creates a group with name and description. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + name: "Backend Team" + description: "Backend engineering team" + ``` + + ### Authorization + + Requires `org:admin` role on the organization. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.GroupService/CreateGroup", + body=maybe_transform( + { + "description": description, + "name": name, + "organization_id": organization_id, + }, + group_create_params.GroupCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=GroupCreateResponse, + ) + + def retrieve( + self, + *, + group_id: str | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> GroupRetrieveResponse: + """ + Gets information about a specific group. + + Use this method to: + + - Retrieve group details and metadata + - Check group configuration + - View member count + + ### Examples + + - Get group details: + + Retrieves information about a specific group. + + ```yaml + groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` + + ### Authorization + + All organization members can view group information (transparency model). + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.GroupService/GetGroup", + body=maybe_transform({"group_id": group_id}, group_retrieve_params.GroupRetrieveParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=GroupRetrieveResponse, + ) + + def update( + self, + *, + description: str | Omit = omit, + group_id: str | Omit = omit, + name: str | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> GroupUpdateResponse: + """ + Updates group information. + + Use this method to: + + - Rename a group + - Update group description + + ### Examples + + - Update group name: + + Changes the name of an existing group. + + ```yaml + groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + name: "Platform Team" + description: "Platform engineering team" + ``` + + ### Authorization + + Requires `org:admin` permission on the organization or `group:admin` permission + on the specific group. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.GroupService/UpdateGroup", + body=maybe_transform( + { + "description": description, + "group_id": group_id, + "name": name, + }, + group_update_params.GroupUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=GroupUpdateResponse, + ) + + def list( + self, + *, + token: str | Omit = omit, + page_size: int | Omit = omit, + pagination: group_list_params.Pagination | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncGroupsPage[Group]: + """ + Lists groups with optional pagination. + + Use this method to: + + - View all groups in an organization + - Check group memberships + - Monitor group configurations + - Audit group access + + ### Examples + + - List all groups: + + Shows all groups with pagination. + + ```yaml + pagination: + pageSize: 20 + ``` + + - List with custom page size: + + Shows groups with specified page size. + + ```yaml + pagination: + pageSize: 50 + token: "next-page-token-from-previous-response" + ``` + + ### Authorization + + All organization members can list groups (transparency model). + + Args: + pagination: pagination contains the pagination options for listing groups + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.GroupService/ListGroups", + page=SyncGroupsPage[Group], + body=maybe_transform({"pagination": pagination}, group_list_params.GroupListParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + group_list_params.GroupListParams, + ), + ), + model=Group, + method="post", + ) + + def delete( + self, + *, + group_id: str | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Deletes a group and removes all its resource assignments. + + When a group is deleted, all resource assignments revert to org-level scope. + + Use this method to: + + - Remove unused groups + - Clean up after team reorganization + + ### Examples + + - Delete a group: + + Permanently removes a group. + + ```yaml + groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` + + ### Authorization + + Requires `org:admin` role on the organization. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.GroupService/DeleteGroup", + body=maybe_transform({"group_id": group_id}, group_delete_params.GroupDeleteParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class AsyncGroupsResource(AsyncAPIResource): + @cached_property + def memberships(self) -> AsyncMembershipsResource: + return AsyncMembershipsResource(self._client) + + @cached_property + def role_assignments(self) -> AsyncRoleAssignmentsResource: + return AsyncRoleAssignmentsResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncGroupsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return AsyncGroupsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncGroupsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return AsyncGroupsResourceWithStreamingResponse(self) + + async def create( + self, + *, + description: str | Omit = omit, + name: str | Omit = omit, + organization_id: str | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> GroupCreateResponse: + """ + Creates a new group within an organization. + + Use this method to: + + - Create teams for access control + - Organize users by department or function + - Set up role-based access groups + + ### Examples + + - Create a basic group: + + Creates a group with name and description. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + name: "Backend Team" + description: "Backend engineering team" + ``` + + ### Authorization + + Requires `org:admin` role on the organization. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.GroupService/CreateGroup", + body=await async_maybe_transform( + { + "description": description, + "name": name, + "organization_id": organization_id, + }, + group_create_params.GroupCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=GroupCreateResponse, + ) + + async def retrieve( + self, + *, + group_id: str | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> GroupRetrieveResponse: + """ + Gets information about a specific group. + + Use this method to: + + - Retrieve group details and metadata + - Check group configuration + - View member count + + ### Examples + + - Get group details: + + Retrieves information about a specific group. + + ```yaml + groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` + + ### Authorization + + All organization members can view group information (transparency model). + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.GroupService/GetGroup", + body=await async_maybe_transform({"group_id": group_id}, group_retrieve_params.GroupRetrieveParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=GroupRetrieveResponse, + ) + + async def update( + self, + *, + description: str | Omit = omit, + group_id: str | Omit = omit, + name: str | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> GroupUpdateResponse: + """ + Updates group information. + + Use this method to: + + - Rename a group + - Update group description + + ### Examples + + - Update group name: + + Changes the name of an existing group. + + ```yaml + groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + name: "Platform Team" + description: "Platform engineering team" + ``` + + ### Authorization + + Requires `org:admin` permission on the organization or `group:admin` permission + on the specific group. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.GroupService/UpdateGroup", + body=await async_maybe_transform( + { + "description": description, + "group_id": group_id, + "name": name, + }, + group_update_params.GroupUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=GroupUpdateResponse, + ) + + def list( + self, + *, + token: str | Omit = omit, + page_size: int | Omit = omit, + pagination: group_list_params.Pagination | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[Group, AsyncGroupsPage[Group]]: + """ + Lists groups with optional pagination. + + Use this method to: + + - View all groups in an organization + - Check group memberships + - Monitor group configurations + - Audit group access + + ### Examples + + - List all groups: + + Shows all groups with pagination. + + ```yaml + pagination: + pageSize: 20 + ``` + + - List with custom page size: + + Shows groups with specified page size. + + ```yaml + pagination: + pageSize: 50 + token: "next-page-token-from-previous-response" + ``` + + ### Authorization + + All organization members can list groups (transparency model). + + Args: + pagination: pagination contains the pagination options for listing groups + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.GroupService/ListGroups", + page=AsyncGroupsPage[Group], + body=maybe_transform({"pagination": pagination}, group_list_params.GroupListParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + group_list_params.GroupListParams, + ), + ), + model=Group, + method="post", + ) + + async def delete( + self, + *, + group_id: str | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Deletes a group and removes all its resource assignments. + + When a group is deleted, all resource assignments revert to org-level scope. + + Use this method to: + + - Remove unused groups + - Clean up after team reorganization + + ### Examples + + - Delete a group: + + Permanently removes a group. + + ```yaml + groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` + + ### Authorization + + Requires `org:admin` role on the organization. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.GroupService/DeleteGroup", + body=await async_maybe_transform({"group_id": group_id}, group_delete_params.GroupDeleteParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class GroupsResourceWithRawResponse: + def __init__(self, groups: GroupsResource) -> None: + self._groups = groups + + self.create = to_raw_response_wrapper( + groups.create, + ) + self.retrieve = to_raw_response_wrapper( + groups.retrieve, + ) + self.update = to_raw_response_wrapper( + groups.update, + ) + self.list = to_raw_response_wrapper( + groups.list, + ) + self.delete = to_raw_response_wrapper( + groups.delete, + ) + + @cached_property + def memberships(self) -> MembershipsResourceWithRawResponse: + return MembershipsResourceWithRawResponse(self._groups.memberships) + + @cached_property + def role_assignments(self) -> RoleAssignmentsResourceWithRawResponse: + return RoleAssignmentsResourceWithRawResponse(self._groups.role_assignments) + + +class AsyncGroupsResourceWithRawResponse: + def __init__(self, groups: AsyncGroupsResource) -> None: + self._groups = groups + + self.create = async_to_raw_response_wrapper( + groups.create, + ) + self.retrieve = async_to_raw_response_wrapper( + groups.retrieve, + ) + self.update = async_to_raw_response_wrapper( + groups.update, + ) + self.list = async_to_raw_response_wrapper( + groups.list, + ) + self.delete = async_to_raw_response_wrapper( + groups.delete, + ) + + @cached_property + def memberships(self) -> AsyncMembershipsResourceWithRawResponse: + return AsyncMembershipsResourceWithRawResponse(self._groups.memberships) + + @cached_property + def role_assignments(self) -> AsyncRoleAssignmentsResourceWithRawResponse: + return AsyncRoleAssignmentsResourceWithRawResponse(self._groups.role_assignments) + + +class GroupsResourceWithStreamingResponse: + def __init__(self, groups: GroupsResource) -> None: + self._groups = groups + + self.create = to_streamed_response_wrapper( + groups.create, + ) + self.retrieve = to_streamed_response_wrapper( + groups.retrieve, + ) + self.update = to_streamed_response_wrapper( + groups.update, + ) + self.list = to_streamed_response_wrapper( + groups.list, + ) + self.delete = to_streamed_response_wrapper( + groups.delete, + ) + + @cached_property + def memberships(self) -> MembershipsResourceWithStreamingResponse: + return MembershipsResourceWithStreamingResponse(self._groups.memberships) + + @cached_property + def role_assignments(self) -> RoleAssignmentsResourceWithStreamingResponse: + return RoleAssignmentsResourceWithStreamingResponse(self._groups.role_assignments) + + +class AsyncGroupsResourceWithStreamingResponse: + def __init__(self, groups: AsyncGroupsResource) -> None: + self._groups = groups + + self.create = async_to_streamed_response_wrapper( + groups.create, + ) + self.retrieve = async_to_streamed_response_wrapper( + groups.retrieve, + ) + self.update = async_to_streamed_response_wrapper( + groups.update, + ) + self.list = async_to_streamed_response_wrapper( + groups.list, + ) + self.delete = async_to_streamed_response_wrapper( + groups.delete, + ) + + @cached_property + def memberships(self) -> AsyncMembershipsResourceWithStreamingResponse: + return AsyncMembershipsResourceWithStreamingResponse(self._groups.memberships) + + @cached_property + def role_assignments(self) -> AsyncRoleAssignmentsResourceWithStreamingResponse: + return AsyncRoleAssignmentsResourceWithStreamingResponse(self._groups.role_assignments) diff --git a/src/gitpod/resources/groups/memberships.py b/src/gitpod/resources/groups/memberships.py new file mode 100644 index 00000000..11b07f11 --- /dev/null +++ b/src/gitpod/resources/groups/memberships.py @@ -0,0 +1,516 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ..._utils import maybe_transform, async_maybe_transform +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...pagination import SyncMembersPage, AsyncMembersPage +from ..._base_client import AsyncPaginator, make_request_options +from ...types.groups import membership_list_params, membership_create_params, membership_delete_params +from ...types.shared_params.subject import Subject +from ...types.groups.group_membership import GroupMembership +from ...types.groups.membership_create_response import MembershipCreateResponse + +__all__ = ["MembershipsResource", "AsyncMembershipsResource"] + + +class MembershipsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> MembershipsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return MembershipsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> MembershipsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return MembershipsResourceWithStreamingResponse(self) + + def create( + self, + *, + group_id: str | Omit = omit, + subject: Subject | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> MembershipCreateResponse: + """ + Creates a membership for a user in a group. + + Use this method to: + + - Add users to groups + - Grant group-based permissions to users + + ### Examples + + - Add a user to a group: + + Creates a membership for a user in a group. + + ```yaml + groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + subject: + id: "f53d2330-3795-4c5d-a1f3-453121af9c60" + principal: PRINCIPAL_USER + ``` + + ### Authorization + + Requires `org:admin` permission on the organization or `group:admin` permission + on the specific group. + + Args: + subject: Subject to add to the group + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.GroupService/CreateMembership", + body=maybe_transform( + { + "group_id": group_id, + "subject": subject, + }, + membership_create_params.MembershipCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=MembershipCreateResponse, + ) + + def list( + self, + *, + token: str | Omit = omit, + page_size: int | Omit = omit, + group_id: str | Omit = omit, + pagination: membership_list_params.Pagination | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncMembersPage[GroupMembership]: + """ + Lists all memberships of a group. + + Use this method to: + + - View all members of a group + - Audit group membership + + ### Examples + + - List group members: + + Shows all members of a specific group. + + ```yaml + groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + pagination: + pageSize: 20 + ``` + + ### Authorization + + All organization members can view group membership (transparency model). + + Args: + pagination: pagination contains the pagination options for listing memberships + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.GroupService/ListMemberships", + page=SyncMembersPage[GroupMembership], + body=maybe_transform( + { + "group_id": group_id, + "pagination": pagination, + }, + membership_list_params.MembershipListParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + membership_list_params.MembershipListParams, + ), + ), + model=GroupMembership, + method="post", + ) + + def delete( + self, + *, + membership_id: str | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Deletes a membership for a user in a group. + + Use this method to: + + - Remove users from groups + - Revoke group-based permissions + + ### Examples + + - Remove a user from a group: + + Deletes a membership by its ID. + + ```yaml + membershipId: "a1b2c3d4-5678-90ab-cdef-1234567890ab" + ``` + + ### Authorization + + Requires `org:admin` permission on the organization or `group:admin` permission + on the specific group. + + Args: + membership_id: The membership to delete + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.GroupService/DeleteMembership", + body=maybe_transform({"membership_id": membership_id}, membership_delete_params.MembershipDeleteParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class AsyncMembershipsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncMembershipsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return AsyncMembershipsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncMembershipsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return AsyncMembershipsResourceWithStreamingResponse(self) + + async def create( + self, + *, + group_id: str | Omit = omit, + subject: Subject | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> MembershipCreateResponse: + """ + Creates a membership for a user in a group. + + Use this method to: + + - Add users to groups + - Grant group-based permissions to users + + ### Examples + + - Add a user to a group: + + Creates a membership for a user in a group. + + ```yaml + groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + subject: + id: "f53d2330-3795-4c5d-a1f3-453121af9c60" + principal: PRINCIPAL_USER + ``` + + ### Authorization + + Requires `org:admin` permission on the organization or `group:admin` permission + on the specific group. + + Args: + subject: Subject to add to the group + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.GroupService/CreateMembership", + body=await async_maybe_transform( + { + "group_id": group_id, + "subject": subject, + }, + membership_create_params.MembershipCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=MembershipCreateResponse, + ) + + def list( + self, + *, + token: str | Omit = omit, + page_size: int | Omit = omit, + group_id: str | Omit = omit, + pagination: membership_list_params.Pagination | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[GroupMembership, AsyncMembersPage[GroupMembership]]: + """ + Lists all memberships of a group. + + Use this method to: + + - View all members of a group + - Audit group membership + + ### Examples + + - List group members: + + Shows all members of a specific group. + + ```yaml + groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + pagination: + pageSize: 20 + ``` + + ### Authorization + + All organization members can view group membership (transparency model). + + Args: + pagination: pagination contains the pagination options for listing memberships + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.GroupService/ListMemberships", + page=AsyncMembersPage[GroupMembership], + body=maybe_transform( + { + "group_id": group_id, + "pagination": pagination, + }, + membership_list_params.MembershipListParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + membership_list_params.MembershipListParams, + ), + ), + model=GroupMembership, + method="post", + ) + + async def delete( + self, + *, + membership_id: str | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Deletes a membership for a user in a group. + + Use this method to: + + - Remove users from groups + - Revoke group-based permissions + + ### Examples + + - Remove a user from a group: + + Deletes a membership by its ID. + + ```yaml + membershipId: "a1b2c3d4-5678-90ab-cdef-1234567890ab" + ``` + + ### Authorization + + Requires `org:admin` permission on the organization or `group:admin` permission + on the specific group. + + Args: + membership_id: The membership to delete + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.GroupService/DeleteMembership", + body=await async_maybe_transform( + {"membership_id": membership_id}, membership_delete_params.MembershipDeleteParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class MembershipsResourceWithRawResponse: + def __init__(self, memberships: MembershipsResource) -> None: + self._memberships = memberships + + self.create = to_raw_response_wrapper( + memberships.create, + ) + self.list = to_raw_response_wrapper( + memberships.list, + ) + self.delete = to_raw_response_wrapper( + memberships.delete, + ) + + +class AsyncMembershipsResourceWithRawResponse: + def __init__(self, memberships: AsyncMembershipsResource) -> None: + self._memberships = memberships + + self.create = async_to_raw_response_wrapper( + memberships.create, + ) + self.list = async_to_raw_response_wrapper( + memberships.list, + ) + self.delete = async_to_raw_response_wrapper( + memberships.delete, + ) + + +class MembershipsResourceWithStreamingResponse: + def __init__(self, memberships: MembershipsResource) -> None: + self._memberships = memberships + + self.create = to_streamed_response_wrapper( + memberships.create, + ) + self.list = to_streamed_response_wrapper( + memberships.list, + ) + self.delete = to_streamed_response_wrapper( + memberships.delete, + ) + + +class AsyncMembershipsResourceWithStreamingResponse: + def __init__(self, memberships: AsyncMembershipsResource) -> None: + self._memberships = memberships + + self.create = async_to_streamed_response_wrapper( + memberships.create, + ) + self.list = async_to_streamed_response_wrapper( + memberships.list, + ) + self.delete = async_to_streamed_response_wrapper( + memberships.delete, + ) diff --git a/src/gitpod/resources/groups/role_assignments.py b/src/gitpod/resources/groups/role_assignments.py new file mode 100644 index 00000000..754dad37 --- /dev/null +++ b/src/gitpod/resources/groups/role_assignments.py @@ -0,0 +1,580 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ..._utils import maybe_transform, async_maybe_transform +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...pagination import SyncAssignmentsPage, AsyncAssignmentsPage +from ..._base_client import AsyncPaginator, make_request_options +from ...types.groups import ( + ResourceRole, + role_assignment_list_params, + role_assignment_create_params, + role_assignment_delete_params, +) +from ...types.groups.resource_role import ResourceRole +from ...types.shared.resource_type import ResourceType +from ...types.groups.role_assignment import RoleAssignment +from ...types.groups.role_assignment_create_response import RoleAssignmentCreateResponse + +__all__ = ["RoleAssignmentsResource", "AsyncRoleAssignmentsResource"] + + +class RoleAssignmentsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> RoleAssignmentsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return RoleAssignmentsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> RoleAssignmentsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return RoleAssignmentsResourceWithStreamingResponse(self) + + def create( + self, + *, + group_id: str | Omit = omit, + resource_id: str | Omit = omit, + resource_role: ResourceRole | Omit = omit, + resource_type: ResourceType | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> RoleAssignmentCreateResponse: + """ + Creates a role assignment for a group on a resource. + + Use this method to: + + - Assign specific roles to groups on runners, projects, or environments + - Grant group-based access to resources + + ### Examples + + - Assign admin role on a runner: + + Grants the group admin access to a runner. + + ```yaml + groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + resourceType: RESOURCE_TYPE_RUNNER + resourceId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + resourceRole: RESOURCE_ROLE_RUNNER_ADMIN + ``` + + - Assign user role on a project: + + Grants the group user access to a project. + + ```yaml + groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + resourceType: RESOURCE_TYPE_PROJECT + resourceId: "a1b2c3d4-5678-90ab-cdef-1234567890ab" + resourceRole: RESOURCE_ROLE_PROJECT_USER + ``` + + ### Authorization + + Requires admin role on the specific resource. + + Args: + resource_role: ResourceRole represents roles that can be assigned to groups on resources These + map directly to the roles defined in backend/db/rule/rbac/role/role.go + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.GroupService/CreateRoleAssignment", + body=maybe_transform( + { + "group_id": group_id, + "resource_id": resource_id, + "resource_role": resource_role, + "resource_type": resource_type, + }, + role_assignment_create_params.RoleAssignmentCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RoleAssignmentCreateResponse, + ) + + def list( + self, + *, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: role_assignment_list_params.Filter | Omit = omit, + pagination: role_assignment_list_params.Pagination | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncAssignmentsPage[RoleAssignment]: + """ + Lists role assignments for a group or resource. + + Use this method to: + + - View all role assignments for a group + - Audit resource access + - Check which groups have access to resources + + ### Examples + + - List role assignments for a group: + + Shows all role assignments for a specific group. + + ```yaml + filter: + groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + pagination: + pageSize: 20 + ``` + + - List role assignments by resource type: + + Shows all role assignments for runners. + + ```yaml + filter: + resourceTypes: + - RESOURCE_TYPE_RUNNER + pagination: + pageSize: 20 + ``` + + ### Authorization + + All organization members can view role assignments (transparency model). + + Args: + filter: Filter parameters + + pagination: Pagination parameters + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.GroupService/ListRoleAssignments", + page=SyncAssignmentsPage[RoleAssignment], + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + role_assignment_list_params.RoleAssignmentListParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + role_assignment_list_params.RoleAssignmentListParams, + ), + ), + model=RoleAssignment, + method="post", + ) + + def delete( + self, + *, + assignment_id: str | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Deletes a role assignment. + + Use this method to: + + - Remove group access to resources + - Revoke role-based permissions + + ### Examples + + - Delete a role assignment: + + Removes a role assignment by its ID. + + ```yaml + assignmentId: "a1b2c3d4-5678-90ab-cdef-1234567890ab" + ``` + + ### Authorization + + Requires admin role on the specific resource. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.GroupService/DeleteRoleAssignment", + body=maybe_transform( + {"assignment_id": assignment_id}, role_assignment_delete_params.RoleAssignmentDeleteParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class AsyncRoleAssignmentsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncRoleAssignmentsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return AsyncRoleAssignmentsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncRoleAssignmentsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return AsyncRoleAssignmentsResourceWithStreamingResponse(self) + + async def create( + self, + *, + group_id: str | Omit = omit, + resource_id: str | Omit = omit, + resource_role: ResourceRole | Omit = omit, + resource_type: ResourceType | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> RoleAssignmentCreateResponse: + """ + Creates a role assignment for a group on a resource. + + Use this method to: + + - Assign specific roles to groups on runners, projects, or environments + - Grant group-based access to resources + + ### Examples + + - Assign admin role on a runner: + + Grants the group admin access to a runner. + + ```yaml + groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + resourceType: RESOURCE_TYPE_RUNNER + resourceId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + resourceRole: RESOURCE_ROLE_RUNNER_ADMIN + ``` + + - Assign user role on a project: + + Grants the group user access to a project. + + ```yaml + groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + resourceType: RESOURCE_TYPE_PROJECT + resourceId: "a1b2c3d4-5678-90ab-cdef-1234567890ab" + resourceRole: RESOURCE_ROLE_PROJECT_USER + ``` + + ### Authorization + + Requires admin role on the specific resource. + + Args: + resource_role: ResourceRole represents roles that can be assigned to groups on resources These + map directly to the roles defined in backend/db/rule/rbac/role/role.go + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.GroupService/CreateRoleAssignment", + body=await async_maybe_transform( + { + "group_id": group_id, + "resource_id": resource_id, + "resource_role": resource_role, + "resource_type": resource_type, + }, + role_assignment_create_params.RoleAssignmentCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RoleAssignmentCreateResponse, + ) + + def list( + self, + *, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: role_assignment_list_params.Filter | Omit = omit, + pagination: role_assignment_list_params.Pagination | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[RoleAssignment, AsyncAssignmentsPage[RoleAssignment]]: + """ + Lists role assignments for a group or resource. + + Use this method to: + + - View all role assignments for a group + - Audit resource access + - Check which groups have access to resources + + ### Examples + + - List role assignments for a group: + + Shows all role assignments for a specific group. + + ```yaml + filter: + groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + pagination: + pageSize: 20 + ``` + + - List role assignments by resource type: + + Shows all role assignments for runners. + + ```yaml + filter: + resourceTypes: + - RESOURCE_TYPE_RUNNER + pagination: + pageSize: 20 + ``` + + ### Authorization + + All organization members can view role assignments (transparency model). + + Args: + filter: Filter parameters + + pagination: Pagination parameters + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.GroupService/ListRoleAssignments", + page=AsyncAssignmentsPage[RoleAssignment], + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + role_assignment_list_params.RoleAssignmentListParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + role_assignment_list_params.RoleAssignmentListParams, + ), + ), + model=RoleAssignment, + method="post", + ) + + async def delete( + self, + *, + assignment_id: str | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Deletes a role assignment. + + Use this method to: + + - Remove group access to resources + - Revoke role-based permissions + + ### Examples + + - Delete a role assignment: + + Removes a role assignment by its ID. + + ```yaml + assignmentId: "a1b2c3d4-5678-90ab-cdef-1234567890ab" + ``` + + ### Authorization + + Requires admin role on the specific resource. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.GroupService/DeleteRoleAssignment", + body=await async_maybe_transform( + {"assignment_id": assignment_id}, role_assignment_delete_params.RoleAssignmentDeleteParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class RoleAssignmentsResourceWithRawResponse: + def __init__(self, role_assignments: RoleAssignmentsResource) -> None: + self._role_assignments = role_assignments + + self.create = to_raw_response_wrapper( + role_assignments.create, + ) + self.list = to_raw_response_wrapper( + role_assignments.list, + ) + self.delete = to_raw_response_wrapper( + role_assignments.delete, + ) + + +class AsyncRoleAssignmentsResourceWithRawResponse: + def __init__(self, role_assignments: AsyncRoleAssignmentsResource) -> None: + self._role_assignments = role_assignments + + self.create = async_to_raw_response_wrapper( + role_assignments.create, + ) + self.list = async_to_raw_response_wrapper( + role_assignments.list, + ) + self.delete = async_to_raw_response_wrapper( + role_assignments.delete, + ) + + +class RoleAssignmentsResourceWithStreamingResponse: + def __init__(self, role_assignments: RoleAssignmentsResource) -> None: + self._role_assignments = role_assignments + + self.create = to_streamed_response_wrapper( + role_assignments.create, + ) + self.list = to_streamed_response_wrapper( + role_assignments.list, + ) + self.delete = to_streamed_response_wrapper( + role_assignments.delete, + ) + + +class AsyncRoleAssignmentsResourceWithStreamingResponse: + def __init__(self, role_assignments: AsyncRoleAssignmentsResource) -> None: + self._role_assignments = role_assignments + + self.create = async_to_streamed_response_wrapper( + role_assignments.create, + ) + self.list = async_to_streamed_response_wrapper( + role_assignments.list, + ) + self.delete = async_to_streamed_response_wrapper( + role_assignments.delete, + ) diff --git a/src/gitpod/resources/organizations/__init__.py b/src/gitpod/resources/organizations/__init__.py index 28e5eedf..84d6bdee 100644 --- a/src/gitpod/resources/organizations/__init__.py +++ b/src/gitpod/resources/organizations/__init__.py @@ -24,6 +24,14 @@ OrganizationsResourceWithStreamingResponse, AsyncOrganizationsResourceWithStreamingResponse, ) +from .custom_domains import ( + CustomDomainsResource, + AsyncCustomDomainsResource, + CustomDomainsResourceWithRawResponse, + AsyncCustomDomainsResourceWithRawResponse, + CustomDomainsResourceWithStreamingResponse, + AsyncCustomDomainsResourceWithStreamingResponse, +) from .sso_configurations import ( SSOConfigurationsResource, AsyncSSOConfigurationsResource, @@ -42,6 +50,12 @@ ) __all__ = [ + "CustomDomainsResource", + "AsyncCustomDomainsResource", + "CustomDomainsResourceWithRawResponse", + "AsyncCustomDomainsResourceWithRawResponse", + "CustomDomainsResourceWithStreamingResponse", + "AsyncCustomDomainsResourceWithStreamingResponse", "DomainVerificationsResource", "AsyncDomainVerificationsResource", "DomainVerificationsResourceWithRawResponse", diff --git a/src/gitpod/resources/organizations/custom_domains.py b/src/gitpod/resources/organizations/custom_domains.py new file mode 100644 index 00000000..3e6e9752 --- /dev/null +++ b/src/gitpod/resources/organizations/custom_domains.py @@ -0,0 +1,636 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional + +import httpx + +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ..._utils import maybe_transform, async_maybe_transform +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.organizations import ( + CustomDomainProvider, + custom_domain_create_params, + custom_domain_delete_params, + custom_domain_update_params, + custom_domain_retrieve_params, +) +from ...types.organizations.custom_domain_provider import CustomDomainProvider +from ...types.organizations.custom_domain_create_response import CustomDomainCreateResponse +from ...types.organizations.custom_domain_update_response import CustomDomainUpdateResponse +from ...types.organizations.custom_domain_retrieve_response import CustomDomainRetrieveResponse + +__all__ = ["CustomDomainsResource", "AsyncCustomDomainsResource"] + + +class CustomDomainsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> CustomDomainsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return CustomDomainsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> CustomDomainsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return CustomDomainsResourceWithStreamingResponse(self) + + def create( + self, + *, + domain_name: str, + organization_id: str, + aws_account_id: Optional[str] | Omit = omit, + cloud_account_id: Optional[str] | Omit = omit, + provider: CustomDomainProvider | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> CustomDomainCreateResponse: + """ + Creates a custom domain configuration for an organization. + + Use this method to configure custom domains for organization workspaces + + ### Examples + + - Configure AWS custom domain: + + Sets up a custom domain with AWS provider. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + domainName: "workspaces.acme-corp.com" + provider: CUSTOM_DOMAIN_PROVIDER_AWS + awsAccountId: "123456789012" + ``` + + Args: + domain_name: domain_name is the custom domain name + + organization_id: organization_id is the ID of the organization to create the custom domain for + + aws_account_id: aws_account_id is the AWS account ID (deprecated: use cloud_account_id) + + cloud_account_id: cloud_account_id is the unified cloud account identifier (AWS Account ID or GCP + Project ID) + + provider: provider is the cloud provider for this custom domain + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.OrganizationService/CreateCustomDomain", + body=maybe_transform( + { + "domain_name": domain_name, + "organization_id": organization_id, + "aws_account_id": aws_account_id, + "cloud_account_id": cloud_account_id, + "provider": provider, + }, + custom_domain_create_params.CustomDomainCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CustomDomainCreateResponse, + ) + + def retrieve( + self, + *, + organization_id: str, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> CustomDomainRetrieveResponse: + """ + Retrieves a specific custom domain configuration. + + Use this method to view custom domain details + + ### Examples + + - Get custom domain configuration: + + Retrieves details of a specific custom domain. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + ``` + + Args: + organization_id: organization_id is the ID of the organization to retrieve custom domain for + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.OrganizationService/GetCustomDomain", + body=maybe_transform( + {"organization_id": organization_id}, custom_domain_retrieve_params.CustomDomainRetrieveParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CustomDomainRetrieveResponse, + ) + + def update( + self, + *, + domain_name: str, + organization_id: str, + aws_account_id: Optional[str] | Omit = omit, + cloud_account_id: Optional[str] | Omit = omit, + provider: Optional[CustomDomainProvider] | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> CustomDomainUpdateResponse: + """ + Updates custom domain configuration settings. + + Use this method to: + + - Update cloud provider settings + - Change AWS account ID + - Modify domain configuration + + ### Examples + + - Update AWS account ID: + + Changes the AWS account ID for the custom domain. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + domainName: "workspaces.acme-corp.com" + awsAccountId: "987654321098" + ``` + + Args: + domain_name: domain_name is the custom domain name + + organization_id: organization_id is the ID of the organization to update custom domain for + + aws_account_id: aws_account_id is the AWS account ID (deprecated: use cloud_account_id) + + cloud_account_id: cloud_account_id is the unified cloud account identifier (AWS Account ID or GCP + Project ID) + + provider: provider is the cloud provider for this custom domain + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.OrganizationService/UpdateCustomDomain", + body=maybe_transform( + { + "domain_name": domain_name, + "organization_id": organization_id, + "aws_account_id": aws_account_id, + "cloud_account_id": cloud_account_id, + "provider": provider, + }, + custom_domain_update_params.CustomDomainUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CustomDomainUpdateResponse, + ) + + def delete( + self, + *, + organization_id: str, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Removes a custom domain configuration from an organization. + + Use this method to: + + - Disable custom domain functionality + - Remove outdated configurations + - Clean up unused domains + + ### Examples + + - Delete custom domain configuration: + + Removes a specific custom domain configuration. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + ``` + + Args: + organization_id: organization_id is the ID of the organization to delete custom domain for + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.OrganizationService/DeleteCustomDomain", + body=maybe_transform( + {"organization_id": organization_id}, custom_domain_delete_params.CustomDomainDeleteParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class AsyncCustomDomainsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncCustomDomainsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return AsyncCustomDomainsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncCustomDomainsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return AsyncCustomDomainsResourceWithStreamingResponse(self) + + async def create( + self, + *, + domain_name: str, + organization_id: str, + aws_account_id: Optional[str] | Omit = omit, + cloud_account_id: Optional[str] | Omit = omit, + provider: CustomDomainProvider | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> CustomDomainCreateResponse: + """ + Creates a custom domain configuration for an organization. + + Use this method to configure custom domains for organization workspaces + + ### Examples + + - Configure AWS custom domain: + + Sets up a custom domain with AWS provider. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + domainName: "workspaces.acme-corp.com" + provider: CUSTOM_DOMAIN_PROVIDER_AWS + awsAccountId: "123456789012" + ``` + + Args: + domain_name: domain_name is the custom domain name + + organization_id: organization_id is the ID of the organization to create the custom domain for + + aws_account_id: aws_account_id is the AWS account ID (deprecated: use cloud_account_id) + + cloud_account_id: cloud_account_id is the unified cloud account identifier (AWS Account ID or GCP + Project ID) + + provider: provider is the cloud provider for this custom domain + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.OrganizationService/CreateCustomDomain", + body=await async_maybe_transform( + { + "domain_name": domain_name, + "organization_id": organization_id, + "aws_account_id": aws_account_id, + "cloud_account_id": cloud_account_id, + "provider": provider, + }, + custom_domain_create_params.CustomDomainCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CustomDomainCreateResponse, + ) + + async def retrieve( + self, + *, + organization_id: str, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> CustomDomainRetrieveResponse: + """ + Retrieves a specific custom domain configuration. + + Use this method to view custom domain details + + ### Examples + + - Get custom domain configuration: + + Retrieves details of a specific custom domain. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + ``` + + Args: + organization_id: organization_id is the ID of the organization to retrieve custom domain for + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.OrganizationService/GetCustomDomain", + body=await async_maybe_transform( + {"organization_id": organization_id}, custom_domain_retrieve_params.CustomDomainRetrieveParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CustomDomainRetrieveResponse, + ) + + async def update( + self, + *, + domain_name: str, + organization_id: str, + aws_account_id: Optional[str] | Omit = omit, + cloud_account_id: Optional[str] | Omit = omit, + provider: Optional[CustomDomainProvider] | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> CustomDomainUpdateResponse: + """ + Updates custom domain configuration settings. + + Use this method to: + + - Update cloud provider settings + - Change AWS account ID + - Modify domain configuration + + ### Examples + + - Update AWS account ID: + + Changes the AWS account ID for the custom domain. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + domainName: "workspaces.acme-corp.com" + awsAccountId: "987654321098" + ``` + + Args: + domain_name: domain_name is the custom domain name + + organization_id: organization_id is the ID of the organization to update custom domain for + + aws_account_id: aws_account_id is the AWS account ID (deprecated: use cloud_account_id) + + cloud_account_id: cloud_account_id is the unified cloud account identifier (AWS Account ID or GCP + Project ID) + + provider: provider is the cloud provider for this custom domain + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.OrganizationService/UpdateCustomDomain", + body=await async_maybe_transform( + { + "domain_name": domain_name, + "organization_id": organization_id, + "aws_account_id": aws_account_id, + "cloud_account_id": cloud_account_id, + "provider": provider, + }, + custom_domain_update_params.CustomDomainUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CustomDomainUpdateResponse, + ) + + async def delete( + self, + *, + organization_id: str, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + Removes a custom domain configuration from an organization. + + Use this method to: + + - Disable custom domain functionality + - Remove outdated configurations + - Clean up unused domains + + ### Examples + + - Delete custom domain configuration: + + Removes a specific custom domain configuration. + + ```yaml + organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + ``` + + Args: + organization_id: organization_id is the ID of the organization to delete custom domain for + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.OrganizationService/DeleteCustomDomain", + body=await async_maybe_transform( + {"organization_id": organization_id}, custom_domain_delete_params.CustomDomainDeleteParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class CustomDomainsResourceWithRawResponse: + def __init__(self, custom_domains: CustomDomainsResource) -> None: + self._custom_domains = custom_domains + + self.create = to_raw_response_wrapper( + custom_domains.create, + ) + self.retrieve = to_raw_response_wrapper( + custom_domains.retrieve, + ) + self.update = to_raw_response_wrapper( + custom_domains.update, + ) + self.delete = to_raw_response_wrapper( + custom_domains.delete, + ) + + +class AsyncCustomDomainsResourceWithRawResponse: + def __init__(self, custom_domains: AsyncCustomDomainsResource) -> None: + self._custom_domains = custom_domains + + self.create = async_to_raw_response_wrapper( + custom_domains.create, + ) + self.retrieve = async_to_raw_response_wrapper( + custom_domains.retrieve, + ) + self.update = async_to_raw_response_wrapper( + custom_domains.update, + ) + self.delete = async_to_raw_response_wrapper( + custom_domains.delete, + ) + + +class CustomDomainsResourceWithStreamingResponse: + def __init__(self, custom_domains: CustomDomainsResource) -> None: + self._custom_domains = custom_domains + + self.create = to_streamed_response_wrapper( + custom_domains.create, + ) + self.retrieve = to_streamed_response_wrapper( + custom_domains.retrieve, + ) + self.update = to_streamed_response_wrapper( + custom_domains.update, + ) + self.delete = to_streamed_response_wrapper( + custom_domains.delete, + ) + + +class AsyncCustomDomainsResourceWithStreamingResponse: + def __init__(self, custom_domains: AsyncCustomDomainsResource) -> None: + self._custom_domains = custom_domains + + self.create = async_to_streamed_response_wrapper( + custom_domains.create, + ) + self.retrieve = async_to_streamed_response_wrapper( + custom_domains.retrieve, + ) + self.update = async_to_streamed_response_wrapper( + custom_domains.update, + ) + self.delete = async_to_streamed_response_wrapper( + custom_domains.delete, + ) diff --git a/src/gitpod/resources/organizations/organizations.py b/src/gitpod/resources/organizations/organizations.py index 28312caa..c1ec57eb 100644 --- a/src/gitpod/resources/organizations/organizations.py +++ b/src/gitpod/resources/organizations/organizations.py @@ -44,6 +44,14 @@ ) from ...pagination import SyncMembersPage, AsyncMembersPage from ..._base_client import AsyncPaginator, make_request_options +from .custom_domains import ( + CustomDomainsResource, + AsyncCustomDomainsResource, + CustomDomainsResourceWithRawResponse, + AsyncCustomDomainsResourceWithRawResponse, + CustomDomainsResourceWithStreamingResponse, + AsyncCustomDomainsResourceWithStreamingResponse, +) from .sso_configurations import ( SSOConfigurationsResource, AsyncSSOConfigurationsResource, @@ -72,6 +80,10 @@ class OrganizationsResource(SyncAPIResource): + @cached_property + def custom_domains(self) -> CustomDomainsResource: + return CustomDomainsResource(self._client) + @cached_property def domain_verifications(self) -> DomainVerificationsResource: return DomainVerificationsResource(self._client) @@ -493,6 +505,7 @@ def list_members( organization_id: str, token: str | Omit = omit, page_size: int | Omit = omit, + filter: organization_list_members_params.Filter | Omit = omit, pagination: organization_list_members_params.Pagination | Omit = omit, # 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. @@ -552,6 +565,7 @@ def list_members( body=maybe_transform( { "organization_id": organization_id, + "filter": filter, "pagination": pagination, }, organization_list_members_params.OrganizationListMembersParams, @@ -645,6 +659,10 @@ def set_role( class AsyncOrganizationsResource(AsyncAPIResource): + @cached_property + def custom_domains(self) -> AsyncCustomDomainsResource: + return AsyncCustomDomainsResource(self._client) + @cached_property def domain_verifications(self) -> AsyncDomainVerificationsResource: return AsyncDomainVerificationsResource(self._client) @@ -1066,6 +1084,7 @@ def list_members( organization_id: str, token: str | Omit = omit, page_size: int | Omit = omit, + filter: organization_list_members_params.Filter | Omit = omit, pagination: organization_list_members_params.Pagination | Omit = omit, # 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. @@ -1125,6 +1144,7 @@ def list_members( body=maybe_transform( { "organization_id": organization_id, + "filter": filter, "pagination": pagination, }, organization_list_members_params.OrganizationListMembersParams, @@ -1246,6 +1266,10 @@ def __init__(self, organizations: OrganizationsResource) -> None: organizations.set_role, ) + @cached_property + def custom_domains(self) -> CustomDomainsResourceWithRawResponse: + return CustomDomainsResourceWithRawResponse(self._organizations.custom_domains) + @cached_property def domain_verifications(self) -> DomainVerificationsResourceWithRawResponse: return DomainVerificationsResourceWithRawResponse(self._organizations.domain_verifications) @@ -1292,6 +1316,10 @@ def __init__(self, organizations: AsyncOrganizationsResource) -> None: organizations.set_role, ) + @cached_property + def custom_domains(self) -> AsyncCustomDomainsResourceWithRawResponse: + return AsyncCustomDomainsResourceWithRawResponse(self._organizations.custom_domains) + @cached_property def domain_verifications(self) -> AsyncDomainVerificationsResourceWithRawResponse: return AsyncDomainVerificationsResourceWithRawResponse(self._organizations.domain_verifications) @@ -1338,6 +1366,10 @@ def __init__(self, organizations: OrganizationsResource) -> None: organizations.set_role, ) + @cached_property + def custom_domains(self) -> CustomDomainsResourceWithStreamingResponse: + return CustomDomainsResourceWithStreamingResponse(self._organizations.custom_domains) + @cached_property def domain_verifications(self) -> DomainVerificationsResourceWithStreamingResponse: return DomainVerificationsResourceWithStreamingResponse(self._organizations.domain_verifications) @@ -1384,6 +1416,10 @@ def __init__(self, organizations: AsyncOrganizationsResource) -> None: organizations.set_role, ) + @cached_property + def custom_domains(self) -> AsyncCustomDomainsResourceWithStreamingResponse: + return AsyncCustomDomainsResourceWithStreamingResponse(self._organizations.custom_domains) + @cached_property def domain_verifications(self) -> AsyncDomainVerificationsResourceWithStreamingResponse: return AsyncDomainVerificationsResourceWithStreamingResponse(self._organizations.domain_verifications) diff --git a/src/gitpod/resources/organizations/policies.py b/src/gitpod/resources/organizations/policies.py index 70d3b52d..93b785e9 100644 --- a/src/gitpod/resources/organizations/policies.py +++ b/src/gitpod/resources/organizations/policies.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Optional +from typing import Dict, Optional import httpx @@ -97,16 +97,22 @@ def update( self, *, organization_id: str, + agent_policy: Optional[policy_update_params.AgentPolicy] | Omit = omit, allowed_editor_ids: SequenceNotStr[str] | Omit = omit, allow_local_runners: Optional[bool] | Omit = omit, default_editor_id: Optional[str] | Omit = omit, default_environment_image: Optional[str] | Omit = omit, + delete_archived_environments_after: Optional[str] | Omit = omit, + editor_version_restrictions: Dict[str, policy_update_params.EditorVersionRestrictions] | Omit = omit, + maximum_environment_lifetime: Optional[str] | Omit = omit, maximum_environments_per_user: Optional[str] | Omit = omit, maximum_environment_timeout: Optional[str] | Omit = omit, maximum_running_environments_per_user: Optional[str] | Omit = omit, members_create_projects: Optional[bool] | Omit = omit, members_require_projects: Optional[bool] | Omit = omit, port_sharing_disabled: Optional[bool] | Omit = omit, + require_custom_domain_access: Optional[bool] | Omit = omit, + security_agent_policy: Optional[policy_update_params.SecurityAgentPolicy] | Omit = omit, # 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, @@ -152,6 +158,8 @@ def update( Args: organization_id: organization_id is the ID of the organization to update policies for + agent_policy: agent_policy contains agent-specific policy settings + allowed_editor_ids: allowed_editor_ids is the list of editor IDs that are allowed to be used in the organization @@ -164,12 +172,23 @@ def update( default_environment_image: default_environment_image is the default container image when none is defined in repo + delete_archived_environments_after: delete_archived_environments_after controls how long archived environments are + kept before automatic deletion. 0 means no automatic deletion. Maximum duration + is 4 weeks (2419200 seconds). + + editor_version_restrictions: editor_version_restrictions restricts which editor versions can be used. Maps + editor ID to version policy with allowed major versions. + + maximum_environment_lifetime: maximum_environment_lifetime controls for how long environments are allowed to + be reused. 0 means no maximum lifetime. Maximum duration is 180 days (15552000 + seconds). + maximum_environments_per_user: maximum_environments_per_user limits total environments (running or stopped) per user maximum_environment_timeout: maximum_environment_timeout controls the maximum timeout allowed for environments in seconds. 0 means no limit (never). Minimum duration is 30 - minutes. + minutes (1800 seconds). maximum_running_environments_per_user: maximum_running_environments_per_user limits simultaneously running environments per user @@ -182,6 +201,11 @@ def update( port_sharing_disabled: port_sharing_disabled controls whether port sharing is disabled in the organization + require_custom_domain_access: require_custom_domain_access controls whether users must access via custom + domain when one is configured. When true, access via app.gitpod.io is blocked. + + security_agent_policy: security_agent_policy contains security agent configuration updates + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -195,16 +219,22 @@ def update( body=maybe_transform( { "organization_id": organization_id, + "agent_policy": agent_policy, "allowed_editor_ids": allowed_editor_ids, "allow_local_runners": allow_local_runners, "default_editor_id": default_editor_id, "default_environment_image": default_environment_image, + "delete_archived_environments_after": delete_archived_environments_after, + "editor_version_restrictions": editor_version_restrictions, + "maximum_environment_lifetime": maximum_environment_lifetime, "maximum_environments_per_user": maximum_environments_per_user, "maximum_environment_timeout": maximum_environment_timeout, "maximum_running_environments_per_user": maximum_running_environments_per_user, "members_create_projects": members_create_projects, "members_require_projects": members_require_projects, "port_sharing_disabled": port_sharing_disabled, + "require_custom_domain_access": require_custom_domain_access, + "security_agent_policy": security_agent_policy, }, policy_update_params.PolicyUpdateParams, ), @@ -291,16 +321,22 @@ async def update( self, *, organization_id: str, + agent_policy: Optional[policy_update_params.AgentPolicy] | Omit = omit, allowed_editor_ids: SequenceNotStr[str] | Omit = omit, allow_local_runners: Optional[bool] | Omit = omit, default_editor_id: Optional[str] | Omit = omit, default_environment_image: Optional[str] | Omit = omit, + delete_archived_environments_after: Optional[str] | Omit = omit, + editor_version_restrictions: Dict[str, policy_update_params.EditorVersionRestrictions] | Omit = omit, + maximum_environment_lifetime: Optional[str] | Omit = omit, maximum_environments_per_user: Optional[str] | Omit = omit, maximum_environment_timeout: Optional[str] | Omit = omit, maximum_running_environments_per_user: Optional[str] | Omit = omit, members_create_projects: Optional[bool] | Omit = omit, members_require_projects: Optional[bool] | Omit = omit, port_sharing_disabled: Optional[bool] | Omit = omit, + require_custom_domain_access: Optional[bool] | Omit = omit, + security_agent_policy: Optional[policy_update_params.SecurityAgentPolicy] | Omit = omit, # 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, @@ -346,6 +382,8 @@ async def update( Args: organization_id: organization_id is the ID of the organization to update policies for + agent_policy: agent_policy contains agent-specific policy settings + allowed_editor_ids: allowed_editor_ids is the list of editor IDs that are allowed to be used in the organization @@ -358,12 +396,23 @@ async def update( default_environment_image: default_environment_image is the default container image when none is defined in repo + delete_archived_environments_after: delete_archived_environments_after controls how long archived environments are + kept before automatic deletion. 0 means no automatic deletion. Maximum duration + is 4 weeks (2419200 seconds). + + editor_version_restrictions: editor_version_restrictions restricts which editor versions can be used. Maps + editor ID to version policy with allowed major versions. + + maximum_environment_lifetime: maximum_environment_lifetime controls for how long environments are allowed to + be reused. 0 means no maximum lifetime. Maximum duration is 180 days (15552000 + seconds). + maximum_environments_per_user: maximum_environments_per_user limits total environments (running or stopped) per user maximum_environment_timeout: maximum_environment_timeout controls the maximum timeout allowed for environments in seconds. 0 means no limit (never). Minimum duration is 30 - minutes. + minutes (1800 seconds). maximum_running_environments_per_user: maximum_running_environments_per_user limits simultaneously running environments per user @@ -376,6 +425,11 @@ async def update( port_sharing_disabled: port_sharing_disabled controls whether port sharing is disabled in the organization + require_custom_domain_access: require_custom_domain_access controls whether users must access via custom + domain when one is configured. When true, access via app.gitpod.io is blocked. + + security_agent_policy: security_agent_policy contains security agent configuration updates + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -389,16 +443,22 @@ async def update( body=await async_maybe_transform( { "organization_id": organization_id, + "agent_policy": agent_policy, "allowed_editor_ids": allowed_editor_ids, "allow_local_runners": allow_local_runners, "default_editor_id": default_editor_id, "default_environment_image": default_environment_image, + "delete_archived_environments_after": delete_archived_environments_after, + "editor_version_restrictions": editor_version_restrictions, + "maximum_environment_lifetime": maximum_environment_lifetime, "maximum_environments_per_user": maximum_environments_per_user, "maximum_environment_timeout": maximum_environment_timeout, "maximum_running_environments_per_user": maximum_running_environments_per_user, "members_create_projects": members_create_projects, "members_require_projects": members_require_projects, "port_sharing_disabled": port_sharing_disabled, + "require_custom_domain_access": require_custom_domain_access, + "security_agent_policy": security_agent_policy, }, policy_update_params.PolicyUpdateParams, ), diff --git a/src/gitpod/resources/organizations/sso_configurations.py b/src/gitpod/resources/organizations/sso_configurations.py index c0f1dad1..7d9796cc 100644 --- a/src/gitpod/resources/organizations/sso_configurations.py +++ b/src/gitpod/resources/organizations/sso_configurations.py @@ -6,7 +6,7 @@ import httpx -from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -59,9 +59,11 @@ def create( *, client_id: str, client_secret: str, - email_domain: str, issuer_url: str, organization_id: str, + display_name: str | Omit = omit, + email_domain: Optional[str] | Omit = omit, + email_domains: SequenceNotStr[str] | Omit = omit, # 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, @@ -110,10 +112,10 @@ def create( client_secret: client_secret is the client secret of the OIDC application set on the IdP - email_domain: email_domain is the domain that is allowed to sign in to the organization - issuer_url: issuer_url is the URL of the IdP issuer + email_domain: email_domain is the domain that is allowed to sign in to the organization + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -128,9 +130,11 @@ def create( { "client_id": client_id, "client_secret": client_secret, - "email_domain": email_domain, "issuer_url": issuer_url, "organization_id": organization_id, + "display_name": display_name, + "email_domain": email_domain, + "email_domains": email_domains, }, sso_configuration_create_params.SSOConfigurationCreateParams, ), @@ -200,7 +204,9 @@ def update( claims: Dict[str, str] | Omit = omit, client_id: Optional[str] | Omit = omit, client_secret: Optional[str] | Omit = omit, + display_name: Optional[str] | Omit = omit, email_domain: Optional[str] | Omit = omit, + email_domains: SequenceNotStr[str] | Omit = omit, issuer_url: Optional[str] | Omit = omit, state: Optional[SSOConfigurationState] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -271,7 +277,9 @@ def update( "claims": claims, "client_id": client_id, "client_secret": client_secret, + "display_name": display_name, "email_domain": email_domain, + "email_domains": email_domains, "issuer_url": issuer_url, "state": state, }, @@ -445,9 +453,11 @@ async def create( *, client_id: str, client_secret: str, - email_domain: str, issuer_url: str, organization_id: str, + display_name: str | Omit = omit, + email_domain: Optional[str] | Omit = omit, + email_domains: SequenceNotStr[str] | Omit = omit, # 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, @@ -496,10 +506,10 @@ async def create( client_secret: client_secret is the client secret of the OIDC application set on the IdP - email_domain: email_domain is the domain that is allowed to sign in to the organization - issuer_url: issuer_url is the URL of the IdP issuer + email_domain: email_domain is the domain that is allowed to sign in to the organization + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -514,9 +524,11 @@ async def create( { "client_id": client_id, "client_secret": client_secret, - "email_domain": email_domain, "issuer_url": issuer_url, "organization_id": organization_id, + "display_name": display_name, + "email_domain": email_domain, + "email_domains": email_domains, }, sso_configuration_create_params.SSOConfigurationCreateParams, ), @@ -586,7 +598,9 @@ async def update( claims: Dict[str, str] | Omit = omit, client_id: Optional[str] | Omit = omit, client_secret: Optional[str] | Omit = omit, + display_name: Optional[str] | Omit = omit, email_domain: Optional[str] | Omit = omit, + email_domains: SequenceNotStr[str] | Omit = omit, issuer_url: Optional[str] | Omit = omit, state: Optional[SSOConfigurationState] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -657,7 +671,9 @@ async def update( "claims": claims, "client_id": client_id, "client_secret": client_secret, + "display_name": display_name, "email_domain": email_domain, + "email_domains": email_domains, "issuer_url": issuer_url, "state": state, }, diff --git a/src/gitpod/resources/prebuilds.py b/src/gitpod/resources/prebuilds.py new file mode 100644 index 00000000..c688d1a3 --- /dev/null +++ b/src/gitpod/resources/prebuilds.py @@ -0,0 +1,860 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional + +import httpx + +from ..types import ( + prebuild_list_params, + prebuild_cancel_params, + prebuild_create_params, + prebuild_delete_params, + prebuild_retrieve_params, + prebuild_create_logs_token_params, +) +from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from .._utils import maybe_transform, async_maybe_transform +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..pagination import SyncPrebuildsPage, AsyncPrebuildsPage +from .._base_client import AsyncPaginator, make_request_options +from ..types.prebuild import Prebuild +from ..types.prebuild_spec_param import PrebuildSpecParam +from ..types.prebuild_cancel_response import PrebuildCancelResponse +from ..types.prebuild_create_response import PrebuildCreateResponse +from ..types.prebuild_retrieve_response import PrebuildRetrieveResponse +from ..types.prebuild_create_logs_token_response import PrebuildCreateLogsTokenResponse + +__all__ = ["PrebuildsResource", "AsyncPrebuildsResource"] + + +class PrebuildsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> PrebuildsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return PrebuildsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> PrebuildsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return PrebuildsResourceWithStreamingResponse(self) + + def create( + self, + *, + project_id: str, + spec: PrebuildSpecParam, + environment_class_id: Optional[str] | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> PrebuildCreateResponse: + """ + Creates a prebuild for a project. + + Use this method to: + + - Create on-demand prebuilds for faster environment startup + - Trigger prebuilds after repository changes + - Generate prebuilds for specific environment classes + + The prebuild process creates an environment, runs the devcontainer prebuild + lifecycle, and creates a snapshot for future environment provisioning. + + ### Examples + + - Create basic prebuild: + + Creates a prebuild for a project using default settings. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + spec: + timeout: "3600s" # 60 minutes default + ``` + + - Create prebuild with custom environment class: + + Creates a prebuild with a specific environment class and timeout. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + environmentClassId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + spec: + timeout: "3600s" # 1 hour + ``` + + Args: + project_id: project_id specifies the project to create a prebuild for + + spec: spec contains the configuration for creating the prebuild + + environment_class_id: environment_class_id specifies which environment class to use for the prebuild. + If not specified, uses the project's default environment class. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.PrebuildService/CreatePrebuild", + body=maybe_transform( + { + "project_id": project_id, + "spec": spec, + "environment_class_id": environment_class_id, + }, + prebuild_create_params.PrebuildCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=PrebuildCreateResponse, + ) + + def retrieve( + self, + *, + prebuild_id: str, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> PrebuildRetrieveResponse: + """ + Gets details about a specific prebuild. + + Use this method to: + + - Check prebuild status and progress + - Access prebuild logs for debugging + + ### Examples + + - Get prebuild details: + + Retrieves comprehensive information about a prebuild. + + ```yaml + prebuildId: "07e03a28-65a5-4d98-b532-8ea67b188048" + ``` + + Args: + prebuild_id: prebuild_id specifies the prebuild to retrieve + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.PrebuildService/GetPrebuild", + body=maybe_transform({"prebuild_id": prebuild_id}, prebuild_retrieve_params.PrebuildRetrieveParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=PrebuildRetrieveResponse, + ) + + def list( + self, + *, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: prebuild_list_params.Filter | Omit = omit, + pagination: prebuild_list_params.Pagination | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncPrebuildsPage[Prebuild]: + """ + ListPrebuilds + + Args: + filter: filter contains the filter options for listing prebuilds + + pagination: pagination contains the pagination options for listing prebuilds + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.PrebuildService/ListPrebuilds", + page=SyncPrebuildsPage[Prebuild], + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + prebuild_list_params.PrebuildListParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + prebuild_list_params.PrebuildListParams, + ), + ), + model=Prebuild, + method="post", + ) + + def delete( + self, + *, + prebuild_id: str, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """Deletes a prebuild. + + Prebuilds are automatically deleted after some time. + + Use this method to manually + delete a prebuild before automatic cleanup, for example to remove a prebuild + that should no longer be used. + + Deletion is processed asynchronously. The prebuild will be marked for deletion + and removed from the system in the background. + + ### Examples + + - Delete prebuild: + + Marks a prebuild for deletion and removes it from the system. + + ```yaml + prebuildId: "07e03a28-65a5-4d98-b532-8ea67b188048" + ``` + + Args: + prebuild_id: prebuild_id specifies the prebuild to delete + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.PrebuildService/DeletePrebuild", + body=maybe_transform({"prebuild_id": prebuild_id}, prebuild_delete_params.PrebuildDeleteParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def cancel( + self, + *, + prebuild_id: str, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> PrebuildCancelResponse: + """ + Cancels a running prebuild. + + Use this method to: + + - Stop prebuilds that are no longer needed + - Free up resources for other operations + + ### Examples + + - Cancel prebuild: + + Stops a running prebuild and cleans up resources. + + ```yaml + prebuildId: "07e03a28-65a5-4d98-b532-8ea67b188048" + ``` + + Args: + prebuild_id: prebuild_id specifies the prebuild to cancel + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.PrebuildService/CancelPrebuild", + body=maybe_transform({"prebuild_id": prebuild_id}, prebuild_cancel_params.PrebuildCancelParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=PrebuildCancelResponse, + ) + + def create_logs_token( + self, + *, + prebuild_id: str, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> PrebuildCreateLogsTokenResponse: + """ + Creates a logs access token for a prebuild. + + Use this method to: + + - Stream logs from a running prebuild + - Access archived logs from completed prebuilds + + Generated tokens are valid for one hour. + + ### Examples + + - Create prebuild logs token: + + Generates a token for accessing prebuild logs. + + ```yaml + prebuildId: "07e03a28-65a5-4d98-b532-8ea67b188048" + ``` + + Args: + prebuild_id: prebuild_id specifies the prebuild for which the logs token should be created. + + +required + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.PrebuildService/CreatePrebuildLogsToken", + body=maybe_transform( + {"prebuild_id": prebuild_id}, prebuild_create_logs_token_params.PrebuildCreateLogsTokenParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=PrebuildCreateLogsTokenResponse, + ) + + +class AsyncPrebuildsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncPrebuildsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return AsyncPrebuildsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncPrebuildsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return AsyncPrebuildsResourceWithStreamingResponse(self) + + async def create( + self, + *, + project_id: str, + spec: PrebuildSpecParam, + environment_class_id: Optional[str] | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> PrebuildCreateResponse: + """ + Creates a prebuild for a project. + + Use this method to: + + - Create on-demand prebuilds for faster environment startup + - Trigger prebuilds after repository changes + - Generate prebuilds for specific environment classes + + The prebuild process creates an environment, runs the devcontainer prebuild + lifecycle, and creates a snapshot for future environment provisioning. + + ### Examples + + - Create basic prebuild: + + Creates a prebuild for a project using default settings. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + spec: + timeout: "3600s" # 60 minutes default + ``` + + - Create prebuild with custom environment class: + + Creates a prebuild with a specific environment class and timeout. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + environmentClassId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + spec: + timeout: "3600s" # 1 hour + ``` + + Args: + project_id: project_id specifies the project to create a prebuild for + + spec: spec contains the configuration for creating the prebuild + + environment_class_id: environment_class_id specifies which environment class to use for the prebuild. + If not specified, uses the project's default environment class. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.PrebuildService/CreatePrebuild", + body=await async_maybe_transform( + { + "project_id": project_id, + "spec": spec, + "environment_class_id": environment_class_id, + }, + prebuild_create_params.PrebuildCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=PrebuildCreateResponse, + ) + + async def retrieve( + self, + *, + prebuild_id: str, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> PrebuildRetrieveResponse: + """ + Gets details about a specific prebuild. + + Use this method to: + + - Check prebuild status and progress + - Access prebuild logs for debugging + + ### Examples + + - Get prebuild details: + + Retrieves comprehensive information about a prebuild. + + ```yaml + prebuildId: "07e03a28-65a5-4d98-b532-8ea67b188048" + ``` + + Args: + prebuild_id: prebuild_id specifies the prebuild to retrieve + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.PrebuildService/GetPrebuild", + body=await async_maybe_transform( + {"prebuild_id": prebuild_id}, prebuild_retrieve_params.PrebuildRetrieveParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=PrebuildRetrieveResponse, + ) + + def list( + self, + *, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: prebuild_list_params.Filter | Omit = omit, + pagination: prebuild_list_params.Pagination | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[Prebuild, AsyncPrebuildsPage[Prebuild]]: + """ + ListPrebuilds + + Args: + filter: filter contains the filter options for listing prebuilds + + pagination: pagination contains the pagination options for listing prebuilds + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.PrebuildService/ListPrebuilds", + page=AsyncPrebuildsPage[Prebuild], + body=maybe_transform( + { + "filter": filter, + "pagination": pagination, + }, + prebuild_list_params.PrebuildListParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + prebuild_list_params.PrebuildListParams, + ), + ), + model=Prebuild, + method="post", + ) + + async def delete( + self, + *, + prebuild_id: str, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """Deletes a prebuild. + + Prebuilds are automatically deleted after some time. + + Use this method to manually + delete a prebuild before automatic cleanup, for example to remove a prebuild + that should no longer be used. + + Deletion is processed asynchronously. The prebuild will be marked for deletion + and removed from the system in the background. + + ### Examples + + - Delete prebuild: + + Marks a prebuild for deletion and removes it from the system. + + ```yaml + prebuildId: "07e03a28-65a5-4d98-b532-8ea67b188048" + ``` + + Args: + prebuild_id: prebuild_id specifies the prebuild to delete + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.PrebuildService/DeletePrebuild", + body=await async_maybe_transform({"prebuild_id": prebuild_id}, prebuild_delete_params.PrebuildDeleteParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def cancel( + self, + *, + prebuild_id: str, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> PrebuildCancelResponse: + """ + Cancels a running prebuild. + + Use this method to: + + - Stop prebuilds that are no longer needed + - Free up resources for other operations + + ### Examples + + - Cancel prebuild: + + Stops a running prebuild and cleans up resources. + + ```yaml + prebuildId: "07e03a28-65a5-4d98-b532-8ea67b188048" + ``` + + Args: + prebuild_id: prebuild_id specifies the prebuild to cancel + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.PrebuildService/CancelPrebuild", + body=await async_maybe_transform({"prebuild_id": prebuild_id}, prebuild_cancel_params.PrebuildCancelParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=PrebuildCancelResponse, + ) + + async def create_logs_token( + self, + *, + prebuild_id: str, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> PrebuildCreateLogsTokenResponse: + """ + Creates a logs access token for a prebuild. + + Use this method to: + + - Stream logs from a running prebuild + - Access archived logs from completed prebuilds + + Generated tokens are valid for one hour. + + ### Examples + + - Create prebuild logs token: + + Generates a token for accessing prebuild logs. + + ```yaml + prebuildId: "07e03a28-65a5-4d98-b532-8ea67b188048" + ``` + + Args: + prebuild_id: prebuild_id specifies the prebuild for which the logs token should be created. + + +required + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.PrebuildService/CreatePrebuildLogsToken", + body=await async_maybe_transform( + {"prebuild_id": prebuild_id}, prebuild_create_logs_token_params.PrebuildCreateLogsTokenParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=PrebuildCreateLogsTokenResponse, + ) + + +class PrebuildsResourceWithRawResponse: + def __init__(self, prebuilds: PrebuildsResource) -> None: + self._prebuilds = prebuilds + + self.create = to_raw_response_wrapper( + prebuilds.create, + ) + self.retrieve = to_raw_response_wrapper( + prebuilds.retrieve, + ) + self.list = to_raw_response_wrapper( + prebuilds.list, + ) + self.delete = to_raw_response_wrapper( + prebuilds.delete, + ) + self.cancel = to_raw_response_wrapper( + prebuilds.cancel, + ) + self.create_logs_token = to_raw_response_wrapper( + prebuilds.create_logs_token, + ) + + +class AsyncPrebuildsResourceWithRawResponse: + def __init__(self, prebuilds: AsyncPrebuildsResource) -> None: + self._prebuilds = prebuilds + + self.create = async_to_raw_response_wrapper( + prebuilds.create, + ) + self.retrieve = async_to_raw_response_wrapper( + prebuilds.retrieve, + ) + self.list = async_to_raw_response_wrapper( + prebuilds.list, + ) + self.delete = async_to_raw_response_wrapper( + prebuilds.delete, + ) + self.cancel = async_to_raw_response_wrapper( + prebuilds.cancel, + ) + self.create_logs_token = async_to_raw_response_wrapper( + prebuilds.create_logs_token, + ) + + +class PrebuildsResourceWithStreamingResponse: + def __init__(self, prebuilds: PrebuildsResource) -> None: + self._prebuilds = prebuilds + + self.create = to_streamed_response_wrapper( + prebuilds.create, + ) + self.retrieve = to_streamed_response_wrapper( + prebuilds.retrieve, + ) + self.list = to_streamed_response_wrapper( + prebuilds.list, + ) + self.delete = to_streamed_response_wrapper( + prebuilds.delete, + ) + self.cancel = to_streamed_response_wrapper( + prebuilds.cancel, + ) + self.create_logs_token = to_streamed_response_wrapper( + prebuilds.create_logs_token, + ) + + +class AsyncPrebuildsResourceWithStreamingResponse: + def __init__(self, prebuilds: AsyncPrebuildsResource) -> None: + self._prebuilds = prebuilds + + self.create = async_to_streamed_response_wrapper( + prebuilds.create, + ) + self.retrieve = async_to_streamed_response_wrapper( + prebuilds.retrieve, + ) + self.list = async_to_streamed_response_wrapper( + prebuilds.list, + ) + self.delete = async_to_streamed_response_wrapper( + prebuilds.delete, + ) + self.cancel = async_to_streamed_response_wrapper( + prebuilds.cancel, + ) + self.create_logs_token = async_to_streamed_response_wrapper( + prebuilds.create_logs_token, + ) diff --git a/src/gitpod/resources/projects/__init__.py b/src/gitpod/resources/projects/__init__.py index da8b9644..d69f1ae8 100644 --- a/src/gitpod/resources/projects/__init__.py +++ b/src/gitpod/resources/projects/__init__.py @@ -16,8 +16,22 @@ ProjectsResourceWithStreamingResponse, AsyncProjectsResourceWithStreamingResponse, ) +from .environment_clases import ( + EnvironmentClasesResource, + AsyncEnvironmentClasesResource, + EnvironmentClasesResourceWithRawResponse, + AsyncEnvironmentClasesResourceWithRawResponse, + EnvironmentClasesResourceWithStreamingResponse, + AsyncEnvironmentClasesResourceWithStreamingResponse, +) __all__ = [ + "EnvironmentClasesResource", + "AsyncEnvironmentClasesResource", + "EnvironmentClasesResourceWithRawResponse", + "AsyncEnvironmentClasesResourceWithRawResponse", + "EnvironmentClasesResourceWithStreamingResponse", + "AsyncEnvironmentClasesResourceWithStreamingResponse", "PoliciesResource", "AsyncPoliciesResource", "PoliciesResourceWithRawResponse", diff --git a/src/gitpod/resources/projects/environment_clases.py b/src/gitpod/resources/projects/environment_clases.py new file mode 100644 index 00000000..94b1098c --- /dev/null +++ b/src/gitpod/resources/projects/environment_clases.py @@ -0,0 +1,385 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable + +import httpx + +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ..._utils import maybe_transform, async_maybe_transform +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...pagination import SyncProjectEnvironmentClassesPage, AsyncProjectEnvironmentClassesPage +from ..._base_client import AsyncPaginator, make_request_options +from ...types.projects import environment_clase_list_params, environment_clase_update_params +from ...types.shared.project_environment_class import ProjectEnvironmentClass as SharedProjectEnvironmentClass +from ...types.shared_params.project_environment_class import ( + ProjectEnvironmentClass as SharedParamsProjectEnvironmentClass, +) + +__all__ = ["EnvironmentClasesResource", "AsyncEnvironmentClasesResource"] + + +class EnvironmentClasesResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> EnvironmentClasesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return EnvironmentClasesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> EnvironmentClasesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return EnvironmentClasesResourceWithStreamingResponse(self) + + def update( + self, + *, + project_environment_classes: Iterable[SharedParamsProjectEnvironmentClass] | Omit = omit, + project_id: str | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + 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 + ``` + + Args: + project_id: project_id specifies the project identifier + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.ProjectService/UpdateProjectEnvironmentClasses", + body=maybe_transform( + { + "project_environment_classes": project_environment_classes, + "project_id": project_id, + }, + environment_clase_update_params.EnvironmentClaseUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def list( + self, + *, + token: str | Omit = omit, + page_size: int | Omit = omit, + pagination: environment_clase_list_params.Pagination | Omit = omit, + project_id: str | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncProjectEnvironmentClassesPage[SharedProjectEnvironmentClass]: + """ + 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 + ``` + + Args: + pagination: pagination contains the pagination options for listing project policies + + project_id: project_id specifies the project identifier + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.ProjectService/ListProjectEnvironmentClasses", + page=SyncProjectEnvironmentClassesPage[SharedProjectEnvironmentClass], + body=maybe_transform( + { + "pagination": pagination, + "project_id": project_id, + }, + environment_clase_list_params.EnvironmentClaseListParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + environment_clase_list_params.EnvironmentClaseListParams, + ), + ), + model=SharedProjectEnvironmentClass, + method="post", + ) + + +class AsyncEnvironmentClasesResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncEnvironmentClasesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#accessing-raw-response-data-eg-headers + """ + return AsyncEnvironmentClasesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncEnvironmentClasesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/gitpod-io/gitpod-sdk-python#with_streaming_response + """ + return AsyncEnvironmentClasesResourceWithStreamingResponse(self) + + async def update( + self, + *, + project_environment_classes: Iterable[SharedParamsProjectEnvironmentClass] | Omit = omit, + project_id: str | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """ + 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 + ``` + + Args: + project_id: project_id specifies the project identifier + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.ProjectService/UpdateProjectEnvironmentClasses", + body=await async_maybe_transform( + { + "project_environment_classes": project_environment_classes, + "project_id": project_id, + }, + environment_clase_update_params.EnvironmentClaseUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def list( + self, + *, + token: str | Omit = omit, + page_size: int | Omit = omit, + pagination: environment_clase_list_params.Pagination | Omit = omit, + project_id: str | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[ + SharedProjectEnvironmentClass, AsyncProjectEnvironmentClassesPage[SharedProjectEnvironmentClass] + ]: + """ + 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 + ``` + + Args: + pagination: pagination contains the pagination options for listing project policies + + project_id: project_id specifies the project identifier + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/gitpod.v1.ProjectService/ListProjectEnvironmentClasses", + page=AsyncProjectEnvironmentClassesPage[SharedProjectEnvironmentClass], + body=maybe_transform( + { + "pagination": pagination, + "project_id": project_id, + }, + environment_clase_list_params.EnvironmentClaseListParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "token": token, + "page_size": page_size, + }, + environment_clase_list_params.EnvironmentClaseListParams, + ), + ), + model=SharedProjectEnvironmentClass, + method="post", + ) + + +class EnvironmentClasesResourceWithRawResponse: + def __init__(self, environment_clases: EnvironmentClasesResource) -> None: + self._environment_clases = environment_clases + + self.update = to_raw_response_wrapper( + environment_clases.update, + ) + self.list = to_raw_response_wrapper( + environment_clases.list, + ) + + +class AsyncEnvironmentClasesResourceWithRawResponse: + def __init__(self, environment_clases: AsyncEnvironmentClasesResource) -> None: + self._environment_clases = environment_clases + + self.update = async_to_raw_response_wrapper( + environment_clases.update, + ) + self.list = async_to_raw_response_wrapper( + environment_clases.list, + ) + + +class EnvironmentClasesResourceWithStreamingResponse: + def __init__(self, environment_clases: EnvironmentClasesResource) -> None: + self._environment_clases = environment_clases + + self.update = to_streamed_response_wrapper( + environment_clases.update, + ) + self.list = to_streamed_response_wrapper( + environment_clases.list, + ) + + +class AsyncEnvironmentClasesResourceWithStreamingResponse: + def __init__(self, environment_clases: AsyncEnvironmentClasesResource) -> None: + self._environment_clases = environment_clases + + self.update = async_to_streamed_response_wrapper( + environment_clases.update, + ) + self.list = async_to_streamed_response_wrapper( + environment_clases.list, + ) diff --git a/src/gitpod/resources/projects/projects.py b/src/gitpod/resources/projects/projects.py index d8d61de5..4a4bd619 100644 --- a/src/gitpod/resources/projects/projects.py +++ b/src/gitpod/resources/projects/projects.py @@ -35,17 +35,29 @@ from ...pagination import SyncProjectsPage, AsyncProjectsPage from ..._base_client import AsyncPaginator, make_request_options from ...types.project import Project +from .environment_clases import ( + EnvironmentClasesResource, + AsyncEnvironmentClasesResource, + EnvironmentClasesResourceWithRawResponse, + AsyncEnvironmentClasesResourceWithRawResponse, + EnvironmentClasesResourceWithStreamingResponse, + AsyncEnvironmentClasesResourceWithStreamingResponse, +) from ...types.project_create_response import ProjectCreateResponse from ...types.project_update_response import ProjectUpdateResponse from ...types.project_retrieve_response import ProjectRetrieveResponse from ...types.environment_initializer_param import EnvironmentInitializerParam -from ...types.project_environment_class_param import ProjectEnvironmentClassParam +from ...types.project_prebuild_configuration_param import ProjectPrebuildConfigurationParam from ...types.project_create_from_environment_response import ProjectCreateFromEnvironmentResponse __all__ = ["ProjectsResource", "AsyncProjectsResource"] class ProjectsResource(SyncAPIResource): + @cached_property + def environment_clases(self) -> EnvironmentClasesResource: + return EnvironmentClasesResource(self._client) + @cached_property def policies(self) -> PoliciesResource: return PoliciesResource(self._client) @@ -72,11 +84,11 @@ def with_streaming_response(self) -> ProjectsResourceWithStreamingResponse: def create( self, *, - environment_class: ProjectEnvironmentClassParam, initializer: EnvironmentInitializerParam, automations_file_path: str | Omit = omit, devcontainer_file_path: str | Omit = omit, name: str | Omit = omit, + prebuild_configuration: ProjectPrebuildConfigurationParam | Omit = omit, technical_description: str | Omit = omit, # 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. @@ -103,8 +115,6 @@ def create( ```yaml name: "Web Application" - environmentClass: - environmentClassId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" initializer: specs: - git: @@ -117,8 +127,6 @@ def create( ```yaml name: "Backend Service" - environmentClass: - environmentClassId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" initializer: specs: - git: @@ -144,6 +152,9 @@ def create( this.matches("^$|^[^/].*") ``` + prebuild_configuration: prebuild_configuration defines how prebuilds are created for this project. If + not set, prebuilds are disabled for the project. + technical_description: technical_description is a detailed technical description of the project This field is not returned by default in GetProject or ListProjects responses 8KB max @@ -159,11 +170,11 @@ def create( "/gitpod.v1.ProjectService/CreateProject", body=maybe_transform( { - "environment_class": environment_class, "initializer": initializer, "automations_file_path": automations_file_path, "devcontainer_file_path": devcontainer_file_path, "name": name, + "prebuild_configuration": prebuild_configuration, "technical_description": technical_description, }, project_create_params.ProjectCreateParams, @@ -229,9 +240,9 @@ def update( *, automations_file_path: Optional[str] | Omit = omit, devcontainer_file_path: Optional[str] | Omit = omit, - environment_class: Optional[ProjectEnvironmentClassParam] | Omit = omit, initializer: Optional[EnvironmentInitializerParam] | Omit = omit, name: Optional[str] | Omit = omit, + prebuild_configuration: Optional[ProjectPrebuildConfigurationParam] | Omit = omit, project_id: str | Omit = omit, technical_description: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -250,6 +261,7 @@ def update( - Update environment class - Change project name - Configure initializers + - Configure prebuild settings ### Examples @@ -262,14 +274,20 @@ def update( name: "New Project Name" ``` - - Update environment class: + - Enable prebuilds with daily schedule: - Changes the project's environment class. + Configures prebuilds to run daily at 2 AM UTC. ```yaml projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" - environmentClass: - environmentClassId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + prebuildConfiguration: + enabled: true + environmentClassIds: + - "b0e12f6c-4c67-429d-a4a6-d9838b5da041" + timeout: "3600s" + trigger: + dailySchedule: + hourUtc: 2 ``` Args: @@ -289,6 +307,10 @@ def update( initializer: initializer is the content initializer + prebuild_configuration: 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. + project_id: project_id specifies the project identifier technical_description: technical_description is a detailed technical description of the project This @@ -308,9 +330,9 @@ def update( { "automations_file_path": automations_file_path, "devcontainer_file_path": devcontainer_file_path, - "environment_class": environment_class, "initializer": initializer, "name": name, + "prebuild_configuration": prebuild_configuration, "project_id": project_id, "technical_description": technical_description, }, @@ -504,6 +526,10 @@ def create_from_environment( class AsyncProjectsResource(AsyncAPIResource): + @cached_property + def environment_clases(self) -> AsyncEnvironmentClasesResource: + return AsyncEnvironmentClasesResource(self._client) + @cached_property def policies(self) -> AsyncPoliciesResource: return AsyncPoliciesResource(self._client) @@ -530,11 +556,11 @@ def with_streaming_response(self) -> AsyncProjectsResourceWithStreamingResponse: async def create( self, *, - environment_class: ProjectEnvironmentClassParam, initializer: EnvironmentInitializerParam, automations_file_path: str | Omit = omit, devcontainer_file_path: str | Omit = omit, name: str | Omit = omit, + prebuild_configuration: ProjectPrebuildConfigurationParam | Omit = omit, technical_description: str | Omit = omit, # 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. @@ -561,8 +587,6 @@ async def create( ```yaml name: "Web Application" - environmentClass: - environmentClassId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" initializer: specs: - git: @@ -575,8 +599,6 @@ async def create( ```yaml name: "Backend Service" - environmentClass: - environmentClassId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" initializer: specs: - git: @@ -602,6 +624,9 @@ async def create( this.matches("^$|^[^/].*") ``` + prebuild_configuration: prebuild_configuration defines how prebuilds are created for this project. If + not set, prebuilds are disabled for the project. + technical_description: technical_description is a detailed technical description of the project This field is not returned by default in GetProject or ListProjects responses 8KB max @@ -617,11 +642,11 @@ async def create( "/gitpod.v1.ProjectService/CreateProject", body=await async_maybe_transform( { - "environment_class": environment_class, "initializer": initializer, "automations_file_path": automations_file_path, "devcontainer_file_path": devcontainer_file_path, "name": name, + "prebuild_configuration": prebuild_configuration, "technical_description": technical_description, }, project_create_params.ProjectCreateParams, @@ -687,9 +712,9 @@ async def update( *, automations_file_path: Optional[str] | Omit = omit, devcontainer_file_path: Optional[str] | Omit = omit, - environment_class: Optional[ProjectEnvironmentClassParam] | Omit = omit, initializer: Optional[EnvironmentInitializerParam] | Omit = omit, name: Optional[str] | Omit = omit, + prebuild_configuration: Optional[ProjectPrebuildConfigurationParam] | Omit = omit, project_id: str | Omit = omit, technical_description: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -708,6 +733,7 @@ async def update( - Update environment class - Change project name - Configure initializers + - Configure prebuild settings ### Examples @@ -720,14 +746,20 @@ async def update( name: "New Project Name" ``` - - Update environment class: + - Enable prebuilds with daily schedule: - Changes the project's environment class. + Configures prebuilds to run daily at 2 AM UTC. ```yaml projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" - environmentClass: - environmentClassId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + prebuildConfiguration: + enabled: true + environmentClassIds: + - "b0e12f6c-4c67-429d-a4a6-d9838b5da041" + timeout: "3600s" + trigger: + dailySchedule: + hourUtc: 2 ``` Args: @@ -747,6 +779,10 @@ async def update( initializer: initializer is the content initializer + prebuild_configuration: 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. + project_id: project_id specifies the project identifier technical_description: technical_description is a detailed technical description of the project This @@ -766,9 +802,9 @@ async def update( { "automations_file_path": automations_file_path, "devcontainer_file_path": devcontainer_file_path, - "environment_class": environment_class, "initializer": initializer, "name": name, + "prebuild_configuration": prebuild_configuration, "project_id": project_id, "technical_description": technical_description, }, @@ -984,6 +1020,10 @@ def __init__(self, projects: ProjectsResource) -> None: projects.create_from_environment, ) + @cached_property + def environment_clases(self) -> EnvironmentClasesResourceWithRawResponse: + return EnvironmentClasesResourceWithRawResponse(self._projects.environment_clases) + @cached_property def policies(self) -> PoliciesResourceWithRawResponse: return PoliciesResourceWithRawResponse(self._projects.policies) @@ -1012,6 +1052,10 @@ def __init__(self, projects: AsyncProjectsResource) -> None: projects.create_from_environment, ) + @cached_property + def environment_clases(self) -> AsyncEnvironmentClasesResourceWithRawResponse: + return AsyncEnvironmentClasesResourceWithRawResponse(self._projects.environment_clases) + @cached_property def policies(self) -> AsyncPoliciesResourceWithRawResponse: return AsyncPoliciesResourceWithRawResponse(self._projects.policies) @@ -1040,6 +1084,10 @@ def __init__(self, projects: ProjectsResource) -> None: projects.create_from_environment, ) + @cached_property + def environment_clases(self) -> EnvironmentClasesResourceWithStreamingResponse: + return EnvironmentClasesResourceWithStreamingResponse(self._projects.environment_clases) + @cached_property def policies(self) -> PoliciesResourceWithStreamingResponse: return PoliciesResourceWithStreamingResponse(self._projects.policies) @@ -1068,6 +1116,10 @@ def __init__(self, projects: AsyncProjectsResource) -> None: projects.create_from_environment, ) + @cached_property + def environment_clases(self) -> AsyncEnvironmentClasesResourceWithStreamingResponse: + return AsyncEnvironmentClasesResourceWithStreamingResponse(self._projects.environment_clases) + @cached_property def policies(self) -> AsyncPoliciesResourceWithStreamingResponse: return AsyncPoliciesResourceWithStreamingResponse(self._projects.policies) diff --git a/src/gitpod/resources/runners/configurations/host_authentication_tokens.py b/src/gitpod/resources/runners/configurations/host_authentication_tokens.py index 1c77a680..ab747fd0 100644 --- a/src/gitpod/resources/runners/configurations/host_authentication_tokens.py +++ b/src/gitpod/resources/runners/configurations/host_authentication_tokens.py @@ -7,7 +7,7 @@ import httpx -from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ...._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -19,6 +19,7 @@ ) from ....pagination import SyncTokensPage, AsyncTokensPage from ...._base_client import AsyncPaginator, make_request_options +from ....types.shared_params.subject import Subject from ....types.runners.configurations import ( HostAuthenticationTokenSource, host_authentication_token_list_params, @@ -65,9 +66,12 @@ def create( token: str | Omit = omit, expires_at: Union[str, datetime] | Omit = omit, host: str | Omit = omit, + integration_id: str | Omit = omit, refresh_token: str | Omit = omit, runner_id: str | Omit = omit, + scopes: SequenceNotStr[str] | Omit = omit, source: HostAuthenticationTokenSource | Omit = omit, + subject: Subject | Omit = omit, user_id: str | Omit = omit, # 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. @@ -102,6 +106,8 @@ def create( ``` Args: + token: stored encrypted, retrieved via GetHostAuthenticationTokenValue + expires_at: 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, @@ -191,6 +197,14 @@ def create( [`ISODateTimeFormat.dateTime()`]() to obtain a formatter capable of generating timestamps in this format. + refresh_token: stored encrypted, retrieved via GetHostAuthenticationTokenValue + + scopes: Maximum 100 scopes allowed (101 for validation purposes) + + subject: Subject identifies the principal (user or service account) for the token + + user_id: Deprecated: Use principal_id and principal_type instead + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -206,9 +220,12 @@ def create( "token": token, "expires_at": expires_at, "host": host, + "integration_id": integration_id, "refresh_token": refresh_token, "runner_id": runner_id, + "scopes": scopes, "source": source, + "subject": subject, "user_id": user_id, }, host_authentication_token_create_params.HostAuthenticationTokenCreateParams, @@ -276,6 +293,7 @@ def update( token: Optional[str] | Omit = omit, expires_at: Union[str, datetime, None] | Omit = omit, refresh_token: Optional[str] | Omit = omit, + scopes: SequenceNotStr[str] | Omit = omit, # 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, @@ -411,6 +429,7 @@ def update( "token": token, "expires_at": expires_at, "refresh_token": refresh_token, + "scopes": scopes, }, host_authentication_token_update_params.HostAuthenticationTokenUpdateParams, ), @@ -578,9 +597,12 @@ async def create( token: str | Omit = omit, expires_at: Union[str, datetime] | Omit = omit, host: str | Omit = omit, + integration_id: str | Omit = omit, refresh_token: str | Omit = omit, runner_id: str | Omit = omit, + scopes: SequenceNotStr[str] | Omit = omit, source: HostAuthenticationTokenSource | Omit = omit, + subject: Subject | Omit = omit, user_id: str | Omit = omit, # 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. @@ -615,6 +637,8 @@ async def create( ``` Args: + token: stored encrypted, retrieved via GetHostAuthenticationTokenValue + expires_at: 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, @@ -704,6 +728,14 @@ async def create( [`ISODateTimeFormat.dateTime()`]() to obtain a formatter capable of generating timestamps in this format. + refresh_token: stored encrypted, retrieved via GetHostAuthenticationTokenValue + + scopes: Maximum 100 scopes allowed (101 for validation purposes) + + subject: Subject identifies the principal (user or service account) for the token + + user_id: Deprecated: Use principal_id and principal_type instead + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -719,9 +751,12 @@ async def create( "token": token, "expires_at": expires_at, "host": host, + "integration_id": integration_id, "refresh_token": refresh_token, "runner_id": runner_id, + "scopes": scopes, "source": source, + "subject": subject, "user_id": user_id, }, host_authentication_token_create_params.HostAuthenticationTokenCreateParams, @@ -789,6 +824,7 @@ async def update( token: Optional[str] | Omit = omit, expires_at: Union[str, datetime, None] | Omit = omit, refresh_token: Optional[str] | Omit = omit, + scopes: SequenceNotStr[str] | Omit = omit, # 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, @@ -924,6 +960,7 @@ async def update( "token": token, "expires_at": expires_at, "refresh_token": refresh_token, + "scopes": scopes, }, host_authentication_token_update_params.HostAuthenticationTokenUpdateParams, ), diff --git a/src/gitpod/resources/runners/configurations/scm_integrations.py b/src/gitpod/resources/runners/configurations/scm_integrations.py index 2f5f82ad..12c4b9e7 100644 --- a/src/gitpod/resources/runners/configurations/scm_integrations.py +++ b/src/gitpod/resources/runners/configurations/scm_integrations.py @@ -62,6 +62,7 @@ def create( pat: bool | Omit = omit, runner_id: str | Omit = omit, scm_id: str | Omit = omit, + virtual_directory: Optional[str] | Omit = omit, # 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, @@ -105,6 +106,11 @@ def create( scm_id: scm_id references the scm_id in the runner's configuration schema that this integration is for + virtual_directory: virtual_directory is the virtual directory path for Azure DevOps Server (e.g., + "/tfs"). This field is only used for Azure DevOps Server SCM integrations and + should be empty for other SCM types. Azure DevOps Server APIs work without + collection when PAT scope is 'All accessible organizations'. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -124,6 +130,7 @@ def create( "pat": pat, "runner_id": runner_id, "scm_id": scm_id, + "virtual_directory": virtual_directory, }, scm_integration_create_params.ScmIntegrationCreateParams, ), @@ -189,6 +196,7 @@ def update( oauth_client_id: Optional[str] | Omit = omit, oauth_plaintext_client_secret: Optional[str] | Omit = omit, pat: Optional[bool] | Omit = omit, + virtual_directory: Optional[str] | Omit = omit, # 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, @@ -238,6 +246,11 @@ def update( This might lead to users being unable to access their repositories until they re-authenticate. + virtual_directory: virtual_directory is the virtual directory path for Azure DevOps Server (e.g., + "/tfs"). This field is only used for Azure DevOps Server SCM integrations and + should be empty for other SCM types. Azure DevOps Server APIs work without + collection when PAT scope is 'All accessible organizations'. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -255,6 +268,7 @@ def update( "oauth_client_id": oauth_client_id, "oauth_plaintext_client_secret": oauth_plaintext_client_secret, "pat": pat, + "virtual_directory": virtual_directory, }, scm_integration_update_params.ScmIntegrationUpdateParams, ), @@ -417,6 +431,7 @@ async def create( pat: bool | Omit = omit, runner_id: str | Omit = omit, scm_id: str | Omit = omit, + virtual_directory: Optional[str] | Omit = omit, # 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, @@ -460,6 +475,11 @@ async def create( scm_id: scm_id references the scm_id in the runner's configuration schema that this integration is for + virtual_directory: virtual_directory is the virtual directory path for Azure DevOps Server (e.g., + "/tfs"). This field is only used for Azure DevOps Server SCM integrations and + should be empty for other SCM types. Azure DevOps Server APIs work without + collection when PAT scope is 'All accessible organizations'. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -479,6 +499,7 @@ async def create( "pat": pat, "runner_id": runner_id, "scm_id": scm_id, + "virtual_directory": virtual_directory, }, scm_integration_create_params.ScmIntegrationCreateParams, ), @@ -544,6 +565,7 @@ async def update( oauth_client_id: Optional[str] | Omit = omit, oauth_plaintext_client_secret: Optional[str] | Omit = omit, pat: Optional[bool] | Omit = omit, + virtual_directory: Optional[str] | Omit = omit, # 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, @@ -593,6 +615,11 @@ async def update( This might lead to users being unable to access their repositories until they re-authenticate. + virtual_directory: virtual_directory is the virtual directory path for Azure DevOps Server (e.g., + "/tfs"). This field is only used for Azure DevOps Server SCM integrations and + should be empty for other SCM types. Azure DevOps Server APIs work without + collection when PAT scope is 'All accessible organizations'. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -610,6 +637,7 @@ async def update( "oauth_client_id": oauth_client_id, "oauth_plaintext_client_secret": oauth_plaintext_client_secret, "pat": pat, + "virtual_directory": virtual_directory, }, scm_integration_update_params.ScmIntegrationUpdateParams, ), diff --git a/src/gitpod/resources/runners/runners.py b/src/gitpod/resources/runners/runners.py index 5b44c562..1c445f8e 100644 --- a/src/gitpod/resources/runners/runners.py +++ b/src/gitpod/resources/runners/runners.py @@ -8,14 +8,17 @@ from ...types import ( RunnerKind, + SearchMode, RunnerProvider, runner_list_params, runner_create_params, runner_delete_params, runner_update_params, runner_retrieve_params, + runner_create_logs_token_params, runner_parse_context_url_params, runner_create_runner_token_params, + runner_search_repositories_params, runner_check_authentication_for_host_params, ) from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given @@ -40,6 +43,7 @@ from ..._base_client import AsyncPaginator, make_request_options from ...types.runner import Runner from ...types.runner_kind import RunnerKind +from ...types.search_mode import SearchMode from ...types.runner_provider import RunnerProvider from ...types.runner_spec_param import RunnerSpecParam from .configurations.configurations import ( @@ -52,8 +56,10 @@ ) from ...types.runner_create_response import RunnerCreateResponse from ...types.runner_retrieve_response import RunnerRetrieveResponse +from ...types.runner_create_logs_token_response import RunnerCreateLogsTokenResponse from ...types.runner_parse_context_url_response import RunnerParseContextURLResponse from ...types.runner_create_runner_token_response import RunnerCreateRunnerTokenResponse +from ...types.runner_search_repositories_response import RunnerSearchRepositoriesResponse from ...types.runner_check_authentication_for_host_response import RunnerCheckAuthenticationForHostResponse __all__ = ["RunnersResource", "AsyncRunnersResource"] @@ -502,6 +508,54 @@ def check_authentication_for_host( cast_to=RunnerCheckAuthenticationForHostResponse, ) + def create_logs_token( + self, + *, + runner_id: str | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> RunnerCreateLogsTokenResponse: + """ + Creates an access token for runner logs and debug information. + + Generated tokens are valid for one hour and provide runner-specific access + permissions. The token is scoped to a specific runner and can be used to access + support bundles. + + ### Examples + + - Generate runner logs token: + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` + + Args: + runner_id: runner_id specifies the runner for which the logs token should be created. + + +required + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.RunnerService/CreateRunnerLogsToken", + body=maybe_transform({"runner_id": runner_id}, runner_create_logs_token_params.RunnerCreateLogsTokenParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RunnerCreateLogsTokenResponse, + ) + def create_runner_token( self, *, @@ -616,6 +670,94 @@ def parse_context_url( cast_to=RunnerParseContextURLResponse, ) + def search_repositories( + self, + *, + limit: int | Omit = omit, + pagination: runner_search_repositories_params.Pagination | Omit = omit, + runner_id: str | Omit = omit, + scm_host: str | Omit = omit, + search_mode: SearchMode | Omit = omit, + search_string: str | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> RunnerSearchRepositoriesResponse: + """ + Searches for repositories across all authenticated SCM hosts. + + Use this method to: + + - List available repositories + - Search repositories by name or content + - Discover repositories for environment creation + + Returns repositories from all authenticated SCM hosts in natural sort order. If + no repositories are found, returns an empty list. + + ### Examples + + - List all repositories: + + Returns up to 25 repositories from all authenticated hosts. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` + + - Search repositories: + + Searches for repositories matching the query across all hosts. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + searchString: "my-project" + limit: 10 + ``` + + Args: + limit: + Maximum number of repositories to return. Default: 25, Maximum: 100 Deprecated: + Use pagination.page_size instead + + pagination: Pagination parameters for repository search + + scm_host: The SCM's host to retrieve repositories from + + search_mode: Search mode determines how search_string is interpreted + + search_string: Search query - interpretation depends on search_mode + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.RunnerService/SearchRepositories", + body=maybe_transform( + { + "limit": limit, + "pagination": pagination, + "runner_id": runner_id, + "scm_host": scm_host, + "search_mode": search_mode, + "search_string": search_string, + }, + runner_search_repositories_params.RunnerSearchRepositoriesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RunnerSearchRepositoriesResponse, + ) + class AsyncRunnersResource(AsyncAPIResource): @cached_property @@ -1060,6 +1202,56 @@ async def check_authentication_for_host( cast_to=RunnerCheckAuthenticationForHostResponse, ) + async def create_logs_token( + self, + *, + runner_id: str | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> RunnerCreateLogsTokenResponse: + """ + Creates an access token for runner logs and debug information. + + Generated tokens are valid for one hour and provide runner-specific access + permissions. The token is scoped to a specific runner and can be used to access + support bundles. + + ### Examples + + - Generate runner logs token: + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` + + Args: + runner_id: runner_id specifies the runner for which the logs token should be created. + + +required + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.RunnerService/CreateRunnerLogsToken", + body=await async_maybe_transform( + {"runner_id": runner_id}, runner_create_logs_token_params.RunnerCreateLogsTokenParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RunnerCreateLogsTokenResponse, + ) + async def create_runner_token( self, *, @@ -1174,6 +1366,94 @@ async def parse_context_url( cast_to=RunnerParseContextURLResponse, ) + async def search_repositories( + self, + *, + limit: int | Omit = omit, + pagination: runner_search_repositories_params.Pagination | Omit = omit, + runner_id: str | Omit = omit, + scm_host: str | Omit = omit, + search_mode: SearchMode | Omit = omit, + search_string: str | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> RunnerSearchRepositoriesResponse: + """ + Searches for repositories across all authenticated SCM hosts. + + Use this method to: + + - List available repositories + - Search repositories by name or content + - Discover repositories for environment creation + + Returns repositories from all authenticated SCM hosts in natural sort order. If + no repositories are found, returns an empty list. + + ### Examples + + - List all repositories: + + Returns up to 25 repositories from all authenticated hosts. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` + + - Search repositories: + + Searches for repositories matching the query across all hosts. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + searchString: "my-project" + limit: 10 + ``` + + Args: + limit: + Maximum number of repositories to return. Default: 25, Maximum: 100 Deprecated: + Use pagination.page_size instead + + pagination: Pagination parameters for repository search + + scm_host: The SCM's host to retrieve repositories from + + search_mode: Search mode determines how search_string is interpreted + + search_string: Search query - interpretation depends on search_mode + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.RunnerService/SearchRepositories", + body=await async_maybe_transform( + { + "limit": limit, + "pagination": pagination, + "runner_id": runner_id, + "scm_host": scm_host, + "search_mode": search_mode, + "search_string": search_string, + }, + runner_search_repositories_params.RunnerSearchRepositoriesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RunnerSearchRepositoriesResponse, + ) + class RunnersResourceWithRawResponse: def __init__(self, runners: RunnersResource) -> None: @@ -1197,12 +1477,18 @@ def __init__(self, runners: RunnersResource) -> None: self.check_authentication_for_host = to_raw_response_wrapper( runners.check_authentication_for_host, ) + self.create_logs_token = to_raw_response_wrapper( + runners.create_logs_token, + ) self.create_runner_token = to_raw_response_wrapper( runners.create_runner_token, ) self.parse_context_url = to_raw_response_wrapper( runners.parse_context_url, ) + self.search_repositories = to_raw_response_wrapper( + runners.search_repositories, + ) @cached_property def configurations(self) -> ConfigurationsResourceWithRawResponse: @@ -1235,12 +1521,18 @@ def __init__(self, runners: AsyncRunnersResource) -> None: self.check_authentication_for_host = async_to_raw_response_wrapper( runners.check_authentication_for_host, ) + self.create_logs_token = async_to_raw_response_wrapper( + runners.create_logs_token, + ) self.create_runner_token = async_to_raw_response_wrapper( runners.create_runner_token, ) self.parse_context_url = async_to_raw_response_wrapper( runners.parse_context_url, ) + self.search_repositories = async_to_raw_response_wrapper( + runners.search_repositories, + ) @cached_property def configurations(self) -> AsyncConfigurationsResourceWithRawResponse: @@ -1273,12 +1565,18 @@ def __init__(self, runners: RunnersResource) -> None: self.check_authentication_for_host = to_streamed_response_wrapper( runners.check_authentication_for_host, ) + self.create_logs_token = to_streamed_response_wrapper( + runners.create_logs_token, + ) self.create_runner_token = to_streamed_response_wrapper( runners.create_runner_token, ) self.parse_context_url = to_streamed_response_wrapper( runners.parse_context_url, ) + self.search_repositories = to_streamed_response_wrapper( + runners.search_repositories, + ) @cached_property def configurations(self) -> ConfigurationsResourceWithStreamingResponse: @@ -1311,12 +1609,18 @@ def __init__(self, runners: AsyncRunnersResource) -> None: self.check_authentication_for_host = async_to_streamed_response_wrapper( runners.check_authentication_for_host, ) + self.create_logs_token = async_to_streamed_response_wrapper( + runners.create_logs_token, + ) self.create_runner_token = async_to_streamed_response_wrapper( runners.create_runner_token, ) self.parse_context_url = async_to_streamed_response_wrapper( runners.parse_context_url, ) + self.search_repositories = async_to_streamed_response_wrapper( + runners.search_repositories, + ) @cached_property def configurations(self) -> AsyncConfigurationsResourceWithStreamingResponse: diff --git a/src/gitpod/resources/secrets.py b/src/gitpod/resources/secrets.py index 16dcd675..6367df25 100644 --- a/src/gitpod/resources/secrets.py +++ b/src/gitpod/resources/secrets.py @@ -54,6 +54,7 @@ def with_streaming_response(self) -> SecretsResourceWithStreamingResponse: def create( self, *, + api_only: bool | Omit = omit, container_registry_basic_auth_host: str | Omit = omit, environment_variable: bool | Omit = omit, file_path: str | Omit = omit, @@ -114,6 +115,10 @@ def create( ``` Args: + api_only: api_only indicates the secret is only available via API/CLI. These secrets are + NOT automatically injected into services or devcontainers. Useful for secrets + that should only be consumed programmatically (e.g., by security agents). + container_registry_basic_auth_host: secret will be mounted as a docker config in the environment VM, mount will have the docker registry host @@ -145,6 +150,7 @@ def create( "/gitpod.v1.SecretService/CreateSecret", body=maybe_transform( { + "api_only": api_only, "container_registry_basic_auth_host": container_registry_basic_auth_host, "environment_variable": environment_variable, "file_path": file_path, @@ -424,6 +430,7 @@ def with_streaming_response(self) -> AsyncSecretsResourceWithStreamingResponse: async def create( self, *, + api_only: bool | Omit = omit, container_registry_basic_auth_host: str | Omit = omit, environment_variable: bool | Omit = omit, file_path: str | Omit = omit, @@ -484,6 +491,10 @@ async def create( ``` Args: + api_only: api_only indicates the secret is only available via API/CLI. These secrets are + NOT automatically injected into services or devcontainers. Useful for secrets + that should only be consumed programmatically (e.g., by security agents). + container_registry_basic_auth_host: secret will be mounted as a docker config in the environment VM, mount will have the docker registry host @@ -515,6 +526,7 @@ async def create( "/gitpod.v1.SecretService/CreateSecret", body=await async_maybe_transform( { + "api_only": api_only, "container_registry_basic_auth_host": container_registry_basic_auth_host, "environment_variable": environment_variable, "file_path": file_path, diff --git a/src/gitpod/resources/users/users.py b/src/gitpod/resources/users/users.py index 2fae4522..4303cf66 100644 --- a/src/gitpod/resources/users/users.py +++ b/src/gitpod/resources/users/users.py @@ -12,7 +12,12 @@ PatsResourceWithStreamingResponse, AsyncPatsResourceWithStreamingResponse, ) -from ...types import user_set_suspended_params, user_get_authenticated_user_params +from ...types import ( + user_get_user_params, + user_delete_user_params, + user_set_suspended_params, + user_get_authenticated_user_params, +) from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from .dotfiles import ( @@ -32,6 +37,7 @@ async_to_streamed_response_wrapper, ) from ..._base_client import make_request_options +from ...types.user_get_user_response import UserGetUserResponse from ...types.user_get_authenticated_user_response import UserGetAuthenticatedUserResponse __all__ = ["UsersResource", "AsyncUsersResource"] @@ -65,6 +71,40 @@ def with_streaming_response(self) -> UsersResourceWithStreamingResponse: """ return UsersResourceWithStreamingResponse(self) + def delete_user( + self, + *, + user_id: str | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """Deletes a user. + + If the User comes from an organization's SSO provider, the + Account will also be deleted. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.UserService/DeleteUser", + body=maybe_transform({"user_id": user_id}, user_delete_user_params.UserDeleteUserParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + def get_authenticated_user( self, *, @@ -114,6 +154,54 @@ def get_authenticated_user( cast_to=UserGetAuthenticatedUserResponse, ) + def get_user( + self, + *, + user_id: str | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> UserGetUserResponse: + """ + Gets basic information about a specific user by their ID. + + Use this method to: + + - Retrieve user profile information + - Get user details for display purposes + - Fetch user metadata for administrative tasks + + ### Examples + + - Get user by ID: + + Retrieves basic user information by user ID. + + ```yaml + userId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/gitpod.v1.UserService/GetUser", + body=maybe_transform({"user_id": user_id}, user_get_user_params.UserGetUserParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=UserGetUserResponse, + ) + def set_suspended( self, *, @@ -208,6 +296,40 @@ def with_streaming_response(self) -> AsyncUsersResourceWithStreamingResponse: """ return AsyncUsersResourceWithStreamingResponse(self) + async def delete_user( + self, + *, + user_id: str | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: + """Deletes a user. + + If the User comes from an organization's SSO provider, the + Account will also be deleted. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.UserService/DeleteUser", + body=await async_maybe_transform({"user_id": user_id}, user_delete_user_params.UserDeleteUserParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + async def get_authenticated_user( self, *, @@ -259,6 +381,54 @@ async def get_authenticated_user( cast_to=UserGetAuthenticatedUserResponse, ) + async def get_user( + self, + *, + user_id: str | Omit = omit, + # 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> UserGetUserResponse: + """ + Gets basic information about a specific user by their ID. + + Use this method to: + + - Retrieve user profile information + - Get user details for display purposes + - Fetch user metadata for administrative tasks + + ### Examples + + - Get user by ID: + + Retrieves basic user information by user ID. + + ```yaml + userId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + ``` + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/gitpod.v1.UserService/GetUser", + body=await async_maybe_transform({"user_id": user_id}, user_get_user_params.UserGetUserParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=UserGetUserResponse, + ) + async def set_suspended( self, *, @@ -329,9 +499,15 @@ class UsersResourceWithRawResponse: def __init__(self, users: UsersResource) -> None: self._users = users + self.delete_user = to_raw_response_wrapper( + users.delete_user, + ) self.get_authenticated_user = to_raw_response_wrapper( users.get_authenticated_user, ) + self.get_user = to_raw_response_wrapper( + users.get_user, + ) self.set_suspended = to_raw_response_wrapper( users.set_suspended, ) @@ -349,9 +525,15 @@ class AsyncUsersResourceWithRawResponse: def __init__(self, users: AsyncUsersResource) -> None: self._users = users + self.delete_user = async_to_raw_response_wrapper( + users.delete_user, + ) self.get_authenticated_user = async_to_raw_response_wrapper( users.get_authenticated_user, ) + self.get_user = async_to_raw_response_wrapper( + users.get_user, + ) self.set_suspended = async_to_raw_response_wrapper( users.set_suspended, ) @@ -369,9 +551,15 @@ class UsersResourceWithStreamingResponse: def __init__(self, users: UsersResource) -> None: self._users = users + self.delete_user = to_streamed_response_wrapper( + users.delete_user, + ) self.get_authenticated_user = to_streamed_response_wrapper( users.get_authenticated_user, ) + self.get_user = to_streamed_response_wrapper( + users.get_user, + ) self.set_suspended = to_streamed_response_wrapper( users.set_suspended, ) @@ -389,9 +577,15 @@ class AsyncUsersResourceWithStreamingResponse: def __init__(self, users: AsyncUsersResource) -> None: self._users = users + self.delete_user = async_to_streamed_response_wrapper( + users.delete_user, + ) self.get_authenticated_user = async_to_streamed_response_wrapper( users.get_authenticated_user, ) + self.get_user = async_to_streamed_response_wrapper( + users.get_user, + ) self.set_suspended = async_to_streamed_response_wrapper( users.set_suspended, ) diff --git a/src/gitpod/types/__init__.py b/src/gitpod/types/__init__.py index cfa1c5d7..c3748784 100644 --- a/src/gitpod/types/__init__.py +++ b/src/gitpod/types/__init__.py @@ -5,6 +5,7 @@ from .user import User as User from .group import Group as Group from .editor import Editor as Editor +from .prompt import Prompt as Prompt from .runner import Runner as Runner from .secret import Secret as Secret from .shared import ( @@ -15,8 +16,10 @@ TaskSpec as TaskSpec, ErrorCode as ErrorCode, Principal as Principal, + SecretRef as SecretRef, FieldValue as FieldValue, UserStatus as UserStatus, + ResourceType as ResourceType, TaskMetadata as TaskMetadata, TaskExecution as TaskExecution, EnvironmentClass as EnvironmentClass, @@ -26,54 +29,87 @@ TaskExecutionPhase as TaskExecutionPhase, TaskExecutionStatus as TaskExecutionStatus, TaskExecutionMetadata as TaskExecutionMetadata, + EnvironmentVariableItem as EnvironmentVariableItem, + ProjectEnvironmentClass as ProjectEnvironmentClass, + EnvironmentVariableSource as EnvironmentVariableSource, ) from .account import Account as Account from .project import Project as Project +from .prebuild import Prebuild as Prebuild from .log_level import LogLevel as LogLevel +from .agent_mode import AgentMode as AgentMode from .environment import Environment as Environment +from .error_level import ErrorLevel as ErrorLevel +from .prompt_spec import PromptSpec as PromptSpec from .runner_kind import RunnerKind as RunnerKind from .runner_spec import RunnerSpec as RunnerSpec +from .search_mode import SearchMode as SearchMode from .gateway_info import GatewayInfo as GatewayInfo from .organization import Organization as Organization from .runner_phase import RunnerPhase as RunnerPhase from .secret_scope import SecretScope as SecretScope -from .resource_type import ResourceType as ResourceType +from .prebuild_spec import PrebuildSpec as PrebuildSpec +from .project_phase import ProjectPhase as ProjectPhase from .runner_status import RunnerStatus as RunnerStatus +from .editor_version import EditorVersion as EditorVersion from .invite_domains import InviteDomains as InviteDomains from .login_provider import LoginProvider as LoginProvider +from .prebuild_phase import PrebuildPhase as PrebuildPhase +from .runner_variant import RunnerVariant as RunnerVariant from .admission_level import AdmissionLevel as AdmissionLevel +from .agent_execution import AgentExecution as AgentExecution +from .prebuild_status import PrebuildStatus as PrebuildStatus +from .prompt_metadata import PromptMetadata as PromptMetadata from .runner_provider import RunnerProvider as RunnerProvider +from .breadcrumb_param import BreadcrumbParam as BreadcrumbParam +from .environment_role import EnvironmentRole as EnvironmentRole from .environment_spec import EnvironmentSpec as EnvironmentSpec from .id_token_version import IDTokenVersion as IDTokenVersion +from .prebuild_trigger import PrebuildTrigger as PrebuildTrigger from .project_metadata import ProjectMetadata as ProjectMetadata from .environment_phase import EnvironmentPhase as EnvironmentPhase +from .error_event_param import ErrorEventParam as ErrorEventParam from .event_list_params import EventListParams as EventListParams from .group_list_params import GroupListParams as GroupListParams from .organization_tier import OrganizationTier as OrganizationTier +from .prebuild_metadata import PrebuildMetadata as PrebuildMetadata from .runner_capability import RunnerCapability as RunnerCapability from .runner_spec_param import RunnerSpecParam as RunnerSpecParam +from .stack_frame_param import StackFrameParam as StackFrameParam from .account_membership import AccountMembership as AccountMembership +from .agent_code_context import AgentCodeContext as AgentCodeContext from .editor_list_params import EditorListParams as EditorListParams from .environment_status import EnvironmentStatus as EnvironmentStatus from .event_watch_params import EventWatchParams as EventWatchParams +from .request_info_param import RequestInfoParam as RequestInfoParam from .resource_operation import ResourceOperation as ResourceOperation from .runner_list_params import RunnerListParams as RunnerListParams from .secret_list_params import SecretListParams as SecretListParams from .secret_scope_param import SecretScopeParam as SecretScopeParam from .event_list_response import EventListResponse as EventListResponse from .gateway_list_params import GatewayListParams as GatewayListParams +from .group_create_params import GroupCreateParams as GroupCreateParams +from .group_delete_params import GroupDeleteParams as GroupDeleteParams +from .group_update_params import GroupUpdateParams as GroupUpdateParams from .organization_member import OrganizationMember as OrganizationMember +from .prebuild_spec_param import PrebuildSpecParam as PrebuildSpecParam from .project_list_params import ProjectListParams as ProjectListParams from .environment_metadata import EnvironmentMetadata as EnvironmentMetadata from .event_watch_response import EventWatchResponse as EventWatchResponse +from .exception_info_param import ExceptionInfoParam as ExceptionInfoParam from .invite_domains_param import InviteDomainsParam as InviteDomainsParam +from .prebuild_list_params import PrebuildListParams as PrebuildListParams from .runner_configuration import RunnerConfiguration as RunnerConfiguration from .runner_create_params import RunnerCreateParams as RunnerCreateParams from .runner_delete_params import RunnerDeleteParams as RunnerDeleteParams from .runner_update_params import RunnerUpdateParams as RunnerUpdateParams from .secret_create_params import SecretCreateParams as SecretCreateParams from .secret_delete_params import SecretDeleteParams as SecretDeleteParams +from .user_get_user_params import UserGetUserParams as UserGetUserParams from .account_delete_params import AccountDeleteParams as AccountDeleteParams +from .group_create_response import GroupCreateResponse as GroupCreateResponse +from .group_retrieve_params import GroupRetrieveParams as GroupRetrieveParams +from .group_update_response import GroupUpdateResponse as GroupUpdateResponse from .joinable_organization import JoinableOrganization as JoinableOrganization from .metrics_configuration import MetricsConfiguration as MetricsConfiguration from .project_create_params import ProjectCreateParams as ProjectCreateParams @@ -81,69 +117,107 @@ from .project_update_params import ProjectUpdateParams as ProjectUpdateParams from .editor_retrieve_params import EditorRetrieveParams as EditorRetrieveParams from .environment_spec_param import EnvironmentSpecParam as EnvironmentSpecParam +from .prebuild_cancel_params import PrebuildCancelParams as PrebuildCancelParams +from .prebuild_create_params import PrebuildCreateParams as PrebuildCreateParams +from .prebuild_delete_params import PrebuildDeleteParams as PrebuildDeleteParams from .runner_create_response import RunnerCreateResponse as RunnerCreateResponse from .runner_release_channel import RunnerReleaseChannel as RunnerReleaseChannel from .runner_retrieve_params import RunnerRetrieveParams as RunnerRetrieveParams from .secret_create_response import SecretCreateResponse as SecretCreateResponse +from .user_get_user_response import UserGetUserResponse as UserGetUserResponse +from .user_input_block_param import UserInputBlockParam as UserInputBlockParam from .account_retrieve_params import AccountRetrieveParams as AccountRetrieveParams from .environment_initializer import EnvironmentInitializer as EnvironmentInitializer from .environment_list_params import EnvironmentListParams as EnvironmentListParams from .environment_stop_params import EnvironmentStopParams as EnvironmentStopParams +from .group_retrieve_response import GroupRetrieveResponse as GroupRetrieveResponse from .project_create_response import ProjectCreateResponse as ProjectCreateResponse from .project_retrieve_params import ProjectRetrieveParams as ProjectRetrieveParams from .project_update_response import ProjectUpdateResponse as ProjectUpdateResponse from .secret_get_value_params import SecretGetValueParams as SecretGetValueParams +from .user_delete_user_params import UserDeleteUserParams as UserDeleteUserParams +from .agent_code_context_param import AgentCodeContextParam as AgentCodeContextParam from .editor_retrieve_response import EditorRetrieveResponse as EditorRetrieveResponse from .environment_start_params import EnvironmentStartParams as EnvironmentStartParams from .environment_usage_record import EnvironmentUsageRecord as EnvironmentUsageRecord from .organization_join_params import OrganizationJoinParams as OrganizationJoinParams +from .prebuild_cancel_response import PrebuildCancelResponse as PrebuildCancelResponse +from .prebuild_create_response import PrebuildCreateResponse as PrebuildCreateResponse +from .prebuild_retrieve_params import PrebuildRetrieveParams as PrebuildRetrieveParams from .runner_retrieve_response import RunnerRetrieveResponse as RunnerRetrieveResponse from .account_retrieve_response import AccountRetrieveResponse as AccountRetrieveResponse +from .agent_list_prompts_params import AgentListPromptsParams as AgentListPromptsParams from .editor_resolve_url_params import EditorResolveURLParams as EditorResolveURLParams from .environment_create_params import EnvironmentCreateParams as EnvironmentCreateParams from .environment_delete_params import EnvironmentDeleteParams as EnvironmentDeleteParams from .environment_update_params import EnvironmentUpdateParams as EnvironmentUpdateParams +from .exception_mechanism_param import ExceptionMechanismParam as ExceptionMechanismParam from .organization_leave_params import OrganizationLeaveParams as OrganizationLeaveParams -from .project_environment_class import ProjectEnvironmentClass as ProjectEnvironmentClass from .project_retrieve_response import ProjectRetrieveResponse as ProjectRetrieveResponse from .secret_get_value_response import SecretGetValueResponse as SecretGetValueResponse from .user_set_suspended_params import UserSetSuspendedParams as UserSetSuspendedParams +from .agent_create_prompt_params import AgentCreatePromptParams as AgentCreatePromptParams +from .agent_delete_prompt_params import AgentDeletePromptParams as AgentDeletePromptParams +from .agent_update_prompt_params import AgentUpdatePromptParams as AgentUpdatePromptParams +from .error_report_errors_params import ErrorReportErrorsParams as ErrorReportErrorsParams from .organization_create_params import OrganizationCreateParams as OrganizationCreateParams from .organization_delete_params import OrganizationDeleteParams as OrganizationDeleteParams from .organization_join_response import OrganizationJoinResponse as OrganizationJoinResponse from .organization_update_params import OrganizationUpdateParams as OrganizationUpdateParams +from .prebuild_retrieve_response import PrebuildRetrieveResponse as PrebuildRetrieveResponse from .runner_configuration_param import RunnerConfigurationParam as RunnerConfigurationParam from .secret_update_value_params import SecretUpdateValueParams as SecretUpdateValueParams +from .agent_stop_execution_params import AgentStopExecutionParams as AgentStopExecutionParams from .editor_resolve_url_response import EditorResolveURLResponse as EditorResolveURLResponse from .environment_activity_signal import EnvironmentActivitySignal as EnvironmentActivitySignal from .environment_create_response import EnvironmentCreateResponse as EnvironmentCreateResponse from .environment_retrieve_params import EnvironmentRetrieveParams as EnvironmentRetrieveParams from .metrics_configuration_param import MetricsConfigurationParam as MetricsConfigurationParam +from .agent_create_prompt_response import AgentCreatePromptResponse as AgentCreatePromptResponse +from .agent_list_executions_params import AgentListExecutionsParams as AgentListExecutionsParams +from .agent_retrieve_prompt_params import AgentRetrievePromptParams as AgentRetrievePromptParams +from .agent_start_execution_params import AgentStartExecutionParams as AgentStartExecutionParams +from .agent_update_prompt_response import AgentUpdatePromptResponse as AgentUpdatePromptResponse from .environment_unarchive_params import EnvironmentUnarchiveParams as EnvironmentUnarchiveParams from .identity_get_id_token_params import IdentityGetIDTokenParams as IdentityGetIDTokenParams from .organization_create_response import OrganizationCreateResponse as OrganizationCreateResponse from .organization_retrieve_params import OrganizationRetrieveParams as OrganizationRetrieveParams from .organization_set_role_params import OrganizationSetRoleParams as OrganizationSetRoleParams from .organization_update_response import OrganizationUpdateResponse as OrganizationUpdateResponse +from .agent_delete_execution_params import AgentDeleteExecutionParams as AgentDeleteExecutionParams from .environment_initializer_param import EnvironmentInitializerParam as EnvironmentInitializerParam from .environment_retrieve_response import EnvironmentRetrieveResponse as EnvironmentRetrieveResponse +from .account_list_sso_logins_params import AccountListSSOLoginsParams as AccountListSSOLoginsParams +from .agent_retrieve_prompt_response import AgentRetrievePromptResponse as AgentRetrievePromptResponse +from .agent_send_to_execution_params import AgentSendToExecutionParams as AgentSendToExecutionParams +from .agent_start_execution_response import AgentStartExecutionResponse as AgentStartExecutionResponse from .environment_mark_active_params import EnvironmentMarkActiveParams as EnvironmentMarkActiveParams from .identity_exchange_token_params import IdentityExchangeTokenParams as IdentityExchangeTokenParams from .identity_get_id_token_response import IdentityGetIDTokenResponse as IdentityGetIDTokenResponse from .organization_retrieve_response import OrganizationRetrieveResponse as OrganizationRetrieveResponse -from .project_environment_class_param import ProjectEnvironmentClassParam as ProjectEnvironmentClassParam +from .project_prebuild_configuration import ProjectPrebuildConfiguration as ProjectPrebuildConfiguration +from .agent_retrieve_execution_params import AgentRetrieveExecutionParams as AgentRetrieveExecutionParams +from .runner_create_logs_token_params import RunnerCreateLogsTokenParams as RunnerCreateLogsTokenParams from .runner_parse_context_url_params import RunnerParseContextURLParams as RunnerParseContextURLParams from .account_get_sso_login_url_params import AccountGetSSOLoginURLParams as AccountGetSSOLoginURLParams +from .account_list_sso_logins_response import AccountListSSOLoginsResponse as AccountListSSOLoginsResponse from .identity_exchange_token_response import IdentityExchangeTokenResponse as IdentityExchangeTokenResponse from .organization_list_members_params import OrganizationListMembersParams as OrganizationListMembersParams +from .agent_retrieve_execution_response import AgentRetrieveExecutionResponse as AgentRetrieveExecutionResponse from .environment_activity_signal_param import EnvironmentActivitySignalParam as EnvironmentActivitySignalParam +from .prebuild_create_logs_token_params import PrebuildCreateLogsTokenParams as PrebuildCreateLogsTokenParams +from .runner_create_logs_token_response import RunnerCreateLogsTokenResponse as RunnerCreateLogsTokenResponse from .runner_create_runner_token_params import RunnerCreateRunnerTokenParams as RunnerCreateRunnerTokenParams from .runner_parse_context_url_response import RunnerParseContextURLResponse as RunnerParseContextURLResponse +from .runner_search_repositories_params import RunnerSearchRepositoriesParams as RunnerSearchRepositoriesParams from .account_get_sso_login_url_response import AccountGetSSOLoginURLResponse as AccountGetSSOLoginURLResponse from .user_get_authenticated_user_params import UserGetAuthenticatedUserParams as UserGetAuthenticatedUserParams from .account_list_login_providers_params import AccountListLoginProvidersParams as AccountListLoginProvidersParams +from .prebuild_create_logs_token_response import PrebuildCreateLogsTokenResponse as PrebuildCreateLogsTokenResponse from .runner_create_runner_token_response import RunnerCreateRunnerTokenResponse as RunnerCreateRunnerTokenResponse +from .runner_search_repositories_response import RunnerSearchRepositoriesResponse as RunnerSearchRepositoriesResponse from .environment_create_logs_token_params import EnvironmentCreateLogsTokenParams as EnvironmentCreateLogsTokenParams +from .project_prebuild_configuration_param import ProjectPrebuildConfigurationParam as ProjectPrebuildConfigurationParam from .user_get_authenticated_user_response import UserGetAuthenticatedUserResponse as UserGetAuthenticatedUserResponse from .environment_create_from_project_params import ( EnvironmentCreateFromProjectParams as EnvironmentCreateFromProjectParams, @@ -172,9 +246,6 @@ from .runner_check_authentication_for_host_params import ( RunnerCheckAuthenticationForHostParams as RunnerCheckAuthenticationForHostParams, ) -from .account_list_joinable_organizations_response import ( - AccountListJoinableOrganizationsResponse as AccountListJoinableOrganizationsResponse, -) from .identity_get_authenticated_identity_response import ( IdentityGetAuthenticatedIdentityResponse as IdentityGetAuthenticatedIdentityResponse, ) @@ -187,3 +258,9 @@ from .usage_list_environment_runtime_records_params import ( UsageListEnvironmentRuntimeRecordsParams as UsageListEnvironmentRuntimeRecordsParams, ) +from .agent_create_execution_conversation_token_params import ( + AgentCreateExecutionConversationTokenParams as AgentCreateExecutionConversationTokenParams, +) +from .agent_create_execution_conversation_token_response import ( + AgentCreateExecutionConversationTokenResponse as AgentCreateExecutionConversationTokenResponse, +) diff --git a/src/gitpod/types/account_delete_params.py b/src/gitpod/types/account_delete_params.py index a0491320..9b0ca700 100644 --- a/src/gitpod/types/account_delete_params.py +++ b/src/gitpod/types/account_delete_params.py @@ -2,6 +2,7 @@ from __future__ import annotations +from typing import Optional from typing_extensions import Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -11,3 +12,6 @@ class AccountDeleteParams(TypedDict, total=False): account_id: Required[Annotated[str, PropertyInfo(alias="accountId")]] + + reason: Optional[str] + """reason is an optional field for the reason for account deletion""" diff --git a/src/gitpod/types/account_list_joinable_organizations_params.py b/src/gitpod/types/account_list_joinable_organizations_params.py index d4531fb7..8550eb06 100644 --- a/src/gitpod/types/account_list_joinable_organizations_params.py +++ b/src/gitpod/types/account_list_joinable_organizations_params.py @@ -6,7 +6,7 @@ from .._utils import PropertyInfo -__all__ = ["AccountListJoinableOrganizationsParams"] +__all__ = ["AccountListJoinableOrganizationsParams", "Pagination"] class AccountListJoinableOrganizationsParams(TypedDict, total=False): @@ -14,4 +14,21 @@ class AccountListJoinableOrganizationsParams(TypedDict, total=False): page_size: Annotated[int, PropertyInfo(alias="pageSize")] - empty: bool + pagination: Pagination + """pagination contains the pagination options for listing joinable organizations""" + + +class Pagination(TypedDict, total=False): + """pagination contains the pagination options for listing joinable organizations""" + + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/account_list_joinable_organizations_response.py b/src/gitpod/types/account_list_joinable_organizations_response.py deleted file mode 100644 index 3253ba5c..00000000 --- a/src/gitpod/types/account_list_joinable_organizations_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .._models import BaseModel -from .joinable_organization import JoinableOrganization - -__all__ = ["AccountListJoinableOrganizationsResponse"] - - -class AccountListJoinableOrganizationsResponse(BaseModel): - joinable_organizations: Optional[List[JoinableOrganization]] = FieldInfo( - alias="joinableOrganizations", default=None - ) diff --git a/src/gitpod/types/account_list_login_providers_params.py b/src/gitpod/types/account_list_login_providers_params.py index 87a93493..badbfe8e 100644 --- a/src/gitpod/types/account_list_login_providers_params.py +++ b/src/gitpod/types/account_list_login_providers_params.py @@ -2,6 +2,7 @@ from __future__ import annotations +from typing import Optional from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo @@ -24,7 +25,10 @@ class AccountListLoginProvidersParams(TypedDict, total=False): class Filter(TypedDict, total=False): """filter contains the filter options for listing login methods""" - invite_id: Annotated[str, PropertyInfo(alias="inviteId")] + email: Optional[str] + """email is the email address to filter SSO providers by""" + + invite_id: Annotated[Optional[str], PropertyInfo(alias="inviteId")] """invite_id is the ID of the invite URL the user wants to login with""" diff --git a/src/gitpod/types/account_list_sso_logins_params.py b/src/gitpod/types/account_list_sso_logins_params.py new file mode 100644 index 00000000..970e6ba4 --- /dev/null +++ b/src/gitpod/types/account_list_sso_logins_params.py @@ -0,0 +1,41 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["AccountListSSOLoginsParams", "Pagination"] + + +class AccountListSSOLoginsParams(TypedDict, total=False): + email: Required[str] + """email is the email the user wants to login with""" + + token: str + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + + pagination: Pagination + """pagination contains the pagination options for listing SSO logins""" + + return_to: Annotated[Optional[str], PropertyInfo(alias="returnTo")] + """return_to is the URL the user will be redirected to after login""" + + +class Pagination(TypedDict, total=False): + """pagination contains the pagination options for listing SSO logins""" + + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/account_list_sso_logins_response.py b/src/gitpod/types/account_list_sso_logins_response.py new file mode 100644 index 00000000..253f0f87 --- /dev/null +++ b/src/gitpod/types/account_list_sso_logins_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["AccountListSSOLoginsResponse"] + + +class AccountListSSOLoginsResponse(BaseModel): + display_name: str = FieldInfo(alias="displayName") + """provider is the provider used by this login method, e.g. + + "github", "google", "custom" + """ + + login_url: str = FieldInfo(alias="loginUrl") + """login_url is the URL to redirect the user to for SSO login""" diff --git a/src/gitpod/types/agent_code_context.py b/src/gitpod/types/agent_code_context.py new file mode 100644 index 00000000..05c18322 --- /dev/null +++ b/src/gitpod/types/agent_code_context.py @@ -0,0 +1,71 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["AgentCodeContext", "ContextURL", "PullRequest", "PullRequestRepository"] + + +class ContextURL(BaseModel): + environment_class_id: Optional[str] = FieldInfo(alias="environmentClassId", default=None) + + url: Optional[str] = None + + +class PullRequestRepository(BaseModel): + """Repository information""" + + clone_url: Optional[str] = FieldInfo(alias="cloneUrl", default=None) + + host: Optional[str] = None + + name: Optional[str] = None + + owner: Optional[str] = None + + +class PullRequest(BaseModel): + """ + Pull request context - optional metadata about the PR being worked on + This is populated when the agent execution is triggered by a PR workflow + or when explicitly provided through the browser extension + """ + + id: Optional[str] = None + """Unique identifier from the source system (e.g., "123" for GitHub PR #123)""" + + author: Optional[str] = None + """Author name as provided by the SCM system""" + + from_branch: Optional[str] = FieldInfo(alias="fromBranch", default=None) + """Source branch name (the branch being merged from)""" + + repository: Optional[PullRequestRepository] = None + """Repository information""" + + title: Optional[str] = None + """Pull request title""" + + to_branch: Optional[str] = FieldInfo(alias="toBranch", default=None) + """Target branch name (the branch being merged into)""" + + url: Optional[str] = None + """Pull request URL (e.g., "https://github.com/owner/repo/pull/123")""" + + +class AgentCodeContext(BaseModel): + context_url: Optional[ContextURL] = FieldInfo(alias="contextUrl", default=None) + + environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) + + project_id: Optional[str] = FieldInfo(alias="projectId", default=None) + + pull_request: Optional[PullRequest] = FieldInfo(alias="pullRequest", default=None) + """ + Pull request context - optional metadata about the PR being worked on This is + populated when the agent execution is triggered by a PR workflow or when + explicitly provided through the browser extension + """ diff --git a/src/gitpod/types/agent_code_context_param.py b/src/gitpod/types/agent_code_context_param.py new file mode 100644 index 00000000..8080145f --- /dev/null +++ b/src/gitpod/types/agent_code_context_param.py @@ -0,0 +1,72 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["AgentCodeContextParam", "ContextURL", "PullRequest", "PullRequestRepository"] + + +class ContextURL(TypedDict, total=False): + environment_class_id: Annotated[str, PropertyInfo(alias="environmentClassId")] + + url: str + + +class PullRequestRepository(TypedDict, total=False): + """Repository information""" + + clone_url: Annotated[str, PropertyInfo(alias="cloneUrl")] + + host: str + + name: str + + owner: str + + +class PullRequest(TypedDict, total=False): + """ + Pull request context - optional metadata about the PR being worked on + This is populated when the agent execution is triggered by a PR workflow + or when explicitly provided through the browser extension + """ + + id: str + """Unique identifier from the source system (e.g., "123" for GitHub PR #123)""" + + author: str + """Author name as provided by the SCM system""" + + from_branch: Annotated[str, PropertyInfo(alias="fromBranch")] + """Source branch name (the branch being merged from)""" + + repository: PullRequestRepository + """Repository information""" + + title: str + """Pull request title""" + + to_branch: Annotated[str, PropertyInfo(alias="toBranch")] + """Target branch name (the branch being merged into)""" + + url: str + """Pull request URL (e.g., "https://github.com/owner/repo/pull/123")""" + + +class AgentCodeContextParam(TypedDict, total=False): + context_url: Annotated[ContextURL, PropertyInfo(alias="contextUrl")] + + environment_id: Annotated[str, PropertyInfo(alias="environmentId")] + + project_id: Annotated[str, PropertyInfo(alias="projectId")] + + pull_request: Annotated[Optional[PullRequest], PropertyInfo(alias="pullRequest")] + """ + Pull request context - optional metadata about the PR being worked on This is + populated when the agent execution is triggered by a PR workflow or when + explicitly provided through the browser extension + """ diff --git a/src/gitpod/types/agent_create_execution_conversation_token_params.py b/src/gitpod/types/agent_create_execution_conversation_token_params.py new file mode 100644 index 00000000..68a8988a --- /dev/null +++ b/src/gitpod/types/agent_create_execution_conversation_token_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["AgentCreateExecutionConversationTokenParams"] + + +class AgentCreateExecutionConversationTokenParams(TypedDict, total=False): + agent_execution_id: Annotated[str, PropertyInfo(alias="agentExecutionId")] diff --git a/src/gitpod/types/agent_create_execution_conversation_token_response.py b/src/gitpod/types/agent_create_execution_conversation_token_response.py new file mode 100644 index 00000000..395ddfb7 --- /dev/null +++ b/src/gitpod/types/agent_create_execution_conversation_token_response.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .._models import BaseModel + +__all__ = ["AgentCreateExecutionConversationTokenResponse"] + + +class AgentCreateExecutionConversationTokenResponse(BaseModel): + token: Optional[str] = None diff --git a/src/gitpod/types/agent_create_prompt_params.py b/src/gitpod/types/agent_create_prompt_params.py new file mode 100644 index 00000000..c5b22317 --- /dev/null +++ b/src/gitpod/types/agent_create_prompt_params.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["AgentCreatePromptParams"] + + +class AgentCreatePromptParams(TypedDict, total=False): + command: str + + description: str + + is_command: Annotated[bool, PropertyInfo(alias="isCommand")] + + is_template: Annotated[bool, PropertyInfo(alias="isTemplate")] + + name: str + + prompt: str diff --git a/src/gitpod/types/agent_create_prompt_response.py b/src/gitpod/types/agent_create_prompt_response.py new file mode 100644 index 00000000..ef5b625b --- /dev/null +++ b/src/gitpod/types/agent_create_prompt_response.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .prompt import Prompt +from .._models import BaseModel + +__all__ = ["AgentCreatePromptResponse"] + + +class AgentCreatePromptResponse(BaseModel): + prompt: Optional[Prompt] = None diff --git a/src/gitpod/types/agent_delete_execution_params.py b/src/gitpod/types/agent_delete_execution_params.py new file mode 100644 index 00000000..f5590561 --- /dev/null +++ b/src/gitpod/types/agent_delete_execution_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["AgentDeleteExecutionParams"] + + +class AgentDeleteExecutionParams(TypedDict, total=False): + agent_execution_id: Annotated[str, PropertyInfo(alias="agentExecutionId")] diff --git a/src/gitpod/types/agent_delete_prompt_params.py b/src/gitpod/types/agent_delete_prompt_params.py new file mode 100644 index 00000000..f6cffb7e --- /dev/null +++ b/src/gitpod/types/agent_delete_prompt_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["AgentDeletePromptParams"] + + +class AgentDeletePromptParams(TypedDict, total=False): + prompt_id: Annotated[str, PropertyInfo(alias="promptId")] diff --git a/src/gitpod/types/agent_execution.py b/src/gitpod/types/agent_execution.py new file mode 100644 index 00000000..384da908 --- /dev/null +++ b/src/gitpod/types/agent_execution.py @@ -0,0 +1,439 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from .._models import BaseModel +from .agent_mode import AgentMode +from .shared.subject import Subject +from .agent_code_context import AgentCodeContext + +__all__ = [ + "AgentExecution", + "Metadata", + "Spec", + "SpecLimits", + "Status", + "StatusCurrentOperation", + "StatusCurrentOperationLlm", + "StatusCurrentOperationToolUse", + "StatusOutputs", + "StatusUsedEnvironment", +] + + +class Metadata(BaseModel): + """ + Metadata is data associated with this agent that's required for other + parts of Gitpod to function + """ + + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """ + 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()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[Subject] = None + + description: Optional[str] = None + + name: Optional[str] = None + + role: Optional[ + Literal["AGENT_EXECUTION_ROLE_UNSPECIFIED", "AGENT_EXECUTION_ROLE_DEFAULT", "AGENT_EXECUTION_ROLE_WORKFLOW"] + ] = None + """role is the role of the agent execution""" + + updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) + """ + 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()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + workflow_action_id: Optional[str] = FieldInfo(alias="workflowActionId", default=None) + """ + workflow_action_id is set when this agent execution was created as part of a + workflow. Used to correlate agent executions with their parent workflow + execution action. + """ + + +class SpecLimits(BaseModel): + max_input_tokens: Optional[str] = FieldInfo(alias="maxInputTokens", default=None) + + max_iterations: Optional[str] = FieldInfo(alias="maxIterations", default=None) + + max_output_tokens: Optional[str] = FieldInfo(alias="maxOutputTokens", default=None) + + +class Spec(BaseModel): + """ + Spec is the configuration of the agent that's required for the + runner to start the agent + """ + + agent_id: Optional[str] = FieldInfo(alias="agentId", default=None) + + code_context: Optional[AgentCodeContext] = FieldInfo(alias="codeContext", default=None) + + desired_phase: Optional[ + Literal["PHASE_UNSPECIFIED", "PHASE_PENDING", "PHASE_RUNNING", "PHASE_WAITING_FOR_INPUT", "PHASE_STOPPED"] + ] = FieldInfo(alias="desiredPhase", default=None) + """desired_phase is the desired phase of the agent run""" + + limits: Optional[SpecLimits] = None + + mode: Optional[AgentMode] = None + """mode is the operational mode for this agent execution""" + + session: Optional[str] = None + + spec_version: Optional[str] = FieldInfo(alias="specVersion", default=None) + """version of the spec. + + The value of this field has no semantic meaning (e.g. don't interpret it as as a + timestamp), but it can be used to impose a partial order. If a.spec_version < + b.spec_version then a was the spec before b. + """ + + +class StatusCurrentOperationLlm(BaseModel): + complete: Optional[bool] = None + + +class StatusCurrentOperationToolUse(BaseModel): + complete: Optional[bool] = None + + tool_name: Optional[str] = FieldInfo(alias="toolName", default=None) + + +class StatusCurrentOperation(BaseModel): + """current_operation is the current operation of the agent execution.""" + + llm: Optional[StatusCurrentOperationLlm] = None + + retries: Optional[str] = None + """retries is the number of times the agent run has retried one or more steps""" + + session: Optional[str] = None + + tool_use: Optional[StatusCurrentOperationToolUse] = FieldInfo(alias="toolUse", default=None) + + +class StatusOutputs(BaseModel): + bool_value: Optional[bool] = FieldInfo(alias="boolValue", default=None) + + float_value: Optional[float] = FieldInfo(alias="floatValue", default=None) + + int_value: Optional[str] = FieldInfo(alias="intValue", default=None) + + string_value: Optional[str] = FieldInfo(alias="stringValue", default=None) + + +class StatusUsedEnvironment(BaseModel): + created_by_agent: Optional[bool] = FieldInfo(alias="createdByAgent", default=None) + + environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) + + +class Status(BaseModel): + """Status is the current status of the agent""" + + cached_creation_tokens_used: Optional[str] = FieldInfo(alias="cachedCreationTokensUsed", default=None) + + cached_input_tokens_used: Optional[str] = FieldInfo(alias="cachedInputTokensUsed", default=None) + + context_window_length: Optional[str] = FieldInfo(alias="contextWindowLength", default=None) + + conversation_url: Optional[str] = FieldInfo(alias="conversationUrl", default=None) + """ + conversation_url is the URL to the conversation (all messages exchanged between + the agent and the user) of the agent run. + """ + + current_activity: Optional[str] = FieldInfo(alias="currentActivity", default=None) + """current_activity is the current activity description of the agent execution.""" + + current_operation: Optional[StatusCurrentOperation] = FieldInfo(alias="currentOperation", default=None) + """current_operation is the current operation of the agent execution.""" + + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message contains the reason the agent run failed to operate.""" + + failure_reason: Optional[ + Literal[ + "AGENT_EXECUTION_FAILURE_REASON_UNSPECIFIED", + "AGENT_EXECUTION_FAILURE_REASON_ENVIRONMENT", + "AGENT_EXECUTION_FAILURE_REASON_SERVICE", + "AGENT_EXECUTION_FAILURE_REASON_LLM_INTEGRATION", + "AGENT_EXECUTION_FAILURE_REASON_INTERNAL", + "AGENT_EXECUTION_FAILURE_REASON_AGENT_EXECUTION", + ] + ] = FieldInfo(alias="failureReason", default=None) + """failure_reason contains a structured reason code for the failure.""" + + input_tokens_used: Optional[str] = FieldInfo(alias="inputTokensUsed", default=None) + + iterations: Optional[str] = None + + judgement: Optional[str] = None + """judgement is the judgement of the agent run produced by the judgement prompt.""" + + outputs: Optional[Dict[str, StatusOutputs]] = None + """ + outputs is a map of key-value pairs that can be set by the agent during + execution. Similar to task execution outputs, but with typed values for + structured data. + """ + + output_tokens_used: Optional[str] = FieldInfo(alias="outputTokensUsed", default=None) + + phase: Optional[ + Literal["PHASE_UNSPECIFIED", "PHASE_PENDING", "PHASE_RUNNING", "PHASE_WAITING_FOR_INPUT", "PHASE_STOPPED"] + ] = None + + session: Optional[str] = None + + status_version: Optional[str] = FieldInfo(alias="statusVersion", default=None) + """version of the status. + + The value of this field has no semantic meaning (e.g. don't interpret it as as a + timestamp), but it can be used to impose a partial order. If a.status_version < + b.status_version then a was the status before b. + """ + + supported_model: Optional[ + Literal[ + "SUPPORTED_MODEL_UNSPECIFIED", + "SUPPORTED_MODEL_SONNET_3_5", + "SUPPORTED_MODEL_SONNET_3_7", + "SUPPORTED_MODEL_SONNET_3_7_EXTENDED", + "SUPPORTED_MODEL_SONNET_4", + "SUPPORTED_MODEL_SONNET_4_EXTENDED", + "SUPPORTED_MODEL_SONNET_4_5", + "SUPPORTED_MODEL_SONNET_4_5_EXTENDED", + "SUPPORTED_MODEL_OPUS_4", + "SUPPORTED_MODEL_OPUS_4_EXTENDED", + "SUPPORTED_MODEL_OPUS_4_5", + "SUPPORTED_MODEL_OPUS_4_5_EXTENDED", + "SUPPORTED_MODEL_OPENAI_4O", + "SUPPORTED_MODEL_OPENAI_4O_MINI", + "SUPPORTED_MODEL_OPENAI_O1", + "SUPPORTED_MODEL_OPENAI_O1_MINI", + ] + ] = FieldInfo(alias="supportedModel", default=None) + """supported_model is the LLM model being used by the agent execution.""" + + transcript_url: Optional[str] = FieldInfo(alias="transcriptUrl", default=None) + """ + transcript_url is the URL to the LLM transcript (all messages exchanged between + the agent and the LLM) of the agent run. + """ + + used_environments: Optional[List[StatusUsedEnvironment]] = FieldInfo(alias="usedEnvironments", default=None) + """ + used_environments is the list of environments that were used by the agent + execution. + """ + + warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) + """warning_message contains warnings, e.g. when the LLM is overloaded.""" + + +class AgentExecution(BaseModel): + id: Optional[str] = None + """ID is a unique identifier of this agent run. + + No other agent run with the same name must be managed by this agent manager + """ + + metadata: Optional[Metadata] = None + """ + Metadata is data associated with this agent that's required for other parts of + Gitpod to function + """ + + spec: Optional[Spec] = None + """ + Spec is the configuration of the agent that's required for the runner to start + the agent + """ + + status: Optional[Status] = None + """Status is the current status of the agent""" diff --git a/src/gitpod/types/agent_list_executions_params.py b/src/gitpod/types/agent_list_executions_params.py new file mode 100644 index 00000000..3a613411 --- /dev/null +++ b/src/gitpod/types/agent_list_executions_params.py @@ -0,0 +1,56 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import Literal, Annotated, TypedDict + +from .._types import SequenceNotStr +from .._utils import PropertyInfo + +__all__ = ["AgentListExecutionsParams", "Filter", "Pagination"] + + +class AgentListExecutionsParams(TypedDict, total=False): + token: str + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + + filter: Filter + + pagination: Pagination + + +class Filter(TypedDict, total=False): + agent_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="agentIds")] + + creator_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="creatorIds")] + + environment_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="environmentIds")] + + project_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="projectIds")] + + roles: List[ + Literal["AGENT_EXECUTION_ROLE_UNSPECIFIED", "AGENT_EXECUTION_ROLE_DEFAULT", "AGENT_EXECUTION_ROLE_WORKFLOW"] + ] + + status_phases: Annotated[ + List[ + Literal["PHASE_UNSPECIFIED", "PHASE_PENDING", "PHASE_RUNNING", "PHASE_WAITING_FOR_INPUT", "PHASE_STOPPED"] + ], + PropertyInfo(alias="statusPhases"), + ] + + +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/agent_list_prompts_params.py b/src/gitpod/types/agent_list_prompts_params.py new file mode 100644 index 00000000..9756b72a --- /dev/null +++ b/src/gitpod/types/agent_list_prompts_params.py @@ -0,0 +1,43 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["AgentListPromptsParams", "Filter", "Pagination"] + + +class AgentListPromptsParams(TypedDict, total=False): + token: str + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + + filter: Filter + + pagination: Pagination + + +class Filter(TypedDict, total=False): + command: str + + command_prefix: Annotated[str, PropertyInfo(alias="commandPrefix")] + + is_command: Annotated[bool, PropertyInfo(alias="isCommand")] + + is_template: Annotated[bool, PropertyInfo(alias="isTemplate")] + + +class Pagination(TypedDict, total=False): + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/agent_mode.py b/src/gitpod/types/agent_mode.py new file mode 100644 index 00000000..de414c76 --- /dev/null +++ b/src/gitpod/types/agent_mode.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["AgentMode"] + +AgentMode: TypeAlias = Literal["AGENT_MODE_UNSPECIFIED", "AGENT_MODE_EXECUTION", "AGENT_MODE_PLANNING"] diff --git a/src/gitpod/types/agent_retrieve_execution_params.py b/src/gitpod/types/agent_retrieve_execution_params.py new file mode 100644 index 00000000..22c896b9 --- /dev/null +++ b/src/gitpod/types/agent_retrieve_execution_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["AgentRetrieveExecutionParams"] + + +class AgentRetrieveExecutionParams(TypedDict, total=False): + agent_execution_id: Annotated[str, PropertyInfo(alias="agentExecutionId")] diff --git a/src/gitpod/types/agent_retrieve_execution_response.py b/src/gitpod/types/agent_retrieve_execution_response.py new file mode 100644 index 00000000..b66ad83f --- /dev/null +++ b/src/gitpod/types/agent_retrieve_execution_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel +from .agent_execution import AgentExecution + +__all__ = ["AgentRetrieveExecutionResponse"] + + +class AgentRetrieveExecutionResponse(BaseModel): + agent_execution: Optional[AgentExecution] = FieldInfo(alias="agentExecution", default=None) diff --git a/src/gitpod/types/agent_retrieve_prompt_params.py b/src/gitpod/types/agent_retrieve_prompt_params.py new file mode 100644 index 00000000..c8dcd123 --- /dev/null +++ b/src/gitpod/types/agent_retrieve_prompt_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["AgentRetrievePromptParams"] + + +class AgentRetrievePromptParams(TypedDict, total=False): + prompt_id: Annotated[str, PropertyInfo(alias="promptId")] diff --git a/src/gitpod/types/agent_retrieve_prompt_response.py b/src/gitpod/types/agent_retrieve_prompt_response.py new file mode 100644 index 00000000..621f5dc2 --- /dev/null +++ b/src/gitpod/types/agent_retrieve_prompt_response.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .prompt import Prompt +from .._models import BaseModel + +__all__ = ["AgentRetrievePromptResponse"] + + +class AgentRetrievePromptResponse(BaseModel): + prompt: Optional[Prompt] = None diff --git a/src/gitpod/types/agent_send_to_execution_params.py b/src/gitpod/types/agent_send_to_execution_params.py new file mode 100644 index 00000000..27c14294 --- /dev/null +++ b/src/gitpod/types/agent_send_to_execution_params.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo +from .user_input_block_param import UserInputBlockParam + +__all__ = ["AgentSendToExecutionParams"] + + +class AgentSendToExecutionParams(TypedDict, total=False): + agent_execution_id: Annotated[str, PropertyInfo(alias="agentExecutionId")] + + user_input: Annotated[UserInputBlockParam, PropertyInfo(alias="userInput")] diff --git a/src/gitpod/types/agent_start_execution_params.py b/src/gitpod/types/agent_start_execution_params.py new file mode 100644 index 00000000..b021f7ed --- /dev/null +++ b/src/gitpod/types/agent_start_execution_params.py @@ -0,0 +1,32 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo +from .agent_mode import AgentMode +from .agent_code_context_param import AgentCodeContextParam + +__all__ = ["AgentStartExecutionParams"] + + +class AgentStartExecutionParams(TypedDict, total=False): + agent_id: Annotated[str, PropertyInfo(alias="agentId")] + + code_context: Annotated[AgentCodeContextParam, PropertyInfo(alias="codeContext")] + + mode: AgentMode + """ + mode specifies the operational mode for this agent execution If not specified, + defaults to AGENT_MODE_EXECUTION + """ + + name: str + + workflow_action_id: Annotated[Optional[str], PropertyInfo(alias="workflowActionId")] + """ + workflow_action_id is an optional reference to the workflow execution action + that created this agent execution. Used for tracking and event correlation. + """ diff --git a/src/gitpod/types/agent_start_execution_response.py b/src/gitpod/types/agent_start_execution_response.py new file mode 100644 index 00000000..d8561792 --- /dev/null +++ b/src/gitpod/types/agent_start_execution_response.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["AgentStartExecutionResponse"] + + +class AgentStartExecutionResponse(BaseModel): + agent_execution_id: Optional[str] = FieldInfo(alias="agentExecutionId", default=None) diff --git a/src/gitpod/types/agent_stop_execution_params.py b/src/gitpod/types/agent_stop_execution_params.py new file mode 100644 index 00000000..ec765d11 --- /dev/null +++ b/src/gitpod/types/agent_stop_execution_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["AgentStopExecutionParams"] + + +class AgentStopExecutionParams(TypedDict, total=False): + agent_execution_id: Annotated[str, PropertyInfo(alias="agentExecutionId")] diff --git a/src/gitpod/types/agent_update_prompt_params.py b/src/gitpod/types/agent_update_prompt_params.py new file mode 100644 index 00000000..8d5e292b --- /dev/null +++ b/src/gitpod/types/agent_update_prompt_params.py @@ -0,0 +1,47 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["AgentUpdatePromptParams", "Metadata", "Spec"] + + +class AgentUpdatePromptParams(TypedDict, total=False): + metadata: Optional[Metadata] + """Metadata updates""" + + prompt_id: Annotated[str, PropertyInfo(alias="promptId")] + """The ID of the prompt to update""" + + spec: Optional[Spec] + """Spec updates""" + + +class Metadata(TypedDict, total=False): + """Metadata updates""" + + description: Optional[str] + """A description of what the prompt does""" + + name: Optional[str] + """The name of the prompt""" + + +class Spec(TypedDict, total=False): + """Spec updates""" + + command: Optional[str] + """The command string (unique within organization)""" + + is_command: Annotated[Optional[bool], PropertyInfo(alias="isCommand")] + """Whether this prompt is a command""" + + is_template: Annotated[Optional[bool], PropertyInfo(alias="isTemplate")] + """Whether this prompt is a template""" + + prompt: Optional[str] + """The prompt content""" diff --git a/src/gitpod/types/agent_update_prompt_response.py b/src/gitpod/types/agent_update_prompt_response.py new file mode 100644 index 00000000..353a4ca9 --- /dev/null +++ b/src/gitpod/types/agent_update_prompt_response.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .prompt import Prompt +from .._models import BaseModel + +__all__ = ["AgentUpdatePromptResponse"] + + +class AgentUpdatePromptResponse(BaseModel): + prompt: Optional[Prompt] = None diff --git a/src/gitpod/types/breadcrumb_param.py b/src/gitpod/types/breadcrumb_param.py new file mode 100644 index 00000000..cef8444d --- /dev/null +++ b/src/gitpod/types/breadcrumb_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Union +from datetime import datetime +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo +from .error_level import ErrorLevel + +__all__ = ["BreadcrumbParam"] + + +class BreadcrumbParam(TypedDict, total=False): + """Breadcrumb information (Sentry-compatible)""" + + category: str + """Breadcrumb category""" + + data: Dict[str, str] + """Additional breadcrumb data""" + + level: ErrorLevel + """Breadcrumb level""" + + message: str + """Breadcrumb message""" + + timestamp: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] + """When the breadcrumb occurred""" + + type: str + """Breadcrumb type (e.g., "navigation", "http", "user", "error")""" diff --git a/src/gitpod/types/editor.py b/src/gitpod/types/editor.py index 96eebfa8..1d05f8f4 100644 --- a/src/gitpod/types/editor.py +++ b/src/gitpod/types/editor.py @@ -1,10 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Optional from pydantic import Field as FieldInfo from .._models import BaseModel +from .editor_version import EditorVersion __all__ = ["Editor"] @@ -23,3 +24,6 @@ class Editor(BaseModel): icon_url: Optional[str] = FieldInfo(alias="iconUrl", default=None) short_description: Optional[str] = FieldInfo(alias="shortDescription", default=None) + + versions: Optional[List[EditorVersion]] = None + """versions contains the list of available versions for this editor""" diff --git a/src/gitpod/types/editor_resolve_url_params.py b/src/gitpod/types/editor_resolve_url_params.py index de698ba0..2ddfd2ab 100644 --- a/src/gitpod/types/editor_resolve_url_params.py +++ b/src/gitpod/types/editor_resolve_url_params.py @@ -18,3 +18,11 @@ class EditorResolveURLParams(TypedDict, total=False): organization_id: Required[Annotated[str, PropertyInfo(alias="organizationId")]] """organizationId is the ID of the organization to resolve the URL for""" + + version: str + """ + version is the editor version to use If not provided, the latest version will be + installed + + Examples for JetBrains: 2025.2 + """ diff --git a/src/gitpod/types/editor_version.py b/src/gitpod/types/editor_version.py new file mode 100644 index 00000000..0f9637fb --- /dev/null +++ b/src/gitpod/types/editor_version.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .._models import BaseModel + +__all__ = ["EditorVersion"] + + +class EditorVersion(BaseModel): + version: str + """version is the version string of the editor Examples for JetBrains: 2025.2""" diff --git a/src/gitpod/types/environment_initializer.py b/src/gitpod/types/environment_initializer.py index 17d42ca5..12f6ef29 100644 --- a/src/gitpod/types/environment_initializer.py +++ b/src/gitpod/types/environment_initializer.py @@ -34,6 +34,7 @@ class SpecGit(BaseModel): "CLONE_TARGET_MODE_REMOTE_COMMIT", "CLONE_TARGET_MODE_REMOTE_BRANCH", "CLONE_TARGET_MODE_LOCAL_BRANCH", + "CLONE_TARGET_MODE_REMOTE_TAG", ] ] = FieldInfo(alias="targetMode", default=None) """the target mode determines what gets checked out""" diff --git a/src/gitpod/types/environment_initializer_param.py b/src/gitpod/types/environment_initializer_param.py index b9a8a978..3e54419a 100644 --- a/src/gitpod/types/environment_initializer_param.py +++ b/src/gitpod/types/environment_initializer_param.py @@ -34,6 +34,7 @@ class SpecGit(TypedDict, total=False): "CLONE_TARGET_MODE_REMOTE_COMMIT", "CLONE_TARGET_MODE_REMOTE_BRANCH", "CLONE_TARGET_MODE_LOCAL_BRANCH", + "CLONE_TARGET_MODE_REMOTE_TAG", ], PropertyInfo(alias="targetMode"), ] diff --git a/src/gitpod/types/environment_list_params.py b/src/gitpod/types/environment_list_params.py index e0ff12ed..0b5d21a1 100644 --- a/src/gitpod/types/environment_list_params.py +++ b/src/gitpod/types/environment_list_params.py @@ -2,12 +2,14 @@ from __future__ import annotations -from typing import List, Optional +from typing import List, Union, Optional +from datetime import datetime from typing_extensions import Literal, Annotated, TypedDict from .._types import SequenceNotStr from .._utils import PropertyInfo from .runner_kind import RunnerKind +from .environment_role import EnvironmentRole from .environment_phase import EnvironmentPhase __all__ = ["EnvironmentListParams", "Filter", "Pagination"] @@ -38,6 +40,9 @@ class Filter(TypedDict, total=False): ] """archival_status filters the response based on environment archive status""" + created_before: Annotated[Union[str, datetime, None], PropertyInfo(alias="createdBefore", format="iso8601")] + """created_before filters environments created before this timestamp""" + creator_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="creatorIds")] """ creator_ids filters the response to only Environments created by specified @@ -50,6 +55,9 @@ class Filter(TypedDict, total=False): specified projects """ + roles: List[EnvironmentRole] + """roles filters the response to only Environments with the specified roles""" + runner_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="runnerIds")] """ runner_ids filters the response to only Environments running on these Runner IDs diff --git a/src/gitpod/types/environment_metadata.py b/src/gitpod/types/environment_metadata.py index 38cb520a..302dded8 100644 --- a/src/gitpod/types/environment_metadata.py +++ b/src/gitpod/types/environment_metadata.py @@ -7,6 +7,7 @@ from .._models import BaseModel from .shared.subject import Subject +from .environment_role import EnvironmentRole __all__ = ["EnvironmentMetadata"] @@ -53,11 +54,20 @@ class EnvironmentMetadata(BaseModel): created """ + prebuild_id: Optional[str] = FieldInfo(alias="prebuildId", default=None) + """ + prebuild_id is the ID of the prebuild this environment was created from. Only + set if the environment was created from a prebuild. + """ + project_id: Optional[str] = FieldInfo(alias="projectId", default=None) """ If the Environment was started from a project, the project_id will reference the project. """ + role: Optional[EnvironmentRole] = None + """role is the role of the environment""" + runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) """Runner is the ID of the runner that runs this environment.""" diff --git a/src/gitpod/types/environment_role.py b/src/gitpod/types/environment_role.py new file mode 100644 index 00000000..2dd22df2 --- /dev/null +++ b/src/gitpod/types/environment_role.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["EnvironmentRole"] + +EnvironmentRole: TypeAlias = Literal[ + "ENVIRONMENT_ROLE_UNSPECIFIED", "ENVIRONMENT_ROLE_DEFAULT", "ENVIRONMENT_ROLE_PREBUILD", "ENVIRONMENT_ROLE_WORKFLOW" +] diff --git a/src/gitpod/types/environment_spec.py b/src/gitpod/types/environment_spec.py index 3e14a5a6..679336f4 100644 --- a/src/gitpod/types/environment_spec.py +++ b/src/gitpod/types/environment_spec.py @@ -1,6 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List, Optional +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -8,6 +9,7 @@ from .admission_level import AdmissionLevel from .environment_phase import EnvironmentPhase from .environment_initializer import EnvironmentInitializer +from .shared.automation_trigger import AutomationTrigger __all__ = [ "EnvironmentSpec", @@ -39,6 +41,13 @@ class AutomationsFile(BaseModel): session: Optional[str] = None + trigger_filter: Optional[List[AutomationTrigger]] = FieldInfo(alias="triggerFilter", default=None) + """ + trigger_filter specifies which automation triggers should execute. When set, + only automations matching these triggers will run. If empty/unset, all triggers + are evaluated normally. + """ + class Content(BaseModel): """content is the content spec of the environment""" @@ -84,6 +93,14 @@ class Devcontainer(BaseModel): dotfiles: Optional[DevcontainerDotfiles] = None """Experimental: dotfiles is the dotfiles configuration of the devcontainer""" + lifecycle_stage: Optional[ + Literal["LIFECYCLE_STAGE_UNSPECIFIED", "LIFECYCLE_STAGE_FULL", "LIFECYCLE_STAGE_PREBUILD"] + ] = FieldInfo(alias="lifecycleStage", default=None) + """ + lifecycle_stage controls which devcontainer lifecycle commands are executed. + Defaults to FULL if not specified. + """ + session: Optional[str] = None @@ -106,11 +123,24 @@ class Port(BaseModel): port: Optional[int] = None """port number""" + protocol: Optional[Literal["PROTOCOL_UNSPECIFIED", "PROTOCOL_HTTP", "PROTOCOL_HTTPS"]] = None + """ + protocol for communication (Gateway proxy → user environment service). this + setting only affects the protocol used between Gateway and user environment + services. + """ + class Secret(BaseModel): id: Optional[str] = None """id is the unique identifier of the secret.""" + api_only: Optional[bool] = FieldInfo(alias="apiOnly", default=None) + """ + api_only indicates the secret is only available via API/CLI. These secrets are + resolved but NOT automatically injected into services or devcontainers. + """ + container_registry_basic_auth_host: Optional[str] = FieldInfo(alias="containerRegistryBasicAuthHost", default=None) """ container_registry_basic_auth_host is the hostname of the container registry @@ -183,7 +213,7 @@ class EnvironmentSpec(BaseModel): """machine is the machine spec of the environment""" ports: Optional[List[Port]] = None - """ports is the set of ports which ought to be exposed to the internet""" + """ports is the set of ports which ought to be exposed to your network""" secrets: Optional[List[Secret]] = None """secrets are confidential data that is mounted into the environment""" @@ -201,3 +231,9 @@ class EnvironmentSpec(BaseModel): timeout: Optional[Timeout] = None """Timeout configures the environment timeout""" + + workflow_action_id: Optional[str] = FieldInfo(alias="workflowActionId", default=None) + """ + workflow_action_id is an optional reference to the workflow execution action + that created this environment. Used for tracking and event correlation. + """ diff --git a/src/gitpod/types/environment_spec_param.py b/src/gitpod/types/environment_spec_param.py index e2fb03ce..3c10dbd3 100644 --- a/src/gitpod/types/environment_spec_param.py +++ b/src/gitpod/types/environment_spec_param.py @@ -2,13 +2,14 @@ from __future__ import annotations -from typing import Iterable -from typing_extensions import Required, Annotated, TypedDict +from typing import Iterable, Optional +from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo from .admission_level import AdmissionLevel from .environment_phase import EnvironmentPhase from .environment_initializer_param import EnvironmentInitializerParam +from .shared_params.automation_trigger import AutomationTrigger __all__ = [ "EnvironmentSpecParam", @@ -40,6 +41,13 @@ class AutomationsFile(TypedDict, total=False): session: str + trigger_filter: Annotated[Iterable[AutomationTrigger], PropertyInfo(alias="triggerFilter")] + """ + trigger_filter specifies which automation triggers should execute. When set, + only automations matching these triggers will run. If empty/unset, all triggers + are evaluated normally. + """ + class Content(TypedDict, total=False): """content is the content spec of the environment""" @@ -85,6 +93,15 @@ class Devcontainer(TypedDict, total=False): dotfiles: DevcontainerDotfiles """Experimental: dotfiles is the dotfiles configuration of the devcontainer""" + lifecycle_stage: Annotated[ + Literal["LIFECYCLE_STAGE_UNSPECIFIED", "LIFECYCLE_STAGE_FULL", "LIFECYCLE_STAGE_PREBUILD"], + PropertyInfo(alias="lifecycleStage"), + ] + """ + lifecycle_stage controls which devcontainer lifecycle commands are executed. + Defaults to FULL if not specified. + """ + session: str @@ -113,11 +130,24 @@ class Port(TypedDict, total=False): port: int """port number""" + protocol: Literal["PROTOCOL_UNSPECIFIED", "PROTOCOL_HTTP", "PROTOCOL_HTTPS"] + """ + protocol for communication (Gateway proxy → user environment service). this + setting only affects the protocol used between Gateway and user environment + services. + """ + class Secret(TypedDict, total=False): id: str """id is the unique identifier of the secret.""" + api_only: Annotated[bool, PropertyInfo(alias="apiOnly")] + """ + api_only indicates the secret is only available via API/CLI. These secrets are + resolved but NOT automatically injected into services or devcontainers. + """ + container_registry_basic_auth_host: Annotated[str, PropertyInfo(alias="containerRegistryBasicAuthHost")] """ container_registry_basic_auth_host is the hostname of the container registry @@ -190,7 +220,7 @@ class EnvironmentSpecParam(TypedDict, total=False): """machine is the machine spec of the environment""" ports: Iterable[Port] - """ports is the set of ports which ought to be exposed to the internet""" + """ports is the set of ports which ought to be exposed to your network""" secrets: Iterable[Secret] """secrets are confidential data that is mounted into the environment""" @@ -208,3 +238,9 @@ class EnvironmentSpecParam(TypedDict, total=False): timeout: Timeout """Timeout configures the environment timeout""" + + workflow_action_id: Annotated[Optional[str], PropertyInfo(alias="workflowActionId")] + """ + workflow_action_id is an optional reference to the workflow execution action + that created this environment. Used for tracking and event correlation. + """ diff --git a/src/gitpod/types/environment_status.py b/src/gitpod/types/environment_status.py index aae1b3a4..45ad12ca 100644 --- a/src/gitpod/types/environment_status.py +++ b/src/gitpod/types/environment_status.py @@ -58,6 +58,7 @@ class AutomationsFile(BaseModel): "CONTENT_PHASE_READY", "CONTENT_PHASE_UPDATING", "CONTENT_PHASE_FAILED", + "CONTENT_PHASE_UNAVAILABLE", ] ] = None """phase is the current phase of the automations file.""" @@ -155,6 +156,7 @@ class Content(BaseModel): "CONTENT_PHASE_READY", "CONTENT_PHASE_UPDATING", "CONTENT_PHASE_FAILED", + "CONTENT_PHASE_UNAVAILABLE", ] ] = None """phase is the current phase of the environment content""" @@ -257,15 +259,26 @@ class EnvironmentURLs(BaseModel): logs: Optional[str] = None """logs is the URL at which the environment logs can be accessed.""" + ops: Optional[str] = None + """ops is the URL at which the environment ops service can be accessed.""" + ports: Optional[List[EnvironmentURLsPort]] = None ssh: Optional[EnvironmentURLsSSH] = None """SSH is the URL at which the environment can be accessed via SSH.""" + support_bundle: Optional[str] = FieldInfo(alias="supportBundle", default=None) + """ + support_bundle is the URL at which the environment support bundle can be + accessed. + """ + class MachineVersions(BaseModel): """versions contains the versions of components in the machine.""" + ami_id: Optional[str] = FieldInfo(alias="amiId", default=None) + supervisor_commit: Optional[str] = FieldInfo(alias="supervisorCommit", default=None) supervisor_version: Optional[str] = FieldInfo(alias="supervisorVersion", default=None) @@ -345,6 +358,7 @@ class Secret(BaseModel): "CONTENT_PHASE_READY", "CONTENT_PHASE_UPDATING", "CONTENT_PHASE_FAILED", + "CONTENT_PHASE_UNAVAILABLE", ] ] = None @@ -372,6 +386,7 @@ class SSHPublicKey(BaseModel): "CONTENT_PHASE_READY", "CONTENT_PHASE_UPDATING", "CONTENT_PHASE_FAILED", + "CONTENT_PHASE_UNAVAILABLE", ] ] = None """phase is the current phase of the public key""" diff --git a/src/gitpod/types/environment_update_params.py b/src/gitpod/types/environment_update_params.py index 172877e9..904aa438 100644 --- a/src/gitpod/types/environment_update_params.py +++ b/src/gitpod/types/environment_update_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Iterable, Optional -from typing_extensions import Annotated, TypedDict +from typing_extensions import Literal, Annotated, TypedDict from .._utils import PropertyInfo from .admission_level import AdmissionLevel @@ -95,6 +95,13 @@ class SpecPort(TypedDict, total=False): port: int """port number""" + protocol: Literal["PROTOCOL_UNSPECIFIED", "PROTOCOL_HTTP", "PROTOCOL_HTTPS"] + """ + protocol for communication (Gateway proxy → user environment service). this + setting only affects the protocol used between Gateway and user environment + services. + """ + class SpecSSHPublicKey(TypedDict, total=False): id: str diff --git a/src/gitpod/types/environments/automations/__init__.py b/src/gitpod/types/environments/automations/__init__.py index d6c647a7..d907df0f 100644 --- a/src/gitpod/types/environments/automations/__init__.py +++ b/src/gitpod/types/environments/automations/__init__.py @@ -3,6 +3,7 @@ from __future__ import annotations from .service import Service as Service +from .service_role import ServiceRole as ServiceRole from .service_spec import ServiceSpec as ServiceSpec from .service_phase import ServicePhase as ServicePhase from .service_status import ServiceStatus as ServiceStatus diff --git a/src/gitpod/types/environments/automations/service_list_params.py b/src/gitpod/types/environments/automations/service_list_params.py index 8a91cdc6..0d1e7cf4 100644 --- a/src/gitpod/types/environments/automations/service_list_params.py +++ b/src/gitpod/types/environments/automations/service_list_params.py @@ -2,10 +2,12 @@ from __future__ import annotations +from typing import List from typing_extensions import Annotated, TypedDict from ...._types import SequenceNotStr from ...._utils import PropertyInfo +from .service_role import ServiceRole __all__ = ["ServiceListParams", "Filter", "Pagination"] @@ -31,6 +33,9 @@ class Filter(TypedDict, total=False): references: SequenceNotStr[str] """references filters the response to only services with these references""" + roles: List[ServiceRole] + """roles filters the response to only services with these roles""" + service_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="serviceIds")] """service_ids filters the response to only services with these IDs""" diff --git a/src/gitpod/types/environments/automations/service_metadata.py b/src/gitpod/types/environments/automations/service_metadata.py index 4555022d..accddd3d 100644 --- a/src/gitpod/types/environments/automations/service_metadata.py +++ b/src/gitpod/types/environments/automations/service_metadata.py @@ -6,6 +6,7 @@ from pydantic import Field as FieldInfo from ...._models import BaseModel +from .service_role import ServiceRole from ...shared.subject import Subject from ...shared.automation_trigger import AutomationTrigger @@ -39,5 +40,8 @@ class ServiceMetadata(BaseModel): identify the service in user interactions (e.g. the CLI). """ + role: Optional[ServiceRole] = None + """role specifies the intended role or purpose of the service.""" + triggered_by: Optional[List[AutomationTrigger]] = FieldInfo(alias="triggeredBy", default=None) """triggered_by is a list of trigger that start the service.""" diff --git a/src/gitpod/types/environments/automations/service_metadata_param.py b/src/gitpod/types/environments/automations/service_metadata_param.py index 669b250a..b8e47969 100644 --- a/src/gitpod/types/environments/automations/service_metadata_param.py +++ b/src/gitpod/types/environments/automations/service_metadata_param.py @@ -7,6 +7,7 @@ from typing_extensions import Annotated, TypedDict from ...._utils import PropertyInfo +from .service_role import ServiceRole from ...shared_params.subject import Subject from ...shared_params.automation_trigger import AutomationTrigger @@ -40,5 +41,8 @@ class ServiceMetadataParam(TypedDict, total=False): identify the service in user interactions (e.g. the CLI). """ + role: ServiceRole + """role specifies the intended role or purpose of the service.""" + triggered_by: Annotated[Iterable[AutomationTrigger], PropertyInfo(alias="triggeredBy")] """triggered_by is a list of trigger that start the service.""" diff --git a/src/gitpod/types/environments/automations/service_role.py b/src/gitpod/types/environments/automations/service_role.py new file mode 100644 index 00000000..0b333444 --- /dev/null +++ b/src/gitpod/types/environments/automations/service_role.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["ServiceRole"] + +ServiceRole: TypeAlias = Literal[ + "SERVICE_ROLE_UNSPECIFIED", + "SERVICE_ROLE_DEFAULT", + "SERVICE_ROLE_EDITOR", + "SERVICE_ROLE_AI_AGENT", + "SERVICE_ROLE_SECURITY_AGENT", +] diff --git a/src/gitpod/types/environments/automations/service_spec.py b/src/gitpod/types/environments/automations/service_spec.py index 6240b462..98b9b1f6 100644 --- a/src/gitpod/types/environments/automations/service_spec.py +++ b/src/gitpod/types/environments/automations/service_spec.py @@ -1,12 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Optional from pydantic import Field as FieldInfo from ...._models import BaseModel from .service_phase import ServicePhase from ...shared.runs_on import RunsOn +from ...shared.environment_variable_item import EnvironmentVariableItem __all__ = ["ServiceSpec", "Commands"] @@ -58,6 +59,9 @@ class ServiceSpec(BaseModel): Used to start or stop the service. """ + env: Optional[List[EnvironmentVariableItem]] = None + """env specifies environment variables for the service.""" + runs_on: Optional[RunsOn] = FieldInfo(alias="runsOn", default=None) """runs_on specifies the environment the service should run on.""" diff --git a/src/gitpod/types/environments/automations/service_spec_param.py b/src/gitpod/types/environments/automations/service_spec_param.py index b08445b4..93bed6a8 100644 --- a/src/gitpod/types/environments/automations/service_spec_param.py +++ b/src/gitpod/types/environments/automations/service_spec_param.py @@ -2,11 +2,13 @@ from __future__ import annotations +from typing import Iterable from typing_extensions import Annotated, TypedDict from ...._utils import PropertyInfo from .service_phase import ServicePhase from ...shared_params.runs_on import RunsOn +from ...shared_params.environment_variable_item import EnvironmentVariableItem __all__ = ["ServiceSpecParam", "Commands"] @@ -58,6 +60,9 @@ class ServiceSpecParam(TypedDict, total=False): Used to start or stop the service. """ + env: Iterable[EnvironmentVariableItem] + """env specifies environment variables for the service.""" + runs_on: Annotated[RunsOn, PropertyInfo(alias="runsOn")] """runs_on specifies the environment the service should run on.""" diff --git a/src/gitpod/types/environments/automations/service_update_params.py b/src/gitpod/types/environments/automations/service_update_params.py index a1c08a83..7ec0e436 100644 --- a/src/gitpod/types/environments/automations/service_update_params.py +++ b/src/gitpod/types/environments/automations/service_update_params.py @@ -6,9 +6,11 @@ from typing_extensions import Annotated, TypedDict from ...._utils import PropertyInfo +from .service_role import ServiceRole from .service_phase import ServicePhase from ...shared_params.runs_on import RunsOn from ...shared_params.automation_trigger import AutomationTrigger +from ...shared_params.environment_variable_item import EnvironmentVariableItem __all__ = ["ServiceUpdateParams", "Metadata", "MetadataTriggeredBy", "Spec", "SpecCommands", "Status"] @@ -42,6 +44,8 @@ class Metadata(TypedDict, total=False): name: Optional[str] + role: Optional[ServiceRole] + triggered_by: Annotated[Optional[MetadataTriggeredBy], PropertyInfo(alias="triggeredBy")] @@ -63,6 +67,8 @@ class Spec(TypedDict, total=False): commands: Optional[SpecCommands] + env: Iterable[EnvironmentVariableItem] + runs_on: Annotated[Optional[RunsOn], PropertyInfo(alias="runsOn")] diff --git a/src/gitpod/types/environments/automations/task_update_params.py b/src/gitpod/types/environments/automations/task_update_params.py index 43d66208..10f30ca2 100644 --- a/src/gitpod/types/environments/automations/task_update_params.py +++ b/src/gitpod/types/environments/automations/task_update_params.py @@ -9,6 +9,7 @@ from ...._utils import PropertyInfo from ...shared_params.runs_on import RunsOn from ...shared_params.automation_trigger import AutomationTrigger +from ...shared_params.environment_variable_item import EnvironmentVariableItem __all__ = ["TaskUpdateParams", "Metadata", "MetadataTriggeredBy", "Spec"] @@ -39,4 +40,6 @@ class Metadata(TypedDict, total=False): class Spec(TypedDict, total=False): command: Optional[str] + env: Iterable[EnvironmentVariableItem] + runs_on: Annotated[Optional[RunsOn], PropertyInfo(alias="runsOn")] diff --git a/src/gitpod/types/environments/automations_file_param.py b/src/gitpod/types/environments/automations_file_param.py index 7d4a2562..226782ce 100644 --- a/src/gitpod/types/environments/automations_file_param.py +++ b/src/gitpod/types/environments/automations_file_param.py @@ -49,6 +49,8 @@ class Services(TypedDict, total=False): name: str + role: Literal["", "default", "editor", "ai-agent"] + runs_on: Annotated[RunsOn, PropertyInfo(alias="runsOn")] triggered_by: Annotated[ @@ -68,7 +70,8 @@ class Tasks(TypedDict, total=False): runs_on: Annotated[RunsOn, PropertyInfo(alias="runsOn")] triggered_by: Annotated[ - List[Literal["manual", "postEnvironmentStart", "postDevcontainerStart"]], PropertyInfo(alias="triggeredBy") + List[Literal["manual", "postEnvironmentStart", "postDevcontainerStart", "prebuild"]], + PropertyInfo(alias="triggeredBy"), ] diff --git a/src/gitpod/types/error_event_param.py b/src/gitpod/types/error_event_param.py new file mode 100644 index 00000000..5b909e4c --- /dev/null +++ b/src/gitpod/types/error_event_param.py @@ -0,0 +1,74 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Union, Iterable +from datetime import datetime +from typing_extensions import Annotated, TypedDict + +from .._types import SequenceNotStr +from .._utils import PropertyInfo +from .error_level import ErrorLevel +from .breadcrumb_param import BreadcrumbParam +from .request_info_param import RequestInfoParam +from .exception_info_param import ExceptionInfoParam + +__all__ = ["ErrorEventParam"] + + +class ErrorEventParam(TypedDict, total=False): + """ErrorEvent contains comprehensive error information (Sentry-compatible)""" + + breadcrumbs: Iterable[BreadcrumbParam] + """Breadcrumbs leading up to the error""" + + environment: str + """Environment (e.g., "production", "staging", "development")""" + + event_id: Annotated[str, PropertyInfo(alias="eventId")] + """Unique event identifier (required by Sentry)""" + + exceptions: Iterable[ExceptionInfoParam] + """Exception information (primary error data)""" + + extra: Dict[str, str] + """Additional arbitrary metadata""" + + fingerprint: SequenceNotStr[str] + """Custom fingerprint for grouping""" + + identity_id: Annotated[str, PropertyInfo(alias="identityId")] + """Identity ID of the user (UUID)""" + + level: ErrorLevel + """Error severity level""" + + logger: str + """Logger name""" + + modules: Dict[str, str] + """Modules/dependencies information""" + + platform: str + """Platform identifier (required by Sentry)""" + + release: str + """Release version""" + + request: RequestInfoParam + """Request information""" + + sdk: Dict[str, str] + """SDK information""" + + server_name: Annotated[str, PropertyInfo(alias="serverName")] + """Server/host name""" + + tags: Dict[str, str] + """Tags for filtering and grouping""" + + timestamp: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] + """When the event occurred (required by Sentry)""" + + transaction: str + """Transaction name (e.g., route name, function name)""" diff --git a/src/gitpod/types/error_level.py b/src/gitpod/types/error_level.py new file mode 100644 index 00000000..573d3f85 --- /dev/null +++ b/src/gitpod/types/error_level.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["ErrorLevel"] + +ErrorLevel: TypeAlias = Literal[ + "ERROR_LEVEL_UNSPECIFIED", + "ERROR_LEVEL_DEBUG", + "ERROR_LEVEL_INFO", + "ERROR_LEVEL_WARNING", + "ERROR_LEVEL_ERROR", + "ERROR_LEVEL_FATAL", +] diff --git a/src/gitpod/types/error_report_errors_params.py b/src/gitpod/types/error_report_errors_params.py new file mode 100644 index 00000000..6aa61989 --- /dev/null +++ b/src/gitpod/types/error_report_errors_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import TypedDict + +from .error_event_param import ErrorEventParam + +__all__ = ["ErrorReportErrorsParams"] + + +class ErrorReportErrorsParams(TypedDict, total=False): + events: Iterable[ErrorEventParam] + """Error events to be reported (batch) - now using Sentry-compatible structure""" diff --git a/src/gitpod/types/event_list_params.py b/src/gitpod/types/event_list_params.py index 51ddc544..21246d50 100644 --- a/src/gitpod/types/event_list_params.py +++ b/src/gitpod/types/event_list_params.py @@ -7,8 +7,8 @@ from .._types import SequenceNotStr from .._utils import PropertyInfo -from .resource_type import ResourceType from .shared.principal import Principal +from .shared.resource_type import ResourceType __all__ = ["EventListParams", "Filter", "Pagination"] diff --git a/src/gitpod/types/event_list_response.py b/src/gitpod/types/event_list_response.py index ce8fb8b2..a5d723d3 100644 --- a/src/gitpod/types/event_list_response.py +++ b/src/gitpod/types/event_list_response.py @@ -6,8 +6,8 @@ from pydantic import Field as FieldInfo from .._models import BaseModel -from .resource_type import ResourceType from .shared.principal import Principal +from .shared.resource_type import ResourceType __all__ = ["EventListResponse"] diff --git a/src/gitpod/types/event_watch_response.py b/src/gitpod/types/event_watch_response.py index 9780ee13..e8e02cc1 100644 --- a/src/gitpod/types/event_watch_response.py +++ b/src/gitpod/types/event_watch_response.py @@ -5,8 +5,8 @@ from pydantic import Field as FieldInfo from .._models import BaseModel -from .resource_type import ResourceType from .resource_operation import ResourceOperation +from .shared.resource_type import ResourceType __all__ = ["EventWatchResponse"] diff --git a/src/gitpod/types/exception_info_param.py b/src/gitpod/types/exception_info_param.py new file mode 100644 index 00000000..ee6f2291 --- /dev/null +++ b/src/gitpod/types/exception_info_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo +from .stack_frame_param import StackFrameParam +from .exception_mechanism_param import ExceptionMechanismParam + +__all__ = ["ExceptionInfoParam"] + + +class ExceptionInfoParam(TypedDict, total=False): + """Exception information (Sentry-compatible)""" + + mechanism: ExceptionMechanismParam + """Exception mechanism""" + + module: str + """Module or package where the exception type is defined""" + + stacktrace: Iterable[StackFrameParam] + """Stack trace frames""" + + thread_id: Annotated[str, PropertyInfo(alias="threadId")] + """Thread ID if applicable""" + + type: str + """Exception type/class name""" + + value: str + """Exception message/value""" diff --git a/src/gitpod/types/exception_mechanism_param.py b/src/gitpod/types/exception_mechanism_param.py new file mode 100644 index 00000000..1fd017ac --- /dev/null +++ b/src/gitpod/types/exception_mechanism_param.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict +from typing_extensions import TypedDict + +__all__ = ["ExceptionMechanismParam"] + + +class ExceptionMechanismParam(TypedDict, total=False): + """Exception mechanism information (Sentry-compatible)""" + + data: Dict[str, str] + """Additional mechanism-specific data""" + + description: str + """Human-readable description of the mechanism""" + + handled: bool + """Whether the exception was handled by user code""" + + synthetic: bool + """Whether this is a synthetic exception (created by SDK)""" + + type: str + """Type of mechanism (e.g., "generic", "promise", "onerror")""" diff --git a/src/gitpod/types/group.py b/src/gitpod/types/group.py index a98b80b7..ac727d0f 100644 --- a/src/gitpod/types/group.py +++ b/src/gitpod/types/group.py @@ -105,6 +105,11 @@ class Group(BaseModel): to obtain a formatter capable of generating timestamps in this format. """ + description: Optional[str] = None + + member_count: Optional[int] = FieldInfo(alias="memberCount", default=None) + """member_count is the total number of members in this group""" + name: Optional[str] = None organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) diff --git a/src/gitpod/types/group_create_params.py b/src/gitpod/types/group_create_params.py new file mode 100644 index 00000000..43e2dd66 --- /dev/null +++ b/src/gitpod/types/group_create_params.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["GroupCreateParams"] + + +class GroupCreateParams(TypedDict, total=False): + description: str + + name: str + + organization_id: Annotated[str, PropertyInfo(alias="organizationId")] diff --git a/src/gitpod/types/group_create_response.py b/src/gitpod/types/group_create_response.py new file mode 100644 index 00000000..de7d97db --- /dev/null +++ b/src/gitpod/types/group_create_response.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .group import Group +from .._models import BaseModel + +__all__ = ["GroupCreateResponse"] + + +class GroupCreateResponse(BaseModel): + group: Optional[Group] = None diff --git a/src/gitpod/types/group_delete_params.py b/src/gitpod/types/group_delete_params.py new file mode 100644 index 00000000..6d0899d0 --- /dev/null +++ b/src/gitpod/types/group_delete_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["GroupDeleteParams"] + + +class GroupDeleteParams(TypedDict, total=False): + group_id: Annotated[str, PropertyInfo(alias="groupId")] diff --git a/src/gitpod/types/group_retrieve_params.py b/src/gitpod/types/group_retrieve_params.py new file mode 100644 index 00000000..0e039801 --- /dev/null +++ b/src/gitpod/types/group_retrieve_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["GroupRetrieveParams"] + + +class GroupRetrieveParams(TypedDict, total=False): + group_id: Annotated[str, PropertyInfo(alias="groupId")] diff --git a/src/gitpod/types/group_retrieve_response.py b/src/gitpod/types/group_retrieve_response.py new file mode 100644 index 00000000..a4fe9908 --- /dev/null +++ b/src/gitpod/types/group_retrieve_response.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .group import Group +from .._models import BaseModel + +__all__ = ["GroupRetrieveResponse"] + + +class GroupRetrieveResponse(BaseModel): + group: Optional[Group] = None diff --git a/src/gitpod/types/group_update_params.py b/src/gitpod/types/group_update_params.py new file mode 100644 index 00000000..f5221b7e --- /dev/null +++ b/src/gitpod/types/group_update_params.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["GroupUpdateParams"] + + +class GroupUpdateParams(TypedDict, total=False): + description: str + + group_id: Annotated[str, PropertyInfo(alias="groupId")] + + name: str diff --git a/src/gitpod/types/group_update_response.py b/src/gitpod/types/group_update_response.py new file mode 100644 index 00000000..b19579b5 --- /dev/null +++ b/src/gitpod/types/group_update_response.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .group import Group +from .._models import BaseModel + +__all__ = ["GroupUpdateResponse"] + + +class GroupUpdateResponse(BaseModel): + group: Optional[Group] = None diff --git a/src/gitpod/types/groups/__init__.py b/src/gitpod/types/groups/__init__.py new file mode 100644 index 00000000..f689e45d --- /dev/null +++ b/src/gitpod/types/groups/__init__.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .resource_role import ResourceRole as ResourceRole +from .role_assignment import RoleAssignment as RoleAssignment +from .group_membership import GroupMembership as GroupMembership +from .membership_list_params import MembershipListParams as MembershipListParams +from .membership_create_params import MembershipCreateParams as MembershipCreateParams +from .membership_delete_params import MembershipDeleteParams as MembershipDeleteParams +from .membership_create_response import MembershipCreateResponse as MembershipCreateResponse +from .role_assignment_list_params import RoleAssignmentListParams as RoleAssignmentListParams +from .role_assignment_create_params import RoleAssignmentCreateParams as RoleAssignmentCreateParams +from .role_assignment_delete_params import RoleAssignmentDeleteParams as RoleAssignmentDeleteParams +from .role_assignment_create_response import RoleAssignmentCreateResponse as RoleAssignmentCreateResponse diff --git a/src/gitpod/types/groups/group_membership.py b/src/gitpod/types/groups/group_membership.py new file mode 100644 index 00000000..667b6ebb --- /dev/null +++ b/src/gitpod/types/groups/group_membership.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from ..shared.subject import Subject + +__all__ = ["GroupMembership"] + + +class GroupMembership(BaseModel): + """GroupMembership represents a subject's membership in a group""" + + id: Optional[str] = None + """Unique identifier for the group membership""" + + avatar_url: Optional[str] = FieldInfo(alias="avatarUrl", default=None) + """Subject's avatar URL""" + + group_id: Optional[str] = FieldInfo(alias="groupId", default=None) + """Group identifier""" + + name: Optional[str] = None + """Subject's display name""" + + subject: Optional[Subject] = None + """Subject (user, runner, environment, service account, etc.)""" diff --git a/src/gitpod/types/groups/membership_create_params.py b/src/gitpod/types/groups/membership_create_params.py new file mode 100644 index 00000000..90b03674 --- /dev/null +++ b/src/gitpod/types/groups/membership_create_params.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from ..._utils import PropertyInfo +from ..shared_params.subject import Subject + +__all__ = ["MembershipCreateParams"] + + +class MembershipCreateParams(TypedDict, total=False): + group_id: Annotated[str, PropertyInfo(alias="groupId")] + + subject: Subject + """Subject to add to the group""" diff --git a/src/gitpod/types/groups/membership_create_response.py b/src/gitpod/types/groups/membership_create_response.py new file mode 100644 index 00000000..23494130 --- /dev/null +++ b/src/gitpod/types/groups/membership_create_response.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .group_membership import GroupMembership + +__all__ = ["MembershipCreateResponse"] + + +class MembershipCreateResponse(BaseModel): + member: Optional[GroupMembership] = None + """GroupMembership represents a subject's membership in a group""" diff --git a/src/gitpod/types/groups/membership_delete_params.py b/src/gitpod/types/groups/membership_delete_params.py new file mode 100644 index 00000000..befcf479 --- /dev/null +++ b/src/gitpod/types/groups/membership_delete_params.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["MembershipDeleteParams"] + + +class MembershipDeleteParams(TypedDict, total=False): + membership_id: Annotated[str, PropertyInfo(alias="membershipId")] + """The membership to delete""" diff --git a/src/gitpod/types/groups/membership_list_params.py b/src/gitpod/types/groups/membership_list_params.py new file mode 100644 index 00000000..e2f90e2d --- /dev/null +++ b/src/gitpod/types/groups/membership_list_params.py @@ -0,0 +1,36 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["MembershipListParams", "Pagination"] + + +class MembershipListParams(TypedDict, total=False): + token: str + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + + group_id: Annotated[str, PropertyInfo(alias="groupId")] + + pagination: Pagination + """pagination contains the pagination options for listing memberships""" + + +class Pagination(TypedDict, total=False): + """pagination contains the pagination options for listing memberships""" + + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/groups/resource_role.py b/src/gitpod/types/groups/resource_role.py new file mode 100644 index 00000000..17dcb324 --- /dev/null +++ b/src/gitpod/types/groups/resource_role.py @@ -0,0 +1,56 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["ResourceRole"] + +ResourceRole: TypeAlias = Literal[ + "RESOURCE_ROLE_UNSPECIFIED", + "RESOURCE_ROLE_ORG_ADMIN", + "RESOURCE_ROLE_ORG_MEMBER", + "RESOURCE_ROLE_GROUP_ADMIN", + "RESOURCE_ROLE_GROUP_VIEWER", + "RESOURCE_ROLE_USER_IDENTITY", + "RESOURCE_ROLE_USER_VIEWER", + "RESOURCE_ROLE_USER_ADMIN", + "RESOURCE_ROLE_ENVIRONMENT_IDENTITY", + "RESOURCE_ROLE_ENVIRONMENT_ADMIN", + "RESOURCE_ROLE_ENVIRONMENT_USER", + "RESOURCE_ROLE_ENVIRONMENT_VIEWER", + "RESOURCE_ROLE_ENVIRONMENT_RUNNER", + "RESOURCE_ROLE_RUNNER_IDENTITY", + "RESOURCE_ROLE_RUNNER_ADMIN", + "RESOURCE_ROLE_RUNNER_LOCAL_ADMIN", + "RESOURCE_ROLE_RUNNER_MANAGED_ADMIN", + "RESOURCE_ROLE_RUNNER_USER", + "RESOURCE_ROLE_RUNNER_CONFIGURATION_READER", + "RESOURCE_ROLE_HOST_AUTHENTICATION_TOKEN_ADMIN", + "RESOURCE_ROLE_HOST_AUTHENTICATION_TOKEN_UPDATER", + "RESOURCE_ROLE_PROJECT_ADMIN", + "RESOURCE_ROLE_PROJECT_USER", + "RESOURCE_ROLE_PROJECT_EDITOR", + "RESOURCE_ROLE_ENVIRONMENT_SERVICE_ADMIN", + "RESOURCE_ROLE_ENVIRONMENT_SERVICE_VIEWER", + "RESOURCE_ROLE_ENVIRONMENT_SERVICE_USER", + "RESOURCE_ROLE_ENVIRONMENT_SERVICE_ENV", + "RESOURCE_ROLE_ENVIRONMENT_TASK_ADMIN", + "RESOURCE_ROLE_ENVIRONMENT_TASK_VIEWER", + "RESOURCE_ROLE_ENVIRONMENT_TASK_USER", + "RESOURCE_ROLE_ENVIRONMENT_TASK_ENV", + "RESOURCE_ROLE_SERVICE_ACCOUNT_IDENTITY", + "RESOURCE_ROLE_SERVICE_ACCOUNT_ADMIN", + "RESOURCE_ROLE_AGENT_EXECUTION_IDENTITY", + "RESOURCE_ROLE_AGENT_EXECUTION_USER", + "RESOURCE_ROLE_AGENT_EXECUTION_ADMIN", + "RESOURCE_ROLE_AGENT_EXECUTION_RUNNER", + "RESOURCE_ROLE_AGENT_EXECUTION_OUTPUTS_REPORTER", + "RESOURCE_ROLE_AGENT_ADMIN", + "RESOURCE_ROLE_AGENT_VIEWER", + "RESOURCE_ROLE_AGENT_EXECUTOR", + "RESOURCE_ROLE_WORKFLOW_ADMIN", + "RESOURCE_ROLE_WORKFLOW_USER", + "RESOURCE_ROLE_WORKFLOW_VIEWER", + "RESOURCE_ROLE_WORKFLOW_EXECUTOR", + "RESOURCE_ROLE_SNAPSHOT_ADMIN", + "RESOURCE_ROLE_SNAPSHOT_RUNNER", +] diff --git a/src/gitpod/types/groups/role_assignment.py b/src/gitpod/types/groups/role_assignment.py new file mode 100644 index 00000000..38e30ea8 --- /dev/null +++ b/src/gitpod/types/groups/role_assignment.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .resource_role import ResourceRole +from ..shared.resource_type import ResourceType + +__all__ = ["RoleAssignment"] + + +class RoleAssignment(BaseModel): + """RoleAssignment represents a role assigned to a group on a specific resource""" + + id: Optional[str] = None + """Unique identifier for the role assignment""" + + group_id: Optional[str] = FieldInfo(alias="groupId", default=None) + """Group identifier""" + + organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + """Organization identifier""" + + resource_id: Optional[str] = FieldInfo(alias="resourceId", default=None) + """Resource identifier""" + + resource_role: Optional[ResourceRole] = FieldInfo(alias="resourceRole", default=None) + """Role assigned to the group on this resource""" + + resource_type: Optional[ResourceType] = FieldInfo(alias="resourceType", default=None) + """Type of resource (runner, project, environment, etc.)""" diff --git a/src/gitpod/types/groups/role_assignment_create_params.py b/src/gitpod/types/groups/role_assignment_create_params.py new file mode 100644 index 00000000..d036e80d --- /dev/null +++ b/src/gitpod/types/groups/role_assignment_create_params.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from ..._utils import PropertyInfo +from .resource_role import ResourceRole +from ..shared.resource_type import ResourceType + +__all__ = ["RoleAssignmentCreateParams"] + + +class RoleAssignmentCreateParams(TypedDict, total=False): + group_id: Annotated[str, PropertyInfo(alias="groupId")] + + resource_id: Annotated[str, PropertyInfo(alias="resourceId")] + + resource_role: Annotated[ResourceRole, PropertyInfo(alias="resourceRole")] + """ + ResourceRole represents roles that can be assigned to groups on resources These + map directly to the roles defined in backend/db/rule/rbac/role/role.go + """ + + resource_type: Annotated[ResourceType, PropertyInfo(alias="resourceType")] diff --git a/src/gitpod/types/groups/role_assignment_create_response.py b/src/gitpod/types/groups/role_assignment_create_response.py new file mode 100644 index 00000000..a10b25bf --- /dev/null +++ b/src/gitpod/types/groups/role_assignment_create_response.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .role_assignment import RoleAssignment + +__all__ = ["RoleAssignmentCreateResponse"] + + +class RoleAssignmentCreateResponse(BaseModel): + assignment: Optional[RoleAssignment] = None + """RoleAssignment represents a role assigned to a group on a specific resource""" diff --git a/src/gitpod/types/groups/role_assignment_delete_params.py b/src/gitpod/types/groups/role_assignment_delete_params.py new file mode 100644 index 00000000..5e5bd851 --- /dev/null +++ b/src/gitpod/types/groups/role_assignment_delete_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["RoleAssignmentDeleteParams"] + + +class RoleAssignmentDeleteParams(TypedDict, total=False): + assignment_id: Annotated[str, PropertyInfo(alias="assignmentId")] diff --git a/src/gitpod/types/groups/role_assignment_list_params.py b/src/gitpod/types/groups/role_assignment_list_params.py new file mode 100644 index 00000000..23c236b5 --- /dev/null +++ b/src/gitpod/types/groups/role_assignment_list_params.py @@ -0,0 +1,68 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import Annotated, TypedDict + +from ..._utils import PropertyInfo +from .resource_role import ResourceRole +from ..shared.resource_type import ResourceType + +__all__ = ["RoleAssignmentListParams", "Filter", "Pagination"] + + +class RoleAssignmentListParams(TypedDict, total=False): + token: str + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + + filter: Filter + """Filter parameters""" + + pagination: Pagination + """Pagination parameters""" + + +class Filter(TypedDict, total=False): + """Filter parameters""" + + group_id: Annotated[str, PropertyInfo(alias="groupId")] + """ + group_id filters the response to only role assignments for this specific group + Empty string is allowed and means no filtering by group + """ + + resource_roles: Annotated[List[ResourceRole], PropertyInfo(alias="resourceRoles")] + """ + resource_roles filters the response to only role assignments with these specific + roles + """ + + resource_types: Annotated[List[ResourceType], PropertyInfo(alias="resourceTypes")] + """ + resource_types filters the response to only role assignments for these resource + types + """ + + user_id: Annotated[str, PropertyInfo(alias="userId")] + """ + user_id filters the response to only role assignments for groups that this user + is a member of Empty string is allowed and means no filtering by user + """ + + +class Pagination(TypedDict, total=False): + """Pagination parameters""" + + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/organization.py b/src/gitpod/types/organization.py index 9ecda14c..edf88f15 100644 --- a/src/gitpod/types/organization.py +++ b/src/gitpod/types/organization.py @@ -110,7 +110,7 @@ class Organization(BaseModel): name: str tier: OrganizationTier - """The tier of the organization - free or enterprise""" + """The tier of the organization - free, enterprise or core""" updated_at: datetime = FieldInfo(alias="updatedAt") """ diff --git a/src/gitpod/types/organization_list_members_params.py b/src/gitpod/types/organization_list_members_params.py index ad8d4495..06c529e8 100644 --- a/src/gitpod/types/organization_list_members_params.py +++ b/src/gitpod/types/organization_list_members_params.py @@ -6,7 +6,7 @@ from .._utils import PropertyInfo -__all__ = ["OrganizationListMembersParams", "Pagination"] +__all__ = ["OrganizationListMembersParams", "Filter", "Pagination"] class OrganizationListMembersParams(TypedDict, total=False): @@ -17,10 +17,17 @@ class OrganizationListMembersParams(TypedDict, total=False): page_size: Annotated[int, PropertyInfo(alias="pageSize")] + filter: Filter + pagination: Pagination """pagination contains the pagination options for listing members""" +class Filter(TypedDict, total=False): + search: str + """search performs case-insensitive search across member name and email""" + + class Pagination(TypedDict, total=False): """pagination contains the pagination options for listing members""" diff --git a/src/gitpod/types/organization_tier.py b/src/gitpod/types/organization_tier.py index ea000b24..c1c70936 100644 --- a/src/gitpod/types/organization_tier.py +++ b/src/gitpod/types/organization_tier.py @@ -5,5 +5,9 @@ __all__ = ["OrganizationTier"] OrganizationTier: TypeAlias = Literal[ - "ORGANIZATION_TIER_UNSPECIFIED", "ORGANIZATION_TIER_FREE", "ORGANIZATION_TIER_ENTERPRISE" + "ORGANIZATION_TIER_UNSPECIFIED", + "ORGANIZATION_TIER_FREE", + "ORGANIZATION_TIER_ENTERPRISE", + "ORGANIZATION_TIER_CORE", + "ORGANIZATION_TIER_FREE_ONA", ] diff --git a/src/gitpod/types/organizations/__init__.py b/src/gitpod/types/organizations/__init__.py index edd5451d..ba4b2b58 100644 --- a/src/gitpod/types/organizations/__init__.py +++ b/src/gitpod/types/organizations/__init__.py @@ -2,13 +2,18 @@ from __future__ import annotations +from .agent_policy import AgentPolicy as AgentPolicy +from .custom_domain import CustomDomain as CustomDomain from .provider_type import ProviderType as ProviderType from .sso_configuration import SSOConfiguration as SSOConfiguration +from .crowd_strike_config import CrowdStrikeConfig as CrowdStrikeConfig from .domain_verification import DomainVerification as DomainVerification from .organization_invite import OrganizationInvite as OrganizationInvite from .invite_create_params import InviteCreateParams as InviteCreateParams from .policy_update_params import PolicyUpdateParams as PolicyUpdateParams from .organization_policies import OrganizationPolicies as OrganizationPolicies +from .security_agent_policy import SecurityAgentPolicy as SecurityAgentPolicy +from .custom_domain_provider import CustomDomainProvider as CustomDomainProvider from .invite_create_response import InviteCreateResponse as InviteCreateResponse from .invite_retrieve_params import InviteRetrieveParams as InviteRetrieveParams from .policy_retrieve_params import PolicyRetrieveParams as PolicyRetrieveParams @@ -17,8 +22,15 @@ from .policy_retrieve_response import PolicyRetrieveResponse as PolicyRetrieveResponse from .domain_verification_state import DomainVerificationState as DomainVerificationState from .invite_get_summary_params import InviteGetSummaryParams as InviteGetSummaryParams +from .custom_domain_create_params import CustomDomainCreateParams as CustomDomainCreateParams +from .custom_domain_delete_params import CustomDomainDeleteParams as CustomDomainDeleteParams +from .custom_domain_update_params import CustomDomainUpdateParams as CustomDomainUpdateParams from .invite_get_summary_response import InviteGetSummaryResponse as InviteGetSummaryResponse +from .custom_domain_create_response import CustomDomainCreateResponse as CustomDomainCreateResponse +from .custom_domain_retrieve_params import CustomDomainRetrieveParams as CustomDomainRetrieveParams +from .custom_domain_update_response import CustomDomainUpdateResponse as CustomDomainUpdateResponse from .sso_configuration_list_params import SSOConfigurationListParams as SSOConfigurationListParams +from .custom_domain_retrieve_response import CustomDomainRetrieveResponse as CustomDomainRetrieveResponse from .domain_verification_list_params import DomainVerificationListParams as DomainVerificationListParams from .sso_configuration_create_params import SSOConfigurationCreateParams as SSOConfigurationCreateParams from .sso_configuration_delete_params import SSOConfigurationDeleteParams as SSOConfigurationDeleteParams diff --git a/src/gitpod/types/organizations/agent_policy.py b/src/gitpod/types/organizations/agent_policy.py new file mode 100644 index 00000000..7f5e1de9 --- /dev/null +++ b/src/gitpod/types/organizations/agent_policy.py @@ -0,0 +1,31 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["AgentPolicy"] + + +class AgentPolicy(BaseModel): + """AgentPolicy contains agent-specific policy settings for an organization""" + + command_deny_list: List[str] = FieldInfo(alias="commandDenyList") + """ + command_deny_list contains a list of commands that agents are not allowed to + execute + """ + + mcp_disabled: bool = FieldInfo(alias="mcpDisabled") + """ + mcp_disabled controls whether MCP (Model Context Protocol) is disabled for + agents + """ + + scm_tools_disabled: bool = FieldInfo(alias="scmToolsDisabled") + """ + scm_tools_disabled controls whether SCM (Source Control Management) tools are + disabled for agents + """ diff --git a/src/gitpod/types/organizations/crowd_strike_config.py b/src/gitpod/types/organizations/crowd_strike_config.py new file mode 100644 index 00000000..2afe1119 --- /dev/null +++ b/src/gitpod/types/organizations/crowd_strike_config.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CrowdStrikeConfig"] + + +class CrowdStrikeConfig(BaseModel): + """CrowdStrikeConfig configures CrowdStrike Falcon sensor deployment""" + + additional_options: Optional[Dict[str, str]] = FieldInfo(alias="additionalOptions", default=None) + """ + additional*options contains additional FALCONCTL_OPT*\\** options as key-value + pairs. Keys should NOT include the FALCONCTL*OPT* prefix. + """ + + cid_secret_id: Optional[str] = FieldInfo(alias="cidSecretId", default=None) + """ + cid_secret_id references an organization secret containing the Customer ID + (CID). + """ + + enabled: Optional[bool] = None + """enabled controls whether CrowdStrike Falcon is deployed to environments""" + + image: Optional[str] = None + """image is the CrowdStrike Falcon sensor container image reference""" + + tags: Optional[str] = None + """tags are optional tags to apply to the Falcon sensor (comma-separated)""" diff --git a/src/gitpod/types/organizations/custom_domain.py b/src/gitpod/types/organizations/custom_domain.py new file mode 100644 index 00000000..80f99740 --- /dev/null +++ b/src/gitpod/types/organizations/custom_domain.py @@ -0,0 +1,42 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .custom_domain_provider import CustomDomainProvider + +__all__ = ["CustomDomain"] + + +class CustomDomain(BaseModel): + """CustomDomain represents a custom domain configuration for an organization""" + + id: str + """id is the unique identifier of the custom domain""" + + created_at: datetime = FieldInfo(alias="createdAt") + """created_at is when the custom domain was created""" + + domain_name: str = FieldInfo(alias="domainName") + """domain_name is the custom domain name""" + + organization_id: str = FieldInfo(alias="organizationId") + """organization_id is the ID of the organization this custom domain belongs to""" + + updated_at: datetime = FieldInfo(alias="updatedAt") + """updated_at is when the custom domain was last updated""" + + aws_account_id: Optional[str] = FieldInfo(alias="awsAccountId", default=None) + """aws_account_id is the AWS account ID (deprecated: use cloud_account_id)""" + + cloud_account_id: Optional[str] = FieldInfo(alias="cloudAccountId", default=None) + """ + cloud_account_id is the unified cloud account identifier (AWS Account ID or GCP + Project ID) + """ + + provider: Optional[CustomDomainProvider] = None + """provider is the cloud provider for this custom domain""" diff --git a/src/gitpod/types/organizations/custom_domain_create_params.py b/src/gitpod/types/organizations/custom_domain_create_params.py new file mode 100644 index 00000000..f0016613 --- /dev/null +++ b/src/gitpod/types/organizations/custom_domain_create_params.py @@ -0,0 +1,31 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .custom_domain_provider import CustomDomainProvider + +__all__ = ["CustomDomainCreateParams"] + + +class CustomDomainCreateParams(TypedDict, total=False): + domain_name: Required[Annotated[str, PropertyInfo(alias="domainName")]] + """domain_name is the custom domain name""" + + organization_id: Required[Annotated[str, PropertyInfo(alias="organizationId")]] + """organization_id is the ID of the organization to create the custom domain for""" + + aws_account_id: Annotated[Optional[str], PropertyInfo(alias="awsAccountId")] + """aws_account_id is the AWS account ID (deprecated: use cloud_account_id)""" + + cloud_account_id: Annotated[Optional[str], PropertyInfo(alias="cloudAccountId")] + """ + cloud_account_id is the unified cloud account identifier (AWS Account ID or GCP + Project ID) + """ + + provider: CustomDomainProvider + """provider is the cloud provider for this custom domain""" diff --git a/src/gitpod/types/organizations/custom_domain_create_response.py b/src/gitpod/types/organizations/custom_domain_create_response.py new file mode 100644 index 00000000..e85efa98 --- /dev/null +++ b/src/gitpod/types/organizations/custom_domain_create_response.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .custom_domain import CustomDomain + +__all__ = ["CustomDomainCreateResponse"] + + +class CustomDomainCreateResponse(BaseModel): + """CreateCustomDomainResponse is the response message for creating a custom domain""" + + custom_domain: CustomDomain = FieldInfo(alias="customDomain") + """custom_domain is the created custom domain""" diff --git a/src/gitpod/types/organizations/custom_domain_delete_params.py b/src/gitpod/types/organizations/custom_domain_delete_params.py new file mode 100644 index 00000000..45b6257f --- /dev/null +++ b/src/gitpod/types/organizations/custom_domain_delete_params.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["CustomDomainDeleteParams"] + + +class CustomDomainDeleteParams(TypedDict, total=False): + organization_id: Required[Annotated[str, PropertyInfo(alias="organizationId")]] + """organization_id is the ID of the organization to delete custom domain for""" diff --git a/src/gitpod/types/organizations/custom_domain_provider.py b/src/gitpod/types/organizations/custom_domain_provider.py new file mode 100644 index 00000000..c67ad4d9 --- /dev/null +++ b/src/gitpod/types/organizations/custom_domain_provider.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CustomDomainProvider"] + +CustomDomainProvider: TypeAlias = Literal[ + "CUSTOM_DOMAIN_PROVIDER_UNSPECIFIED", "CUSTOM_DOMAIN_PROVIDER_AWS", "CUSTOM_DOMAIN_PROVIDER_GCP" +] diff --git a/src/gitpod/types/organizations/custom_domain_retrieve_params.py b/src/gitpod/types/organizations/custom_domain_retrieve_params.py new file mode 100644 index 00000000..9ff0e3d5 --- /dev/null +++ b/src/gitpod/types/organizations/custom_domain_retrieve_params.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["CustomDomainRetrieveParams"] + + +class CustomDomainRetrieveParams(TypedDict, total=False): + organization_id: Required[Annotated[str, PropertyInfo(alias="organizationId")]] + """organization_id is the ID of the organization to retrieve custom domain for""" diff --git a/src/gitpod/types/organizations/custom_domain_retrieve_response.py b/src/gitpod/types/organizations/custom_domain_retrieve_response.py new file mode 100644 index 00000000..52edd20e --- /dev/null +++ b/src/gitpod/types/organizations/custom_domain_retrieve_response.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .custom_domain import CustomDomain + +__all__ = ["CustomDomainRetrieveResponse"] + + +class CustomDomainRetrieveResponse(BaseModel): + custom_domain: CustomDomain = FieldInfo(alias="customDomain") + """CustomDomain represents a custom domain configuration for an organization""" diff --git a/src/gitpod/types/organizations/custom_domain_update_params.py b/src/gitpod/types/organizations/custom_domain_update_params.py new file mode 100644 index 00000000..9c5b64ce --- /dev/null +++ b/src/gitpod/types/organizations/custom_domain_update_params.py @@ -0,0 +1,31 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .custom_domain_provider import CustomDomainProvider + +__all__ = ["CustomDomainUpdateParams"] + + +class CustomDomainUpdateParams(TypedDict, total=False): + domain_name: Required[Annotated[str, PropertyInfo(alias="domainName")]] + """domain_name is the custom domain name""" + + organization_id: Required[Annotated[str, PropertyInfo(alias="organizationId")]] + """organization_id is the ID of the organization to update custom domain for""" + + aws_account_id: Annotated[Optional[str], PropertyInfo(alias="awsAccountId")] + """aws_account_id is the AWS account ID (deprecated: use cloud_account_id)""" + + cloud_account_id: Annotated[Optional[str], PropertyInfo(alias="cloudAccountId")] + """ + cloud_account_id is the unified cloud account identifier (AWS Account ID or GCP + Project ID) + """ + + provider: Optional[CustomDomainProvider] + """provider is the cloud provider for this custom domain""" diff --git a/src/gitpod/types/organizations/custom_domain_update_response.py b/src/gitpod/types/organizations/custom_domain_update_response.py new file mode 100644 index 00000000..0a206c1c --- /dev/null +++ b/src/gitpod/types/organizations/custom_domain_update_response.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .custom_domain import CustomDomain + +__all__ = ["CustomDomainUpdateResponse"] + + +class CustomDomainUpdateResponse(BaseModel): + """UpdateCustomDomainResponse is the response message for updating a custom domain""" + + custom_domain: CustomDomain = FieldInfo(alias="customDomain") + """custom_domain is the updated custom domain""" diff --git a/src/gitpod/types/organizations/organization_policies.py b/src/gitpod/types/organizations/organization_policies.py index 673c7561..e84968b0 100644 --- a/src/gitpod/types/organizations/organization_policies.py +++ b/src/gitpod/types/organizations/organization_policies.py @@ -1,15 +1,32 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import Dict, List, Optional from pydantic import Field as FieldInfo from ..._models import BaseModel +from .agent_policy import AgentPolicy +from .security_agent_policy import SecurityAgentPolicy -__all__ = ["OrganizationPolicies"] +__all__ = ["OrganizationPolicies", "EditorVersionRestrictions"] + + +class EditorVersionRestrictions(BaseModel): + """EditorVersionPolicy defines the version policy for a specific editor""" + + allowed_versions: Optional[List[str]] = FieldInfo(alias="allowedVersions", default=None) + """ + allowed_versions lists the versions that are allowed If empty, we will use the + latest version of the editor + + Examples for JetBrains: `["2025.2", "2025.1", "2024.3"]` + """ class OrganizationPolicies(BaseModel): + agent_policy: AgentPolicy = FieldInfo(alias="agentPolicy") + """agent_policy contains agent-specific policy settings""" + allowed_editor_ids: List[str] = FieldInfo(alias="allowedEditorIds") """ allowed_editor_ids is the list of editor IDs that are allowed to be used in the @@ -64,9 +81,46 @@ class OrganizationPolicies(BaseModel): organization """ + require_custom_domain_access: bool = FieldInfo(alias="requireCustomDomainAccess") + """ + require_custom_domain_access controls whether users must access via custom + domain when one is configured. When true, access via app.gitpod.io is blocked. + """ + + delete_archived_environments_after: Optional[str] = FieldInfo(alias="deleteArchivedEnvironmentsAfter", default=None) + """ + delete_archived_environments_after controls how long archived environments are + kept before automatic deletion. 0 means no automatic deletion. Maximum duration + is 4 weeks (2419200 seconds). + """ + + editor_version_restrictions: Optional[Dict[str, EditorVersionRestrictions]] = FieldInfo( + alias="editorVersionRestrictions", default=None + ) + """ + editor_version_restrictions restricts which editor versions can be used. Maps + editor ID to version policy, editor_version_restrictions not set means no + restrictions. If empty or not set for an editor, we will use the latest version + of the editor + """ + + maximum_environment_lifetime: Optional[str] = FieldInfo(alias="maximumEnvironmentLifetime", default=None) + """ + maximum_environment_lifetime controls for how long environments are allowed to + be reused. 0 means no maximum lifetime. Maximum duration is 180 days (15552000 + seconds). + """ + maximum_environment_timeout: Optional[str] = FieldInfo(alias="maximumEnvironmentTimeout", default=None) """ maximum_environment_timeout controls the maximum timeout allowed for environments in seconds. 0 means no limit (never). Minimum duration is 30 - minutes. + minutes (1800 seconds). + """ + + security_agent_policy: Optional[SecurityAgentPolicy] = FieldInfo(alias="securityAgentPolicy", default=None) + """ + security_agent_policy contains security agent configuration for the + organization. When configured, security agents are automatically deployed to all + environments. """ diff --git a/src/gitpod/types/organizations/policy_update_params.py b/src/gitpod/types/organizations/policy_update_params.py index acd315bd..50cfaae4 100644 --- a/src/gitpod/types/organizations/policy_update_params.py +++ b/src/gitpod/types/organizations/policy_update_params.py @@ -2,19 +2,28 @@ from __future__ import annotations -from typing import Optional +from typing import Dict, Optional from typing_extensions import Required, Annotated, TypedDict from ..._types import SequenceNotStr from ..._utils import PropertyInfo -__all__ = ["PolicyUpdateParams"] +__all__ = [ + "PolicyUpdateParams", + "AgentPolicy", + "EditorVersionRestrictions", + "SecurityAgentPolicy", + "SecurityAgentPolicyCrowdstrike", +] class PolicyUpdateParams(TypedDict, total=False): organization_id: Required[Annotated[str, PropertyInfo(alias="organizationId")]] """organization_id is the ID of the organization to update policies for""" + agent_policy: Annotated[Optional[AgentPolicy], PropertyInfo(alias="agentPolicy")] + """agent_policy contains agent-specific policy settings""" + allowed_editor_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="allowedEditorIds")] """ allowed_editor_ids is the list of editor IDs that are allowed to be used in the @@ -39,6 +48,28 @@ class PolicyUpdateParams(TypedDict, total=False): repo """ + delete_archived_environments_after: Annotated[Optional[str], PropertyInfo(alias="deleteArchivedEnvironmentsAfter")] + """ + delete_archived_environments_after controls how long archived environments are + kept before automatic deletion. 0 means no automatic deletion. Maximum duration + is 4 weeks (2419200 seconds). + """ + + editor_version_restrictions: Annotated[ + Dict[str, EditorVersionRestrictions], PropertyInfo(alias="editorVersionRestrictions") + ] + """ + editor_version_restrictions restricts which editor versions can be used. Maps + editor ID to version policy with allowed major versions. + """ + + maximum_environment_lifetime: Annotated[Optional[str], PropertyInfo(alias="maximumEnvironmentLifetime")] + """ + maximum_environment_lifetime controls for how long environments are allowed to + be reused. 0 means no maximum lifetime. Maximum duration is 180 days (15552000 + seconds). + """ + maximum_environments_per_user: Annotated[Optional[str], PropertyInfo(alias="maximumEnvironmentsPerUser")] """ maximum_environments_per_user limits total environments (running or stopped) per @@ -49,7 +80,7 @@ class PolicyUpdateParams(TypedDict, total=False): """ maximum_environment_timeout controls the maximum timeout allowed for environments in seconds. 0 means no limit (never). Minimum duration is 30 - minutes. + minutes (1800 seconds). """ maximum_running_environments_per_user: Annotated[ @@ -74,3 +105,77 @@ class PolicyUpdateParams(TypedDict, total=False): port_sharing_disabled controls whether port sharing is disabled in the organization """ + + require_custom_domain_access: Annotated[Optional[bool], PropertyInfo(alias="requireCustomDomainAccess")] + """ + require_custom_domain_access controls whether users must access via custom + domain when one is configured. When true, access via app.gitpod.io is blocked. + """ + + security_agent_policy: Annotated[Optional[SecurityAgentPolicy], PropertyInfo(alias="securityAgentPolicy")] + """security_agent_policy contains security agent configuration updates""" + + +class AgentPolicy(TypedDict, total=False): + """agent_policy contains agent-specific policy settings""" + + command_deny_list: Annotated[SequenceNotStr[str], PropertyInfo(alias="commandDenyList")] + """ + command_deny_list contains a list of commands that agents are not allowed to + execute + """ + + mcp_disabled: Annotated[Optional[bool], PropertyInfo(alias="mcpDisabled")] + """ + mcp_disabled controls whether MCP (Model Context Protocol) is disabled for + agents + """ + + scm_tools_disabled: Annotated[Optional[bool], PropertyInfo(alias="scmToolsDisabled")] + """ + scm_tools_disabled controls whether SCM (Source Control Management) tools are + disabled for agents + """ + + +class EditorVersionRestrictions(TypedDict, total=False): + """EditorVersionPolicy defines the version policy for a specific editor""" + + allowed_versions: Annotated[SequenceNotStr[str], PropertyInfo(alias="allowedVersions")] + """ + allowed_versions lists the versions that are allowed If empty, we will use the + latest version of the editor + + Examples for JetBrains: `["2025.2", "2025.1", "2024.3"]` + """ + + +class SecurityAgentPolicyCrowdstrike(TypedDict, total=False): + """crowdstrike contains CrowdStrike Falcon configuration updates""" + + additional_options: Annotated[Dict[str, str], PropertyInfo(alias="additionalOptions")] + """ + additional*options contains additional FALCONCTL_OPT*\\** options as key-value + pairs + """ + + cid_secret_id: Annotated[Optional[str], PropertyInfo(alias="cidSecretId")] + """ + cid_secret_id references an organization secret containing the Customer ID (CID) + """ + + enabled: Optional[bool] + """enabled controls whether CrowdStrike Falcon is deployed to environments""" + + image: Optional[str] + """image is the CrowdStrike Falcon sensor container image reference""" + + tags: Optional[str] + """tags are optional tags to apply to the Falcon sensor""" + + +class SecurityAgentPolicy(TypedDict, total=False): + """security_agent_policy contains security agent configuration updates""" + + crowdstrike: Optional[SecurityAgentPolicyCrowdstrike] + """crowdstrike contains CrowdStrike Falcon configuration updates""" diff --git a/src/gitpod/types/organizations/security_agent_policy.py b/src/gitpod/types/organizations/security_agent_policy.py new file mode 100644 index 00000000..f10c816e --- /dev/null +++ b/src/gitpod/types/organizations/security_agent_policy.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .crowd_strike_config import CrowdStrikeConfig + +__all__ = ["SecurityAgentPolicy"] + + +class SecurityAgentPolicy(BaseModel): + """ + SecurityAgentPolicy contains security agent configuration for an organization. + When enabled, security agents are automatically deployed to all environments. + """ + + crowdstrike: Optional[CrowdStrikeConfig] = None + """crowdstrike contains CrowdStrike Falcon configuration""" diff --git a/src/gitpod/types/organizations/sso_configuration.py b/src/gitpod/types/organizations/sso_configuration.py index 4ae99127..7f7f70b7 100644 --- a/src/gitpod/types/organizations/sso_configuration.py +++ b/src/gitpod/types/organizations/sso_configuration.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, Optional +from typing import Dict, List, Optional from pydantic import Field as FieldInfo @@ -32,4 +32,8 @@ class SSOConfiguration(BaseModel): client_id: Optional[str] = FieldInfo(alias="clientId", default=None) """client_id is the client ID of the OIDC application set on the IdP""" + display_name: Optional[str] = FieldInfo(alias="displayName", default=None) + email_domain: Optional[str] = FieldInfo(alias="emailDomain", default=None) + + email_domains: Optional[List[str]] = FieldInfo(alias="emailDomains", default=None) diff --git a/src/gitpod/types/organizations/sso_configuration_create_params.py b/src/gitpod/types/organizations/sso_configuration_create_params.py index cd14f5c0..04f39fb1 100644 --- a/src/gitpod/types/organizations/sso_configuration_create_params.py +++ b/src/gitpod/types/organizations/sso_configuration_create_params.py @@ -2,8 +2,10 @@ from __future__ import annotations +from typing import Optional from typing_extensions import Required, Annotated, TypedDict +from ..._types import SequenceNotStr from ..._utils import PropertyInfo __all__ = ["SSOConfigurationCreateParams"] @@ -16,10 +18,14 @@ class SSOConfigurationCreateParams(TypedDict, total=False): client_secret: Required[Annotated[str, PropertyInfo(alias="clientSecret")]] """client_secret is the client secret of the OIDC application set on the IdP""" - email_domain: Required[Annotated[str, PropertyInfo(alias="emailDomain")]] - """email_domain is the domain that is allowed to sign in to the organization""" - issuer_url: Required[Annotated[str, PropertyInfo(alias="issuerUrl")]] """issuer_url is the URL of the IdP issuer""" organization_id: Required[Annotated[str, PropertyInfo(alias="organizationId")]] + + display_name: Annotated[str, PropertyInfo(alias="displayName")] + + email_domain: Annotated[Optional[str], PropertyInfo(alias="emailDomain")] + """email_domain is the domain that is allowed to sign in to the organization""" + + email_domains: Annotated[SequenceNotStr[str], PropertyInfo(alias="emailDomains")] diff --git a/src/gitpod/types/organizations/sso_configuration_update_params.py b/src/gitpod/types/organizations/sso_configuration_update_params.py index 4af2dab7..998789ab 100644 --- a/src/gitpod/types/organizations/sso_configuration_update_params.py +++ b/src/gitpod/types/organizations/sso_configuration_update_params.py @@ -5,6 +5,7 @@ from typing import Dict, Optional from typing_extensions import Required, Annotated, TypedDict +from ..._types import SequenceNotStr from ..._utils import PropertyInfo from .sso_configuration_state import SSOConfigurationState @@ -24,8 +25,12 @@ class SSOConfigurationUpdateParams(TypedDict, total=False): client_secret: Annotated[Optional[str], PropertyInfo(alias="clientSecret")] """client_secret is the client secret of the SSO provider""" + display_name: Annotated[Optional[str], PropertyInfo(alias="displayName")] + email_domain: Annotated[Optional[str], PropertyInfo(alias="emailDomain")] + email_domains: Annotated[SequenceNotStr[str], PropertyInfo(alias="emailDomains")] + issuer_url: Annotated[Optional[str], PropertyInfo(alias="issuerUrl")] """issuer_url is the URL of the IdP issuer""" diff --git a/src/gitpod/types/prebuild.py b/src/gitpod/types/prebuild.py new file mode 100644 index 00000000..eb1eaddd --- /dev/null +++ b/src/gitpod/types/prebuild.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .._models import BaseModel +from .prebuild_spec import PrebuildSpec +from .prebuild_status import PrebuildStatus +from .prebuild_metadata import PrebuildMetadata + +__all__ = ["Prebuild"] + + +class Prebuild(BaseModel): + """ + Prebuild represents a prebuild for a project that creates a snapshot + for faster environment startup times. + """ + + metadata: PrebuildMetadata + """metadata contains organizational and ownership information""" + + spec: PrebuildSpec + """spec contains the configuration used to create this prebuild""" + + status: PrebuildStatus + """status contains the current status and progress of the prebuild""" + + id: Optional[str] = None + """id is the unique identifier for the prebuild""" diff --git a/src/gitpod/types/prebuild_cancel_params.py b/src/gitpod/types/prebuild_cancel_params.py new file mode 100644 index 00000000..476eb099 --- /dev/null +++ b/src/gitpod/types/prebuild_cancel_params.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["PrebuildCancelParams"] + + +class PrebuildCancelParams(TypedDict, total=False): + prebuild_id: Required[Annotated[str, PropertyInfo(alias="prebuildId")]] + """prebuild_id specifies the prebuild to cancel""" diff --git a/src/gitpod/types/prebuild_cancel_response.py b/src/gitpod/types/prebuild_cancel_response.py new file mode 100644 index 00000000..9f388e17 --- /dev/null +++ b/src/gitpod/types/prebuild_cancel_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .._models import BaseModel +from .prebuild import Prebuild + +__all__ = ["PrebuildCancelResponse"] + + +class PrebuildCancelResponse(BaseModel): + prebuild: Prebuild + """ + Prebuild represents a prebuild for a project that creates a snapshot for faster + environment startup times. + """ diff --git a/src/gitpod/types/prebuild_create_logs_token_params.py b/src/gitpod/types/prebuild_create_logs_token_params.py new file mode 100644 index 00000000..ea9f1e18 --- /dev/null +++ b/src/gitpod/types/prebuild_create_logs_token_params.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["PrebuildCreateLogsTokenParams"] + + +class PrebuildCreateLogsTokenParams(TypedDict, total=False): + prebuild_id: Required[Annotated[str, PropertyInfo(alias="prebuildId")]] + """prebuild_id specifies the prebuild for which the logs token should be created. + + +required + """ diff --git a/src/gitpod/types/prebuild_create_logs_token_response.py b/src/gitpod/types/prebuild_create_logs_token_response.py new file mode 100644 index 00000000..afbbaafc --- /dev/null +++ b/src/gitpod/types/prebuild_create_logs_token_response.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["PrebuildCreateLogsTokenResponse"] + + +class PrebuildCreateLogsTokenResponse(BaseModel): + access_token: str = FieldInfo(alias="accessToken") + """access_token is the token that can be used to access the logs of the prebuild""" diff --git a/src/gitpod/types/prebuild_create_params.py b/src/gitpod/types/prebuild_create_params.py new file mode 100644 index 00000000..038f30e4 --- /dev/null +++ b/src/gitpod/types/prebuild_create_params.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Required, Annotated, TypedDict + +from .._utils import PropertyInfo +from .prebuild_spec_param import PrebuildSpecParam + +__all__ = ["PrebuildCreateParams"] + + +class PrebuildCreateParams(TypedDict, total=False): + project_id: Required[Annotated[str, PropertyInfo(alias="projectId")]] + """project_id specifies the project to create a prebuild for""" + + spec: Required[PrebuildSpecParam] + """spec contains the configuration for creating the prebuild""" + + environment_class_id: Annotated[Optional[str], PropertyInfo(alias="environmentClassId")] + """ + environment_class_id specifies which environment class to use for the prebuild. + If not specified, uses the project's default environment class. + """ diff --git a/src/gitpod/types/prebuild_create_response.py b/src/gitpod/types/prebuild_create_response.py new file mode 100644 index 00000000..c7fdef0d --- /dev/null +++ b/src/gitpod/types/prebuild_create_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .._models import BaseModel +from .prebuild import Prebuild + +__all__ = ["PrebuildCreateResponse"] + + +class PrebuildCreateResponse(BaseModel): + prebuild: Prebuild + """ + Prebuild represents a prebuild for a project that creates a snapshot for faster + environment startup times. + """ diff --git a/src/gitpod/types/prebuild_delete_params.py b/src/gitpod/types/prebuild_delete_params.py new file mode 100644 index 00000000..8b19ddc7 --- /dev/null +++ b/src/gitpod/types/prebuild_delete_params.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["PrebuildDeleteParams"] + + +class PrebuildDeleteParams(TypedDict, total=False): + prebuild_id: Required[Annotated[str, PropertyInfo(alias="prebuildId")]] + """prebuild_id specifies the prebuild to delete""" diff --git a/src/gitpod/types/prebuild_list_params.py b/src/gitpod/types/prebuild_list_params.py new file mode 100644 index 00000000..59075354 --- /dev/null +++ b/src/gitpod/types/prebuild_list_params.py @@ -0,0 +1,50 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import Annotated, TypedDict + +from .._types import SequenceNotStr +from .._utils import PropertyInfo +from .prebuild_phase import PrebuildPhase + +__all__ = ["PrebuildListParams", "Filter", "Pagination"] + + +class PrebuildListParams(TypedDict, total=False): + token: str + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + + filter: Filter + """filter contains the filter options for listing prebuilds""" + + pagination: Pagination + """pagination contains the pagination options for listing prebuilds""" + + +class Filter(TypedDict, total=False): + """filter contains the filter options for listing prebuilds""" + + phases: List[PrebuildPhase] + """phases filters prebuilds by their current phase""" + + project_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="projectIds")] + """project_ids filters prebuilds to specific projects""" + + +class Pagination(TypedDict, total=False): + """pagination contains the pagination options for listing prebuilds""" + + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/prebuild_metadata.py b/src/gitpod/types/prebuild_metadata.py new file mode 100644 index 00000000..80e89bd4 --- /dev/null +++ b/src/gitpod/types/prebuild_metadata.py @@ -0,0 +1,54 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from pydantic import Field as FieldInfo + +from .._models import BaseModel +from .shared.subject import Subject +from .prebuild_trigger import PrebuildTrigger + +__all__ = ["PrebuildMetadata"] + + +class PrebuildMetadata(BaseModel): + """PrebuildMetadata contains metadata about the prebuild""" + + created_at: datetime = FieldInfo(alias="createdAt") + """created_at is when the prebuild was created""" + + creator: Subject + """ + creator is the identity of who created the prebuild. For manual prebuilds, this + is the user who triggered it. For scheduled prebuilds, this is the configured + executor. + """ + + updated_at: datetime = FieldInfo(alias="updatedAt") + """updated_at is when the prebuild was last updated""" + + environment_class_id: Optional[str] = FieldInfo(alias="environmentClassId", default=None) + """ + environment_class_id is the environment class used to create this prebuild. + While the prebuild is created with a specific environment class, environments + with different classes (e.g., smaller or larger instance sizes) can be created + from the same prebuild, as long as they run on the same runner. If not specified + in create requests, uses the project's default environment class. + """ + + executor: Optional[Subject] = None + """ + executor is the identity used to run the prebuild. The executor's SCM + credentials are used to clone the repository. If not set, the creator's identity + is used. + """ + + organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + """organization_id is the ID of the organization that owns the prebuild""" + + project_id: Optional[str] = FieldInfo(alias="projectId", default=None) + """project_id is the ID of the project this prebuild was created for""" + + triggered_by: Optional[PrebuildTrigger] = FieldInfo(alias="triggeredBy", default=None) + """trigger describes the trigger that created this prebuild.""" diff --git a/src/gitpod/types/prebuild_phase.py b/src/gitpod/types/prebuild_phase.py new file mode 100644 index 00000000..f4066cf4 --- /dev/null +++ b/src/gitpod/types/prebuild_phase.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["PrebuildPhase"] + +PrebuildPhase: TypeAlias = Literal[ + "PREBUILD_PHASE_UNSPECIFIED", + "PREBUILD_PHASE_PENDING", + "PREBUILD_PHASE_STARTING", + "PREBUILD_PHASE_RUNNING", + "PREBUILD_PHASE_STOPPING", + "PREBUILD_PHASE_SNAPSHOTTING", + "PREBUILD_PHASE_COMPLETED", + "PREBUILD_PHASE_FAILED", + "PREBUILD_PHASE_CANCELLING", + "PREBUILD_PHASE_CANCELLED", + "PREBUILD_PHASE_DELETING", + "PREBUILD_PHASE_DELETED", +] diff --git a/src/gitpod/types/prebuild_retrieve_params.py b/src/gitpod/types/prebuild_retrieve_params.py new file mode 100644 index 00000000..36f2f51d --- /dev/null +++ b/src/gitpod/types/prebuild_retrieve_params.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["PrebuildRetrieveParams"] + + +class PrebuildRetrieveParams(TypedDict, total=False): + prebuild_id: Required[Annotated[str, PropertyInfo(alias="prebuildId")]] + """prebuild_id specifies the prebuild to retrieve""" diff --git a/src/gitpod/types/prebuild_retrieve_response.py b/src/gitpod/types/prebuild_retrieve_response.py new file mode 100644 index 00000000..d3a23009 --- /dev/null +++ b/src/gitpod/types/prebuild_retrieve_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .._models import BaseModel +from .prebuild import Prebuild + +__all__ = ["PrebuildRetrieveResponse"] + + +class PrebuildRetrieveResponse(BaseModel): + prebuild: Prebuild + """ + Prebuild represents a prebuild for a project that creates a snapshot for faster + environment startup times. + """ diff --git a/src/gitpod/types/prebuild_spec.py b/src/gitpod/types/prebuild_spec.py new file mode 100644 index 00000000..478bdd62 --- /dev/null +++ b/src/gitpod/types/prebuild_spec.py @@ -0,0 +1,32 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel +from .prebuild_phase import PrebuildPhase + +__all__ = ["PrebuildSpec"] + + +class PrebuildSpec(BaseModel): + """PrebuildSpec contains the configuration used to create a prebuild""" + + desired_phase: Optional[PrebuildPhase] = FieldInfo(alias="desiredPhase", default=None) + """ + desired_phase is the desired phase of the prebuild. Used to signal cancellation + or other state changes. This field is managed by the API and reconciler. + """ + + spec_version: Optional[str] = FieldInfo(alias="specVersion", default=None) + """ + spec_version is incremented each time the spec is updated. Used for optimistic + concurrency control. + """ + + timeout: Optional[str] = None + """ + timeout is the maximum time allowed for the prebuild to complete. Defaults to 60 + minutes if not specified. Maximum allowed timeout is 2 hours. + """ diff --git a/src/gitpod/types/prebuild_spec_param.py b/src/gitpod/types/prebuild_spec_param.py new file mode 100644 index 00000000..3894f048 --- /dev/null +++ b/src/gitpod/types/prebuild_spec_param.py @@ -0,0 +1,32 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo +from .prebuild_phase import PrebuildPhase + +__all__ = ["PrebuildSpecParam"] + + +class PrebuildSpecParam(TypedDict, total=False): + """PrebuildSpec contains the configuration used to create a prebuild""" + + desired_phase: Annotated[PrebuildPhase, PropertyInfo(alias="desiredPhase")] + """ + desired_phase is the desired phase of the prebuild. Used to signal cancellation + or other state changes. This field is managed by the API and reconciler. + """ + + spec_version: Annotated[str, PropertyInfo(alias="specVersion")] + """ + spec_version is incremented each time the spec is updated. Used for optimistic + concurrency control. + """ + + timeout: str + """ + timeout is the maximum time allowed for the prebuild to complete. Defaults to 60 + minutes if not specified. Maximum allowed timeout is 2 hours. + """ diff --git a/src/gitpod/types/prebuild_status.py b/src/gitpod/types/prebuild_status.py new file mode 100644 index 00000000..70592150 --- /dev/null +++ b/src/gitpod/types/prebuild_status.py @@ -0,0 +1,51 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from pydantic import Field as FieldInfo + +from .._models import BaseModel +from .prebuild_phase import PrebuildPhase + +__all__ = ["PrebuildStatus"] + + +class PrebuildStatus(BaseModel): + """PrebuildStatus contains the current status and progress of a prebuild""" + + phase: PrebuildPhase + """phase is the current phase of the prebuild lifecycle""" + + completion_time: Optional[datetime] = FieldInfo(alias="completionTime", default=None) + """completion_time is when the prebuild completed (successfully or with failure)""" + + environment_id: Optional[str] = FieldInfo(alias="environmentId", default=None) + """ + environment_id is the ID of the environment used to create this prebuild. This + field is set when the prebuild environment is created. + """ + + failure_message: Optional[str] = FieldInfo(alias="failureMessage", default=None) + """failure_message contains details about why the prebuild failed""" + + log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) + """ + log_url provides access to prebuild logs. During prebuild execution, this + references the environment logs. After completion, this may reference archived + logs. + """ + + status_version: Optional[str] = FieldInfo(alias="statusVersion", default=None) + """ + status_version is incremented each time the status is updated. Used for + optimistic concurrency control. + """ + + warning_message: Optional[str] = FieldInfo(alias="warningMessage", default=None) + """ + warning_message contains warnings from the prebuild environment that indicate + something went wrong but the prebuild could still complete. For example, the + devcontainer failed to build but the environment is still usable. These warnings + will likely affect any environment started from this prebuild. + """ diff --git a/src/gitpod/types/prebuild_trigger.py b/src/gitpod/types/prebuild_trigger.py new file mode 100644 index 00000000..dc961c88 --- /dev/null +++ b/src/gitpod/types/prebuild_trigger.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["PrebuildTrigger"] + +PrebuildTrigger: TypeAlias = Literal[ + "PREBUILD_TRIGGER_UNSPECIFIED", "PREBUILD_TRIGGER_MANUAL", "PREBUILD_TRIGGER_SCHEDULED" +] diff --git a/src/gitpod/types/project.py b/src/gitpod/types/project.py index 80e2586f..f5039be5 100644 --- a/src/gitpod/types/project.py +++ b/src/gitpod/types/project.py @@ -5,10 +5,12 @@ from pydantic import Field as FieldInfo from .._models import BaseModel +from .project_phase import ProjectPhase from .shared.subject import Subject from .project_metadata import ProjectMetadata from .environment_initializer import EnvironmentInitializer -from .project_environment_class import ProjectEnvironmentClass +from .project_prebuild_configuration import ProjectPrebuildConfiguration +from .shared.project_environment_class import ProjectEnvironmentClass __all__ = ["Project", "UsedBy"] @@ -26,6 +28,7 @@ class UsedBy(BaseModel): class Project(BaseModel): environment_class: ProjectEnvironmentClass = FieldInfo(alias="environmentClass") + """Use `environment_classes` instead.""" id: Optional[str] = None """id is the unique identifier for the project""" @@ -36,17 +39,31 @@ class Project(BaseModel): root """ + desired_phase: Optional[ProjectPhase] = FieldInfo(alias="desiredPhase", default=None) + """ + desired_phase is the desired phase of the project When set to DELETED, the + project is pending deletion + """ + devcontainer_file_path: Optional[str] = FieldInfo(alias="devcontainerFilePath", default=None) """ devcontainer_file_path is the path to the devcontainer file relative to the repo root """ + environment_classes: Optional[List[ProjectEnvironmentClass]] = FieldInfo(alias="environmentClasses", default=None) + """environment_classes is the list of environment classes for the project""" + initializer: Optional[EnvironmentInitializer] = None """initializer is the content initializer""" metadata: Optional[ProjectMetadata] = None + prebuild_configuration: Optional[ProjectPrebuildConfiguration] = FieldInfo( + alias="prebuildConfiguration", default=None + ) + """prebuild_configuration defines how prebuilds are created for this project.""" + technical_description: Optional[str] = FieldInfo(alias="technicalDescription", default=None) """ technical_description is a detailed technical description of the project This diff --git a/src/gitpod/types/project_create_params.py b/src/gitpod/types/project_create_params.py index ff3b8b27..fa9ed5b0 100644 --- a/src/gitpod/types/project_create_params.py +++ b/src/gitpod/types/project_create_params.py @@ -6,14 +6,12 @@ from .._utils import PropertyInfo from .environment_initializer_param import EnvironmentInitializerParam -from .project_environment_class_param import ProjectEnvironmentClassParam +from .project_prebuild_configuration_param import ProjectPrebuildConfigurationParam __all__ = ["ProjectCreateParams"] class ProjectCreateParams(TypedDict, total=False): - environment_class: Required[Annotated[ProjectEnvironmentClassParam, PropertyInfo(alias="environmentClass")]] - initializer: Required[EnvironmentInitializerParam] """initializer is the content initializer""" @@ -39,6 +37,12 @@ class ProjectCreateParams(TypedDict, total=False): name: str + prebuild_configuration: Annotated[ProjectPrebuildConfigurationParam, PropertyInfo(alias="prebuildConfiguration")] + """ + prebuild_configuration defines how prebuilds are created for this project. If + not set, prebuilds are disabled for the project. + """ + technical_description: Annotated[str, PropertyInfo(alias="technicalDescription")] """ technical_description is a detailed technical description of the project This diff --git a/src/gitpod/types/project_list_params.py b/src/gitpod/types/project_list_params.py index ccd432f5..ea25cc93 100644 --- a/src/gitpod/types/project_list_params.py +++ b/src/gitpod/types/project_list_params.py @@ -25,6 +25,18 @@ class Filter(TypedDict, total=False): project_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="projectIds")] """project_ids filters the response to only projects with these IDs""" + runner_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="runnerIds")] + """ + runner_ids filters the response to only projects that use environment classes + from these runners + """ + + search: str + """ + search performs case-insensitive search across project name, project ID, and + repository name + """ + class Pagination(TypedDict, total=False): """pagination contains the pagination options for listing organizations""" diff --git a/src/gitpod/types/project_phase.py b/src/gitpod/types/project_phase.py new file mode 100644 index 00000000..b6f34bae --- /dev/null +++ b/src/gitpod/types/project_phase.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["ProjectPhase"] + +ProjectPhase: TypeAlias = Literal["PROJECT_PHASE_UNSPECIFIED", "PROJECT_PHASE_ACTIVE", "PROJECT_PHASE_DELETED"] diff --git a/src/gitpod/types/project_prebuild_configuration.py b/src/gitpod/types/project_prebuild_configuration.py new file mode 100644 index 00000000..53a227de --- /dev/null +++ b/src/gitpod/types/project_prebuild_configuration.py @@ -0,0 +1,74 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel +from .shared.subject import Subject + +__all__ = ["ProjectPrebuildConfiguration", "Trigger", "TriggerDailySchedule"] + + +class TriggerDailySchedule(BaseModel): + """ + daily_schedule triggers a prebuild once per day at the specified hour (UTC). + The actual start time may vary slightly to distribute system load. + """ + + hour_utc: Optional[int] = FieldInfo(alias="hourUtc", default=None) + """ + 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. + """ + + +class Trigger(BaseModel): + """trigger defines when prebuilds should be created.""" + + daily_schedule: TriggerDailySchedule = FieldInfo(alias="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. + """ + + +class ProjectPrebuildConfiguration(BaseModel): + """ + ProjectPrebuildConfiguration defines how prebuilds are created for a project. + Prebuilds create environment snapshots that enable faster environment startup times. + """ + + enabled: Optional[bool] = None + """ + enabled controls whether prebuilds are created for this project. When disabled, + no automatic prebuilds will be triggered. + """ + + enable_jetbrains_warmup: Optional[bool] = FieldInfo(alias="enableJetbrainsWarmup", default=None) + """ + enable_jetbrains_warmup controls whether JetBrains IDE warmup runs during + prebuilds. + """ + + environment_class_ids: Optional[List[str]] = FieldInfo(alias="environmentClassIds", default=None) + """ + environment_class_ids specifies which environment classes should have prebuilds + created. If empty, no prebuilds are created. + """ + + executor: Optional[Subject] = None + """ + 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: Optional[str] = None + """ + 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: Optional[Trigger] = None + """trigger defines when prebuilds should be created.""" diff --git a/src/gitpod/types/project_prebuild_configuration_param.py b/src/gitpod/types/project_prebuild_configuration_param.py new file mode 100644 index 00000000..a39e531a --- /dev/null +++ b/src/gitpod/types/project_prebuild_configuration_param.py @@ -0,0 +1,75 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from .._types import SequenceNotStr +from .._utils import PropertyInfo +from .shared_params.subject import Subject + +__all__ = ["ProjectPrebuildConfigurationParam", "Trigger", "TriggerDailySchedule"] + + +class TriggerDailySchedule(TypedDict, total=False): + """ + daily_schedule triggers a prebuild once per day at the specified hour (UTC). + The actual start time may vary slightly to distribute system load. + """ + + hour_utc: Annotated[int, PropertyInfo(alias="hourUtc")] + """ + 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. + """ + + +class Trigger(TypedDict, total=False): + """trigger defines when prebuilds should be created.""" + + daily_schedule: Required[Annotated[TriggerDailySchedule, PropertyInfo(alias="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. + """ + + +class ProjectPrebuildConfigurationParam(TypedDict, total=False): + """ + ProjectPrebuildConfiguration defines how prebuilds are created for a project. + Prebuilds create environment snapshots that enable faster environment startup times. + """ + + enabled: bool + """ + enabled controls whether prebuilds are created for this project. When disabled, + no automatic prebuilds will be triggered. + """ + + enable_jetbrains_warmup: Annotated[bool, PropertyInfo(alias="enableJetbrainsWarmup")] + """ + enable_jetbrains_warmup controls whether JetBrains IDE warmup runs during + prebuilds. + """ + + environment_class_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="environmentClassIds")] + """ + 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: str + """ + 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.""" diff --git a/src/gitpod/types/project_update_params.py b/src/gitpod/types/project_update_params.py index 214d3fa8..c27e98a6 100644 --- a/src/gitpod/types/project_update_params.py +++ b/src/gitpod/types/project_update_params.py @@ -7,7 +7,7 @@ from .._utils import PropertyInfo from .environment_initializer_param import EnvironmentInitializerParam -from .project_environment_class_param import ProjectEnvironmentClassParam +from .project_prebuild_configuration_param import ProjectPrebuildConfigurationParam __all__ = ["ProjectUpdateParams"] @@ -33,13 +33,20 @@ class ProjectUpdateParams(TypedDict, total=False): ``` """ - environment_class: Annotated[Optional[ProjectEnvironmentClassParam], PropertyInfo(alias="environmentClass")] - initializer: Optional[EnvironmentInitializerParam] """initializer is the content initializer""" name: Optional[str] + prebuild_configuration: Annotated[ + Optional[ProjectPrebuildConfigurationParam], PropertyInfo(alias="prebuildConfiguration") + ] + """ + 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. + """ + project_id: Annotated[str, PropertyInfo(alias="projectId")] """project_id specifies the project identifier""" diff --git a/src/gitpod/types/projects/__init__.py b/src/gitpod/types/projects/__init__.py index f6f8d0b8..2620dfc9 100644 --- a/src/gitpod/types/projects/__init__.py +++ b/src/gitpod/types/projects/__init__.py @@ -10,3 +10,5 @@ from .policy_update_params import PolicyUpdateParams as PolicyUpdateParams from .policy_create_response import PolicyCreateResponse as PolicyCreateResponse from .policy_update_response import PolicyUpdateResponse as PolicyUpdateResponse +from .environment_clase_list_params import EnvironmentClaseListParams as EnvironmentClaseListParams +from .environment_clase_update_params import EnvironmentClaseUpdateParams as EnvironmentClaseUpdateParams diff --git a/src/gitpod/types/projects/environment_clase_list_params.py b/src/gitpod/types/projects/environment_clase_list_params.py new file mode 100644 index 00000000..01df8bf0 --- /dev/null +++ b/src/gitpod/types/projects/environment_clase_list_params.py @@ -0,0 +1,37 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["EnvironmentClaseListParams", "Pagination"] + + +class EnvironmentClaseListParams(TypedDict, total=False): + token: str + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + + pagination: Pagination + """pagination contains the pagination options for listing project policies""" + + project_id: Annotated[str, PropertyInfo(alias="projectId")] + """project_id specifies the project identifier""" + + +class Pagination(TypedDict, total=False): + """pagination contains the pagination options for listing project policies""" + + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/projects/environment_clase_update_params.py b/src/gitpod/types/projects/environment_clase_update_params.py new file mode 100644 index 00000000..754fcc02 --- /dev/null +++ b/src/gitpod/types/projects/environment_clase_update_params.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Annotated, TypedDict + +from ..._utils import PropertyInfo +from ..shared_params.project_environment_class import ProjectEnvironmentClass + +__all__ = ["EnvironmentClaseUpdateParams"] + + +class EnvironmentClaseUpdateParams(TypedDict, total=False): + project_environment_classes: Annotated[ + Iterable[ProjectEnvironmentClass], PropertyInfo(alias="projectEnvironmentClasses") + ] + + project_id: Annotated[str, PropertyInfo(alias="projectId")] + """project_id specifies the project identifier""" diff --git a/src/gitpod/types/prompt.py b/src/gitpod/types/prompt.py new file mode 100644 index 00000000..963771ee --- /dev/null +++ b/src/gitpod/types/prompt.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .._models import BaseModel +from .prompt_spec import PromptSpec +from .prompt_metadata import PromptMetadata + +__all__ = ["Prompt"] + + +class Prompt(BaseModel): + id: Optional[str] = None + + metadata: Optional[PromptMetadata] = None + + spec: Optional[PromptSpec] = None diff --git a/src/gitpod/types/prompt_metadata.py b/src/gitpod/types/prompt_metadata.py new file mode 100644 index 00000000..66d65b16 --- /dev/null +++ b/src/gitpod/types/prompt_metadata.py @@ -0,0 +1,209 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from pydantic import Field as FieldInfo + +from .._models import BaseModel +from .shared.subject import Subject + +__all__ = ["PromptMetadata"] + + +class PromptMetadata(BaseModel): + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) + """ + 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()`]() + to obtain a formatter capable of generating timestamps in this format. + """ + + creator: Optional[Subject] = None + """creator is the identity of the prompt creator""" + + description: Optional[str] = None + """description is a description of what the prompt does""" + + name: Optional[str] = None + """name is the human readable name of the prompt""" + + organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + """organization_id is the ID of the organization that contains the prompt""" + + updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) + """ + 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()`]() + to obtain a formatter capable of generating timestamps in this format. + """ diff --git a/src/gitpod/types/prompt_spec.py b/src/gitpod/types/prompt_spec.py new file mode 100644 index 00000000..7db3c112 --- /dev/null +++ b/src/gitpod/types/prompt_spec.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["PromptSpec"] + + +class PromptSpec(BaseModel): + command: Optional[str] = None + """command is the unique command string within the organization""" + + is_command: Optional[bool] = FieldInfo(alias="isCommand", default=None) + """is_command indicates if this prompt is a command""" + + is_template: Optional[bool] = FieldInfo(alias="isTemplate", default=None) + """is_template indicates if this prompt is a template""" + + prompt: Optional[str] = None + """prompt is the content of the prompt""" diff --git a/src/gitpod/types/request_info_param.py b/src/gitpod/types/request_info_param.py new file mode 100644 index 00000000..8e764855 --- /dev/null +++ b/src/gitpod/types/request_info_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["RequestInfoParam"] + + +class RequestInfoParam(TypedDict, total=False): + """Request information (Sentry-compatible)""" + + data: str + """Request body (truncated if large)""" + + headers: Dict[str, str] + """Request headers""" + + method: str + """HTTP method""" + + query_string: Annotated[Dict[str, str], PropertyInfo(alias="queryString")] + """Query parameters""" + + url: str + """Request URL""" diff --git a/src/gitpod/types/runner.py b/src/gitpod/types/runner.py index ec169a36..ff396c37 100644 --- a/src/gitpod/types/runner.py +++ b/src/gitpod/types/runner.py @@ -33,6 +33,12 @@ class Runner(BaseModel): runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) + runner_manager_id: Optional[str] = FieldInfo(alias="runnerManagerId", default=None) + """ + The runner manager id specifies the runner manager for the managed runner. This + field is only set for managed runners. + """ + spec: Optional[RunnerSpec] = None """The runner's specification""" diff --git a/src/gitpod/types/runner_capability.py b/src/gitpod/types/runner_capability.py index 0a668725..b63ac784 100644 --- a/src/gitpod/types/runner_capability.py +++ b/src/gitpod/types/runner_capability.py @@ -11,4 +11,5 @@ "RUNNER_CAPABILITY_AGENT_EXECUTION", "RUNNER_CAPABILITY_ALLOW_ENV_TOKEN_POPULATION", "RUNNER_CAPABILITY_DEFAULT_DEV_CONTAINER_IMAGE", + "RUNNER_CAPABILITY_ENVIRONMENT_SNAPSHOT", ] diff --git a/src/gitpod/types/runner_configuration.py b/src/gitpod/types/runner_configuration.py index 4f91d552..4e4cf1e6 100644 --- a/src/gitpod/types/runner_configuration.py +++ b/src/gitpod/types/runner_configuration.py @@ -20,7 +20,7 @@ class RunnerConfiguration(BaseModel): """ devcontainer_image_cache_enabled controls whether the devcontainer build cache is enabled for this runner. Only takes effect on supported runners, currently - only AWS EC2 runners. + only AWS EC2 and Gitpod-managed runners. """ log_level: Optional[LogLevel] = FieldInfo(alias="logLevel", default=None) diff --git a/src/gitpod/types/runner_configuration_param.py b/src/gitpod/types/runner_configuration_param.py index 7ba49ee7..d29c11fc 100644 --- a/src/gitpod/types/runner_configuration_param.py +++ b/src/gitpod/types/runner_configuration_param.py @@ -20,7 +20,7 @@ class RunnerConfigurationParam(TypedDict, total=False): """ devcontainer_image_cache_enabled controls whether the devcontainer build cache is enabled for this runner. Only takes effect on supported runners, currently - only AWS EC2 runners. + only AWS EC2 and Gitpod-managed runners. """ log_level: Annotated[LogLevel, PropertyInfo(alias="logLevel")] diff --git a/src/gitpod/types/runner_create_logs_token_params.py b/src/gitpod/types/runner_create_logs_token_params.py new file mode 100644 index 00000000..33e853b7 --- /dev/null +++ b/src/gitpod/types/runner_create_logs_token_params.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["RunnerCreateLogsTokenParams"] + + +class RunnerCreateLogsTokenParams(TypedDict, total=False): + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + """runner_id specifies the runner for which the logs token should be created. + + +required + """ diff --git a/src/gitpod/types/runner_create_logs_token_response.py b/src/gitpod/types/runner_create_logs_token_response.py new file mode 100644 index 00000000..8bfe41f7 --- /dev/null +++ b/src/gitpod/types/runner_create_logs_token_response.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["RunnerCreateLogsTokenResponse"] + + +class RunnerCreateLogsTokenResponse(BaseModel): + access_token: str = FieldInfo(alias="accessToken") + """ + access_token is the token that can be used to access the logs and support bundle + of the runner + """ diff --git a/src/gitpod/types/runner_parse_context_url_response.py b/src/gitpod/types/runner_parse_context_url_response.py index e34f770b..c712e408 100644 --- a/src/gitpod/types/runner_parse_context_url_response.py +++ b/src/gitpod/types/runner_parse_context_url_response.py @@ -6,7 +6,7 @@ from .._models import BaseModel -__all__ = ["RunnerParseContextURLResponse", "Git"] +__all__ = ["RunnerParseContextURLResponse", "Git", "Issue", "Pr", "PullRequest", "PullRequestRepository"] class Git(BaseModel): @@ -22,13 +22,93 @@ class Git(BaseModel): repo: Optional[str] = None + tag: Optional[str] = None + upstream_remote_url: Optional[str] = FieldInfo(alias="upstreamRemoteUrl", default=None) +class Issue(BaseModel): + id: Optional[str] = None + """id is the source system's ID of this issue, e.g. BNFRD-6100""" + + title: Optional[str] = None + + +class Pr(BaseModel): + """Deprecated: Use top-level PullRequest message instead""" + + id: Optional[str] = None + + from_branch: Optional[str] = FieldInfo(alias="fromBranch", default=None) + + title: Optional[str] = None + + to_branch: Optional[str] = FieldInfo(alias="toBranch", default=None) + + +class PullRequestRepository(BaseModel): + """Repository information""" + + clone_url: Optional[str] = FieldInfo(alias="cloneUrl", default=None) + + host: Optional[str] = None + + name: Optional[str] = None + + owner: Optional[str] = None + + +class PullRequest(BaseModel): + """ + PullRequest represents pull request metadata from source control systems. + This message is used across workflow triggers, executions, and agent contexts + to maintain consistent PR information throughout the system. + """ + + id: Optional[str] = None + """Unique identifier from the source system (e.g., "123" for GitHub PR #123)""" + + author: Optional[str] = None + """Author name as provided by the SCM system""" + + from_branch: Optional[str] = FieldInfo(alias="fromBranch", default=None) + """Source branch name (the branch being merged from)""" + + repository: Optional[PullRequestRepository] = None + """Repository information""" + + title: Optional[str] = None + """Pull request title""" + + to_branch: Optional[str] = FieldInfo(alias="toBranch", default=None) + """Target branch name (the branch being merged into)""" + + url: Optional[str] = None + """Pull request URL (e.g., "https://github.com/owner/repo/pull/123")""" + + class RunnerParseContextURLResponse(BaseModel): git: Optional[Git] = None + issue: Optional[Issue] = None + original_context_url: Optional[str] = FieldInfo(alias="originalContextUrl", default=None) + pr: Optional[Pr] = None + """Deprecated: Use top-level PullRequest message instead""" + project_ids: Optional[List[str]] = FieldInfo(alias="projectIds", default=None) """project_ids is a list of projects to which the context URL belongs to.""" + + pull_request: Optional[PullRequest] = FieldInfo(alias="pullRequest", default=None) + """ + PullRequest represents pull request metadata from source control systems. This + message is used across workflow triggers, executions, and agent contexts to + maintain consistent PR information throughout the system. + """ + + scm_id: Optional[str] = FieldInfo(alias="scmId", default=None) + """ + scm_id is the unique identifier of the SCM provider (e.g., "github", "gitlab", + "bitbucket") + """ diff --git a/src/gitpod/types/runner_provider.py b/src/gitpod/types/runner_provider.py index 8f8efef0..f0730df4 100644 --- a/src/gitpod/types/runner_provider.py +++ b/src/gitpod/types/runner_provider.py @@ -10,4 +10,5 @@ "RUNNER_PROVIDER_LINUX_HOST", "RUNNER_PROVIDER_DESKTOP_MAC", "RUNNER_PROVIDER_MANAGED", + "RUNNER_PROVIDER_GCP", ] diff --git a/src/gitpod/types/runner_search_repositories_params.py b/src/gitpod/types/runner_search_repositories_params.py new file mode 100644 index 00000000..4b73cd0a --- /dev/null +++ b/src/gitpod/types/runner_search_repositories_params.py @@ -0,0 +1,48 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo +from .search_mode import SearchMode + +__all__ = ["RunnerSearchRepositoriesParams", "Pagination"] + + +class RunnerSearchRepositoriesParams(TypedDict, total=False): + limit: int + """ + Maximum number of repositories to return. Default: 25, Maximum: 100 Deprecated: + Use pagination.page_size instead + """ + + pagination: Pagination + """Pagination parameters for repository search""" + + runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + + scm_host: Annotated[str, PropertyInfo(alias="scmHost")] + """The SCM's host to retrieve repositories from""" + + search_mode: Annotated[SearchMode, PropertyInfo(alias="searchMode")] + """Search mode determines how search_string is interpreted""" + + search_string: Annotated[str, PropertyInfo(alias="searchString")] + """Search query - interpretation depends on search_mode""" + + +class Pagination(TypedDict, total=False): + """Pagination parameters for repository search""" + + token: str + """ + Token for the next set of results that was returned as next_token of a + PaginationResponse + """ + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + """Page size is the maximum number of results to retrieve per page. Defaults to 25. + + Maximum 100. + """ diff --git a/src/gitpod/types/runner_search_repositories_response.py b/src/gitpod/types/runner_search_repositories_response.py new file mode 100644 index 00000000..65597de3 --- /dev/null +++ b/src/gitpod/types/runner_search_repositories_response.py @@ -0,0 +1,38 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["RunnerSearchRepositoriesResponse", "Pagination", "Repository"] + + +class Pagination(BaseModel): + """Pagination information for the response""" + + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + """Token passed for retrieving the next set of results. + + Empty if there are no more results + """ + + +class Repository(BaseModel): + name: Optional[str] = None + """Repository name (e.g., "my-project")""" + + url: Optional[str] = None + """Repository URL (e.g., "https://github.com/owner/my-project")""" + + +class RunnerSearchRepositoriesResponse(BaseModel): + last_page: Optional[int] = FieldInfo(alias="lastPage", default=None) + """Last page in the responses""" + + pagination: Optional[Pagination] = None + """Pagination information for the response""" + + repositories: Optional[List[Repository]] = None + """List of repositories matching the search criteria""" diff --git a/src/gitpod/types/runner_spec.py b/src/gitpod/types/runner_spec.py index 9fb48111..82da9949 100644 --- a/src/gitpod/types/runner_spec.py +++ b/src/gitpod/types/runner_spec.py @@ -6,6 +6,7 @@ from .._models import BaseModel from .runner_phase import RunnerPhase +from .runner_variant import RunnerVariant from .runner_configuration import RunnerConfiguration __all__ = ["RunnerSpec"] @@ -17,3 +18,6 @@ class RunnerSpec(BaseModel): desired_phase: Optional[RunnerPhase] = FieldInfo(alias="desiredPhase", default=None) """RunnerPhase represents the phase a runner is in""" + + variant: Optional[RunnerVariant] = None + """The runner's variant""" diff --git a/src/gitpod/types/runner_spec_param.py b/src/gitpod/types/runner_spec_param.py index c356eb32..bf953fdd 100644 --- a/src/gitpod/types/runner_spec_param.py +++ b/src/gitpod/types/runner_spec_param.py @@ -6,6 +6,7 @@ from .._utils import PropertyInfo from .runner_phase import RunnerPhase +from .runner_variant import RunnerVariant from .runner_configuration_param import RunnerConfigurationParam __all__ = ["RunnerSpecParam"] @@ -17,3 +18,6 @@ class RunnerSpecParam(TypedDict, total=False): desired_phase: Annotated[RunnerPhase, PropertyInfo(alias="desiredPhase")] """RunnerPhase represents the phase a runner is in""" + + variant: RunnerVariant + """The runner's variant""" diff --git a/src/gitpod/types/runner_status.py b/src/gitpod/types/runner_status.py index d1d2971f..cabcb489 100644 --- a/src/gitpod/types/runner_status.py +++ b/src/gitpod/types/runner_status.py @@ -29,6 +29,9 @@ class RunnerStatus(BaseModel): gateway_info: Optional[GatewayInfo] = FieldInfo(alias="gatewayInfo", default=None) """gateway_info is information about the gateway to which the runner is connected.""" + llm_url: Optional[str] = FieldInfo(alias="llmUrl", default=None) + """llm_url is the URL of the LLM service to which the runner is connected.""" + log_url: Optional[str] = FieldInfo(alias="logUrl", default=None) message: Optional[str] = None @@ -40,9 +43,19 @@ class RunnerStatus(BaseModel): phase: Optional[RunnerPhase] = None """The runner's reported phase""" + public_key: Optional[str] = FieldInfo(alias="publicKey", default=None) + """public_key is the runner's public key used for encryption (32 bytes)""" + region: Optional[str] = None """region is the region the runner is running in, if applicable.""" + support_bundle_url: Optional[str] = FieldInfo(alias="supportBundleUrl", default=None) + """ + support_bundle_url is the URL at which the runner support bundle can be + accessed. This URL provides access to pprof profiles and other debug + information. Only available for standalone runners. + """ + system_details: Optional[str] = FieldInfo(alias="systemDetails", default=None) updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None) diff --git a/src/gitpod/types/runner_variant.py b/src/gitpod/types/runner_variant.py new file mode 100644 index 00000000..da164aef --- /dev/null +++ b/src/gitpod/types/runner_variant.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["RunnerVariant"] + +RunnerVariant: TypeAlias = Literal["RUNNER_VARIANT_UNSPECIFIED", "RUNNER_VARIANT_STANDARD", "RUNNER_VARIANT_ENTERPRISE"] diff --git a/src/gitpod/types/runners/configuration_validate_params.py b/src/gitpod/types/runners/configuration_validate_params.py index 8afdbe5d..68c1664a 100644 --- a/src/gitpod/types/runners/configuration_validate_params.py +++ b/src/gitpod/types/runners/configuration_validate_params.py @@ -64,5 +64,13 @@ class ScmIntegration(TypedDict, total=False): integration is for """ + virtual_directory: Annotated[Optional[str], PropertyInfo(alias="virtualDirectory")] + """ + virtual_directory is the virtual directory path for Azure DevOps Server (e.g., + "/tfs"). This field is only used for Azure DevOps Server SCM integrations and + should be empty for other SCM types. Azure DevOps Server APIs work without + collection when PAT scope is 'All accessible organizations'. + """ + set_pydantic_config(ScmIntegration, {"arbitrary_types_allowed": True}) diff --git a/src/gitpod/types/runners/configurations/host_authentication_token.py b/src/gitpod/types/runners/configurations/host_authentication_token.py index 22e57609..1c531be8 100644 --- a/src/gitpod/types/runners/configurations/host_authentication_token.py +++ b/src/gitpod/types/runners/configurations/host_authentication_token.py @@ -1,11 +1,12 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Optional from datetime import datetime from pydantic import Field as FieldInfo from ...._models import BaseModel +from ...shared.subject import Subject from .host_authentication_token_source import HostAuthenticationTokenSource __all__ = ["HostAuthenticationToken"] @@ -108,8 +109,23 @@ class HostAuthenticationToken(BaseModel): host: Optional[str] = None + integration_id: Optional[str] = FieldInfo(alias="integrationId", default=None) + """links to integration instance""" + runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None) + scopes: Optional[List[str]] = None + """token permissions""" + source: Optional[HostAuthenticationTokenSource] = None + """auth_type""" + + subject: Optional[Subject] = None + """ + Subject identifies the principal (user or service account) for the token Note: + actual token and refresh_token values are retrieved via + GetHostAuthenticationTokenValue API + """ user_id: Optional[str] = FieldInfo(alias="userId", default=None) + """Deprecated: Use principal_id and principal_type instead principal (user)""" diff --git a/src/gitpod/types/runners/configurations/host_authentication_token_create_params.py b/src/gitpod/types/runners/configurations/host_authentication_token_create_params.py index f0ba68ee..9728b363 100644 --- a/src/gitpod/types/runners/configurations/host_authentication_token_create_params.py +++ b/src/gitpod/types/runners/configurations/host_authentication_token_create_params.py @@ -6,7 +6,9 @@ from datetime import datetime from typing_extensions import Annotated, TypedDict +from ...._types import SequenceNotStr from ...._utils import PropertyInfo +from ...shared_params.subject import Subject from .host_authentication_token_source import HostAuthenticationTokenSource __all__ = ["HostAuthenticationTokenCreateParams"] @@ -14,6 +16,7 @@ class HostAuthenticationTokenCreateParams(TypedDict, total=False): token: str + """stored encrypted, retrieved via GetHostAuthenticationTokenValue""" expires_at: Annotated[Union[str, datetime], PropertyInfo(alias="expiresAt", format="iso8601")] """ @@ -109,10 +112,20 @@ class HostAuthenticationTokenCreateParams(TypedDict, total=False): host: str + integration_id: Annotated[str, PropertyInfo(alias="integrationId")] + refresh_token: Annotated[str, PropertyInfo(alias="refreshToken")] + """stored encrypted, retrieved via GetHostAuthenticationTokenValue""" runner_id: Annotated[str, PropertyInfo(alias="runnerId")] + scopes: SequenceNotStr[str] + """Maximum 100 scopes allowed (101 for validation purposes)""" + source: HostAuthenticationTokenSource + subject: Subject + """Subject identifies the principal (user or service account) for the token""" + user_id: Annotated[str, PropertyInfo(alias="userId")] + """Deprecated: Use principal_id and principal_type instead""" diff --git a/src/gitpod/types/runners/configurations/host_authentication_token_list_params.py b/src/gitpod/types/runners/configurations/host_authentication_token_list_params.py index 2576f40c..34a1fd4c 100644 --- a/src/gitpod/types/runners/configurations/host_authentication_token_list_params.py +++ b/src/gitpod/types/runners/configurations/host_authentication_token_list_params.py @@ -23,7 +23,11 @@ class HostAuthenticationTokenListParams(TypedDict, total=False): class Filter(TypedDict, total=False): runner_id: Annotated[Optional[str], PropertyInfo(alias="runnerId")] + subject_id: Annotated[Optional[str], PropertyInfo(alias="subjectId")] + """Filter by subject (user or service account)""" + user_id: Annotated[Optional[str], PropertyInfo(alias="userId")] + """Deprecated: Use principal_id instead""" class Pagination(TypedDict, total=False): diff --git a/src/gitpod/types/runners/configurations/host_authentication_token_update_params.py b/src/gitpod/types/runners/configurations/host_authentication_token_update_params.py index 50dfcd27..eeb7ed93 100644 --- a/src/gitpod/types/runners/configurations/host_authentication_token_update_params.py +++ b/src/gitpod/types/runners/configurations/host_authentication_token_update_params.py @@ -6,6 +6,7 @@ from datetime import datetime from typing_extensions import Annotated, TypedDict +from ...._types import SequenceNotStr from ...._utils import PropertyInfo __all__ = ["HostAuthenticationTokenUpdateParams"] @@ -109,3 +110,5 @@ class HostAuthenticationTokenUpdateParams(TypedDict, total=False): """ refresh_token: Annotated[Optional[str], PropertyInfo(alias="refreshToken")] + + scopes: SequenceNotStr[str] diff --git a/src/gitpod/types/runners/configurations/scm_integration.py b/src/gitpod/types/runners/configurations/scm_integration.py index 05841dc2..f9ed1e61 100644 --- a/src/gitpod/types/runners/configurations/scm_integration.py +++ b/src/gitpod/types/runners/configurations/scm_integration.py @@ -27,3 +27,11 @@ class ScmIntegration(BaseModel): scm_id references the scm_id in the runner's configuration schema that this integration is for """ + + virtual_directory: Optional[str] = FieldInfo(alias="virtualDirectory", default=None) + """ + virtual_directory is the virtual directory path for Azure DevOps Server (e.g., + "/tfs"). This field is only used for Azure DevOps Server SCM integrations and + should be empty for other SCM types. Azure DevOps Server APIs work without + collection when PAT scope is 'All accessible organizations'. + """ diff --git a/src/gitpod/types/runners/configurations/scm_integration_create_params.py b/src/gitpod/types/runners/configurations/scm_integration_create_params.py index 8cbddf05..b9a0c846 100644 --- a/src/gitpod/types/runners/configurations/scm_integration_create_params.py +++ b/src/gitpod/types/runners/configurations/scm_integration_create_params.py @@ -40,3 +40,11 @@ class ScmIntegrationCreateParams(TypedDict, total=False): scm_id references the scm_id in the runner's configuration schema that this integration is for """ + + virtual_directory: Annotated[Optional[str], PropertyInfo(alias="virtualDirectory")] + """ + virtual_directory is the virtual directory path for Azure DevOps Server (e.g., + "/tfs"). This field is only used for Azure DevOps Server SCM integrations and + should be empty for other SCM types. Azure DevOps Server APIs work without + collection when PAT scope is 'All accessible organizations'. + """ diff --git a/src/gitpod/types/runners/configurations/scm_integration_update_params.py b/src/gitpod/types/runners/configurations/scm_integration_update_params.py index 706496de..887fa077 100644 --- a/src/gitpod/types/runners/configurations/scm_integration_update_params.py +++ b/src/gitpod/types/runners/configurations/scm_integration_update_params.py @@ -44,3 +44,11 @@ class ScmIntegrationUpdateParams(TypedDict, total=False): This might lead to users being unable to access their repositories until they re-authenticate. """ + + virtual_directory: Annotated[Optional[str], PropertyInfo(alias="virtualDirectory")] + """ + virtual_directory is the virtual directory path for Azure DevOps Server (e.g., + "/tfs"). This field is only used for Azure DevOps Server SCM integrations and + should be empty for other SCM types. Azure DevOps Server APIs work without + collection when PAT scope is 'All accessible organizations'. + """ diff --git a/src/gitpod/types/search_mode.py b/src/gitpod/types/search_mode.py new file mode 100644 index 00000000..5d2ba5bc --- /dev/null +++ b/src/gitpod/types/search_mode.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SearchMode"] + +SearchMode: TypeAlias = Literal["SEARCH_MODE_UNSPECIFIED", "SEARCH_MODE_KEYWORD", "SEARCH_MODE_NATIVE"] diff --git a/src/gitpod/types/secret.py b/src/gitpod/types/secret.py index f7bdd151..052d62a9 100644 --- a/src/gitpod/types/secret.py +++ b/src/gitpod/types/secret.py @@ -15,6 +15,9 @@ class Secret(BaseModel): id: Optional[str] = None + api_only: Optional[bool] = FieldInfo(alias="apiOnly", default=None) + """api_only indicates the secret is only available via API/CLI""" + container_registry_basic_auth_host: Optional[str] = FieldInfo(alias="containerRegistryBasicAuthHost", default=None) """secret will be mounted as a registry secret""" diff --git a/src/gitpod/types/secret_create_params.py b/src/gitpod/types/secret_create_params.py index 61487b0c..37c24627 100644 --- a/src/gitpod/types/secret_create_params.py +++ b/src/gitpod/types/secret_create_params.py @@ -11,6 +11,13 @@ class SecretCreateParams(TypedDict, total=False): + api_only: Annotated[bool, PropertyInfo(alias="apiOnly")] + """ + api_only indicates the secret is only available via API/CLI. These secrets are + NOT automatically injected into services or devcontainers. Useful for secrets + that should only be consumed programmatically (e.g., by security agents). + """ + 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 diff --git a/src/gitpod/types/secret_scope.py b/src/gitpod/types/secret_scope.py index 0c5bc664..f66b6726 100644 --- a/src/gitpod/types/secret_scope.py +++ b/src/gitpod/types/secret_scope.py @@ -10,6 +10,9 @@ class SecretScope(BaseModel): + organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + """organization_id is the Organization ID this Secret belongs to""" + project_id: Optional[str] = FieldInfo(alias="projectId", default=None) """project_id is the Project ID this Secret belongs to""" diff --git a/src/gitpod/types/secret_scope_param.py b/src/gitpod/types/secret_scope_param.py index 85ee9a40..d68e56b5 100644 --- a/src/gitpod/types/secret_scope_param.py +++ b/src/gitpod/types/secret_scope_param.py @@ -10,6 +10,9 @@ class SecretScopeParam(TypedDict, total=False): + organization_id: Annotated[str, PropertyInfo(alias="organizationId")] + """organization_id is the Organization ID this Secret belongs to""" + project_id: Annotated[str, PropertyInfo(alias="projectId")] """project_id is the Project ID this Secret belongs to""" diff --git a/src/gitpod/types/shared/__init__.py b/src/gitpod/types/shared/__init__.py index 4a5d70aa..50c13152 100644 --- a/src/gitpod/types/shared/__init__.py +++ b/src/gitpod/types/shared/__init__.py @@ -7,8 +7,10 @@ from .principal import Principal as Principal from .task_spec import TaskSpec as TaskSpec from .error_code import ErrorCode as ErrorCode +from .secret_ref import SecretRef as SecretRef from .field_value import FieldValue as FieldValue from .user_status import UserStatus as UserStatus +from .resource_type import ResourceType as ResourceType from .task_metadata import TaskMetadata as TaskMetadata from .task_execution import TaskExecution as TaskExecution from .environment_class import EnvironmentClass as EnvironmentClass @@ -18,3 +20,6 @@ from .task_execution_phase import TaskExecutionPhase as TaskExecutionPhase from .task_execution_status import TaskExecutionStatus as TaskExecutionStatus from .task_execution_metadata import TaskExecutionMetadata as TaskExecutionMetadata +from .environment_variable_item import EnvironmentVariableItem as EnvironmentVariableItem +from .project_environment_class import ProjectEnvironmentClass as ProjectEnvironmentClass +from .environment_variable_source import EnvironmentVariableSource as EnvironmentVariableSource diff --git a/src/gitpod/types/shared/automation_trigger.py b/src/gitpod/types/shared/automation_trigger.py index d319ff02..c21e923e 100644 --- a/src/gitpod/types/shared/automation_trigger.py +++ b/src/gitpod/types/shared/automation_trigger.py @@ -12,8 +12,13 @@ class AutomationTrigger(BaseModel): """ An AutomationTrigger represents a trigger for an automation action. - The `post_environment_start` field indicates that the automation should be triggered after the environment has started. + The `manual` field shows a start button in the UI for manually triggering the automation. + The `post_machine_start` field indicates that the automation should be triggered after the machine has started, before the devcontainer is ready. + This is used for machine-level services like security agents that need to start early. + The `post_environment_start` field indicates that the automation should be triggered after the environment has started (devcontainer ready). The `post_devcontainer_start` field indicates that the automation should be triggered after the dev container has started. + The `prebuild` field starts the automation during a prebuild of an environment. This phase does not have user secrets available. + Note: The prebuild trigger can only be used with tasks, not services. """ manual: Optional[bool] = None @@ -21,3 +26,7 @@ class AutomationTrigger(BaseModel): post_devcontainer_start: Optional[bool] = FieldInfo(alias="postDevcontainerStart", default=None) post_environment_start: Optional[bool] = FieldInfo(alias="postEnvironmentStart", default=None) + + post_machine_start: Optional[bool] = FieldInfo(alias="postMachineStart", default=None) + + prebuild: Optional[bool] = None diff --git a/src/gitpod/types/shared/environment_variable_item.py b/src/gitpod/types/shared/environment_variable_item.py new file mode 100644 index 00000000..171db36b --- /dev/null +++ b/src/gitpod/types/shared/environment_variable_item.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .environment_variable_source import EnvironmentVariableSource + +__all__ = ["EnvironmentVariableItem"] + + +class EnvironmentVariableItem(BaseModel): + """ + EnvironmentVariableItem represents an environment variable that can be set + either from a literal value or from a secret reference. + """ + + name: Optional[str] = None + """name is the environment variable name.""" + + value: Optional[str] = None + """value is a literal string value.""" + + value_from: Optional[EnvironmentVariableSource] = FieldInfo(alias="valueFrom", default=None) + """value_from specifies a source for the value.""" diff --git a/src/gitpod/types/shared/environment_variable_source.py b/src/gitpod/types/shared/environment_variable_source.py new file mode 100644 index 00000000..09df6528 --- /dev/null +++ b/src/gitpod/types/shared/environment_variable_source.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .secret_ref import SecretRef + +__all__ = ["EnvironmentVariableSource"] + + +class EnvironmentVariableSource(BaseModel): + """EnvironmentVariableSource specifies a source for an environment variable value.""" + + secret_ref: SecretRef = FieldInfo(alias="secretRef") + """secret_ref references a secret by ID.""" diff --git a/src/gitpod/types/shared/principal.py b/src/gitpod/types/shared/principal.py index 5300b520..b71334f8 100644 --- a/src/gitpod/types/shared/principal.py +++ b/src/gitpod/types/shared/principal.py @@ -12,4 +12,5 @@ "PRINCIPAL_ENVIRONMENT", "PRINCIPAL_SERVICE_ACCOUNT", "PRINCIPAL_RUNNER_MANAGER", + "PRINCIPAL_AGENT_EXECUTION", ] diff --git a/src/gitpod/types/project_environment_class.py b/src/gitpod/types/shared/project_environment_class.py similarity index 83% rename from src/gitpod/types/project_environment_class.py rename to src/gitpod/types/shared/project_environment_class.py index a969845a..52c5e008 100644 --- a/src/gitpod/types/project_environment_class.py +++ b/src/gitpod/types/shared/project_environment_class.py @@ -4,7 +4,7 @@ from pydantic import Field as FieldInfo -from .._models import BaseModel +from ..._models import BaseModel __all__ = ["ProjectEnvironmentClass"] @@ -18,3 +18,6 @@ class ProjectEnvironmentClass(BaseModel): local_runner: Optional[bool] = FieldInfo(alias="localRunner", default=None) """Use a local runner for the user""" + + order: Optional[int] = None + """order is the priority of this entry""" diff --git a/src/gitpod/types/resource_type.py b/src/gitpod/types/shared/resource_type.py similarity index 63% rename from src/gitpod/types/resource_type.py rename to src/gitpod/types/shared/resource_type.py index c273d47a..5aec70eb 100644 --- a/src/gitpod/types/resource_type.py +++ b/src/gitpod/types/shared/resource_type.py @@ -30,4 +30,21 @@ "RESOURCE_TYPE_ENVIRONMENT_SESSION", "RESOURCE_TYPE_USER_SECRET", "RESOURCE_TYPE_ORGANIZATION_POLICY", + "RESOURCE_TYPE_ORGANIZATION_SECRET", + "RESOURCE_TYPE_PROJECT_ENVIRONMENT_CLASS", + "RESOURCE_TYPE_BILLING", + "RESOURCE_TYPE_PROMPT", + "RESOURCE_TYPE_COUPON", + "RESOURCE_TYPE_COUPON_REDEMPTION", + "RESOURCE_TYPE_ACCOUNT", + "RESOURCE_TYPE_INTEGRATION", + "RESOURCE_TYPE_WORKFLOW", + "RESOURCE_TYPE_WORKFLOW_EXECUTION", + "RESOURCE_TYPE_WORKFLOW_EXECUTION_ACTION", + "RESOURCE_TYPE_SNAPSHOT", + "RESOURCE_TYPE_PREBUILD", + "RESOURCE_TYPE_ORGANIZATION_LLM_INTEGRATION", + "RESOURCE_TYPE_CUSTOM_DOMAIN", + "RESOURCE_TYPE_ROLE_ASSIGNMENT_CHANGED", + "RESOURCE_TYPE_GROUP_MEMBERSHIP_CHANGED", ] diff --git a/src/gitpod/types/shared/runs_on.py b/src/gitpod/types/shared/runs_on.py index 7702279d..33cf1bd5 100644 --- a/src/gitpod/types/shared/runs_on.py +++ b/src/gitpod/types/shared/runs_on.py @@ -14,4 +14,7 @@ class Docker(BaseModel): class RunsOn(BaseModel): - docker: Docker + docker: Optional[Docker] = None + + machine: Optional[object] = None + """Machine runs the service/task directly on the VM/machine level.""" diff --git a/src/gitpod/types/shared/secret_ref.py b/src/gitpod/types/shared/secret_ref.py new file mode 100644 index 00000000..20904f1b --- /dev/null +++ b/src/gitpod/types/shared/secret_ref.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel + +__all__ = ["SecretRef"] + + +class SecretRef(BaseModel): + """SecretRef references a secret by its ID.""" + + id: Optional[str] = None + """id is the UUID of the secret to reference.""" diff --git a/src/gitpod/types/shared/task_spec.py b/src/gitpod/types/shared/task_spec.py index c69815fb..9c30234e 100644 --- a/src/gitpod/types/shared/task_spec.py +++ b/src/gitpod/types/shared/task_spec.py @@ -1,11 +1,12 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Optional from pydantic import Field as FieldInfo from .runs_on import RunsOn from ..._models import BaseModel +from .environment_variable_item import EnvironmentVariableItem __all__ = ["TaskSpec"] @@ -14,5 +15,8 @@ class TaskSpec(BaseModel): command: Optional[str] = None """command contains the command the task should execute""" + env: Optional[List[EnvironmentVariableItem]] = None + """env specifies environment variables for the task.""" + runs_on: Optional[RunsOn] = FieldInfo(alias="runsOn", default=None) """runs_on specifies the environment the task should run on.""" diff --git a/src/gitpod/types/shared_params/__init__.py b/src/gitpod/types/shared_params/__init__.py index 51915e7a..4673c768 100644 --- a/src/gitpod/types/shared_params/__init__.py +++ b/src/gitpod/types/shared_params/__init__.py @@ -4,9 +4,14 @@ from .subject import Subject as Subject from .principal import Principal as Principal from .task_spec import TaskSpec as TaskSpec +from .secret_ref import SecretRef as SecretRef from .field_value import FieldValue as FieldValue +from .resource_type import ResourceType as ResourceType 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 from .task_execution_phase import TaskExecutionPhase as TaskExecutionPhase +from .environment_variable_item import EnvironmentVariableItem as EnvironmentVariableItem +from .project_environment_class import ProjectEnvironmentClass as ProjectEnvironmentClass +from .environment_variable_source import EnvironmentVariableSource as EnvironmentVariableSource diff --git a/src/gitpod/types/shared_params/automation_trigger.py b/src/gitpod/types/shared_params/automation_trigger.py index 2327173a..0c840fe9 100644 --- a/src/gitpod/types/shared_params/automation_trigger.py +++ b/src/gitpod/types/shared_params/automation_trigger.py @@ -12,8 +12,13 @@ class AutomationTrigger(TypedDict, total=False): """ An AutomationTrigger represents a trigger for an automation action. - The `post_environment_start` field indicates that the automation should be triggered after the environment has started. + The `manual` field shows a start button in the UI for manually triggering the automation. + The `post_machine_start` field indicates that the automation should be triggered after the machine has started, before the devcontainer is ready. + This is used for machine-level services like security agents that need to start early. + The `post_environment_start` field indicates that the automation should be triggered after the environment has started (devcontainer ready). The `post_devcontainer_start` field indicates that the automation should be triggered after the dev container has started. + The `prebuild` field starts the automation during a prebuild of an environment. This phase does not have user secrets available. + Note: The prebuild trigger can only be used with tasks, not services. """ manual: bool @@ -21,3 +26,7 @@ class AutomationTrigger(TypedDict, total=False): post_devcontainer_start: Annotated[bool, PropertyInfo(alias="postDevcontainerStart")] post_environment_start: Annotated[bool, PropertyInfo(alias="postEnvironmentStart")] + + post_machine_start: Annotated[bool, PropertyInfo(alias="postMachineStart")] + + prebuild: bool diff --git a/src/gitpod/types/shared_params/environment_variable_item.py b/src/gitpod/types/shared_params/environment_variable_item.py new file mode 100644 index 00000000..c4d3b5ed --- /dev/null +++ b/src/gitpod/types/shared_params/environment_variable_item.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from ..._utils import PropertyInfo +from .environment_variable_source import EnvironmentVariableSource + +__all__ = ["EnvironmentVariableItem"] + + +class EnvironmentVariableItem(TypedDict, total=False): + """ + EnvironmentVariableItem represents an environment variable that can be set + either from a literal value or from a secret reference. + """ + + name: str + """name is the environment variable name.""" + + value: str + """value is a literal string value.""" + + value_from: Annotated[EnvironmentVariableSource, PropertyInfo(alias="valueFrom")] + """value_from specifies a source for the value.""" diff --git a/src/gitpod/types/shared_params/environment_variable_source.py b/src/gitpod/types/shared_params/environment_variable_source.py new file mode 100644 index 00000000..2e5b3244 --- /dev/null +++ b/src/gitpod/types/shared_params/environment_variable_source.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .secret_ref import SecretRef + +__all__ = ["EnvironmentVariableSource"] + + +class EnvironmentVariableSource(TypedDict, total=False): + """EnvironmentVariableSource specifies a source for an environment variable value.""" + + secret_ref: Required[Annotated[SecretRef, PropertyInfo(alias="secretRef")]] + """secret_ref references a secret by ID.""" diff --git a/src/gitpod/types/shared_params/principal.py b/src/gitpod/types/shared_params/principal.py index 3cefcfa1..465d7b21 100644 --- a/src/gitpod/types/shared_params/principal.py +++ b/src/gitpod/types/shared_params/principal.py @@ -14,4 +14,5 @@ "PRINCIPAL_ENVIRONMENT", "PRINCIPAL_SERVICE_ACCOUNT", "PRINCIPAL_RUNNER_MANAGER", + "PRINCIPAL_AGENT_EXECUTION", ] diff --git a/src/gitpod/types/project_environment_class_param.py b/src/gitpod/types/shared_params/project_environment_class.py similarity index 72% rename from src/gitpod/types/project_environment_class_param.py rename to src/gitpod/types/shared_params/project_environment_class.py index c6e29185..84194873 100644 --- a/src/gitpod/types/project_environment_class_param.py +++ b/src/gitpod/types/shared_params/project_environment_class.py @@ -4,12 +4,12 @@ from typing_extensions import Annotated, TypedDict -from .._utils import PropertyInfo +from ..._utils import PropertyInfo -__all__ = ["ProjectEnvironmentClassParam"] +__all__ = ["ProjectEnvironmentClass"] -class ProjectEnvironmentClassParam(TypedDict, total=False): +class ProjectEnvironmentClass(TypedDict, total=False): environment_class_id: Annotated[str, PropertyInfo(alias="environmentClassId")] """Use a fixed environment class on a given Runner. @@ -18,3 +18,6 @@ class ProjectEnvironmentClassParam(TypedDict, total=False): local_runner: Annotated[bool, PropertyInfo(alias="localRunner")] """Use a local runner for the user""" + + order: int + """order is the priority of this entry""" diff --git a/src/gitpod/types/shared_params/resource_type.py b/src/gitpod/types/shared_params/resource_type.py new file mode 100644 index 00000000..4c567f1c --- /dev/null +++ b/src/gitpod/types/shared_params/resource_type.py @@ -0,0 +1,52 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypeAlias + +__all__ = ["ResourceType"] + +ResourceType: TypeAlias = Literal[ + "RESOURCE_TYPE_UNSPECIFIED", + "RESOURCE_TYPE_ENVIRONMENT", + "RESOURCE_TYPE_RUNNER", + "RESOURCE_TYPE_PROJECT", + "RESOURCE_TYPE_TASK", + "RESOURCE_TYPE_TASK_EXECUTION", + "RESOURCE_TYPE_SERVICE", + "RESOURCE_TYPE_ORGANIZATION", + "RESOURCE_TYPE_USER", + "RESOURCE_TYPE_ENVIRONMENT_CLASS", + "RESOURCE_TYPE_RUNNER_SCM_INTEGRATION", + "RESOURCE_TYPE_HOST_AUTHENTICATION_TOKEN", + "RESOURCE_TYPE_GROUP", + "RESOURCE_TYPE_PERSONAL_ACCESS_TOKEN", + "RESOURCE_TYPE_USER_PREFERENCE", + "RESOURCE_TYPE_SERVICE_ACCOUNT", + "RESOURCE_TYPE_SECRET", + "RESOURCE_TYPE_SSO_CONFIG", + "RESOURCE_TYPE_DOMAIN_VERIFICATION", + "RESOURCE_TYPE_AGENT_EXECUTION", + "RESOURCE_TYPE_RUNNER_LLM_INTEGRATION", + "RESOURCE_TYPE_AGENT", + "RESOURCE_TYPE_ENVIRONMENT_SESSION", + "RESOURCE_TYPE_USER_SECRET", + "RESOURCE_TYPE_ORGANIZATION_POLICY", + "RESOURCE_TYPE_ORGANIZATION_SECRET", + "RESOURCE_TYPE_PROJECT_ENVIRONMENT_CLASS", + "RESOURCE_TYPE_BILLING", + "RESOURCE_TYPE_PROMPT", + "RESOURCE_TYPE_COUPON", + "RESOURCE_TYPE_COUPON_REDEMPTION", + "RESOURCE_TYPE_ACCOUNT", + "RESOURCE_TYPE_INTEGRATION", + "RESOURCE_TYPE_WORKFLOW", + "RESOURCE_TYPE_WORKFLOW_EXECUTION", + "RESOURCE_TYPE_WORKFLOW_EXECUTION_ACTION", + "RESOURCE_TYPE_SNAPSHOT", + "RESOURCE_TYPE_PREBUILD", + "RESOURCE_TYPE_ORGANIZATION_LLM_INTEGRATION", + "RESOURCE_TYPE_CUSTOM_DOMAIN", + "RESOURCE_TYPE_ROLE_ASSIGNMENT_CHANGED", + "RESOURCE_TYPE_GROUP_MEMBERSHIP_CHANGED", +] diff --git a/src/gitpod/types/shared_params/runs_on.py b/src/gitpod/types/shared_params/runs_on.py index 733d8286..8fc0fd3c 100644 --- a/src/gitpod/types/shared_params/runs_on.py +++ b/src/gitpod/types/shared_params/runs_on.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing_extensions import TypedDict from ..._types import SequenceNotStr @@ -16,4 +16,7 @@ class Docker(TypedDict, total=False): class RunsOn(TypedDict, total=False): - docker: Required[Docker] + docker: Docker + + machine: object + """Machine runs the service/task directly on the VM/machine level.""" diff --git a/src/gitpod/types/shared_params/secret_ref.py b/src/gitpod/types/shared_params/secret_ref.py new file mode 100644 index 00000000..cbfc6e6a --- /dev/null +++ b/src/gitpod/types/shared_params/secret_ref.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["SecretRef"] + + +class SecretRef(TypedDict, total=False): + """SecretRef references a secret by its ID.""" + + id: str + """id is the UUID of the secret to reference.""" diff --git a/src/gitpod/types/shared_params/task_spec.py b/src/gitpod/types/shared_params/task_spec.py index 5f40eef4..691ba57b 100644 --- a/src/gitpod/types/shared_params/task_spec.py +++ b/src/gitpod/types/shared_params/task_spec.py @@ -2,10 +2,12 @@ from __future__ import annotations +from typing import Iterable from typing_extensions import Annotated, TypedDict from .runs_on import RunsOn from ..._utils import PropertyInfo +from .environment_variable_item import EnvironmentVariableItem __all__ = ["TaskSpec"] @@ -14,5 +16,8 @@ class TaskSpec(TypedDict, total=False): command: str """command contains the command the task should execute""" + env: Iterable[EnvironmentVariableItem] + """env specifies environment variables for the task.""" + runs_on: Annotated[RunsOn, PropertyInfo(alias="runsOn")] """runs_on specifies the environment the task should run on.""" diff --git a/src/gitpod/types/stack_frame_param.py b/src/gitpod/types/stack_frame_param.py new file mode 100644 index 00000000..6ce75870 --- /dev/null +++ b/src/gitpod/types/stack_frame_param.py @@ -0,0 +1,43 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict +from typing_extensions import Annotated, TypedDict + +from .._types import SequenceNotStr +from .._utils import PropertyInfo + +__all__ = ["StackFrameParam"] + + +class StackFrameParam(TypedDict, total=False): + """Stack trace frame information (Sentry-compatible)""" + + colno: int + """Column number in the line""" + + context_line: Annotated[str, PropertyInfo(alias="contextLine")] + + filename: str + """File name or path""" + + function: str + """Function name""" + + in_app: Annotated[bool, PropertyInfo(alias="inApp")] + """Whether this frame is in application code (vs library/framework code)""" + + lineno: int + """Line number in the file""" + + module: str + """Module or package name""" + + post_context: Annotated[SequenceNotStr[str], PropertyInfo(alias="postContext")] + + pre_context: Annotated[SequenceNotStr[str], PropertyInfo(alias="preContext")] + """Source code context around the error line""" + + vars: Dict[str, str] + """Additional frame-specific variables/locals""" diff --git a/src/gitpod/types/user.py b/src/gitpod/types/user.py index a8ce63f8..7bb441f2 100644 --- a/src/gitpod/types/user.py +++ b/src/gitpod/types/user.py @@ -21,6 +21,9 @@ class User(BaseModel): created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) """created_at is the creation time""" + email: Optional[str] = None + """email is the user's email address""" + name: Optional[str] = None """name is the full name of the user""" diff --git a/src/gitpod/types/user_delete_user_params.py b/src/gitpod/types/user_delete_user_params.py new file mode 100644 index 00000000..9c9639aa --- /dev/null +++ b/src/gitpod/types/user_delete_user_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["UserDeleteUserParams"] + + +class UserDeleteUserParams(TypedDict, total=False): + user_id: Annotated[str, PropertyInfo(alias="userId")] diff --git a/src/gitpod/types/user_get_user_params.py b/src/gitpod/types/user_get_user_params.py new file mode 100644 index 00000000..c4657c6d --- /dev/null +++ b/src/gitpod/types/user_get_user_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["UserGetUserParams"] + + +class UserGetUserParams(TypedDict, total=False): + user_id: Annotated[str, PropertyInfo(alias="userId")] diff --git a/src/gitpod/types/user_get_user_response.py b/src/gitpod/types/user_get_user_response.py new file mode 100644 index 00000000..ba5a8735 --- /dev/null +++ b/src/gitpod/types/user_get_user_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .user import User +from .._models import BaseModel + +__all__ = ["UserGetUserResponse"] + + +class UserGetUserResponse(BaseModel): + user: User diff --git a/src/gitpod/types/user_input_block_param.py b/src/gitpod/types/user_input_block_param.py new file mode 100644 index 00000000..e62eecf3 --- /dev/null +++ b/src/gitpod/types/user_input_block_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from datetime import datetime +from typing_extensions import Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["UserInputBlockParam", "Text"] + + +class Text(TypedDict, total=False): + content: str + + +class UserInputBlockParam(TypedDict, total=False): + text: Required[Text] + + id: str + + created_at: Annotated[Union[str, datetime], PropertyInfo(alias="createdAt", format="iso8601")] + """Timestamp when this block was created. Used for debugging and support bundles.""" diff --git a/tests/api_resources/environments/automations/test_services.py b/tests/api_resources/environments/automations/test_services.py index d4b9aebc..650c04b9 100644 --- a/tests/api_resources/environments/automations/test_services.py +++ b/tests/api_resources/environments/automations/test_services.py @@ -37,17 +37,20 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: metadata={ "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), "creator": { - "id": "id", + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED", }, "description": "Runs the development web server", "name": "Web Server", "reference": "web-server", + "role": "SERVICE_ROLE_UNSPECIFIED", "triggered_by": [ { "manual": True, "post_devcontainer_start": True, "post_environment_start": True, + "post_machine_start": True, + "prebuild": True, } ], }, @@ -58,11 +61,19 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "stop": "stop", }, "desired_phase": "SERVICE_PHASE_UNSPECIFIED", + "env": [ + { + "name": "x", + "value": "value", + "value_from": {"secret_ref": {"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}}, + } + ], "runs_on": { "docker": { "environment": ["string"], "image": "x", - } + }, + "machine": {}, }, "session": "session", "spec_version": "specVersion", @@ -142,12 +153,15 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: metadata={ "description": "description", "name": "x", + "role": "SERVICE_ROLE_UNSPECIFIED", "triggered_by": { "trigger": [ { "manual": True, "post_devcontainer_start": True, "post_environment_start": True, + "post_machine_start": True, + "prebuild": True, } ] }, @@ -158,11 +172,19 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: "start": "npm run start:dev", "stop": "stop", }, + "env": [ + { + "name": "x", + "value": "value", + "value_from": {"secret_ref": {"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}}, + } + ], "runs_on": { "docker": { "environment": ["string"], "image": "x", - } + }, + "machine": {}, }, }, status={ @@ -212,6 +234,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: filter={ "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "references": ["web-server", "database"], + "roles": ["SERVICE_ROLE_UNSPECIFIED"], "service_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], }, pagination={ @@ -372,17 +395,20 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> metadata={ "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), "creator": { - "id": "id", + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED", }, "description": "Runs the development web server", "name": "Web Server", "reference": "web-server", + "role": "SERVICE_ROLE_UNSPECIFIED", "triggered_by": [ { "manual": True, "post_devcontainer_start": True, "post_environment_start": True, + "post_machine_start": True, + "prebuild": True, } ], }, @@ -393,11 +419,19 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "stop": "stop", }, "desired_phase": "SERVICE_PHASE_UNSPECIFIED", + "env": [ + { + "name": "x", + "value": "value", + "value_from": {"secret_ref": {"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}}, + } + ], "runs_on": { "docker": { "environment": ["string"], "image": "x", - } + }, + "machine": {}, }, "session": "session", "spec_version": "specVersion", @@ -477,12 +511,15 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> metadata={ "description": "description", "name": "x", + "role": "SERVICE_ROLE_UNSPECIFIED", "triggered_by": { "trigger": [ { "manual": True, "post_devcontainer_start": True, "post_environment_start": True, + "post_machine_start": True, + "prebuild": True, } ] }, @@ -493,11 +530,19 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> "start": "npm run start:dev", "stop": "stop", }, + "env": [ + { + "name": "x", + "value": "value", + "value_from": {"secret_ref": {"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}}, + } + ], "runs_on": { "docker": { "environment": ["string"], "image": "x", - } + }, + "machine": {}, }, }, status={ @@ -547,6 +592,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N filter={ "environment_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "references": ["web-server", "database"], + "roles": ["SERVICE_ROLE_UNSPECIFIED"], "service_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], }, pagination={ diff --git a/tests/api_resources/environments/automations/test_tasks.py b/tests/api_resources/environments/automations/test_tasks.py index 58ec8c1d..057d1a17 100644 --- a/tests/api_resources/environments/automations/test_tasks.py +++ b/tests/api_resources/environments/automations/test_tasks.py @@ -39,7 +39,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: metadata={ "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), "creator": { - "id": "id", + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED", }, "description": "Builds the project artifacts", @@ -50,16 +50,26 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "manual": True, "post_devcontainer_start": True, "post_environment_start": True, + "post_machine_start": True, + "prebuild": True, } ], }, spec={ "command": "npm run build", + "env": [ + { + "name": "x", + "value": "value", + "value_from": {"secret_ref": {"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}}, + } + ], "runs_on": { "docker": { "environment": ["string"], "image": "x", - } + }, + "machine": {}, }, }, ) @@ -144,17 +154,27 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: "manual": True, "post_devcontainer_start": True, "post_environment_start": True, + "post_machine_start": True, + "prebuild": True, } ] }, }, spec={ "command": "npm run test:coverage", + "env": [ + { + "name": "x", + "value": "value", + "value_from": {"secret_ref": {"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}}, + } + ], "runs_on": { "docker": { "environment": ["string"], "image": "x", - } + }, + "machine": {}, }, }, ) @@ -321,7 +341,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> metadata={ "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), "creator": { - "id": "id", + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED", }, "description": "Builds the project artifacts", @@ -332,16 +352,26 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "manual": True, "post_devcontainer_start": True, "post_environment_start": True, + "post_machine_start": True, + "prebuild": True, } ], }, spec={ "command": "npm run build", + "env": [ + { + "name": "x", + "value": "value", + "value_from": {"secret_ref": {"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}}, + } + ], "runs_on": { "docker": { "environment": ["string"], "image": "x", - } + }, + "machine": {}, }, }, ) @@ -426,17 +456,27 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> "manual": True, "post_devcontainer_start": True, "post_environment_start": True, + "post_machine_start": True, + "prebuild": True, } ] }, }, spec={ "command": "npm run test:coverage", + "env": [ + { + "name": "x", + "value": "value", + "value_from": {"secret_ref": {"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}}, + } + ], "runs_on": { "docker": { "environment": ["string"], "image": "x", - } + }, + "machine": {}, }, }, ) diff --git a/tests/api_resources/environments/test_automations.py b/tests/api_resources/environments/test_automations.py index 8a2f0551..8a1bfcfb 100644 --- a/tests/api_resources/environments/test_automations.py +++ b/tests/api_resources/environments/test_automations.py @@ -37,11 +37,13 @@ def test_method_upsert_with_all_params(self, client: Gitpod) -> None: }, "description": "Development web server", "name": "Web Server", + "role": "", "runs_on": { "docker": { "environment": ["string"], "image": "x", - } + }, + "machine": {}, }, "triggered_by": ["postDevcontainerStart"], } @@ -56,7 +58,8 @@ def test_method_upsert_with_all_params(self, client: Gitpod) -> None: "docker": { "environment": ["string"], "image": "x", - } + }, + "machine": {}, }, "triggered_by": ["postEnvironmentStart"], } @@ -114,11 +117,13 @@ async def test_method_upsert_with_all_params(self, async_client: AsyncGitpod) -> }, "description": "Development web server", "name": "Web Server", + "role": "", "runs_on": { "docker": { "environment": ["string"], "image": "x", - } + }, + "machine": {}, }, "triggered_by": ["postDevcontainerStart"], } @@ -133,7 +138,8 @@ async def test_method_upsert_with_all_params(self, async_client: AsyncGitpod) -> "docker": { "environment": ["string"], "image": "x", - } + }, + "machine": {}, }, "triggered_by": ["postEnvironmentStart"], } diff --git a/tests/api_resources/groups/__init__.py b/tests/api_resources/groups/__init__.py new file mode 100644 index 00000000..fd8019a9 --- /dev/null +++ b/tests/api_resources/groups/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/groups/test_memberships.py b/tests/api_resources/groups/test_memberships.py new file mode 100644 index 00000000..b0de9f54 --- /dev/null +++ b/tests/api_resources/groups/test_memberships.py @@ -0,0 +1,264 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.pagination import SyncMembersPage, AsyncMembersPage +from gitpod.types.groups import ( + GroupMembership, + MembershipCreateResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestMemberships: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create(self, client: Gitpod) -> None: + membership = client.groups.memberships.create() + assert_matches_type(MembershipCreateResponse, membership, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create_with_all_params(self, client: Gitpod) -> None: + membership = client.groups.memberships.create( + group_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + subject={ + "id": "f53d2330-3795-4c5d-a1f3-453121af9c60", + "principal": "PRINCIPAL_USER", + }, + ) + assert_matches_type(MembershipCreateResponse, membership, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_create(self, client: Gitpod) -> None: + response = client.groups.memberships.with_raw_response.create() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + membership = response.parse() + assert_matches_type(MembershipCreateResponse, membership, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_create(self, client: Gitpod) -> None: + with client.groups.memberships.with_streaming_response.create() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + membership = response.parse() + assert_matches_type(MembershipCreateResponse, membership, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_list(self, client: Gitpod) -> None: + membership = client.groups.memberships.list() + assert_matches_type(SyncMembersPage[GroupMembership], membership, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_list_with_all_params(self, client: Gitpod) -> None: + membership = client.groups.memberships.list( + token="token", + page_size=0, + group_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + pagination={ + "token": "token", + "page_size": 20, + }, + ) + assert_matches_type(SyncMembersPage[GroupMembership], membership, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_list(self, client: Gitpod) -> None: + response = client.groups.memberships.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + membership = response.parse() + assert_matches_type(SyncMembersPage[GroupMembership], membership, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_list(self, client: Gitpod) -> None: + with client.groups.memberships.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + membership = response.parse() + assert_matches_type(SyncMembersPage[GroupMembership], membership, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_delete(self, client: Gitpod) -> None: + membership = client.groups.memberships.delete() + assert_matches_type(object, membership, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_delete_with_all_params(self, client: Gitpod) -> None: + membership = client.groups.memberships.delete( + membership_id="a1b2c3d4-5678-90ab-cdef-1234567890ab", + ) + assert_matches_type(object, membership, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_delete(self, client: Gitpod) -> None: + response = client.groups.memberships.with_raw_response.delete() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + membership = response.parse() + assert_matches_type(object, membership, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_delete(self, client: Gitpod) -> None: + with client.groups.memberships.with_streaming_response.delete() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + membership = response.parse() + assert_matches_type(object, membership, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncMemberships: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create(self, async_client: AsyncGitpod) -> None: + membership = await async_client.groups.memberships.create() + assert_matches_type(MembershipCreateResponse, membership, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: + membership = await async_client.groups.memberships.create( + group_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + subject={ + "id": "f53d2330-3795-4c5d-a1f3-453121af9c60", + "principal": "PRINCIPAL_USER", + }, + ) + assert_matches_type(MembershipCreateResponse, membership, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: + response = await async_client.groups.memberships.with_raw_response.create() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + membership = await response.parse() + assert_matches_type(MembershipCreateResponse, membership, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: + async with async_client.groups.memberships.with_streaming_response.create() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + membership = await response.parse() + assert_matches_type(MembershipCreateResponse, membership, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_list(self, async_client: AsyncGitpod) -> None: + membership = await async_client.groups.memberships.list() + assert_matches_type(AsyncMembersPage[GroupMembership], membership, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: + membership = await async_client.groups.memberships.list( + token="token", + page_size=0, + group_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + pagination={ + "token": "token", + "page_size": 20, + }, + ) + assert_matches_type(AsyncMembersPage[GroupMembership], membership, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: + response = await async_client.groups.memberships.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + membership = await response.parse() + assert_matches_type(AsyncMembersPage[GroupMembership], membership, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: + async with async_client.groups.memberships.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + membership = await response.parse() + assert_matches_type(AsyncMembersPage[GroupMembership], membership, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_delete(self, async_client: AsyncGitpod) -> None: + membership = await async_client.groups.memberships.delete() + assert_matches_type(object, membership, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: + membership = await async_client.groups.memberships.delete( + membership_id="a1b2c3d4-5678-90ab-cdef-1234567890ab", + ) + assert_matches_type(object, membership, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: + response = await async_client.groups.memberships.with_raw_response.delete() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + membership = await response.parse() + assert_matches_type(object, membership, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: + async with async_client.groups.memberships.with_streaming_response.delete() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + membership = await response.parse() + assert_matches_type(object, membership, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/groups/test_role_assignments.py b/tests/api_resources/groups/test_role_assignments.py new file mode 100644 index 00000000..23940822 --- /dev/null +++ b/tests/api_resources/groups/test_role_assignments.py @@ -0,0 +1,272 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.pagination import SyncAssignmentsPage, AsyncAssignmentsPage +from gitpod.types.groups import ( + RoleAssignment, + RoleAssignmentCreateResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestRoleAssignments: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create(self, client: Gitpod) -> None: + role_assignment = client.groups.role_assignments.create() + assert_matches_type(RoleAssignmentCreateResponse, role_assignment, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create_with_all_params(self, client: Gitpod) -> None: + role_assignment = client.groups.role_assignments.create( + group_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + resource_id="f53d2330-3795-4c5d-a1f3-453121af9c60", + resource_role="RESOURCE_ROLE_RUNNER_ADMIN", + resource_type="RESOURCE_TYPE_RUNNER", + ) + assert_matches_type(RoleAssignmentCreateResponse, role_assignment, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_create(self, client: Gitpod) -> None: + response = client.groups.role_assignments.with_raw_response.create() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + role_assignment = response.parse() + assert_matches_type(RoleAssignmentCreateResponse, role_assignment, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_create(self, client: Gitpod) -> None: + with client.groups.role_assignments.with_streaming_response.create() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + role_assignment = response.parse() + assert_matches_type(RoleAssignmentCreateResponse, role_assignment, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_list(self, client: Gitpod) -> None: + role_assignment = client.groups.role_assignments.list() + assert_matches_type(SyncAssignmentsPage[RoleAssignment], role_assignment, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_list_with_all_params(self, client: Gitpod) -> None: + role_assignment = client.groups.role_assignments.list( + token="token", + page_size=0, + filter={ + "group_id": "groupId", + "resource_roles": ["RESOURCE_ROLE_UNSPECIFIED"], + "resource_types": ["RESOURCE_TYPE_RUNNER"], + "user_id": "userId", + }, + pagination={ + "token": "token", + "page_size": 20, + }, + ) + assert_matches_type(SyncAssignmentsPage[RoleAssignment], role_assignment, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_list(self, client: Gitpod) -> None: + response = client.groups.role_assignments.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + role_assignment = response.parse() + assert_matches_type(SyncAssignmentsPage[RoleAssignment], role_assignment, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_list(self, client: Gitpod) -> None: + with client.groups.role_assignments.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + role_assignment = response.parse() + assert_matches_type(SyncAssignmentsPage[RoleAssignment], role_assignment, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_delete(self, client: Gitpod) -> None: + role_assignment = client.groups.role_assignments.delete() + assert_matches_type(object, role_assignment, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_delete_with_all_params(self, client: Gitpod) -> None: + role_assignment = client.groups.role_assignments.delete( + assignment_id="a1b2c3d4-5678-90ab-cdef-1234567890ab", + ) + assert_matches_type(object, role_assignment, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_delete(self, client: Gitpod) -> None: + response = client.groups.role_assignments.with_raw_response.delete() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + role_assignment = response.parse() + assert_matches_type(object, role_assignment, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_delete(self, client: Gitpod) -> None: + with client.groups.role_assignments.with_streaming_response.delete() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + role_assignment = response.parse() + assert_matches_type(object, role_assignment, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncRoleAssignments: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create(self, async_client: AsyncGitpod) -> None: + role_assignment = await async_client.groups.role_assignments.create() + assert_matches_type(RoleAssignmentCreateResponse, role_assignment, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: + role_assignment = await async_client.groups.role_assignments.create( + group_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + resource_id="f53d2330-3795-4c5d-a1f3-453121af9c60", + resource_role="RESOURCE_ROLE_RUNNER_ADMIN", + resource_type="RESOURCE_TYPE_RUNNER", + ) + assert_matches_type(RoleAssignmentCreateResponse, role_assignment, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: + response = await async_client.groups.role_assignments.with_raw_response.create() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + role_assignment = await response.parse() + assert_matches_type(RoleAssignmentCreateResponse, role_assignment, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: + async with async_client.groups.role_assignments.with_streaming_response.create() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + role_assignment = await response.parse() + assert_matches_type(RoleAssignmentCreateResponse, role_assignment, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_list(self, async_client: AsyncGitpod) -> None: + role_assignment = await async_client.groups.role_assignments.list() + assert_matches_type(AsyncAssignmentsPage[RoleAssignment], role_assignment, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: + role_assignment = await async_client.groups.role_assignments.list( + token="token", + page_size=0, + filter={ + "group_id": "groupId", + "resource_roles": ["RESOURCE_ROLE_UNSPECIFIED"], + "resource_types": ["RESOURCE_TYPE_RUNNER"], + "user_id": "userId", + }, + pagination={ + "token": "token", + "page_size": 20, + }, + ) + assert_matches_type(AsyncAssignmentsPage[RoleAssignment], role_assignment, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: + response = await async_client.groups.role_assignments.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + role_assignment = await response.parse() + assert_matches_type(AsyncAssignmentsPage[RoleAssignment], role_assignment, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: + async with async_client.groups.role_assignments.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + role_assignment = await response.parse() + assert_matches_type(AsyncAssignmentsPage[RoleAssignment], role_assignment, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_delete(self, async_client: AsyncGitpod) -> None: + role_assignment = await async_client.groups.role_assignments.delete() + assert_matches_type(object, role_assignment, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: + role_assignment = await async_client.groups.role_assignments.delete( + assignment_id="a1b2c3d4-5678-90ab-cdef-1234567890ab", + ) + assert_matches_type(object, role_assignment, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: + response = await async_client.groups.role_assignments.with_raw_response.delete() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + role_assignment = await response.parse() + assert_matches_type(object, role_assignment, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: + async with async_client.groups.role_assignments.with_streaming_response.delete() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + role_assignment = await response.parse() + assert_matches_type(object, role_assignment, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/organizations/test_custom_domains.py b/tests/api_resources/organizations/test_custom_domains.py new file mode 100644 index 00000000..dd7d86bc --- /dev/null +++ b/tests/api_resources/organizations/test_custom_domains.py @@ -0,0 +1,360 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types.organizations import ( + CustomDomainCreateResponse, + CustomDomainUpdateResponse, + CustomDomainRetrieveResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestCustomDomains: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create(self, client: Gitpod) -> None: + custom_domain = client.organizations.custom_domains.create( + domain_name="workspaces.acme-corp.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type(CustomDomainCreateResponse, custom_domain, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create_with_all_params(self, client: Gitpod) -> None: + custom_domain = client.organizations.custom_domains.create( + domain_name="workspaces.acme-corp.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + aws_account_id="123456789012", + cloud_account_id="cloudAccountId", + provider="CUSTOM_DOMAIN_PROVIDER_AWS", + ) + assert_matches_type(CustomDomainCreateResponse, custom_domain, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_create(self, client: Gitpod) -> None: + response = client.organizations.custom_domains.with_raw_response.create( + domain_name="workspaces.acme-corp.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + custom_domain = response.parse() + assert_matches_type(CustomDomainCreateResponse, custom_domain, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_create(self, client: Gitpod) -> None: + with client.organizations.custom_domains.with_streaming_response.create( + domain_name="workspaces.acme-corp.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + custom_domain = response.parse() + assert_matches_type(CustomDomainCreateResponse, custom_domain, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_retrieve(self, client: Gitpod) -> None: + custom_domain = client.organizations.custom_domains.retrieve( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type(CustomDomainRetrieveResponse, custom_domain, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_retrieve(self, client: Gitpod) -> None: + response = client.organizations.custom_domains.with_raw_response.retrieve( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + custom_domain = response.parse() + assert_matches_type(CustomDomainRetrieveResponse, custom_domain, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_retrieve(self, client: Gitpod) -> None: + with client.organizations.custom_domains.with_streaming_response.retrieve( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + custom_domain = response.parse() + assert_matches_type(CustomDomainRetrieveResponse, custom_domain, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_update(self, client: Gitpod) -> None: + custom_domain = client.organizations.custom_domains.update( + domain_name="workspaces.acme-corp.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type(CustomDomainUpdateResponse, custom_domain, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_update_with_all_params(self, client: Gitpod) -> None: + custom_domain = client.organizations.custom_domains.update( + domain_name="workspaces.acme-corp.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + aws_account_id="987654321098", + cloud_account_id="cloudAccountId", + provider="CUSTOM_DOMAIN_PROVIDER_UNSPECIFIED", + ) + assert_matches_type(CustomDomainUpdateResponse, custom_domain, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_update(self, client: Gitpod) -> None: + response = client.organizations.custom_domains.with_raw_response.update( + domain_name="workspaces.acme-corp.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + custom_domain = response.parse() + assert_matches_type(CustomDomainUpdateResponse, custom_domain, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_update(self, client: Gitpod) -> None: + with client.organizations.custom_domains.with_streaming_response.update( + domain_name="workspaces.acme-corp.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + custom_domain = response.parse() + assert_matches_type(CustomDomainUpdateResponse, custom_domain, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_delete(self, client: Gitpod) -> None: + custom_domain = client.organizations.custom_domains.delete( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type(object, custom_domain, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_delete(self, client: Gitpod) -> None: + response = client.organizations.custom_domains.with_raw_response.delete( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + custom_domain = response.parse() + assert_matches_type(object, custom_domain, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_delete(self, client: Gitpod) -> None: + with client.organizations.custom_domains.with_streaming_response.delete( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + custom_domain = response.parse() + assert_matches_type(object, custom_domain, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncCustomDomains: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create(self, async_client: AsyncGitpod) -> None: + custom_domain = await async_client.organizations.custom_domains.create( + domain_name="workspaces.acme-corp.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type(CustomDomainCreateResponse, custom_domain, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: + custom_domain = await async_client.organizations.custom_domains.create( + domain_name="workspaces.acme-corp.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + aws_account_id="123456789012", + cloud_account_id="cloudAccountId", + provider="CUSTOM_DOMAIN_PROVIDER_AWS", + ) + assert_matches_type(CustomDomainCreateResponse, custom_domain, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.custom_domains.with_raw_response.create( + domain_name="workspaces.acme-corp.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + custom_domain = await response.parse() + assert_matches_type(CustomDomainCreateResponse, custom_domain, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.custom_domains.with_streaming_response.create( + domain_name="workspaces.acme-corp.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + custom_domain = await response.parse() + assert_matches_type(CustomDomainCreateResponse, custom_domain, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: + custom_domain = await async_client.organizations.custom_domains.retrieve( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type(CustomDomainRetrieveResponse, custom_domain, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.custom_domains.with_raw_response.retrieve( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + custom_domain = await response.parse() + assert_matches_type(CustomDomainRetrieveResponse, custom_domain, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.custom_domains.with_streaming_response.retrieve( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + custom_domain = await response.parse() + assert_matches_type(CustomDomainRetrieveResponse, custom_domain, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_update(self, async_client: AsyncGitpod) -> None: + custom_domain = await async_client.organizations.custom_domains.update( + domain_name="workspaces.acme-corp.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type(CustomDomainUpdateResponse, custom_domain, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: + custom_domain = await async_client.organizations.custom_domains.update( + domain_name="workspaces.acme-corp.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + aws_account_id="987654321098", + cloud_account_id="cloudAccountId", + provider="CUSTOM_DOMAIN_PROVIDER_UNSPECIFIED", + ) + assert_matches_type(CustomDomainUpdateResponse, custom_domain, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.custom_domains.with_raw_response.update( + domain_name="workspaces.acme-corp.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + custom_domain = await response.parse() + assert_matches_type(CustomDomainUpdateResponse, custom_domain, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.custom_domains.with_streaming_response.update( + domain_name="workspaces.acme-corp.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + custom_domain = await response.parse() + assert_matches_type(CustomDomainUpdateResponse, custom_domain, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_delete(self, async_client: AsyncGitpod) -> None: + custom_domain = await async_client.organizations.custom_domains.delete( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type(object, custom_domain, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.custom_domains.with_raw_response.delete( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + custom_domain = await response.parse() + assert_matches_type(object, custom_domain, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.custom_domains.with_streaming_response.delete( + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + custom_domain = await response.parse() + assert_matches_type(object, custom_domain, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/organizations/test_policies.py b/tests/api_resources/organizations/test_policies.py index cf7c13ff..1d743341 100644 --- a/tests/api_resources/organizations/test_policies.py +++ b/tests/api_resources/organizations/test_policies.py @@ -64,16 +64,34 @@ def test_method_update(self, client: Gitpod) -> None: def test_method_update_with_all_params(self, client: Gitpod) -> None: policy = client.organizations.policies.update( organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + agent_policy={ + "command_deny_list": ["string"], + "mcp_disabled": True, + "scm_tools_disabled": True, + }, allowed_editor_ids=["string"], allow_local_runners=True, default_editor_id="defaultEditorId", default_environment_image="defaultEnvironmentImage", + delete_archived_environments_after="+9125115.360s", + editor_version_restrictions={"foo": {"allowed_versions": ["string"]}}, + maximum_environment_lifetime="+9125115.360s", maximum_environments_per_user="20", maximum_environment_timeout="3600s", maximum_running_environments_per_user="5", members_create_projects=True, members_require_projects=True, port_sharing_disabled=True, + require_custom_domain_access=True, + security_agent_policy={ + "crowdstrike": { + "additional_options": {"foo": "string"}, + "cid_secret_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "enabled": True, + "image": "image", + "tags": "tags", + } + }, ) assert_matches_type(object, policy, path=["response"]) @@ -156,16 +174,34 @@ async def test_method_update(self, async_client: AsyncGitpod) -> None: async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.organizations.policies.update( organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + agent_policy={ + "command_deny_list": ["string"], + "mcp_disabled": True, + "scm_tools_disabled": True, + }, allowed_editor_ids=["string"], allow_local_runners=True, default_editor_id="defaultEditorId", default_environment_image="defaultEnvironmentImage", + delete_archived_environments_after="+9125115.360s", + editor_version_restrictions={"foo": {"allowed_versions": ["string"]}}, + maximum_environment_lifetime="+9125115.360s", maximum_environments_per_user="20", maximum_environment_timeout="3600s", maximum_running_environments_per_user="5", members_create_projects=True, members_require_projects=True, port_sharing_disabled=True, + require_custom_domain_access=True, + security_agent_policy={ + "crowdstrike": { + "additional_options": {"foo": "string"}, + "cid_secret_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "enabled": True, + "image": "image", + "tags": "tags", + } + }, ) assert_matches_type(object, policy, path=["response"]) diff --git a/tests/api_resources/organizations/test_sso_configurations.py b/tests/api_resources/organizations/test_sso_configurations.py index 415fd137..9e10ff80 100644 --- a/tests/api_resources/organizations/test_sso_configurations.py +++ b/tests/api_resources/organizations/test_sso_configurations.py @@ -28,19 +28,31 @@ def test_method_create(self, client: Gitpod) -> None: sso_configuration = client.organizations.sso_configurations.create( client_id="012345678-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com", client_secret="GOCSPX-abcdefghijklmnopqrstuvwxyz123456", - email_domain="acme-corp.com", issuer_url="https://accounts.google.com", organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create_with_all_params(self, client: Gitpod) -> None: + sso_configuration = client.organizations.sso_configurations.create( + client_id="012345678-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com", + client_secret="GOCSPX-abcdefghijklmnopqrstuvwxyz123456", + issuer_url="https://accounts.google.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + display_name="displayName", + email_domain="acme-corp.com", + email_domains=["sfN2.l.iJR-BU.u9JV9.a.m.o2D-4b-Jd.0Z-kX.L.n.S.f.UKbxB"], + ) + assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.organizations.sso_configurations.with_raw_response.create( client_id="012345678-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com", client_secret="GOCSPX-abcdefghijklmnopqrstuvwxyz123456", - email_domain="acme-corp.com", issuer_url="https://accounts.google.com", organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) @@ -56,7 +68,6 @@ def test_streaming_response_create(self, client: Gitpod) -> None: with client.organizations.sso_configurations.with_streaming_response.create( client_id="012345678-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com", client_secret="GOCSPX-abcdefghijklmnopqrstuvwxyz123456", - email_domain="acme-corp.com", issuer_url="https://accounts.google.com", organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) as response: @@ -118,7 +129,9 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: claims={"foo": "string"}, client_id="new-client-id", client_secret="new-client-secret", + display_name="displayName", email_domain="xxxx", + email_domains=["sfN2.l.iJR-BU.u9JV9.a.m.o2D-4b-Jd.0Z-kX.L.n.S.f.UKbxB"], issuer_url="https://example.com", state="SSO_CONFIGURATION_STATE_UNSPECIFIED", ) @@ -244,19 +257,31 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: sso_configuration = await async_client.organizations.sso_configurations.create( client_id="012345678-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com", client_secret="GOCSPX-abcdefghijklmnopqrstuvwxyz123456", - email_domain="acme-corp.com", issuer_url="https://accounts.google.com", organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: + sso_configuration = await async_client.organizations.sso_configurations.create( + client_id="012345678-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com", + client_secret="GOCSPX-abcdefghijklmnopqrstuvwxyz123456", + issuer_url="https://accounts.google.com", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + display_name="displayName", + email_domain="acme-corp.com", + email_domains=["sfN2.l.iJR-BU.u9JV9.a.m.o2D-4b-Jd.0Z-kX.L.n.S.f.UKbxB"], + ) + assert_matches_type(SSOConfigurationCreateResponse, sso_configuration, path=["response"]) + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.organizations.sso_configurations.with_raw_response.create( client_id="012345678-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com", client_secret="GOCSPX-abcdefghijklmnopqrstuvwxyz123456", - email_domain="acme-corp.com", issuer_url="https://accounts.google.com", organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) @@ -272,7 +297,6 @@ async def test_streaming_response_create(self, async_client: AsyncGitpod) -> Non async with async_client.organizations.sso_configurations.with_streaming_response.create( client_id="012345678-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com", client_secret="GOCSPX-abcdefghijklmnopqrstuvwxyz123456", - email_domain="acme-corp.com", issuer_url="https://accounts.google.com", organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) as response: @@ -334,7 +358,9 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> claims={"foo": "string"}, client_id="new-client-id", client_secret="new-client-secret", + display_name="displayName", email_domain="xxxx", + email_domains=["sfN2.l.iJR-BU.u9JV9.a.m.o2D-4b-Jd.0Z-kX.L.n.S.f.UKbxB"], issuer_url="https://example.com", state="SSO_CONFIGURATION_STATE_UNSPECIFIED", ) diff --git a/tests/api_resources/projects/test_environment_clases.py b/tests/api_resources/projects/test_environment_clases.py new file mode 100644 index 00000000..fada14da --- /dev/null +++ b/tests/api_resources/projects/test_environment_clases.py @@ -0,0 +1,221 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.pagination import SyncProjectEnvironmentClassesPage, AsyncProjectEnvironmentClassesPage +from gitpod.types.shared import ProjectEnvironmentClass + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestEnvironmentClases: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_update(self, client: Gitpod) -> None: + environment_clase = client.projects.environment_clases.update() + assert_matches_type(object, environment_clase, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_update_with_all_params(self, client: Gitpod) -> None: + environment_clase = client.projects.environment_clases.update( + project_environment_classes=[ + { + "environment_class_id": "b0e12f6c-4c67-429d-a4a6-d9838b5da041", + "local_runner": True, + "order": 0, + }, + { + "environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "local_runner": True, + "order": 1, + }, + ], + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type(object, environment_clase, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_update(self, client: Gitpod) -> None: + response = client.projects.environment_clases.with_raw_response.update() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment_clase = response.parse() + assert_matches_type(object, environment_clase, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_update(self, client: Gitpod) -> None: + with client.projects.environment_clases.with_streaming_response.update() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment_clase = response.parse() + assert_matches_type(object, environment_clase, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_list(self, client: Gitpod) -> None: + environment_clase = client.projects.environment_clases.list() + assert_matches_type( + SyncProjectEnvironmentClassesPage[ProjectEnvironmentClass], environment_clase, path=["response"] + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_list_with_all_params(self, client: Gitpod) -> None: + environment_clase = client.projects.environment_clases.list( + token="token", + page_size=0, + pagination={ + "token": "token", + "page_size": 20, + }, + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type( + SyncProjectEnvironmentClassesPage[ProjectEnvironmentClass], environment_clase, path=["response"] + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_list(self, client: Gitpod) -> None: + response = client.projects.environment_clases.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment_clase = response.parse() + assert_matches_type( + SyncProjectEnvironmentClassesPage[ProjectEnvironmentClass], environment_clase, path=["response"] + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_list(self, client: Gitpod) -> None: + with client.projects.environment_clases.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment_clase = response.parse() + assert_matches_type( + SyncProjectEnvironmentClassesPage[ProjectEnvironmentClass], environment_clase, path=["response"] + ) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncEnvironmentClases: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_update(self, async_client: AsyncGitpod) -> None: + environment_clase = await async_client.projects.environment_clases.update() + assert_matches_type(object, environment_clase, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: + environment_clase = await async_client.projects.environment_clases.update( + project_environment_classes=[ + { + "environment_class_id": "b0e12f6c-4c67-429d-a4a6-d9838b5da041", + "local_runner": True, + "order": 0, + }, + { + "environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "local_runner": True, + "order": 1, + }, + ], + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type(object, environment_clase, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: + response = await async_client.projects.environment_clases.with_raw_response.update() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment_clase = await response.parse() + assert_matches_type(object, environment_clase, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: + async with async_client.projects.environment_clases.with_streaming_response.update() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment_clase = await response.parse() + assert_matches_type(object, environment_clase, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_list(self, async_client: AsyncGitpod) -> None: + environment_clase = await async_client.projects.environment_clases.list() + assert_matches_type( + AsyncProjectEnvironmentClassesPage[ProjectEnvironmentClass], environment_clase, path=["response"] + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: + environment_clase = await async_client.projects.environment_clases.list( + token="token", + page_size=0, + pagination={ + "token": "token", + "page_size": 20, + }, + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type( + AsyncProjectEnvironmentClassesPage[ProjectEnvironmentClass], environment_clase, path=["response"] + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: + response = await async_client.projects.environment_clases.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + environment_clase = await response.parse() + assert_matches_type( + AsyncProjectEnvironmentClassesPage[ProjectEnvironmentClass], environment_clase, path=["response"] + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: + async with async_client.projects.environment_clases.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + environment_clase = await response.parse() + assert_matches_type( + AsyncProjectEnvironmentClassesPage[ProjectEnvironmentClass], environment_clase, path=["response"] + ) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/runners/configurations/test_host_authentication_tokens.py b/tests/api_resources/runners/configurations/test_host_authentication_tokens.py index 3e24dbc1..ccfcf9f2 100644 --- a/tests/api_resources/runners/configurations/test_host_authentication_tokens.py +++ b/tests/api_resources/runners/configurations/test_host_authentication_tokens.py @@ -36,9 +36,15 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: token="gho_xxxxxxxxxxxx", expires_at=parse_datetime("2024-12-31T23:59:59Z"), host="github.com", + integration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", refresh_token="ghr_xxxxxxxxxxxx", runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + scopes=["string"], source="HOST_AUTHENTICATION_TOKEN_SOURCE_OAUTH", + subject={ + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "principal": "PRINCIPAL_UNSPECIFIED", + }, user_id="f53d2330-3795-4c5d-a1f3-453121af9c60", ) assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) @@ -115,6 +121,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: token="gho_xxxxxxxxxxxx", expires_at=parse_datetime("2024-12-31T23:59:59Z"), refresh_token="ghr_xxxxxxxxxxxx", + scopes=["string"], ) assert_matches_type(object, host_authentication_token, path=["response"]) @@ -154,6 +161,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: page_size=0, filter={ "runner_id": "d2c94c27-3b76-4a42-b88c-95a85e392c68", + "subject_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "user_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", }, pagination={ @@ -240,9 +248,15 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> token="gho_xxxxxxxxxxxx", expires_at=parse_datetime("2024-12-31T23:59:59Z"), host="github.com", + integration_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", refresh_token="ghr_xxxxxxxxxxxx", runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + scopes=["string"], source="HOST_AUTHENTICATION_TOKEN_SOURCE_OAUTH", + subject={ + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "principal": "PRINCIPAL_UNSPECIFIED", + }, user_id="f53d2330-3795-4c5d-a1f3-453121af9c60", ) assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) @@ -323,6 +337,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> token="gho_xxxxxxxxxxxx", expires_at=parse_datetime("2024-12-31T23:59:59Z"), refresh_token="ghr_xxxxxxxxxxxx", + scopes=["string"], ) assert_matches_type(object, host_authentication_token, path=["response"]) @@ -364,6 +379,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N page_size=0, filter={ "runner_id": "d2c94c27-3b76-4a42-b88c-95a85e392c68", + "subject_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "user_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", }, pagination={ diff --git a/tests/api_resources/runners/configurations/test_scm_integrations.py b/tests/api_resources/runners/configurations/test_scm_integrations.py index 36bf74fd..d68d3e88 100644 --- a/tests/api_resources/runners/configurations/test_scm_integrations.py +++ b/tests/api_resources/runners/configurations/test_scm_integrations.py @@ -39,6 +39,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: pat=True, runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", scm_id="github", + virtual_directory="virtualDirectory", ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) @@ -115,6 +116,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: oauth_client_id="new_client_id", oauth_plaintext_client_secret="new_client_secret", pat=True, + virtual_directory="virtualDirectory", ) assert_matches_type(object, scm_integration, path=["response"]) @@ -241,6 +243,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> pat=True, runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", scm_id="github", + virtual_directory="virtualDirectory", ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) @@ -317,6 +320,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> oauth_client_id="new_client_id", oauth_plaintext_client_secret="new_client_secret", pat=True, + virtual_directory="virtualDirectory", ) assert_matches_type(object, scm_integration, path=["response"]) diff --git a/tests/api_resources/runners/test_configurations.py b/tests/api_resources/runners/test_configurations.py index cebba5e7..0672e8e1 100644 --- a/tests/api_resources/runners/test_configurations.py +++ b/tests/api_resources/runners/test_configurations.py @@ -50,6 +50,7 @@ def test_method_validate_with_all_params(self, client: Gitpod) -> None: "oauth_plaintext_client_secret": "client_secret", "pat": True, "scm_id": "github", + "virtual_directory": "virtualDirectory", }, ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) @@ -115,6 +116,7 @@ async def test_method_validate_with_all_params(self, async_client: AsyncGitpod) "oauth_plaintext_client_secret": "client_secret", "pat": True, "scm_id": "github", + "virtual_directory": "virtualDirectory", }, ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) diff --git a/tests/api_resources/test_accounts.py b/tests/api_resources/test_accounts.py index 31390ba9..41f2192e 100644 --- a/tests/api_resources/test_accounts.py +++ b/tests/api_resources/test_accounts.py @@ -11,11 +11,19 @@ from tests.utils import assert_matches_type from gitpod.types import ( LoginProvider, + JoinableOrganization, AccountRetrieveResponse, + AccountListSSOLoginsResponse, AccountGetSSOLoginURLResponse, - AccountListJoinableOrganizationsResponse, ) -from gitpod.pagination import SyncLoginProvidersPage, AsyncLoginProvidersPage +from gitpod.pagination import ( + SyncLoginsPage, + AsyncLoginsPage, + SyncLoginProvidersPage, + AsyncLoginProvidersPage, + SyncJoinableOrganizationsPage, + AsyncJoinableOrganizationsPage, +) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -67,6 +75,15 @@ def test_method_delete(self, client: Gitpod) -> None: ) assert_matches_type(object, account, path=["response"]) + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_delete_with_all_params(self, client: Gitpod) -> None: + account = client.accounts.delete( + account_id="f53d2330-3795-4c5d-a1f3-453121af9c60", + reason="reason", + ) + assert_matches_type(object, account, path=["response"]) + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_delete(self, client: Gitpod) -> None: @@ -140,7 +157,7 @@ def test_streaming_response_get_sso_login_url(self, client: Gitpod) -> None: @parametrize def test_method_list_joinable_organizations(self, client: Gitpod) -> None: account = client.accounts.list_joinable_organizations() - assert_matches_type(AccountListJoinableOrganizationsResponse, account, path=["response"]) + assert_matches_type(SyncJoinableOrganizationsPage[JoinableOrganization], account, path=["response"]) @pytest.mark.skip(reason="Prism tests are disabled") @parametrize @@ -148,9 +165,12 @@ def test_method_list_joinable_organizations_with_all_params(self, client: Gitpod account = client.accounts.list_joinable_organizations( token="token", page_size=0, - empty=True, + pagination={ + "token": "token", + "page_size": 100, + }, ) - assert_matches_type(AccountListJoinableOrganizationsResponse, account, path=["response"]) + assert_matches_type(SyncJoinableOrganizationsPage[JoinableOrganization], account, path=["response"]) @pytest.mark.skip(reason="Prism tests are disabled") @parametrize @@ -160,7 +180,7 @@ def test_raw_response_list_joinable_organizations(self, client: Gitpod) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" account = response.parse() - assert_matches_type(AccountListJoinableOrganizationsResponse, account, path=["response"]) + assert_matches_type(SyncJoinableOrganizationsPage[JoinableOrganization], account, path=["response"]) @pytest.mark.skip(reason="Prism tests are disabled") @parametrize @@ -170,7 +190,7 @@ def test_streaming_response_list_joinable_organizations(self, client: Gitpod) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" account = response.parse() - assert_matches_type(AccountListJoinableOrganizationsResponse, account, path=["response"]) + assert_matches_type(SyncJoinableOrganizationsPage[JoinableOrganization], account, path=["response"]) assert cast(Any, response.is_closed) is True @@ -186,7 +206,10 @@ def test_method_list_login_providers_with_all_params(self, client: Gitpod) -> No account = client.accounts.list_login_providers( token="token", page_size=0, - filter={"invite_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, + filter={ + "email": "email", + "invite_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + }, pagination={ "token": "token", "page_size": 20, @@ -216,6 +239,55 @@ def test_streaming_response_list_login_providers(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_list_sso_logins(self, client: Gitpod) -> None: + account = client.accounts.list_sso_logins( + email="dev@stainless.com", + ) + assert_matches_type(SyncLoginsPage[AccountListSSOLoginsResponse], account, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_list_sso_logins_with_all_params(self, client: Gitpod) -> None: + account = client.accounts.list_sso_logins( + email="dev@stainless.com", + token="token", + page_size=0, + pagination={ + "token": "token", + "page_size": 100, + }, + return_to="https://example.com", + ) + assert_matches_type(SyncLoginsPage[AccountListSSOLoginsResponse], account, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_list_sso_logins(self, client: Gitpod) -> None: + response = client.accounts.with_raw_response.list_sso_logins( + email="dev@stainless.com", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + account = response.parse() + assert_matches_type(SyncLoginsPage[AccountListSSOLoginsResponse], account, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_list_sso_logins(self, client: Gitpod) -> None: + with client.accounts.with_streaming_response.list_sso_logins( + email="dev@stainless.com", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + account = response.parse() + assert_matches_type(SyncLoginsPage[AccountListSSOLoginsResponse], account, path=["response"]) + + assert cast(Any, response.is_closed) is True + class TestAsyncAccounts: parametrize = pytest.mark.parametrize( @@ -266,6 +338,15 @@ async def test_method_delete(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(object, account, path=["response"]) + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: + account = await async_client.accounts.delete( + account_id="f53d2330-3795-4c5d-a1f3-453121af9c60", + reason="reason", + ) + assert_matches_type(object, account, path=["response"]) + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: @@ -339,7 +420,7 @@ async def test_streaming_response_get_sso_login_url(self, async_client: AsyncGit @parametrize async def test_method_list_joinable_organizations(self, async_client: AsyncGitpod) -> None: account = await async_client.accounts.list_joinable_organizations() - assert_matches_type(AccountListJoinableOrganizationsResponse, account, path=["response"]) + assert_matches_type(AsyncJoinableOrganizationsPage[JoinableOrganization], account, path=["response"]) @pytest.mark.skip(reason="Prism tests are disabled") @parametrize @@ -347,9 +428,12 @@ async def test_method_list_joinable_organizations_with_all_params(self, async_cl account = await async_client.accounts.list_joinable_organizations( token="token", page_size=0, - empty=True, + pagination={ + "token": "token", + "page_size": 100, + }, ) - assert_matches_type(AccountListJoinableOrganizationsResponse, account, path=["response"]) + assert_matches_type(AsyncJoinableOrganizationsPage[JoinableOrganization], account, path=["response"]) @pytest.mark.skip(reason="Prism tests are disabled") @parametrize @@ -359,7 +443,7 @@ async def test_raw_response_list_joinable_organizations(self, async_client: Asyn assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" account = await response.parse() - assert_matches_type(AccountListJoinableOrganizationsResponse, account, path=["response"]) + assert_matches_type(AsyncJoinableOrganizationsPage[JoinableOrganization], account, path=["response"]) @pytest.mark.skip(reason="Prism tests are disabled") @parametrize @@ -369,7 +453,7 @@ async def test_streaming_response_list_joinable_organizations(self, async_client assert response.http_request.headers.get("X-Stainless-Lang") == "python" account = await response.parse() - assert_matches_type(AccountListJoinableOrganizationsResponse, account, path=["response"]) + assert_matches_type(AsyncJoinableOrganizationsPage[JoinableOrganization], account, path=["response"]) assert cast(Any, response.is_closed) is True @@ -385,7 +469,10 @@ async def test_method_list_login_providers_with_all_params(self, async_client: A account = await async_client.accounts.list_login_providers( token="token", page_size=0, - filter={"invite_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, + filter={ + "email": "email", + "invite_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + }, pagination={ "token": "token", "page_size": 20, @@ -414,3 +501,52 @@ async def test_streaming_response_list_login_providers(self, async_client: Async assert_matches_type(AsyncLoginProvidersPage[LoginProvider], account, path=["response"]) assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_list_sso_logins(self, async_client: AsyncGitpod) -> None: + account = await async_client.accounts.list_sso_logins( + email="dev@stainless.com", + ) + assert_matches_type(AsyncLoginsPage[AccountListSSOLoginsResponse], account, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_list_sso_logins_with_all_params(self, async_client: AsyncGitpod) -> None: + account = await async_client.accounts.list_sso_logins( + email="dev@stainless.com", + token="token", + page_size=0, + pagination={ + "token": "token", + "page_size": 100, + }, + return_to="https://example.com", + ) + assert_matches_type(AsyncLoginsPage[AccountListSSOLoginsResponse], account, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_list_sso_logins(self, async_client: AsyncGitpod) -> None: + response = await async_client.accounts.with_raw_response.list_sso_logins( + email="dev@stainless.com", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + account = await response.parse() + assert_matches_type(AsyncLoginsPage[AccountListSSOLoginsResponse], account, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_list_sso_logins(self, async_client: AsyncGitpod) -> None: + async with async_client.accounts.with_streaming_response.list_sso_logins( + email="dev@stainless.com", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + account = await response.parse() + assert_matches_type(AsyncLoginsPage[AccountListSSOLoginsResponse], account, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_agents.py b/tests/api_resources/test_agents.py new file mode 100644 index 00000000..9a37aaf8 --- /dev/null +++ b/tests/api_resources/test_agents.py @@ -0,0 +1,1037 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types import ( + Prompt, + AgentExecution, + AgentCreatePromptResponse, + AgentUpdatePromptResponse, + AgentRetrievePromptResponse, + AgentStartExecutionResponse, + AgentRetrieveExecutionResponse, + AgentCreateExecutionConversationTokenResponse, +) +from gitpod._utils import parse_datetime +from gitpod.pagination import SyncPromptsPage, AsyncPromptsPage, SyncAgentExecutionsPage, AsyncAgentExecutionsPage + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestAgents: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create_execution_conversation_token(self, client: Gitpod) -> None: + agent = client.agents.create_execution_conversation_token() + assert_matches_type(AgentCreateExecutionConversationTokenResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create_execution_conversation_token_with_all_params(self, client: Gitpod) -> None: + agent = client.agents.create_execution_conversation_token( + agent_execution_id="6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35", + ) + assert_matches_type(AgentCreateExecutionConversationTokenResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_create_execution_conversation_token(self, client: Gitpod) -> None: + response = client.agents.with_raw_response.create_execution_conversation_token() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = response.parse() + assert_matches_type(AgentCreateExecutionConversationTokenResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_create_execution_conversation_token(self, client: Gitpod) -> None: + with client.agents.with_streaming_response.create_execution_conversation_token() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = response.parse() + assert_matches_type(AgentCreateExecutionConversationTokenResponse, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create_prompt(self, client: Gitpod) -> None: + agent = client.agents.create_prompt() + assert_matches_type(AgentCreatePromptResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create_prompt_with_all_params(self, client: Gitpod) -> None: + agent = client.agents.create_prompt( + command="command", + description="x", + is_command=True, + is_template=True, + name="x", + prompt="x", + ) + assert_matches_type(AgentCreatePromptResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_create_prompt(self, client: Gitpod) -> None: + response = client.agents.with_raw_response.create_prompt() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = response.parse() + assert_matches_type(AgentCreatePromptResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_create_prompt(self, client: Gitpod) -> None: + with client.agents.with_streaming_response.create_prompt() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = response.parse() + assert_matches_type(AgentCreatePromptResponse, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_delete_execution(self, client: Gitpod) -> None: + agent = client.agents.delete_execution() + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_delete_execution_with_all_params(self, client: Gitpod) -> None: + agent = client.agents.delete_execution( + agent_execution_id="6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35", + ) + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_delete_execution(self, client: Gitpod) -> None: + response = client.agents.with_raw_response.delete_execution() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = response.parse() + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_delete_execution(self, client: Gitpod) -> None: + with client.agents.with_streaming_response.delete_execution() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = response.parse() + assert_matches_type(object, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_delete_prompt(self, client: Gitpod) -> None: + agent = client.agents.delete_prompt() + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_delete_prompt_with_all_params(self, client: Gitpod) -> None: + agent = client.agents.delete_prompt( + prompt_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_delete_prompt(self, client: Gitpod) -> None: + response = client.agents.with_raw_response.delete_prompt() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = response.parse() + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_delete_prompt(self, client: Gitpod) -> None: + with client.agents.with_streaming_response.delete_prompt() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = response.parse() + assert_matches_type(object, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_list_executions(self, client: Gitpod) -> None: + agent = client.agents.list_executions() + assert_matches_type(SyncAgentExecutionsPage[AgentExecution], agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_list_executions_with_all_params(self, client: Gitpod) -> None: + agent = client.agents.list_executions( + token="token", + page_size=0, + filter={ + "agent_ids": ["b8a64cfa-43e2-4b9d-9fb3-07edc63f5971"], + "creator_ids": ["string"], + "environment_ids": ["string"], + "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "roles": ["AGENT_EXECUTION_ROLE_UNSPECIFIED"], + "status_phases": ["PHASE_UNSPECIFIED"], + }, + pagination={ + "token": "token", + "page_size": 10, + }, + ) + assert_matches_type(SyncAgentExecutionsPage[AgentExecution], agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_list_executions(self, client: Gitpod) -> None: + response = client.agents.with_raw_response.list_executions() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = response.parse() + assert_matches_type(SyncAgentExecutionsPage[AgentExecution], agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_list_executions(self, client: Gitpod) -> None: + with client.agents.with_streaming_response.list_executions() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = response.parse() + assert_matches_type(SyncAgentExecutionsPage[AgentExecution], agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_list_prompts(self, client: Gitpod) -> None: + agent = client.agents.list_prompts() + assert_matches_type(SyncPromptsPage[Prompt], agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_list_prompts_with_all_params(self, client: Gitpod) -> None: + agent = client.agents.list_prompts( + token="token", + page_size=0, + filter={ + "command": "command", + "command_prefix": "commandPrefix", + "is_command": True, + "is_template": True, + }, + pagination={ + "token": "token", + "page_size": 10, + }, + ) + assert_matches_type(SyncPromptsPage[Prompt], agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_list_prompts(self, client: Gitpod) -> None: + response = client.agents.with_raw_response.list_prompts() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = response.parse() + assert_matches_type(SyncPromptsPage[Prompt], agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_list_prompts(self, client: Gitpod) -> None: + with client.agents.with_streaming_response.list_prompts() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = response.parse() + assert_matches_type(SyncPromptsPage[Prompt], agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_retrieve_execution(self, client: Gitpod) -> None: + agent = client.agents.retrieve_execution() + assert_matches_type(AgentRetrieveExecutionResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_retrieve_execution_with_all_params(self, client: Gitpod) -> None: + agent = client.agents.retrieve_execution( + agent_execution_id="6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35", + ) + assert_matches_type(AgentRetrieveExecutionResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_retrieve_execution(self, client: Gitpod) -> None: + response = client.agents.with_raw_response.retrieve_execution() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = response.parse() + assert_matches_type(AgentRetrieveExecutionResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_retrieve_execution(self, client: Gitpod) -> None: + with client.agents.with_streaming_response.retrieve_execution() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = response.parse() + assert_matches_type(AgentRetrieveExecutionResponse, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_retrieve_prompt(self, client: Gitpod) -> None: + agent = client.agents.retrieve_prompt() + assert_matches_type(AgentRetrievePromptResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_retrieve_prompt_with_all_params(self, client: Gitpod) -> None: + agent = client.agents.retrieve_prompt( + prompt_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) + assert_matches_type(AgentRetrievePromptResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_retrieve_prompt(self, client: Gitpod) -> None: + response = client.agents.with_raw_response.retrieve_prompt() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = response.parse() + assert_matches_type(AgentRetrievePromptResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_retrieve_prompt(self, client: Gitpod) -> None: + with client.agents.with_streaming_response.retrieve_prompt() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = response.parse() + assert_matches_type(AgentRetrievePromptResponse, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_send_to_execution(self, client: Gitpod) -> None: + agent = client.agents.send_to_execution() + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_send_to_execution_with_all_params(self, client: Gitpod) -> None: + agent = client.agents.send_to_execution( + agent_execution_id="6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35", + user_input={ + "text": {"content": "Generate a report based on the latest logs."}, + "id": "id", + "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), + }, + ) + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_send_to_execution(self, client: Gitpod) -> None: + response = client.agents.with_raw_response.send_to_execution() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = response.parse() + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_send_to_execution(self, client: Gitpod) -> None: + with client.agents.with_streaming_response.send_to_execution() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = response.parse() + assert_matches_type(object, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_start_execution(self, client: Gitpod) -> None: + agent = client.agents.start_execution() + assert_matches_type(AgentStartExecutionResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_start_execution_with_all_params(self, client: Gitpod) -> None: + agent = client.agents.start_execution( + agent_id="b8a64cfa-43e2-4b9d-9fb3-07edc63f5971", + code_context={ + "context_url": { + "environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "url": "https://example.com", + }, + "environment_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "project_id": "2d22e4eb-31da-467f-882c-27e21550992f", + "pull_request": { + "id": "id", + "author": "author", + "from_branch": "fromBranch", + "repository": { + "clone_url": "cloneUrl", + "host": "host", + "name": "name", + "owner": "owner", + }, + "title": "title", + "to_branch": "toBranch", + "url": "url", + }, + }, + mode="AGENT_MODE_UNSPECIFIED", + name="name", + workflow_action_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(AgentStartExecutionResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_start_execution(self, client: Gitpod) -> None: + response = client.agents.with_raw_response.start_execution() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = response.parse() + assert_matches_type(AgentStartExecutionResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_start_execution(self, client: Gitpod) -> None: + with client.agents.with_streaming_response.start_execution() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = response.parse() + assert_matches_type(AgentStartExecutionResponse, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_stop_execution(self, client: Gitpod) -> None: + agent = client.agents.stop_execution() + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_stop_execution_with_all_params(self, client: Gitpod) -> None: + agent = client.agents.stop_execution( + agent_execution_id="6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35", + ) + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_stop_execution(self, client: Gitpod) -> None: + response = client.agents.with_raw_response.stop_execution() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = response.parse() + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_stop_execution(self, client: Gitpod) -> None: + with client.agents.with_streaming_response.stop_execution() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = response.parse() + assert_matches_type(object, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_update_prompt(self, client: Gitpod) -> None: + agent = client.agents.update_prompt() + assert_matches_type(AgentUpdatePromptResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_update_prompt_with_all_params(self, client: Gitpod) -> None: + agent = client.agents.update_prompt( + metadata={ + "description": "x", + "name": "name", + }, + prompt_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + spec={ + "command": "command", + "is_command": True, + "is_template": True, + "prompt": "prompt", + }, + ) + assert_matches_type(AgentUpdatePromptResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_update_prompt(self, client: Gitpod) -> None: + response = client.agents.with_raw_response.update_prompt() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = response.parse() + assert_matches_type(AgentUpdatePromptResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_update_prompt(self, client: Gitpod) -> None: + with client.agents.with_streaming_response.update_prompt() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = response.parse() + assert_matches_type(AgentUpdatePromptResponse, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncAgents: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create_execution_conversation_token(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.create_execution_conversation_token() + assert_matches_type(AgentCreateExecutionConversationTokenResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create_execution_conversation_token_with_all_params(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.create_execution_conversation_token( + agent_execution_id="6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35", + ) + assert_matches_type(AgentCreateExecutionConversationTokenResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_create_execution_conversation_token(self, async_client: AsyncGitpod) -> None: + response = await async_client.agents.with_raw_response.create_execution_conversation_token() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = await response.parse() + assert_matches_type(AgentCreateExecutionConversationTokenResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_create_execution_conversation_token(self, async_client: AsyncGitpod) -> None: + async with async_client.agents.with_streaming_response.create_execution_conversation_token() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = await response.parse() + assert_matches_type(AgentCreateExecutionConversationTokenResponse, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create_prompt(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.create_prompt() + assert_matches_type(AgentCreatePromptResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create_prompt_with_all_params(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.create_prompt( + command="command", + description="x", + is_command=True, + is_template=True, + name="x", + prompt="x", + ) + assert_matches_type(AgentCreatePromptResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_create_prompt(self, async_client: AsyncGitpod) -> None: + response = await async_client.agents.with_raw_response.create_prompt() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = await response.parse() + assert_matches_type(AgentCreatePromptResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_create_prompt(self, async_client: AsyncGitpod) -> None: + async with async_client.agents.with_streaming_response.create_prompt() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = await response.parse() + assert_matches_type(AgentCreatePromptResponse, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_delete_execution(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.delete_execution() + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_delete_execution_with_all_params(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.delete_execution( + agent_execution_id="6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35", + ) + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_delete_execution(self, async_client: AsyncGitpod) -> None: + response = await async_client.agents.with_raw_response.delete_execution() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = await response.parse() + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_delete_execution(self, async_client: AsyncGitpod) -> None: + async with async_client.agents.with_streaming_response.delete_execution() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = await response.parse() + assert_matches_type(object, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_delete_prompt(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.delete_prompt() + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_delete_prompt_with_all_params(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.delete_prompt( + prompt_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_delete_prompt(self, async_client: AsyncGitpod) -> None: + response = await async_client.agents.with_raw_response.delete_prompt() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = await response.parse() + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_delete_prompt(self, async_client: AsyncGitpod) -> None: + async with async_client.agents.with_streaming_response.delete_prompt() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = await response.parse() + assert_matches_type(object, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_list_executions(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.list_executions() + assert_matches_type(AsyncAgentExecutionsPage[AgentExecution], agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_list_executions_with_all_params(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.list_executions( + token="token", + page_size=0, + filter={ + "agent_ids": ["b8a64cfa-43e2-4b9d-9fb3-07edc63f5971"], + "creator_ids": ["string"], + "environment_ids": ["string"], + "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "roles": ["AGENT_EXECUTION_ROLE_UNSPECIFIED"], + "status_phases": ["PHASE_UNSPECIFIED"], + }, + pagination={ + "token": "token", + "page_size": 10, + }, + ) + assert_matches_type(AsyncAgentExecutionsPage[AgentExecution], agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_list_executions(self, async_client: AsyncGitpod) -> None: + response = await async_client.agents.with_raw_response.list_executions() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = await response.parse() + assert_matches_type(AsyncAgentExecutionsPage[AgentExecution], agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_list_executions(self, async_client: AsyncGitpod) -> None: + async with async_client.agents.with_streaming_response.list_executions() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = await response.parse() + assert_matches_type(AsyncAgentExecutionsPage[AgentExecution], agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_list_prompts(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.list_prompts() + assert_matches_type(AsyncPromptsPage[Prompt], agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_list_prompts_with_all_params(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.list_prompts( + token="token", + page_size=0, + filter={ + "command": "command", + "command_prefix": "commandPrefix", + "is_command": True, + "is_template": True, + }, + pagination={ + "token": "token", + "page_size": 10, + }, + ) + assert_matches_type(AsyncPromptsPage[Prompt], agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_list_prompts(self, async_client: AsyncGitpod) -> None: + response = await async_client.agents.with_raw_response.list_prompts() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = await response.parse() + assert_matches_type(AsyncPromptsPage[Prompt], agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_list_prompts(self, async_client: AsyncGitpod) -> None: + async with async_client.agents.with_streaming_response.list_prompts() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = await response.parse() + assert_matches_type(AsyncPromptsPage[Prompt], agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_retrieve_execution(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.retrieve_execution() + assert_matches_type(AgentRetrieveExecutionResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_retrieve_execution_with_all_params(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.retrieve_execution( + agent_execution_id="6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35", + ) + assert_matches_type(AgentRetrieveExecutionResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_retrieve_execution(self, async_client: AsyncGitpod) -> None: + response = await async_client.agents.with_raw_response.retrieve_execution() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = await response.parse() + assert_matches_type(AgentRetrieveExecutionResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_retrieve_execution(self, async_client: AsyncGitpod) -> None: + async with async_client.agents.with_streaming_response.retrieve_execution() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = await response.parse() + assert_matches_type(AgentRetrieveExecutionResponse, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_retrieve_prompt(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.retrieve_prompt() + assert_matches_type(AgentRetrievePromptResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_retrieve_prompt_with_all_params(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.retrieve_prompt( + prompt_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) + assert_matches_type(AgentRetrievePromptResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_retrieve_prompt(self, async_client: AsyncGitpod) -> None: + response = await async_client.agents.with_raw_response.retrieve_prompt() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = await response.parse() + assert_matches_type(AgentRetrievePromptResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_retrieve_prompt(self, async_client: AsyncGitpod) -> None: + async with async_client.agents.with_streaming_response.retrieve_prompt() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = await response.parse() + assert_matches_type(AgentRetrievePromptResponse, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_send_to_execution(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.send_to_execution() + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_send_to_execution_with_all_params(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.send_to_execution( + agent_execution_id="6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35", + user_input={ + "text": {"content": "Generate a report based on the latest logs."}, + "id": "id", + "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), + }, + ) + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_send_to_execution(self, async_client: AsyncGitpod) -> None: + response = await async_client.agents.with_raw_response.send_to_execution() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = await response.parse() + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_send_to_execution(self, async_client: AsyncGitpod) -> None: + async with async_client.agents.with_streaming_response.send_to_execution() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = await response.parse() + assert_matches_type(object, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_start_execution(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.start_execution() + assert_matches_type(AgentStartExecutionResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_start_execution_with_all_params(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.start_execution( + agent_id="b8a64cfa-43e2-4b9d-9fb3-07edc63f5971", + code_context={ + "context_url": { + "environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "url": "https://example.com", + }, + "environment_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "project_id": "2d22e4eb-31da-467f-882c-27e21550992f", + "pull_request": { + "id": "id", + "author": "author", + "from_branch": "fromBranch", + "repository": { + "clone_url": "cloneUrl", + "host": "host", + "name": "name", + "owner": "owner", + }, + "title": "title", + "to_branch": "toBranch", + "url": "url", + }, + }, + mode="AGENT_MODE_UNSPECIFIED", + name="name", + workflow_action_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(AgentStartExecutionResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_start_execution(self, async_client: AsyncGitpod) -> None: + response = await async_client.agents.with_raw_response.start_execution() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = await response.parse() + assert_matches_type(AgentStartExecutionResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_start_execution(self, async_client: AsyncGitpod) -> None: + async with async_client.agents.with_streaming_response.start_execution() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = await response.parse() + assert_matches_type(AgentStartExecutionResponse, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_stop_execution(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.stop_execution() + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_stop_execution_with_all_params(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.stop_execution( + agent_execution_id="6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35", + ) + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_stop_execution(self, async_client: AsyncGitpod) -> None: + response = await async_client.agents.with_raw_response.stop_execution() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = await response.parse() + assert_matches_type(object, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_stop_execution(self, async_client: AsyncGitpod) -> None: + async with async_client.agents.with_streaming_response.stop_execution() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = await response.parse() + assert_matches_type(object, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_update_prompt(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.update_prompt() + assert_matches_type(AgentUpdatePromptResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_update_prompt_with_all_params(self, async_client: AsyncGitpod) -> None: + agent = await async_client.agents.update_prompt( + metadata={ + "description": "x", + "name": "name", + }, + prompt_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + spec={ + "command": "command", + "is_command": True, + "is_template": True, + "prompt": "prompt", + }, + ) + assert_matches_type(AgentUpdatePromptResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_update_prompt(self, async_client: AsyncGitpod) -> None: + response = await async_client.agents.with_raw_response.update_prompt() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = await response.parse() + assert_matches_type(AgentUpdatePromptResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_update_prompt(self, async_client: AsyncGitpod) -> None: + async with async_client.agents.with_streaming_response.update_prompt() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = await response.parse() + assert_matches_type(AgentUpdatePromptResponse, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_editors.py b/tests/api_resources/test_editors.py index 45b7012c..5a6ebcd0 100644 --- a/tests/api_resources/test_editors.py +++ b/tests/api_resources/test_editors.py @@ -108,6 +108,17 @@ def test_method_resolve_url(self, client: Gitpod) -> None: ) assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_resolve_url_with_all_params(self, client: Gitpod) -> None: + editor = client.editors.resolve_url( + editor_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + version="version", + ) + assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_resolve_url(self, client: Gitpod) -> None: @@ -230,6 +241,17 @@ async def test_method_resolve_url(self, async_client: AsyncGitpod) -> None: ) assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_resolve_url_with_all_params(self, async_client: AsyncGitpod) -> None: + editor = await async_client.editors.resolve_url( + editor_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + version="version", + ) + assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_resolve_url(self, async_client: AsyncGitpod) -> None: diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index d7876b0e..127cc4b8 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -41,6 +41,15 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "automations_file": { "automations_file_path": "automationsFilePath", "session": "session", + "trigger_filter": [ + { + "manual": True, + "post_devcontainer_start": True, + "post_environment_start": True, + "post_machine_start": True, + "prebuild": True, + } + ], }, "content": { "git_email": "gitEmail", @@ -66,6 +75,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "default_devcontainer_image": "defaultDevcontainerImage", "devcontainer_file_path": "devcontainerFilePath", "dotfiles": {"repository": "https://example.com"}, + "lifecycle_stage": "LIFECYCLE_STAGE_UNSPECIFIED", "session": "session", }, "machine": { @@ -76,12 +86,14 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: { "admission": "ADMISSION_LEVEL_UNSPECIFIED", "name": "x", - "port": 1, + "port": 1024, + "protocol": "PROTOCOL_UNSPECIFIED", } ], "secrets": [ { "id": "id", + "api_only": True, "container_registry_basic_auth_host": "containerRegistryBasicAuthHost", "environment_variable": "environmentVariable", "file_path": "filePath", @@ -100,6 +112,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: } ], "timeout": {"disconnected": "+9125115.360s"}, + "workflow_action_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", }, ) assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) @@ -204,7 +217,8 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: { "admission": "ADMISSION_LEVEL_UNSPECIFIED", "name": "x", - "port": 1, + "port": 1024, + "protocol": "PROTOCOL_UNSPECIFIED", } ], "ssh_public_keys": [ @@ -254,8 +268,10 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: page_size=0, filter={ "archival_status": "ARCHIVAL_STATUS_UNSPECIFIED", + "created_before": parse_datetime("2019-12-27T18:11:19.117Z"), "creator_ids": ["f53d2330-3795-4c5d-a1f3-453121af9c60"], "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "roles": ["ENVIRONMENT_ROLE_UNSPECIFIED"], "runner_ids": ["e6aa9c54-89d3-42c1-ac31-bd8d8f1concentrate"], "runner_kinds": ["RUNNER_KIND_UNSPECIFIED"], "status_phases": ["ENVIRONMENT_PHASE_UNSPECIFIED"], @@ -376,6 +392,15 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non "automations_file": { "automations_file_path": "automationsFilePath", "session": "session", + "trigger_filter": [ + { + "manual": True, + "post_devcontainer_start": True, + "post_environment_start": True, + "post_machine_start": True, + "prebuild": True, + } + ], }, "content": { "git_email": "gitEmail", @@ -401,6 +426,7 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non "default_devcontainer_image": "defaultDevcontainerImage", "devcontainer_file_path": "devcontainerFilePath", "dotfiles": {"repository": "https://example.com"}, + "lifecycle_stage": "LIFECYCLE_STAGE_UNSPECIFIED", "session": "session", }, "machine": { @@ -411,12 +437,14 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non { "admission": "ADMISSION_LEVEL_UNSPECIFIED", "name": "x", - "port": 1, + "port": 1024, + "protocol": "PROTOCOL_UNSPECIFIED", } ], "secrets": [ { "id": "id", + "api_only": True, "container_registry_basic_auth_host": "containerRegistryBasicAuthHost", "environment_variable": "environmentVariable", "file_path": "filePath", @@ -435,6 +463,7 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non } ], "timeout": {"disconnected": "14400s"}, + "workflow_action_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", }, ) assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) @@ -666,6 +695,15 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "automations_file": { "automations_file_path": "automationsFilePath", "session": "session", + "trigger_filter": [ + { + "manual": True, + "post_devcontainer_start": True, + "post_environment_start": True, + "post_machine_start": True, + "prebuild": True, + } + ], }, "content": { "git_email": "gitEmail", @@ -691,6 +729,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "default_devcontainer_image": "defaultDevcontainerImage", "devcontainer_file_path": "devcontainerFilePath", "dotfiles": {"repository": "https://example.com"}, + "lifecycle_stage": "LIFECYCLE_STAGE_UNSPECIFIED", "session": "session", }, "machine": { @@ -701,12 +740,14 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> { "admission": "ADMISSION_LEVEL_UNSPECIFIED", "name": "x", - "port": 1, + "port": 1024, + "protocol": "PROTOCOL_UNSPECIFIED", } ], "secrets": [ { "id": "id", + "api_only": True, "container_registry_basic_auth_host": "containerRegistryBasicAuthHost", "environment_variable": "environmentVariable", "file_path": "filePath", @@ -725,6 +766,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> } ], "timeout": {"disconnected": "+9125115.360s"}, + "workflow_action_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", }, ) assert_matches_type(EnvironmentCreateResponse, environment, path=["response"]) @@ -829,7 +871,8 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> { "admission": "ADMISSION_LEVEL_UNSPECIFIED", "name": "x", - "port": 1, + "port": 1024, + "protocol": "PROTOCOL_UNSPECIFIED", } ], "ssh_public_keys": [ @@ -879,8 +922,10 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N page_size=0, filter={ "archival_status": "ARCHIVAL_STATUS_UNSPECIFIED", + "created_before": parse_datetime("2019-12-27T18:11:19.117Z"), "creator_ids": ["f53d2330-3795-4c5d-a1f3-453121af9c60"], "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "roles": ["ENVIRONMENT_ROLE_UNSPECIFIED"], "runner_ids": ["e6aa9c54-89d3-42c1-ac31-bd8d8f1concentrate"], "runner_kinds": ["RUNNER_KIND_UNSPECIFIED"], "status_phases": ["ENVIRONMENT_PHASE_UNSPECIFIED"], @@ -1001,6 +1046,15 @@ async def test_method_create_from_project_with_all_params(self, async_client: As "automations_file": { "automations_file_path": "automationsFilePath", "session": "session", + "trigger_filter": [ + { + "manual": True, + "post_devcontainer_start": True, + "post_environment_start": True, + "post_machine_start": True, + "prebuild": True, + } + ], }, "content": { "git_email": "gitEmail", @@ -1026,6 +1080,7 @@ async def test_method_create_from_project_with_all_params(self, async_client: As "default_devcontainer_image": "defaultDevcontainerImage", "devcontainer_file_path": "devcontainerFilePath", "dotfiles": {"repository": "https://example.com"}, + "lifecycle_stage": "LIFECYCLE_STAGE_UNSPECIFIED", "session": "session", }, "machine": { @@ -1036,12 +1091,14 @@ async def test_method_create_from_project_with_all_params(self, async_client: As { "admission": "ADMISSION_LEVEL_UNSPECIFIED", "name": "x", - "port": 1, + "port": 1024, + "protocol": "PROTOCOL_UNSPECIFIED", } ], "secrets": [ { "id": "id", + "api_only": True, "container_registry_basic_auth_host": "containerRegistryBasicAuthHost", "environment_variable": "environmentVariable", "file_path": "filePath", @@ -1060,6 +1117,7 @@ async def test_method_create_from_project_with_all_params(self, async_client: As } ], "timeout": {"disconnected": "14400s"}, + "workflow_action_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", }, ) assert_matches_type(EnvironmentCreateFromProjectResponse, environment, path=["response"]) diff --git a/tests/api_resources/test_errors.py b/tests/api_resources/test_errors.py new file mode 100644 index 00000000..4cc33cae --- /dev/null +++ b/tests/api_resources/test_errors.py @@ -0,0 +1,224 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod._utils import parse_datetime + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestErrors: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_report_errors(self, client: Gitpod) -> None: + error = client.errors.report_errors() + assert_matches_type(object, error, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_report_errors_with_all_params(self, client: Gitpod) -> None: + error = client.errors.report_errors( + events=[ + { + "breadcrumbs": [ + { + "category": "category", + "data": {"foo": "string"}, + "level": "ERROR_LEVEL_UNSPECIFIED", + "message": "message", + "timestamp": parse_datetime("2019-12-27T18:11:19.117Z"), + "type": "type", + } + ], + "environment": "environment", + "event_id": "210b9798eb53baa4e69d31c1071cf03d", + "exceptions": [ + { + "mechanism": { + "data": {"foo": "string"}, + "description": "description", + "handled": True, + "synthetic": True, + "type": "x", + }, + "module": "module", + "stacktrace": [ + { + "colno": 0, + "context_line": "contextLine", + "filename": "filename", + "function": "function", + "in_app": True, + "lineno": 0, + "module": "module", + "post_context": ["string"], + "pre_context": ["string"], + "vars": {"foo": "string"}, + } + ], + "thread_id": "threadId", + "type": "x", + "value": "value", + } + ], + "extra": {"foo": "string"}, + "fingerprint": ["x"], + "identity_id": "ecc2efdd-ddfa-31a9-c6f1-b833d337aa7c", + "level": "ERROR_LEVEL_UNSPECIFIED", + "logger": "logger", + "modules": {"foo": "string"}, + "platform": "x", + "release": "release", + "request": { + "data": "data", + "headers": {"foo": "string"}, + "method": "method", + "query_string": {"foo": "string"}, + "url": "url", + }, + "sdk": {"foo": "string"}, + "server_name": "serverName", + "tags": {"foo": "string"}, + "timestamp": parse_datetime("2019-12-27T18:11:19.117Z"), + "transaction": "transaction", + } + ], + ) + assert_matches_type(object, error, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_report_errors(self, client: Gitpod) -> None: + response = client.errors.with_raw_response.report_errors() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + error = response.parse() + assert_matches_type(object, error, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_report_errors(self, client: Gitpod) -> None: + with client.errors.with_streaming_response.report_errors() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + error = response.parse() + assert_matches_type(object, error, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncErrors: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_report_errors(self, async_client: AsyncGitpod) -> None: + error = await async_client.errors.report_errors() + assert_matches_type(object, error, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_report_errors_with_all_params(self, async_client: AsyncGitpod) -> None: + error = await async_client.errors.report_errors( + events=[ + { + "breadcrumbs": [ + { + "category": "category", + "data": {"foo": "string"}, + "level": "ERROR_LEVEL_UNSPECIFIED", + "message": "message", + "timestamp": parse_datetime("2019-12-27T18:11:19.117Z"), + "type": "type", + } + ], + "environment": "environment", + "event_id": "210b9798eb53baa4e69d31c1071cf03d", + "exceptions": [ + { + "mechanism": { + "data": {"foo": "string"}, + "description": "description", + "handled": True, + "synthetic": True, + "type": "x", + }, + "module": "module", + "stacktrace": [ + { + "colno": 0, + "context_line": "contextLine", + "filename": "filename", + "function": "function", + "in_app": True, + "lineno": 0, + "module": "module", + "post_context": ["string"], + "pre_context": ["string"], + "vars": {"foo": "string"}, + } + ], + "thread_id": "threadId", + "type": "x", + "value": "value", + } + ], + "extra": {"foo": "string"}, + "fingerprint": ["x"], + "identity_id": "ecc2efdd-ddfa-31a9-c6f1-b833d337aa7c", + "level": "ERROR_LEVEL_UNSPECIFIED", + "logger": "logger", + "modules": {"foo": "string"}, + "platform": "x", + "release": "release", + "request": { + "data": "data", + "headers": {"foo": "string"}, + "method": "method", + "query_string": {"foo": "string"}, + "url": "url", + }, + "sdk": {"foo": "string"}, + "server_name": "serverName", + "tags": {"foo": "string"}, + "timestamp": parse_datetime("2019-12-27T18:11:19.117Z"), + "transaction": "transaction", + } + ], + ) + assert_matches_type(object, error, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_report_errors(self, async_client: AsyncGitpod) -> None: + response = await async_client.errors.with_raw_response.report_errors() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + error = await response.parse() + assert_matches_type(object, error, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_report_errors(self, async_client: AsyncGitpod) -> None: + async with async_client.errors.with_streaming_response.report_errors() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + error = await response.parse() + assert_matches_type(object, error, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_groups.py b/tests/api_resources/test_groups.py index dd784b4e..4a8a1bb4 100644 --- a/tests/api_resources/test_groups.py +++ b/tests/api_resources/test_groups.py @@ -9,7 +9,12 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type -from gitpod.types import Group +from gitpod.types import ( + Group, + GroupCreateResponse, + GroupUpdateResponse, + GroupRetrieveResponse, +) from gitpod.pagination import SyncGroupsPage, AsyncGroupsPage base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -18,6 +23,118 @@ class TestGroups: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create(self, client: Gitpod) -> None: + group = client.groups.create() + assert_matches_type(GroupCreateResponse, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create_with_all_params(self, client: Gitpod) -> None: + group = client.groups.create( + description="Backend engineering team", + name="Backend Team", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type(GroupCreateResponse, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_create(self, client: Gitpod) -> None: + response = client.groups.with_raw_response.create() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + group = response.parse() + assert_matches_type(GroupCreateResponse, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_create(self, client: Gitpod) -> None: + with client.groups.with_streaming_response.create() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + group = response.parse() + assert_matches_type(GroupCreateResponse, group, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_retrieve(self, client: Gitpod) -> None: + group = client.groups.retrieve() + assert_matches_type(GroupRetrieveResponse, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: + group = client.groups.retrieve( + group_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) + assert_matches_type(GroupRetrieveResponse, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_retrieve(self, client: Gitpod) -> None: + response = client.groups.with_raw_response.retrieve() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + group = response.parse() + assert_matches_type(GroupRetrieveResponse, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_retrieve(self, client: Gitpod) -> None: + with client.groups.with_streaming_response.retrieve() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + group = response.parse() + assert_matches_type(GroupRetrieveResponse, group, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_update(self, client: Gitpod) -> None: + group = client.groups.update() + assert_matches_type(GroupUpdateResponse, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_update_with_all_params(self, client: Gitpod) -> None: + group = client.groups.update( + description="Platform engineering team", + group_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + name="Platform Team", + ) + assert_matches_type(GroupUpdateResponse, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_update(self, client: Gitpod) -> None: + response = client.groups.with_raw_response.update() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + group = response.parse() + assert_matches_type(GroupUpdateResponse, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_update(self, client: Gitpod) -> None: + with client.groups.with_streaming_response.update() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + group = response.parse() + assert_matches_type(GroupUpdateResponse, group, path=["response"]) + + assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Gitpod) -> None: @@ -59,12 +176,160 @@ def test_streaming_response_list(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_delete(self, client: Gitpod) -> None: + group = client.groups.delete() + assert_matches_type(object, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_delete_with_all_params(self, client: Gitpod) -> None: + group = client.groups.delete( + group_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) + assert_matches_type(object, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_delete(self, client: Gitpod) -> None: + response = client.groups.with_raw_response.delete() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + group = response.parse() + assert_matches_type(object, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_delete(self, client: Gitpod) -> None: + with client.groups.with_streaming_response.delete() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + group = response.parse() + assert_matches_type(object, group, path=["response"]) + + assert cast(Any, response.is_closed) is True + class TestAsyncGroups: parametrize = pytest.mark.parametrize( "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create(self, async_client: AsyncGitpod) -> None: + group = await async_client.groups.create() + assert_matches_type(GroupCreateResponse, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: + group = await async_client.groups.create( + description="Backend engineering team", + name="Backend Team", + organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + ) + assert_matches_type(GroupCreateResponse, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: + response = await async_client.groups.with_raw_response.create() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + group = await response.parse() + assert_matches_type(GroupCreateResponse, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: + async with async_client.groups.with_streaming_response.create() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + group = await response.parse() + assert_matches_type(GroupCreateResponse, group, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: + group = await async_client.groups.retrieve() + assert_matches_type(GroupRetrieveResponse, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: + group = await async_client.groups.retrieve( + group_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) + assert_matches_type(GroupRetrieveResponse, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: + response = await async_client.groups.with_raw_response.retrieve() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + group = await response.parse() + assert_matches_type(GroupRetrieveResponse, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: + async with async_client.groups.with_streaming_response.retrieve() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + group = await response.parse() + assert_matches_type(GroupRetrieveResponse, group, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_update(self, async_client: AsyncGitpod) -> None: + group = await async_client.groups.update() + assert_matches_type(GroupUpdateResponse, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: + group = await async_client.groups.update( + description="Platform engineering team", + group_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + name="Platform Team", + ) + assert_matches_type(GroupUpdateResponse, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_update(self, async_client: AsyncGitpod) -> None: + response = await async_client.groups.with_raw_response.update() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + group = await response.parse() + assert_matches_type(GroupUpdateResponse, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_update(self, async_client: AsyncGitpod) -> None: + async with async_client.groups.with_streaming_response.update() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + group = await response.parse() + assert_matches_type(GroupUpdateResponse, group, path=["response"]) + + assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGitpod) -> None: @@ -105,3 +370,39 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: assert_matches_type(AsyncGroupsPage[Group], group, path=["response"]) assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_delete(self, async_client: AsyncGitpod) -> None: + group = await async_client.groups.delete() + assert_matches_type(object, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: + group = await async_client.groups.delete( + group_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) + assert_matches_type(object, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: + response = await async_client.groups.with_raw_response.delete() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + group = await response.parse() + assert_matches_type(object, group, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: + async with async_client.groups.with_streaming_response.delete() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + group = await response.parse() + assert_matches_type(object, group, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_organizations.py b/tests/api_resources/test_organizations.py index ff2df938..8cda4e70 100644 --- a/tests/api_resources/test_organizations.py +++ b/tests/api_resources/test_organizations.py @@ -266,6 +266,7 @@ def test_method_list_members_with_all_params(self, client: Gitpod) -> None: organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", token="token", page_size=0, + filter={"search": "search"}, pagination={ "token": "token", "page_size": 20, @@ -594,6 +595,7 @@ async def test_method_list_members_with_all_params(self, async_client: AsyncGitp organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", token="token", page_size=0, + filter={"search": "search"}, pagination={ "token": "token", "page_size": 20, diff --git a/tests/api_resources/test_prebuilds.py b/tests/api_resources/test_prebuilds.py new file mode 100644 index 00000000..258dcef1 --- /dev/null +++ b/tests/api_resources/test_prebuilds.py @@ -0,0 +1,495 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gitpod import Gitpod, AsyncGitpod +from tests.utils import assert_matches_type +from gitpod.types import ( + Prebuild, + PrebuildCancelResponse, + PrebuildCreateResponse, + PrebuildRetrieveResponse, + PrebuildCreateLogsTokenResponse, +) +from gitpod.pagination import SyncPrebuildsPage, AsyncPrebuildsPage + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestPrebuilds: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create(self, client: Gitpod) -> None: + prebuild = client.prebuilds.create( + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + spec={}, + ) + assert_matches_type(PrebuildCreateResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create_with_all_params(self, client: Gitpod) -> None: + prebuild = client.prebuilds.create( + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + spec={ + "desired_phase": "PREBUILD_PHASE_UNSPECIFIED", + "spec_version": "specVersion", + "timeout": "3600s", + }, + environment_class_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(PrebuildCreateResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_create(self, client: Gitpod) -> None: + response = client.prebuilds.with_raw_response.create( + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + spec={}, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + prebuild = response.parse() + assert_matches_type(PrebuildCreateResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_create(self, client: Gitpod) -> None: + with client.prebuilds.with_streaming_response.create( + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + spec={}, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + prebuild = response.parse() + assert_matches_type(PrebuildCreateResponse, prebuild, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_retrieve(self, client: Gitpod) -> None: + prebuild = client.prebuilds.retrieve( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) + assert_matches_type(PrebuildRetrieveResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_retrieve(self, client: Gitpod) -> None: + response = client.prebuilds.with_raw_response.retrieve( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + prebuild = response.parse() + assert_matches_type(PrebuildRetrieveResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_retrieve(self, client: Gitpod) -> None: + with client.prebuilds.with_streaming_response.retrieve( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + prebuild = response.parse() + assert_matches_type(PrebuildRetrieveResponse, prebuild, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_list(self, client: Gitpod) -> None: + prebuild = client.prebuilds.list() + assert_matches_type(SyncPrebuildsPage[Prebuild], prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_list_with_all_params(self, client: Gitpod) -> None: + prebuild = client.prebuilds.list( + token="token", + page_size=0, + filter={ + "phases": ["PREBUILD_PHASE_UNSPECIFIED"], + "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + }, + pagination={ + "token": "token", + "page_size": 100, + }, + ) + assert_matches_type(SyncPrebuildsPage[Prebuild], prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_list(self, client: Gitpod) -> None: + response = client.prebuilds.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + prebuild = response.parse() + assert_matches_type(SyncPrebuildsPage[Prebuild], prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_list(self, client: Gitpod) -> None: + with client.prebuilds.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + prebuild = response.parse() + assert_matches_type(SyncPrebuildsPage[Prebuild], prebuild, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_delete(self, client: Gitpod) -> None: + prebuild = client.prebuilds.delete( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) + assert_matches_type(object, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_delete(self, client: Gitpod) -> None: + response = client.prebuilds.with_raw_response.delete( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + prebuild = response.parse() + assert_matches_type(object, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_delete(self, client: Gitpod) -> None: + with client.prebuilds.with_streaming_response.delete( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + prebuild = response.parse() + assert_matches_type(object, prebuild, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_cancel(self, client: Gitpod) -> None: + prebuild = client.prebuilds.cancel( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) + assert_matches_type(PrebuildCancelResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_cancel(self, client: Gitpod) -> None: + response = client.prebuilds.with_raw_response.cancel( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + prebuild = response.parse() + assert_matches_type(PrebuildCancelResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_cancel(self, client: Gitpod) -> None: + with client.prebuilds.with_streaming_response.cancel( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + prebuild = response.parse() + assert_matches_type(PrebuildCancelResponse, prebuild, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create_logs_token(self, client: Gitpod) -> None: + prebuild = client.prebuilds.create_logs_token( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) + assert_matches_type(PrebuildCreateLogsTokenResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_create_logs_token(self, client: Gitpod) -> None: + response = client.prebuilds.with_raw_response.create_logs_token( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + prebuild = response.parse() + assert_matches_type(PrebuildCreateLogsTokenResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_create_logs_token(self, client: Gitpod) -> None: + with client.prebuilds.with_streaming_response.create_logs_token( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + prebuild = response.parse() + assert_matches_type(PrebuildCreateLogsTokenResponse, prebuild, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncPrebuilds: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create(self, async_client: AsyncGitpod) -> None: + prebuild = await async_client.prebuilds.create( + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + spec={}, + ) + assert_matches_type(PrebuildCreateResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: + prebuild = await async_client.prebuilds.create( + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + spec={ + "desired_phase": "PREBUILD_PHASE_UNSPECIFIED", + "spec_version": "specVersion", + "timeout": "3600s", + }, + environment_class_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(PrebuildCreateResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: + response = await async_client.prebuilds.with_raw_response.create( + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + spec={}, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + prebuild = await response.parse() + assert_matches_type(PrebuildCreateResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: + async with async_client.prebuilds.with_streaming_response.create( + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", + spec={}, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + prebuild = await response.parse() + assert_matches_type(PrebuildCreateResponse, prebuild, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: + prebuild = await async_client.prebuilds.retrieve( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) + assert_matches_type(PrebuildRetrieveResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: + response = await async_client.prebuilds.with_raw_response.retrieve( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + prebuild = await response.parse() + assert_matches_type(PrebuildRetrieveResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: + async with async_client.prebuilds.with_streaming_response.retrieve( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + prebuild = await response.parse() + assert_matches_type(PrebuildRetrieveResponse, prebuild, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_list(self, async_client: AsyncGitpod) -> None: + prebuild = await async_client.prebuilds.list() + assert_matches_type(AsyncPrebuildsPage[Prebuild], prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: + prebuild = await async_client.prebuilds.list( + token="token", + page_size=0, + filter={ + "phases": ["PREBUILD_PHASE_UNSPECIFIED"], + "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + }, + pagination={ + "token": "token", + "page_size": 100, + }, + ) + assert_matches_type(AsyncPrebuildsPage[Prebuild], prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: + response = await async_client.prebuilds.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + prebuild = await response.parse() + assert_matches_type(AsyncPrebuildsPage[Prebuild], prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: + async with async_client.prebuilds.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + prebuild = await response.parse() + assert_matches_type(AsyncPrebuildsPage[Prebuild], prebuild, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_delete(self, async_client: AsyncGitpod) -> None: + prebuild = await async_client.prebuilds.delete( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) + assert_matches_type(object, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: + response = await async_client.prebuilds.with_raw_response.delete( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + prebuild = await response.parse() + assert_matches_type(object, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: + async with async_client.prebuilds.with_streaming_response.delete( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + prebuild = await response.parse() + assert_matches_type(object, prebuild, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_cancel(self, async_client: AsyncGitpod) -> None: + prebuild = await async_client.prebuilds.cancel( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) + assert_matches_type(PrebuildCancelResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_cancel(self, async_client: AsyncGitpod) -> None: + response = await async_client.prebuilds.with_raw_response.cancel( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + prebuild = await response.parse() + assert_matches_type(PrebuildCancelResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_cancel(self, async_client: AsyncGitpod) -> None: + async with async_client.prebuilds.with_streaming_response.cancel( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + prebuild = await response.parse() + assert_matches_type(PrebuildCancelResponse, prebuild, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create_logs_token(self, async_client: AsyncGitpod) -> None: + prebuild = await async_client.prebuilds.create_logs_token( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) + assert_matches_type(PrebuildCreateLogsTokenResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_create_logs_token(self, async_client: AsyncGitpod) -> None: + response = await async_client.prebuilds.with_raw_response.create_logs_token( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + prebuild = await response.parse() + assert_matches_type(PrebuildCreateLogsTokenResponse, prebuild, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_create_logs_token(self, async_client: AsyncGitpod) -> None: + async with async_client.prebuilds.with_streaming_response.create_logs_token( + prebuild_id="07e03a28-65a5-4d98-b532-8ea67b188048", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + prebuild = await response.parse() + assert_matches_type(PrebuildCreateLogsTokenResponse, prebuild, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_projects.py b/tests/api_resources/test_projects.py index 217a8453..0408e8a1 100644 --- a/tests/api_resources/test_projects.py +++ b/tests/api_resources/test_projects.py @@ -28,7 +28,6 @@ class TestProjects: @parametrize def test_method_create(self, client: Gitpod) -> None: project = client.projects.create( - environment_class={}, initializer={}, ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) @@ -37,10 +36,6 @@ def test_method_create(self, client: Gitpod) -> None: @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: project = client.projects.create( - environment_class={ - "environment_class_id": "d2c94c27-3b76-4a42-b88c-95a85e392c68", - "local_runner": True, - }, initializer={ "specs": [ { @@ -58,6 +53,17 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: automations_file_path="automationsFilePath", devcontainer_file_path="devcontainerFilePath", name="Web Application", + prebuild_configuration={ + "enabled": True, + "enable_jetbrains_warmup": True, + "environment_class_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "executor": { + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "principal": "PRINCIPAL_UNSPECIFIED", + }, + "timeout": "+9125115.360s", + "trigger": {"daily_schedule": {"hour_utc": 23}}, + }, technical_description="technicalDescription", ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) @@ -66,7 +72,6 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: @parametrize def test_raw_response_create(self, client: Gitpod) -> None: response = client.projects.with_raw_response.create( - environment_class={}, initializer={}, ) @@ -79,7 +84,6 @@ def test_raw_response_create(self, client: Gitpod) -> None: @parametrize def test_streaming_response_create(self, client: Gitpod) -> None: with client.projects.with_streaming_response.create( - environment_class={}, initializer={}, ) as response: assert not response.is_closed @@ -138,10 +142,6 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: project = client.projects.update( automations_file_path="automationsFilePath", devcontainer_file_path="devcontainerFilePath", - environment_class={ - "environment_class_id": "d2c94c27-3b76-4a42-b88c-95a85e392c68", - "local_runner": True, - }, initializer={ "specs": [ { @@ -157,6 +157,17 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ] }, name="x", + prebuild_configuration={ + "enabled": True, + "enable_jetbrains_warmup": True, + "environment_class_ids": ["b0e12f6c-4c67-429d-a4a6-d9838b5da041"], + "executor": { + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "principal": "PRINCIPAL_UNSPECIFIED", + }, + "timeout": "3600s", + "trigger": {"daily_schedule": {"hour_utc": 2}}, + }, project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", technical_description="technicalDescription", ) @@ -196,7 +207,11 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: project = client.projects.list( token="token", page_size=0, - filter={"project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}, + filter={ + "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "runner_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "search": "search", + }, pagination={ "token": "token", "page_size": 20, @@ -309,7 +324,6 @@ class TestAsyncProjects: @parametrize async def test_method_create(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.create( - environment_class={}, initializer={}, ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) @@ -318,10 +332,6 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.create( - environment_class={ - "environment_class_id": "d2c94c27-3b76-4a42-b88c-95a85e392c68", - "local_runner": True, - }, initializer={ "specs": [ { @@ -339,6 +349,17 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> automations_file_path="automationsFilePath", devcontainer_file_path="devcontainerFilePath", name="Web Application", + prebuild_configuration={ + "enabled": True, + "enable_jetbrains_warmup": True, + "environment_class_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "executor": { + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "principal": "PRINCIPAL_UNSPECIFIED", + }, + "timeout": "+9125115.360s", + "trigger": {"daily_schedule": {"hour_utc": 23}}, + }, technical_description="technicalDescription", ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) @@ -347,7 +368,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> @parametrize async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: response = await async_client.projects.with_raw_response.create( - environment_class={}, initializer={}, ) @@ -360,7 +380,6 @@ async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: async with async_client.projects.with_streaming_response.create( - environment_class={}, initializer={}, ) as response: assert not response.is_closed @@ -419,10 +438,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> project = await async_client.projects.update( automations_file_path="automationsFilePath", devcontainer_file_path="devcontainerFilePath", - environment_class={ - "environment_class_id": "d2c94c27-3b76-4a42-b88c-95a85e392c68", - "local_runner": True, - }, initializer={ "specs": [ { @@ -438,6 +453,17 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ] }, name="x", + prebuild_configuration={ + "enabled": True, + "enable_jetbrains_warmup": True, + "environment_class_ids": ["b0e12f6c-4c67-429d-a4a6-d9838b5da041"], + "executor": { + "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "principal": "PRINCIPAL_UNSPECIFIED", + }, + "timeout": "3600s", + "trigger": {"daily_schedule": {"hour_utc": 2}}, + }, project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", technical_description="technicalDescription", ) @@ -477,7 +503,11 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N project = await async_client.projects.list( token="token", page_size=0, - filter={"project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}, + filter={ + "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "runner_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "search": "search", + }, pagination={ "token": "token", "page_size": 20, diff --git a/tests/api_resources/test_runners.py b/tests/api_resources/test_runners.py index 56e374ae..9ce4674b 100644 --- a/tests/api_resources/test_runners.py +++ b/tests/api_resources/test_runners.py @@ -13,8 +13,10 @@ Runner, RunnerCreateResponse, RunnerRetrieveResponse, + RunnerCreateLogsTokenResponse, RunnerParseContextURLResponse, RunnerCreateRunnerTokenResponse, + RunnerSearchRepositoriesResponse, RunnerCheckAuthenticationForHostResponse, ) from gitpod.pagination import SyncRunnersPage, AsyncRunnersPage @@ -54,6 +56,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "release_channel": "RUNNER_RELEASE_CHANNEL_STABLE", }, "desired_phase": "RUNNER_PHASE_ACTIVE", + "variant": "RUNNER_VARIANT_UNSPECIFIED", }, ) assert_matches_type(RunnerCreateResponse, runner, path=["response"]) @@ -288,6 +291,42 @@ def test_streaming_response_check_authentication_for_host(self, client: Gitpod) assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create_logs_token(self, client: Gitpod) -> None: + runner = client.runners.create_logs_token() + assert_matches_type(RunnerCreateLogsTokenResponse, runner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create_logs_token_with_all_params(self, client: Gitpod) -> None: + runner = client.runners.create_logs_token( + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) + assert_matches_type(RunnerCreateLogsTokenResponse, runner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_create_logs_token(self, client: Gitpod) -> None: + response = client.runners.with_raw_response.create_logs_token() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner = response.parse() + assert_matches_type(RunnerCreateLogsTokenResponse, runner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_create_logs_token(self, client: Gitpod) -> None: + with client.runners.with_streaming_response.create_logs_token() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner = response.parse() + assert_matches_type(RunnerCreateLogsTokenResponse, runner, path=["response"]) + + assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_runner_token(self, client: Gitpod) -> None: @@ -361,6 +400,50 @@ def test_streaming_response_parse_context_url(self, client: Gitpod) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_search_repositories(self, client: Gitpod) -> None: + runner = client.runners.search_repositories() + assert_matches_type(RunnerSearchRepositoriesResponse, runner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_search_repositories_with_all_params(self, client: Gitpod) -> None: + runner = client.runners.search_repositories( + limit=1, + pagination={ + "token": "token", + "page_size": 100, + }, + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + scm_host="scmHost", + search_mode="SEARCH_MODE_UNSPECIFIED", + search_string="searchString", + ) + assert_matches_type(RunnerSearchRepositoriesResponse, runner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_search_repositories(self, client: Gitpod) -> None: + response = client.runners.with_raw_response.search_repositories() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner = response.parse() + assert_matches_type(RunnerSearchRepositoriesResponse, runner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_search_repositories(self, client: Gitpod) -> None: + with client.runners.with_streaming_response.search_repositories() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner = response.parse() + assert_matches_type(RunnerSearchRepositoriesResponse, runner, path=["response"]) + + assert cast(Any, response.is_closed) is True + class TestAsyncRunners: parametrize = pytest.mark.parametrize( @@ -396,6 +479,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "release_channel": "RUNNER_RELEASE_CHANNEL_STABLE", }, "desired_phase": "RUNNER_PHASE_ACTIVE", + "variant": "RUNNER_VARIANT_UNSPECIFIED", }, ) assert_matches_type(RunnerCreateResponse, runner, path=["response"]) @@ -630,6 +714,42 @@ async def test_streaming_response_check_authentication_for_host(self, async_clie assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create_logs_token(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.create_logs_token() + assert_matches_type(RunnerCreateLogsTokenResponse, runner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create_logs_token_with_all_params(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.create_logs_token( + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + ) + assert_matches_type(RunnerCreateLogsTokenResponse, runner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_create_logs_token(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.with_raw_response.create_logs_token() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner = await response.parse() + assert_matches_type(RunnerCreateLogsTokenResponse, runner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_create_logs_token(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.with_streaming_response.create_logs_token() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner = await response.parse() + assert_matches_type(RunnerCreateLogsTokenResponse, runner, path=["response"]) + + assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_runner_token(self, async_client: AsyncGitpod) -> None: @@ -702,3 +822,47 @@ async def test_streaming_response_parse_context_url(self, async_client: AsyncGit assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_search_repositories(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.search_repositories() + assert_matches_type(RunnerSearchRepositoriesResponse, runner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_search_repositories_with_all_params(self, async_client: AsyncGitpod) -> None: + runner = await async_client.runners.search_repositories( + limit=1, + pagination={ + "token": "token", + "page_size": 100, + }, + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + scm_host="scmHost", + search_mode="SEARCH_MODE_UNSPECIFIED", + search_string="searchString", + ) + assert_matches_type(RunnerSearchRepositoriesResponse, runner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_search_repositories(self, async_client: AsyncGitpod) -> None: + response = await async_client.runners.with_raw_response.search_repositories() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + runner = await response.parse() + assert_matches_type(RunnerSearchRepositoriesResponse, runner, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_search_repositories(self, async_client: AsyncGitpod) -> None: + async with async_client.runners.with_streaming_response.search_repositories() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + runner = await response.parse() + assert_matches_type(RunnerSearchRepositoriesResponse, runner, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_secrets.py b/tests/api_resources/test_secrets.py index ddaaae29..6a54d360 100644 --- a/tests/api_resources/test_secrets.py +++ b/tests/api_resources/test_secrets.py @@ -32,12 +32,14 @@ def test_method_create(self, client: Gitpod) -> None: @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: secret = client.secrets.create( + api_only=True, container_registry_basic_auth_host="containerRegistryBasicAuthHost", environment_variable=True, file_path="filePath", name="DATABASE_URL", project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", scope={ + "organization_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "project_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "user_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", }, @@ -82,6 +84,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: filter={ "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "scope": { + "organization_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "project_id": "b0e12f6c-4c67-429d-a4a6-d9838b5da047", "user_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", }, @@ -240,12 +243,14 @@ 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( + api_only=True, container_registry_basic_auth_host="containerRegistryBasicAuthHost", environment_variable=True, file_path="filePath", name="DATABASE_URL", project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", scope={ + "organization_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "project_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "user_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", }, @@ -290,6 +295,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N filter={ "project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "scope": { + "organization_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "project_id": "b0e12f6c-4c67-429d-a4a6-d9838b5da047", "user_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", }, diff --git a/tests/api_resources/test_users.py b/tests/api_resources/test_users.py index cfe22b3d..576deff0 100644 --- a/tests/api_resources/test_users.py +++ b/tests/api_resources/test_users.py @@ -9,7 +9,10 @@ from gitpod import Gitpod, AsyncGitpod from tests.utils import assert_matches_type -from gitpod.types import UserGetAuthenticatedUserResponse +from gitpod.types import ( + UserGetUserResponse, + UserGetAuthenticatedUserResponse, +) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -17,6 +20,42 @@ class TestUsers: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_delete_user(self, client: Gitpod) -> None: + user = client.users.delete_user() + assert_matches_type(object, user, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_delete_user_with_all_params(self, client: Gitpod) -> None: + user = client.users.delete_user( + user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(object, user, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_delete_user(self, client: Gitpod) -> None: + response = client.users.with_raw_response.delete_user() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + user = response.parse() + assert_matches_type(object, user, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_delete_user(self, client: Gitpod) -> None: + with client.users.with_streaming_response.delete_user() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + user = response.parse() + assert_matches_type(object, user, path=["response"]) + + assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_get_authenticated_user(self, client: Gitpod) -> None: @@ -53,6 +92,42 @@ def test_streaming_response_get_authenticated_user(self, client: Gitpod) -> None assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_get_user(self, client: Gitpod) -> None: + user = client.users.get_user() + assert_matches_type(UserGetUserResponse, user, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_get_user_with_all_params(self, client: Gitpod) -> None: + user = client.users.get_user( + user_id="f53d2330-3795-4c5d-a1f3-453121af9c60", + ) + assert_matches_type(UserGetUserResponse, user, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_get_user(self, client: Gitpod) -> None: + response = client.users.with_raw_response.get_user() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + user = response.parse() + assert_matches_type(UserGetUserResponse, user, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_get_user(self, client: Gitpod) -> None: + with client.users.with_streaming_response.get_user() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + user = response.parse() + assert_matches_type(UserGetUserResponse, user, path=["response"]) + + assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_set_suspended(self, client: Gitpod) -> None: @@ -96,6 +171,42 @@ class TestAsyncUsers: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_delete_user(self, async_client: AsyncGitpod) -> None: + user = await async_client.users.delete_user() + assert_matches_type(object, user, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_delete_user_with_all_params(self, async_client: AsyncGitpod) -> None: + user = await async_client.users.delete_user( + user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(object, user, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_delete_user(self, async_client: AsyncGitpod) -> None: + response = await async_client.users.with_raw_response.delete_user() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + user = await response.parse() + assert_matches_type(object, user, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_delete_user(self, async_client: AsyncGitpod) -> None: + async with async_client.users.with_streaming_response.delete_user() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + user = await response.parse() + assert_matches_type(object, user, path=["response"]) + + assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_get_authenticated_user(self, async_client: AsyncGitpod) -> None: @@ -132,6 +243,42 @@ async def test_streaming_response_get_authenticated_user(self, async_client: Asy assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_get_user(self, async_client: AsyncGitpod) -> None: + user = await async_client.users.get_user() + assert_matches_type(UserGetUserResponse, user, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_get_user_with_all_params(self, async_client: AsyncGitpod) -> None: + user = await async_client.users.get_user( + user_id="f53d2330-3795-4c5d-a1f3-453121af9c60", + ) + assert_matches_type(UserGetUserResponse, user, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_get_user(self, async_client: AsyncGitpod) -> None: + response = await async_client.users.with_raw_response.get_user() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + user = await response.parse() + assert_matches_type(UserGetUserResponse, user, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_get_user(self, async_client: AsyncGitpod) -> None: + async with async_client.users.with_streaming_response.get_user() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + user = await response.parse() + assert_matches_type(UserGetUserResponse, user, path=["response"]) + + assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_set_suspended(self, async_client: AsyncGitpod) -> None: