diff --git a/.release-please-manifest.json b/.release-please-manifest.json index ba6c348..f14b480 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.1" + ".": "0.1.0-alpha.2" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 1b7c986..87b67de 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 106 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-da4c36c6b1d973f481abb8eefdeb085d88eaf37eeaba30d276cb3daa405b6f0c.yml +configured_endpoints: 111 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-36f9d46890bf3667f5a6529bdb156fe1560834ad8187c4271aa0b0024de1adb5.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index e925a84..3d13bc0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## 0.1.0-alpha.2 (2025-02-12) + +Full Changelog: [v0.1.0-alpha.1...v0.1.0-alpha.2](https://github.com/gitpod-io/gitpod-sdk-python/compare/v0.1.0-alpha.1...v0.1.0-alpha.2) + +### Features + +* **api:** manual updates ([#18](https://github.com/gitpod-io/gitpod-sdk-python/issues/18)) ([06b6d24](https://github.com/gitpod-io/gitpod-sdk-python/commit/06b6d240835591bac5f684eb4c5b948ad16c831a)) +* **api:** manual updates ([#19](https://github.com/gitpod-io/gitpod-sdk-python/issues/19)) ([ad9f662](https://github.com/gitpod-io/gitpod-sdk-python/commit/ad9f6629f8ba9b829299c3e43efea320f80e9d62)) +* **api:** manual updates ([#20](https://github.com/gitpod-io/gitpod-sdk-python/issues/20)) ([1a90a1b](https://github.com/gitpod-io/gitpod-sdk-python/commit/1a90a1bf843979c5ca263e88f36afd04265e7137)) + + +### Chores + +* update SDK settings ([#16](https://github.com/gitpod-io/gitpod-sdk-python/issues/16)) ([daa1308](https://github.com/gitpod-io/gitpod-sdk-python/commit/daa13087a8e0e3678365e5ef51cd3db2f4737327)) + ## 0.1.0-alpha.1 (2025-02-11) Full Changelog: [v0.0.1-alpha.0...v0.1.0-alpha.1](https://github.com/gitpod-io/gitpod-sdk-python/compare/v0.0.1-alpha.0...v0.1.0-alpha.1) diff --git a/README.md b/README.md index d093a21..7cb4c28 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Gitpod Python API library -[![PyPI version](https://img.shields.io/pypi/v/gitpod.svg)](https://pypi.org/project/gitpod/) +[![PyPI version](https://img.shields.io/pypi/v/gitpod-sdk.svg)](https://pypi.org/project/gitpod-sdk/) The Gitpod Python library provides convenient access to the Gitpod REST API from any Python 3.8+ application. The library includes type definitions for all request params and response fields, @@ -15,13 +15,10 @@ The REST API documentation can be found on [docs.gitpod.com](https://docs.gitpod ## Installation ```sh -# install from the production repo -pip install git+ssh://git@github.com/gitpod-io/gitpod-sdk-python.git +# install from PyPI +pip install --pre gitpod-sdk ``` -> [!NOTE] -> Once this package is [published to PyPI](https://app.stainlessapi.com/docs/guides/publish), this will become: `pip install --pre gitpod` - ## Usage The full API of this library can be found in [api.md](api.md). diff --git a/api.md b/api.md index 40b1aea..d6933bf 100644 --- a/api.md +++ b/api.md @@ -9,11 +9,14 @@ from gitpod.types import ( Principal, RunsOn, Subject, + Task, TaskExecution, TaskExecutionMetadata, TaskExecutionPhase, TaskExecutionSpec, TaskExecutionStatus, + TaskMetadata, + TaskSpec, UserStatus, ) ``` @@ -141,9 +144,6 @@ Types: ```python from gitpod.types.environments.automations import ( - Task, - TaskMetadata, - TaskSpec, TaskCreateResponse, TaskRetrieveResponse, TaskUpdateResponse, @@ -157,7 +157,7 @@ Methods: - client.environments.automations.tasks.create(\*\*params) -> TaskCreateResponse - client.environments.automations.tasks.retrieve(\*\*params) -> TaskRetrieveResponse - client.environments.automations.tasks.update(\*\*params) -> object -- client.environments.automations.tasks.list(\*\*params) -> SyncTasksPage[Task] +- client.environments.automations.tasks.list(\*\*params) -> SyncTasksPage[Task] - client.environments.automations.tasks.delete(\*\*params) -> object - client.environments.automations.tasks.start(\*\*params) -> TaskStartResponse @@ -259,6 +259,29 @@ Methods: - client.organizations.list_members(\*\*params) -> SyncMembersPage[OrganizationMember] - client.organizations.set_role(\*\*params) -> object +## DomainVerifications + +Types: + +```python +from gitpod.types.organizations import ( + DomainVerification, + DomainVerificationState, + DomainVerificationCreateResponse, + DomainVerificationRetrieveResponse, + DomainVerificationDeleteResponse, + DomainVerificationVerifyResponse, +) +``` + +Methods: + +- client.organizations.domain_verifications.create(\*\*params) -> DomainVerificationCreateResponse +- client.organizations.domain_verifications.retrieve(\*\*params) -> DomainVerificationRetrieveResponse +- client.organizations.domain_verifications.list(\*\*params) -> SyncDomainVerificationsPage[DomainVerification] +- client.organizations.domain_verifications.delete(\*\*params) -> object +- client.organizations.domain_verifications.verify(\*\*params) -> DomainVerificationVerifyResponse + ## Invites Types: diff --git a/pyproject.toml b/pyproject.toml index a62739f..7c84667 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] -name = "gitpod" -version = "0.1.0-alpha.1" +name = "gitpod-sdk" +version = "0.1.0-alpha.2" description = "The official Python library for the gitpod API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/requirements-dev.lock b/requirements-dev.lock index a050918..cc60f65 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -12,7 +12,7 @@ annotated-types==0.6.0 # via pydantic anyio==4.4.0 - # via gitpod + # via gitpod-sdk # via httpx argcomplete==3.1.2 # via nox @@ -25,7 +25,7 @@ dirty-equals==0.6.0 distlib==0.3.7 # via virtualenv distro==1.8.0 - # via gitpod + # via gitpod-sdk exceptiongroup==1.2.2 # via anyio # via pytest @@ -36,7 +36,7 @@ h11==0.14.0 httpcore==1.0.2 # via httpx httpx==0.28.1 - # via gitpod + # via gitpod-sdk # via respx idna==3.4 # via anyio @@ -63,7 +63,7 @@ platformdirs==3.11.0 pluggy==1.5.0 # via pytest pydantic==2.10.3 - # via gitpod + # via gitpod-sdk pydantic-core==2.27.1 # via pydantic pygments==2.18.0 @@ -85,14 +85,14 @@ six==1.16.0 # via python-dateutil sniffio==1.3.0 # via anyio - # via gitpod + # via gitpod-sdk time-machine==2.9.0 tomli==2.0.2 # via mypy # via pytest typing-extensions==4.12.2 # via anyio - # via gitpod + # via gitpod-sdk # via mypy # via pydantic # via pydantic-core diff --git a/requirements.lock b/requirements.lock index 2699011..65e7618 100644 --- a/requirements.lock +++ b/requirements.lock @@ -12,13 +12,13 @@ annotated-types==0.6.0 # via pydantic anyio==4.4.0 - # via gitpod + # via gitpod-sdk # via httpx certifi==2023.7.22 # via httpcore # via httpx distro==1.8.0 - # via gitpod + # via gitpod-sdk exceptiongroup==1.2.2 # via anyio h11==0.14.0 @@ -26,19 +26,19 @@ h11==0.14.0 httpcore==1.0.2 # via httpx httpx==0.28.1 - # via gitpod + # via gitpod-sdk idna==3.4 # via anyio # via httpx pydantic==2.10.3 - # via gitpod + # via gitpod-sdk pydantic-core==2.27.1 # via pydantic sniffio==1.3.0 # via anyio - # via gitpod + # via gitpod-sdk typing-extensions==4.12.2 # via anyio - # via gitpod + # via gitpod-sdk # via pydantic # via pydantic-core diff --git a/src/gitpod/_version.py b/src/gitpod/_version.py index 8ed9927..ad57910 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.1.0-alpha.1" # x-release-please-version +__version__ = "0.1.0-alpha.2" # x-release-please-version diff --git a/src/gitpod/pagination.py b/src/gitpod/pagination.py index 393e2f8..a8e74f8 100644 --- a/src/gitpod/pagination.py +++ b/src/gitpod/pagination.py @@ -9,6 +9,9 @@ from ._base_client import BasePage, PageInfo, BaseSyncPage, BaseAsyncPage __all__ = [ + "DomainVerificationsPagePagination", + "SyncDomainVerificationsPage", + "AsyncDomainVerificationsPage", "EditorsPagePagination", "SyncEditorsPage", "AsyncEditorsPage", @@ -71,6 +74,56 @@ _T = TypeVar("_T") +class DomainVerificationsPagePagination(BaseModel): + next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) + + +class SyncDomainVerificationsPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + domain_verifications: List[_T] = FieldInfo(alias="domainVerifications") + pagination: Optional[DomainVerificationsPagePagination] = None + + @override + def _get_page_items(self) -> List[_T]: + domain_verifications = self.domain_verifications + if not domain_verifications: + return [] + return domain_verifications + + @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 AsyncDomainVerificationsPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + domain_verifications: List[_T] = FieldInfo(alias="domainVerifications") + pagination: Optional[DomainVerificationsPagePagination] = None + + @override + def _get_page_items(self) -> List[_T]: + domain_verifications = self.domain_verifications + if not domain_verifications: + return [] + return domain_verifications + + @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 EditorsPagePagination(BaseModel): next_token: Optional[str] = FieldInfo(alias="nextToken", default=None) diff --git a/src/gitpod/resources/environments/automations/tasks/tasks.py b/src/gitpod/resources/environments/automations/tasks/tasks.py index 1e0b197..9858163 100644 --- a/src/gitpod/resources/environments/automations/tasks/tasks.py +++ b/src/gitpod/resources/environments/automations/tasks/tasks.py @@ -29,6 +29,8 @@ ) from .....pagination import SyncTasksPage, AsyncTasksPage from ....._base_client import AsyncPaginator, make_request_options +from .....types.shared.task import Task +from .....types.shared_params.task_spec import TaskSpec from .....types.environments.automations import ( task_list_params, task_start_params, @@ -37,9 +39,7 @@ task_update_params, task_retrieve_params, ) -from .....types.environments.automations.task import Task -from .....types.environments.automations.task_spec_param import TaskSpecParam -from .....types.environments.automations.task_metadata_param import TaskMetadataParam +from .....types.shared_params.task_metadata import TaskMetadata from .....types.environments.automations.task_start_response import TaskStartResponse from .....types.environments.automations.task_create_response import TaskCreateResponse from .....types.environments.automations.task_retrieve_response import TaskRetrieveResponse @@ -76,8 +76,8 @@ def create( *, depends_on: List[str] | NotGiven = NOT_GIVEN, environment_id: str | NotGiven = NOT_GIVEN, - metadata: TaskMetadataParam | NotGiven = NOT_GIVEN, - spec: TaskSpecParam | NotGiven = NOT_GIVEN, + metadata: TaskMetadata | NotGiven = NOT_GIVEN, + spec: TaskSpec | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -344,8 +344,8 @@ async def create( *, depends_on: List[str] | NotGiven = NOT_GIVEN, environment_id: str | NotGiven = NOT_GIVEN, - metadata: TaskMetadataParam | NotGiven = NOT_GIVEN, - spec: TaskSpecParam | NotGiven = NOT_GIVEN, + metadata: TaskMetadata | NotGiven = NOT_GIVEN, + spec: TaskSpec | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/gitpod/resources/environments/environments.py b/src/gitpod/resources/environments/environments.py index d535188..091b00c 100644 --- a/src/gitpod/resources/environments/environments.py +++ b/src/gitpod/resources/environments/environments.py @@ -248,7 +248,6 @@ def list( token: str | NotGiven = NOT_GIVEN, page_size: int | NotGiven = NOT_GIVEN, filter: environment_list_params.Filter | NotGiven = NOT_GIVEN, - organization_id: str | NotGiven = NOT_GIVEN, pagination: environment_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -261,8 +260,6 @@ def list( ListEnvironments returns a list of environments that match the query. Args: - organization_id: organization_id is the ID of the organization that contains the environments - pagination: pagination contains the pagination options for listing environments extra_headers: Send extra headers @@ -279,7 +276,6 @@ def list( body=maybe_transform( { "filter": filter, - "organization_id": organization_id, "pagination": pagination, }, environment_list_params.EnvironmentListParams, @@ -739,7 +735,6 @@ def list( token: str | NotGiven = NOT_GIVEN, page_size: int | NotGiven = NOT_GIVEN, filter: environment_list_params.Filter | NotGiven = NOT_GIVEN, - organization_id: str | NotGiven = NOT_GIVEN, pagination: environment_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -752,8 +747,6 @@ def list( ListEnvironments returns a list of environments that match the query. Args: - organization_id: organization_id is the ID of the organization that contains the environments - pagination: pagination contains the pagination options for listing environments extra_headers: Send extra headers @@ -770,7 +763,6 @@ def list( body=maybe_transform( { "filter": filter, - "organization_id": organization_id, "pagination": pagination, }, environment_list_params.EnvironmentListParams, diff --git a/src/gitpod/resources/organizations/__init__.py b/src/gitpod/resources/organizations/__init__.py index 164bee2..3b7cf4e 100644 --- a/src/gitpod/resources/organizations/__init__.py +++ b/src/gitpod/resources/organizations/__init__.py @@ -24,8 +24,22 @@ SSOConfigurationsResourceWithStreamingResponse, AsyncSSOConfigurationsResourceWithStreamingResponse, ) +from .domain_verifications import ( + DomainVerificationsResource, + AsyncDomainVerificationsResource, + DomainVerificationsResourceWithRawResponse, + AsyncDomainVerificationsResourceWithRawResponse, + DomainVerificationsResourceWithStreamingResponse, + AsyncDomainVerificationsResourceWithStreamingResponse, +) __all__ = [ + "DomainVerificationsResource", + "AsyncDomainVerificationsResource", + "DomainVerificationsResourceWithRawResponse", + "AsyncDomainVerificationsResourceWithRawResponse", + "DomainVerificationsResourceWithStreamingResponse", + "AsyncDomainVerificationsResourceWithStreamingResponse", "InvitesResource", "AsyncInvitesResource", "InvitesResourceWithRawResponse", diff --git a/src/gitpod/resources/organizations/domain_verifications.py b/src/gitpod/resources/organizations/domain_verifications.py new file mode 100644 index 0000000..3761289 --- /dev/null +++ b/src/gitpod/resources/organizations/domain_verifications.py @@ -0,0 +1,554 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 SyncDomainVerificationsPage, AsyncDomainVerificationsPage +from ..._base_client import AsyncPaginator, make_request_options +from ...types.organizations import ( + domain_verification_list_params, + domain_verification_create_params, + domain_verification_delete_params, + domain_verification_verify_params, + domain_verification_retrieve_params, +) +from ...types.organizations.domain_verification import DomainVerification +from ...types.organizations.domain_verification_create_response import DomainVerificationCreateResponse +from ...types.organizations.domain_verification_verify_response import DomainVerificationVerifyResponse +from ...types.organizations.domain_verification_retrieve_response import DomainVerificationRetrieveResponse + +__all__ = ["DomainVerificationsResource", "AsyncDomainVerificationsResource"] + + +class DomainVerificationsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> DomainVerificationsResourceWithRawResponse: + """ + 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 DomainVerificationsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> DomainVerificationsResourceWithStreamingResponse: + """ + 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 DomainVerificationsResourceWithStreamingResponse(self) + + def create( + self, + *, + domain: str | NotGiven = NOT_GIVEN, + organization_id: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DomainVerificationCreateResponse: + """ + CreateDomainVerification creates a new domain verification request + + 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.OrganizationService/CreateDomainVerification", + body=maybe_transform( + { + "domain": domain, + "organization_id": organization_id, + }, + domain_verification_create_params.DomainVerificationCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DomainVerificationCreateResponse, + ) + + def retrieve( + self, + *, + domain_verification_id: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DomainVerificationRetrieveResponse: + """ + GetDomainVerification retrieves a domain verification request + + 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.OrganizationService/GetDomainVerification", + body=maybe_transform( + {"domain_verification_id": domain_verification_id}, + domain_verification_retrieve_params.DomainVerificationRetrieveParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DomainVerificationRetrieveResponse, + ) + + def list( + self, + *, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + organization_id: str | NotGiven = NOT_GIVEN, + pagination: domain_verification_list_params.Pagination | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SyncDomainVerificationsPage[DomainVerification]: + """ + ListDomainVerifications lists all domain verifications for an 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._get_api_list( + "/gitpod.v1.OrganizationService/ListDomainVerifications", + page=SyncDomainVerificationsPage[DomainVerification], + body=maybe_transform( + { + "organization_id": organization_id, + "pagination": pagination, + }, + domain_verification_list_params.DomainVerificationListParams, + ), + 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, + }, + domain_verification_list_params.DomainVerificationListParams, + ), + ), + model=DomainVerification, + method="post", + ) + + def delete( + self, + *, + domain_verification_id: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + DeleteDomainVerification deletes a domain verification request + + 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.OrganizationService/DeleteDomainVerification", + body=maybe_transform( + {"domain_verification_id": domain_verification_id}, + domain_verification_delete_params.DomainVerificationDeleteParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def verify( + self, + *, + domain_verification_id: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DomainVerificationVerifyResponse: + """ + VerifyDomain verifies a domain ownership + + 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.OrganizationService/VerifyDomain", + body=maybe_transform( + {"domain_verification_id": domain_verification_id}, + domain_verification_verify_params.DomainVerificationVerifyParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DomainVerificationVerifyResponse, + ) + + +class AsyncDomainVerificationsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncDomainVerificationsResourceWithRawResponse: + """ + 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 AsyncDomainVerificationsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncDomainVerificationsResourceWithStreamingResponse: + """ + 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 AsyncDomainVerificationsResourceWithStreamingResponse(self) + + async def create( + self, + *, + domain: str | NotGiven = NOT_GIVEN, + organization_id: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DomainVerificationCreateResponse: + """ + CreateDomainVerification creates a new domain verification request + + 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.OrganizationService/CreateDomainVerification", + body=await async_maybe_transform( + { + "domain": domain, + "organization_id": organization_id, + }, + domain_verification_create_params.DomainVerificationCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DomainVerificationCreateResponse, + ) + + async def retrieve( + self, + *, + domain_verification_id: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DomainVerificationRetrieveResponse: + """ + GetDomainVerification retrieves a domain verification request + + 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.OrganizationService/GetDomainVerification", + body=await async_maybe_transform( + {"domain_verification_id": domain_verification_id}, + domain_verification_retrieve_params.DomainVerificationRetrieveParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DomainVerificationRetrieveResponse, + ) + + def list( + self, + *, + token: str | NotGiven = NOT_GIVEN, + page_size: int | NotGiven = NOT_GIVEN, + organization_id: str | NotGiven = NOT_GIVEN, + pagination: domain_verification_list_params.Pagination | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AsyncPaginator[DomainVerification, AsyncDomainVerificationsPage[DomainVerification]]: + """ + ListDomainVerifications lists all domain verifications for an 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._get_api_list( + "/gitpod.v1.OrganizationService/ListDomainVerifications", + page=AsyncDomainVerificationsPage[DomainVerification], + body=maybe_transform( + { + "organization_id": organization_id, + "pagination": pagination, + }, + domain_verification_list_params.DomainVerificationListParams, + ), + 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, + }, + domain_verification_list_params.DomainVerificationListParams, + ), + ), + model=DomainVerification, + method="post", + ) + + async def delete( + self, + *, + domain_verification_id: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + DeleteDomainVerification deletes a domain verification request + + 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.OrganizationService/DeleteDomainVerification", + body=await async_maybe_transform( + {"domain_verification_id": domain_verification_id}, + domain_verification_delete_params.DomainVerificationDeleteParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def verify( + self, + *, + domain_verification_id: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DomainVerificationVerifyResponse: + """ + VerifyDomain verifies a domain ownership + + 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.OrganizationService/VerifyDomain", + body=await async_maybe_transform( + {"domain_verification_id": domain_verification_id}, + domain_verification_verify_params.DomainVerificationVerifyParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DomainVerificationVerifyResponse, + ) + + +class DomainVerificationsResourceWithRawResponse: + def __init__(self, domain_verifications: DomainVerificationsResource) -> None: + self._domain_verifications = domain_verifications + + self.create = to_raw_response_wrapper( + domain_verifications.create, + ) + self.retrieve = to_raw_response_wrapper( + domain_verifications.retrieve, + ) + self.list = to_raw_response_wrapper( + domain_verifications.list, + ) + self.delete = to_raw_response_wrapper( + domain_verifications.delete, + ) + self.verify = to_raw_response_wrapper( + domain_verifications.verify, + ) + + +class AsyncDomainVerificationsResourceWithRawResponse: + def __init__(self, domain_verifications: AsyncDomainVerificationsResource) -> None: + self._domain_verifications = domain_verifications + + self.create = async_to_raw_response_wrapper( + domain_verifications.create, + ) + self.retrieve = async_to_raw_response_wrapper( + domain_verifications.retrieve, + ) + self.list = async_to_raw_response_wrapper( + domain_verifications.list, + ) + self.delete = async_to_raw_response_wrapper( + domain_verifications.delete, + ) + self.verify = async_to_raw_response_wrapper( + domain_verifications.verify, + ) + + +class DomainVerificationsResourceWithStreamingResponse: + def __init__(self, domain_verifications: DomainVerificationsResource) -> None: + self._domain_verifications = domain_verifications + + self.create = to_streamed_response_wrapper( + domain_verifications.create, + ) + self.retrieve = to_streamed_response_wrapper( + domain_verifications.retrieve, + ) + self.list = to_streamed_response_wrapper( + domain_verifications.list, + ) + self.delete = to_streamed_response_wrapper( + domain_verifications.delete, + ) + self.verify = to_streamed_response_wrapper( + domain_verifications.verify, + ) + + +class AsyncDomainVerificationsResourceWithStreamingResponse: + def __init__(self, domain_verifications: AsyncDomainVerificationsResource) -> None: + self._domain_verifications = domain_verifications + + self.create = async_to_streamed_response_wrapper( + domain_verifications.create, + ) + self.retrieve = async_to_streamed_response_wrapper( + domain_verifications.retrieve, + ) + self.list = async_to_streamed_response_wrapper( + domain_verifications.list, + ) + self.delete = async_to_streamed_response_wrapper( + domain_verifications.delete, + ) + self.verify = async_to_streamed_response_wrapper( + domain_verifications.verify, + ) diff --git a/src/gitpod/resources/organizations/organizations.py b/src/gitpod/resources/organizations/organizations.py index d10cb52..8707b72 100644 --- a/src/gitpod/resources/organizations/organizations.py +++ b/src/gitpod/resources/organizations/organizations.py @@ -51,6 +51,14 @@ AsyncSSOConfigurationsResourceWithStreamingResponse, ) from ...types.organization import Organization +from .domain_verifications import ( + DomainVerificationsResource, + AsyncDomainVerificationsResource, + DomainVerificationsResourceWithRawResponse, + AsyncDomainVerificationsResourceWithRawResponse, + DomainVerificationsResourceWithStreamingResponse, + AsyncDomainVerificationsResourceWithStreamingResponse, +) from ...types.organization_member import OrganizationMember from ...types.invite_domains_param import InviteDomainsParam from ...types.shared.organization_role import OrganizationRole @@ -63,6 +71,10 @@ class OrganizationsResource(SyncAPIResource): + @cached_property + def domain_verifications(self) -> DomainVerificationsResource: + return DomainVerificationsResource(self._client) + @cached_property def invites(self) -> InvitesResource: return InvitesResource(self._client) @@ -490,6 +502,10 @@ def set_role( class AsyncOrganizationsResource(AsyncAPIResource): + @cached_property + def domain_verifications(self) -> AsyncDomainVerificationsResource: + return AsyncDomainVerificationsResource(self._client) + @cached_property def invites(self) -> AsyncInvitesResource: return AsyncInvitesResource(self._client) @@ -948,6 +964,10 @@ def __init__(self, organizations: OrganizationsResource) -> None: organizations.set_role, ) + @cached_property + def domain_verifications(self) -> DomainVerificationsResourceWithRawResponse: + return DomainVerificationsResourceWithRawResponse(self._organizations.domain_verifications) + @cached_property def invites(self) -> InvitesResourceWithRawResponse: return InvitesResourceWithRawResponse(self._organizations.invites) @@ -989,6 +1009,10 @@ def __init__(self, organizations: AsyncOrganizationsResource) -> None: organizations.set_role, ) + @cached_property + def domain_verifications(self) -> AsyncDomainVerificationsResourceWithRawResponse: + return AsyncDomainVerificationsResourceWithRawResponse(self._organizations.domain_verifications) + @cached_property def invites(self) -> AsyncInvitesResourceWithRawResponse: return AsyncInvitesResourceWithRawResponse(self._organizations.invites) @@ -1030,6 +1054,10 @@ def __init__(self, organizations: OrganizationsResource) -> None: organizations.set_role, ) + @cached_property + def domain_verifications(self) -> DomainVerificationsResourceWithStreamingResponse: + return DomainVerificationsResourceWithStreamingResponse(self._organizations.domain_verifications) + @cached_property def invites(self) -> InvitesResourceWithStreamingResponse: return InvitesResourceWithStreamingResponse(self._organizations.invites) @@ -1071,6 +1099,10 @@ def __init__(self, organizations: AsyncOrganizationsResource) -> None: organizations.set_role, ) + @cached_property + def domain_verifications(self) -> AsyncDomainVerificationsResourceWithStreamingResponse: + return AsyncDomainVerificationsResourceWithStreamingResponse(self._organizations.domain_verifications) + @cached_property def invites(self) -> AsyncInvitesResourceWithStreamingResponse: return AsyncInvitesResourceWithStreamingResponse(self._organizations.invites) diff --git a/src/gitpod/resources/secrets.py b/src/gitpod/resources/secrets.py index 374b4c8..14c6bb4 100644 --- a/src/gitpod/resources/secrets.py +++ b/src/gitpod/resources/secrets.py @@ -56,6 +56,7 @@ def with_streaming_response(self) -> SecretsResourceWithStreamingResponse: def create( self, *, + container_registry_basic_auth_host: str | NotGiven = NOT_GIVEN, environment_variable: bool | NotGiven = NOT_GIVEN, file_path: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, @@ -72,6 +73,13 @@ def create( CreateSecret creates a new secret. Args: + container_registry_basic_auth_host: secret will be mounted as a docker config in the environment VM, mount will have + the docker host value must be a valid registry hostname with optional port: + + ``` + this.matches("^[a-zA-Z0-9][a-zA-Z0-9.-]*[a-zA-Z0-9](:[0-9]+)?$") + ``` + environment_variable: secret will be created as an Environment Variable with the same name as the secret @@ -98,6 +106,7 @@ def create( "/gitpod.v1.SecretService/CreateSecret", body=maybe_transform( { + "container_registry_basic_auth_host": container_registry_basic_auth_host, "environment_variable": environment_variable, "file_path": file_path, "name": name, @@ -297,6 +306,7 @@ def with_streaming_response(self) -> AsyncSecretsResourceWithStreamingResponse: async def create( self, *, + container_registry_basic_auth_host: str | NotGiven = NOT_GIVEN, environment_variable: bool | NotGiven = NOT_GIVEN, file_path: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, @@ -313,6 +323,13 @@ async def create( CreateSecret creates a new secret. Args: + container_registry_basic_auth_host: secret will be mounted as a docker config in the environment VM, mount will have + the docker host value must be a valid registry hostname with optional port: + + ``` + this.matches("^[a-zA-Z0-9][a-zA-Z0-9.-]*[a-zA-Z0-9](:[0-9]+)?$") + ``` + environment_variable: secret will be created as an Environment Variable with the same name as the secret @@ -339,6 +356,7 @@ async def create( "/gitpod.v1.SecretService/CreateSecret", body=await async_maybe_transform( { + "container_registry_basic_auth_host": container_registry_basic_auth_host, "environment_variable": environment_variable, "file_path": file_path, "name": name, diff --git a/src/gitpod/types/__init__.py b/src/gitpod/types/__init__.py index 1ff00e1..03e376b 100644 --- a/src/gitpod/types/__init__.py +++ b/src/gitpod/types/__init__.py @@ -9,11 +9,14 @@ from .runner import Runner as Runner from .secret import Secret as Secret from .shared import ( + Task as Task, RunsOn as RunsOn, Subject as Subject, + TaskSpec as TaskSpec, Principal as Principal, FieldValue as FieldValue, UserStatus as UserStatus, + TaskMetadata as TaskMetadata, TaskExecution as TaskExecution, EnvironmentClass as EnvironmentClass, OrganizationRole as OrganizationRole, diff --git a/src/gitpod/types/environment_list_params.py b/src/gitpod/types/environment_list_params.py index 90bd40b..4fe1e4c 100644 --- a/src/gitpod/types/environment_list_params.py +++ b/src/gitpod/types/environment_list_params.py @@ -19,9 +19,6 @@ class EnvironmentListParams(TypedDict, total=False): filter: Filter - organization_id: Annotated[str, PropertyInfo(alias="organizationId")] - """organization_id is the ID of the organization that contains the environments""" - pagination: Pagination """pagination contains the pagination options for listing environments""" diff --git a/src/gitpod/types/environment_spec.py b/src/gitpod/types/environment_spec.py index 96ea049..d65c166 100644 --- a/src/gitpod/types/environment_spec.py +++ b/src/gitpod/types/environment_spec.py @@ -83,6 +83,12 @@ class Port(BaseModel): class Secret(BaseModel): + container_registry_basic_auth_host: Optional[str] = FieldInfo(alias="containerRegistryBasicAuthHost", default=None) + """ + container_registry_basic_auth_host is the hostname of the container registry + that supports basic auth + """ + environment_variable: Optional[str] = FieldInfo(alias="environmentVariable", default=None) file_path: Optional[str] = FieldInfo(alias="filePath", default=None) diff --git a/src/gitpod/types/environment_spec_param.py b/src/gitpod/types/environment_spec_param.py index 2c1d714..cad8f65 100644 --- a/src/gitpod/types/environment_spec_param.py +++ b/src/gitpod/types/environment_spec_param.py @@ -90,6 +90,12 @@ class Port(TypedDict, total=False): class Secret(TypedDict, total=False): + container_registry_basic_auth_host: Annotated[str, PropertyInfo(alias="containerRegistryBasicAuthHost")] + """ + container_registry_basic_auth_host is the hostname of the container registry + that supports basic auth + """ + environment_variable: Annotated[str, PropertyInfo(alias="environmentVariable")] file_path: Annotated[str, PropertyInfo(alias="filePath")] diff --git a/src/gitpod/types/environments/automations/__init__.py b/src/gitpod/types/environments/automations/__init__.py index 11a40e6..d6c647a 100644 --- a/src/gitpod/types/environments/automations/__init__.py +++ b/src/gitpod/types/environments/automations/__init__.py @@ -2,14 +2,10 @@ from __future__ import annotations -from .task import Task as Task from .service import Service as Service -from .task_spec import TaskSpec as TaskSpec from .service_spec import ServiceSpec as ServiceSpec from .service_phase import ServicePhase as ServicePhase -from .task_metadata import TaskMetadata as TaskMetadata from .service_status import ServiceStatus as ServiceStatus -from .task_spec_param import TaskSpecParam as TaskSpecParam from .service_metadata import ServiceMetadata as ServiceMetadata from .task_list_params import TaskListParams as TaskListParams from .task_start_params import TaskStartParams as TaskStartParams @@ -19,7 +15,6 @@ from .task_update_params import TaskUpdateParams as TaskUpdateParams from .service_list_params import ServiceListParams as ServiceListParams from .service_stop_params import ServiceStopParams as ServiceStopParams -from .task_metadata_param import TaskMetadataParam as TaskMetadataParam from .task_start_response import TaskStartResponse as TaskStartResponse from .service_start_params import ServiceStartParams as ServiceStartParams from .task_create_response import TaskCreateResponse as TaskCreateResponse diff --git a/src/gitpod/types/environments/automations/task_create_params.py b/src/gitpod/types/environments/automations/task_create_params.py index 331519b..5bb8916 100644 --- a/src/gitpod/types/environments/automations/task_create_params.py +++ b/src/gitpod/types/environments/automations/task_create_params.py @@ -6,8 +6,8 @@ from typing_extensions import Annotated, TypedDict from ...._utils import PropertyInfo -from .task_spec_param import TaskSpecParam -from .task_metadata_param import TaskMetadataParam +from ...shared_params.task_spec import TaskSpec +from ...shared_params.task_metadata import TaskMetadata __all__ = ["TaskCreateParams"] @@ -17,6 +17,6 @@ class TaskCreateParams(TypedDict, total=False): environment_id: Annotated[str, PropertyInfo(alias="environmentId")] - metadata: TaskMetadataParam + metadata: TaskMetadata - spec: TaskSpecParam + spec: TaskSpec diff --git a/src/gitpod/types/environments/automations/task_create_response.py b/src/gitpod/types/environments/automations/task_create_response.py index 511677b..4845e6b 100644 --- a/src/gitpod/types/environments/automations/task_create_response.py +++ b/src/gitpod/types/environments/automations/task_create_response.py @@ -2,8 +2,8 @@ from typing import Optional -from .task import Task from ...._models import BaseModel +from ...shared.task import Task __all__ = ["TaskCreateResponse"] diff --git a/src/gitpod/types/environments/automations/task_retrieve_response.py b/src/gitpod/types/environments/automations/task_retrieve_response.py index 557ccce..0f01e7b 100644 --- a/src/gitpod/types/environments/automations/task_retrieve_response.py +++ b/src/gitpod/types/environments/automations/task_retrieve_response.py @@ -2,8 +2,8 @@ from typing import Optional -from .task import Task from ...._models import BaseModel +from ...shared.task import Task __all__ = ["TaskRetrieveResponse"] diff --git a/src/gitpod/types/environments/class_list_params.py b/src/gitpod/types/environments/class_list_params.py index 046d982..1abb82c 100644 --- a/src/gitpod/types/environments/class_list_params.py +++ b/src/gitpod/types/environments/class_list_params.py @@ -6,6 +6,8 @@ from typing_extensions import Annotated, TypedDict from ..._utils import PropertyInfo +from ..runner_kind import RunnerKind +from ..runner_provider import RunnerProvider __all__ = ["ClassListParams", "Filter", "Pagination"] @@ -22,6 +24,14 @@ class ClassListParams(TypedDict, total=False): class Filter(TypedDict, total=False): + can_create_environments: Annotated[Optional[bool], PropertyInfo(alias="canCreateEnvironments")] + """ + can_create_environments filters the response to only environment classes that + can be used to create new environments by the caller. Unlike enabled, which + indicates general availability, this ensures the caller only sees environment + classes they are allowed to use. + """ + enabled: Optional[bool] """ enabled filters the response to only enabled or disabled environment classes. If @@ -31,6 +41,18 @@ class Filter(TypedDict, total=False): runner_ids: Annotated[List[str], PropertyInfo(alias="runnerIds")] """runner_ids filters the response to only EnvironmentClasses of these Runner IDs""" + runner_kinds: Annotated[List[RunnerKind], PropertyInfo(alias="runnerKinds")] + """ + runner_kind filters the response to only environment classes from runners of + these kinds. + """ + + runner_providers: Annotated[List[RunnerProvider], PropertyInfo(alias="runnerProviders")] + """ + runner_providers filters the response to only environment classes from runners + of these providers. + """ + class Pagination(TypedDict, total=False): token: str diff --git a/src/gitpod/types/organizations/__init__.py b/src/gitpod/types/organizations/__init__.py index ce9a399..83301d7 100644 --- a/src/gitpod/types/organizations/__init__.py +++ b/src/gitpod/types/organizations/__init__.py @@ -4,18 +4,30 @@ from .provider_type import ProviderType as ProviderType from .sso_configuration import SSOConfiguration as SSOConfiguration +from .domain_verification import DomainVerification as DomainVerification from .organization_invite import OrganizationInvite as OrganizationInvite from .invite_create_params import InviteCreateParams as InviteCreateParams from .invite_create_response import InviteCreateResponse as InviteCreateResponse from .invite_retrieve_params import InviteRetrieveParams as InviteRetrieveParams from .sso_configuration_state import SSOConfigurationState as SSOConfigurationState from .invite_retrieve_response import InviteRetrieveResponse as InviteRetrieveResponse +from .domain_verification_state import DomainVerificationState as DomainVerificationState from .invite_get_summary_params import InviteGetSummaryParams as InviteGetSummaryParams from .invite_get_summary_response import InviteGetSummaryResponse as InviteGetSummaryResponse from .sso_configuration_list_params import SSOConfigurationListParams as SSOConfigurationListParams +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 from .sso_configuration_update_params import SSOConfigurationUpdateParams as SSOConfigurationUpdateParams +from .domain_verification_create_params import DomainVerificationCreateParams as DomainVerificationCreateParams +from .domain_verification_delete_params import DomainVerificationDeleteParams as DomainVerificationDeleteParams +from .domain_verification_verify_params import DomainVerificationVerifyParams as DomainVerificationVerifyParams from .sso_configuration_create_response import SSOConfigurationCreateResponse as SSOConfigurationCreateResponse from .sso_configuration_retrieve_params import SSOConfigurationRetrieveParams as SSOConfigurationRetrieveParams +from .domain_verification_create_response import DomainVerificationCreateResponse as DomainVerificationCreateResponse +from .domain_verification_retrieve_params import DomainVerificationRetrieveParams as DomainVerificationRetrieveParams +from .domain_verification_verify_response import DomainVerificationVerifyResponse as DomainVerificationVerifyResponse from .sso_configuration_retrieve_response import SSOConfigurationRetrieveResponse as SSOConfigurationRetrieveResponse +from .domain_verification_retrieve_response import ( + DomainVerificationRetrieveResponse as DomainVerificationRetrieveResponse, +) diff --git a/src/gitpod/types/organizations/domain_verification.py b/src/gitpod/types/organizations/domain_verification.py new file mode 100644 index 0000000..04d9847 --- /dev/null +++ b/src/gitpod/types/organizations/domain_verification.py @@ -0,0 +1,113 @@ +# 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 .domain_verification_state import DomainVerificationState + +__all__ = ["DomainVerification"] + + +class DomainVerification(BaseModel): + id: Optional[str] = None + + domain: Optional[str] = None + + organization_id: Optional[str] = FieldInfo(alias="organizationId", default=None) + + state: Optional[DomainVerificationState] = None + + verified_at: Optional[datetime] = FieldInfo(alias="verifiedAt", 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/organizations/domain_verification_create_params.py b/src/gitpod/types/organizations/domain_verification_create_params.py new file mode 100644 index 0000000..317c158 --- /dev/null +++ b/src/gitpod/types/organizations/domain_verification_create_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_extensions import Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["DomainVerificationCreateParams"] + + +class DomainVerificationCreateParams(TypedDict, total=False): + domain: str + + organization_id: Annotated[str, PropertyInfo(alias="organizationId")] diff --git a/src/gitpod/types/organizations/domain_verification_create_response.py b/src/gitpod/types/organizations/domain_verification_create_response.py new file mode 100644 index 0000000..c42eb64 --- /dev/null +++ b/src/gitpod/types/organizations/domain_verification_create_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 .domain_verification import DomainVerification + +__all__ = ["DomainVerificationCreateResponse"] + + +class DomainVerificationCreateResponse(BaseModel): + domain_verification: Optional[DomainVerification] = FieldInfo(alias="domainVerification", default=None) diff --git a/src/gitpod/types/organizations/domain_verification_delete_params.py b/src/gitpod/types/organizations/domain_verification_delete_params.py new file mode 100644 index 0000000..15025b9 --- /dev/null +++ b/src/gitpod/types/organizations/domain_verification_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__ = ["DomainVerificationDeleteParams"] + + +class DomainVerificationDeleteParams(TypedDict, total=False): + domain_verification_id: Annotated[str, PropertyInfo(alias="domainVerificationId")] diff --git a/src/gitpod/types/organizations/domain_verification_list_params.py b/src/gitpod/types/organizations/domain_verification_list_params.py new file mode 100644 index 0000000..dfa94c2 --- /dev/null +++ b/src/gitpod/types/organizations/domain_verification_list_params.py @@ -0,0 +1,33 @@ +# 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__ = ["DomainVerificationListParams", "Pagination"] + + +class DomainVerificationListParams(TypedDict, total=False): + token: str + + page_size: Annotated[int, PropertyInfo(alias="pageSize")] + + organization_id: Annotated[str, PropertyInfo(alias="organizationId")] + + pagination: Pagination + + +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/organizations/domain_verification_retrieve_params.py b/src/gitpod/types/organizations/domain_verification_retrieve_params.py new file mode 100644 index 0000000..c471720 --- /dev/null +++ b/src/gitpod/types/organizations/domain_verification_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__ = ["DomainVerificationRetrieveParams"] + + +class DomainVerificationRetrieveParams(TypedDict, total=False): + domain_verification_id: Annotated[str, PropertyInfo(alias="domainVerificationId")] diff --git a/src/gitpod/types/organizations/domain_verification_retrieve_response.py b/src/gitpod/types/organizations/domain_verification_retrieve_response.py new file mode 100644 index 0000000..06d2737 --- /dev/null +++ b/src/gitpod/types/organizations/domain_verification_retrieve_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 .domain_verification import DomainVerification + +__all__ = ["DomainVerificationRetrieveResponse"] + + +class DomainVerificationRetrieveResponse(BaseModel): + domain_verification: Optional[DomainVerification] = FieldInfo(alias="domainVerification", default=None) diff --git a/src/gitpod/types/organizations/domain_verification_state.py b/src/gitpod/types/organizations/domain_verification_state.py new file mode 100644 index 0000000..cc7a6d8 --- /dev/null +++ b/src/gitpod/types/organizations/domain_verification_state.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__ = ["DomainVerificationState"] + +DomainVerificationState: TypeAlias = Literal[ + "DOMAIN_VERIFICATION_STATE_UNSPECIFIED", "DOMAIN_VERIFICATION_STATE_PENDING", "DOMAIN_VERIFICATION_STATE_VERIFIED" +] diff --git a/src/gitpod/types/organizations/domain_verification_verify_params.py b/src/gitpod/types/organizations/domain_verification_verify_params.py new file mode 100644 index 0000000..7f96c20 --- /dev/null +++ b/src/gitpod/types/organizations/domain_verification_verify_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__ = ["DomainVerificationVerifyParams"] + + +class DomainVerificationVerifyParams(TypedDict, total=False): + domain_verification_id: Annotated[str, PropertyInfo(alias="domainVerificationId")] diff --git a/src/gitpod/types/organizations/domain_verification_verify_response.py b/src/gitpod/types/organizations/domain_verification_verify_response.py new file mode 100644 index 0000000..91c0053 --- /dev/null +++ b/src/gitpod/types/organizations/domain_verification_verify_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 .domain_verification import DomainVerification + +__all__ = ["DomainVerificationVerifyResponse"] + + +class DomainVerificationVerifyResponse(BaseModel): + domain_verification: Optional[DomainVerification] = FieldInfo(alias="domainVerification", default=None) diff --git a/src/gitpod/types/projects/project_role.py b/src/gitpod/types/projects/project_role.py index b2a6261..e488d52 100644 --- a/src/gitpod/types/projects/project_role.py +++ b/src/gitpod/types/projects/project_role.py @@ -4,4 +4,6 @@ __all__ = ["ProjectRole"] -ProjectRole: TypeAlias = Literal["PROJECT_ROLE_UNSPECIFIED", "PROJECT_ROLE_ADMIN", "PROJECT_ROLE_USER"] +ProjectRole: TypeAlias = Literal[ + "PROJECT_ROLE_UNSPECIFIED", "PROJECT_ROLE_ADMIN", "PROJECT_ROLE_USER", "PROJECT_ROLE_EDITOR" +] diff --git a/src/gitpod/types/resource_type.py b/src/gitpod/types/resource_type.py index c34eaea..ed64eee 100644 --- a/src/gitpod/types/resource_type.py +++ b/src/gitpod/types/resource_type.py @@ -23,4 +23,5 @@ "RESOURCE_TYPE_SERVICE_ACCOUNT", "RESOURCE_TYPE_SECRET", "RESOURCE_TYPE_SSO_CONFIG", + "RESOURCE_TYPE_DOMAIN_VERIFICATION", ] diff --git a/src/gitpod/types/runners/configurations/environment_class_list_params.py b/src/gitpod/types/runners/configurations/environment_class_list_params.py index c5c59b1..14cdf32 100644 --- a/src/gitpod/types/runners/configurations/environment_class_list_params.py +++ b/src/gitpod/types/runners/configurations/environment_class_list_params.py @@ -6,6 +6,8 @@ from typing_extensions import Annotated, TypedDict from ...._utils import PropertyInfo +from ...runner_kind import RunnerKind +from ...runner_provider import RunnerProvider __all__ = ["EnvironmentClassListParams", "Filter", "Pagination"] @@ -22,6 +24,14 @@ class EnvironmentClassListParams(TypedDict, total=False): class Filter(TypedDict, total=False): + can_create_environments: Annotated[Optional[bool], PropertyInfo(alias="canCreateEnvironments")] + """ + can_create_environments filters the response to only environment classes that + can be used to create new environments by the caller. Unlike enabled, which + indicates general availability, this ensures the caller only sees environment + classes they are allowed to use. + """ + enabled: Optional[bool] """ enabled filters the response to only enabled or disabled environment classes. If @@ -31,6 +41,18 @@ class Filter(TypedDict, total=False): runner_ids: Annotated[List[str], PropertyInfo(alias="runnerIds")] """runner_ids filters the response to only EnvironmentClasses of these Runner IDs""" + runner_kinds: Annotated[List[RunnerKind], PropertyInfo(alias="runnerKinds")] + """ + runner_kind filters the response to only environment classes from runners of + these kinds. + """ + + runner_providers: Annotated[List[RunnerProvider], PropertyInfo(alias="runnerProviders")] + """ + runner_providers filters the response to only environment classes from runners + of these providers. + """ + class Pagination(TypedDict, total=False): token: str diff --git a/src/gitpod/types/secret.py b/src/gitpod/types/secret.py index 13e91d3..e994fa7 100644 --- a/src/gitpod/types/secret.py +++ b/src/gitpod/types/secret.py @@ -14,6 +14,9 @@ class Secret(BaseModel): id: Optional[str] = None + container_registry_basic_auth_host: Optional[str] = FieldInfo(alias="containerRegistryBasicAuthHost", default=None) + """secret will be mounted as a registry secret""" + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) """ A Timestamp represents a point in time independent of any time zone or local diff --git a/src/gitpod/types/secret_create_params.py b/src/gitpod/types/secret_create_params.py index 99447e0..81da5d9 100644 --- a/src/gitpod/types/secret_create_params.py +++ b/src/gitpod/types/secret_create_params.py @@ -10,6 +10,16 @@ class SecretCreateParams(TypedDict, total=False): + container_registry_basic_auth_host: Annotated[str, PropertyInfo(alias="containerRegistryBasicAuthHost")] + """ + secret will be mounted as a docker config in the environment VM, mount will have + the docker host value must be a valid registry hostname with optional port: + + ``` + this.matches('^[a-zA-Z0-9][a-zA-Z0-9.-]*[a-zA-Z0-9](:[0-9]+)?$') + ``` + """ + environment_variable: Annotated[bool, PropertyInfo(alias="environmentVariable")] """ secret will be created as an Environment Variable with the same name as the diff --git a/src/gitpod/types/shared/__init__.py b/src/gitpod/types/shared/__init__.py index 4911a8a..ba0e256 100644 --- a/src/gitpod/types/shared/__init__.py +++ b/src/gitpod/types/shared/__init__.py @@ -1,10 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .task import Task as Task from .runs_on import RunsOn as RunsOn from .subject import Subject as Subject from .principal import Principal as Principal +from .task_spec import TaskSpec as TaskSpec from .field_value import FieldValue as FieldValue from .user_status import UserStatus as UserStatus +from .task_metadata import TaskMetadata as TaskMetadata from .task_execution import TaskExecution as TaskExecution from .environment_class import EnvironmentClass as EnvironmentClass from .organization_role import OrganizationRole as OrganizationRole diff --git a/src/gitpod/types/environments/automations/task.py b/src/gitpod/types/shared/task.py similarity index 94% rename from src/gitpod/types/environments/automations/task.py rename to src/gitpod/types/shared/task.py index 01d91d1..95e8566 100644 --- a/src/gitpod/types/environments/automations/task.py +++ b/src/gitpod/types/shared/task.py @@ -4,8 +4,8 @@ from pydantic import Field as FieldInfo +from ..._models import BaseModel from .task_spec import TaskSpec -from ...._models import BaseModel from .task_metadata import TaskMetadata __all__ = ["Task"] diff --git a/src/gitpod/types/shared/task_execution_spec.py b/src/gitpod/types/shared/task_execution_spec.py index 923f5f6..17a4bff 100644 --- a/src/gitpod/types/shared/task_execution_spec.py +++ b/src/gitpod/types/shared/task_execution_spec.py @@ -5,8 +5,8 @@ from pydantic import Field as FieldInfo from ..._models import BaseModel +from .task_spec import TaskSpec from .task_execution_phase import TaskExecutionPhase -from ..environments.automations.task_spec import TaskSpec __all__ = ["TaskExecutionSpec", "Plan", "PlanStep", "PlanStepTask"] diff --git a/src/gitpod/types/environments/automations/task_metadata.py b/src/gitpod/types/shared/task_metadata.py similarity index 97% rename from src/gitpod/types/environments/automations/task_metadata.py rename to src/gitpod/types/shared/task_metadata.py index f99f98e..23e6c2c 100644 --- a/src/gitpod/types/environments/automations/task_metadata.py +++ b/src/gitpod/types/shared/task_metadata.py @@ -5,9 +5,9 @@ from pydantic import Field as FieldInfo -from ...._models import BaseModel -from ...shared.subject import Subject -from ...shared.automation_trigger import AutomationTrigger +from .subject import Subject +from ..._models import BaseModel +from .automation_trigger import AutomationTrigger __all__ = ["TaskMetadata"] diff --git a/src/gitpod/types/environments/automations/task_spec.py b/src/gitpod/types/shared/task_spec.py similarity index 86% rename from src/gitpod/types/environments/automations/task_spec.py rename to src/gitpod/types/shared/task_spec.py index 3d1d0f1..c69815f 100644 --- a/src/gitpod/types/environments/automations/task_spec.py +++ b/src/gitpod/types/shared/task_spec.py @@ -4,8 +4,8 @@ from pydantic import Field as FieldInfo -from ...._models import BaseModel -from ...shared.runs_on import RunsOn +from .runs_on import RunsOn +from ..._models import BaseModel __all__ = ["TaskSpec"] diff --git a/src/gitpod/types/shared_params/__init__.py b/src/gitpod/types/shared_params/__init__.py index d98911f..51915e7 100644 --- a/src/gitpod/types/shared_params/__init__.py +++ b/src/gitpod/types/shared_params/__init__.py @@ -3,7 +3,9 @@ from .runs_on import RunsOn as RunsOn from .subject import Subject as Subject from .principal import Principal as Principal +from .task_spec import TaskSpec as TaskSpec from .field_value import FieldValue as FieldValue +from .task_metadata import TaskMetadata as TaskMetadata from .environment_class import EnvironmentClass as EnvironmentClass from .organization_role import OrganizationRole as OrganizationRole from .automation_trigger import AutomationTrigger as AutomationTrigger diff --git a/src/gitpod/types/environments/automations/task_metadata_param.py b/src/gitpod/types/shared_params/task_metadata.py similarity index 95% rename from src/gitpod/types/environments/automations/task_metadata_param.py rename to src/gitpod/types/shared_params/task_metadata.py index 9331c97..50ffda7 100644 --- a/src/gitpod/types/environments/automations/task_metadata_param.py +++ b/src/gitpod/types/shared_params/task_metadata.py @@ -6,14 +6,14 @@ from datetime import datetime from typing_extensions import Annotated, TypedDict -from ...._utils import PropertyInfo -from ...shared_params.subject import Subject -from ...shared_params.automation_trigger import AutomationTrigger +from .subject import Subject +from ..._utils import PropertyInfo +from .automation_trigger import AutomationTrigger -__all__ = ["TaskMetadataParam"] +__all__ = ["TaskMetadata"] -class TaskMetadataParam(TypedDict, total=False): +class TaskMetadata(TypedDict, total=False): created_at: Annotated[Union[str, datetime], PropertyInfo(alias="createdAt", format="iso8601")] """ A Timestamp represents a point in time independent of any time zone or local diff --git a/src/gitpod/types/environments/automations/task_spec_param.py b/src/gitpod/types/shared_params/task_spec.py similarity index 71% rename from src/gitpod/types/environments/automations/task_spec_param.py rename to src/gitpod/types/shared_params/task_spec.py index bf0c629..5f40eef 100644 --- a/src/gitpod/types/environments/automations/task_spec_param.py +++ b/src/gitpod/types/shared_params/task_spec.py @@ -4,13 +4,13 @@ from typing_extensions import Annotated, TypedDict -from ...._utils import PropertyInfo -from ...shared_params.runs_on import RunsOn +from .runs_on import RunsOn +from ..._utils import PropertyInfo -__all__ = ["TaskSpecParam"] +__all__ = ["TaskSpec"] -class TaskSpecParam(TypedDict, total=False): +class TaskSpec(TypedDict, total=False): command: str """command contains the command the task should execute""" diff --git a/tests/api_resources/environments/automations/test_tasks.py b/tests/api_resources/environments/automations/test_tasks.py index 4cee7ae..adcf14f 100644 --- a/tests/api_resources/environments/automations/test_tasks.py +++ b/tests/api_resources/environments/automations/test_tasks.py @@ -11,8 +11,8 @@ from tests.utils import assert_matches_type from gitpod._utils import parse_datetime from gitpod.pagination import SyncTasksPage, AsyncTasksPage +from gitpod.types.shared import Task from gitpod.types.environments.automations import ( - Task, TaskStartResponse, TaskCreateResponse, TaskRetrieveResponse, diff --git a/tests/api_resources/environments/test_classes.py b/tests/api_resources/environments/test_classes.py index f097f89..ba3893e 100644 --- a/tests/api_resources/environments/test_classes.py +++ b/tests/api_resources/environments/test_classes.py @@ -31,8 +31,11 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: token="token", page_size=0, filter={ + "can_create_environments": True, "enabled": True, "runner_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "runner_kinds": ["RUNNER_KIND_UNSPECIFIED"], + "runner_providers": ["RUNNER_PROVIDER_UNSPECIFIED"], }, pagination={ "token": "token", @@ -80,8 +83,11 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N token="token", page_size=0, filter={ + "can_create_environments": True, "enabled": True, "runner_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "runner_kinds": ["RUNNER_KIND_UNSPECIFIED"], + "runner_providers": ["RUNNER_PROVIDER_UNSPECIFIED"], }, pagination={ "token": "token", diff --git a/tests/api_resources/organizations/test_domain_verifications.py b/tests/api_resources/organizations/test_domain_verifications.py new file mode 100644 index 0000000..9a170cf --- /dev/null +++ b/tests/api_resources/organizations/test_domain_verifications.py @@ -0,0 +1,404 @@ +# 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 SyncDomainVerificationsPage, AsyncDomainVerificationsPage +from gitpod.types.organizations import ( + DomainVerification, + DomainVerificationCreateResponse, + DomainVerificationVerifyResponse, + DomainVerificationRetrieveResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestDomainVerifications: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip() + @parametrize + def test_method_create(self, client: Gitpod) -> None: + domain_verification = client.organizations.domain_verifications.create() + assert_matches_type(DomainVerificationCreateResponse, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_create_with_all_params(self, client: Gitpod) -> None: + domain_verification = client.organizations.domain_verifications.create( + domain="xxxx", + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(DomainVerificationCreateResponse, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_create(self, client: Gitpod) -> None: + response = client.organizations.domain_verifications.with_raw_response.create() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + domain_verification = response.parse() + assert_matches_type(DomainVerificationCreateResponse, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_create(self, client: Gitpod) -> None: + with client.organizations.domain_verifications.with_streaming_response.create() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + domain_verification = response.parse() + assert_matches_type(DomainVerificationCreateResponse, domain_verification, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_method_retrieve(self, client: Gitpod) -> None: + domain_verification = client.organizations.domain_verifications.retrieve() + assert_matches_type(DomainVerificationRetrieveResponse, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: + domain_verification = client.organizations.domain_verifications.retrieve( + domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(DomainVerificationRetrieveResponse, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_retrieve(self, client: Gitpod) -> None: + response = client.organizations.domain_verifications.with_raw_response.retrieve() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + domain_verification = response.parse() + assert_matches_type(DomainVerificationRetrieveResponse, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_retrieve(self, client: Gitpod) -> None: + with client.organizations.domain_verifications.with_streaming_response.retrieve() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + domain_verification = response.parse() + assert_matches_type(DomainVerificationRetrieveResponse, domain_verification, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_method_list(self, client: Gitpod) -> None: + domain_verification = client.organizations.domain_verifications.list() + assert_matches_type(SyncDomainVerificationsPage[DomainVerification], domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_list_with_all_params(self, client: Gitpod) -> None: + domain_verification = client.organizations.domain_verifications.list( + token="token", + page_size=0, + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + pagination={ + "token": "token", + "page_size": 100, + }, + ) + assert_matches_type(SyncDomainVerificationsPage[DomainVerification], domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_list(self, client: Gitpod) -> None: + response = client.organizations.domain_verifications.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + domain_verification = response.parse() + assert_matches_type(SyncDomainVerificationsPage[DomainVerification], domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_list(self, client: Gitpod) -> None: + with client.organizations.domain_verifications.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + domain_verification = response.parse() + assert_matches_type(SyncDomainVerificationsPage[DomainVerification], domain_verification, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_method_delete(self, client: Gitpod) -> None: + domain_verification = client.organizations.domain_verifications.delete() + assert_matches_type(object, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_delete_with_all_params(self, client: Gitpod) -> None: + domain_verification = client.organizations.domain_verifications.delete( + domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(object, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_delete(self, client: Gitpod) -> None: + response = client.organizations.domain_verifications.with_raw_response.delete() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + domain_verification = response.parse() + assert_matches_type(object, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_delete(self, client: Gitpod) -> None: + with client.organizations.domain_verifications.with_streaming_response.delete() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + domain_verification = response.parse() + assert_matches_type(object, domain_verification, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_method_verify(self, client: Gitpod) -> None: + domain_verification = client.organizations.domain_verifications.verify() + assert_matches_type(DomainVerificationVerifyResponse, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_verify_with_all_params(self, client: Gitpod) -> None: + domain_verification = client.organizations.domain_verifications.verify( + domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(DomainVerificationVerifyResponse, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_verify(self, client: Gitpod) -> None: + response = client.organizations.domain_verifications.with_raw_response.verify() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + domain_verification = response.parse() + assert_matches_type(DomainVerificationVerifyResponse, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_verify(self, client: Gitpod) -> None: + with client.organizations.domain_verifications.with_streaming_response.verify() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + domain_verification = response.parse() + assert_matches_type(DomainVerificationVerifyResponse, domain_verification, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncDomainVerifications: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create(self, async_client: AsyncGitpod) -> None: + domain_verification = await async_client.organizations.domain_verifications.create() + assert_matches_type(DomainVerificationCreateResponse, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: + domain_verification = await async_client.organizations.domain_verifications.create( + domain="xxxx", + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(DomainVerificationCreateResponse, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.domain_verifications.with_raw_response.create() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + domain_verification = await response.parse() + assert_matches_type(DomainVerificationCreateResponse, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.domain_verifications.with_streaming_response.create() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + domain_verification = await response.parse() + assert_matches_type(DomainVerificationCreateResponse, domain_verification, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: + domain_verification = await async_client.organizations.domain_verifications.retrieve() + assert_matches_type(DomainVerificationRetrieveResponse, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: + domain_verification = await async_client.organizations.domain_verifications.retrieve( + domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(DomainVerificationRetrieveResponse, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.domain_verifications.with_raw_response.retrieve() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + domain_verification = await response.parse() + assert_matches_type(DomainVerificationRetrieveResponse, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.domain_verifications.with_streaming_response.retrieve() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + domain_verification = await response.parse() + assert_matches_type(DomainVerificationRetrieveResponse, domain_verification, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_method_list(self, async_client: AsyncGitpod) -> None: + domain_verification = await async_client.organizations.domain_verifications.list() + assert_matches_type(AsyncDomainVerificationsPage[DomainVerification], domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None: + domain_verification = await async_client.organizations.domain_verifications.list( + token="token", + page_size=0, + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + pagination={ + "token": "token", + "page_size": 100, + }, + ) + assert_matches_type(AsyncDomainVerificationsPage[DomainVerification], domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_list(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.domain_verifications.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + domain_verification = await response.parse() + assert_matches_type(AsyncDomainVerificationsPage[DomainVerification], domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.domain_verifications.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + domain_verification = await response.parse() + assert_matches_type( + AsyncDomainVerificationsPage[DomainVerification], domain_verification, path=["response"] + ) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_method_delete(self, async_client: AsyncGitpod) -> None: + domain_verification = await async_client.organizations.domain_verifications.delete() + assert_matches_type(object, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: + domain_verification = await async_client.organizations.domain_verifications.delete( + domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(object, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_delete(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.domain_verifications.with_raw_response.delete() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + domain_verification = await response.parse() + assert_matches_type(object, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.domain_verifications.with_streaming_response.delete() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + domain_verification = await response.parse() + assert_matches_type(object, domain_verification, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_method_verify(self, async_client: AsyncGitpod) -> None: + domain_verification = await async_client.organizations.domain_verifications.verify() + assert_matches_type(DomainVerificationVerifyResponse, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_verify_with_all_params(self, async_client: AsyncGitpod) -> None: + domain_verification = await async_client.organizations.domain_verifications.verify( + domain_verification_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(DomainVerificationVerifyResponse, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_verify(self, async_client: AsyncGitpod) -> None: + response = await async_client.organizations.domain_verifications.with_raw_response.verify() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + domain_verification = await response.parse() + assert_matches_type(DomainVerificationVerifyResponse, domain_verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_verify(self, async_client: AsyncGitpod) -> None: + async with async_client.organizations.domain_verifications.with_streaming_response.verify() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + domain_verification = await response.parse() + assert_matches_type(DomainVerificationVerifyResponse, domain_verification, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/runners/configurations/test_environment_classes.py b/tests/api_resources/runners/configurations/test_environment_classes.py index de30bc1..0c47b39 100644 --- a/tests/api_resources/runners/configurations/test_environment_classes.py +++ b/tests/api_resources/runners/configurations/test_environment_classes.py @@ -154,8 +154,11 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: token="token", page_size=0, filter={ + "can_create_environments": True, "enabled": True, "runner_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "runner_kinds": ["RUNNER_KIND_UNSPECIFIED"], + "runner_providers": ["RUNNER_PROVIDER_UNSPECIFIED"], }, pagination={ "token": "token", @@ -324,8 +327,11 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N token="token", page_size=0, filter={ + "can_create_environments": True, "enabled": True, "runner_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "runner_kinds": ["RUNNER_KIND_UNSPECIFIED"], + "runner_providers": ["RUNNER_PROVIDER_UNSPECIFIED"], }, pagination={ "token": "token", diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index 992d3b2..811daf8 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -78,6 +78,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ], "secrets": [ { + "container_registry_basic_auth_host": "containerRegistryBasicAuthHost", "environment_variable": "environmentVariable", "file_path": "filePath", "git_credential_host": "gitCredentialHost", @@ -256,7 +257,6 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "runner_kinds": ["RUNNER_KIND_UNSPECIFIED"], "status_phases": ["ENVIRONMENT_PHASE_UNSPECIFIED"], }, - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", pagination={ "token": "token", "page_size": 100, @@ -377,6 +377,7 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non ], "secrets": [ { + "container_registry_basic_auth_host": "containerRegistryBasicAuthHost", "environment_variable": "environmentVariable", "file_path": "filePath", "git_credential_host": "gitCredentialHost", @@ -625,6 +626,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ], "secrets": [ { + "container_registry_basic_auth_host": "containerRegistryBasicAuthHost", "environment_variable": "environmentVariable", "file_path": "filePath", "git_credential_host": "gitCredentialHost", @@ -803,7 +805,6 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "runner_kinds": ["RUNNER_KIND_UNSPECIFIED"], "status_phases": ["ENVIRONMENT_PHASE_UNSPECIFIED"], }, - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", pagination={ "token": "token", "page_size": 100, @@ -924,6 +925,7 @@ async def test_method_create_from_project_with_all_params(self, async_client: As ], "secrets": [ { + "container_registry_basic_auth_host": "containerRegistryBasicAuthHost", "environment_variable": "environmentVariable", "file_path": "filePath", "git_credential_host": "gitCredentialHost", diff --git a/tests/api_resources/test_secrets.py b/tests/api_resources/test_secrets.py index ce95778..439581a 100644 --- a/tests/api_resources/test_secrets.py +++ b/tests/api_resources/test_secrets.py @@ -32,6 +32,7 @@ def test_method_create(self, client: Gitpod) -> None: @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: secret = client.secrets.create( + container_registry_basic_auth_host="containerRegistryBasicAuthHost", environment_variable=True, file_path="filePath", name="name", @@ -227,6 +228,7 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.create( + container_registry_basic_auth_host="containerRegistryBasicAuthHost", environment_variable=True, file_path="filePath", name="name",