From 8740d110e9b72f970f449459a8ae3279868fcc6c Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Tue, 5 May 2026 12:52:03 +0000 Subject: [PATCH] Generate git --- services/git/oas_commit | 2 +- services/git/src/stackit/git/__init__.py | 12 + .../git/src/stackit/git/api/default_api.py | 1689 +++++++++++++++-- .../git/src/stackit/git/models/__init__.py | 5 + .../src/stackit/git/models/authentication.py | 12 + .../stackit/git/models/create_user_payload.py | 104 + .../src/stackit/git/models/feature_toggle.py | 20 +- .../git/src/stackit/git/models/list_users.py | 93 + .../stackit/git/models/patch_user_payload.py | 90 + .../git/src/stackit/git/models/pipelines.py | 99 + services/git/src/stackit/git/models/user.py | 98 + 11 files changed, 2048 insertions(+), 176 deletions(-) create mode 100644 services/git/src/stackit/git/models/create_user_payload.py create mode 100644 services/git/src/stackit/git/models/list_users.py create mode 100644 services/git/src/stackit/git/models/patch_user_payload.py create mode 100644 services/git/src/stackit/git/models/pipelines.py create mode 100644 services/git/src/stackit/git/models/user.py diff --git a/services/git/oas_commit b/services/git/oas_commit index e3713dde3..ac6b51d5c 100644 --- a/services/git/oas_commit +++ b/services/git/oas_commit @@ -1 +1 @@ -0e64886dd0847341800d7191ed193b75413be998 +f0b456a3636b0fbc03c2da3907a575d7955f6e6b diff --git a/services/git/src/stackit/git/__init__.py b/services/git/src/stackit/git/__init__.py index 7bd204d82..764ab171b 100644 --- a/services/git/src/stackit/git/__init__.py +++ b/services/git/src/stackit/git/__init__.py @@ -37,6 +37,7 @@ "CreateAuthenticationPayload", "CreateInstancePayload", "CreateRunnerPayload", + "CreateUserPayload", "FeatureToggle", "Flavor", "GenericErrorResponse", @@ -44,14 +45,18 @@ "InternalServerErrorResponse", "ListFlavors", "ListInstances", + "ListUsers", "NotFoundErrorResponse", "PatchAuthenticationPayload", "PatchInstancePayload", "PatchOperation", + "PatchUserPayload", + "Pipelines", "Runner", "RunnerRuntime", "RunnerRuntimeList", "UnauthorizedErrorResponse", + "User", ] # import apis into sdk package @@ -89,6 +94,9 @@ 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 ( @@ -100,6 +108,7 @@ ) 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_users import ListUsers as ListUsers from stackit.git.models.not_found_error_response import ( NotFoundErrorResponse as NotFoundErrorResponse, ) @@ -110,6 +119,8 @@ PatchInstancePayload as PatchInstancePayload, ) from stackit.git.models.patch_operation import PatchOperation as PatchOperation +from stackit.git.models.patch_user_payload import PatchUserPayload as PatchUserPayload +from stackit.git.models.pipelines import Pipelines as Pipelines from stackit.git.models.runner import Runner as Runner from stackit.git.models.runner_runtime import RunnerRuntime as RunnerRuntime from stackit.git.models.runner_runtime_list import ( @@ -118,3 +129,4 @@ from stackit.git.models.unauthorized_error_response import ( UnauthorizedErrorResponse as UnauthorizedErrorResponse, ) +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 8b9a2c46c..0df90f1a9 100644 --- a/services/git/src/stackit/git/api/default_api.py +++ b/services/git/src/stackit/git/api/default_api.py @@ -26,13 +26,17 @@ from stackit.git.models.create_authentication_payload import CreateAuthenticationPayload from stackit.git.models.create_instance_payload import CreateInstancePayload 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_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_user_payload import PatchUserPayload from stackit.git.models.runner import Runner from stackit.git.models.runner_runtime_list import RunnerRuntimeList +from stackit.git.models.user import User from stackit.git.rest import RESTResponseType @@ -872,11 +876,11 @@ def _create_runner_serialize( ) @validate_call - def delete_authentication( + def create_user( 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.")], + create_user_payload: Annotated[CreateUserPayload, Field(description="Instance User details options.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -886,17 +890,17 @@ 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 + ) -> User: + """Create an Instance Local/Technical User. - Deletes the authentication source associated to this STACKIT Git instance. + 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 authentication_id: Authentication Source identifier. (required) - :type authentication_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 @@ -919,10 +923,10 @@ def delete_authentication( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_authentication_serialize( + _param = self._create_user_serialize( project_id=project_id, instance_id=instance_id, - authentication_id=authentication_id, + create_user_payload=create_user_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -930,10 +934,9 @@ def delete_authentication( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "201": "User", "400": "GenericErrorResponse", - "401": "UnauthorizedErrorResponse", - "404": "GenericErrorResponse", + "401": None, "409": "GenericErrorResponse", "500": "GenericErrorResponse", } @@ -945,11 +948,11 @@ def delete_authentication( ).data @validate_call - def delete_authentication_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.")], - authentication_id: Annotated[UUID, Field(description="Authentication Source identifier.")], + create_user_payload: Annotated[CreateUserPayload, Field(description="Instance User details options.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -959,17 +962,17 @@ 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[User]: + """Create an Instance Local/Technical User. - Deletes the authentication source associated to this STACKIT Git instance. + 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 authentication_id: Authentication Source identifier. (required) - :type authentication_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 @@ -992,10 +995,10 @@ def delete_authentication_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_authentication_serialize( + _param = self._create_user_serialize( project_id=project_id, instance_id=instance_id, - authentication_id=authentication_id, + create_user_payload=create_user_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1003,10 +1006,9 @@ def delete_authentication_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "201": "User", "400": "GenericErrorResponse", - "401": "UnauthorizedErrorResponse", - "404": "GenericErrorResponse", + "401": None, "409": "GenericErrorResponse", "500": "GenericErrorResponse", } @@ -1018,11 +1020,11 @@ def delete_authentication_with_http_info( ) @validate_call - def delete_authentication_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.")], - authentication_id: Annotated[UUID, Field(description="Authentication Source identifier.")], + create_user_payload: Annotated[CreateUserPayload, Field(description="Instance User details options.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1033,16 +1035,16 @@ 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 Instance Local/Technical User. - Deletes the authentication source associated to this STACKIT Git instance. + 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 authentication_id: Authentication Source identifier. (required) - :type authentication_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 @@ -1065,10 +1067,10 @@ def delete_authentication_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_authentication_serialize( + _param = self._create_user_serialize( project_id=project_id, instance_id=instance_id, - authentication_id=authentication_id, + create_user_payload=create_user_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1076,21 +1078,20 @@ def delete_authentication_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "201": "User", "400": "GenericErrorResponse", - "401": "UnauthorizedErrorResponse", - "404": "GenericErrorResponse", + "401": None, "409": "GenericErrorResponse", "500": "GenericErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _delete_authentication_serialize( + def _create_user_serialize( self, project_id, instance_id, - authentication_id, + create_user_payload, _request_auth, _content_type, _headers, @@ -1113,23 +1114,31 @@ 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 # process the query parameters # 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}/authentications/{authenticationId}", + method="POST", + resource_path="/v1beta/projects/{projectId}/instances/{instanceId}/users", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1143,10 +1152,11 @@ def _delete_authentication_serialize( ) @validate_call - def delete_instance( + def delete_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)], @@ -1157,14 +1167,16 @@ def delete_instance( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> None: - """Delete Instance. + """Delete Authentication Source - Deletes a STACKIT Git instance and destroys all associated data. + Deletes the authentication source 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 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 @@ -1187,9 +1199,10 @@ def delete_instance( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_instance_serialize( + _param = self._delete_authentication_serialize( project_id=project_id, instance_id=instance_id, + authentication_id=authentication_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1199,7 +1212,7 @@ def delete_instance( _response_types_map: Dict[str, Optional[str]] = { "204": None, "400": "GenericErrorResponse", - "401": None, + "401": "UnauthorizedErrorResponse", "404": "GenericErrorResponse", "409": "GenericErrorResponse", "500": "GenericErrorResponse", @@ -1212,10 +1225,11 @@ def delete_instance( ).data @validate_call - def delete_instance_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.")], + authentication_id: Annotated[UUID, Field(description="Authentication Source identifier.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1226,14 +1240,16 @@ def delete_instance_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[None]: - """Delete Instance. + """Delete Authentication Source - Deletes a STACKIT Git instance and destroys all associated data. + Deletes the authentication source 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 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 @@ -1256,9 +1272,10 @@ def delete_instance_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_instance_serialize( + _param = self._delete_authentication_serialize( project_id=project_id, instance_id=instance_id, + authentication_id=authentication_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1268,7 +1285,7 @@ def delete_instance_with_http_info( _response_types_map: Dict[str, Optional[str]] = { "204": None, "400": "GenericErrorResponse", - "401": None, + "401": "UnauthorizedErrorResponse", "404": "GenericErrorResponse", "409": "GenericErrorResponse", "500": "GenericErrorResponse", @@ -1281,10 +1298,11 @@ def delete_instance_with_http_info( ) @validate_call - def delete_instance_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.")], + authentication_id: Annotated[UUID, Field(description="Authentication Source identifier.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1295,14 +1313,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. + """Delete Authentication Source - Deletes a STACKIT Git instance and destroys all associated data. + Deletes the authentication source 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 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 @@ -1325,9 +1345,10 @@ def delete_instance_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_instance_serialize( + _param = self._delete_authentication_serialize( project_id=project_id, instance_id=instance_id, + authentication_id=authentication_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1337,7 +1358,7 @@ def delete_instance_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { "204": None, "400": "GenericErrorResponse", - "401": None, + "401": "UnauthorizedErrorResponse", "404": "GenericErrorResponse", "409": "GenericErrorResponse", "500": "GenericErrorResponse", @@ -1345,10 +1366,11 @@ def delete_instance_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _delete_instance_serialize( + def _delete_authentication_serialize( self, project_id, instance_id, + authentication_id, _request_auth, _content_type, _headers, @@ -1371,6 +1393,8 @@ def _delete_instance_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 # process the query parameters # process the header parameters # process the form parameters @@ -1385,7 +1409,7 @@ def _delete_instance_serialize( return self.api_client.param_serialize( method="DELETE", - resource_path="/v1beta/projects/{projectId}/instances/{instanceId}", + resource_path="/v1beta/projects/{projectId}/instances/{instanceId}/authentications/{authenticationId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1399,7 +1423,7 @@ def _delete_instance_serialize( ) @validate_call - def delete_runner( + def delete_instance( self, project_id: Annotated[UUID, Field(description="Project identifier.")], instance_id: Annotated[UUID, Field(description="Instance identifier.")], @@ -1413,9 +1437,9 @@ def delete_runner( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> None: - """Delete Runner. + """Delete Instance. - Deletes the runner associated to this STACKIT Git instance and destroys all associated data. + Deletes a STACKIT Git instance and destroys all associated data. :param project_id: Project identifier. (required) :type project_id: UUID @@ -1443,7 +1467,7 @@ def delete_runner( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_runner_serialize( + _param = self._delete_instance_serialize( project_id=project_id, instance_id=instance_id, _request_auth=_request_auth, @@ -1456,7 +1480,8 @@ def delete_runner( "204": None, "400": "GenericErrorResponse", "401": None, - "404": None, + "404": "GenericErrorResponse", + "409": "GenericErrorResponse", "500": "GenericErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -1467,7 +1492,7 @@ def delete_runner( ).data @validate_call - def delete_runner_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.")], @@ -1481,9 +1506,9 @@ def delete_runner_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[None]: - """Delete Runner. + """Delete Instance. - Deletes the runner associated to this STACKIT Git instance and destroys all associated data. + Deletes a STACKIT Git instance and destroys all associated data. :param project_id: Project identifier. (required) :type project_id: UUID @@ -1511,7 +1536,7 @@ def delete_runner_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_runner_serialize( + _param = self._delete_instance_serialize( project_id=project_id, instance_id=instance_id, _request_auth=_request_auth, @@ -1524,7 +1549,8 @@ def delete_runner_with_http_info( "204": None, "400": "GenericErrorResponse", "401": None, - "404": None, + "404": "GenericErrorResponse", + "409": "GenericErrorResponse", "500": "GenericErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -1535,7 +1561,7 @@ def delete_runner_with_http_info( ) @validate_call - def delete_runner_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.")], @@ -1549,9 +1575,9 @@ 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. + """Delete Instance. - Deletes the runner associated to this STACKIT Git instance and destroys all associated data. + Deletes a STACKIT Git instance and destroys all associated data. :param project_id: Project identifier. (required) :type project_id: UUID @@ -1579,7 +1605,7 @@ def delete_runner_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_runner_serialize( + _param = self._delete_instance_serialize( project_id=project_id, instance_id=instance_id, _request_auth=_request_auth, @@ -1592,13 +1618,14 @@ def delete_runner_without_preload_content( "204": None, "400": "GenericErrorResponse", "401": None, - "404": None, + "404": "GenericErrorResponse", + "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 _delete_instance_serialize( self, project_id, instance_id, @@ -1638,7 +1665,7 @@ def _delete_runner_serialize( return self.api_client.param_serialize( method="DELETE", - resource_path="/v1beta/projects/{projectId}/instances/{instanceId}/runner", + resource_path="/v1beta/projects/{projectId}/instances/{instanceId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1652,11 +1679,10 @@ def _delete_runner_serialize( ) @validate_call - def get_authentication( + def delete_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.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1666,17 +1692,15 @@ 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 Runner. - Get authentication provider + 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 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 @@ -1699,10 +1723,9 @@ def get_authentication( :return: Returns the result object. """ # noqa: E501 - _param = self._get_authentication_serialize( + _param = self._delete_runner_serialize( project_id=project_id, instance_id=instance_id, - authentication_id=authentication_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1710,10 +1733,11 @@ def get_authentication( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Authentication", - "400": "BadErrorResponse", - "401": "UnauthorizedErrorResponse", - "500": "InternalServerErrorResponse", + "204": None, + "400": "GenericErrorResponse", + "401": None, + "404": None, + "500": "GenericErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -1723,11 +1747,10 @@ def get_authentication( ).data @validate_call - def get_authentication_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.")], - authentication_id: Annotated[UUID, Field(description="Authentication Source identifier.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1737,17 +1760,15 @@ 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 Runner. - Get authentication provider + 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 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 @@ -1770,10 +1791,9 @@ def get_authentication_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_authentication_serialize( + _param = self._delete_runner_serialize( project_id=project_id, instance_id=instance_id, - authentication_id=authentication_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1781,10 +1801,11 @@ def get_authentication_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Authentication", - "400": "BadErrorResponse", - "401": "UnauthorizedErrorResponse", - "500": "InternalServerErrorResponse", + "204": None, + "400": "GenericErrorResponse", + "401": None, + "404": None, + "500": "GenericErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -1794,11 +1815,10 @@ def get_authentication_with_http_info( ) @validate_call - def get_authentication_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.")], - authentication_id: Annotated[UUID, Field(description="Authentication Source identifier.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1809,16 +1829,14 @@ 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 Runner. - Get authentication provider + 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 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 @@ -1841,10 +1859,9 @@ def get_authentication_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_authentication_serialize( + _param = self._delete_runner_serialize( project_id=project_id, instance_id=instance_id, - authentication_id=authentication_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1852,19 +1869,19 @@ def get_authentication_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Authentication", - "400": "BadErrorResponse", - "401": "UnauthorizedErrorResponse", - "500": "InternalServerErrorResponse", + "204": None, + "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_authentication_serialize( + def _delete_runner_serialize( self, project_id, instance_id, - authentication_id, _request_auth, _content_type, _headers, @@ -1887,8 +1904,6 @@ def _get_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 # process the query parameters # process the header parameters # process the form parameters @@ -1902,8 +1917,8 @@ def _get_authentication_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1beta/projects/{projectId}/instances/{instanceId}/authentications/{authenticationId}", + method="DELETE", + resource_path="/v1beta/projects/{projectId}/instances/{instanceId}/runner", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1917,10 +1932,11 @@ def _get_authentication_serialize( ) @validate_call - def get_instance( + 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)], @@ -1930,15 +1946,17 @@ 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 User. - Retrieves information about a STACKIT Git instance. + 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 @@ -1961,9 +1979,10 @@ def get_instance( :return: Returns the result object. """ # noqa: E501 - _param = self._get_instance_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, @@ -1971,10 +1990,11 @@ def get_instance( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Instance", + "204": None, "400": "GenericErrorResponse", "401": None, - "404": "GenericErrorResponse", + "404": None, + "409": None, "500": "GenericErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -1985,10 +2005,11 @@ def get_instance( ).data @validate_call - def get_instance_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)], @@ -1998,15 +2019,17 @@ 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 User. - Retrieves information about a STACKIT Git instance. + 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 @@ -2029,9 +2052,10 @@ def get_instance_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_instance_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, @@ -2039,10 +2063,11 @@ def get_instance_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Instance", + "204": None, "400": "GenericErrorResponse", "401": None, - "404": "GenericErrorResponse", + "404": None, + "409": None, "500": "GenericErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2053,10 +2078,11 @@ def get_instance_with_http_info( ) @validate_call - def get_instance_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)], @@ -2067,14 +2093,16 @@ 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 User. - Retrieves information about a STACKIT Git instance. + 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 @@ -2097,9 +2125,10 @@ def get_instance_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_instance_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, @@ -2107,19 +2136,21 @@ def get_instance_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Instance", + "204": None, "400": "GenericErrorResponse", "401": None, - "404": "GenericErrorResponse", + "404": None, + "409": None, "500": "GenericErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_instance_serialize( + def _delete_user_serialize( self, project_id, instance_id, + username, _request_auth, _content_type, _headers, @@ -2142,6 +2173,8 @@ def _get_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 @@ -2155,8 +2188,8 @@ def _get_instance_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1beta/projects/{projectId}/instances/{instanceId}", + method="DELETE", + resource_path="/v1beta/projects/{projectId}/instances/{instanceId}/users/{username}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2170,10 +2203,11 @@ def _get_instance_serialize( ) @validate_call - def get_runner( + 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)], @@ -2183,9 +2217,662 @@ 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. - + ) -> 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_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: + """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 _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, + _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_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]: + """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 _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, + _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_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: + """Get Runner information. + Retrieves information about a runner in a STACKIT Git instance. :param project_id: Project identifier. (required) @@ -2214,9 +2901,130 @@ def get_runner( :return: Returns the result object. """ # noqa: E501 - _param = self._get_runner_serialize( + _param = self._get_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_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_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, @@ -2224,7 +3032,7 @@ def get_runner( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Runner", + "302": "User", "400": "GenericErrorResponse", "401": None, "404": None, @@ -2238,10 +3046,11 @@ def get_runner( ).data @validate_call - def get_runner_with_http_info( + 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)], @@ -2251,10 +3060,272 @@ 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]: + """Get Instance User information. - Retrieves information about a runner in a STACKIT Git instance. + 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.")], + _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 all STACKIT Git Users within an instances. + + :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_users_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": "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.")], + _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 all STACKIT Git Users within an instances. :param project_id: Project identifier. (required) :type project_id: UUID @@ -2282,7 +3353,7 @@ def get_runner_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_runner_serialize( + _param = self._get_users_serialize( project_id=project_id, instance_id=instance_id, _request_auth=_request_auth, @@ -2292,10 +3363,9 @@ def get_runner_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Runner", + "200": "ListUsers", "400": "GenericErrorResponse", "401": None, - "404": None, "500": "GenericErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2306,7 +3376,7 @@ def get_runner_with_http_info( ) @validate_call - def get_runner_without_preload_content( + def get_users_without_preload_content( self, project_id: Annotated[UUID, Field(description="Project identifier.")], instance_id: Annotated[UUID, Field(description="Instance identifier.")], @@ -2320,9 +3390,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. + """Get instance Users. - Retrieves information about a runner in a STACKIT Git instance. + Lists all STACKIT Git Users within an instances. :param project_id: Project identifier. (required) :type project_id: UUID @@ -2350,7 +3420,7 @@ def get_runner_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_runner_serialize( + _param = self._get_users_serialize( project_id=project_id, instance_id=instance_id, _request_auth=_request_auth, @@ -2360,16 +3430,15 @@ def get_runner_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Runner", + "200": "ListUsers", "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_runner_serialize( + def _get_users_serialize( self, project_id, instance_id, @@ -2409,7 +3478,7 @@ def _get_runner_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta/projects/{projectId}/instances/{instanceId}/runner", + resource_path="/v1beta/projects/{projectId}/instances/{instanceId}/users", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3963,3 +5032,297 @@ def _patch_instance_serialize( _host=_host, _request_auth=_request_auth, ) + + @validate_call + def patch_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.")], + patch_user_payload: PatchUserPayload, + _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, + ) -> User: + """Patch Instance User. + + Patches the 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 patch_user_payload: (required) + :type patch_user_payload: PatchUserPayload + :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_user_serialize( + project_id=project_id, + instance_id=instance_id, + username=username, + patch_user_payload=patch_user_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "User", + "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_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.")], + patch_user_payload: PatchUserPayload, + _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[User]: + """Patch Instance User. + + Patches the 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 patch_user_payload: (required) + :type patch_user_payload: PatchUserPayload + :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_user_serialize( + project_id=project_id, + instance_id=instance_id, + username=username, + patch_user_payload=patch_user_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "User", + "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_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.")], + patch_user_payload: PatchUserPayload, + _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 User. + + Patches the 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 patch_user_payload: (required) + :type patch_user_payload: PatchUserPayload + :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_user_serialize( + project_id=project_id, + instance_id=instance_id, + username=username, + patch_user_payload=patch_user_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "User", + "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_user_serialize( + self, + project_id, + instance_id, + username, + patch_user_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 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_user_payload is not None: + _body_params = patch_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="PATCH", + 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, + ) diff --git a/services/git/src/stackit/git/models/__init__.py b/services/git/src/stackit/git/models/__init__.py index 389f7c924..a566d06f7 100644 --- a/services/git/src/stackit/git/models/__init__.py +++ b/services/git/src/stackit/git/models/__init__.py @@ -22,6 +22,7 @@ from stackit.git.models.create_authentication_payload import CreateAuthenticationPayload from stackit.git.models.create_instance_payload import CreateInstancePayload 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 @@ -31,11 +32,15 @@ ) from stackit.git.models.list_flavors import ListFlavors from stackit.git.models.list_instances import ListInstances +from stackit.git.models.list_users import ListUsers from stackit.git.models.not_found_error_response import NotFoundErrorResponse from stackit.git.models.patch_authentication_payload import PatchAuthenticationPayload from stackit.git.models.patch_instance_payload import PatchInstancePayload from stackit.git.models.patch_operation import PatchOperation +from stackit.git.models.patch_user_payload import PatchUserPayload +from stackit.git.models.pipelines import Pipelines from stackit.git.models.runner import Runner from stackit.git.models.runner_runtime import RunnerRuntime from stackit.git.models.runner_runtime_list import RunnerRuntimeList from stackit.git.models.unauthorized_error_response import UnauthorizedErrorResponse +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 d4311e134..4f6515528 100644 --- a/services/git/src/stackit/git/models/authentication.py +++ b/services/git/src/stackit/git/models/authentication.py @@ -49,6 +49,9 @@ 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", "client_id", @@ -59,6 +62,7 @@ class Authentication(BaseModel): "provider", "scopes", "status", + "status_message", ] @field_validator("auto_discover_url") @@ -92,6 +96,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( populate_by_name=True, validate_assignment=True, @@ -151,6 +162,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "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_user_payload.py b/services/git/src/stackit/git/models/create_user_payload.py new file mode 100644 index 000000000..1ca0e4463 --- /dev/null +++ b/services/git/src/stackit/git/models/create_user_payload.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, StrictBool +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( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(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 80987381d..cf0b68d35 100644 --- a/services/git/src/stackit/git/models/feature_toggle.py +++ b/services/git/src/stackit/git/models/feature_toggle.py @@ -28,6 +28,8 @@ ) from typing_extensions import Self +from stackit.git.models.pipelines import Pipelines + class FeatureToggle(BaseModel): """ @@ -35,13 +37,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): @@ -90,16 +88,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: @@ -119,8 +115,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/list_users.py b/services/git/src/stackit/git/models/list_users.py new file mode 100644 index 000000000..6f5de38f7 --- /dev/null +++ b/services/git/src/stackit/git/models/list_users.py @@ -0,0 +1,93 @@ +# 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 typing_extensions import Annotated, Self + +from stackit.git.models.user import User + + +class ListUsers(BaseModel): + """ + A list of STACKIT Git instance Users. + """ # noqa: E501 + + users: Annotated[List[User], Field(max_length=50)] + __properties: ClassVar[List[str]] = ["users"] + + model_config = ConfigDict( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(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( + {"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/patch_user_payload.py b/services/git/src/stackit/git/models/patch_user_payload.py new file mode 100644 index 000000000..6aed1b109 --- /dev/null +++ b/services/git/src/stackit/git/models/patch_user_payload.py @@ -0,0 +1,90 @@ +# 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 typing_extensions import Annotated, Self + + +class PatchUserPayload(BaseModel): + """ + Properties to patch 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( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PatchUserPayload 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 PatchUserPayload 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/pipelines.py b/services/git/src/stackit/git/models/pipelines.py new file mode 100644 index 000000000..5d7f1329e --- /dev/null +++ b/services/git/src/stackit/git/models/pipelines.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, + StrictBool, + StrictStr, +) +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( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(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/user.py b/services/git/src/stackit/git/models/user.py new file mode 100644 index 000000000..ad0e7efb7 --- /dev/null +++ b/services/git/src/stackit/git/models/user.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, Field, StrictInt +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( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(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