From 01a55f51feb721ed590f5d85904da96075b2b7c9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 19 Feb 2025 09:33:04 +0000 Subject: [PATCH] feat(api): manual updates --- .stats.yml | 2 +- src/gitpod/resources/events.py | 92 +++- src/gitpod/resources/groups.py | 60 ++- src/gitpod/resources/projects/policies.py | 158 ++++++- src/gitpod/resources/projects/projects.py | 290 +++++++++++- .../runners/configurations/configurations.py | 52 ++- .../configurations/environment_classes.py | 194 +++++++- .../host_authentication_tokens.py | 222 ++++++++- .../runners/configurations/schema.py | 36 +- .../configurations/scm_integrations.py | 198 +++++++- src/gitpod/resources/runners/policies.py | 158 ++++++- src/gitpod/resources/runners/runners.py | 422 +++++++++++++++--- tests/api_resources/projects/test_policies.py | 32 +- .../test_environment_classes.py | 52 ++- .../test_host_authentication_tokens.py | 56 +-- .../runners/configurations/test_schema.py | 4 +- .../configurations/test_scm_integrations.py | 48 +- .../runners/test_configurations.py | 24 +- tests/api_resources/runners/test_policies.py | 32 +- tests/api_resources/test_events.py | 8 +- tests/api_resources/test_groups.py | 4 +- tests/api_resources/test_projects.py | 40 +- tests/api_resources/test_runners.py | 40 +- 23 files changed, 1933 insertions(+), 291 deletions(-) diff --git a/.stats.yml b/.stats.yml index f08fd6b4..27a7d826 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 111 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-cd6a05ae99d2a050577fa0e729e6ae89b4eacd78f61366a77269398368f8a877.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-d6a243325df36817d495ce6dd54f80766b77a97e1ca2f6d371c0a68b7d070e0f.yml diff --git a/src/gitpod/resources/events.py b/src/gitpod/resources/events.py index 8a7ebdda..f5de7cf1 100644 --- a/src/gitpod/resources/events.py +++ b/src/gitpod/resources/events.py @@ -62,8 +62,32 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncEntriesPage[EventListResponse]: """ - ListAuditLogs retrieves a paginated list of audit logs for the specified - organization + Lists audit logs with filtering and pagination options. + + Use this method to: + + - View audit history + - Track user actions + - Monitor system changes + + ### Examples + + - List all logs: + + ```yaml + pagination: + pageSize: 20 + ``` + + - Filter by actor: + + ```yaml + filter: + actorIds: ["d2c94c27-3b76-4a42-b88c-95a85e392c68"] + actorPrincipals: ["PRINCIPAL_USER"] + pagination: + pageSize: 20 + ``` Args: pagination: pagination contains the pagination options for listing environments @@ -116,7 +140,23 @@ def watch( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> JSONLDecoder[EventWatchResponse]: """ - WatchEvents streams all requests events to the client + Streams events for all projects, runners, environments, tasks, and services + based on the specified scope. + + Use this method to: + + - Monitor resource changes in real-time + - Track system events + - Receive notifications + + The scope parameter determines which events to watch: + + - Organization scope (default): Watch all organization-wide events including + projects, runners and environments. Task and service events are not included. + Use by setting organization=true or omitting the scope. + - Environment scope: Watch events for a specific environment, including its + tasks, task executions, and services. Use by setting environment_id to the + UUID of the environment to watch. Args: environment_id: Environment scope produces events for the environment itself, all tasks, task @@ -187,8 +227,32 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[EventListResponse, AsyncEntriesPage[EventListResponse]]: """ - ListAuditLogs retrieves a paginated list of audit logs for the specified - organization + Lists audit logs with filtering and pagination options. + + Use this method to: + + - View audit history + - Track user actions + - Monitor system changes + + ### Examples + + - List all logs: + + ```yaml + pagination: + pageSize: 20 + ``` + + - Filter by actor: + + ```yaml + filter: + actorIds: ["d2c94c27-3b76-4a42-b88c-95a85e392c68"] + actorPrincipals: ["PRINCIPAL_USER"] + pagination: + pageSize: 20 + ``` Args: pagination: pagination contains the pagination options for listing environments @@ -241,7 +305,23 @@ async def watch( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncJSONLDecoder[EventWatchResponse]: """ - WatchEvents streams all requests events to the client + Streams events for all projects, runners, environments, tasks, and services + based on the specified scope. + + Use this method to: + + - Monitor resource changes in real-time + - Track system events + - Receive notifications + + The scope parameter determines which events to watch: + + - Organization scope (default): Watch all organization-wide events including + projects, runners and environments. Task and service events are not included. + Use by setting organization=true or omitting the scope. + - Environment scope: Watch events for a specific environment, including its + tasks, task executions, and services. Use by setting environment_id to the + UUID of the environment to watch. Args: environment_id: Environment scope produces events for the environment itself, all tasks, task diff --git a/src/gitpod/resources/groups.py b/src/gitpod/resources/groups.py index 233e4b08..56c681f2 100644 --- a/src/gitpod/resources/groups.py +++ b/src/gitpod/resources/groups.py @@ -56,7 +56,35 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncGroupsPage[Group]: """ - ListGroups lists groups + Lists groups with optional pagination. + + Use this method to: + + - View all groups + - Check group memberships + - Monitor group configurations + - Audit group access + + ### Examples + + - List all groups: + + Shows all groups with pagination. + + ```yaml + pagination: + pageSize: 20 + ``` + + - List with custom page size: + + Shows groups with specified page size. + + ```yaml + pagination: + pageSize: 50 + token: "next-page-token-from-previous-response" + ``` Args: pagination: pagination contains the pagination options for listing groups @@ -125,7 +153,35 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[Group, AsyncGroupsPage[Group]]: """ - ListGroups lists groups + Lists groups with optional pagination. + + Use this method to: + + - View all groups + - Check group memberships + - Monitor group configurations + - Audit group access + + ### Examples + + - List all groups: + + Shows all groups with pagination. + + ```yaml + pagination: + pageSize: 20 + ``` + + - List with custom page size: + + Shows groups with specified page size. + + ```yaml + pagination: + pageSize: 50 + token: "next-page-token-from-previous-response" + ``` Args: pagination: pagination contains the pagination options for listing groups diff --git a/src/gitpod/resources/projects/policies.py b/src/gitpod/resources/projects/policies.py index ffac1625..5ca918c7 100644 --- a/src/gitpod/resources/projects/policies.py +++ b/src/gitpod/resources/projects/policies.py @@ -68,7 +68,25 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> PolicyCreateResponse: """ - CreateProjectPolicy creates a Project Policy. + Creates a new policy for a project. + + Use this method to: + + - Set up access controls + - Define group permissions + - Configure role-based access + + ### Examples + + - Create admin policy: + + Grants admin access to a group. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + groupId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + role: PROJECT_ROLE_ADMIN + ``` Args: group_id: group_id specifies the group_id identifier @@ -113,7 +131,25 @@ def update( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> PolicyUpdateResponse: """ - UpdateProjectPolicy updates a Project Policy. + Updates an existing project policy. + + Use this method to: + + - Modify access levels + - Change group roles + - Update permissions + + ### Examples + + - Update policy role: + + Changes a group's access level. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + groupId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + role: PROJECT_ROLE_EDITOR + ``` Args: group_id: group_id specifies the group_id identifier @@ -159,7 +195,25 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncPoliciesPage[ProjectPolicy]: """ - ListProjectPolicies lists policies for a project. + Lists policies for a project. + + Use this method to: + + - View access controls + - Check policy configurations + - Audit permissions + + ### Examples + + - List policies: + + Shows all policies for a project. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + pagination: + pageSize: 20 + ``` Args: pagination: pagination contains the pagination options for listing project policies @@ -214,7 +268,24 @@ def delete( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - DeleteProjectPolicy deletes a Project Policy. + Deletes a project policy. + + Use this method to: + + - Remove access controls + - Revoke permissions + - Clean up policies + + ### Examples + + - Delete policy: + + Removes a group's access policy. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + groupId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + ``` Args: group_id: group_id specifies the group_id identifier @@ -279,7 +350,25 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> PolicyCreateResponse: """ - CreateProjectPolicy creates a Project Policy. + Creates a new policy for a project. + + Use this method to: + + - Set up access controls + - Define group permissions + - Configure role-based access + + ### Examples + + - Create admin policy: + + Grants admin access to a group. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + groupId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + role: PROJECT_ROLE_ADMIN + ``` Args: group_id: group_id specifies the group_id identifier @@ -324,7 +413,25 @@ async def update( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> PolicyUpdateResponse: """ - UpdateProjectPolicy updates a Project Policy. + Updates an existing project policy. + + Use this method to: + + - Modify access levels + - Change group roles + - Update permissions + + ### Examples + + - Update policy role: + + Changes a group's access level. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + groupId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + role: PROJECT_ROLE_EDITOR + ``` Args: group_id: group_id specifies the group_id identifier @@ -370,7 +477,25 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[ProjectPolicy, AsyncPoliciesPage[ProjectPolicy]]: """ - ListProjectPolicies lists policies for a project. + Lists policies for a project. + + Use this method to: + + - View access controls + - Check policy configurations + - Audit permissions + + ### Examples + + - List policies: + + Shows all policies for a project. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + pagination: + pageSize: 20 + ``` Args: pagination: pagination contains the pagination options for listing project policies @@ -425,7 +550,24 @@ async def delete( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - DeleteProjectPolicy deletes a Project Policy. + Deletes a project policy. + + Use this method to: + + - Remove access controls + - Revoke permissions + - Clean up policies + + ### Examples + + - Delete policy: + + Removes a group's access policy. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + groupId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + ``` Args: group_id: group_id specifies the group_id identifier diff --git a/src/gitpod/resources/projects/projects.py b/src/gitpod/resources/projects/projects.py index b3cd1461..47ddd964 100644 --- a/src/gitpod/resources/projects/projects.py +++ b/src/gitpod/resources/projects/projects.py @@ -88,7 +88,46 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ProjectCreateResponse: """ - CreateProject creates a new Project. + Creates a new project with specified configuration. + + Use this method to: + + - Set up development projects + - Configure project environments + - Define project settings + - Initialize project content + + ### Examples + + - Create basic project: + + Creates a project with minimal configuration. + + ```yaml + name: "Web Application" + environmentClass: + environmentClassId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + initializer: + specs: + - git: + remoteUri: "https://github.com/org/repo" + ``` + + - Create project with devcontainer: + + Creates a project with custom development container. + + ```yaml + name: "Backend Service" + environmentClass: + environmentClassId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + initializer: + specs: + - git: + remoteUri: "https://github.com/org/backend" + devcontainerFilePath: ".devcontainer/devcontainer.json" + automationsFilePath: ".gitpod/automations.yaml" + ``` Args: initializer: EnvironmentInitializer specifies how an environment is to be initialized @@ -145,7 +184,23 @@ def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ProjectRetrieveResponse: """ - GetProject retrieves a single Project. + Gets details about a specific project. + + Use this method to: + + - View project configuration + - Check project status + - Get project metadata + + ### Examples + + - Get project details: + + Retrieves information about a specific project. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + ``` Args: project_id: project_id specifies the project identifier @@ -184,7 +239,35 @@ def update( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ProjectUpdateResponse: """ - UpdateProject updates the properties of a Project. + Updates a project's configuration. + + Use this method to: + + - Modify project settings + - Update environment class + - Change project name + - Configure initializers + + ### Examples + + - Update project name: + + Changes the project's display name. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + name: "New Project Name" + ``` + + - Update environment class: + + Changes the project's environment class. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + environmentClass: + environmentClassId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: automations_file_path: automations_file_path is the path to the automations file relative to the repo @@ -246,7 +329,24 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncProjectsPage[Project]: """ - ListProjects lists all projects the caller has access to. + Lists projects with optional filtering. + + Use this method to: + + - View all accessible projects + - Browse project configurations + - Monitor project status + + ### Examples + + - List projects: + + Shows all projects with pagination. + + ```yaml + pagination: + pageSize: 20 + ``` Args: pagination: pagination contains the pagination options for listing organizations @@ -292,7 +392,23 @@ def delete( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - DeleteProject deletes the specified project. + Deletes a project permanently. + + Use this method to: + + - Remove unused projects + - Clean up test projects + - Delete obsolete configurations + + ### Examples + + - Delete project: + + Permanently removes a project. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + ``` Args: project_id: project_id specifies the project identifier @@ -327,7 +443,24 @@ def create_from_environment( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ProjectCreateFromEnvironmentResponse: """ - CreateProject creates a new Project using an environment as template. + Creates a new project using an existing environment as a template. + + Use this method to: + + - Clone environment configurations + - Create projects from templates + - Share environment setups + + ### Examples + + - Create from environment: + + Creates a project based on existing environment. + + ```yaml + name: "Frontend Project" + environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + ``` Args: environment_id: environment_id specifies the environment identifier @@ -396,7 +529,46 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ProjectCreateResponse: """ - CreateProject creates a new Project. + Creates a new project with specified configuration. + + Use this method to: + + - Set up development projects + - Configure project environments + - Define project settings + - Initialize project content + + ### Examples + + - Create basic project: + + Creates a project with minimal configuration. + + ```yaml + name: "Web Application" + environmentClass: + environmentClassId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + initializer: + specs: + - git: + remoteUri: "https://github.com/org/repo" + ``` + + - Create project with devcontainer: + + Creates a project with custom development container. + + ```yaml + name: "Backend Service" + environmentClass: + environmentClassId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + initializer: + specs: + - git: + remoteUri: "https://github.com/org/backend" + devcontainerFilePath: ".devcontainer/devcontainer.json" + automationsFilePath: ".gitpod/automations.yaml" + ``` Args: initializer: EnvironmentInitializer specifies how an environment is to be initialized @@ -453,7 +625,23 @@ async def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ProjectRetrieveResponse: """ - GetProject retrieves a single Project. + Gets details about a specific project. + + Use this method to: + + - View project configuration + - Check project status + - Get project metadata + + ### Examples + + - Get project details: + + Retrieves information about a specific project. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + ``` Args: project_id: project_id specifies the project identifier @@ -492,7 +680,35 @@ async def update( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ProjectUpdateResponse: """ - UpdateProject updates the properties of a Project. + Updates a project's configuration. + + Use this method to: + + - Modify project settings + - Update environment class + - Change project name + - Configure initializers + + ### Examples + + - Update project name: + + Changes the project's display name. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + name: "New Project Name" + ``` + + - Update environment class: + + Changes the project's environment class. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + environmentClass: + environmentClassId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: automations_file_path: automations_file_path is the path to the automations file relative to the repo @@ -554,7 +770,24 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[Project, AsyncProjectsPage[Project]]: """ - ListProjects lists all projects the caller has access to. + Lists projects with optional filtering. + + Use this method to: + + - View all accessible projects + - Browse project configurations + - Monitor project status + + ### Examples + + - List projects: + + Shows all projects with pagination. + + ```yaml + pagination: + pageSize: 20 + ``` Args: pagination: pagination contains the pagination options for listing organizations @@ -600,7 +833,23 @@ async def delete( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - DeleteProject deletes the specified project. + Deletes a project permanently. + + Use this method to: + + - Remove unused projects + - Clean up test projects + - Delete obsolete configurations + + ### Examples + + - Delete project: + + Permanently removes a project. + + ```yaml + projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + ``` Args: project_id: project_id specifies the project identifier @@ -635,7 +884,24 @@ async def create_from_environment( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ProjectCreateFromEnvironmentResponse: """ - CreateProject creates a new Project using an environment as template. + Creates a new project using an existing environment as a template. + + Use this method to: + + - Clone environment configurations + - Create projects from templates + - Share environment setups + + ### Examples + + - Create from environment: + + Creates a project based on existing environment. + + ```yaml + name: "Frontend Project" + environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + ``` Args: environment_id: environment_id specifies the environment identifier diff --git a/src/gitpod/resources/runners/configurations/configurations.py b/src/gitpod/resources/runners/configurations/configurations.py index 135c7883..97459924 100644 --- a/src/gitpod/resources/runners/configurations/configurations.py +++ b/src/gitpod/resources/runners/configurations/configurations.py @@ -106,10 +106,30 @@ def validate( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ConfigurationValidateResponse: - """ValidateRunnerConfiguration validates a runner configuration (e.g. + """ + Validates a runner configuration. + + Use this method to: + + - Check configuration validity + - Verify integration settings + - Validate environment classes + + ### Examples + + - Validate SCM integration: + + Checks if an SCM integration is valid. - environment - class, SCM integration) with the runner. + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + scmIntegration: + id: "integration-id" + scmId: "github" + host: "github.com" + oauthClientId: "client_id" + oauthPlaintextClientSecret: "client_secret" + ``` Args: extra_headers: Send extra headers @@ -186,10 +206,30 @@ async def validate( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ConfigurationValidateResponse: - """ValidateRunnerConfiguration validates a runner configuration (e.g. + """ + Validates a runner configuration. + + Use this method to: + + - Check configuration validity + - Verify integration settings + - Validate environment classes + + ### Examples + + - Validate SCM integration: + + Checks if an SCM integration is valid. - environment - class, SCM integration) with the runner. + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + scmIntegration: + id: "integration-id" + scmId: "github" + host: "github.com" + oauthClientId: "client_id" + oauthPlaintextClientSecret: "client_secret" + ``` Args: extra_headers: Send extra headers diff --git a/src/gitpod/resources/runners/configurations/environment_classes.py b/src/gitpod/resources/runners/configurations/environment_classes.py index e790fe78..d9df2a5c 100644 --- a/src/gitpod/resources/runners/configurations/environment_classes.py +++ b/src/gitpod/resources/runners/configurations/environment_classes.py @@ -70,7 +70,30 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> EnvironmentClassCreateResponse: """ - CreateEnvironmentClass creates a new environment class on a runner. + Creates a new environment class for a runner. + + Use this method to: + + - Define compute resources + - Configure environment settings + - Set up runtime options + + ### Examples + + - Create environment class: + + Creates a new environment configuration. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + displayName: "Large Instance" + description: "8 CPU, 16GB RAM" + configuration: + - key: "cpu" + value: "8" + - key: "memory" + value: "16384" + ``` Args: extra_headers: Send extra headers @@ -110,7 +133,23 @@ def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> EnvironmentClassRetrieveResponse: """ - GetEnvironmentClass returns a single environment class configured for a runner. + Gets details about a specific environment class. + + Use this method to: + + - View class configuration + - Check resource settings + - Verify availability + + ### Examples + + - Get class details: + + Retrieves information about a specific class. + + ```yaml + environmentClassId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -148,7 +187,26 @@ def update( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - UpdateEnvironmentClass updates an existing environment class on a runner. + Updates an environment class. + + Use this method to: + + - Modify class settings + - Update resource limits + - Change availability + + ### Examples + + - Update class: + + Changes class configuration. + + ```yaml + environmentClassId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + displayName: "Updated Large Instance" + description: "16 CPU, 32GB RAM" + enabled: true + ``` Args: extra_headers: Send extra headers @@ -191,8 +249,37 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncEnvironmentClassesPage[EnvironmentClass]: """ - buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE ListEnvironmentClasses returns all - environment classes configured for a runner. + Lists environment classes with optional filtering. + + Use this method to: + + - View available classes + - Filter by capability + - Check enabled status + + ### Examples + + - List all classes: + + Shows all environment classes. + + ```yaml + pagination: + pageSize: 20 + ``` + + - Filter enabled classes: + + Lists only enabled environment classes. + + ```yaml + filter: + enabled: true + pagination: + pageSize: 20 + ``` + + buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE Args: pagination: pagination contains the pagination options for listing environment classes @@ -268,7 +355,30 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> EnvironmentClassCreateResponse: """ - CreateEnvironmentClass creates a new environment class on a runner. + Creates a new environment class for a runner. + + Use this method to: + + - Define compute resources + - Configure environment settings + - Set up runtime options + + ### Examples + + - Create environment class: + + Creates a new environment configuration. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + displayName: "Large Instance" + description: "8 CPU, 16GB RAM" + configuration: + - key: "cpu" + value: "8" + - key: "memory" + value: "16384" + ``` Args: extra_headers: Send extra headers @@ -308,7 +418,23 @@ async def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> EnvironmentClassRetrieveResponse: """ - GetEnvironmentClass returns a single environment class configured for a runner. + Gets details about a specific environment class. + + Use this method to: + + - View class configuration + - Check resource settings + - Verify availability + + ### Examples + + - Get class details: + + Retrieves information about a specific class. + + ```yaml + environmentClassId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -346,7 +472,26 @@ async def update( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - UpdateEnvironmentClass updates an existing environment class on a runner. + Updates an environment class. + + Use this method to: + + - Modify class settings + - Update resource limits + - Change availability + + ### Examples + + - Update class: + + Changes class configuration. + + ```yaml + environmentClassId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + displayName: "Updated Large Instance" + description: "16 CPU, 32GB RAM" + enabled: true + ``` Args: extra_headers: Send extra headers @@ -389,8 +534,37 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[EnvironmentClass, AsyncEnvironmentClassesPage[EnvironmentClass]]: """ - buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE ListEnvironmentClasses returns all - environment classes configured for a runner. + Lists environment classes with optional filtering. + + Use this method to: + + - View available classes + - Filter by capability + - Check enabled status + + ### Examples + + - List all classes: + + Shows all environment classes. + + ```yaml + pagination: + pageSize: 20 + ``` + + - Filter enabled classes: + + Lists only enabled environment classes. + + ```yaml + filter: + enabled: true + pagination: + pageSize: 20 + ``` + + buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE Args: pagination: pagination contains the pagination options for listing environment classes diff --git a/src/gitpod/resources/runners/configurations/host_authentication_tokens.py b/src/gitpod/resources/runners/configurations/host_authentication_tokens.py index 4f49af81..0b8c5855 100644 --- a/src/gitpod/resources/runners/configurations/host_authentication_tokens.py +++ b/src/gitpod/resources/runners/configurations/host_authentication_tokens.py @@ -80,7 +80,29 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> HostAuthenticationTokenCreateResponse: """ - CreateHostAuthenticationToken + Creates a new authentication token for accessing remote hosts. + + Use this method to: + + - Set up SCM authentication + - Configure OAuth credentials + - Manage PAT tokens + + ### Examples + + - Create OAuth token: + + Creates a new OAuth-based authentication token. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + userId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + host: "github.com" + token: "gho_xxxxxxxxxxxx" + source: HOST_AUTHENTICATION_TOKEN_SOURCE_OAUTH + expiresAt: "2024-12-31T23:59:59Z" + refreshToken: "ghr_xxxxxxxxxxxx" + ``` Args: expires_at: A Timestamp represents a point in time independent of any time zone or local @@ -212,7 +234,23 @@ def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> HostAuthenticationTokenRetrieveResponse: """ - GetHostAuthenticationToken + Gets details about a specific host authentication token. + + Use this method to: + + - View token information + - Check token expiration + - Verify token validity + + ### Examples + + - Get token details: + + Retrieves information about a specific token. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -249,7 +287,26 @@ def update( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - UpdateHostAuthenticationToken + Updates an existing host authentication token. + + Use this method to: + + - Refresh token values + - Update expiration + - Modify token settings + + ### Examples + + - Update token: + + Updates token value and expiration. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + token: "gho_xxxxxxxxxxxx" + expiresAt: "2024-12-31T23:59:59Z" + refreshToken: "ghr_xxxxxxxxxxxx" + ``` Args: expires_at: A Timestamp represents a point in time independent of any time zone or local @@ -381,7 +438,35 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncTokensPage[HostAuthenticationToken]: """ - ListHostAuthenticationTokens + Lists host authentication tokens with optional filtering. + + Use this method to: + + - View all tokens + - Filter by runner or user + - Monitor token status + + ### Examples + + - List all tokens: + + Shows all tokens with pagination. + + ```yaml + pagination: + pageSize: 20 + ``` + + - Filter by runner: + + Lists tokens for a specific runner. + + ```yaml + filter: + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + pagination: + pageSize: 20 + ``` Args: extra_headers: Send extra headers @@ -431,7 +516,23 @@ def delete( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - DeleteHostAuthenticationToken + Deletes a host authentication token. + + Use this method to: + + - Remove unused tokens + - Revoke access + - Clean up expired tokens + + ### Examples + + - Delete token: + + Permanently removes a token. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -492,7 +593,29 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> HostAuthenticationTokenCreateResponse: """ - CreateHostAuthenticationToken + Creates a new authentication token for accessing remote hosts. + + Use this method to: + + - Set up SCM authentication + - Configure OAuth credentials + - Manage PAT tokens + + ### Examples + + - Create OAuth token: + + Creates a new OAuth-based authentication token. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + userId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + host: "github.com" + token: "gho_xxxxxxxxxxxx" + source: HOST_AUTHENTICATION_TOKEN_SOURCE_OAUTH + expiresAt: "2024-12-31T23:59:59Z" + refreshToken: "ghr_xxxxxxxxxxxx" + ``` Args: expires_at: A Timestamp represents a point in time independent of any time zone or local @@ -624,7 +747,23 @@ async def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> HostAuthenticationTokenRetrieveResponse: """ - GetHostAuthenticationToken + Gets details about a specific host authentication token. + + Use this method to: + + - View token information + - Check token expiration + - Verify token validity + + ### Examples + + - Get token details: + + Retrieves information about a specific token. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -661,7 +800,26 @@ async def update( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - UpdateHostAuthenticationToken + Updates an existing host authentication token. + + Use this method to: + + - Refresh token values + - Update expiration + - Modify token settings + + ### Examples + + - Update token: + + Updates token value and expiration. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + token: "gho_xxxxxxxxxxxx" + expiresAt: "2024-12-31T23:59:59Z" + refreshToken: "ghr_xxxxxxxxxxxx" + ``` Args: expires_at: A Timestamp represents a point in time independent of any time zone or local @@ -793,7 +951,35 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[HostAuthenticationToken, AsyncTokensPage[HostAuthenticationToken]]: """ - ListHostAuthenticationTokens + Lists host authentication tokens with optional filtering. + + Use this method to: + + - View all tokens + - Filter by runner or user + - Monitor token status + + ### Examples + + - List all tokens: + + Shows all tokens with pagination. + + ```yaml + pagination: + pageSize: 20 + ``` + + - Filter by runner: + + Lists tokens for a specific runner. + + ```yaml + filter: + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + pagination: + pageSize: 20 + ``` Args: extra_headers: Send extra headers @@ -843,7 +1029,23 @@ async def delete( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - DeleteHostAuthenticationToken + Deletes a host authentication token. + + Use this method to: + + - Remove unused tokens + - Revoke access + - Clean up expired tokens + + ### Examples + + - Delete token: + + Permanently removes a token. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers diff --git a/src/gitpod/resources/runners/configurations/schema.py b/src/gitpod/resources/runners/configurations/schema.py index 4d3f3e5e..e15565ac 100644 --- a/src/gitpod/resources/runners/configurations/schema.py +++ b/src/gitpod/resources/runners/configurations/schema.py @@ -56,7 +56,23 @@ def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SchemaRetrieveResponse: """ - GetRunnerConfigurationSchema retrieves the latest Runner configuration schema + Gets the latest runner configuration schema. + + Use this method to: + + - View available settings + - Check configuration options + - Validate configurations + + ### Examples + + - Get schema: + + Retrieves configuration schema for a runner. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -109,7 +125,23 @@ async def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SchemaRetrieveResponse: """ - GetRunnerConfigurationSchema retrieves the latest Runner configuration schema + Gets the latest runner configuration schema. + + Use this method to: + + - View available settings + - Check configuration options + - Validate configurations + + ### Examples + + - Get schema: + + Retrieves configuration schema for a runner. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers diff --git a/src/gitpod/resources/runners/configurations/scm_integrations.py b/src/gitpod/resources/runners/configurations/scm_integrations.py index 97aa2608..0ce580d9 100644 --- a/src/gitpod/resources/runners/configurations/scm_integrations.py +++ b/src/gitpod/resources/runners/configurations/scm_integrations.py @@ -72,7 +72,27 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ScmIntegrationCreateResponse: """ - CreateSCMIntegration creates a new SCM integration on a runner. + Creates a new SCM integration for a runner. + + Use this method to: + + - Configure source control access + - Set up repository integrations + - Enable code synchronization + + ### Examples + + - Create GitHub integration: + + Sets up GitHub SCM integration. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + scmId: "github" + host: "github.com" + oauthClientId: "client_id" + oauthPlaintextClientSecret: "client_secret" + ``` Args: oauth_client_id: oauth_client_id is the OAuth app's client ID, if OAuth is configured. If @@ -123,7 +143,23 @@ def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ScmIntegrationRetrieveResponse: """ - GetSCMIntegration returns a single SCM integration configured for a runner. + Gets details about a specific SCM integration. + + Use this method to: + + - View integration settings + - Check integration status + - Verify configuration + + ### Examples + + - Get integration details: + + Retrieves information about a specific integration. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -158,7 +194,25 @@ def update( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - UpdateSCMIntegration updates an existing SCM integration on a runner. + Updates an existing SCM integration. + + Use this method to: + + - Modify integration settings + - Update credentials + - Change configuration + + ### Examples + + - Update integration: + + Updates OAuth credentials. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + oauthClientId: "new_client_id" + oauthPlaintextClientSecret: "new_client_secret" + ``` Args: oauth_client_id: oauth_client_id can be set to update the OAuth app's client ID. If an empty @@ -218,7 +272,26 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncIntegrationsPage[ScmIntegration]: """ - ListSCMIntegrations returns all SCM integrations configured for a runner. + Lists SCM integrations for a runner. + + Use this method to: + + - View all integrations + - Monitor integration status + - Check available SCMs + + ### Examples + + - List integrations: + + Shows all SCM integrations. + + ```yaml + filter: + runnerIds: ["d2c94c27-3b76-4a42-b88c-95a85e392c68"] + pagination: + pageSize: 20 + ``` Args: pagination: pagination contains the pagination options for listing scm integrations @@ -270,7 +343,23 @@ def delete( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - DeleteSCMIntegration deletes an existing SCM integration on a runner. + Deletes an SCM integration. + + Use this method to: + + - Remove unused integrations + - Clean up configurations + - Revoke SCM access + + ### Examples + + - Delete integration: + + Removes an SCM integration. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -328,7 +417,27 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ScmIntegrationCreateResponse: """ - CreateSCMIntegration creates a new SCM integration on a runner. + Creates a new SCM integration for a runner. + + Use this method to: + + - Configure source control access + - Set up repository integrations + - Enable code synchronization + + ### Examples + + - Create GitHub integration: + + Sets up GitHub SCM integration. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + scmId: "github" + host: "github.com" + oauthClientId: "client_id" + oauthPlaintextClientSecret: "client_secret" + ``` Args: oauth_client_id: oauth_client_id is the OAuth app's client ID, if OAuth is configured. If @@ -379,7 +488,23 @@ async def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ScmIntegrationRetrieveResponse: """ - GetSCMIntegration returns a single SCM integration configured for a runner. + Gets details about a specific SCM integration. + + Use this method to: + + - View integration settings + - Check integration status + - Verify configuration + + ### Examples + + - Get integration details: + + Retrieves information about a specific integration. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -414,7 +539,25 @@ async def update( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - UpdateSCMIntegration updates an existing SCM integration on a runner. + Updates an existing SCM integration. + + Use this method to: + + - Modify integration settings + - Update credentials + - Change configuration + + ### Examples + + - Update integration: + + Updates OAuth credentials. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + oauthClientId: "new_client_id" + oauthPlaintextClientSecret: "new_client_secret" + ``` Args: oauth_client_id: oauth_client_id can be set to update the OAuth app's client ID. If an empty @@ -474,7 +617,26 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[ScmIntegration, AsyncIntegrationsPage[ScmIntegration]]: """ - ListSCMIntegrations returns all SCM integrations configured for a runner. + Lists SCM integrations for a runner. + + Use this method to: + + - View all integrations + - Monitor integration status + - Check available SCMs + + ### Examples + + - List integrations: + + Shows all SCM integrations. + + ```yaml + filter: + runnerIds: ["d2c94c27-3b76-4a42-b88c-95a85e392c68"] + pagination: + pageSize: 20 + ``` Args: pagination: pagination contains the pagination options for listing scm integrations @@ -526,7 +688,23 @@ async def delete( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - DeleteSCMIntegration deletes an existing SCM integration on a runner. + Deletes an SCM integration. + + Use this method to: + + - Remove unused integrations + - Clean up configurations + - Revoke SCM access + + ### Examples + + - Delete integration: + + Removes an SCM integration. + + ```yaml + id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers diff --git a/src/gitpod/resources/runners/policies.py b/src/gitpod/resources/runners/policies.py index 09de7ed1..5bc9d25b 100644 --- a/src/gitpod/resources/runners/policies.py +++ b/src/gitpod/resources/runners/policies.py @@ -68,7 +68,25 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> PolicyCreateResponse: """ - CreateRunnerPolicy creates a new runner policy. + Creates a new policy for a runner. + + Use this method to: + + - Set up access controls + - Define group permissions + - Configure role-based access + + ### Examples + + - Create admin policy: + + Grants admin access to a group. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + groupId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + role: RUNNER_ROLE_ADMIN + ``` Args: group_id: group_id specifies the group_id identifier @@ -113,7 +131,25 @@ def update( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> PolicyUpdateResponse: """ - UpdateRunnerPolicy an existing runner policy. + Updates an existing runner policy. + + Use this method to: + + - Modify access levels + - Change group roles + - Update permissions + + ### Examples + + - Update policy role: + + Changes a group's access level. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + groupId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + role: RUNNER_ROLE_USER + ``` Args: group_id: group_id specifies the group_id identifier @@ -159,7 +195,25 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncPoliciesPage[RunnerPolicy]: """ - ListRunnerPolicies lists runner policies. + Lists policies for a runner. + + Use this method to: + + - View access controls + - Check policy configurations + - Audit permissions + + ### Examples + + - List policies: + + Shows all policies for a runner. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + pagination: + pageSize: 20 + ``` Args: pagination: pagination contains the pagination options for listing project policies @@ -214,7 +268,24 @@ def delete( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - DeleteRunnerPolicy deletes a runner policy. + Deletes a runner policy. + + Use this method to: + + - Remove access controls + - Revoke permissions + - Clean up policies + + ### Examples + + - Delete policy: + + Removes a group's access policy. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + groupId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + ``` Args: group_id: group_id specifies the group_id identifier @@ -279,7 +350,25 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> PolicyCreateResponse: """ - CreateRunnerPolicy creates a new runner policy. + Creates a new policy for a runner. + + Use this method to: + + - Set up access controls + - Define group permissions + - Configure role-based access + + ### Examples + + - Create admin policy: + + Grants admin access to a group. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + groupId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + role: RUNNER_ROLE_ADMIN + ``` Args: group_id: group_id specifies the group_id identifier @@ -324,7 +413,25 @@ async def update( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> PolicyUpdateResponse: """ - UpdateRunnerPolicy an existing runner policy. + Updates an existing runner policy. + + Use this method to: + + - Modify access levels + - Change group roles + - Update permissions + + ### Examples + + - Update policy role: + + Changes a group's access level. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + groupId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + role: RUNNER_ROLE_USER + ``` Args: group_id: group_id specifies the group_id identifier @@ -370,7 +477,25 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[RunnerPolicy, AsyncPoliciesPage[RunnerPolicy]]: """ - ListRunnerPolicies lists runner policies. + Lists policies for a runner. + + Use this method to: + + - View access controls + - Check policy configurations + - Audit permissions + + ### Examples + + - List policies: + + Shows all policies for a runner. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + pagination: + pageSize: 20 + ``` Args: pagination: pagination contains the pagination options for listing project policies @@ -425,7 +550,24 @@ async def delete( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - DeleteRunnerPolicy deletes a runner policy. + Deletes a runner policy. + + Use this method to: + + - Remove access controls + - Revoke permissions + - Clean up policies + + ### Examples + + - Delete policy: + + Removes a group's access policy. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + groupId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + ``` Args: group_id: group_id specifies the group_id identifier diff --git a/src/gitpod/resources/runners/runners.py b/src/gitpod/resources/runners/runners.py index 66fc4e7a..2b4b2219 100644 --- a/src/gitpod/resources/runners/runners.py +++ b/src/gitpod/resources/runners/runners.py @@ -104,11 +104,48 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RunnerCreateResponse: - """CreateRunner creates a new runner with the server. + """Creates a new runner registration with the server. Registrations are very - short-lived and must be renewed every 30 seconds. Runners can be registered for - an entire organisation or a single user. + short-lived and must be renewed every 30 seconds. + + Use this method to: + + - Register organization runners + - Set up runner configurations + - Initialize runner credentials + - Configure auto-updates + + ### Examples + + - Create cloud runner: + + Creates a new runner in AWS EC2. + + ```yaml + name: "Production Runner" + provider: RUNNER_PROVIDER_AWS_EC2 + spec: + desiredPhase: RUNNER_PHASE_ACTIVE + configuration: + region: "us-west" + releaseChannel: RUNNER_RELEASE_CHANNEL_STABLE + autoUpdate: true + ``` + + - Create local runner: + + Creates a new local runner on Linux. + + ```yaml + name: "Local Development Runner" + provider: RUNNER_PROVIDER_LINUX_HOST + spec: + desiredPhase: RUNNER_PHASE_ACTIVE + configuration: + releaseChannel: RUNNER_RELEASE_CHANNEL_LATEST + autoUpdate: true + ``` Args: kind: RunnerKind represents the kind of a runner @@ -156,7 +193,24 @@ def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RunnerRetrieveResponse: """ - GetRunner returns a single runner. + Gets details about a specific runner. + + Use this method to: + + - Check runner status + - View runner configuration + - Monitor runner health + - Verify runner capabilities + + ### Examples + + - Get runner details: + + Retrieves information about a specific runner. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -190,7 +244,29 @@ def update( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - UpdateRunner updates an environment runner. + Updates a runner's configuration. + + Use this method to: + + - Modify runner settings + - Update release channels + - Change runner status + - Configure auto-update settings + + ### Examples + + - Update configuration: + + Changes runner settings. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + name: "Updated Runner Name" + spec: + configuration: + releaseChannel: RUNNER_RELEASE_CHANNEL_LATEST + autoUpdate: true + ``` Args: name: The runner's name which is shown to users @@ -238,7 +314,36 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncRunnersPage[Runner]: """ - ListRunners returns all runners registered in the scope. + Lists all registered runners with optional filtering. + + Use this method to: + + - View all available runners + - Filter by runner type + - Monitor runner status + - Check runner availability + + ### Examples + + - List all runners: + + Shows all runners with pagination. + + ```yaml + pagination: + pageSize: 20 + ``` + + - Filter by provider: + + Lists only AWS EC2 runners. + + ```yaml + filter: + providers: ["RUNNER_PROVIDER_AWS_EC2"] + pagination: + pageSize: 20 + ``` Args: pagination: pagination contains the pagination options for listing runners @@ -291,7 +396,23 @@ def delete( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - DeleteRunner deletes an environment runner. + Deletes a runner permanently. + + Use this method to: + + - Remove unused runners + - Clean up runner registrations + - Delete obsolete runners + + ### Examples + + - Delete runner: + + Permanently removes a runner. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: force: force indicates whether the runner should be deleted forcefully. When force @@ -335,10 +456,23 @@ def check_authentication_for_host( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RunnerCheckAuthenticationForHostResponse: """ - CheckAuthenticationForHost asks a runner if the user is authenticated against a - particular host, e.g. an SCM system. If not, this function will return a URL - that the user should visit to authenticate, or indicate that Personal Access - Tokens are supported. + Checks if a user is authenticated for a specific host. + + Use this method to: + + - Verify authentication status + - Get authentication URLs + - Check PAT support + + ### Examples + + - Check authentication: + + Verifies authentication for a host. + + ```yaml + host: "github.com" + ``` Args: extra_headers: Send extra headers @@ -375,11 +509,26 @@ def create_runner_token( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RunnerCreateRunnerTokenResponse: - """CreateRunnerToken returns a token that can be used to authenticate as the - runner. + """ + Creates a new authentication token for a runner. + + Use this method to: + + - Generate runner credentials + - Renew expired tokens + - Set up runner authentication + + Note: This does not expire previously issued tokens. + + ### Examples + + - Create token: + + Creates a new token for runner authentication. - Use this call to renew an outdated token - this does not expire any - previously issued tokens. + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -414,18 +563,30 @@ def parse_context_url( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RunnerParseContextURLResponse: """ - ParseContextURL asks a runner to parse a context URL, and return the parsed - result. + Parses a context URL and returns the parsed result. + + Use this method to: + + - Validate context URLs + - Check repository access + - Verify branch existence + + Returns: + + - FAILED_PRECONDITION if authentication is required + - PERMISSION_DENIED if access is not allowed + - INVALID_ARGUMENT if URL is invalid + - NOT_FOUND if repository/branch doesn't exist + + ### Examples + + - Parse URL: - This call returns + Parses and validates a context URL. - - FAILED_PRECONDITION if the user requires authentication on the runner to - access the context URL - - PERMISSION_DENIED if the user is not allowed to access the context URL using - the credentials they have - - INVALID_ARGUMENT if the context URL is invalid - - NOT_FOUND if the repository or branch indicated by the context URL does not - exist + ```yaml + contextUrl: "https://github.com/org/repo/tree/main" + ``` Args: extra_headers: Send extra headers @@ -494,11 +655,48 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RunnerCreateResponse: - """CreateRunner creates a new runner with the server. + """Creates a new runner registration with the server. Registrations are very - short-lived and must be renewed every 30 seconds. Runners can be registered for - an entire organisation or a single user. + short-lived and must be renewed every 30 seconds. + + Use this method to: + + - Register organization runners + - Set up runner configurations + - Initialize runner credentials + - Configure auto-updates + + ### Examples + + - Create cloud runner: + + Creates a new runner in AWS EC2. + + ```yaml + name: "Production Runner" + provider: RUNNER_PROVIDER_AWS_EC2 + spec: + desiredPhase: RUNNER_PHASE_ACTIVE + configuration: + region: "us-west" + releaseChannel: RUNNER_RELEASE_CHANNEL_STABLE + autoUpdate: true + ``` + + - Create local runner: + + Creates a new local runner on Linux. + + ```yaml + name: "Local Development Runner" + provider: RUNNER_PROVIDER_LINUX_HOST + spec: + desiredPhase: RUNNER_PHASE_ACTIVE + configuration: + releaseChannel: RUNNER_RELEASE_CHANNEL_LATEST + autoUpdate: true + ``` Args: kind: RunnerKind represents the kind of a runner @@ -546,7 +744,24 @@ async def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RunnerRetrieveResponse: """ - GetRunner returns a single runner. + Gets details about a specific runner. + + Use this method to: + + - Check runner status + - View runner configuration + - Monitor runner health + - Verify runner capabilities + + ### Examples + + - Get runner details: + + Retrieves information about a specific runner. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -580,7 +795,29 @@ async def update( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - UpdateRunner updates an environment runner. + Updates a runner's configuration. + + Use this method to: + + - Modify runner settings + - Update release channels + - Change runner status + - Configure auto-update settings + + ### Examples + + - Update configuration: + + Changes runner settings. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + name: "Updated Runner Name" + spec: + configuration: + releaseChannel: RUNNER_RELEASE_CHANNEL_LATEST + autoUpdate: true + ``` Args: name: The runner's name which is shown to users @@ -628,7 +865,36 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[Runner, AsyncRunnersPage[Runner]]: """ - ListRunners returns all runners registered in the scope. + Lists all registered runners with optional filtering. + + Use this method to: + + - View all available runners + - Filter by runner type + - Monitor runner status + - Check runner availability + + ### Examples + + - List all runners: + + Shows all runners with pagination. + + ```yaml + pagination: + pageSize: 20 + ``` + + - Filter by provider: + + Lists only AWS EC2 runners. + + ```yaml + filter: + providers: ["RUNNER_PROVIDER_AWS_EC2"] + pagination: + pageSize: 20 + ``` Args: pagination: pagination contains the pagination options for listing runners @@ -681,7 +947,23 @@ async def delete( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> object: """ - DeleteRunner deletes an environment runner. + Deletes a runner permanently. + + Use this method to: + + - Remove unused runners + - Clean up runner registrations + - Delete obsolete runners + + ### Examples + + - Delete runner: + + Permanently removes a runner. + + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: force: force indicates whether the runner should be deleted forcefully. When force @@ -725,10 +1007,23 @@ async def check_authentication_for_host( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RunnerCheckAuthenticationForHostResponse: """ - CheckAuthenticationForHost asks a runner if the user is authenticated against a - particular host, e.g. an SCM system. If not, this function will return a URL - that the user should visit to authenticate, or indicate that Personal Access - Tokens are supported. + Checks if a user is authenticated for a specific host. + + Use this method to: + + - Verify authentication status + - Get authentication URLs + - Check PAT support + + ### Examples + + - Check authentication: + + Verifies authentication for a host. + + ```yaml + host: "github.com" + ``` Args: extra_headers: Send extra headers @@ -765,11 +1060,26 @@ async def create_runner_token( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RunnerCreateRunnerTokenResponse: - """CreateRunnerToken returns a token that can be used to authenticate as the - runner. + """ + Creates a new authentication token for a runner. + + Use this method to: + + - Generate runner credentials + - Renew expired tokens + - Set up runner authentication + + Note: This does not expire previously issued tokens. + + ### Examples + + - Create token: + + Creates a new token for runner authentication. - Use this call to renew an outdated token - this does not expire any - previously issued tokens. + ```yaml + runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + ``` Args: extra_headers: Send extra headers @@ -804,18 +1114,30 @@ async def parse_context_url( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RunnerParseContextURLResponse: """ - ParseContextURL asks a runner to parse a context URL, and return the parsed - result. + Parses a context URL and returns the parsed result. + + Use this method to: + + - Validate context URLs + - Check repository access + - Verify branch existence + + Returns: + + - FAILED_PRECONDITION if authentication is required + - PERMISSION_DENIED if access is not allowed + - INVALID_ARGUMENT if URL is invalid + - NOT_FOUND if repository/branch doesn't exist + + ### Examples + + - Parse URL: - This call returns + Parses and validates a context URL. - - FAILED_PRECONDITION if the user requires authentication on the runner to - access the context URL - - PERMISSION_DENIED if the user is not allowed to access the context URL using - the credentials they have - - INVALID_ARGUMENT if the context URL is invalid - - NOT_FOUND if the repository or branch indicated by the context URL does not - exist + ```yaml + contextUrl: "https://github.com/org/repo/tree/main" + ``` Args: extra_headers: Send extra headers diff --git a/tests/api_resources/projects/test_policies.py b/tests/api_resources/projects/test_policies.py index cf0a4f4f..fdd40b73 100644 --- a/tests/api_resources/projects/test_policies.py +++ b/tests/api_resources/projects/test_policies.py @@ -32,8 +32,8 @@ def test_method_create(self, client: Gitpod) -> None: @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: policy = client.projects.policies.create( - group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + group_id="f53d2330-3795-4c5d-a1f3-453121af9c60", + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", role="PROJECT_ROLE_UNSPECIFIED", ) assert_matches_type(PolicyCreateResponse, policy, path=["response"]) @@ -70,8 +70,8 @@ def test_method_update(self, client: Gitpod) -> None: @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: policy = client.projects.policies.update( - group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + group_id="f53d2330-3795-4c5d-a1f3-453121af9c60", + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", role="PROJECT_ROLE_UNSPECIFIED", ) assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) @@ -112,9 +112,9 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: page_size=0, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, - project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert_matches_type(SyncPoliciesPage[ProjectPolicy], policy, path=["response"]) @@ -150,8 +150,8 @@ def test_method_delete(self, client: Gitpod) -> None: @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: policy = client.projects.policies.delete( - group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + group_id="f53d2330-3795-4c5d-a1f3-453121af9c60", + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert_matches_type(object, policy, path=["response"]) @@ -191,8 +191,8 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.create( - group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + group_id="f53d2330-3795-4c5d-a1f3-453121af9c60", + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", role="PROJECT_ROLE_UNSPECIFIED", ) assert_matches_type(PolicyCreateResponse, policy, path=["response"]) @@ -229,8 +229,8 @@ async def test_method_update(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.update( - group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + group_id="f53d2330-3795-4c5d-a1f3-453121af9c60", + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", role="PROJECT_ROLE_UNSPECIFIED", ) assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) @@ -271,9 +271,9 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N page_size=0, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, - project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert_matches_type(AsyncPoliciesPage[ProjectPolicy], policy, path=["response"]) @@ -309,8 +309,8 @@ async def test_method_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.projects.policies.delete( - group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + group_id="f53d2330-3795-4c5d-a1f3-453121af9c60", + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert_matches_type(object, policy, path=["response"]) diff --git a/tests/api_resources/runners/configurations/test_environment_classes.py b/tests/api_resources/runners/configurations/test_environment_classes.py index 0c47b397..1668612b 100644 --- a/tests/api_resources/runners/configurations/test_environment_classes.py +++ b/tests/api_resources/runners/configurations/test_environment_classes.py @@ -34,13 +34,17 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.create( configuration=[ { - "key": "key", - "value": "value", - } + "key": "cpu", + "value": "8", + }, + { + "key": "memory", + "value": "16384", + }, ], - description="xxx", - display_name="xxx", - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + description="8 CPU, 16GB RAM", + display_name="Large Instance", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) @@ -76,7 +80,7 @@ def test_method_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.retrieve( - environment_class_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + environment_class_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) @@ -112,10 +116,10 @@ def test_method_update(self, client: Gitpod) -> None: @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: environment_class = client.runners.configurations.environment_classes.update( - description="xxx", - display_name="xxx", + description="16 CPU, 32GB RAM", + display_name="Updated Large Instance", enabled=True, - environment_class_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + environment_class_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(object, environment_class, path=["response"]) @@ -162,7 +166,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: }, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(SyncEnvironmentClassesPage[EnvironmentClass], environment_class, path=["response"]) @@ -205,13 +209,17 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> environment_class = await async_client.runners.configurations.environment_classes.create( configuration=[ { - "key": "key", - "value": "value", - } + "key": "cpu", + "value": "8", + }, + { + "key": "memory", + "value": "16384", + }, ], - description="xxx", - display_name="xxx", - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + description="8 CPU, 16GB RAM", + display_name="Large Instance", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(EnvironmentClassCreateResponse, environment_class, path=["response"]) @@ -247,7 +255,7 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.retrieve( - environment_class_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + environment_class_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(EnvironmentClassRetrieveResponse, environment_class, path=["response"]) @@ -285,10 +293,10 @@ async def test_method_update(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: environment_class = await async_client.runners.configurations.environment_classes.update( - description="xxx", - display_name="xxx", + description="16 CPU, 32GB RAM", + display_name="Updated Large Instance", enabled=True, - environment_class_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + environment_class_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(object, environment_class, path=["response"]) @@ -335,7 +343,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N }, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(AsyncEnvironmentClassesPage[EnvironmentClass], environment_class, path=["response"]) diff --git a/tests/api_resources/runners/configurations/test_host_authentication_tokens.py b/tests/api_resources/runners/configurations/test_host_authentication_tokens.py index 27694ae4..684e0f4d 100644 --- a/tests/api_resources/runners/configurations/test_host_authentication_tokens.py +++ b/tests/api_resources/runners/configurations/test_host_authentication_tokens.py @@ -33,13 +33,13 @@ def test_method_create(self, client: Gitpod) -> None: @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.create( - token="x", - expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), - host="x", - refresh_token="refreshToken", - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + token="gho_xxxxxxxxxxxx", + expires_at=parse_datetime("2024-12-31T23:59:59Z"), + host="github.com", + refresh_token="ghr_xxxxxxxxxxxx", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", source="HOST_AUTHENTICATION_TOKEN_SOURCE_UNSPECIFIED", - user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + user_id="f53d2330-3795-4c5d-a1f3-453121af9c60", ) assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) @@ -75,7 +75,7 @@ def test_method_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.retrieve( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) @@ -111,10 +111,10 @@ def test_method_update(self, client: Gitpod) -> None: @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.update( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - token="x", - expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), - refresh_token="refreshToken", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + token="gho_xxxxxxxxxxxx", + expires_at=parse_datetime("2024-12-31T23:59:59Z"), + refresh_token="ghr_xxxxxxxxxxxx", ) assert_matches_type(object, host_authentication_token, path=["response"]) @@ -153,12 +153,12 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: token="token", page_size=0, filter={ - "runner_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "runner_id": "d2c94c27-3b76-4a42-b88c-95a85e392c68", "user_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", }, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(SyncTokensPage[HostAuthenticationToken], host_authentication_token, path=["response"]) @@ -195,7 +195,7 @@ def test_method_delete(self, client: Gitpod) -> None: @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: host_authentication_token = client.runners.configurations.host_authentication_tokens.delete( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(object, host_authentication_token, path=["response"]) @@ -235,13 +235,13 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.create( - token="x", - expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), - host="x", - refresh_token="refreshToken", - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + token="gho_xxxxxxxxxxxx", + expires_at=parse_datetime("2024-12-31T23:59:59Z"), + host="github.com", + refresh_token="ghr_xxxxxxxxxxxx", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", source="HOST_AUTHENTICATION_TOKEN_SOURCE_UNSPECIFIED", - user_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + user_id="f53d2330-3795-4c5d-a1f3-453121af9c60", ) assert_matches_type(HostAuthenticationTokenCreateResponse, host_authentication_token, path=["response"]) @@ -279,7 +279,7 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.retrieve( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(HostAuthenticationTokenRetrieveResponse, host_authentication_token, path=["response"]) @@ -317,10 +317,10 @@ async def test_method_update(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.update( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - token="x", - expires_at=parse_datetime("2019-12-27T18:11:19.117Z"), - refresh_token="refreshToken", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + token="gho_xxxxxxxxxxxx", + expires_at=parse_datetime("2024-12-31T23:59:59Z"), + refresh_token="ghr_xxxxxxxxxxxx", ) assert_matches_type(object, host_authentication_token, path=["response"]) @@ -361,12 +361,12 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N token="token", page_size=0, filter={ - "runner_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "runner_id": "d2c94c27-3b76-4a42-b88c-95a85e392c68", "user_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", }, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(AsyncTokensPage[HostAuthenticationToken], host_authentication_token, path=["response"]) @@ -405,7 +405,7 @@ async def test_method_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: host_authentication_token = await async_client.runners.configurations.host_authentication_tokens.delete( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(object, host_authentication_token, path=["response"]) diff --git a/tests/api_resources/runners/configurations/test_schema.py b/tests/api_resources/runners/configurations/test_schema.py index 3fce8e32..9d507253 100644 --- a/tests/api_resources/runners/configurations/test_schema.py +++ b/tests/api_resources/runners/configurations/test_schema.py @@ -27,7 +27,7 @@ def test_method_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: schema = client.runners.configurations.schema.retrieve( - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) @@ -67,7 +67,7 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: schema = await async_client.runners.configurations.schema.retrieve( - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(SchemaRetrieveResponse, schema, path=["response"]) diff --git a/tests/api_resources/runners/configurations/test_scm_integrations.py b/tests/api_resources/runners/configurations/test_scm_integrations.py index 41ee4a5f..a3c76eb7 100644 --- a/tests/api_resources/runners/configurations/test_scm_integrations.py +++ b/tests/api_resources/runners/configurations/test_scm_integrations.py @@ -32,12 +32,12 @@ def test_method_create(self, client: Gitpod) -> None: @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.create( - host="host", - oauth_client_id="oauthClientId", - oauth_plaintext_client_secret="oauthPlaintextClientSecret", + host="github.com", + oauth_client_id="client_id", + oauth_plaintext_client_secret="client_secret", pat=True, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - scm_id="scmId", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + scm_id="github", ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) @@ -73,7 +73,7 @@ def test_method_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.retrieve( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) @@ -109,9 +109,9 @@ def test_method_update(self, client: Gitpod) -> None: @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.update( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - oauth_client_id="oauthClientId", - oauth_plaintext_client_secret="oauthPlaintextClientSecret", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + oauth_client_id="new_client_id", + oauth_plaintext_client_secret="new_client_secret", pat=True, ) assert_matches_type(object, scm_integration, path=["response"]) @@ -150,10 +150,10 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.list( token="token", page_size=0, - filter={"runner_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}, + filter={"runner_ids": ["d2c94c27-3b76-4a42-b88c-95a85e392c68"]}, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(SyncIntegrationsPage[ScmIntegration], scm_integration, path=["response"]) @@ -190,7 +190,7 @@ def test_method_delete(self, client: Gitpod) -> None: @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: scm_integration = client.runners.configurations.scm_integrations.delete( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(object, scm_integration, path=["response"]) @@ -230,12 +230,12 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.create( - host="host", - oauth_client_id="oauthClientId", - oauth_plaintext_client_secret="oauthPlaintextClientSecret", + host="github.com", + oauth_client_id="client_id", + oauth_plaintext_client_secret="client_secret", pat=True, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - scm_id="scmId", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + scm_id="github", ) assert_matches_type(ScmIntegrationCreateResponse, scm_integration, path=["response"]) @@ -271,7 +271,7 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.retrieve( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(ScmIntegrationRetrieveResponse, scm_integration, path=["response"]) @@ -307,9 +307,9 @@ async def test_method_update(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.update( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - oauth_client_id="oauthClientId", - oauth_plaintext_client_secret="oauthPlaintextClientSecret", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", + oauth_client_id="new_client_id", + oauth_plaintext_client_secret="new_client_secret", pat=True, ) assert_matches_type(object, scm_integration, path=["response"]) @@ -348,10 +348,10 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N scm_integration = await async_client.runners.configurations.scm_integrations.list( token="token", page_size=0, - filter={"runner_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}, + filter={"runner_ids": ["d2c94c27-3b76-4a42-b88c-95a85e392c68"]}, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(AsyncIntegrationsPage[ScmIntegration], scm_integration, path=["response"]) @@ -388,7 +388,7 @@ async def test_method_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: scm_integration = await async_client.runners.configurations.scm_integrations.delete( - id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(object, scm_integration, path=["response"]) diff --git a/tests/api_resources/runners/test_configurations.py b/tests/api_resources/runners/test_configurations.py index 7184caf4..8d88dc3b 100644 --- a/tests/api_resources/runners/test_configurations.py +++ b/tests/api_resources/runners/test_configurations.py @@ -40,15 +40,15 @@ def test_method_validate_with_all_params(self, client: Gitpod) -> None: "display_name": "xxx", "enabled": True, }, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", scm_integration={ - "id": "id", - "host": "host", - "oauth_client_id": "oauthClientId", + "id": "integration-id", + "host": "github.com", + "oauth_client_id": "client_id", "oauth_encrypted_client_secret": "U3RhaW5sZXNzIHJvY2tz", - "oauth_plaintext_client_secret": "oauthPlaintextClientSecret", + "oauth_plaintext_client_secret": "client_secret", "pat": True, - "scm_id": "scmId", + "scm_id": "github", }, ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) @@ -102,15 +102,15 @@ async def test_method_validate_with_all_params(self, async_client: AsyncGitpod) "display_name": "xxx", "enabled": True, }, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", scm_integration={ - "id": "id", - "host": "host", - "oauth_client_id": "oauthClientId", + "id": "integration-id", + "host": "github.com", + "oauth_client_id": "client_id", "oauth_encrypted_client_secret": "U3RhaW5sZXNzIHJvY2tz", - "oauth_plaintext_client_secret": "oauthPlaintextClientSecret", + "oauth_plaintext_client_secret": "client_secret", "pat": True, - "scm_id": "scmId", + "scm_id": "github", }, ) assert_matches_type(ConfigurationValidateResponse, configuration, path=["response"]) diff --git a/tests/api_resources/runners/test_policies.py b/tests/api_resources/runners/test_policies.py index f0bcafa7..a5da4a8d 100644 --- a/tests/api_resources/runners/test_policies.py +++ b/tests/api_resources/runners/test_policies.py @@ -32,9 +32,9 @@ def test_method_create(self, client: Gitpod) -> None: @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: policy = client.runners.policies.create( - group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + group_id="f53d2330-3795-4c5d-a1f3-453121af9c60", role="RUNNER_ROLE_UNSPECIFIED", - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(PolicyCreateResponse, policy, path=["response"]) @@ -70,9 +70,9 @@ def test_method_update(self, client: Gitpod) -> None: @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: policy = client.runners.policies.update( - group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + group_id="f53d2330-3795-4c5d-a1f3-453121af9c60", role="RUNNER_ROLE_UNSPECIFIED", - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) @@ -112,9 +112,9 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: page_size=0, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(SyncPoliciesPage[RunnerPolicy], policy, path=["response"]) @@ -150,8 +150,8 @@ def test_method_delete(self, client: Gitpod) -> None: @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: policy = client.runners.policies.delete( - group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + group_id="f53d2330-3795-4c5d-a1f3-453121af9c60", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(object, policy, path=["response"]) @@ -191,9 +191,9 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.create( - group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + group_id="f53d2330-3795-4c5d-a1f3-453121af9c60", role="RUNNER_ROLE_UNSPECIFIED", - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(PolicyCreateResponse, policy, path=["response"]) @@ -229,9 +229,9 @@ async def test_method_update(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.update( - group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + group_id="f53d2330-3795-4c5d-a1f3-453121af9c60", role="RUNNER_ROLE_UNSPECIFIED", - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(PolicyUpdateResponse, policy, path=["response"]) @@ -271,9 +271,9 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N page_size=0, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(AsyncPoliciesPage[RunnerPolicy], policy, path=["response"]) @@ -309,8 +309,8 @@ async def test_method_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: policy = await async_client.runners.policies.delete( - group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + group_id="f53d2330-3795-4c5d-a1f3-453121af9c60", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(object, policy, path=["response"]) diff --git a/tests/api_resources/test_events.py b/tests/api_resources/test_events.py index 11a2ab96..977730ed 100644 --- a/tests/api_resources/test_events.py +++ b/tests/api_resources/test_events.py @@ -32,14 +32,14 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: token="token", page_size=0, filter={ - "actor_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "actor_ids": ["d2c94c27-3b76-4a42-b88c-95a85e392c68"], "actor_principals": ["PRINCIPAL_UNSPECIFIED"], "subject_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "subject_types": ["RESOURCE_TYPE_UNSPECIFIED"], }, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(SyncEntriesPage[EventListResponse], event, path=["response"]) @@ -120,14 +120,14 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N token="token", page_size=0, filter={ - "actor_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "actor_ids": ["d2c94c27-3b76-4a42-b88c-95a85e392c68"], "actor_principals": ["PRINCIPAL_UNSPECIFIED"], "subject_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "subject_types": ["RESOURCE_TYPE_UNSPECIFIED"], }, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(AsyncEntriesPage[EventListResponse], event, path=["response"]) diff --git a/tests/api_resources/test_groups.py b/tests/api_resources/test_groups.py index 00bfe68a..ed1c0380 100644 --- a/tests/api_resources/test_groups.py +++ b/tests/api_resources/test_groups.py @@ -32,7 +32,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: page_size=0, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(SyncGroupsPage[Group], group, path=["response"]) @@ -77,7 +77,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N page_size=0, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(AsyncGroupsPage[Group], group, path=["response"]) diff --git a/tests/api_resources/test_projects.py b/tests/api_resources/test_projects.py index 4a57297b..3d47dbde 100644 --- a/tests/api_resources/test_projects.py +++ b/tests/api_resources/test_projects.py @@ -38,7 +38,7 @@ def test_method_create(self, client: Gitpod) -> None: def test_method_create_with_all_params(self, client: Gitpod) -> None: project = client.projects.create( environment_class={ - "environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "environment_class_id": "d2c94c27-3b76-4a42-b88c-95a85e392c68", "local_runner": True, }, initializer={ @@ -48,7 +48,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: "git": { "checkout_location": "checkoutLocation", "clone_target": "cloneTarget", - "remote_uri": "remoteUri", + "remote_uri": "https://github.com/org/repo", "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", "upstream_remote_uri": "upstreamRemoteUri", }, @@ -57,7 +57,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: }, automations_file_path="automationsFilePath", devcontainer_file_path="devcontainerFilePath", - name="x", + name="Web Application", ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) @@ -99,7 +99,7 @@ def test_method_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: project = client.projects.retrieve( - project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) @@ -138,7 +138,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: automations_file_path="automationsFilePath", devcontainer_file_path="devcontainerFilePath", environment_class={ - "environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "environment_class_id": "d2c94c27-3b76-4a42-b88c-95a85e392c68", "local_runner": True, }, initializer={ @@ -156,7 +156,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None: ] }, name="x", - project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) @@ -196,7 +196,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: page_size=0, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(SyncProjectsPage[Project], project, path=["response"]) @@ -233,7 +233,7 @@ def test_method_delete(self, client: Gitpod) -> None: @parametrize def test_method_delete_with_all_params(self, client: Gitpod) -> None: project = client.projects.delete( - project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert_matches_type(object, project, path=["response"]) @@ -269,8 +269,8 @@ def test_method_create_from_environment(self, client: Gitpod) -> None: @parametrize def test_method_create_from_environment_with_all_params(self, client: Gitpod) -> None: project = client.projects.create_from_environment( - environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - name="x", + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", + name="Frontend Project", ) assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) @@ -314,7 +314,7 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.create( environment_class={ - "environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "environment_class_id": "d2c94c27-3b76-4a42-b88c-95a85e392c68", "local_runner": True, }, initializer={ @@ -324,7 +324,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> "git": { "checkout_location": "checkoutLocation", "clone_target": "cloneTarget", - "remote_uri": "remoteUri", + "remote_uri": "https://github.com/org/repo", "target_mode": "CLONE_TARGET_MODE_UNSPECIFIED", "upstream_remote_uri": "upstreamRemoteUri", }, @@ -333,7 +333,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> }, automations_file_path="automationsFilePath", devcontainer_file_path="devcontainerFilePath", - name="x", + name="Web Application", ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) @@ -375,7 +375,7 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.retrieve( - project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert_matches_type(ProjectRetrieveResponse, project, path=["response"]) @@ -414,7 +414,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> automations_file_path="automationsFilePath", devcontainer_file_path="devcontainerFilePath", environment_class={ - "environment_class_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "environment_class_id": "d2c94c27-3b76-4a42-b88c-95a85e392c68", "local_runner": True, }, initializer={ @@ -432,7 +432,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> ] }, name="x", - project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert_matches_type(ProjectUpdateResponse, project, path=["response"]) @@ -472,7 +472,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N page_size=0, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(AsyncProjectsPage[Project], project, path=["response"]) @@ -509,7 +509,7 @@ async def test_method_delete(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.delete( - project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047", ) assert_matches_type(object, project, path=["response"]) @@ -545,8 +545,8 @@ async def test_method_create_from_environment(self, async_client: AsyncGitpod) - @parametrize async def test_method_create_from_environment_with_all_params(self, async_client: AsyncGitpod) -> None: project = await async_client.projects.create_from_environment( - environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - name="x", + environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", + name="Frontend Project", ) assert_matches_type(ProjectCreateFromEnvironmentResponse, project, path=["response"]) diff --git a/tests/api_resources/test_runners.py b/tests/api_resources/test_runners.py index 3829f7d6..8968127a 100644 --- a/tests/api_resources/test_runners.py +++ b/tests/api_resources/test_runners.py @@ -36,12 +36,12 @@ def test_method_create(self, client: Gitpod) -> None: def test_method_create_with_all_params(self, client: Gitpod) -> None: runner = client.runners.create( kind="RUNNER_KIND_UNSPECIFIED", - name="xxx", + name="Production Runner", provider="RUNNER_PROVIDER_UNSPECIFIED", spec={ "configuration": { "auto_update": True, - "region": "region", + "region": "us-west", "release_channel": "RUNNER_RELEASE_CHANNEL_UNSPECIFIED", }, "desired_phase": "RUNNER_PHASE_UNSPECIFIED", @@ -81,7 +81,7 @@ def test_method_retrieve(self, client: Gitpod) -> None: @parametrize def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: runner = client.runners.retrieve( - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) @@ -117,8 +117,8 @@ def test_method_update(self, client: Gitpod) -> None: @parametrize def test_method_update_with_all_params(self, client: Gitpod) -> None: runner = client.runners.update( - name="xxx", - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + name="Updated Runner Name", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", spec={ "configuration": { "auto_update": True, @@ -170,7 +170,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: }, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(SyncRunnersPage[Runner], runner, path=["response"]) @@ -208,7 +208,7 @@ def test_method_delete(self, client: Gitpod) -> None: def test_method_delete_with_all_params(self, client: Gitpod) -> None: runner = client.runners.delete( force=True, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(object, runner, path=["response"]) @@ -244,7 +244,7 @@ def test_method_check_authentication_for_host(self, client: Gitpod) -> None: @parametrize def test_method_check_authentication_for_host_with_all_params(self, client: Gitpod) -> None: runner = client.runners.check_authentication_for_host( - host="host", + host="github.com", runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) @@ -281,7 +281,7 @@ def test_method_create_runner_token(self, client: Gitpod) -> None: @parametrize def test_method_create_runner_token_with_all_params(self, client: Gitpod) -> None: runner = client.runners.create_runner_token( - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) @@ -317,7 +317,7 @@ def test_method_parse_context_url(self, client: Gitpod) -> None: @parametrize def test_method_parse_context_url_with_all_params(self, client: Gitpod) -> None: runner = client.runners.parse_context_url( - context_url="https://example.com", + context_url="https://github.com/org/repo/tree/main", runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"]) @@ -359,12 +359,12 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.create( kind="RUNNER_KIND_UNSPECIFIED", - name="xxx", + name="Production Runner", provider="RUNNER_PROVIDER_UNSPECIFIED", spec={ "configuration": { "auto_update": True, - "region": "region", + "region": "us-west", "release_channel": "RUNNER_RELEASE_CHANNEL_UNSPECIFIED", }, "desired_phase": "RUNNER_PHASE_UNSPECIFIED", @@ -404,7 +404,7 @@ async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.retrieve( - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(RunnerRetrieveResponse, runner, path=["response"]) @@ -440,8 +440,8 @@ async def test_method_update(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.update( - name="xxx", - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + name="Updated Runner Name", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", spec={ "configuration": { "auto_update": True, @@ -493,7 +493,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N }, pagination={ "token": "token", - "page_size": 100, + "page_size": 20, }, ) assert_matches_type(AsyncRunnersPage[Runner], runner, path=["response"]) @@ -531,7 +531,7 @@ async def test_method_delete(self, async_client: AsyncGitpod) -> None: async def test_method_delete_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.delete( force=True, - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(object, runner, path=["response"]) @@ -567,7 +567,7 @@ async def test_method_check_authentication_for_host(self, async_client: AsyncGit @parametrize async def test_method_check_authentication_for_host_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.check_authentication_for_host( - host="host", + host="github.com", runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) assert_matches_type(RunnerCheckAuthenticationForHostResponse, runner, path=["response"]) @@ -604,7 +604,7 @@ async def test_method_create_runner_token(self, async_client: AsyncGitpod) -> No @parametrize async def test_method_create_runner_token_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.create_runner_token( - runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68", ) assert_matches_type(RunnerCreateRunnerTokenResponse, runner, path=["response"]) @@ -640,7 +640,7 @@ async def test_method_parse_context_url(self, async_client: AsyncGitpod) -> None @parametrize async def test_method_parse_context_url_with_all_params(self, async_client: AsyncGitpod) -> None: runner = await async_client.runners.parse_context_url( - context_url="https://example.com", + context_url="https://github.com/org/repo/tree/main", runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) assert_matches_type(RunnerParseContextURLResponse, runner, path=["response"])