diff --git a/services/git/oas_commit b/services/git/oas_commit index e3713dde3..18508ffba 100644 --- a/services/git/oas_commit +++ b/services/git/oas_commit @@ -1 +1 @@ -0e64886dd0847341800d7191ed193b75413be998 +013a25a4f4064dccb8506a21ad7a1d28b417dad5 diff --git a/services/git/src/stackit/git/__init__.py b/services/git/src/stackit/git/__init__.py index 5fa00cce6..7992117db 100644 --- a/services/git/src/stackit/git/__init__.py +++ b/services/git/src/stackit/git/__init__.py @@ -35,22 +35,40 @@ "ConflictErrorResponse", "CreateAuthenticationPayload", "CreateInstancePayload", + "CreateLegacyRunnerPayload", + "CreateOrganizationRunnerPayload", "CreateRunnerPayload", + "CreateUserPayload", "FeatureToggle", "Flavor", "GenericErrorResponse", + "GroupDefinition", "Instance", "InternalServerErrorResponse", "ListFlavors", "ListInstances", + "ListOrganizationTeams", + "ListOrganizations", + "ListUsers", "NotFoundErrorResponse", + "Organization", + "OrganizationTeam", "PatchAuthenticationPayload", "PatchInstancePayload", + "PatchLegacyRunnerPayload", "PatchOperation", + "PatchRunnerPayload", + "Pipelines", "Runner", + "RunnerFamily", + "RunnerFamilyList", + "RunnerList", "RunnerRuntime", "RunnerRuntimeList", + "TeamMappingRow", "UnauthorizedErrorResponse", + "UpdateUserPayload", + "User", ] # import apis into sdk package @@ -85,35 +103,67 @@ from stackit.git.models.create_instance_payload import ( CreateInstancePayload as CreateInstancePayload, ) +from stackit.git.models.create_legacy_runner_payload import ( + CreateLegacyRunnerPayload as CreateLegacyRunnerPayload, +) +from stackit.git.models.create_organization_runner_payload import ( + CreateOrganizationRunnerPayload as CreateOrganizationRunnerPayload, +) from stackit.git.models.create_runner_payload import ( CreateRunnerPayload as CreateRunnerPayload, ) +from stackit.git.models.create_user_payload import ( + CreateUserPayload as CreateUserPayload, +) from stackit.git.models.feature_toggle import FeatureToggle as FeatureToggle from stackit.git.models.flavor import Flavor as Flavor from stackit.git.models.generic_error_response import ( GenericErrorResponse as GenericErrorResponse, ) +from stackit.git.models.group_definition import GroupDefinition as GroupDefinition from stackit.git.models.instance import Instance as Instance from stackit.git.models.internal_server_error_response import ( InternalServerErrorResponse as InternalServerErrorResponse, ) from stackit.git.models.list_flavors import ListFlavors as ListFlavors from stackit.git.models.list_instances import ListInstances as ListInstances +from stackit.git.models.list_organization_teams import ( + ListOrganizationTeams as ListOrganizationTeams, +) +from stackit.git.models.list_organizations import ListOrganizations as ListOrganizations +from stackit.git.models.list_users import ListUsers as ListUsers from stackit.git.models.not_found_error_response import ( NotFoundErrorResponse as NotFoundErrorResponse, ) +from stackit.git.models.organization import Organization as Organization +from stackit.git.models.organization_team import OrganizationTeam as OrganizationTeam from stackit.git.models.patch_authentication_payload import ( PatchAuthenticationPayload as PatchAuthenticationPayload, ) from stackit.git.models.patch_instance_payload import ( PatchInstancePayload as PatchInstancePayload, ) +from stackit.git.models.patch_legacy_runner_payload import ( + PatchLegacyRunnerPayload as PatchLegacyRunnerPayload, +) from stackit.git.models.patch_operation import PatchOperation as PatchOperation +from stackit.git.models.patch_runner_payload import ( + PatchRunnerPayload as PatchRunnerPayload, +) +from stackit.git.models.pipelines import Pipelines as Pipelines from stackit.git.models.runner import Runner as Runner +from stackit.git.models.runner_family import RunnerFamily as RunnerFamily +from stackit.git.models.runner_family_list import RunnerFamilyList as RunnerFamilyList +from stackit.git.models.runner_list import RunnerList as RunnerList from stackit.git.models.runner_runtime import RunnerRuntime as RunnerRuntime from stackit.git.models.runner_runtime_list import ( RunnerRuntimeList as RunnerRuntimeList, ) +from stackit.git.models.team_mapping_row import TeamMappingRow as TeamMappingRow from stackit.git.models.unauthorized_error_response import ( UnauthorizedErrorResponse as UnauthorizedErrorResponse, ) +from stackit.git.models.update_user_payload import ( + UpdateUserPayload as UpdateUserPayload, +) +from stackit.git.models.user import User as User diff --git a/services/git/src/stackit/git/api/default_api.py b/services/git/src/stackit/git/api/default_api.py index c3de7124b..06f8cd89b 100644 --- a/services/git/src/stackit/git/api/default_api.py +++ b/services/git/src/stackit/git/api/default_api.py @@ -12,6 +12,7 @@ Do not edit the class manually. """ # noqa: E501 +import warnings from typing import Any, Dict, List, Optional, Tuple, Union from uuid import UUID @@ -31,14 +32,28 @@ from stackit.git.models.authentication_list import AuthenticationList from stackit.git.models.create_authentication_payload import CreateAuthenticationPayload from stackit.git.models.create_instance_payload import CreateInstancePayload +from stackit.git.models.create_legacy_runner_payload import CreateLegacyRunnerPayload +from stackit.git.models.create_organization_runner_payload import ( + CreateOrganizationRunnerPayload, +) from stackit.git.models.create_runner_payload import CreateRunnerPayload +from stackit.git.models.create_user_payload import CreateUserPayload from stackit.git.models.instance import Instance from stackit.git.models.list_flavors import ListFlavors from stackit.git.models.list_instances import ListInstances +from stackit.git.models.list_organization_teams import ListOrganizationTeams +from stackit.git.models.list_organizations import ListOrganizations +from stackit.git.models.list_users import ListUsers from stackit.git.models.patch_authentication_payload import PatchAuthenticationPayload from stackit.git.models.patch_instance_payload import PatchInstancePayload +from stackit.git.models.patch_legacy_runner_payload import PatchLegacyRunnerPayload +from stackit.git.models.patch_runner_payload import PatchRunnerPayload from stackit.git.models.runner import Runner +from stackit.git.models.runner_family_list import RunnerFamilyList +from stackit.git.models.runner_list import RunnerList from stackit.git.models.runner_runtime_list import RunnerRuntimeList +from stackit.git.models.update_user_payload import UpdateUserPayload +from stackit.git.models.user import User from stackit.git.rest import RESTResponseType @@ -602,11 +617,13 @@ def _create_instance_serialize( ) @validate_call - def create_runner( + def create_legacy_runner( self, project_id: Annotated[UUID, Field(description="Project identifier.")], instance_id: Annotated[UUID, Field(description="Instance identifier.")], - create_runner_payload: Annotated[CreateRunnerPayload, Field(description="Runner configuration options.")], + create_legacy_runner_payload: Annotated[ + CreateLegacyRunnerPayload, Field(description="Runner configuration options.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -617,16 +634,16 @@ def create_runner( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> Runner: - """Create the runner associated to this instance. + """(Deprecated) Create the runner associated to this instance (deprecated). - Creates the runner associated to this STACKIT Git instance. + Deprecated: Use `/v1beta/projects/{projectId}/instances/{instanceId}/runners` instead. Creates a runner associated to this STACKIT Git instance. :param project_id: Project identifier. (required) :type project_id: UUID :param instance_id: Instance identifier. (required) :type instance_id: UUID - :param create_runner_payload: Runner configuration options. (required) - :type create_runner_payload: CreateRunnerPayload + :param create_legacy_runner_payload: Runner configuration options. (required) + :type create_legacy_runner_payload: CreateLegacyRunnerPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -648,11 +665,14 @@ def create_runner( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn( + "POST /v1beta/projects/{projectId}/instances/{instanceId}/runner is deprecated.", DeprecationWarning + ) - _param = self._create_runner_serialize( + _param = self._create_legacy_runner_serialize( project_id=project_id, instance_id=instance_id, - create_runner_payload=create_runner_payload, + create_legacy_runner_payload=create_legacy_runner_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -674,11 +694,13 @@ def create_runner( ).data @validate_call - def create_runner_with_http_info( + def create_legacy_runner_with_http_info( self, project_id: Annotated[UUID, Field(description="Project identifier.")], instance_id: Annotated[UUID, Field(description="Instance identifier.")], - create_runner_payload: Annotated[CreateRunnerPayload, Field(description="Runner configuration options.")], + create_legacy_runner_payload: Annotated[ + CreateLegacyRunnerPayload, Field(description="Runner configuration options.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -689,16 +711,16 @@ def create_runner_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[Runner]: - """Create the runner associated to this instance. + """(Deprecated) Create the runner associated to this instance (deprecated). - Creates the runner associated to this STACKIT Git instance. + Deprecated: Use `/v1beta/projects/{projectId}/instances/{instanceId}/runners` instead. Creates a runner associated to this STACKIT Git instance. :param project_id: Project identifier. (required) :type project_id: UUID :param instance_id: Instance identifier. (required) :type instance_id: UUID - :param create_runner_payload: Runner configuration options. (required) - :type create_runner_payload: CreateRunnerPayload + :param create_legacy_runner_payload: Runner configuration options. (required) + :type create_legacy_runner_payload: CreateLegacyRunnerPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -720,11 +742,14 @@ def create_runner_with_http_info( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn( + "POST /v1beta/projects/{projectId}/instances/{instanceId}/runner is deprecated.", DeprecationWarning + ) - _param = self._create_runner_serialize( + _param = self._create_legacy_runner_serialize( project_id=project_id, instance_id=instance_id, - create_runner_payload=create_runner_payload, + create_legacy_runner_payload=create_legacy_runner_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -746,11 +771,13 @@ def create_runner_with_http_info( ) @validate_call - def create_runner_without_preload_content( + def create_legacy_runner_without_preload_content( self, project_id: Annotated[UUID, Field(description="Project identifier.")], instance_id: Annotated[UUID, Field(description="Instance identifier.")], - create_runner_payload: Annotated[CreateRunnerPayload, Field(description="Runner configuration options.")], + create_legacy_runner_payload: Annotated[ + CreateLegacyRunnerPayload, Field(description="Runner configuration options.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -761,16 +788,16 @@ def create_runner_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Create the runner associated to this instance. + """(Deprecated) Create the runner associated to this instance (deprecated). - Creates the runner associated to this STACKIT Git instance. + Deprecated: Use `/v1beta/projects/{projectId}/instances/{instanceId}/runners` instead. Creates a runner associated to this STACKIT Git instance. :param project_id: Project identifier. (required) :type project_id: UUID :param instance_id: Instance identifier. (required) :type instance_id: UUID - :param create_runner_payload: Runner configuration options. (required) - :type create_runner_payload: CreateRunnerPayload + :param create_legacy_runner_payload: Runner configuration options. (required) + :type create_legacy_runner_payload: CreateLegacyRunnerPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -792,11 +819,14 @@ def create_runner_without_preload_content( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn( + "POST /v1beta/projects/{projectId}/instances/{instanceId}/runner is deprecated.", DeprecationWarning + ) - _param = self._create_runner_serialize( + _param = self._create_legacy_runner_serialize( project_id=project_id, instance_id=instance_id, - create_runner_payload=create_runner_payload, + create_legacy_runner_payload=create_legacy_runner_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -813,11 +843,11 @@ def create_runner_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _create_runner_serialize( + def _create_legacy_runner_serialize( self, project_id, instance_id, - create_runner_payload, + create_legacy_runner_payload, _request_auth, _content_type, _headers, @@ -844,8 +874,8 @@ def _create_runner_serialize( # process the header parameters # process the form parameters # process the body parameter - if create_runner_payload is not None: - _body_params = create_runner_payload + if create_legacy_runner_payload is not None: + _body_params = create_legacy_runner_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -878,11 +908,14 @@ def _create_runner_serialize( ) @validate_call - def delete_authentication( + def create_organization_runner( self, project_id: Annotated[UUID, Field(description="Project identifier.")], instance_id: Annotated[UUID, Field(description="Instance identifier.")], - authentication_id: Annotated[UUID, Field(description="Authentication Source identifier.")], + org: Annotated[StrictStr, Field(description="Organization name.")], + create_organization_runner_payload: Annotated[ + CreateOrganizationRunnerPayload, Field(description="Runner configuration options.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -892,17 +925,19 @@ def delete_authentication( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete Authentication Source + ) -> Runner: + """Create an organization-scoped runner associated to this instance. - Deletes the authentication source associated to this STACKIT Git instance. + Creates a runner scoped to a Forgejo organization within this STACKIT Git instance. :param project_id: Project identifier. (required) :type project_id: UUID :param instance_id: Instance identifier. (required) :type instance_id: UUID - :param authentication_id: Authentication Source identifier. (required) - :type authentication_id: UUID + :param org: Organization name. (required) + :type org: str + :param create_organization_runner_payload: Runner configuration options. (required) + :type create_organization_runner_payload: CreateOrganizationRunnerPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -925,10 +960,11 @@ def delete_authentication( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_authentication_serialize( + _param = self._create_organization_runner_serialize( project_id=project_id, instance_id=instance_id, - authentication_id=authentication_id, + org=org, + create_organization_runner_payload=create_organization_runner_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -936,12 +972,12 @@ def delete_authentication( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "GenericErrorResponse", - "401": "UnauthorizedErrorResponse", - "404": "GenericErrorResponse", - "409": "GenericErrorResponse", - "500": "GenericErrorResponse", + "202": "Runner", + "400": "BadErrorResponse", + "401": None, + "404": "NotFoundErrorResponse", + "409": "AlreadyExistsError", + "500": "InternalServerErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -951,11 +987,14 @@ def delete_authentication( ).data @validate_call - def delete_authentication_with_http_info( + def create_organization_runner_with_http_info( self, project_id: Annotated[UUID, Field(description="Project identifier.")], instance_id: Annotated[UUID, Field(description="Instance identifier.")], - authentication_id: Annotated[UUID, Field(description="Authentication Source identifier.")], + org: Annotated[StrictStr, Field(description="Organization name.")], + create_organization_runner_payload: Annotated[ + CreateOrganizationRunnerPayload, Field(description="Runner configuration options.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -965,17 +1004,19 @@ def delete_authentication_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Delete Authentication Source + ) -> ApiResponse[Runner]: + """Create an organization-scoped runner associated to this instance. - Deletes the authentication source associated to this STACKIT Git instance. + Creates a runner scoped to a Forgejo organization within this STACKIT Git instance. :param project_id: Project identifier. (required) :type project_id: UUID :param instance_id: Instance identifier. (required) :type instance_id: UUID - :param authentication_id: Authentication Source identifier. (required) - :type authentication_id: UUID + :param org: Organization name. (required) + :type org: str + :param create_organization_runner_payload: Runner configuration options. (required) + :type create_organization_runner_payload: CreateOrganizationRunnerPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -998,10 +1039,11 @@ def delete_authentication_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_authentication_serialize( + _param = self._create_organization_runner_serialize( project_id=project_id, instance_id=instance_id, - authentication_id=authentication_id, + org=org, + create_organization_runner_payload=create_organization_runner_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1009,12 +1051,12 @@ def delete_authentication_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "GenericErrorResponse", - "401": "UnauthorizedErrorResponse", - "404": "GenericErrorResponse", - "409": "GenericErrorResponse", - "500": "GenericErrorResponse", + "202": "Runner", + "400": "BadErrorResponse", + "401": None, + "404": "NotFoundErrorResponse", + "409": "AlreadyExistsError", + "500": "InternalServerErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -1024,11 +1066,14 @@ def delete_authentication_with_http_info( ) @validate_call - def delete_authentication_without_preload_content( + def create_organization_runner_without_preload_content( self, project_id: Annotated[UUID, Field(description="Project identifier.")], instance_id: Annotated[UUID, Field(description="Instance identifier.")], - authentication_id: Annotated[UUID, Field(description="Authentication Source identifier.")], + org: Annotated[StrictStr, Field(description="Organization name.")], + create_organization_runner_payload: Annotated[ + CreateOrganizationRunnerPayload, Field(description="Runner configuration options.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1039,16 +1084,18 @@ def delete_authentication_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Delete Authentication Source + """Create an organization-scoped runner associated to this instance. - Deletes the authentication source associated to this STACKIT Git instance. + Creates a runner scoped to a Forgejo organization within this STACKIT Git instance. :param project_id: Project identifier. (required) :type project_id: UUID :param instance_id: Instance identifier. (required) :type instance_id: UUID - :param authentication_id: Authentication Source identifier. (required) - :type authentication_id: UUID + :param org: Organization name. (required) + :type org: str + :param create_organization_runner_payload: Runner configuration options. (required) + :type create_organization_runner_payload: CreateOrganizationRunnerPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1071,10 +1118,11 @@ def delete_authentication_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_authentication_serialize( + _param = self._create_organization_runner_serialize( project_id=project_id, instance_id=instance_id, - authentication_id=authentication_id, + org=org, + create_organization_runner_payload=create_organization_runner_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1082,21 +1130,22 @@ def delete_authentication_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "GenericErrorResponse", - "401": "UnauthorizedErrorResponse", - "404": "GenericErrorResponse", - "409": "GenericErrorResponse", - "500": "GenericErrorResponse", + "202": "Runner", + "400": "BadErrorResponse", + "401": None, + "404": "NotFoundErrorResponse", + "409": "AlreadyExistsError", + "500": "InternalServerErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _delete_authentication_serialize( + def _create_organization_runner_serialize( self, project_id, instance_id, - authentication_id, + org, + create_organization_runner_payload, _request_auth, _content_type, _headers, @@ -1119,23 +1168,33 @@ def _delete_authentication_serialize( _path_params["projectId"] = project_id if instance_id is not None: _path_params["instanceId"] = instance_id - if authentication_id is not None: - _path_params["authenticationId"] = authentication_id + if org is not None: + _path_params["org"] = org # process the query parameters # process the header parameters # process the form parameters # process the body parameter + if create_organization_runner_payload is not None: + _body_params = create_organization_runner_payload # set the HTTP header `Accept` if "Accept" not in _header_params: _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + # authentication setting _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1beta/projects/{projectId}/instances/{instanceId}/authentications/{authenticationId}", + method="POST", + resource_path="/v1beta/projects/{projectId}/instances/{instanceId}/organizations/{org}/runners", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1149,10 +1208,11 @@ def _delete_authentication_serialize( ) @validate_call - def delete_instance( + def create_runner( self, project_id: Annotated[UUID, Field(description="Project identifier.")], instance_id: Annotated[UUID, Field(description="Instance identifier.")], + create_runner_payload: Annotated[CreateRunnerPayload, Field(description="Runner configuration options.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1162,15 +1222,17 @@ def delete_instance( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete Instance. + ) -> Runner: + """Create the runner associated to this instance. - Deletes a STACKIT Git instance and destroys all associated data. + Creates a runner associated to this STACKIT Git instance. :param project_id: Project identifier. (required) :type project_id: UUID :param instance_id: Instance identifier. (required) :type instance_id: UUID + :param create_runner_payload: Runner configuration options. (required) + :type create_runner_payload: CreateRunnerPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1193,9 +1255,10 @@ def delete_instance( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_instance_serialize( + _param = self._create_runner_serialize( project_id=project_id, instance_id=instance_id, + create_runner_payload=create_runner_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1203,12 +1266,12 @@ def delete_instance( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "GenericErrorResponse", + "202": "Runner", + "400": "BadErrorResponse", "401": None, - "404": "GenericErrorResponse", - "409": "GenericErrorResponse", - "500": "GenericErrorResponse", + "404": "NotFoundErrorResponse", + "409": "AlreadyExistsError", + "500": "InternalServerErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -1218,10 +1281,11 @@ def delete_instance( ).data @validate_call - def delete_instance_with_http_info( + def create_runner_with_http_info( self, project_id: Annotated[UUID, Field(description="Project identifier.")], instance_id: Annotated[UUID, Field(description="Instance identifier.")], + create_runner_payload: Annotated[CreateRunnerPayload, Field(description="Runner configuration options.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1231,15 +1295,17 @@ def delete_instance_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Delete Instance. + ) -> ApiResponse[Runner]: + """Create the runner associated to this instance. - Deletes a STACKIT Git instance and destroys all associated data. + Creates a runner associated to this STACKIT Git instance. :param project_id: Project identifier. (required) :type project_id: UUID :param instance_id: Instance identifier. (required) :type instance_id: UUID + :param create_runner_payload: Runner configuration options. (required) + :type create_runner_payload: CreateRunnerPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1262,9 +1328,10 @@ def delete_instance_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_instance_serialize( + _param = self._create_runner_serialize( project_id=project_id, instance_id=instance_id, + create_runner_payload=create_runner_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1272,12 +1339,12 @@ def delete_instance_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "GenericErrorResponse", + "202": "Runner", + "400": "BadErrorResponse", "401": None, - "404": "GenericErrorResponse", - "409": "GenericErrorResponse", - "500": "GenericErrorResponse", + "404": "NotFoundErrorResponse", + "409": "AlreadyExistsError", + "500": "InternalServerErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -1287,10 +1354,11 @@ def delete_instance_with_http_info( ) @validate_call - def delete_instance_without_preload_content( + def create_runner_without_preload_content( self, project_id: Annotated[UUID, Field(description="Project identifier.")], instance_id: Annotated[UUID, Field(description="Instance identifier.")], + create_runner_payload: Annotated[CreateRunnerPayload, Field(description="Runner configuration options.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1301,14 +1369,16 @@ def delete_instance_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Delete Instance. + """Create the runner associated to this instance. - Deletes a STACKIT Git instance and destroys all associated data. + Creates a runner associated to this STACKIT Git instance. :param project_id: Project identifier. (required) :type project_id: UUID :param instance_id: Instance identifier. (required) :type instance_id: UUID + :param create_runner_payload: Runner configuration options. (required) + :type create_runner_payload: CreateRunnerPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1331,9 +1401,10 @@ def delete_instance_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_instance_serialize( + _param = self._create_runner_serialize( project_id=project_id, instance_id=instance_id, + create_runner_payload=create_runner_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1341,20 +1412,21 @@ def delete_instance_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "GenericErrorResponse", + "202": "Runner", + "400": "BadErrorResponse", "401": None, - "404": "GenericErrorResponse", - "409": "GenericErrorResponse", - "500": "GenericErrorResponse", + "404": "NotFoundErrorResponse", + "409": "AlreadyExistsError", + "500": "InternalServerErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _delete_instance_serialize( + def _create_runner_serialize( self, project_id, instance_id, + create_runner_payload, _request_auth, _content_type, _headers, @@ -1381,17 +1453,27 @@ def _delete_instance_serialize( # process the header parameters # process the form parameters # process the body parameter + if create_runner_payload is not None: + _body_params = create_runner_payload # set the HTTP header `Accept` if "Accept" not in _header_params: _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + # authentication setting _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1beta/projects/{projectId}/instances/{instanceId}", + method="POST", + resource_path="/v1beta/projects/{projectId}/instances/{instanceId}/runners", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1405,10 +1487,11 @@ def _delete_instance_serialize( ) @validate_call - def delete_runner( + def create_user( self, project_id: Annotated[UUID, Field(description="Project identifier.")], instance_id: Annotated[UUID, Field(description="Instance identifier.")], + create_user_payload: Annotated[CreateUserPayload, Field(description="Instance User details options.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1418,15 +1501,17 @@ def delete_runner( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete Runner. + ) -> User: + """Create an Instance Local/Technical User. - Deletes the runner associated to this STACKIT Git instance and destroys all associated data. + Creates a new STACKIT Git instance Local/Technical User. :param project_id: Project identifier. (required) :type project_id: UUID :param instance_id: Instance identifier. (required) :type instance_id: UUID + :param create_user_payload: Instance User details options. (required) + :type create_user_payload: CreateUserPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1449,9 +1534,10 @@ def delete_runner( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_runner_serialize( + _param = self._create_user_serialize( project_id=project_id, instance_id=instance_id, + create_user_payload=create_user_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1459,10 +1545,10 @@ def delete_runner( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "201": "User", "400": "GenericErrorResponse", "401": None, - "404": None, + "409": "GenericErrorResponse", "500": "GenericErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -1473,10 +1559,11 @@ def delete_runner( ).data @validate_call - def delete_runner_with_http_info( + def create_user_with_http_info( self, project_id: Annotated[UUID, Field(description="Project identifier.")], instance_id: Annotated[UUID, Field(description="Instance identifier.")], + create_user_payload: Annotated[CreateUserPayload, Field(description="Instance User details options.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1486,15 +1573,17 @@ def delete_runner_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Delete Runner. + ) -> ApiResponse[User]: + """Create an Instance Local/Technical User. - Deletes the runner associated to this STACKIT Git instance and destroys all associated data. + Creates a new STACKIT Git instance Local/Technical User. :param project_id: Project identifier. (required) :type project_id: UUID :param instance_id: Instance identifier. (required) :type instance_id: UUID + :param create_user_payload: Instance User details options. (required) + :type create_user_payload: CreateUserPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1517,9 +1606,10 @@ def delete_runner_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_runner_serialize( + _param = self._create_user_serialize( project_id=project_id, instance_id=instance_id, + create_user_payload=create_user_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1527,10 +1617,10 @@ def delete_runner_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "201": "User", "400": "GenericErrorResponse", "401": None, - "404": None, + "409": "GenericErrorResponse", "500": "GenericErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -1541,10 +1631,11 @@ def delete_runner_with_http_info( ) @validate_call - def delete_runner_without_preload_content( + def create_user_without_preload_content( self, project_id: Annotated[UUID, Field(description="Project identifier.")], instance_id: Annotated[UUID, Field(description="Instance identifier.")], + create_user_payload: Annotated[CreateUserPayload, Field(description="Instance User details options.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1555,14 +1646,16 @@ def delete_runner_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Delete Runner. + """Create an Instance Local/Technical User. - Deletes the runner associated to this STACKIT Git instance and destroys all associated data. + Creates a new STACKIT Git instance Local/Technical User. :param project_id: Project identifier. (required) :type project_id: UUID :param instance_id: Instance identifier. (required) :type instance_id: UUID + :param create_user_payload: Instance User details options. (required) + :type create_user_payload: CreateUserPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1585,9 +1678,10 @@ def delete_runner_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_runner_serialize( + _param = self._create_user_serialize( project_id=project_id, instance_id=instance_id, + create_user_payload=create_user_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1595,19 +1689,20 @@ def delete_runner_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "201": "User", "400": "GenericErrorResponse", "401": None, - "404": None, + "409": "GenericErrorResponse", "500": "GenericErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _delete_runner_serialize( + def _create_user_serialize( self, project_id, instance_id, + create_user_payload, _request_auth, _content_type, _headers, @@ -1634,17 +1729,27 @@ def _delete_runner_serialize( # process the header parameters # process the form parameters # process the body parameter + if create_user_payload is not None: + _body_params = create_user_payload # set the HTTP header `Accept` if "Accept" not in _header_params: _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + # authentication setting _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1beta/projects/{projectId}/instances/{instanceId}/runner", + method="POST", + resource_path="/v1beta/projects/{projectId}/instances/{instanceId}/users", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1658,7 +1763,7 @@ def _delete_runner_serialize( ) @validate_call - def get_authentication( + def delete_authentication( self, project_id: Annotated[UUID, Field(description="Project identifier.")], instance_id: Annotated[UUID, Field(description="Instance identifier.")], @@ -1672,10 +1777,10 @@ def get_authentication( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Authentication: - """Get authentication provider + ) -> None: + """Delete Authentication Source - Get authentication provider + Deletes the authentication source associated to this STACKIT Git instance. :param project_id: Project identifier. (required) :type project_id: UUID @@ -1705,7 +1810,7 @@ def get_authentication( :return: Returns the result object. """ # noqa: E501 - _param = self._get_authentication_serialize( + _param = self._delete_authentication_serialize( project_id=project_id, instance_id=instance_id, authentication_id=authentication_id, @@ -1716,10 +1821,12 @@ def get_authentication( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Authentication", - "400": "BadErrorResponse", + "204": None, + "400": "GenericErrorResponse", "401": "UnauthorizedErrorResponse", - "500": "InternalServerErrorResponse", + "404": "GenericErrorResponse", + "409": "GenericErrorResponse", + "500": "GenericErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -1729,7 +1836,7 @@ def get_authentication( ).data @validate_call - def get_authentication_with_http_info( + def delete_authentication_with_http_info( self, project_id: Annotated[UUID, Field(description="Project identifier.")], instance_id: Annotated[UUID, Field(description="Instance identifier.")], @@ -1743,10 +1850,10 @@ def get_authentication_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Authentication]: - """Get authentication provider + ) -> ApiResponse[None]: + """Delete Authentication Source - Get authentication provider + Deletes the authentication source associated to this STACKIT Git instance. :param project_id: Project identifier. (required) :type project_id: UUID @@ -1776,7 +1883,7 @@ def get_authentication_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_authentication_serialize( + _param = self._delete_authentication_serialize( project_id=project_id, instance_id=instance_id, authentication_id=authentication_id, @@ -1787,10 +1894,12 @@ def get_authentication_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Authentication", - "400": "BadErrorResponse", + "204": None, + "400": "GenericErrorResponse", "401": "UnauthorizedErrorResponse", - "500": "InternalServerErrorResponse", + "404": "GenericErrorResponse", + "409": "GenericErrorResponse", + "500": "GenericErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -1800,7 +1909,7 @@ def get_authentication_with_http_info( ) @validate_call - def get_authentication_without_preload_content( + def delete_authentication_without_preload_content( self, project_id: Annotated[UUID, Field(description="Project identifier.")], instance_id: Annotated[UUID, Field(description="Instance identifier.")], @@ -1815,9 +1924,9 @@ def get_authentication_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get authentication provider + """Delete Authentication Source - Get authentication provider + Deletes the authentication source associated to this STACKIT Git instance. :param project_id: Project identifier. (required) :type project_id: UUID @@ -1847,7 +1956,7 @@ def get_authentication_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_authentication_serialize( + _param = self._delete_authentication_serialize( project_id=project_id, instance_id=instance_id, authentication_id=authentication_id, @@ -1858,15 +1967,17 @@ def get_authentication_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Authentication", - "400": "BadErrorResponse", + "204": None, + "400": "GenericErrorResponse", "401": "UnauthorizedErrorResponse", - "500": "InternalServerErrorResponse", + "404": "GenericErrorResponse", + "409": "GenericErrorResponse", + "500": "GenericErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_authentication_serialize( + def _delete_authentication_serialize( self, project_id, instance_id, @@ -1908,7 +2019,7 @@ def _get_authentication_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", + method="DELETE", resource_path="/v1beta/projects/{projectId}/instances/{instanceId}/authentications/{authenticationId}", path_params=_path_params, query_params=_query_params, @@ -1923,7 +2034,7 @@ def _get_authentication_serialize( ) @validate_call - def get_instance( + def delete_instance( self, project_id: Annotated[UUID, Field(description="Project identifier.")], instance_id: Annotated[UUID, Field(description="Instance identifier.")], @@ -1936,10 +2047,10 @@ def get_instance( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Instance: - """Get Instance information. + ) -> None: + """Delete Instance. - Retrieves information about a STACKIT Git instance. + Deletes a STACKIT Git instance and destroys all associated data. :param project_id: Project identifier. (required) :type project_id: UUID @@ -1967,7 +2078,7 @@ def get_instance( :return: Returns the result object. """ # noqa: E501 - _param = self._get_instance_serialize( + _param = self._delete_instance_serialize( project_id=project_id, instance_id=instance_id, _request_auth=_request_auth, @@ -1977,10 +2088,11 @@ def get_instance( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Instance", + "204": None, "400": "GenericErrorResponse", "401": None, "404": "GenericErrorResponse", + "409": "GenericErrorResponse", "500": "GenericErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -1991,7 +2103,7 @@ def get_instance( ).data @validate_call - def get_instance_with_http_info( + def delete_instance_with_http_info( self, project_id: Annotated[UUID, Field(description="Project identifier.")], instance_id: Annotated[UUID, Field(description="Instance identifier.")], @@ -2004,10 +2116,10 @@ def get_instance_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Instance]: - """Get Instance information. + ) -> ApiResponse[None]: + """Delete Instance. - Retrieves information about a STACKIT Git instance. + Deletes a STACKIT Git instance and destroys all associated data. :param project_id: Project identifier. (required) :type project_id: UUID @@ -2035,7 +2147,7 @@ def get_instance_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_instance_serialize( + _param = self._delete_instance_serialize( project_id=project_id, instance_id=instance_id, _request_auth=_request_auth, @@ -2045,10 +2157,11 @@ def get_instance_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Instance", + "204": None, "400": "GenericErrorResponse", "401": None, "404": "GenericErrorResponse", + "409": "GenericErrorResponse", "500": "GenericErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2059,7 +2172,7 @@ def get_instance_with_http_info( ) @validate_call - def get_instance_without_preload_content( + def delete_instance_without_preload_content( self, project_id: Annotated[UUID, Field(description="Project identifier.")], instance_id: Annotated[UUID, Field(description="Instance identifier.")], @@ -2073,9 +2186,9 @@ def get_instance_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get Instance information. + """Delete Instance. - Retrieves information about a STACKIT Git instance. + Deletes a STACKIT Git instance and destroys all associated data. :param project_id: Project identifier. (required) :type project_id: UUID @@ -2103,7 +2216,7 @@ def get_instance_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_instance_serialize( + _param = self._delete_instance_serialize( project_id=project_id, instance_id=instance_id, _request_auth=_request_auth, @@ -2113,16 +2226,17 @@ def get_instance_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Instance", + "204": None, "400": "GenericErrorResponse", "401": None, "404": "GenericErrorResponse", + "409": "GenericErrorResponse", "500": "GenericErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_instance_serialize( + def _delete_instance_serialize( self, project_id, instance_id, @@ -2161,7 +2275,7 @@ def _get_instance_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", + method="DELETE", resource_path="/v1beta/projects/{projectId}/instances/{instanceId}", path_params=_path_params, query_params=_query_params, @@ -2176,7 +2290,7 @@ def _get_instance_serialize( ) @validate_call - def get_runner( + def delete_legacy_runner( self, project_id: Annotated[UUID, Field(description="Project identifier.")], instance_id: Annotated[UUID, Field(description="Instance identifier.")], @@ -2189,10 +2303,10 @@ def get_runner( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Runner: - """Get Runner information. + ) -> None: + """(Deprecated) Delete Runner (deprecated). - Retrieves information about a runner in a STACKIT Git instance. + Deprecated: Use `/v1beta/projects/{projectId}/instances/{instanceId}/runners/{runnerId}` instead. Deletes the runner associated to this STACKIT Git instance and destroys all associated data. :param project_id: Project identifier. (required) :type project_id: UUID @@ -2219,8 +2333,11 @@ def get_runner( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn( + "DELETE /v1beta/projects/{projectId}/instances/{instanceId}/runner is deprecated.", DeprecationWarning + ) - _param = self._get_runner_serialize( + _param = self._delete_legacy_runner_serialize( project_id=project_id, instance_id=instance_id, _request_auth=_request_auth, @@ -2230,7 +2347,7 @@ def get_runner( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Runner", + "204": None, "400": "GenericErrorResponse", "401": None, "404": None, @@ -2244,7 +2361,7 @@ def get_runner( ).data @validate_call - def get_runner_with_http_info( + def delete_legacy_runner_with_http_info( self, project_id: Annotated[UUID, Field(description="Project identifier.")], instance_id: Annotated[UUID, Field(description="Instance identifier.")], @@ -2257,10 +2374,10 @@ def get_runner_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Runner]: - """Get Runner information. + ) -> ApiResponse[None]: + """(Deprecated) Delete Runner (deprecated). - Retrieves information about a runner in a STACKIT Git instance. + Deprecated: Use `/v1beta/projects/{projectId}/instances/{instanceId}/runners/{runnerId}` instead. Deletes the runner associated to this STACKIT Git instance and destroys all associated data. :param project_id: Project identifier. (required) :type project_id: UUID @@ -2287,8 +2404,11 @@ def get_runner_with_http_info( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn( + "DELETE /v1beta/projects/{projectId}/instances/{instanceId}/runner is deprecated.", DeprecationWarning + ) - _param = self._get_runner_serialize( + _param = self._delete_legacy_runner_serialize( project_id=project_id, instance_id=instance_id, _request_auth=_request_auth, @@ -2298,7 +2418,7 @@ def get_runner_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Runner", + "204": None, "400": "GenericErrorResponse", "401": None, "404": None, @@ -2312,7 +2432,7 @@ def get_runner_with_http_info( ) @validate_call - def get_runner_without_preload_content( + def delete_legacy_runner_without_preload_content( self, project_id: Annotated[UUID, Field(description="Project identifier.")], instance_id: Annotated[UUID, Field(description="Instance identifier.")], @@ -2326,9 +2446,9 @@ def get_runner_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get Runner information. + """(Deprecated) Delete Runner (deprecated). - Retrieves information about a runner in a STACKIT Git instance. + Deprecated: Use `/v1beta/projects/{projectId}/instances/{instanceId}/runners/{runnerId}` instead. Deletes the runner associated to this STACKIT Git instance and destroys all associated data. :param project_id: Project identifier. (required) :type project_id: UUID @@ -2355,8 +2475,11 @@ def get_runner_without_preload_content( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn( + "DELETE /v1beta/projects/{projectId}/instances/{instanceId}/runner is deprecated.", DeprecationWarning + ) - _param = self._get_runner_serialize( + _param = self._delete_legacy_runner_serialize( project_id=project_id, instance_id=instance_id, _request_auth=_request_auth, @@ -2366,7 +2489,7 @@ def get_runner_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Runner", + "204": None, "400": "GenericErrorResponse", "401": None, "404": None, @@ -2375,7 +2498,7 @@ def get_runner_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_runner_serialize( + def _delete_legacy_runner_serialize( self, project_id, instance_id, @@ -2414,7 +2537,7 @@ def _get_runner_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", + method="DELETE", resource_path="/v1beta/projects/{projectId}/instances/{instanceId}/runner", path_params=_path_params, query_params=_query_params, @@ -2429,10 +2552,12 @@ def _get_runner_serialize( ) @validate_call - def list_authentication( + def delete_organization_runner( self, project_id: Annotated[UUID, Field(description="Project identifier.")], instance_id: Annotated[UUID, Field(description="Instance identifier.")], + org: Annotated[StrictStr, Field(description="Organization name.")], + runner_id: Annotated[UUID, Field(description="The UUID of the STACKIT Git Runner.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2442,15 +2567,19 @@ def list_authentication( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> AuthenticationList: - """List authentication sources + ) -> None: + """Delete Organization Runner. - Lists all authentication sources belonging to a specific instance + Deletes the organization-scoped runner associated to this STACKIT Git instance and destroys all associated data. :param project_id: Project identifier. (required) :type project_id: UUID :param instance_id: Instance identifier. (required) :type instance_id: UUID + :param org: Organization name. (required) + :type org: str + :param runner_id: The UUID of the STACKIT Git Runner. (required) + :type runner_id: UUID :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2473,9 +2602,11 @@ def list_authentication( :return: Returns the result object. """ # noqa: E501 - _param = self._list_authentication_serialize( + _param = self._delete_organization_runner_serialize( project_id=project_id, instance_id=instance_id, + org=org, + runner_id=runner_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2483,9 +2614,10 @@ def list_authentication( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AuthenticationList", + "204": None, "400": "BadErrorResponse", - "401": "UnauthorizedErrorResponse", + "401": None, + "404": None, "500": "InternalServerErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2496,10 +2628,12 @@ def list_authentication( ).data @validate_call - def list_authentication_with_http_info( + def delete_organization_runner_with_http_info( self, project_id: Annotated[UUID, Field(description="Project identifier.")], instance_id: Annotated[UUID, Field(description="Instance identifier.")], + org: Annotated[StrictStr, Field(description="Organization name.")], + runner_id: Annotated[UUID, Field(description="The UUID of the STACKIT Git Runner.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2509,15 +2643,19 @@ def list_authentication_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[AuthenticationList]: - """List authentication sources + ) -> ApiResponse[None]: + """Delete Organization Runner. - Lists all authentication sources belonging to a specific instance + Deletes the organization-scoped runner associated to this STACKIT Git instance and destroys all associated data. :param project_id: Project identifier. (required) :type project_id: UUID :param instance_id: Instance identifier. (required) :type instance_id: UUID + :param org: Organization name. (required) + :type org: str + :param runner_id: The UUID of the STACKIT Git Runner. (required) + :type runner_id: UUID :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2540,9 +2678,11 @@ def list_authentication_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_authentication_serialize( + _param = self._delete_organization_runner_serialize( project_id=project_id, instance_id=instance_id, + org=org, + runner_id=runner_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2550,9 +2690,10 @@ def list_authentication_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AuthenticationList", + "204": None, "400": "BadErrorResponse", - "401": "UnauthorizedErrorResponse", + "401": None, + "404": None, "500": "InternalServerErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2563,10 +2704,12 @@ def list_authentication_with_http_info( ) @validate_call - def list_authentication_without_preload_content( + def delete_organization_runner_without_preload_content( self, project_id: Annotated[UUID, Field(description="Project identifier.")], instance_id: Annotated[UUID, Field(description="Instance identifier.")], + org: Annotated[StrictStr, Field(description="Organization name.")], + runner_id: Annotated[UUID, Field(description="The UUID of the STACKIT Git Runner.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2577,14 +2720,18 @@ def list_authentication_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List authentication sources + """Delete Organization Runner. - Lists all authentication sources belonging to a specific instance + Deletes the organization-scoped runner associated to this STACKIT Git instance and destroys all associated data. :param project_id: Project identifier. (required) :type project_id: UUID :param instance_id: Instance identifier. (required) :type instance_id: UUID + :param org: Organization name. (required) + :type org: str + :param runner_id: The UUID of the STACKIT Git Runner. (required) + :type runner_id: UUID :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2607,9 +2754,11 @@ def list_authentication_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_authentication_serialize( + _param = self._delete_organization_runner_serialize( project_id=project_id, instance_id=instance_id, + org=org, + runner_id=runner_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2617,18 +2766,21 @@ def list_authentication_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AuthenticationList", + "204": None, "400": "BadErrorResponse", - "401": "UnauthorizedErrorResponse", + "401": None, + "404": None, "500": "InternalServerErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_authentication_serialize( + def _delete_organization_runner_serialize( self, project_id, instance_id, + org, + runner_id, _request_auth, _content_type, _headers, @@ -2651,6 +2803,10 @@ def _list_authentication_serialize( _path_params["projectId"] = project_id if instance_id is not None: _path_params["instanceId"] = instance_id + if org is not None: + _path_params["org"] = org + if runner_id is not None: + _path_params["runnerId"] = runner_id # process the query parameters # process the header parameters # process the form parameters @@ -2664,8 +2820,8 @@ def _list_authentication_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1beta/projects/{projectId}/instances/{instanceId}/authentications", + method="DELETE", + resource_path="/v1beta/projects/{projectId}/instances/{instanceId}/organizations/{org}/runners/{runnerId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2679,9 +2835,11 @@ def _list_authentication_serialize( ) @validate_call - def list_flavors( + def delete_runner( self, project_id: Annotated[UUID, Field(description="Project identifier.")], + instance_id: Annotated[UUID, Field(description="Instance identifier.")], + runner_id: Annotated[UUID, Field(description="The UUID of the STACKIT Git Runner.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2691,13 +2849,17 @@ def list_flavors( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ListFlavors: - """Returns the details for the given STACKIT Git flavors. + ) -> None: + """Delete Runner. - Provides detailed information about possible Git Flavors. + Deletes the runner associated to this STACKIT Git instance and destroys all associated data. :param project_id: Project identifier. (required) :type project_id: UUID + :param instance_id: Instance identifier. (required) + :type instance_id: UUID + :param runner_id: The UUID of the STACKIT Git Runner. (required) + :type runner_id: UUID :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2720,8 +2882,10 @@ def list_flavors( :return: Returns the result object. """ # noqa: E501 - _param = self._list_flavors_serialize( + _param = self._delete_runner_serialize( project_id=project_id, + instance_id=instance_id, + runner_id=runner_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2729,11 +2893,11 @@ def list_flavors( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListFlavors", - "400": "GenericErrorResponse", + "204": None, + "400": "BadErrorResponse", "401": None, "404": None, - "500": "GenericErrorResponse", + "500": "InternalServerErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -2743,9 +2907,11 @@ def list_flavors( ).data @validate_call - def list_flavors_with_http_info( + def delete_runner_with_http_info( self, project_id: Annotated[UUID, Field(description="Project identifier.")], + instance_id: Annotated[UUID, Field(description="Instance identifier.")], + runner_id: Annotated[UUID, Field(description="The UUID of the STACKIT Git Runner.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2755,13 +2921,17 @@ def list_flavors_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ListFlavors]: - """Returns the details for the given STACKIT Git flavors. + ) -> ApiResponse[None]: + """Delete Runner. - Provides detailed information about possible Git Flavors. + Deletes the runner associated to this STACKIT Git instance and destroys all associated data. :param project_id: Project identifier. (required) :type project_id: UUID + :param instance_id: Instance identifier. (required) + :type instance_id: UUID + :param runner_id: The UUID of the STACKIT Git Runner. (required) + :type runner_id: UUID :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2784,8 +2954,10 @@ def list_flavors_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_flavors_serialize( + _param = self._delete_runner_serialize( project_id=project_id, + instance_id=instance_id, + runner_id=runner_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2793,11 +2965,11 @@ def list_flavors_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListFlavors", - "400": "GenericErrorResponse", + "204": None, + "400": "BadErrorResponse", "401": None, "404": None, - "500": "GenericErrorResponse", + "500": "InternalServerErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -2807,9 +2979,11 @@ def list_flavors_with_http_info( ) @validate_call - def list_flavors_without_preload_content( + def delete_runner_without_preload_content( self, project_id: Annotated[UUID, Field(description="Project identifier.")], + instance_id: Annotated[UUID, Field(description="Instance identifier.")], + runner_id: Annotated[UUID, Field(description="The UUID of the STACKIT Git Runner.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2820,12 +2994,16 @@ def list_flavors_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Returns the details for the given STACKIT Git flavors. + """Delete Runner. - Provides detailed information about possible Git Flavors. + Deletes the runner associated to this STACKIT Git instance and destroys all associated data. :param project_id: Project identifier. (required) :type project_id: UUID + :param instance_id: Instance identifier. (required) + :type instance_id: UUID + :param runner_id: The UUID of the STACKIT Git Runner. (required) + :type runner_id: UUID :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2848,8 +3026,10 @@ def list_flavors_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_flavors_serialize( + _param = self._delete_runner_serialize( project_id=project_id, + instance_id=instance_id, + runner_id=runner_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2857,18 +3037,20 @@ def list_flavors_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListFlavors", - "400": "GenericErrorResponse", + "204": None, + "400": "BadErrorResponse", "401": None, "404": None, - "500": "GenericErrorResponse", + "500": "InternalServerErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_flavors_serialize( + def _delete_runner_serialize( self, project_id, + instance_id, + runner_id, _request_auth, _content_type, _headers, @@ -2889,6 +3071,10 @@ def _list_flavors_serialize( # process the path parameters if project_id is not None: _path_params["projectId"] = project_id + if instance_id is not None: + _path_params["instanceId"] = instance_id + if runner_id is not None: + _path_params["runnerId"] = runner_id # process the query parameters # process the header parameters # process the form parameters @@ -2902,8 +3088,8 @@ def _list_flavors_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1beta/projects/{projectId}/flavors", + method="DELETE", + resource_path="/v1beta/projects/{projectId}/instances/{instanceId}/runners/{runnerId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2917,9 +3103,11 @@ def _list_flavors_serialize( ) @validate_call - def list_instances( + def delete_user( self, project_id: Annotated[UUID, Field(description="Project identifier.")], + instance_id: Annotated[UUID, Field(description="Instance identifier.")], + username: Annotated[StrictStr, Field(description="Instance User identifier.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2929,13 +3117,17 @@ def list_instances( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ListInstances: - """List Instances. + ) -> None: + """Delete Instance User. - Lists all STACKIT Git instances within a project. + Deletes a STACKIT Git instance User and destroys all associated data. :param project_id: Project identifier. (required) :type project_id: UUID + :param instance_id: Instance identifier. (required) + :type instance_id: UUID + :param username: Instance User identifier. (required) + :type username: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2958,8 +3150,10 @@ def list_instances( :return: Returns the result object. """ # noqa: E501 - _param = self._list_instances_serialize( + _param = self._delete_user_serialize( project_id=project_id, + instance_id=instance_id, + username=username, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2967,9 +3161,11 @@ def list_instances( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListInstances", + "204": None, "400": "GenericErrorResponse", "401": None, + "404": None, + "409": None, "500": "GenericErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2980,9 +3176,11 @@ def list_instances( ).data @validate_call - def list_instances_with_http_info( + def delete_user_with_http_info( self, project_id: Annotated[UUID, Field(description="Project identifier.")], + instance_id: Annotated[UUID, Field(description="Instance identifier.")], + username: Annotated[StrictStr, Field(description="Instance User identifier.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2992,13 +3190,17 @@ def list_instances_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ListInstances]: - """List Instances. + ) -> ApiResponse[None]: + """Delete Instance User. - Lists all STACKIT Git instances within a project. + Deletes a STACKIT Git instance User and destroys all associated data. :param project_id: Project identifier. (required) :type project_id: UUID + :param instance_id: Instance identifier. (required) + :type instance_id: UUID + :param username: Instance User identifier. (required) + :type username: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3021,8 +3223,10 @@ def list_instances_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_instances_serialize( + _param = self._delete_user_serialize( project_id=project_id, + instance_id=instance_id, + username=username, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3030,9 +3234,11 @@ def list_instances_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListInstances", + "204": None, "400": "GenericErrorResponse", "401": None, + "404": None, + "409": None, "500": "GenericErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -3043,9 +3249,11 @@ def list_instances_with_http_info( ) @validate_call - def list_instances_without_preload_content( + def delete_user_without_preload_content( self, project_id: Annotated[UUID, Field(description="Project identifier.")], + instance_id: Annotated[UUID, Field(description="Instance identifier.")], + username: Annotated[StrictStr, Field(description="Instance User identifier.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3056,12 +3264,16 @@ def list_instances_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List Instances. + """Delete Instance User. - Lists all STACKIT Git instances within a project. + Deletes a STACKIT Git instance User and destroys all associated data. :param project_id: Project identifier. (required) :type project_id: UUID + :param instance_id: Instance identifier. (required) + :type instance_id: UUID + :param username: Instance User identifier. (required) + :type username: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3084,8 +3296,10 @@ def list_instances_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_instances_serialize( + _param = self._delete_user_serialize( project_id=project_id, + instance_id=instance_id, + username=username, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3093,17 +3307,21 @@ def list_instances_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListInstances", + "204": None, "400": "GenericErrorResponse", "401": None, + "404": None, + "409": None, "500": "GenericErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_instances_serialize( + def _delete_user_serialize( self, project_id, + instance_id, + username, _request_auth, _content_type, _headers, @@ -3124,6 +3342,10 @@ def _list_instances_serialize( # process the path parameters if project_id is not None: _path_params["projectId"] = project_id + if instance_id is not None: + _path_params["instanceId"] = instance_id + if username is not None: + _path_params["username"] = username # process the query parameters # process the header parameters # process the form parameters @@ -3137,8 +3359,8 @@ def _list_instances_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1beta/projects/{projectId}/instances", + method="DELETE", + resource_path="/v1beta/projects/{projectId}/instances/{instanceId}/users/{username}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3152,9 +3374,11 @@ def _list_instances_serialize( ) @validate_call - def list_runner_runtimes( + def get_authentication( self, project_id: Annotated[UUID, Field(description="Project identifier.")], + instance_id: Annotated[UUID, Field(description="Instance identifier.")], + authentication_id: Annotated[UUID, Field(description="Authentication Source identifier.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3164,9 +3388,3261 @@ def list_runner_runtimes( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RunnerRuntimeList: - """list_runner_runtimes - + ) -> Authentication: + """Get authentication provider + + Get authentication provider + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param instance_id: Instance identifier. (required) + :type instance_id: UUID + :param authentication_id: Authentication Source identifier. (required) + :type authentication_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_authentication_serialize( + project_id=project_id, + instance_id=instance_id, + authentication_id=authentication_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Authentication", + "400": "BadErrorResponse", + "401": "UnauthorizedErrorResponse", + "500": "InternalServerErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_authentication_with_http_info( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + instance_id: Annotated[UUID, Field(description="Instance identifier.")], + authentication_id: Annotated[UUID, Field(description="Authentication Source identifier.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Authentication]: + """Get authentication provider + + Get authentication provider + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param instance_id: Instance identifier. (required) + :type instance_id: UUID + :param authentication_id: Authentication Source identifier. (required) + :type authentication_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_authentication_serialize( + project_id=project_id, + instance_id=instance_id, + authentication_id=authentication_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Authentication", + "400": "BadErrorResponse", + "401": "UnauthorizedErrorResponse", + "500": "InternalServerErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_authentication_without_preload_content( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + instance_id: Annotated[UUID, Field(description="Instance identifier.")], + authentication_id: Annotated[UUID, Field(description="Authentication Source identifier.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get authentication provider + + Get authentication provider + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param instance_id: Instance identifier. (required) + :type instance_id: UUID + :param authentication_id: Authentication Source identifier. (required) + :type authentication_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_authentication_serialize( + project_id=project_id, + instance_id=instance_id, + authentication_id=authentication_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Authentication", + "400": "BadErrorResponse", + "401": "UnauthorizedErrorResponse", + "500": "InternalServerErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_authentication_serialize( + self, + project_id, + instance_id, + authentication_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + if instance_id is not None: + _path_params["instanceId"] = instance_id + if authentication_id is not None: + _path_params["authenticationId"] = authentication_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1beta/projects/{projectId}/instances/{instanceId}/authentications/{authenticationId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_instance( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + instance_id: Annotated[UUID, Field(description="Instance identifier.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Instance: + """Get Instance information. + + Retrieves information about a STACKIT Git instance. + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param instance_id: Instance identifier. (required) + :type instance_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_instance_serialize( + project_id=project_id, + instance_id=instance_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Instance", + "400": "GenericErrorResponse", + "401": None, + "404": "GenericErrorResponse", + "500": "GenericErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_instance_with_http_info( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + instance_id: Annotated[UUID, Field(description="Instance identifier.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Instance]: + """Get Instance information. + + Retrieves information about a STACKIT Git instance. + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param instance_id: Instance identifier. (required) + :type instance_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_instance_serialize( + project_id=project_id, + instance_id=instance_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Instance", + "400": "GenericErrorResponse", + "401": None, + "404": "GenericErrorResponse", + "500": "GenericErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_instance_without_preload_content( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + instance_id: Annotated[UUID, Field(description="Instance identifier.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Instance information. + + Retrieves information about a STACKIT Git instance. + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param instance_id: Instance identifier. (required) + :type instance_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_instance_serialize( + project_id=project_id, + instance_id=instance_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Instance", + "400": "GenericErrorResponse", + "401": None, + "404": "GenericErrorResponse", + "500": "GenericErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_instance_serialize( + self, + project_id, + instance_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + if instance_id is not None: + _path_params["instanceId"] = instance_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1beta/projects/{projectId}/instances/{instanceId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_legacy_runner( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + instance_id: Annotated[UUID, Field(description="Instance identifier.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Runner: + """(Deprecated) Get Runner information (deprecated). + + Deprecated: Use `/v1beta/projects/{projectId}/instances/{instanceId}/runners/{runnerId}` or `/v1beta/projects/{projectId}/instances/{instanceId}/runners` instead. Retrieves information about the legacy runner in a STACKIT Git instance. + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param instance_id: Instance identifier. (required) + :type instance_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn( + "GET /v1beta/projects/{projectId}/instances/{instanceId}/runner is deprecated.", DeprecationWarning + ) + + _param = self._get_legacy_runner_serialize( + project_id=project_id, + instance_id=instance_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Runner", + "400": "GenericErrorResponse", + "401": None, + "404": None, + "500": "GenericErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_legacy_runner_with_http_info( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + instance_id: Annotated[UUID, Field(description="Instance identifier.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Runner]: + """(Deprecated) Get Runner information (deprecated). + + Deprecated: Use `/v1beta/projects/{projectId}/instances/{instanceId}/runners/{runnerId}` or `/v1beta/projects/{projectId}/instances/{instanceId}/runners` instead. Retrieves information about the legacy runner in a STACKIT Git instance. + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param instance_id: Instance identifier. (required) + :type instance_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn( + "GET /v1beta/projects/{projectId}/instances/{instanceId}/runner is deprecated.", DeprecationWarning + ) + + _param = self._get_legacy_runner_serialize( + project_id=project_id, + instance_id=instance_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Runner", + "400": "GenericErrorResponse", + "401": None, + "404": None, + "500": "GenericErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_legacy_runner_without_preload_content( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + instance_id: Annotated[UUID, Field(description="Instance identifier.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """(Deprecated) Get Runner information (deprecated). + + Deprecated: Use `/v1beta/projects/{projectId}/instances/{instanceId}/runners/{runnerId}` or `/v1beta/projects/{projectId}/instances/{instanceId}/runners` instead. Retrieves information about the legacy runner in a STACKIT Git instance. + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param instance_id: Instance identifier. (required) + :type instance_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn( + "GET /v1beta/projects/{projectId}/instances/{instanceId}/runner is deprecated.", DeprecationWarning + ) + + _param = self._get_legacy_runner_serialize( + project_id=project_id, + instance_id=instance_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Runner", + "400": "GenericErrorResponse", + "401": None, + "404": None, + "500": "GenericErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_legacy_runner_serialize( + self, + project_id, + instance_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + if instance_id is not None: + _path_params["instanceId"] = instance_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1beta/projects/{projectId}/instances/{instanceId}/runner", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_organization_teams( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + instance_id: Annotated[UUID, Field(description="Instance identifier.")], + org: Annotated[StrictStr, Field(description="Organization name.")], + page: Annotated[ + Optional[Annotated[int, Field(strict=True, ge=1)]], + Field(description="Page number for pagination (1-indexed). Each page contains up to 50 teams."), + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ListOrganizationTeams: + """Get Organization Teams. + + Lists all STACKIT Git Organization Teams within an instance. Supports pagination via the optional `page` query parameter. Each page returns up to 50 teams. + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param instance_id: Instance identifier. (required) + :type instance_id: UUID + :param org: Organization name. (required) + :type org: str + :param page: Page number for pagination (1-indexed). Each page contains up to 50 teams. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_organization_teams_serialize( + project_id=project_id, + instance_id=instance_id, + org=org, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ListOrganizationTeams", + "400": "GenericErrorResponse", + "401": None, + "404": "GenericErrorResponse", + "500": "GenericErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_organization_teams_with_http_info( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + instance_id: Annotated[UUID, Field(description="Instance identifier.")], + org: Annotated[StrictStr, Field(description="Organization name.")], + page: Annotated[ + Optional[Annotated[int, Field(strict=True, ge=1)]], + Field(description="Page number for pagination (1-indexed). Each page contains up to 50 teams."), + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ListOrganizationTeams]: + """Get Organization Teams. + + Lists all STACKIT Git Organization Teams within an instance. Supports pagination via the optional `page` query parameter. Each page returns up to 50 teams. + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param instance_id: Instance identifier. (required) + :type instance_id: UUID + :param org: Organization name. (required) + :type org: str + :param page: Page number for pagination (1-indexed). Each page contains up to 50 teams. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_organization_teams_serialize( + project_id=project_id, + instance_id=instance_id, + org=org, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ListOrganizationTeams", + "400": "GenericErrorResponse", + "401": None, + "404": "GenericErrorResponse", + "500": "GenericErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_organization_teams_without_preload_content( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + instance_id: Annotated[UUID, Field(description="Instance identifier.")], + org: Annotated[StrictStr, Field(description="Organization name.")], + page: Annotated[ + Optional[Annotated[int, Field(strict=True, ge=1)]], + Field(description="Page number for pagination (1-indexed). Each page contains up to 50 teams."), + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Organization Teams. + + Lists all STACKIT Git Organization Teams within an instance. Supports pagination via the optional `page` query parameter. Each page returns up to 50 teams. + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param instance_id: Instance identifier. (required) + :type instance_id: UUID + :param org: Organization name. (required) + :type org: str + :param page: Page number for pagination (1-indexed). Each page contains up to 50 teams. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_organization_teams_serialize( + project_id=project_id, + instance_id=instance_id, + org=org, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ListOrganizationTeams", + "400": "GenericErrorResponse", + "401": None, + "404": "GenericErrorResponse", + "500": "GenericErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_organization_teams_serialize( + self, + project_id, + instance_id, + org, + page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + if instance_id is not None: + _path_params["instanceId"] = instance_id + if org is not None: + _path_params["org"] = org + # process the query parameters + if page is not None: + + _query_params.append(("page", page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1beta/projects/{projectId}/instances/{instanceId}/organizations/{org}/teams", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_organizations( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + instance_id: Annotated[UUID, Field(description="Instance identifier.")], + page: Annotated[ + Optional[Annotated[int, Field(strict=True, ge=1)]], + Field(description="Page number for pagination (1-indexed). Each page contains up to 50 organizations."), + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ListOrganizations: + """Get instance Organizations. + + Lists all STACKIT Git Organizations within an instance. Supports pagination via the optional `page` query parameter. Each page returns up to 50 organizations. + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param instance_id: Instance identifier. (required) + :type instance_id: UUID + :param page: Page number for pagination (1-indexed). Each page contains up to 50 organizations. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_organizations_serialize( + project_id=project_id, + instance_id=instance_id, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ListOrganizations", + "400": "GenericErrorResponse", + "401": None, + "404": "GenericErrorResponse", + "500": "GenericErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_organizations_with_http_info( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + instance_id: Annotated[UUID, Field(description="Instance identifier.")], + page: Annotated[ + Optional[Annotated[int, Field(strict=True, ge=1)]], + Field(description="Page number for pagination (1-indexed). Each page contains up to 50 organizations."), + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ListOrganizations]: + """Get instance Organizations. + + Lists all STACKIT Git Organizations within an instance. Supports pagination via the optional `page` query parameter. Each page returns up to 50 organizations. + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param instance_id: Instance identifier. (required) + :type instance_id: UUID + :param page: Page number for pagination (1-indexed). Each page contains up to 50 organizations. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_organizations_serialize( + project_id=project_id, + instance_id=instance_id, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ListOrganizations", + "400": "GenericErrorResponse", + "401": None, + "404": "GenericErrorResponse", + "500": "GenericErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_organizations_without_preload_content( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + instance_id: Annotated[UUID, Field(description="Instance identifier.")], + page: Annotated[ + Optional[Annotated[int, Field(strict=True, ge=1)]], + Field(description="Page number for pagination (1-indexed). Each page contains up to 50 organizations."), + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get instance Organizations. + + Lists all STACKIT Git Organizations within an instance. Supports pagination via the optional `page` query parameter. Each page returns up to 50 organizations. + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param instance_id: Instance identifier. (required) + :type instance_id: UUID + :param page: Page number for pagination (1-indexed). Each page contains up to 50 organizations. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_organizations_serialize( + project_id=project_id, + instance_id=instance_id, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ListOrganizations", + "400": "GenericErrorResponse", + "401": None, + "404": "GenericErrorResponse", + "500": "GenericErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_organizations_serialize( + self, + project_id, + instance_id, + page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + if instance_id is not None: + _path_params["instanceId"] = instance_id + # process the query parameters + if page is not None: + + _query_params.append(("page", page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1beta/projects/{projectId}/instances/{instanceId}/organizations", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_runner( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + instance_id: Annotated[UUID, Field(description="Instance identifier.")], + runner_id: Annotated[UUID, Field(description="The UUID of the STACKIT Git Runner.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Runner: + """Get Runner information. + + Retrieves information about a runner in a STACKIT Git instance. + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param instance_id: Instance identifier. (required) + :type instance_id: UUID + :param runner_id: The UUID of the STACKIT Git Runner. (required) + :type runner_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_runner_serialize( + project_id=project_id, + instance_id=instance_id, + runner_id=runner_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Runner", + "400": "BadErrorResponse", + "401": None, + "404": None, + "500": "InternalServerErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_runner_with_http_info( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + instance_id: Annotated[UUID, Field(description="Instance identifier.")], + runner_id: Annotated[UUID, Field(description="The UUID of the STACKIT Git Runner.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Runner]: + """Get Runner information. + + Retrieves information about a runner in a STACKIT Git instance. + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param instance_id: Instance identifier. (required) + :type instance_id: UUID + :param runner_id: The UUID of the STACKIT Git Runner. (required) + :type runner_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_runner_serialize( + project_id=project_id, + instance_id=instance_id, + runner_id=runner_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Runner", + "400": "BadErrorResponse", + "401": None, + "404": None, + "500": "InternalServerErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_runner_without_preload_content( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + instance_id: Annotated[UUID, Field(description="Instance identifier.")], + runner_id: Annotated[UUID, Field(description="The UUID of the STACKIT Git Runner.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Runner information. + + Retrieves information about a runner in a STACKIT Git instance. + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param instance_id: Instance identifier. (required) + :type instance_id: UUID + :param runner_id: The UUID of the STACKIT Git Runner. (required) + :type runner_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_runner_serialize( + project_id=project_id, + instance_id=instance_id, + runner_id=runner_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Runner", + "400": "BadErrorResponse", + "401": None, + "404": None, + "500": "InternalServerErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_runner_serialize( + self, + project_id, + instance_id, + runner_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + if instance_id is not None: + _path_params["instanceId"] = instance_id + if runner_id is not None: + _path_params["runnerId"] = runner_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1beta/projects/{projectId}/instances/{instanceId}/runners/{runnerId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_user( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + instance_id: Annotated[UUID, Field(description="Instance identifier.")], + username: Annotated[StrictStr, Field(description="Instance User identifier.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Get Instance User information. + + Retrieves information about a STACKIT Git instance User. + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param instance_id: Instance identifier. (required) + :type instance_id: UUID + :param username: Instance User identifier. (required) + :type username: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_user_serialize( + project_id=project_id, + instance_id=instance_id, + username=username, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "302": "User", + "400": "GenericErrorResponse", + "401": None, + "404": None, + "500": "GenericErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_user_with_http_info( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + instance_id: Annotated[UUID, Field(description="Instance identifier.")], + username: Annotated[StrictStr, Field(description="Instance User identifier.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Get Instance User information. + + Retrieves information about a STACKIT Git instance User. + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param instance_id: Instance identifier. (required) + :type instance_id: UUID + :param username: Instance User identifier. (required) + :type username: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_user_serialize( + project_id=project_id, + instance_id=instance_id, + username=username, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "302": "User", + "400": "GenericErrorResponse", + "401": None, + "404": None, + "500": "GenericErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_user_without_preload_content( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + instance_id: Annotated[UUID, Field(description="Instance identifier.")], + username: Annotated[StrictStr, Field(description="Instance User identifier.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Instance User information. + + Retrieves information about a STACKIT Git instance User. + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param instance_id: Instance identifier. (required) + :type instance_id: UUID + :param username: Instance User identifier. (required) + :type username: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_user_serialize( + project_id=project_id, + instance_id=instance_id, + username=username, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "302": "User", + "400": "GenericErrorResponse", + "401": None, + "404": None, + "500": "GenericErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_user_serialize( + self, + project_id, + instance_id, + username, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + if instance_id is not None: + _path_params["instanceId"] = instance_id + if username is not None: + _path_params["username"] = username + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1beta/projects/{projectId}/instances/{instanceId}/users/{username}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_users( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + instance_id: Annotated[UUID, Field(description="Instance identifier.")], + page: Annotated[ + Optional[Annotated[int, Field(strict=True, ge=1)]], + Field(description="Page number for pagination (1-indexed). Each page contains up to 50 users."), + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ListUsers: + """Get instance Users. + + Lists STACKIT Git Users within an instance. Supports pagination via the optional `page` query parameter. Each page returns up to 50 users. + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param instance_id: Instance identifier. (required) + :type instance_id: UUID + :param page: Page number for pagination (1-indexed). Each page contains up to 50 users. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_users_serialize( + project_id=project_id, + instance_id=instance_id, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ListUsers", + "400": "GenericErrorResponse", + "401": None, + "500": "GenericErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_users_with_http_info( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + instance_id: Annotated[UUID, Field(description="Instance identifier.")], + page: Annotated[ + Optional[Annotated[int, Field(strict=True, ge=1)]], + Field(description="Page number for pagination (1-indexed). Each page contains up to 50 users."), + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ListUsers]: + """Get instance Users. + + Lists STACKIT Git Users within an instance. Supports pagination via the optional `page` query parameter. Each page returns up to 50 users. + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param instance_id: Instance identifier. (required) + :type instance_id: UUID + :param page: Page number for pagination (1-indexed). Each page contains up to 50 users. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_users_serialize( + project_id=project_id, + instance_id=instance_id, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ListUsers", + "400": "GenericErrorResponse", + "401": None, + "500": "GenericErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_users_without_preload_content( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + instance_id: Annotated[UUID, Field(description="Instance identifier.")], + page: Annotated[ + Optional[Annotated[int, Field(strict=True, ge=1)]], + Field(description="Page number for pagination (1-indexed). Each page contains up to 50 users."), + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get instance Users. + + Lists STACKIT Git Users within an instance. Supports pagination via the optional `page` query parameter. Each page returns up to 50 users. + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param instance_id: Instance identifier. (required) + :type instance_id: UUID + :param page: Page number for pagination (1-indexed). Each page contains up to 50 users. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_users_serialize( + project_id=project_id, + instance_id=instance_id, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ListUsers", + "400": "GenericErrorResponse", + "401": None, + "500": "GenericErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_users_serialize( + self, + project_id, + instance_id, + page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + if instance_id is not None: + _path_params["instanceId"] = instance_id + # process the query parameters + if page is not None: + + _query_params.append(("page", page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1beta/projects/{projectId}/instances/{instanceId}/users", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_authentication( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + instance_id: Annotated[UUID, Field(description="Instance identifier.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AuthenticationList: + """List authentication sources + + Lists all authentication sources belonging to a specific instance + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param instance_id: Instance identifier. (required) + :type instance_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_authentication_serialize( + project_id=project_id, + instance_id=instance_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "AuthenticationList", + "400": "BadErrorResponse", + "401": "UnauthorizedErrorResponse", + "500": "InternalServerErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_authentication_with_http_info( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + instance_id: Annotated[UUID, Field(description="Instance identifier.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AuthenticationList]: + """List authentication sources + + Lists all authentication sources belonging to a specific instance + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param instance_id: Instance identifier. (required) + :type instance_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_authentication_serialize( + project_id=project_id, + instance_id=instance_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "AuthenticationList", + "400": "BadErrorResponse", + "401": "UnauthorizedErrorResponse", + "500": "InternalServerErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_authentication_without_preload_content( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + instance_id: Annotated[UUID, Field(description="Instance identifier.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List authentication sources + + Lists all authentication sources belonging to a specific instance + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param instance_id: Instance identifier. (required) + :type instance_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_authentication_serialize( + project_id=project_id, + instance_id=instance_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "AuthenticationList", + "400": "BadErrorResponse", + "401": "UnauthorizedErrorResponse", + "500": "InternalServerErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_authentication_serialize( + self, + project_id, + instance_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + if instance_id is not None: + _path_params["instanceId"] = instance_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1beta/projects/{projectId}/instances/{instanceId}/authentications", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_flavors( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ListFlavors: + """Returns the details for the given STACKIT Git flavors. + + Provides detailed information about possible Git Flavors. + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_flavors_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ListFlavors", + "400": "GenericErrorResponse", + "401": None, + "404": None, + "500": "GenericErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_flavors_with_http_info( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ListFlavors]: + """Returns the details for the given STACKIT Git flavors. + + Provides detailed information about possible Git Flavors. + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_flavors_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ListFlavors", + "400": "GenericErrorResponse", + "401": None, + "404": None, + "500": "GenericErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_flavors_without_preload_content( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Returns the details for the given STACKIT Git flavors. + + Provides detailed information about possible Git Flavors. + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_flavors_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ListFlavors", + "400": "GenericErrorResponse", + "401": None, + "404": None, + "500": "GenericErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_flavors_serialize( + self, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1beta/projects/{projectId}/flavors", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_instances( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ListInstances: + """List Instances. + + Lists all STACKIT Git instances within a project. + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_instances_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ListInstances", + "400": "GenericErrorResponse", + "401": None, + "500": "GenericErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_instances_with_http_info( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ListInstances]: + """List Instances. + + Lists all STACKIT Git instances within a project. + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_instances_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ListInstances", + "400": "GenericErrorResponse", + "401": None, + "500": "GenericErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_instances_without_preload_content( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Instances. + + Lists all STACKIT Git instances within a project. + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_instances_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ListInstances", + "400": "GenericErrorResponse", + "401": None, + "500": "GenericErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_instances_serialize( + self, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1beta/projects/{projectId}/instances", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_runner_families( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RunnerFamilyList: + """list_runner_families + + A list of runner families that are available for the project. + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_runner_families_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "RunnerFamilyList", + "400": "GenericErrorResponse", + "401": None, + "404": "GenericErrorResponse", + "500": "GenericErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_runner_families_with_http_info( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RunnerFamilyList]: + """list_runner_families + + A list of runner families that are available for the project. + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_runner_families_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "RunnerFamilyList", + "400": "GenericErrorResponse", + "401": None, + "404": "GenericErrorResponse", + "500": "GenericErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_runner_families_without_preload_content( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list_runner_families + + A list of runner families that are available for the project. + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_runner_families_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "RunnerFamilyList", + "400": "GenericErrorResponse", + "401": None, + "404": "GenericErrorResponse", + "500": "GenericErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_runner_families_serialize( + self, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1beta/projects/{projectId}/runner-families", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_runner_runtimes( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RunnerRuntimeList: + """list_runner_runtimes + + A list of runner runtimes that are available to be enabled for the project. + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_runner_runtimes_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "RunnerRuntimeList", + "400": "GenericErrorResponse", + "401": None, + "404": "GenericErrorResponse", + "500": "GenericErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_runner_runtimes_with_http_info( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RunnerRuntimeList]: + """list_runner_runtimes + + A list of runner runtimes that are available to be enabled for the project. + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_runner_runtimes_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "RunnerRuntimeList", + "400": "GenericErrorResponse", + "401": None, + "404": "GenericErrorResponse", + "500": "GenericErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_runner_runtimes_without_preload_content( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list_runner_runtimes + A list of runner runtimes that are available to be enabled for the project. :param project_id: Project identifier. (required) @@ -3193,8 +6669,965 @@ def list_runner_runtimes( :return: Returns the result object. """ # noqa: E501 - _param = self._list_runner_runtimes_serialize( + _param = self._list_runner_runtimes_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "RunnerRuntimeList", + "400": "GenericErrorResponse", + "401": None, + "404": "GenericErrorResponse", + "500": "GenericErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_runner_runtimes_serialize( + self, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1beta/projects/{projectId}/runner-runtimes", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_runners( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + instance_id: Annotated[UUID, Field(description="Instance identifier.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RunnerList: + """List Runners. + + Lists all STACKIT Git runners belonging to an instance. + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param instance_id: Instance identifier. (required) + :type instance_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_runners_serialize( + project_id=project_id, + instance_id=instance_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "RunnerList", + "400": "BadErrorResponse", + "401": None, + "404": None, + "500": "InternalServerErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_runners_with_http_info( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + instance_id: Annotated[UUID, Field(description="Instance identifier.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RunnerList]: + """List Runners. + + Lists all STACKIT Git runners belonging to an instance. + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param instance_id: Instance identifier. (required) + :type instance_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_runners_serialize( + project_id=project_id, + instance_id=instance_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "RunnerList", + "400": "BadErrorResponse", + "401": None, + "404": None, + "500": "InternalServerErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_runners_without_preload_content( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + instance_id: Annotated[UUID, Field(description="Instance identifier.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Runners. + + Lists all STACKIT Git runners belonging to an instance. + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param instance_id: Instance identifier. (required) + :type instance_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_runners_serialize( + project_id=project_id, + instance_id=instance_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "RunnerList", + "400": "BadErrorResponse", + "401": None, + "404": None, + "500": "InternalServerErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_runners_serialize( + self, + project_id, + instance_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + if instance_id is not None: + _path_params["instanceId"] = instance_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1beta/projects/{projectId}/instances/{instanceId}/runners", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def patch_authentication( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + instance_id: Annotated[UUID, Field(description="Instance identifier.")], + authentication_id: Annotated[UUID, Field(description="Authentication Source identifier.")], + patch_authentication_payload: Annotated[ + PatchAuthenticationPayload, Field(description="Authentication Definition configuration data.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Authentication: + """Patch Authentication. + + Patches the Authentication Provider. + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param instance_id: Instance identifier. (required) + :type instance_id: UUID + :param authentication_id: Authentication Source identifier. (required) + :type authentication_id: UUID + :param patch_authentication_payload: Authentication Definition configuration data. (required) + :type patch_authentication_payload: PatchAuthenticationPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._patch_authentication_serialize( + project_id=project_id, + instance_id=instance_id, + authentication_id=authentication_id, + patch_authentication_payload=patch_authentication_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "202": "Authentication", + "400": "BadErrorResponse", + "401": "UnauthorizedErrorResponse", + "404": "NotFoundErrorResponse", + "500": "InternalServerErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def patch_authentication_with_http_info( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + instance_id: Annotated[UUID, Field(description="Instance identifier.")], + authentication_id: Annotated[UUID, Field(description="Authentication Source identifier.")], + patch_authentication_payload: Annotated[ + PatchAuthenticationPayload, Field(description="Authentication Definition configuration data.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Authentication]: + """Patch Authentication. + + Patches the Authentication Provider. + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param instance_id: Instance identifier. (required) + :type instance_id: UUID + :param authentication_id: Authentication Source identifier. (required) + :type authentication_id: UUID + :param patch_authentication_payload: Authentication Definition configuration data. (required) + :type patch_authentication_payload: PatchAuthenticationPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._patch_authentication_serialize( + project_id=project_id, + instance_id=instance_id, + authentication_id=authentication_id, + patch_authentication_payload=patch_authentication_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "202": "Authentication", + "400": "BadErrorResponse", + "401": "UnauthorizedErrorResponse", + "404": "NotFoundErrorResponse", + "500": "InternalServerErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def patch_authentication_without_preload_content( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + instance_id: Annotated[UUID, Field(description="Instance identifier.")], + authentication_id: Annotated[UUID, Field(description="Authentication Source identifier.")], + patch_authentication_payload: Annotated[ + PatchAuthenticationPayload, Field(description="Authentication Definition configuration data.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Patch Authentication. + + Patches the Authentication Provider. + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param instance_id: Instance identifier. (required) + :type instance_id: UUID + :param authentication_id: Authentication Source identifier. (required) + :type authentication_id: UUID + :param patch_authentication_payload: Authentication Definition configuration data. (required) + :type patch_authentication_payload: PatchAuthenticationPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._patch_authentication_serialize( + project_id=project_id, + instance_id=instance_id, + authentication_id=authentication_id, + patch_authentication_payload=patch_authentication_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "202": "Authentication", + "400": "BadErrorResponse", + "401": "UnauthorizedErrorResponse", + "404": "NotFoundErrorResponse", + "500": "InternalServerErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _patch_authentication_serialize( + self, + project_id, + instance_id, + authentication_id, + patch_authentication_payload, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + if instance_id is not None: + _path_params["instanceId"] = instance_id + if authentication_id is not None: + _path_params["authenticationId"] = authentication_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if patch_authentication_payload is not None: + _body_params = patch_authentication_payload + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="PATCH", + resource_path="/v1beta/projects/{projectId}/instances/{instanceId}/authentications/{authenticationId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def patch_instance( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + instance_id: Annotated[UUID, Field(description="Instance identifier.")], + patch_instance_payload: PatchInstancePayload, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Instance: + """Patch Instance. + + Patches the Instance. + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param instance_id: Instance identifier. (required) + :type instance_id: UUID + :param patch_instance_payload: (required) + :type patch_instance_payload: PatchInstancePayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._patch_instance_serialize( + project_id=project_id, + instance_id=instance_id, + patch_instance_payload=patch_instance_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Instance", + "202": None, + "400": "GenericErrorResponse", + "401": None, + "404": None, + "409": None, + "500": "GenericErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def patch_instance_with_http_info( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + instance_id: Annotated[UUID, Field(description="Instance identifier.")], + patch_instance_payload: PatchInstancePayload, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Instance]: + """Patch Instance. + + Patches the Instance. + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param instance_id: Instance identifier. (required) + :type instance_id: UUID + :param patch_instance_payload: (required) + :type patch_instance_payload: PatchInstancePayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._patch_instance_serialize( + project_id=project_id, + instance_id=instance_id, + patch_instance_payload=patch_instance_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Instance", + "202": None, + "400": "GenericErrorResponse", + "401": None, + "404": None, + "409": None, + "500": "GenericErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def patch_instance_without_preload_content( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + instance_id: Annotated[UUID, Field(description="Instance identifier.")], + patch_instance_payload: PatchInstancePayload, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Patch Instance. + + Patches the Instance. + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param instance_id: Instance identifier. (required) + :type instance_id: UUID + :param patch_instance_payload: (required) + :type patch_instance_payload: PatchInstancePayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._patch_instance_serialize( + project_id=project_id, + instance_id=instance_id, + patch_instance_payload=patch_instance_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Instance", + "202": None, + "400": "GenericErrorResponse", + "401": None, + "404": None, + "409": None, + "500": "GenericErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _patch_instance_serialize( + self, + project_id, + instance_id, + patch_instance_payload, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + if instance_id is not None: + _path_params["instanceId"] = instance_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if patch_instance_payload is not None: + _body_params = patch_instance_payload + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json", "application/json-patch+json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="PATCH", + resource_path="/v1beta/projects/{projectId}/instances/{instanceId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def patch_legacy_runner( + self, + project_id: Annotated[UUID, Field(description="Project identifier.")], + instance_id: Annotated[UUID, Field(description="Instance identifier.")], + patch_legacy_runner_payload: Annotated[ + PatchLegacyRunnerPayload, Field(description="Runner Definition configuration data.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Runner: + """(Deprecated) Patch Runner (deprecated). + + Deprecated: Use `/v1beta/projects/{projectId}/instances/{instanceId}/runners/{runnerId}` instead. Patches the Runner information. + + :param project_id: Project identifier. (required) + :type project_id: UUID + :param instance_id: Instance identifier. (required) + :type instance_id: UUID + :param patch_legacy_runner_payload: Runner Definition configuration data. (required) + :type patch_legacy_runner_payload: PatchLegacyRunnerPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn( + "PATCH /v1beta/projects/{projectId}/instances/{instanceId}/runner is deprecated.", DeprecationWarning + ) + + _param = self._patch_legacy_runner_serialize( project_id=project_id, + instance_id=instance_id, + patch_legacy_runner_payload=patch_legacy_runner_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3202,11 +7635,11 @@ def list_runner_runtimes( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "RunnerRuntimeList", - "400": "GenericErrorResponse", - "401": None, - "404": "GenericErrorResponse", - "500": "GenericErrorResponse", + "202": "Runner", + "400": "BadErrorResponse", + "401": "UnauthorizedErrorResponse", + "404": "NotFoundErrorResponse", + "500": "InternalServerErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -3216,9 +7649,13 @@ def list_runner_runtimes( ).data @validate_call - def list_runner_runtimes_with_http_info( + def patch_legacy_runner_with_http_info( self, project_id: Annotated[UUID, Field(description="Project identifier.")], + instance_id: Annotated[UUID, Field(description="Instance identifier.")], + patch_legacy_runner_payload: Annotated[ + PatchLegacyRunnerPayload, Field(description="Runner Definition configuration data.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3228,13 +7665,17 @@ def list_runner_runtimes_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[RunnerRuntimeList]: - """list_runner_runtimes + ) -> ApiResponse[Runner]: + """(Deprecated) Patch Runner (deprecated). - A list of runner runtimes that are available to be enabled for the project. + Deprecated: Use `/v1beta/projects/{projectId}/instances/{instanceId}/runners/{runnerId}` instead. Patches the Runner information. :param project_id: Project identifier. (required) :type project_id: UUID + :param instance_id: Instance identifier. (required) + :type instance_id: UUID + :param patch_legacy_runner_payload: Runner Definition configuration data. (required) + :type patch_legacy_runner_payload: PatchLegacyRunnerPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3256,9 +7697,14 @@ def list_runner_runtimes_with_http_info( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn( + "PATCH /v1beta/projects/{projectId}/instances/{instanceId}/runner is deprecated.", DeprecationWarning + ) - _param = self._list_runner_runtimes_serialize( + _param = self._patch_legacy_runner_serialize( project_id=project_id, + instance_id=instance_id, + patch_legacy_runner_payload=patch_legacy_runner_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3266,11 +7712,11 @@ def list_runner_runtimes_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "RunnerRuntimeList", - "400": "GenericErrorResponse", - "401": None, - "404": "GenericErrorResponse", - "500": "GenericErrorResponse", + "202": "Runner", + "400": "BadErrorResponse", + "401": "UnauthorizedErrorResponse", + "404": "NotFoundErrorResponse", + "500": "InternalServerErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -3280,9 +7726,13 @@ def list_runner_runtimes_with_http_info( ) @validate_call - def list_runner_runtimes_without_preload_content( + def patch_legacy_runner_without_preload_content( self, project_id: Annotated[UUID, Field(description="Project identifier.")], + instance_id: Annotated[UUID, Field(description="Instance identifier.")], + patch_legacy_runner_payload: Annotated[ + PatchLegacyRunnerPayload, Field(description="Runner Definition configuration data.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3293,12 +7743,16 @@ def list_runner_runtimes_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """list_runner_runtimes + """(Deprecated) Patch Runner (deprecated). - A list of runner runtimes that are available to be enabled for the project. + Deprecated: Use `/v1beta/projects/{projectId}/instances/{instanceId}/runners/{runnerId}` instead. Patches the Runner information. :param project_id: Project identifier. (required) :type project_id: UUID + :param instance_id: Instance identifier. (required) + :type instance_id: UUID + :param patch_legacy_runner_payload: Runner Definition configuration data. (required) + :type patch_legacy_runner_payload: PatchLegacyRunnerPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3320,9 +7774,14 @@ def list_runner_runtimes_without_preload_content( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn( + "PATCH /v1beta/projects/{projectId}/instances/{instanceId}/runner is deprecated.", DeprecationWarning + ) - _param = self._list_runner_runtimes_serialize( + _param = self._patch_legacy_runner_serialize( project_id=project_id, + instance_id=instance_id, + patch_legacy_runner_payload=patch_legacy_runner_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3330,18 +7789,20 @@ def list_runner_runtimes_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "RunnerRuntimeList", - "400": "GenericErrorResponse", - "401": None, - "404": "GenericErrorResponse", - "500": "GenericErrorResponse", + "202": "Runner", + "400": "BadErrorResponse", + "401": "UnauthorizedErrorResponse", + "404": "NotFoundErrorResponse", + "500": "InternalServerErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_runner_runtimes_serialize( + def _patch_legacy_runner_serialize( self, project_id, + instance_id, + patch_legacy_runner_payload, _request_auth, _content_type, _headers, @@ -3362,21 +7823,33 @@ def _list_runner_runtimes_serialize( # process the path parameters if project_id is not None: _path_params["projectId"] = project_id + if instance_id is not None: + _path_params["instanceId"] = instance_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + if patch_legacy_runner_payload is not None: + _body_params = patch_legacy_runner_payload # set the HTTP header `Accept` if "Accept" not in _header_params: _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + # authentication setting _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1beta/projects/{projectId}/runner-runtimes", + method="PATCH", + resource_path="/v1beta/projects/{projectId}/instances/{instanceId}/runner", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3390,14 +7863,12 @@ def _list_runner_runtimes_serialize( ) @validate_call - def patch_authentication( + def patch_runner( self, project_id: Annotated[UUID, Field(description="Project identifier.")], instance_id: Annotated[UUID, Field(description="Instance identifier.")], - authentication_id: Annotated[UUID, Field(description="Authentication Source identifier.")], - patch_authentication_payload: Annotated[ - PatchAuthenticationPayload, Field(description="Authentication Definition configuration data.") - ], + runner_id: Annotated[UUID, Field(description="The UUID of the STACKIT Git Runner.")], + patch_runner_payload: Annotated[PatchRunnerPayload, Field(description="Runner Definition configuration data.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3407,19 +7878,19 @@ def patch_authentication( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Authentication: - """Patch Authentication. + ) -> Runner: + """Patch Runner. - Patches the Authentication Provider. + Patches the Runner information. :param project_id: Project identifier. (required) :type project_id: UUID :param instance_id: Instance identifier. (required) :type instance_id: UUID - :param authentication_id: Authentication Source identifier. (required) - :type authentication_id: UUID - :param patch_authentication_payload: Authentication Definition configuration data. (required) - :type patch_authentication_payload: PatchAuthenticationPayload + :param runner_id: The UUID of the STACKIT Git Runner. (required) + :type runner_id: UUID + :param patch_runner_payload: Runner Definition configuration data. (required) + :type patch_runner_payload: PatchRunnerPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3442,11 +7913,11 @@ def patch_authentication( :return: Returns the result object. """ # noqa: E501 - _param = self._patch_authentication_serialize( + _param = self._patch_runner_serialize( project_id=project_id, instance_id=instance_id, - authentication_id=authentication_id, - patch_authentication_payload=patch_authentication_payload, + runner_id=runner_id, + patch_runner_payload=patch_runner_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3454,7 +7925,7 @@ def patch_authentication( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "Authentication", + "202": "Runner", "400": "BadErrorResponse", "401": "UnauthorizedErrorResponse", "404": "NotFoundErrorResponse", @@ -3468,14 +7939,12 @@ def patch_authentication( ).data @validate_call - def patch_authentication_with_http_info( + def patch_runner_with_http_info( self, project_id: Annotated[UUID, Field(description="Project identifier.")], instance_id: Annotated[UUID, Field(description="Instance identifier.")], - authentication_id: Annotated[UUID, Field(description="Authentication Source identifier.")], - patch_authentication_payload: Annotated[ - PatchAuthenticationPayload, Field(description="Authentication Definition configuration data.") - ], + runner_id: Annotated[UUID, Field(description="The UUID of the STACKIT Git Runner.")], + patch_runner_payload: Annotated[PatchRunnerPayload, Field(description="Runner Definition configuration data.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3485,19 +7954,19 @@ def patch_authentication_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Authentication]: - """Patch Authentication. + ) -> ApiResponse[Runner]: + """Patch Runner. - Patches the Authentication Provider. + Patches the Runner information. :param project_id: Project identifier. (required) :type project_id: UUID :param instance_id: Instance identifier. (required) :type instance_id: UUID - :param authentication_id: Authentication Source identifier. (required) - :type authentication_id: UUID - :param patch_authentication_payload: Authentication Definition configuration data. (required) - :type patch_authentication_payload: PatchAuthenticationPayload + :param runner_id: The UUID of the STACKIT Git Runner. (required) + :type runner_id: UUID + :param patch_runner_payload: Runner Definition configuration data. (required) + :type patch_runner_payload: PatchRunnerPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3520,11 +7989,11 @@ def patch_authentication_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._patch_authentication_serialize( + _param = self._patch_runner_serialize( project_id=project_id, instance_id=instance_id, - authentication_id=authentication_id, - patch_authentication_payload=patch_authentication_payload, + runner_id=runner_id, + patch_runner_payload=patch_runner_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3532,7 +8001,7 @@ def patch_authentication_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "Authentication", + "202": "Runner", "400": "BadErrorResponse", "401": "UnauthorizedErrorResponse", "404": "NotFoundErrorResponse", @@ -3546,14 +8015,12 @@ def patch_authentication_with_http_info( ) @validate_call - def patch_authentication_without_preload_content( + def patch_runner_without_preload_content( self, project_id: Annotated[UUID, Field(description="Project identifier.")], instance_id: Annotated[UUID, Field(description="Instance identifier.")], - authentication_id: Annotated[UUID, Field(description="Authentication Source identifier.")], - patch_authentication_payload: Annotated[ - PatchAuthenticationPayload, Field(description="Authentication Definition configuration data.") - ], + runner_id: Annotated[UUID, Field(description="The UUID of the STACKIT Git Runner.")], + patch_runner_payload: Annotated[PatchRunnerPayload, Field(description="Runner Definition configuration data.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3564,18 +8031,18 @@ def patch_authentication_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Patch Authentication. + """Patch Runner. - Patches the Authentication Provider. + Patches the Runner information. :param project_id: Project identifier. (required) :type project_id: UUID :param instance_id: Instance identifier. (required) :type instance_id: UUID - :param authentication_id: Authentication Source identifier. (required) - :type authentication_id: UUID - :param patch_authentication_payload: Authentication Definition configuration data. (required) - :type patch_authentication_payload: PatchAuthenticationPayload + :param runner_id: The UUID of the STACKIT Git Runner. (required) + :type runner_id: UUID + :param patch_runner_payload: Runner Definition configuration data. (required) + :type patch_runner_payload: PatchRunnerPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3598,11 +8065,11 @@ def patch_authentication_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._patch_authentication_serialize( + _param = self._patch_runner_serialize( project_id=project_id, instance_id=instance_id, - authentication_id=authentication_id, - patch_authentication_payload=patch_authentication_payload, + runner_id=runner_id, + patch_runner_payload=patch_runner_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3610,7 +8077,7 @@ def patch_authentication_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "Authentication", + "202": "Runner", "400": "BadErrorResponse", "401": "UnauthorizedErrorResponse", "404": "NotFoundErrorResponse", @@ -3619,12 +8086,12 @@ def patch_authentication_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _patch_authentication_serialize( + def _patch_runner_serialize( self, project_id, instance_id, - authentication_id, - patch_authentication_payload, + runner_id, + patch_runner_payload, _request_auth, _content_type, _headers, @@ -3647,14 +8114,14 @@ def _patch_authentication_serialize( _path_params["projectId"] = project_id if instance_id is not None: _path_params["instanceId"] = instance_id - if authentication_id is not None: - _path_params["authenticationId"] = authentication_id + if runner_id is not None: + _path_params["runnerId"] = runner_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if patch_authentication_payload is not None: - _body_params = patch_authentication_payload + if patch_runner_payload is not None: + _body_params = patch_runner_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -3673,7 +8140,7 @@ def _patch_authentication_serialize( return self.api_client.param_serialize( method="PATCH", - resource_path="/v1beta/projects/{projectId}/instances/{instanceId}/authentications/{authenticationId}", + resource_path="/v1beta/projects/{projectId}/instances/{instanceId}/runners/{runnerId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3687,11 +8154,12 @@ def _patch_authentication_serialize( ) @validate_call - def patch_instance( + def update_user( self, project_id: Annotated[UUID, Field(description="Project identifier.")], instance_id: Annotated[UUID, Field(description="Instance identifier.")], - patch_instance_payload: PatchInstancePayload, + username: Annotated[StrictStr, Field(description="Instance User identifier.")], + update_user_payload: UpdateUserPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3701,17 +8169,19 @@ def patch_instance( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Instance: - """Patch Instance. + ) -> User: + """Update Instance User. - Patches the Instance. + Updates the Instance User. :param project_id: Project identifier. (required) :type project_id: UUID :param instance_id: Instance identifier. (required) :type instance_id: UUID - :param patch_instance_payload: (required) - :type patch_instance_payload: PatchInstancePayload + :param username: Instance User identifier. (required) + :type username: str + :param update_user_payload: (required) + :type update_user_payload: UpdateUserPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3734,10 +8204,11 @@ def patch_instance( :return: Returns the result object. """ # noqa: E501 - _param = self._patch_instance_serialize( + _param = self._update_user_serialize( project_id=project_id, instance_id=instance_id, - patch_instance_payload=patch_instance_payload, + username=username, + update_user_payload=update_user_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3745,8 +8216,7 @@ def patch_instance( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Instance", - "202": None, + "200": "User", "400": "GenericErrorResponse", "401": None, "404": None, @@ -3761,11 +8231,12 @@ def patch_instance( ).data @validate_call - def patch_instance_with_http_info( + def update_user_with_http_info( self, project_id: Annotated[UUID, Field(description="Project identifier.")], instance_id: Annotated[UUID, Field(description="Instance identifier.")], - patch_instance_payload: PatchInstancePayload, + username: Annotated[StrictStr, Field(description="Instance User identifier.")], + update_user_payload: UpdateUserPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3775,17 +8246,19 @@ def patch_instance_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Instance]: - """Patch Instance. + ) -> ApiResponse[User]: + """Update Instance User. - Patches the Instance. + Updates the Instance User. :param project_id: Project identifier. (required) :type project_id: UUID :param instance_id: Instance identifier. (required) :type instance_id: UUID - :param patch_instance_payload: (required) - :type patch_instance_payload: PatchInstancePayload + :param username: Instance User identifier. (required) + :type username: str + :param update_user_payload: (required) + :type update_user_payload: UpdateUserPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3808,10 +8281,11 @@ def patch_instance_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._patch_instance_serialize( + _param = self._update_user_serialize( project_id=project_id, instance_id=instance_id, - patch_instance_payload=patch_instance_payload, + username=username, + update_user_payload=update_user_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3819,8 +8293,7 @@ def patch_instance_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Instance", - "202": None, + "200": "User", "400": "GenericErrorResponse", "401": None, "404": None, @@ -3835,11 +8308,12 @@ def patch_instance_with_http_info( ) @validate_call - def patch_instance_without_preload_content( + def update_user_without_preload_content( self, project_id: Annotated[UUID, Field(description="Project identifier.")], instance_id: Annotated[UUID, Field(description="Instance identifier.")], - patch_instance_payload: PatchInstancePayload, + username: Annotated[StrictStr, Field(description="Instance User identifier.")], + update_user_payload: UpdateUserPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3850,16 +8324,18 @@ def patch_instance_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Patch Instance. + """Update Instance User. - Patches the Instance. + Updates the Instance User. :param project_id: Project identifier. (required) :type project_id: UUID :param instance_id: Instance identifier. (required) :type instance_id: UUID - :param patch_instance_payload: (required) - :type patch_instance_payload: PatchInstancePayload + :param username: Instance User identifier. (required) + :type username: str + :param update_user_payload: (required) + :type update_user_payload: UpdateUserPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3882,10 +8358,11 @@ def patch_instance_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._patch_instance_serialize( + _param = self._update_user_serialize( project_id=project_id, instance_id=instance_id, - patch_instance_payload=patch_instance_payload, + username=username, + update_user_payload=update_user_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3893,8 +8370,7 @@ def patch_instance_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Instance", - "202": None, + "200": "User", "400": "GenericErrorResponse", "401": None, "404": None, @@ -3904,11 +8380,12 @@ def patch_instance_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _patch_instance_serialize( + def _update_user_serialize( self, project_id, instance_id, - patch_instance_payload, + username, + update_user_payload, _request_auth, _content_type, _headers, @@ -3931,12 +8408,14 @@ def _patch_instance_serialize( _path_params["projectId"] = project_id if instance_id is not None: _path_params["instanceId"] = instance_id + if username is not None: + _path_params["username"] = username # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if patch_instance_payload is not None: - _body_params = patch_instance_payload + if update_user_payload is not None: + _body_params = update_user_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -3946,9 +8425,7 @@ def _patch_instance_serialize( if _content_type: _header_params["Content-Type"] = _content_type else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json", "application/json-patch+json"] - ) + _default_content_type = self.api_client.select_header_content_type(["application/json"]) if _default_content_type is not None: _header_params["Content-Type"] = _default_content_type @@ -3957,7 +8434,7 @@ def _patch_instance_serialize( return self.api_client.param_serialize( method="PATCH", - resource_path="/v1beta/projects/{projectId}/instances/{instanceId}", + resource_path="/v1beta/projects/{projectId}/instances/{instanceId}/users/{username}", path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/services/git/src/stackit/git/models/__init__.py b/services/git/src/stackit/git/models/__init__.py index 52ee81370..beb8ae7ac 100644 --- a/services/git/src/stackit/git/models/__init__.py +++ b/services/git/src/stackit/git/models/__init__.py @@ -21,21 +21,41 @@ from stackit.git.models.conflict_error_response import ConflictErrorResponse from stackit.git.models.create_authentication_payload import CreateAuthenticationPayload from stackit.git.models.create_instance_payload import CreateInstancePayload +from stackit.git.models.create_legacy_runner_payload import CreateLegacyRunnerPayload +from stackit.git.models.create_organization_runner_payload import ( + CreateOrganizationRunnerPayload, +) from stackit.git.models.create_runner_payload import CreateRunnerPayload +from stackit.git.models.create_user_payload import CreateUserPayload from stackit.git.models.feature_toggle import FeatureToggle from stackit.git.models.flavor import Flavor from stackit.git.models.generic_error_response import GenericErrorResponse +from stackit.git.models.group_definition import GroupDefinition from stackit.git.models.instance import Instance from stackit.git.models.internal_server_error_response import ( InternalServerErrorResponse, ) from stackit.git.models.list_flavors import ListFlavors from stackit.git.models.list_instances import ListInstances +from stackit.git.models.list_organization_teams import ListOrganizationTeams +from stackit.git.models.list_organizations import ListOrganizations +from stackit.git.models.list_users import ListUsers from stackit.git.models.not_found_error_response import NotFoundErrorResponse +from stackit.git.models.organization import Organization +from stackit.git.models.organization_team import OrganizationTeam from stackit.git.models.patch_authentication_payload import PatchAuthenticationPayload from stackit.git.models.patch_instance_payload import PatchInstancePayload +from stackit.git.models.patch_legacy_runner_payload import PatchLegacyRunnerPayload from stackit.git.models.patch_operation import PatchOperation +from stackit.git.models.patch_runner_payload import PatchRunnerPayload +from stackit.git.models.pipelines import Pipelines from stackit.git.models.runner import Runner +from stackit.git.models.runner_family import RunnerFamily +from stackit.git.models.runner_family_list import RunnerFamilyList +from stackit.git.models.runner_list import RunnerList from stackit.git.models.runner_runtime import RunnerRuntime from stackit.git.models.runner_runtime_list import RunnerRuntimeList +from stackit.git.models.team_mapping_row import TeamMappingRow from stackit.git.models.unauthorized_error_response import UnauthorizedErrorResponse +from stackit.git.models.update_user_payload import UpdateUserPayload +from stackit.git.models.user import User diff --git a/services/git/src/stackit/git/models/authentication.py b/services/git/src/stackit/git/models/authentication.py index 98a92fecd..c3f84bcbd 100644 --- a/services/git/src/stackit/git/models/authentication.py +++ b/services/git/src/stackit/git/models/authentication.py @@ -21,10 +21,19 @@ from typing import Any, ClassVar, Dict, List, Optional, Set from uuid import UUID -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + StrictBool, + StrictStr, + field_validator, +) from pydantic_core import to_jsonable_python from typing_extensions import Annotated, Self +from stackit.git.models.group_definition import GroupDefinition + class Authentication(BaseModel): """ @@ -34,10 +43,19 @@ class Authentication(BaseModel): auto_discover_url: Annotated[str, Field(strict=True)] = Field( description="The well-known configuration url to use for this authentication definition." ) + auto_team_removal: Optional[StrictBool] = Field( + default=None, description="Whether to automatically remove users from teams when group membership is revoked." + ) client_id: StrictStr = Field(description="The IDP client id to use.") created_at: datetime = Field( description="The date and time the creation of the authentication definition was triggered." ) + group_claim_name: Optional[StrictStr] = Field( + default=None, description="The name of the JWT claim used to identify group memberships." + ) + groups: Optional[List[GroupDefinition]] = Field( + default=None, description="Effective group definitions mapping IdP groups to STACKIT Git teams." + ) icon_url: Annotated[str, Field(strict=True)] = Field( description="The url of the icon to use for this authentication definition." ) @@ -50,16 +68,23 @@ class Authentication(BaseModel): provider: StrictStr = Field(description="The Oauth2 provider to use.") scopes: StrictStr = Field(description="Scopes defines the OIDC scopes to request.") status: StrictStr = Field(description="The current status of the authentication definition.") + status_message: Optional[StrictStr] = Field( + default=None, description="Provides additional information or error details when the status is 'Error'." + ) __properties: ClassVar[List[str]] = [ "auto_discover_url", + "auto_team_removal", "client_id", "created_at", + "group_claim_name", + "groups", "icon_url", "id", "name", "provider", "scopes", "status", + "status_message", ] @field_validator("auto_discover_url") @@ -99,6 +124,13 @@ def icon_url_validate_regular_expression(cls, value): ) return value + @field_validator("status") + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(["Creating", "Updating", "Deleting", "Ready", "Error"]): + raise ValueError("must be one of enum values ('Creating', 'Updating', 'Deleting', 'Ready', 'Error')") + return value + model_config = ConfigDict( validate_by_name=True, validate_by_alias=True, @@ -136,6 +168,13 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of each item in groups (list) + _items = [] + if self.groups: + for _item_groups in self.groups: + if _item_groups: + _items.append(_item_groups.to_dict()) + _dict["groups"] = _items return _dict @classmethod @@ -150,14 +189,22 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { "auto_discover_url": obj.get("auto_discover_url"), + "auto_team_removal": obj.get("auto_team_removal"), "client_id": obj.get("client_id"), "created_at": obj.get("created_at"), + "group_claim_name": obj.get("group_claim_name"), + "groups": ( + [GroupDefinition.from_dict(_item) for _item in obj["groups"]] + if obj.get("groups") is not None + else None + ), "icon_url": obj.get("icon_url"), "id": obj.get("id"), "name": obj.get("name"), "provider": obj.get("provider"), "scopes": obj.get("scopes"), "status": obj.get("status"), + "status_message": obj.get("status_message"), } ) return _obj diff --git a/services/git/src/stackit/git/models/create_authentication_payload.py b/services/git/src/stackit/git/models/create_authentication_payload.py index b1229b833..da3cd849c 100644 --- a/services/git/src/stackit/git/models/create_authentication_payload.py +++ b/services/git/src/stackit/git/models/create_authentication_payload.py @@ -19,10 +19,19 @@ import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + StrictBool, + StrictStr, + field_validator, +) from pydantic_core import to_jsonable_python from typing_extensions import Annotated, Self +from stackit.git.models.group_definition import GroupDefinition + class CreateAuthenticationPayload(BaseModel): """ @@ -32,8 +41,18 @@ class CreateAuthenticationPayload(BaseModel): auto_discover_url: Annotated[str, Field(strict=True)] = Field( description="The well-known configuration url to use for this authentication definition." ) + auto_team_removal: Optional[StrictBool] = Field( + default=False, description="Whether to automatically remove users from teams when group membership is revoked." + ) client_id: Annotated[str, Field(strict=True, max_length=256)] = Field(description="The IDP client id to use.") client_secret: StrictStr = Field(description="The IDP client secret to use.") + group_claim_name: Optional[StrictStr] = Field( + default=None, + description="The name of the JWT claim used to identify group memberships. Must be set together with groups.", + ) + groups: Optional[List[GroupDefinition]] = Field( + default=None, description="Group definitions mapping IdP groups to STACKIT Git teams." + ) icon_url: Optional[Annotated[str, Field(strict=True)]] = Field( default=None, description="The url of the icon to use for this authentication definition." ) @@ -46,8 +65,11 @@ class CreateAuthenticationPayload(BaseModel): ) __properties: ClassVar[List[str]] = [ "auto_discover_url", + "auto_team_removal", "client_id", "client_secret", + "group_claim_name", + "groups", "icon_url", "name", "provider", @@ -118,6 +140,13 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of each item in groups (list) + _items = [] + if self.groups: + for _item_groups in self.groups: + if _item_groups: + _items.append(_item_groups.to_dict()) + _dict["groups"] = _items return _dict @classmethod @@ -132,8 +161,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { "auto_discover_url": obj.get("auto_discover_url"), + "auto_team_removal": ( + obj.get("auto_team_removal") if obj.get("auto_team_removal") is not None else False + ), "client_id": obj.get("client_id"), "client_secret": obj.get("client_secret"), + "group_claim_name": obj.get("group_claim_name"), + "groups": ( + [GroupDefinition.from_dict(_item) for _item in obj["groups"]] + if obj.get("groups") is not None + else None + ), "icon_url": obj.get("icon_url"), "name": obj.get("name"), "provider": obj.get("provider") if obj.get("provider") is not None else "openidConnect", diff --git a/services/git/src/stackit/git/models/create_legacy_runner_payload.py b/services/git/src/stackit/git/models/create_legacy_runner_payload.py new file mode 100644 index 000000000..127abf8c5 --- /dev/null +++ b/services/git/src/stackit/git/models/create_legacy_runner_payload.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" +STACKIT Git API + +STACKIT Git management API. + +The version of the OpenAPI document: 1beta.0.4 +Contact: git@stackit.cloud +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic_core import to_jsonable_python +from typing_extensions import Annotated, Self + + +class CreateLegacyRunnerPayload(BaseModel): + """ + Request a runner to be created supporting the requested list of runtime labels. + """ # noqa: E501 + + family_name: Optional[StrictStr] = Field( + default=None, description="The runner's job family name.", alias="familyName" + ) + labels: Annotated[List[StrictStr], Field(min_length=1)] + __properties: ClassVar[List[str]] = ["familyName", "labels"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateLegacyRunnerPayload from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateLegacyRunnerPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"familyName": obj.get("familyName"), "labels": obj.get("labels")}) + return _obj diff --git a/services/git/src/stackit/git/models/create_organization_runner_payload.py b/services/git/src/stackit/git/models/create_organization_runner_payload.py new file mode 100644 index 000000000..793456d2b --- /dev/null +++ b/services/git/src/stackit/git/models/create_organization_runner_payload.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" +STACKIT Git API + +STACKIT Git management API. + +The version of the OpenAPI document: 1beta.0.4 +Contact: git@stackit.cloud +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic_core import to_jsonable_python +from typing_extensions import Annotated, Self + + +class CreateOrganizationRunnerPayload(BaseModel): + """ + Request a runner to be created supporting the requested list of runtime labels. + """ # noqa: E501 + + family_name: Optional[StrictStr] = Field( + default=None, description="The runner's job family name.", alias="familyName" + ) + labels: Annotated[List[StrictStr], Field(min_length=1)] + __properties: ClassVar[List[str]] = ["familyName", "labels"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateOrganizationRunnerPayload from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateOrganizationRunnerPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"familyName": obj.get("familyName"), "labels": obj.get("labels")}) + return _obj diff --git a/services/git/src/stackit/git/models/create_runner_payload.py b/services/git/src/stackit/git/models/create_runner_payload.py index 3882188f6..a5b3ce1b8 100644 --- a/services/git/src/stackit/git/models/create_runner_payload.py +++ b/services/git/src/stackit/git/models/create_runner_payload.py @@ -18,9 +18,9 @@ import pprint from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from pydantic_core import to_jsonable_python -from typing_extensions import Self +from typing_extensions import Annotated, Self class CreateRunnerPayload(BaseModel): @@ -28,8 +28,11 @@ class CreateRunnerPayload(BaseModel): Request a runner to be created supporting the requested list of runtime labels. """ # noqa: E501 - labels: List[StrictStr] - __properties: ClassVar[List[str]] = ["labels"] + family_name: Optional[StrictStr] = Field( + default=None, description="The runner's job family name.", alias="familyName" + ) + labels: Annotated[List[StrictStr], Field(min_length=1)] + __properties: ClassVar[List[str]] = ["familyName", "labels"] model_config = ConfigDict( validate_by_name=True, @@ -79,5 +82,5 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"labels": obj.get("labels")}) + _obj = cls.model_validate({"familyName": obj.get("familyName"), "labels": obj.get("labels")}) return _obj diff --git a/services/git/src/stackit/git/models/create_user_payload.py b/services/git/src/stackit/git/models/create_user_payload.py new file mode 100644 index 000000000..d74953dfc --- /dev/null +++ b/services/git/src/stackit/git/models/create_user_payload.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" +STACKIT Git API + +STACKIT Git management API. + +The version of the OpenAPI document: 1beta.0.4 +Contact: git@stackit.cloud +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from pydantic_core import to_jsonable_python +from typing_extensions import Annotated, Self + + +class CreateUserPayload(BaseModel): + """ + Request a STACKIT Git instance User to be created with these properties. + """ # noqa: E501 + + email: Annotated[str, Field(strict=True, max_length=254)] = Field( + description="A user chosen email to distinguish multiple STACKIT Git instance Users." + ) + force_send_reset_password: Optional[StrictBool] = Field( + default=False, description="Whether to force sending a reset password email." + ) + name: Annotated[str, Field(strict=True, max_length=32)] = Field(description="Name of the user.") + password: Annotated[str, Field(strict=True, max_length=64)] = Field( + description="A user password to allow user/pass instance login." + ) + username: Annotated[str, Field(strict=True, max_length=32)] = Field( + description="A user chosen username to distinguish multiple STACKIT Git instance Users." + ) + __properties: ClassVar[List[str]] = ["email", "force_send_reset_password", "name", "password", "username"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateUserPayload from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateUserPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "email": obj.get("email"), + "force_send_reset_password": ( + obj.get("force_send_reset_password") if obj.get("force_send_reset_password") is not None else False + ), + "name": obj.get("name"), + "password": obj.get("password"), + "username": obj.get("username"), + } + ) + return _obj diff --git a/services/git/src/stackit/git/models/feature_toggle.py b/services/git/src/stackit/git/models/feature_toggle.py index f3141f679..81fc203a5 100644 --- a/services/git/src/stackit/git/models/feature_toggle.py +++ b/services/git/src/stackit/git/models/feature_toggle.py @@ -29,6 +29,8 @@ from pydantic_core import to_jsonable_python from typing_extensions import Self +from stackit.git.models.pipelines import Pipelines + class FeatureToggle(BaseModel): """ @@ -36,13 +38,9 @@ class FeatureToggle(BaseModel): """ # noqa: E501 default_email_notifications: Optional[StrictStr] = Field(default=None, description="Default email notifications.") - enable_commit_signatures: Optional[StrictBool] = Field(default=None, description="Enable commit signatures.") enable_local_login: Optional[StrictBool] = Field(default=None, description="Enable local login.") - __properties: ClassVar[List[str]] = [ - "default_email_notifications", - "enable_commit_signatures", - "enable_local_login", - ] + pipelines: Optional[Pipelines] = None + __properties: ClassVar[List[str]] = ["default_email_notifications", "enable_local_login", "pipelines"] @field_validator("default_email_notifications") def default_email_notifications_validate_enum(cls, value): @@ -91,16 +89,14 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of pipelines + if self.pipelines: + _dict["pipelines"] = self.pipelines.to_dict() # set to None if default_email_notifications (nullable) is None # and model_fields_set contains the field if self.default_email_notifications is None and "default_email_notifications" in self.model_fields_set: _dict["default_email_notifications"] = None - # set to None if enable_commit_signatures (nullable) is None - # and model_fields_set contains the field - if self.enable_commit_signatures is None and "enable_commit_signatures" in self.model_fields_set: - _dict["enable_commit_signatures"] = None - # set to None if enable_local_login (nullable) is None # and model_fields_set contains the field if self.enable_local_login is None and "enable_local_login" in self.model_fields_set: @@ -120,8 +116,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { "default_email_notifications": obj.get("default_email_notifications"), - "enable_commit_signatures": obj.get("enable_commit_signatures"), "enable_local_login": obj.get("enable_local_login"), + "pipelines": Pipelines.from_dict(obj["pipelines"]) if obj.get("pipelines") is not None else None, } ) return _obj diff --git a/services/git/src/stackit/git/models/group_definition.py b/services/git/src/stackit/git/models/group_definition.py new file mode 100644 index 000000000..f6694ba8c --- /dev/null +++ b/services/git/src/stackit/git/models/group_definition.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" +STACKIT Git API + +STACKIT Git management API. + +The version of the OpenAPI document: 1beta.0.4 +Contact: git@stackit.cloud +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic_core import to_jsonable_python +from typing_extensions import Self + +from stackit.git.models.team_mapping_row import TeamMappingRow + + +class GroupDefinition(BaseModel): + """ + GroupDefinition + """ # noqa: E501 + + group: StrictStr = Field(description="Identity provider group identifier.") + team_mappings: Optional[List[TeamMappingRow]] = Field(default=None, description="Team mapping rows for this group.") + __properties: ClassVar[List[str]] = ["group", "team_mappings"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GroupDefinition from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in team_mappings (list) + _items = [] + if self.team_mappings: + for _item_team_mappings in self.team_mappings: + if _item_team_mappings: + _items.append(_item_team_mappings.to_dict()) + _dict["team_mappings"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GroupDefinition from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "group": obj.get("group"), + "team_mappings": ( + [TeamMappingRow.from_dict(_item) for _item in obj["team_mappings"]] + if obj.get("team_mappings") is not None + else None + ), + } + ) + return _obj diff --git a/services/git/src/stackit/git/models/instance.py b/services/git/src/stackit/git/models/instance.py index 82ac2fe90..0928c50db 100644 --- a/services/git/src/stackit/git/models/instance.py +++ b/services/git/src/stackit/git/models/instance.py @@ -21,7 +21,14 @@ from typing import Any, ClassVar, Dict, List, Optional, Set from uuid import UUID -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + StrictBool, + StrictStr, + field_validator, +) from pydantic_core import to_jsonable_python from typing_extensions import Annotated, Self @@ -34,12 +41,17 @@ class Instance(BaseModel): """ # noqa: E501 acl: List[StrictStr] = Field(description="Restricted ACL for instance access.") + admin_login: StrictBool = Field(description="Enable or disable Admin Idp") consumed_disk: StrictStr = Field(description="How many bytes of disk space is consumed. Read Only.") consumed_object_storage: StrictStr = Field(description="How many bytes of Object Storage is consumed. Read Only.") created: datetime = Field(description="The date and time the creation of the STACKIT Git instance was triggered.") feature_toggle: FeatureToggle flavor: StrictStr = Field(description="Instance flavor.") id: UUID = Field(description="A auto generated unique id which identifies the STACKIT Git instances.") + labels: Optional[Dict[str, Annotated[str, Field(strict=True, max_length=63)]]] = Field( + default=None, + description="Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. The `stackit-` prefix is reserved and cannot be used for Keys.", + ) name: Annotated[str, Field(strict=True, max_length=32)] = Field( description="A user chosen name to distinguish multiple STACKIT Git instances." ) @@ -54,12 +66,14 @@ class Instance(BaseModel): ) __properties: ClassVar[List[str]] = [ "acl", + "admin_login", "consumed_disk", "consumed_object_storage", "created", "feature_toggle", "flavor", "id", + "labels", "name", "state", "url", @@ -142,6 +156,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { "acl": obj.get("acl"), + "admin_login": obj.get("admin_login") if obj.get("admin_login") is not None else False, "consumed_disk": obj.get("consumed_disk"), "consumed_object_storage": obj.get("consumed_object_storage"), "created": obj.get("created"), @@ -150,6 +165,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: ), "flavor": obj.get("flavor"), "id": obj.get("id"), + "labels": obj.get("labels"), "name": obj.get("name"), "state": obj.get("state"), "url": obj.get("url"), diff --git a/services/git/src/stackit/git/models/list_organization_teams.py b/services/git/src/stackit/git/models/list_organization_teams.py new file mode 100644 index 000000000..f4929aca6 --- /dev/null +++ b/services/git/src/stackit/git/models/list_organization_teams.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" +STACKIT Git API + +STACKIT Git management API. + +The version of the OpenAPI document: 1beta.0.4 +Contact: git@stackit.cloud +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from pydantic_core import to_jsonable_python +from typing_extensions import Self + +from stackit.git.models.organization_team import OrganizationTeam + + +class ListOrganizationTeams(BaseModel): + """ + A paginated list of STACKIT Git instance Organization Teams. + """ # noqa: E501 + + items_count: StrictInt = Field(description="Number of teams returned in this page.", alias="itemsCount") + offset: StrictInt = Field(description="Zero-based index of the first item in this page.") + teams: List[OrganizationTeam] + total_pages: StrictInt = Field( + description="Total number of pages available based on the fixed page size of 50.", alias="totalPages" + ) + __properties: ClassVar[List[str]] = ["itemsCount", "offset", "teams", "totalPages"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ListOrganizationTeams from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in teams (list) + _items = [] + if self.teams: + for _item_teams in self.teams: + if _item_teams: + _items.append(_item_teams.to_dict()) + _dict["teams"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListOrganizationTeams from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "itemsCount": obj.get("itemsCount"), + "offset": obj.get("offset"), + "teams": ( + [OrganizationTeam.from_dict(_item) for _item in obj["teams"]] + if obj.get("teams") is not None + else None + ), + "totalPages": obj.get("totalPages"), + } + ) + return _obj diff --git a/services/git/src/stackit/git/models/list_organizations.py b/services/git/src/stackit/git/models/list_organizations.py new file mode 100644 index 000000000..8979312b7 --- /dev/null +++ b/services/git/src/stackit/git/models/list_organizations.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" +STACKIT Git API + +STACKIT Git management API. + +The version of the OpenAPI document: 1beta.0.4 +Contact: git@stackit.cloud +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from pydantic_core import to_jsonable_python +from typing_extensions import Self + +from stackit.git.models.organization import Organization + + +class ListOrganizations(BaseModel): + """ + A paginated list of STACKIT Git instance Organizations. + """ # noqa: E501 + + items_count: StrictInt = Field(description="Number of organizations returned in this page.", alias="itemsCount") + offset: StrictInt = Field(description="Zero-based index of the first item in this page.") + organizations: List[Organization] + total_pages: StrictInt = Field( + description="Total number of pages available based on the fixed page size of 50.", alias="totalPages" + ) + __properties: ClassVar[List[str]] = ["itemsCount", "offset", "organizations", "totalPages"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ListOrganizations from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in organizations (list) + _items = [] + if self.organizations: + for _item_organizations in self.organizations: + if _item_organizations: + _items.append(_item_organizations.to_dict()) + _dict["organizations"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListOrganizations from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "itemsCount": obj.get("itemsCount"), + "offset": obj.get("offset"), + "organizations": ( + [Organization.from_dict(_item) for _item in obj["organizations"]] + if obj.get("organizations") is not None + else None + ), + "totalPages": obj.get("totalPages"), + } + ) + return _obj diff --git a/services/git/src/stackit/git/models/list_users.py b/services/git/src/stackit/git/models/list_users.py new file mode 100644 index 000000000..19fefd12a --- /dev/null +++ b/services/git/src/stackit/git/models/list_users.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" +STACKIT Git API + +STACKIT Git management API. + +The version of the OpenAPI document: 1beta.0.4 +Contact: git@stackit.cloud +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from pydantic_core import to_jsonable_python +from typing_extensions import Self + +from stackit.git.models.user import User + + +class ListUsers(BaseModel): + """ + A paginated list of STACKIT Git instance Users. + """ # noqa: E501 + + items_count: StrictInt = Field(description="Number of users returned in this page.", alias="itemsCount") + offset: StrictInt = Field(description="Zero-based index of the first item in this page.") + total_pages: StrictInt = Field( + description="Total number of pages available based on the fixed page size of 50.", alias="totalPages" + ) + users: List[User] + __properties: ClassVar[List[str]] = ["itemsCount", "offset", "totalPages", "users"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ListUsers from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in users (list) + _items = [] + if self.users: + for _item_users in self.users: + if _item_users: + _items.append(_item_users.to_dict()) + _dict["users"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListUsers from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "itemsCount": obj.get("itemsCount"), + "offset": obj.get("offset"), + "totalPages": obj.get("totalPages"), + "users": [User.from_dict(_item) for _item in obj["users"]] if obj.get("users") is not None else None, + } + ) + return _obj diff --git a/services/git/src/stackit/git/models/organization.py b/services/git/src/stackit/git/models/organization.py new file mode 100644 index 000000000..57891b521 --- /dev/null +++ b/services/git/src/stackit/git/models/organization.py @@ -0,0 +1,83 @@ +# coding: utf-8 + +""" +STACKIT Git API + +STACKIT Git management API. + +The version of the OpenAPI document: 1beta.0.4 +Contact: git@stackit.cloud +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from pydantic_core import to_jsonable_python +from typing_extensions import Annotated, Self + + +class Organization(BaseModel): + """ + Describes a STACKIT Git instance Organization. + """ # noqa: E501 + + name: Annotated[str, Field(strict=True, max_length=40)] = Field(description="Name of the organization.") + __properties: ClassVar[List[str]] = ["name"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Organization from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Organization from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"name": obj.get("name")}) + return _obj diff --git a/services/git/src/stackit/git/models/organization_team.py b/services/git/src/stackit/git/models/organization_team.py new file mode 100644 index 000000000..722441ebe --- /dev/null +++ b/services/git/src/stackit/git/models/organization_team.py @@ -0,0 +1,83 @@ +# coding: utf-8 + +""" +STACKIT Git API + +STACKIT Git management API. + +The version of the OpenAPI document: 1beta.0.4 +Contact: git@stackit.cloud +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from pydantic_core import to_jsonable_python +from typing_extensions import Annotated, Self + + +class OrganizationTeam(BaseModel): + """ + Describes a STACKIT Git instance Organization Team. + """ # noqa: E501 + + name: Annotated[str, Field(strict=True, max_length=255)] = Field(description="Name of the team.") + __properties: ClassVar[List[str]] = ["name"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OrganizationTeam from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OrganizationTeam from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"name": obj.get("name")}) + return _obj diff --git a/services/git/src/stackit/git/models/patch_authentication_payload.py b/services/git/src/stackit/git/models/patch_authentication_payload.py index dd63111dc..26b361532 100644 --- a/services/git/src/stackit/git/models/patch_authentication_payload.py +++ b/services/git/src/stackit/git/models/patch_authentication_payload.py @@ -19,10 +19,19 @@ import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + StrictBool, + StrictStr, + field_validator, +) from pydantic_core import to_jsonable_python from typing_extensions import Annotated, Self +from stackit.git.models.group_definition import GroupDefinition + class PatchAuthenticationPayload(BaseModel): """ @@ -32,10 +41,20 @@ class PatchAuthenticationPayload(BaseModel): auto_discover_url: Optional[Annotated[str, Field(strict=True)]] = Field( default=None, description="The well-known configuration url to use for this authentication definition." ) + auto_team_removal: Optional[StrictBool] = Field( + default=None, description="Whether to automatically remove users from teams when group membership is revoked." + ) client_id: Optional[Annotated[str, Field(strict=True, max_length=256)]] = Field( default=None, description="The IDP client id to use." ) client_secret: Optional[StrictStr] = Field(default=None, description="The IDP client secret to use.") + group_claim_name: Optional[StrictStr] = Field( + default=None, + description="The name of the JWT claim used to identify group memberships. Must be set together with groups.", + ) + groups: Optional[List[GroupDefinition]] = Field( + default=None, description="Group definitions mapping IdP groups to STACKIT Git teams." + ) icon_url: Optional[Annotated[str, Field(strict=True)]] = Field( default=None, description="The url of the icon to use for this authentication definition." ) @@ -43,8 +62,11 @@ class PatchAuthenticationPayload(BaseModel): scopes: Optional[StrictStr] = Field(default=None, description="Scopes defines the OIDC scopes to request.") __properties: ClassVar[List[str]] = [ "auto_discover_url", + "auto_team_removal", "client_id", "client_secret", + "group_claim_name", + "groups", "icon_url", "provider", "scopes", @@ -117,6 +139,13 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of each item in groups (list) + _items = [] + if self.groups: + for _item_groups in self.groups: + if _item_groups: + _items.append(_item_groups.to_dict()) + _dict["groups"] = _items return _dict @classmethod @@ -131,8 +160,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { "auto_discover_url": obj.get("auto_discover_url"), + "auto_team_removal": obj.get("auto_team_removal"), "client_id": obj.get("client_id"), "client_secret": obj.get("client_secret"), + "group_claim_name": obj.get("group_claim_name"), + "groups": ( + [GroupDefinition.from_dict(_item) for _item in obj["groups"]] + if obj.get("groups") is not None + else None + ), "icon_url": obj.get("icon_url"), "provider": obj.get("provider"), "scopes": obj.get("scopes"), diff --git a/services/git/src/stackit/git/models/patch_instance_payload.py b/services/git/src/stackit/git/models/patch_instance_payload.py index 16d3678ba..b0472c9e5 100644 --- a/services/git/src/stackit/git/models/patch_instance_payload.py +++ b/services/git/src/stackit/git/models/patch_instance_payload.py @@ -18,7 +18,13 @@ import pprint from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic import ( + BaseModel, + ConfigDict, + Field, + StrictBool, + StrictStr, +) from pydantic_core import to_jsonable_python from typing_extensions import Annotated, Self @@ -33,8 +39,13 @@ class PatchInstancePayload(BaseModel): acl: Optional[Annotated[List[StrictStr], Field(max_length=50)]] = Field( default=None, description="A list of CIDR network addresses that are allowed to access the instance." ) + admin_login: Optional[StrictBool] = Field(default=None, description="Enable Admin IdP") feature_toggle: Optional[FeatureToggle] = None - __properties: ClassVar[List[str]] = ["acl", "feature_toggle"] + labels: Optional[Dict[str, Annotated[str, Field(strict=True, max_length=63)]]] = Field( + default=None, + description="Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. The `stackit-` prefix is reserved and cannot be used for Keys.", + ) + __properties: ClassVar[List[str]] = ["acl", "admin_login", "feature_toggle", "labels"] model_config = ConfigDict( validate_by_name=True, @@ -95,9 +106,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { "acl": obj.get("acl"), + "admin_login": obj.get("admin_login"), "feature_toggle": ( FeatureToggle.from_dict(obj["feature_toggle"]) if obj.get("feature_toggle") is not None else None ), + "labels": obj.get("labels"), } ) return _obj diff --git a/services/git/src/stackit/git/models/patch_legacy_runner_payload.py b/services/git/src/stackit/git/models/patch_legacy_runner_payload.py new file mode 100644 index 000000000..b200c3189 --- /dev/null +++ b/services/git/src/stackit/git/models/patch_legacy_runner_payload.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" +STACKIT Git API + +STACKIT Git management API. + +The version of the OpenAPI document: 1beta.0.4 +Contact: git@stackit.cloud +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic_core import to_jsonable_python +from typing_extensions import Self + + +class PatchLegacyRunnerPayload(BaseModel): + """ + Request a runner to be updated supporting the requested list of runtime labels. + """ # noqa: E501 + + family_name: Optional[StrictStr] = Field( + default=None, description="The runner's job family name.", alias="familyName" + ) + labels: List[StrictStr] + __properties: ClassVar[List[str]] = ["familyName", "labels"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PatchLegacyRunnerPayload from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PatchLegacyRunnerPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"familyName": obj.get("familyName"), "labels": obj.get("labels")}) + return _obj diff --git a/services/git/src/stackit/git/models/patch_runner_payload.py b/services/git/src/stackit/git/models/patch_runner_payload.py new file mode 100644 index 000000000..91430664e --- /dev/null +++ b/services/git/src/stackit/git/models/patch_runner_payload.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" +STACKIT Git API + +STACKIT Git management API. + +The version of the OpenAPI document: 1beta.0.4 +Contact: git@stackit.cloud +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic_core import to_jsonable_python +from typing_extensions import Self + + +class PatchRunnerPayload(BaseModel): + """ + Request a runner to be updated supporting the requested list of runtime labels. + """ # noqa: E501 + + family_name: Optional[StrictStr] = Field( + default=None, description="The runner's job family name.", alias="familyName" + ) + labels: List[StrictStr] + __properties: ClassVar[List[str]] = ["familyName", "labels"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PatchRunnerPayload from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PatchRunnerPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"familyName": obj.get("familyName"), "labels": obj.get("labels")}) + return _obj diff --git a/services/git/src/stackit/git/models/pipelines.py b/services/git/src/stackit/git/models/pipelines.py new file mode 100644 index 000000000..81dc176e8 --- /dev/null +++ b/services/git/src/stackit/git/models/pipelines.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" +STACKIT Git API + +STACKIT Git management API. + +The version of the OpenAPI document: 1beta.0.4 +Contact: git@stackit.cloud +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import ( + BaseModel, + ConfigDict, + Field, + StrictBool, + StrictStr, +) +from pydantic_core import to_jsonable_python +from typing_extensions import Self + + +class Pipelines(BaseModel): + """ + Feature toggles for instance pipelines + """ # noqa: E501 + + action_url: Optional[StrictStr] = Field(default=None, description="The action URL for the pipelines") + enabled: Optional[StrictBool] = Field(default=None, description="Enable pipelines for this instance") + __properties: ClassVar[List[str]] = ["action_url", "enabled"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Pipelines from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if action_url (nullable) is None + # and model_fields_set contains the field + if self.action_url is None and "action_url" in self.model_fields_set: + _dict["action_url"] = None + + # set to None if enabled (nullable) is None + # and model_fields_set contains the field + if self.enabled is None and "enabled" in self.model_fields_set: + _dict["enabled"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Pipelines from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"action_url": obj.get("action_url"), "enabled": obj.get("enabled")}) + return _obj diff --git a/services/git/src/stackit/git/models/runner.py b/services/git/src/stackit/git/models/runner.py index c47e0e5be..a1c1dd4e2 100644 --- a/services/git/src/stackit/git/models/runner.py +++ b/services/git/src/stackit/git/models/runner.py @@ -23,7 +23,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from pydantic_core import to_jsonable_python -from typing_extensions import Self +from typing_extensions import Annotated, Self class Runner(BaseModel): @@ -32,10 +32,17 @@ class Runner(BaseModel): """ # noqa: E501 created_at: datetime + family_name: Optional[StrictStr] = Field( + default=None, description="The runner's job family name.", alias="familyName" + ) id: UUID labels: List[StrictStr] + organization: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=40)]] = Field( + default=None, + description="Forgejo organization name (slug, matching `Organization.name`) the runner is scoped to; omitted for global runners. Must not contain `..` or spaces.", + ) status: StrictStr = Field(description="The current status of the runner.") - __properties: ClassVar[List[str]] = ["created_at", "id", "labels", "status"] + __properties: ClassVar[List[str]] = ["created_at", "familyName", "id", "labels", "organization", "status"] @field_validator("created_at", mode="before") def created_at_change_year_zero_to_one(cls, value): @@ -50,6 +57,19 @@ def created_at_change_year_zero_to_one(cls, value): return "0001" + value[4:] # Take "0001" and append the rest of the string return value + @field_validator("organization") + def organization_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not isinstance(value, str): + value = str(value) + + if not re.match(r"^[a-zA-Z0-9]([a-zA-Z0-9._-]*[a-zA-Z0-9])?$", value): + raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9]([a-zA-Z0-9._-]*[a-zA-Z0-9])?$/") + return value + model_config = ConfigDict( validate_by_name=True, validate_by_alias=True, @@ -101,8 +121,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { "created_at": obj.get("created_at"), + "familyName": obj.get("familyName"), "id": obj.get("id"), "labels": obj.get("labels"), + "organization": obj.get("organization"), "status": obj.get("status"), } ) diff --git a/services/git/src/stackit/git/models/runner_family.py b/services/git/src/stackit/git/models/runner_family.py new file mode 100644 index 000000000..bfed78ed6 --- /dev/null +++ b/services/git/src/stackit/git/models/runner_family.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" +STACKIT Git API + +STACKIT Git management API. + +The version of the OpenAPI document: 1beta.0.4 +Contact: git@stackit.cloud +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic_core import to_jsonable_python +from typing_extensions import Self + + +class RunnerFamily(BaseModel): + """ + Describes a STACKIT Git Runner Family. + """ # noqa: E501 + + arch: StrictStr = Field(description="Indicates the runner image architecture.") + availability: StrictStr = Field(description="Indicates the availability of the runner label") + cpu: StrictStr = Field(description="CPU virtual cores resource limit of jobs.") + disk: StrictStr = Field(description="Disk size limit of jobs.") + display_name: StrictStr = Field(description="Human-friendly name of the runtime.") + name: StrictStr = Field(description="Family name identifier.") + ram: StrictStr = Field(description="RAM resource limit of jobs.") + __properties: ClassVar[List[str]] = ["arch", "availability", "cpu", "disk", "display_name", "name", "ram"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RunnerFamily from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RunnerFamily from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "arch": obj.get("arch"), + "availability": obj.get("availability"), + "cpu": obj.get("cpu"), + "disk": obj.get("disk"), + "display_name": obj.get("display_name"), + "name": obj.get("name"), + "ram": obj.get("ram"), + } + ) + return _obj diff --git a/services/git/src/stackit/git/models/runner_family_list.py b/services/git/src/stackit/git/models/runner_family_list.py new file mode 100644 index 000000000..0f0b01387 --- /dev/null +++ b/services/git/src/stackit/git/models/runner_family_list.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" +STACKIT Git API + +STACKIT Git management API. + +The version of the OpenAPI document: 1beta.0.4 +Contact: git@stackit.cloud +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict +from pydantic_core import to_jsonable_python +from typing_extensions import Self + +from stackit.git.models.runner_family import RunnerFamily + + +class RunnerFamilyList(BaseModel): + """ + A list of STACKIT Git RunnerFamily. + """ # noqa: E501 + + items: List[RunnerFamily] + __properties: ClassVar[List[str]] = ["items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RunnerFamilyList from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict["items"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RunnerFamilyList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "items": ( + [RunnerFamily.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + ) + } + ) + return _obj diff --git a/services/git/src/stackit/git/models/runner_list.py b/services/git/src/stackit/git/models/runner_list.py new file mode 100644 index 000000000..7c1a5516f --- /dev/null +++ b/services/git/src/stackit/git/models/runner_list.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" +STACKIT Git API + +STACKIT Git management API. + +The version of the OpenAPI document: 1beta.0.4 +Contact: git@stackit.cloud +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict +from pydantic_core import to_jsonable_python +from typing_extensions import Self + +from stackit.git.models.runner import Runner + + +class RunnerList(BaseModel): + """ + A list of STACKIT Git Runners. + """ # noqa: E501 + + items: List[Runner] + __properties: ClassVar[List[str]] = ["items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RunnerList from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict["items"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RunnerList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + {"items": [Runner.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None} + ) + return _obj diff --git a/services/git/src/stackit/git/models/runner_runtime.py b/services/git/src/stackit/git/models/runner_runtime.py index 6b8fc7c85..b9199003b 100644 --- a/services/git/src/stackit/git/models/runner_runtime.py +++ b/services/git/src/stackit/git/models/runner_runtime.py @@ -28,12 +28,13 @@ class RunnerRuntime(BaseModel): Describes a STACKIT Git Runner runtime. """ # noqa: E501 + arch: StrictStr = Field(description="Indicates the runner image architecture.") availability: StrictStr = Field(description="Indicates the availability of the runner label") description: StrictStr = Field(description="Human-friendly description of the runtime and it's capabilities.") display_name: StrictStr = Field(description="Human-friendly name of the runtime.") id: StrictStr = Field(description="Runtime identifier.") label: StrictStr = Field(description="Runtime label.") - __properties: ClassVar[List[str]] = ["availability", "description", "display_name", "id", "label"] + __properties: ClassVar[List[str]] = ["arch", "availability", "description", "display_name", "id", "label"] model_config = ConfigDict( validate_by_name=True, @@ -85,6 +86,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { + "arch": obj.get("arch"), "availability": obj.get("availability"), "description": obj.get("description"), "display_name": obj.get("display_name"), diff --git a/services/git/src/stackit/git/models/team_mapping_row.py b/services/git/src/stackit/git/models/team_mapping_row.py new file mode 100644 index 000000000..03656db41 --- /dev/null +++ b/services/git/src/stackit/git/models/team_mapping_row.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" +STACKIT Git API + +STACKIT Git management API. + +The version of the OpenAPI document: 1beta.0.4 +Contact: git@stackit.cloud +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic_core import to_jsonable_python +from typing_extensions import Self + + +class TeamMappingRow(BaseModel): + """ + TeamMappingRow + """ # noqa: E501 + + organization: StrictStr = Field(description="Name of the organization in STACKIT Git.") + team: StrictStr = Field(description="Name of the team within the organization.") + __properties: ClassVar[List[str]] = ["organization", "team"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TeamMappingRow from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TeamMappingRow from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"organization": obj.get("organization"), "team": obj.get("team")}) + return _obj diff --git a/services/git/src/stackit/git/models/update_user_payload.py b/services/git/src/stackit/git/models/update_user_payload.py new file mode 100644 index 000000000..03e783deb --- /dev/null +++ b/services/git/src/stackit/git/models/update_user_payload.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" +STACKIT Git API + +STACKIT Git management API. + +The version of the OpenAPI document: 1beta.0.4 +Contact: git@stackit.cloud +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from pydantic_core import to_jsonable_python +from typing_extensions import Annotated, Self + + +class UpdateUserPayload(BaseModel): + """ + Properties to update a Instance User. All fields are optional. + """ # noqa: E501 + + email: Optional[Annotated[str, Field(strict=True, max_length=254)]] = Field( + default=None, description="A user chosen email to distinguish multiple STACKIT Git instance Users." + ) + name: Optional[Annotated[str, Field(strict=True, max_length=32)]] = Field( + default=None, description="Name of the user." + ) + password: Optional[Annotated[str, Field(strict=True, max_length=64)]] = Field( + default=None, description="A user password to allow user/pass instance login." + ) + __properties: ClassVar[List[str]] = ["email", "name", "password"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UpdateUserPayload from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateUserPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"email": obj.get("email"), "name": obj.get("name"), "password": obj.get("password")}) + return _obj diff --git a/services/git/src/stackit/git/models/user.py b/services/git/src/stackit/git/models/user.py new file mode 100644 index 000000000..af0c4c47d --- /dev/null +++ b/services/git/src/stackit/git/models/user.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" +STACKIT Git API + +STACKIT Git management API. + +The version of the OpenAPI document: 1beta.0.4 +Contact: git@stackit.cloud +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from pydantic_core import to_jsonable_python +from typing_extensions import Annotated, Self + + +class User(BaseModel): + """ + Describes a STACKIT Git instance User. + """ # noqa: E501 + + email: Annotated[str, Field(strict=True, max_length=254)] = Field( + description="A user chosen email to distinguish multiple STACKIT Git instance Users." + ) + id: Optional[StrictInt] = Field( + default=None, description="A auto generated unique id which identifies the STACKIT Git instances." + ) + name: Annotated[str, Field(strict=True, max_length=32)] = Field(description="Name of the user.") + username: Annotated[str, Field(strict=True, max_length=32)] = Field( + description="A user chosen username to distinguish multiple STACKIT Git instance Users." + ) + __properties: ClassVar[List[str]] = ["email", "id", "name", "username"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of User from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set( + [ + "id", + ] + ) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of User from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + {"email": obj.get("email"), "id": obj.get("id"), "name": obj.get("name"), "username": obj.get("username")} + ) + return _obj