diff --git a/.gitattributes b/.gitattributes index 44c7cb240..7925f93cc 100644 --- a/.gitattributes +++ b/.gitattributes @@ -6,3 +6,4 @@ *.{sh,py} text eol=lf .git_archival.txt export-subst *.mp4 filter=lfs diff=lfs merge=lfs -text +frontend/src/app/openapi/** linguist-generated=true diff --git a/Makefile b/Makefile index df958368f..b84bee372 100644 --- a/Makefile +++ b/Makefile @@ -96,8 +96,8 @@ helm-deploy: --set docker.registry.sessions=$(CAPELLACOLLAB_SESSIONS_REGISTRY) \ --set docker.tag=$(DOCKER_TAG) \ --set mocks.oauth=True \ - --set authentication.claimMapping.username=sub \ - --set authentication.endpoints.authorization=https://localhost/default/authorize \ + --set backend.authentication.claimMapping.username=sub \ + --set backend.authentication.endpoints.authorization=https://localhost/default/authorize \ --set development=$(DEVELOPMENT_MODE) \ --set cluster.ingressClassName=traefik \ --set cluster.ingressNamespace=kube-system \ diff --git a/backend/capellacollab/alembic/versions/f3d2dedd7906_add_jupyter_token_column.py b/backend/capellacollab/alembic/versions/f3d2dedd7906_add_jupyter_token_column.py index c9a9184d2..9b043d46a 100644 --- a/backend/capellacollab/alembic/versions/f3d2dedd7906_add_jupyter_token_column.py +++ b/backend/capellacollab/alembic/versions/f3d2dedd7906_add_jupyter_token_column.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: Copyright DB InfraGO AG and contributors # SPDX-License-Identifier: Apache-2.0 -"""Commit message +"""Add column for Jupyter token Revision ID: f3d2dedd7906 Revises: 4df9c82766e2 diff --git a/backend/capellacollab/core/authentication/api_key_cookie.py b/backend/capellacollab/core/authentication/api_key_cookie.py index 772508e59..9a6c34c3f 100644 --- a/backend/capellacollab/core/authentication/api_key_cookie.py +++ b/backend/capellacollab/core/authentication/api_key_cookie.py @@ -11,7 +11,7 @@ from capellacollab.config import config -from . import exceptions, oidc_provider +from . import exceptions, oidc log = logging.getLogger(__name__) @@ -21,7 +21,7 @@ class JWTConfig: _jwks_client = None - def __init__(self, oidc_config: oidc_provider.AbstractOIDCProviderConfig): + def __init__(self, oidc_config: oidc.OIDCProviderConfig): self.oidc_config = oidc_config if JWTConfig._jwks_client is None: @@ -32,10 +32,10 @@ def __init__(self, oidc_config: oidc_provider.AbstractOIDCProviderConfig): class JWTAPIKeyCookie(security.APIKeyCookie): - def __init__(self, oidc_config: oidc_provider.AbstractOIDCProviderConfig): + def __init__(self): super().__init__(name="id_token", auto_error=True) - self.oidc_config = oidc_config - self.jwt_config = JWTConfig(oidc_config) + self.oidc_config = oidc.get_cached_oidc_config() + self.jwt_config = JWTConfig(self.oidc_config) async def __call__(self, request: fastapi.Request) -> str: token: str | None = await super().__call__(request) @@ -62,6 +62,16 @@ def validate_token(self, token: str) -> dict[str, t.Any]: ) except jwt_exceptions.ExpiredSignatureError: raise exceptions.TokenSignatureExpired() + except jwt_exceptions.InvalidIssuerError: + log.exception( + "Expected issuer '%s'. Got '%s'", + self.oidc_config.get_issuer(), + jwt.decode( + jwt=token, + options={"verify_signature": False}, + )["iss"], + ) + raise exceptions.JWTValidationFailed() except jwt_exceptions.PyJWTError: log.exception("JWT validation failed", exc_info=True) raise exceptions.JWTValidationFailed() diff --git a/backend/capellacollab/core/authentication/injectables.py b/backend/capellacollab/core/authentication/injectables.py index 844c1a749..e85e95d14 100644 --- a/backend/capellacollab/core/authentication/injectables.py +++ b/backend/capellacollab/core/authentication/injectables.py @@ -4,7 +4,6 @@ from __future__ import annotations import dataclasses -import functools import logging import fastapi @@ -24,28 +23,11 @@ from capellacollab.users import exceptions as users_exceptions from capellacollab.users import models as users_models -from . import exceptions, oidc_provider +from . import exceptions logger = logging.getLogger(__name__) -@functools.lru_cache -def get_cached_oidc_config() -> oidc_provider.AbstractOIDCProviderConfig: - return oidc_provider.WellKnownOIDCProviderConfig() - - -async def get_oidc_config() -> oidc_provider.AbstractOIDCProviderConfig: - return get_cached_oidc_config() - - -async def get_oidc_provider( - oidc_config: oidc_provider.AbstractOIDCProviderConfig = fastapi.Depends( - get_oidc_config - ), -) -> oidc_provider.AbstractOIDCProvider: - return oidc_provider.OIDCProvider(oidc_config) - - class OpenAPIFakeBase(security_base.SecurityBase): """Fake class to display the authentication methods in the OpenAPI docs @@ -79,13 +61,10 @@ class OpenAPIPersonalAccessToken(OpenAPIFakeBase): async def get_username( request: fastapi.Request, - oidc_config: oidc_provider.AbstractOIDCProviderConfig = fastapi.Depends( - get_oidc_config - ), _unused1=fastapi.Depends(OpenAPIPersonalAccessToken()), ) -> str: if request.cookies.get("id_token"): - username = await api_key_cookie.JWTAPIKeyCookie(oidc_config)(request) + username = await api_key_cookie.JWTAPIKeyCookie()(request) return username authorization = request.headers.get("Authorization") @@ -99,7 +78,6 @@ async def get_username( case _: raise exceptions.UnknownScheme(scheme) - assert username return username diff --git a/backend/capellacollab/core/authentication/models.py b/backend/capellacollab/core/authentication/models.py index 2a4d936ef..7dadb470b 100644 --- a/backend/capellacollab/core/authentication/models.py +++ b/backend/capellacollab/core/authentication/models.py @@ -9,3 +9,10 @@ class TokenRequest(core_pydantic.BaseModel): code: str nonce: str code_verifier: str + + +class AuthorizationResponse(core_pydantic.BaseModel): + auth_url: str + state: str + nonce: str + code_verifier: str diff --git a/backend/capellacollab/core/authentication/oidc_provider.py b/backend/capellacollab/core/authentication/oidc.py similarity index 74% rename from backend/capellacollab/core/authentication/oidc_provider.py rename to backend/capellacollab/core/authentication/oidc.py index 9970f473f..ea65eaadf 100644 --- a/backend/capellacollab/core/authentication/oidc_provider.py +++ b/backend/capellacollab/core/authentication/oidc.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: Copyright DB InfraGO AG and contributors # SPDX-License-Identifier: Apache-2.0 -import abc +import functools import logging import typing as t @@ -10,46 +10,12 @@ from capellacollab.config import config -from . import exceptions +from . import exceptions, models logger = logging.getLogger(__name__) -class AbstractOIDCProviderConfig(abc.ABC): - @abc.abstractmethod - def get_authorization_endpoint(self) -> str: - pass - - @abc.abstractmethod - def get_token_endpoint(self) -> str: - pass - - @abc.abstractmethod - def get_jwks_uri(self) -> str: - pass - - @abc.abstractmethod - def get_supported_signing_algorithms(self) -> list[str]: - pass - - @abc.abstractmethod - def get_issuer(self) -> str: - pass - - @abc.abstractmethod - def get_scopes(self) -> list[str]: - pass - - @abc.abstractmethod - def get_client_id(self) -> str: - pass - - @abc.abstractmethod - def get_client_secret(self) -> str: - pass - - -class WellKnownOIDCProviderConfig(AbstractOIDCProviderConfig): +class OIDCProviderConfig: def __init__(self): self.well_known_uri = config.authentication.endpoints.well_known self.well_known = self._fetch_well_known_configuration() @@ -92,32 +58,16 @@ def get_client_id(self) -> str: return config.authentication.client.id -class AbstractOIDCProvider(abc.ABC): - def __init__(self, oidc_config: AbstractOIDCProviderConfig): - self.oidc_config = oidc_config +@functools.lru_cache +def get_cached_oidc_config() -> OIDCProviderConfig: + return OIDCProviderConfig() - @abc.abstractmethod - def get_authorization_url_with_parameters( - self, - ) -> t.Tuple[str, str, str, str]: - pass - - @abc.abstractmethod - def exchange_code_for_tokens( - self, authorization_code: str, code_verifier: str - ) -> dict[str, t.Any]: - pass - - @abc.abstractmethod - def refresh_token(self, _refresh_token: str) -> dict[str, t.Any]: - pass - -class OIDCProvider(AbstractOIDCProvider): +class OIDCProvider: CODE_CHALLENGE_METHOD = "S256" - def __init__(self, oidc_config: AbstractOIDCProviderConfig): - super().__init__(oidc_config) + def __init__(self): + self.oidc_config = get_cached_oidc_config() self.web_client: oauth2.WebApplicationClient = ( oauth2.WebApplicationClient( client_id=self.oidc_config.get_client_id() @@ -126,10 +76,10 @@ def __init__(self, oidc_config: AbstractOIDCProviderConfig): def get_authorization_url_with_parameters( self, - ) -> t.Tuple[str, str, str, str]: + ) -> models.AuthorizationResponse: state = common.generate_token() - nonce = common.generate_nonce() + code_verifier = self.web_client.create_code_verifier(length=43) code_challenge = self.web_client.create_code_challenge( code_verifier, OIDCProvider.CODE_CHALLENGE_METHOD @@ -145,7 +95,12 @@ def get_authorization_url_with_parameters( code_challenge_method=OIDCProvider.CODE_CHALLENGE_METHOD, ) - return (auth_url, state, nonce, code_verifier) + return models.AuthorizationResponse( + auth_url=auth_url, + state=state, + nonce=nonce, + code_verifier=code_verifier, + ) def exchange_code_for_tokens( self, authorization_code: str, code_verifier: str diff --git a/backend/capellacollab/core/authentication/routes.py b/backend/capellacollab/core/authentication/routes.py index 1974833d4..5fce7f9db 100644 --- a/backend/capellacollab/core/authentication/routes.py +++ b/backend/capellacollab/core/authentication/routes.py @@ -13,50 +13,34 @@ from capellacollab.users import crud as users_crud from capellacollab.users import models as users_models -from . import api_key_cookie, exceptions, injectables, models, oidc_provider +from . import api_key_cookie, exceptions, models, oidc -router = fastapi.APIRouter() +router = fastapi.APIRouter(tags=["Authentication"]) -@router.get("", name="Get the authorization URL for the OAuth Server") -async def get_redirect_url( +@router.get("") +async def get_authorization_url( response: fastapi.Response, - provider: oidc_provider.AbstractOIDCProvider = fastapi.Depends( - injectables.get_oidc_provider - ), -) -> dict[str, str]: - auth_url, state, nonce, code_verifier = ( - provider.get_authorization_url_with_parameters() +) -> models.AuthorizationResponse: + authorization_response = ( + oidc.OIDCProvider().get_authorization_url_with_parameters() ) delete_token_cookies(response) - return { - "auth_url": auth_url, - "state": state, - "nonce": nonce, - "code_verifier": code_verifier, - } + return authorization_response -@router.post("/tokens", name="Create the identity token") -async def api_get_token( +@router.post("/tokens") +async def get_identity_token( token_request: models.TokenRequest, response: fastapi.Response, db: orm.Session = fastapi.Depends(database.get_db), - provider: oidc_provider.AbstractOIDCProvider = fastapi.Depends( - injectables.get_oidc_provider - ), - oidc_config: oidc_provider.AbstractOIDCProviderConfig = fastapi.Depends( - injectables.get_oidc_config - ), ): - tokens = provider.exchange_code_for_tokens( + tokens = oidc.OIDCProvider().exchange_code_for_tokens( token_request.code, token_request.code_verifier ) - validated_id_token = validate_id_token( - tokens["id_token"], oidc_config, None - ) + validated_id_token = validate_id_token(tokens["id_token"], None) user = create_or_update_user(db, validated_id_token) update_token_cookies( @@ -64,26 +48,18 @@ async def api_get_token( ) -@router.put("/tokens", name="Refresh the identity token") -async def api_refresh_token( +@router.put("/tokens") +async def refresh_identity_token( response: fastapi.Response, refresh_token: t.Annotated[str | None, fastapi.Cookie()] = None, db: orm.Session = fastapi.Depends(database.get_db), - provider: oidc_provider.AbstractOIDCProvider = fastapi.Depends( - injectables.get_oidc_provider - ), - oidc_config: oidc_provider.AbstractOIDCProviderConfig = fastapi.Depends( - injectables.get_oidc_config - ), -): +) -> None: if refresh_token is None or refresh_token == "": raise exceptions.RefreshTokenCookieMissingError() - tokens = provider.refresh_token(refresh_token) + tokens = oidc.OIDCProvider().refresh_token(refresh_token) - validated_id_token = validate_id_token( - tokens["id_token"], oidc_config, None - ) + validated_id_token = validate_id_token(tokens["id_token"], None) user = create_or_update_user(db, validated_id_token) update_token_cookies( @@ -91,22 +67,19 @@ async def api_refresh_token( ) -@router.delete("/tokens", name="Remove the token (log out)") +@router.delete("/tokens") async def logout(response: fastapi.Response): delete_token_cookies(response) return None -@router.get("/tokens", name="Validate the token") -async def validate_token( +@router.get("/tokens") +async def validate_jwt_token( request: fastapi.Request, scope: users_models.Role | None = None, db: orm.Session = fastapi.Depends(database.get_db), - oidc_config: oidc_provider.AbstractOIDCProviderConfig = fastapi.Depends( - injectables.get_oidc_config - ), ): - username = await api_key_cookie.JWTAPIKeyCookie(oidc_config)(request) + username = await api_key_cookie.JWTAPIKeyCookie()(request) if scope and scope.ADMIN: auth_injectables.RoleVerification( required_role=users_models.Role.ADMIN @@ -116,12 +89,12 @@ async def validate_token( def validate_id_token( id_token: str, - oidc_config: oidc_provider.AbstractOIDCProviderConfig, nonce: str | None, ) -> dict[str, str]: - validated_id_token = api_key_cookie.JWTAPIKeyCookie( - oidc_config - ).validate_token(id_token) + validated_id_token = api_key_cookie.JWTAPIKeyCookie().validate_token( + id_token + ) + oidc_config = oidc.get_cached_oidc_config() if nonce and not hmac.compare_digest(validated_id_token["nonce"], nonce): raise exceptions.NonceMismatchError() @@ -146,6 +119,16 @@ def create_or_update_user( user = users_crud.create_user(db, username, idp_identifier, email) events_crud.create_user_creation_event(db, user) + if user.email != email: + user = users_crud.update_user( + db, user, users_models.PatchUser(email=email) + ) + + if user.name != username: + user = users_crud.update_user( + db, user, users_models.PatchUser(name=username) + ) + users_crud.update_last_login(db, user) return user diff --git a/backend/capellacollab/core/logging/__init__.py b/backend/capellacollab/core/logging/__init__.py index 58cef5f9f..605bf3b2a 100644 --- a/backend/capellacollab/core/logging/__init__.py +++ b/backend/capellacollab/core/logging/__init__.py @@ -80,10 +80,7 @@ async def dispatch( call_next: base.RequestResponseEndpoint, ): try: - oidc_config = await auth_injectables.get_oidc_config() - username = await auth_injectables.get_username( - request, oidc_config - ) + username = await auth_injectables.get_username(request) except fastapi.HTTPException: username = "anonymous" diff --git a/backend/capellacollab/projects/routes.py b/backend/capellacollab/projects/routes.py index 5d9481035..a26c4f941 100644 --- a/backend/capellacollab/projects/routes.py +++ b/backend/capellacollab/projects/routes.py @@ -199,7 +199,6 @@ def _delete_all_pipelines_for_project( router.include_router( toolmodels_routes.router, prefix="/{project_slug}/models", - tags=["Projects - Models"], ) router.include_router( projects_events_routes.router, diff --git a/backend/capellacollab/sessions/routes.py b/backend/capellacollab/sessions/routes.py index 5025d8abc..141825263 100644 --- a/backend/capellacollab/sessions/routes.py +++ b/backend/capellacollab/sessions/routes.py @@ -380,7 +380,8 @@ def get_session_connection_information( key=c_key, value=c_value, path=f"/session/{session.id}", - expires=datetime.datetime.now() + datetime.timedelta(hours=24), + expires=datetime.datetime.now(datetime.UTC) + + datetime.timedelta(hours=24), ) return core_models.PayloadResponseModel( diff --git a/backend/capellacollab/settings/configuration/routes.py b/backend/capellacollab/settings/configuration/routes.py index 41fb29de6..d7dba4736 100644 --- a/backend/capellacollab/settings/configuration/routes.py +++ b/backend/capellacollab/settings/configuration/routes.py @@ -19,10 +19,11 @@ required_role=users_models.Role.ADMIN ) ) - ] + ], + tags=["Configuration"], ) -schema_router = fastapi.APIRouter(dependencies=[]) +schema_router = fastapi.APIRouter(dependencies=[], tags=["Configuration"]) @router.get( diff --git a/backend/capellacollab/settings/integrations/purevariants/routes.py b/backend/capellacollab/settings/integrations/purevariants/routes.py index b603d2256..dcc25b643 100644 --- a/backend/capellacollab/settings/integrations/purevariants/routes.py +++ b/backend/capellacollab/settings/integrations/purevariants/routes.py @@ -21,6 +21,7 @@ ) ) ], + tags=["Integrations - PureVariants"], ) diff --git a/backend/capellacollab/users/models.py b/backend/capellacollab/users/models.py index 7e8ee71f0..0aa250916 100644 --- a/backend/capellacollab/users/models.py +++ b/backend/capellacollab/users/models.py @@ -29,6 +29,7 @@ class BaseUser(core_pydantic.BaseModel): id: int name: str idp_identifier: str + email: str | None = None role: Role diff --git a/backend/tests/conftest.py b/backend/tests/conftest.py index da5343f59..ced2d08b2 100644 --- a/backend/tests/conftest.py +++ b/backend/tests/conftest.py @@ -12,13 +12,11 @@ import pytest import sqlalchemy import sqlalchemy.exc -from core import conftest as core_conftest from fastapi import testclient from sqlalchemy import engine, orm from testcontainers import postgres from capellacollab.__main__ import app -from capellacollab.core.authentication import oidc_provider from capellacollab.core.database import migration os.environ["DEVELOPMENT_MODE"] = "1" @@ -91,28 +89,16 @@ def commit(*args, **kwargs): yield session -@pytest.fixture() -def client(monkeypatch: pytest.MonkeyPatch) -> testclient.TestClient: - monkeypatch.setattr( - "capellacollab.core.authentication.api_key_cookie.JWTConfig", - core_conftest.MockJWTConfig, - ) - +@pytest.fixture(name="client") +def fixture_client() -> testclient.TestClient: return testclient.TestClient(app, cookies={"id_token": "any"}) +@pytest.fixture(name="client_unauthenticated") +def fixture_client_unauthenticated() -> testclient.TestClient: + return testclient.TestClient(app) + + @pytest.fixture(name="logger") def fixture_logger() -> logging.LoggerAdapter: return logging.LoggerAdapter(logging.getLogger()) - - -@pytest.fixture(name="mock_oidc_config") -def fixture_mock_oidc_config(): - return core_conftest.MockOIDCProviderConfig() - - -@pytest.fixture(name="mock_oidc_provider") -def fixture_mock_oidc_provider( - mock_oidc_config: oidc_provider.AbstractOIDCProviderConfig, -): - return core_conftest.MockOIDCProvider(mock_oidc_config) diff --git a/backend/tests/core/conftest.py b/backend/tests/core/conftest.py deleted file mode 100644 index 3be79f875..000000000 --- a/backend/tests/core/conftest.py +++ /dev/null @@ -1,124 +0,0 @@ -# SPDX-FileCopyrightText: Copyright DB InfraGO AG and contributors -# SPDX-License-Identifier: Apache-2.0 - - -import typing as t - -import pytest -from fastapi import testclient - -from capellacollab.__main__ import app -from capellacollab.core.authentication import injectables as auth_injectables -from capellacollab.core.authentication import oidc_provider - - -class MockPyJWK: - def __init__(self) -> None: - self.key = "mock-key" - - -class MockJWKSClient: - def get_signing_key_from_jwt(self, token: str): - return MockPyJWK() - - -class MockJWTConfig: - def __init__( - self, oidc_config: oidc_provider.AbstractOIDCProviderConfig - ) -> None: - self.oidc_config = oidc_config - self.jwks_client = MockJWKSClient() - - -class MockOIDCProviderConfig(oidc_provider.AbstractOIDCProviderConfig): - def get_authorization_endpoint(self) -> str: - return "mock-authorization-endpoint" - - def get_token_endpoint(self) -> str: - return "mock-token-endpoint" - - def get_jwks_uri(self) -> str: - return "mock-jwks-uri" - - def get_supported_signing_algorithms(self) -> list[str]: - return ["RS256"] - - def get_issuer(self) -> str: - return "mock-issuer" - - def get_scopes(self) -> list[str]: - return ["openid", "offline_access", "email"] - - def get_client_secret(self) -> str: - return "mock-secret" - - def get_client_id(self) -> str: - return "mock-client-id" - - -class MockOIDCProvider(oidc_provider.AbstractOIDCProvider): - def __init__(self, oidc_config: oidc_provider.AbstractOIDCProviderConfig): - super().__init__(oidc_config) - self.oidc_config = oidc_config - - def get_authorization_url_with_parameters( - self, - ) -> t.Tuple[str, str, str, str]: - return ( - "mock-auth-url", - "mock-state", - "mock-nonce", - "mock-code-verifier", - ) - - def exchange_code_for_tokens( - self, authorization_code: str, code_verifier: str - ) -> dict[str, t.Any]: - return { - "id_token": "mock-id-token", - "access-token": "mock-access-token", - "refresh-token": "mock-refresh-token", - } - - def refresh_token(self, _refresh_token: str) -> dict[str, t.Any]: - return { - "id_token": "mock-id-token", - "access-token": "mock-access-token", - "refresh-token": "mock-refresh-token", - } - - -@pytest.fixture(name="mock_oidc_provider_and_config") -def fixture_mock_oidc_provider_and_config( - mock_oidc_config: oidc_provider.AbstractOIDCProviderConfig, - mock_oidc_provider: oidc_provider.AbstractOIDCProvider, -): - async def get_mock_oidc_config() -> ( - oidc_provider.AbstractOIDCProviderConfig - ): - return mock_oidc_config - - async def get_mock_oidc_provider() -> oidc_provider.AbstractOIDCProvider: - return mock_oidc_provider - - app.dependency_overrides[auth_injectables.get_oidc_config] = ( - get_mock_oidc_config - ) - app.dependency_overrides[auth_injectables.get_oidc_provider] = ( - get_mock_oidc_provider - ) - - yield - - del app.dependency_overrides[auth_injectables.get_oidc_config] - del app.dependency_overrides[auth_injectables.get_oidc_provider] - - -@pytest.mark.usefixtures("mock_oidc_provider_and_config") -@pytest.fixture(name="unauthorized_client") -def fixture_unauthorized_client(monkeypatch: pytest.MonkeyPatch): - monkeypatch.setattr( - "capellacollab.core.authentication.api_key_cookie.JWTConfig", - MockJWTConfig, - ) - return testclient.TestClient(app) diff --git a/backend/tests/core/test_auth.py b/backend/tests/core/test_auth.py deleted file mode 100644 index 6f47388e4..000000000 --- a/backend/tests/core/test_auth.py +++ /dev/null @@ -1,56 +0,0 @@ -# SPDX-FileCopyrightText: Copyright DB InfraGO AG and contributors -# SPDX-License-Identifier: Apache-2.0 - - -from unittest import mock - -import pytest -from fastapi import status, testclient - -from capellacollab.core.authentication import ( - api_key_cookie, - exceptions, - oidc_provider, - routes, -) - - -def test_missing_refresh_token(unauthorized_client: testclient.TestClient): - response = unauthorized_client.put("api/v1/authentication/tokens") - json_response = response.json() - - assert response.status_code == status.HTTP_400_BAD_REQUEST - assert json_response["detail"]["err_code"] == "NO_REFRESH_TOKEN_COOKIE" - - -@pytest.mark.usefixtures("mock_auth_endpoints") -def test_validate_id_token_nonce_mismatch( - mock_oidc_config: oidc_provider.AbstractOIDCProviderConfig, - monkeypatch: pytest.MonkeyPatch, -): - mock_jwt_api_cookie = mock.MagicMock() - mock_jwt_api_cookie.return_value.validate_token.return_value = { - "nonce": "mismatch-nonce" - } - - monkeypatch.setattr(api_key_cookie, "JWTAPIKeyCookie", mock_jwt_api_cookie) - - with pytest.raises(exceptions.NonceMismatchError): - routes.validate_id_token("any", mock_oidc_config, "correct-nonce") - - -@pytest.mark.usefixtures("mock_auth_endpoints") -def test_validate_id_token_audience_mismatch( - mock_oidc_config: oidc_provider.AbstractOIDCProviderConfig, - monkeypatch: pytest.MonkeyPatch, -): - mock_jwt_api_cookie = mock.MagicMock() - mock_jwt_api_cookie.return_value.validate_token.return_value = { - "nonce": "mock-nonce", - "aud": "mock-audience", - } - - monkeypatch.setattr(api_key_cookie, "JWTAPIKeyCookie", mock_jwt_api_cookie) - - with pytest.raises(exceptions.UnauthenticatedError): - routes.validate_id_token("any", mock_oidc_config, "mock-nonce") diff --git a/backend/tests/core/test_auth_routes.py b/backend/tests/core/test_auth_routes.py new file mode 100644 index 000000000..687362240 --- /dev/null +++ b/backend/tests/core/test_auth_routes.py @@ -0,0 +1,236 @@ +# SPDX-FileCopyrightText: Copyright DB InfraGO AG and contributors +# SPDX-License-Identifier: Apache-2.0 + + +from unittest import mock + +import pytest +import responses +from fastapi import status, testclient +from sqlalchemy import orm + +from capellacollab.config import config +from capellacollab.core.authentication import api_key_cookie, exceptions, oidc +from capellacollab.core.authentication import routes +from capellacollab.core.authentication import routes as auth_routes +from capellacollab.users import crud as users_crud +from capellacollab.users import models as users_models + + +@pytest.fixture(name="mock_auth_endpoints") +def fixture_mock_oidc_endpoints(monkeypatch: pytest.MonkeyPatch): + monkeypatch.setattr( + config.authentication.endpoints, + "well_known", + "https://mock.localhost/default/.well-known/openid-configuration", + ) + responses.get( + "https://mock.localhost/default/.well-known/openid-configuration", + status=200, + json={ + "authorization_endpoint": "https://mock.localhost/default/authorize", + "token_endpoint": "https://mock.localhost/default/token", + "jwks_uri": "https:///mock.localhost/default/jwks", + }, + ) + + +@pytest.fixture(name="mock_token_creation") +def fixture_mock_token_creation(monkeypatch: pytest.MonkeyPatch): + responses.post( + "https://mock.localhost/default/token", + status=200, + json={ + "id_token": "id_token", + "refresh_token": "refresh_token", + "access_token": "access_token", + }, + ) + + monkeypatch.setattr(config.authentication.client, "id", "client_id") + monkeypatch.setattr( + api_key_cookie.JWTAPIKeyCookie, + "validate_token", + lambda self, token: { + "nonce": "nonce", + "aud": "client_id", + "sub": "sub", + }, + ) + + +@responses.activate +@pytest.mark.usefixtures("mock_auth_endpoints") +def test_get_prefilled_authorization_url( + client_unauthenticated: testclient.TestClient, +): + """Get the authorization URL from the backend""" + response = client_unauthenticated.get("/api/v1/authentication") + assert response.status_code == status.HTTP_200_OK + assert response.json()["auth_url"].startswith( + "https://mock.localhost/default/authorize" + ) + + +@responses.activate +@pytest.mark.usefixtures("mock_auth_endpoints", "mock_token_creation") +def test_get_identity_token( + client_unauthenticated: testclient.TestClient, +): + """Check that the identity token is set as cookie""" + response = client_unauthenticated.post( + "/api/v1/authentication/tokens", + json={"code": "any", "nonce": "nonce", "code_verifier": "any"}, + ) + + assert response.status_code == status.HTTP_200_OK + + assert "id_token" in response.headers["set-cookie"] + assert "refresh_token" in response.headers["set-cookie"] + + +@responses.activate +@pytest.mark.usefixtures("mock_auth_endpoints") +def test_user_info_updated_on_login( + db: orm.Session, + monkeypatch: pytest.MonkeyPatch, + client_unauthenticated: testclient.TestClient, + user: users_models.DatabaseUser, +): + """Propagate changes of the name or email fields of the JWT""" + monkeypatch.setattr( + oidc.OIDCProvider, + "exchange_code_for_tokens", + lambda *args: {"id_token": ""}, + ) + monkeypatch.setattr( + config.authentication.mapping, "identifier", "idp_identifier" + ) + monkeypatch.setattr( + auth_routes, + "validate_id_token", + lambda *args: { + "idp_identifier": user.idp_identifier, + "sub": "new_name", + "email": "test@example.com", + }, + ) + + response = client_unauthenticated.post( + "/api/v1/authentication/tokens", + json={"code": "any", "nonce": "nonce", "code_verifier": "any"}, + ) + assert response.status_code == status.HTTP_200_OK + + updated_user = users_crud.get_user_by_idp_identifier( + db, user.idp_identifier + ) + assert updated_user is not None + assert updated_user.name == "new_name" + assert updated_user.email == "test@example.com" + + +@responses.activate +@pytest.mark.usefixtures("mock_auth_endpoints") +def test_user_created_on_first_login( + db: orm.Session, + monkeypatch: pytest.MonkeyPatch, + client_unauthenticated: testclient.TestClient, +): + """When a user logs in the first time, it should be created""" + assert users_crud.get_user_by_idp_identifier(db, "test") is None + + monkeypatch.setattr( + oidc.OIDCProvider, + "exchange_code_for_tokens", + lambda *args: {"id_token": ""}, + ) + monkeypatch.setattr( + auth_routes, "validate_id_token", lambda *args: {"sub": "sub"} + ) + monkeypatch.setattr( + auth_routes, + "validate_id_token", + lambda *args: { + "sub": "test", + }, + ) + + response = client_unauthenticated.post( + "/api/v1/authentication/tokens", + json={"code": "any", "nonce": "nonce", "code_verifier": "any"}, + ) + assert response.status_code == status.HTTP_200_OK + + assert users_crud.get_user_by_name(db, "test") is not None + + +@responses.activate +@pytest.mark.usefixtures("mock_auth_endpoints", "mock_token_creation") +def test_refresh_token( + client_unauthenticated: testclient.TestClient, +): + response = client_unauthenticated.put( + "/api/v1/authentication/tokens", + cookies={ + "refresh_token": "refresh_token", + }, + json={"code": "any", "nonce": "nonce", "code_verifier": "any"}, + ) + + assert response.status_code == status.HTTP_200_OK + + assert "id_token" in response.headers["set-cookie"] + assert "refresh_token" in response.headers["set-cookie"] + + +@responses.activate +@pytest.mark.usefixtures("mock_auth_endpoints") +def test_delete_token_cookies( + client_unauthenticated: testclient.TestClient, +): + response = client_unauthenticated.delete("/api/v1/authentication/tokens") + + assert response.status_code == status.HTTP_200_OK + assert 'id_token=""' in response.headers["set-cookie"] + + +def test_missing_refresh_token(client_unauthenticated: testclient.TestClient): + response = client_unauthenticated.put("api/v1/authentication/tokens") + json_response = response.json() + + assert response.status_code == status.HTTP_400_BAD_REQUEST + assert json_response["detail"]["err_code"] == "NO_REFRESH_TOKEN_COOKIE" + + +@responses.activate +@pytest.mark.usefixtures("mock_auth_endpoints") +def test_validate_id_token_nonce_mismatch( + monkeypatch: pytest.MonkeyPatch, +): + mock_jwt_api_cookie = mock.MagicMock() + mock_jwt_api_cookie.return_value.validate_token.return_value = { + "nonce": "mismatch-nonce" + } + + monkeypatch.setattr(api_key_cookie, "JWTAPIKeyCookie", mock_jwt_api_cookie) + + with pytest.raises(exceptions.NonceMismatchError): + routes.validate_id_token("any", "correct-nonce") + + +@responses.activate +@pytest.mark.usefixtures("mock_auth_endpoints") +def test_validate_id_token_audience_mismatch( + monkeypatch: pytest.MonkeyPatch, +): + mock_jwt_api_cookie = mock.MagicMock() + mock_jwt_api_cookie.return_value.validate_token.return_value = { + "nonce": "mock-nonce", + "aud": "mock-audience", + } + + monkeypatch.setattr(api_key_cookie, "JWTAPIKeyCookie", mock_jwt_api_cookie) + + with pytest.raises(exceptions.UnauthenticatedError): + routes.validate_id_token("any", "mock-nonce") diff --git a/backend/tests/projects/test_projects_routes.py b/backend/tests/projects/test_projects_routes.py index 29b6ff917..a989b530d 100644 --- a/backend/tests/projects/test_projects_routes.py +++ b/backend/tests/projects/test_projects_routes.py @@ -19,7 +19,9 @@ def test_get_internal_default_project_as_user( - client: testclient.TestClient, db: orm.Session, executor_name: str + client: testclient.TestClient, + db: orm.Session, + executor_name: str, ): users_crud.create_user( db, executor_name, executor_name, None, users_models.Role.USER @@ -40,7 +42,9 @@ def test_get_internal_default_project_as_user( def test_get_projects_as_user_only_shows_default_internal_project( - client: testclient.TestClient, db: orm.Session, executor_name: str + client: testclient.TestClient, + db: orm.Session, + executor_name: str, ): users_crud.create_user( db, executor_name, executor_name, None, users_models.Role.USER @@ -59,7 +63,8 @@ def test_get_projects_as_user_only_shows_default_internal_project( @pytest.mark.usefixtures("project_manager") def test_get_projects_as_user_with_project( - client: testclient.TestClient, project: projects_models.DatabaseProject + client: testclient.TestClient, + project: projects_models.DatabaseProject, ): response = client.get("/api/v1/projects") @@ -73,7 +78,9 @@ def test_get_projects_as_user_with_project( def test_get_projects_as_admin( - client: testclient.TestClient, db: orm.Session, executor_name: str + client: testclient.TestClient, + db: orm.Session, + executor_name: str, ): project = projects_crud.create_project( db, "test project", visibility=projects_models.Visibility.PRIVATE @@ -94,7 +101,9 @@ def test_get_projects_as_admin( def test_get_internal_projects_as_user( - client: testclient.TestClient, db: orm.Session, executor_name: str + client: testclient.TestClient, + db: orm.Session, + executor_name: str, ): project = projects_crud.create_project( db, "test project", visibility=projects_models.Visibility.INTERNAL @@ -115,7 +124,9 @@ def test_get_internal_projects_as_user( def test_get_internal_projects_as_user_without_duplicates( - client: testclient.TestClient, db: orm.Session, executor_name: str + client: testclient.TestClient, + db: orm.Session, + executor_name: str, ): user = users_crud.create_user( db, executor_name, executor_name, None, users_models.Role.USER @@ -149,7 +160,9 @@ def test_get_internal_projects_as_user_without_duplicates( def test_create_private_project_as_admin( - client: testclient.TestClient, db: orm.Session, executor_name: str + client: testclient.TestClient, + db: orm.Session, + executor_name: str, ): users_crud.create_user( db, executor_name, executor_name, None, users_models.Role.ADMIN @@ -172,7 +185,9 @@ def test_create_private_project_as_admin( def test_create_internal_project_as_admin( - client: testclient.TestClient, db: orm.Session, executor_name: str + client: testclient.TestClient, + db: orm.Session, + executor_name: str, ): users_crud.create_user( db, executor_name, executor_name, None, users_models.Role.ADMIN @@ -196,7 +211,9 @@ def test_create_internal_project_as_admin( def test_update_project_as_admin( - client: testclient.TestClient, db: orm.Session, executor_name: str + client: testclient.TestClient, + db: orm.Session, + executor_name: str, ): users_crud.create_user( db, executor_name, executor_name, None, users_models.Role.ADMIN @@ -295,28 +312,36 @@ def test_delete_pipeline_called_when_archiving_project( @pytest.mark.usefixtures("project_user") -def test_get_project_per_role_user(client: testclient.TestClient): +def test_get_project_per_role_user( + client: testclient.TestClient, +): response = client.get("/api/v1/projects/?minimum_role=user") assert response.status_code == 200 assert len(response.json()) > 0 @pytest.mark.usefixtures("project_user") -def test_get_project_per_role_manager_as_user(client: testclient.TestClient): +def test_get_project_per_role_manager_as_user( + client: testclient.TestClient, +): response = client.get("/api/v1/projects/?minimum_role=manager") assert response.status_code == 200 assert len(response.json()) == 0 @pytest.mark.usefixtures("project_manager") -def test_get_project_per_role_manager(client: testclient.TestClient): +def test_get_project_per_role_manager( + client: testclient.TestClient, +): response = client.get("/api/v1/projects/?minimum_role=manager") assert response.status_code == 200 assert len(response.json()) > 0 def test_get_project_per_role_admin( - client: testclient.TestClient, executor_name: str, db: orm.Session + client: testclient.TestClient, + executor_name: str, + db: orm.Session, ): users_crud.create_user( db, executor_name, executor_name, None, users_models.Role.ADMIN diff --git a/backend/tests/sessions/hooks/test_guacamole_hook.py b/backend/tests/sessions/hooks/test_guacamole_hook.py index 8c583607a..851139e83 100644 --- a/backend/tests/sessions/hooks/test_guacamole_hook.py +++ b/backend/tests/sessions/hooks/test_guacamole_hook.py @@ -27,7 +27,7 @@ def fixture_session() -> sessions_models.DatabaseSession: created_at=datetime.datetime.now(), type=sessions_models.SessionType.READONLY, owner=users_models.DatabaseUser( - name="test", role=users_models.Role.USER + name="test", idp_identifier="test", role=users_models.Role.USER ), tool=tool_version.tool, version=tool_version, @@ -141,7 +141,7 @@ def test_guacamole_configuration_hook( "host": "test", }, user=users_models.DatabaseUser( - name="test", role=users_models.Role.USER + name="test", idp_identifier="test", role=users_models.Role.USER ), connection_method=tools_models.GuacamoleConnectionMethod(), ) @@ -180,7 +180,7 @@ def test_fail_if_guacamole_unreachable( "host": "test", }, user=users_models.DatabaseUser( - name="test", role=users_models.Role.USER + name="test", idp_identifier="test", role=users_models.Role.USER ), connection_method=tools_models.GuacamoleConnectionMethod(), ) @@ -208,7 +208,7 @@ def test_guacamole_hook_not_executed_for_http_method( }, db_session=session, user=users_models.DatabaseUser( - name="test", role=users_models.Role.USER + name="test", idp_identifier="test", role=users_models.Role.USER ), connection_method=tools_models.HTTPConnectionMethod(), ) @@ -236,7 +236,7 @@ def test_skip_guacamole_user_deletion_on_404( "host": "test", }, user=users_models.DatabaseUser( - name="test", role=users_models.Role.USER + name="test", idp_identifier="test", role=users_models.Role.USER ), connection_method=tools_models.GuacamoleConnectionMethod(), ) diff --git a/backend/tests/sessions/test_session_environment.py b/backend/tests/sessions/test_session_environment.py index 8df44b934..3009f2ad1 100644 --- a/backend/tests/sessions/test_session_environment.py +++ b/backend/tests/sessions/test_session_environment.py @@ -145,7 +145,9 @@ class GetSessionsReponseMock: connection_method_id="test", provisioning=[], ), - users_models.DatabaseUser(name="test", role=users_models.Role.USER), + users_models.DatabaseUser( + name="test", idp_identifier="test", role=users_models.Role.USER + ), None, operator, logger, diff --git a/backend/tests/sessions/test_session_routes.py b/backend/tests/sessions/test_session_routes.py index 1f3b15d0b..8472083b7 100644 --- a/backend/tests/sessions/test_session_routes.py +++ b/backend/tests/sessions/test_session_routes.py @@ -177,6 +177,7 @@ def test_create_session_without_provisioning( assert kubernetes.sessions +@pytest.mark.usefixtures("executor_name") def test_validate_session_token_with_invalid_session( client: testclient.TestClient, ): diff --git a/backend/tests/settings/teamforcapella/test_t4c_instances.py b/backend/tests/settings/teamforcapella/test_t4c_instances.py index 63e1836c4..89fd9cde3 100644 --- a/backend/tests/settings/teamforcapella/test_t4c_instances.py +++ b/backend/tests/settings/teamforcapella/test_t4c_instances.py @@ -87,7 +87,9 @@ def test_create_t4c_instance_already_existing_name( @pytest.mark.usefixtures("t4c_instance") def test_get_t4c_instances( - client: testclient.TestClient, db: orm.Session, executor_name: str + client: testclient.TestClient, + db: orm.Session, + executor_name: str, ): users_crud.create_user( db, executor_name, executor_name, None, users_models.Role.ADMIN diff --git a/backend/tests/settings/test_global_configuration.py b/backend/tests/settings/test_global_configuration.py index 2c8531939..9a0655dd0 100644 --- a/backend/tests/settings/test_global_configuration.py +++ b/backend/tests/settings/test_global_configuration.py @@ -14,7 +14,9 @@ @pytest.mark.usefixtures("admin") -def test_get_default_configuration(client: testclient.TestClient): +def test_get_default_configuration( + client: testclient.TestClient, +): """Test that the default configuration is returned if no configuration is set.""" response = client.get("/api/v1/settings/configurations/global") @@ -47,6 +49,7 @@ def test_get_general_configuration( ) +@pytest.mark.usefixtures("executor_name") def test_get_configuration_schema(client: testclient.TestClient): response = client.get("/api/v1/settings/configurations/global/schema") @@ -55,7 +58,9 @@ def test_get_configuration_schema(client: testclient.TestClient): @pytest.mark.usefixtures("admin") -def test_update_general_configuration(client: testclient.TestClient): +def test_update_general_configuration( + client: testclient.TestClient, +): common_metadata = { "privacy_policy_url": "https://example.com/privacy-policy", "imprint_url": "https://example.com/imprint", @@ -109,7 +114,9 @@ def test_update_general_configuration_additional_properties_fails( def test_metadata_is_updated( - client: testclient.TestClient, db: orm.Session, executor_name: str + client: testclient.TestClient, + db: orm.Session, + executor_name: str, ): admin = users_crud.create_user( db, executor_name, executor_name, None, users_models.Role.ADMIN diff --git a/backend/tests/test_event_creation.py b/backend/tests/test_event_creation.py index 2589dc684..c24e4ff23 100644 --- a/backend/tests/test_event_creation.py +++ b/backend/tests/test_event_creation.py @@ -3,10 +3,12 @@ import pytest import sqlalchemy as sa +from fastapi import testclient from sqlalchemy import orm from capellacollab import config from capellacollab.events import models as events_models +from capellacollab.projects import models as projects_models from capellacollab.projects.users import crud as projects_users_crud from capellacollab.projects.users import models as projects_users_models from capellacollab.users import crud as users_crud @@ -16,9 +18,8 @@ def test_create_admin_user_by_system(db): - user: users_models.DatabaseUser = users_crud.get_user_by_name( - db, config.config.initial.admin - ) + user = users_crud.get_user_by_name(db, config.config.initial.admin) + assert user is not None events: list[events_models.DatabaseUserHistoryEvent] = ( get_events_by_user_id(db, user.id) @@ -41,8 +42,13 @@ def test_create_user_created_event(client, db, executor_name, unique_username): ) response = client.post( - "/api/v1/users/", - json={"name": unique_username, "role": "user", "reason": reason}, + "/api/v1/users", + json={ + "name": unique_username, + "role": "user", + "reason": reason, + "idp_identifier": "test", + }, ) events = get_events_by_username(db, unique_username) @@ -59,14 +65,24 @@ def test_create_user_created_event(client, db, executor_name, unique_username): assert event.user_id == int(response.json()["id"]) -def test_user_deleted_cleanup(client, db, executor_name, unique_username): +def test_user_deleted_cleanup( + client: testclient.TestClient, + db: orm.Session, + executor_name: str, + unique_username: str, +): executor = users_crud.create_user( db, executor_name, executor_name, None, users_models.Role.ADMIN ) response = client.post( - "/api/v1/users/", - json={"name": unique_username, "role": "user", "reason": reason}, + "/api/v1/users", + json={ + "name": unique_username, + "idp_identifier": "test", + "role": "user", + "reason": reason, + }, ) assert response.status_code == 200 @@ -97,13 +113,13 @@ def test_user_deleted_cleanup(client, db, executor_name, unique_username): ], ) def test_create_assign_user_role_event( - client, - db, - executor_name, - unique_username, - initial_role, - target_role, - expected_event_type, + client: testclient.TestClient, + db: orm.Session, + executor_name: str, + unique_username: str, + initial_role: users_models.Role, + target_role: users_models.Role, + expected_event_type: events_models.EventType, ): executor = users_crud.create_user( db, executor_name, executor_name, None, users_models.Role.ADMIN @@ -145,13 +161,13 @@ def test_create_assign_user_role_event( ], ) def test_create_user_added_to_project_event( - client, - db, - executor_name, - unique_username, - project, - permission, - expected_permission_event_type, + client: testclient.TestClient, + db: orm.Session, + executor_name: str, + unique_username: str, + project: projects_models.DatabaseProject, + permission: projects_users_models.ProjectUserPermission, + expected_permission_event_type: events_models.EventType, ): executor = users_crud.create_user( db, executor_name, executor_name, None, users_models.Role.ADMIN @@ -192,7 +208,11 @@ def test_create_user_added_to_project_event( def test_create_user_removed_from_project_event( - client, db, executor_name, unique_username, project + client: testclient.TestClient, + db: orm.Session, + executor_name: str, + unique_username: str, + project: projects_models.DatabaseProject, ): executor = users_crud.create_user( db, executor_name, executor_name, None, users_models.Role.ADMIN @@ -231,7 +251,11 @@ def test_create_user_removed_from_project_event( def test_create_manager_added_to_project_event( - client, db, executor_name, unique_username, project + client: testclient.TestClient, + db: orm.Session, + executor_name: str, + unique_username: str, + project: projects_models.DatabaseProject, ): executor = users_crud.create_user( db, executor_name, executor_name, None, users_models.Role.ADMIN @@ -285,14 +309,14 @@ def test_create_manager_added_to_project_event( ], ) def test_create_user_permission_change_event( - client, - db, - executor_name, - unique_username, - project, - initial_permission, - target_permission, - expected_permission_event_type, + client: testclient.TestClient, + db: orm.Session, + executor_name: str, + unique_username: str, + project: projects_models.DatabaseProject, + initial_permission: projects_users_models.ProjectUserPermission, + target_permission: projects_users_models.ProjectUserPermission, + expected_permission_event_type: events_models.EventType, ): executor = users_crud.create_user( db, executor_name, executor_name, None, users_models.Role.ADMIN @@ -347,14 +371,14 @@ def test_create_user_permission_change_event( ], ) def test_create_user_role_change_event( - client, - db, - executor_name, - unique_username, - project, - initial_role, - target_role, - expected_role_event_type, + client: testclient.TestClient, + db: orm.Session, + executor_name: str, + unique_username: str, + project: projects_models.DatabaseProject, + initial_role: projects_users_models.ProjectUserRole, + target_role: projects_users_models.ProjectUserRole, + expected_role_event_type: events_models.EventType, ): executor = users_crud.create_user( db, executor_name, executor_name, None, users_models.Role.ADMIN diff --git a/backend/tests/test_metrics.py b/backend/tests/test_metrics.py index 49aeab99f..8591703b8 100644 --- a/backend/tests/test_metrics.py +++ b/backend/tests/test_metrics.py @@ -5,11 +5,12 @@ from fastapi import testclient from kubernetes import client as k8s_client +from capellacollab import __main__ from capellacollab.sessions import metrics -def test_metrics_endpoint(client: testclient.TestClient): - response = client.get("/metrics") +def test_metrics_endpoint(client_unauthenticated: testclient.TestClient): + response = client_unauthenticated.get("/metrics") assert response.status_code == 200 assert "# HELP " in response.text diff --git a/backend/tests/tools/test_tools_natures_routes.py b/backend/tests/tools/test_tools_natures_routes.py index 2b003b971..53ea7ada0 100644 --- a/backend/tests/tools/test_tools_natures_routes.py +++ b/backend/tests/tools/test_tools_natures_routes.py @@ -9,7 +9,8 @@ @pytest.mark.usefixtures("admin") def test_create_tool_nature( - client: testclient.TestClient, tool: tools_models.DatabaseTool + client: testclient.TestClient, + tool: tools_models.DatabaseTool, ): """Test creating a tool nature""" diff --git a/backend/tests/tools/test_tools_routes.py b/backend/tests/tools/test_tools_routes.py index dae6c23c0..4d1fe4cf5 100644 --- a/backend/tests/tools/test_tools_routes.py +++ b/backend/tests/tools/test_tools_routes.py @@ -46,7 +46,8 @@ def test_create_tool(client: testclient.TestClient): @pytest.mark.usefixtures("admin") def test_update_tool( - client: testclient.TestClient, tool: tools_models.DatabaseTool + client: testclient.TestClient, + tool: tools_models.DatabaseTool, ): """Test updating a tool""" response = client.put( @@ -85,7 +86,8 @@ def test_update_tool( @pytest.mark.usefixtures("admin") def test_delete_tool( - client: testclient.TestClient, tool: tools_models.DatabaseTool + client: testclient.TestClient, + tool: tools_models.DatabaseTool, ): """Test deleting a tool""" response = client.delete( diff --git a/backend/tests/tools/versions/test_tools_version_routes.py b/backend/tests/tools/versions/test_tools_version_routes.py index 953e890a1..0c7658e88 100644 --- a/backend/tests/tools/versions/test_tools_version_routes.py +++ b/backend/tests/tools/versions/test_tools_version_routes.py @@ -9,7 +9,8 @@ @pytest.mark.usefixtures("admin") def test_create_tool_version( - client: testclient.TestClient, tool: tools_models.DatabaseTool + client: testclient.TestClient, + tool: tools_models.DatabaseTool, ): """Test creating a tool version""" response = client.post( diff --git a/backend/tests/users/fixtures.py b/backend/tests/users/fixtures.py index 4d614dd7e..62cbe9c3c 100644 --- a/backend/tests/users/fixtures.py +++ b/backend/tests/users/fixtures.py @@ -21,10 +21,10 @@ def fixture_executor_name(monkeypatch: pytest.MonkeyPatch) -> str: name = str(uuid.uuid1()) - # pylint: disable=unused-argument async def cookie_passthrough(self, request: fastapi.Request): return name + monkeypatch.setattr(JWTAPIKeyCookie, "__init__", lambda self: None) monkeypatch.setattr(JWTAPIKeyCookie, "__call__", cookie_passthrough) return name diff --git a/backend/tests/users/test_users.py b/backend/tests/users/test_users.py index f6acc8da6..b7c58d7ad 100644 --- a/backend/tests/users/test_users.py +++ b/backend/tests/users/test_users.py @@ -18,7 +18,9 @@ def test_get_user_by_id_admin( - client: testclient.TestClient, db: orm.Session, executor_name: str + client: testclient.TestClient, + db: orm.Session, + executor_name: str, ): users_crud.create_user( db, executor_name, executor_name, None, users_models.Role.ADMIN diff --git a/frontend/Makefile b/frontend/Makefile index a9e40925f..42daf9a0f 100644 --- a/frontend/Makefile +++ b/frontend/Makefile @@ -3,6 +3,8 @@ export NG_FORCE_TTY=false +.ONESHELL: + dev: ng serve --host 0.0.0.0 --open @@ -20,11 +22,11 @@ storybook: openapi: python postprocess_openapi_schema.py - mkdir -p /tmp/openapi + OPENAPI_DIR=$$(mktemp -d) docker run --rm \ -v /tmp/openapi.json:/tmp/openapi.json \ -v $$(pwd)/openapi_templates:/tmp/openapi_templates \ - -v /tmp/openapi:/tmp/output \ + -v $$OPENAPI_DIR:/tmp/output \ -u $$(id -u $${USER}):$$(id -g $${USER}) \ openapitools/openapi-generator-cli:v7.7.0 generate \ -i /tmp/openapi.json \ @@ -33,6 +35,7 @@ openapi: --additional-properties=fileNaming=kebab-case,legacyDiscriminatorBehavior=false \ -g typescript-angular \ -o /tmp/output - cp ../LICENSES/.license_header_cc0.txt /tmp/openapi/.openapi-generator/FILES.license - cp ../LICENSES/.license_header_cc0.txt /tmp/openapi/.openapi-generator/VERSION.license - rsync -avh --delete /tmp/openapi/ $$(pwd)/src/app/openapi + cp ../LICENSES/.license_header_cc0.txt $$OPENAPI_DIR/.openapi-generator/FILES.license + cp ../LICENSES/.license_header_cc0.txt $$OPENAPI_DIR/.openapi-generator/VERSION.license + rsync -avh --delete $$OPENAPI_DIR/ $$(pwd)/src/app/openapi + rm -rf $$OPENAPI_DIR diff --git a/frontend/src/app/general/auth/auth-guard/auth-guard.service.ts b/frontend/src/app/general/auth/auth-guard/auth-guard.service.ts index 4b173132b..e5fc8df23 100644 --- a/frontend/src/app/general/auth/auth-guard/auth-guard.service.ts +++ b/frontend/src/app/general/auth/auth-guard/auth-guard.service.ts @@ -9,13 +9,13 @@ import { CanActivateFn, RouterStateSnapshot, } from '@angular/router'; -import { AuthService } from 'src/app/services/auth/auth.service'; +import { AuthenticationWrapperService } from 'src/app/services/auth/auth.service'; export const authGuard: CanActivateFn = ( _route: ActivatedRouteSnapshot, _state: RouterStateSnapshot, ) => { - const authService = inject(AuthService); + const authService = inject(AuthenticationWrapperService); if (authService.isLoggedIn()) { return true; diff --git a/frontend/src/app/general/auth/auth-redirect/auth-redirect.component.ts b/frontend/src/app/general/auth/auth-redirect/auth-redirect.component.ts index d5fb87511..86413a64f 100644 --- a/frontend/src/app/general/auth/auth-redirect/auth-redirect.component.ts +++ b/frontend/src/app/general/auth/auth-redirect/auth-redirect.component.ts @@ -6,7 +6,8 @@ import { Component, OnInit } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; import { ToastService } from 'src/app/helpers/toast/toast.service'; -import { AuthService } from 'src/app/services/auth/auth.service'; +import { AuthenticationService } from 'src/app/openapi'; +import { AuthenticationWrapperService } from 'src/app/services/auth/auth.service'; import { UserWrapperService } from 'src/app/services/user/user.service'; @Component({ @@ -18,7 +19,8 @@ export class AuthRedirectComponent implements OnInit { constructor( private route: ActivatedRoute, private toastService: ToastService, - private authService: AuthService, + private authService: AuthenticationWrapperService, + private authenticationService: AuthenticationService, private userService: UserWrapperService, private router: Router, ) {} @@ -66,8 +68,12 @@ export class AuthRedirectComponent implements OnInit { this.authService.SESSION_STORAGE_CODE_VERIFIER_KEY, ); - this.authService - .getIdentityToken(params.code, nonce, codeVerifier) + this.authenticationService + .getIdentityToken({ + code: params.code, + nonce, + code_verifier: codeVerifier, + }) .subscribe({ next: () => { localStorage.setItem(this.authService.LOGGED_IN_KEY, 'true'); diff --git a/frontend/src/app/general/auth/auth/auth.component.ts b/frontend/src/app/general/auth/auth/auth.component.ts index 7826f04ca..d17dd453e 100644 --- a/frontend/src/app/general/auth/auth/auth.component.ts +++ b/frontend/src/app/general/auth/auth/auth.component.ts @@ -9,7 +9,7 @@ import { MatButton } from '@angular/material/button'; import { ActivatedRoute, ParamMap } from '@angular/router'; import { MetadataService } from 'src/app/general/metadata/metadata.service'; import { PageLayoutService } from 'src/app/page-layout/page-layout.service'; -import { AuthService } from 'src/app/services/auth/auth.service'; +import { AuthenticationWrapperService } from 'src/app/services/auth/auth.service'; @Component({ selector: 'app-auth', @@ -30,7 +30,7 @@ export class AuthComponent implements OnInit { constructor( public metadataService: MetadataService, - public authService: AuthService, + public authService: AuthenticationWrapperService, private pageLayoutService: PageLayoutService, private route: ActivatedRoute, ) { diff --git a/frontend/src/app/general/auth/http-interceptor/auth.interceptor.ts b/frontend/src/app/general/auth/http-interceptor/auth.interceptor.ts index 93bb384a6..f85a5c179 100644 --- a/frontend/src/app/general/auth/http-interceptor/auth.interceptor.ts +++ b/frontend/src/app/general/auth/http-interceptor/auth.interceptor.ts @@ -14,13 +14,15 @@ import { Injectable } from '@angular/core'; import { Router } from '@angular/router'; import { Observable } from 'rxjs'; import { catchError, switchMap } from 'rxjs/operators'; -import { AuthService } from 'src/app/services/auth/auth.service'; +import { AuthenticationService } from 'src/app/openapi'; +import { AuthenticationWrapperService } from 'src/app/services/auth/auth.service'; @Injectable() export class AuthInterceptor implements HttpInterceptor { constructor( private router: Router, - private authService: AuthService, + private authService: AuthenticationWrapperService, + private authenticationService: AuthenticationService, ) {} intercept( @@ -43,7 +45,7 @@ export class AuthInterceptor implements HttpInterceptor { if (err.status === 401) { localStorage.setItem(this.authService.LOGGED_IN_KEY, 'false'); if (err.error.detail.err_code == 'TOKEN_SIGNATURE_EXPIRED') { - return this.authService.performTokenRefresh().pipe( + return this.authenticationService.refreshIdentityToken().pipe( switchMap(() => { return next.handle(request); }), diff --git a/frontend/src/app/general/auth/logout/logout-redirect/logout-redirect.component.ts b/frontend/src/app/general/auth/logout/logout-redirect/logout-redirect.component.ts index c4e707d1d..775a8641d 100644 --- a/frontend/src/app/general/auth/logout/logout-redirect/logout-redirect.component.ts +++ b/frontend/src/app/general/auth/logout/logout-redirect/logout-redirect.component.ts @@ -5,7 +5,7 @@ import { Component, OnInit } from '@angular/core'; import { Router } from '@angular/router'; -import { AuthService } from 'src/app/services/auth/auth.service'; +import { AuthenticationWrapperService } from 'src/app/services/auth/auth.service'; @Component({ selector: 'app-logout-redirect', @@ -15,7 +15,7 @@ import { AuthService } from 'src/app/services/auth/auth.service'; }) export class LogoutRedirectComponent implements OnInit { constructor( - private authService: AuthService, + private authService: AuthenticationWrapperService, private router: Router, ) {} diff --git a/frontend/src/app/general/header/header.component.ts b/frontend/src/app/general/header/header.component.ts index 5f31abaed..d6cbea9a4 100644 --- a/frontend/src/app/general/header/header.component.ts +++ b/frontend/src/app/general/header/header.component.ts @@ -9,7 +9,7 @@ import { MatIcon } from '@angular/material/icon'; import { MatMenu, MatMenuItem, MatMenuTrigger } from '@angular/material/menu'; import { RouterLink } from '@angular/router'; import { NavBarService } from 'src/app/general/nav-bar/nav-bar.service'; -import { AuthService } from '../../services/auth/auth.service'; +import { AuthenticationWrapperService } from '../../services/auth/auth.service'; import { UserWrapperService } from '../../services/user/user.service'; import { BreadcrumbsComponent } from '../breadcrumbs/breadcrumbs.component'; @@ -31,7 +31,7 @@ import { BreadcrumbsComponent } from '../breadcrumbs/breadcrumbs.component'; }) export class HeaderComponent { constructor( - public authService: AuthService, + public authService: AuthenticationWrapperService, public userService: UserWrapperService, public navBarService: NavBarService, ) {} diff --git a/frontend/src/app/general/nav-bar-menu/nav-bar-menu.component.ts b/frontend/src/app/general/nav-bar-menu/nav-bar-menu.component.ts index 6c1af1eb8..45b0f695f 100644 --- a/frontend/src/app/general/nav-bar-menu/nav-bar-menu.component.ts +++ b/frontend/src/app/general/nav-bar-menu/nav-bar-menu.component.ts @@ -9,7 +9,7 @@ import { MatIcon } from '@angular/material/icon'; import { MatList, MatListItem } from '@angular/material/list'; import { RouterLink } from '@angular/router'; import { NavBarService } from 'src/app/general/nav-bar/nav-bar.service'; -import { AuthService } from 'src/app/services/auth/auth.service'; +import { AuthenticationWrapperService } from 'src/app/services/auth/auth.service'; import { UserWrapperService } from 'src/app/services/user/user.service'; @Component({ @@ -21,7 +21,7 @@ import { UserWrapperService } from 'src/app/services/user/user.service'; }) export class NavBarMenuComponent { constructor( - public authService: AuthService, + public authService: AuthenticationWrapperService, public navBarService: NavBarService, public userService: UserWrapperService, ) {} diff --git a/frontend/src/app/openapi/.openapi-generator/FILES b/frontend/src/app/openapi/.openapi-generator/FILES index ef2e6ad6e..0a149ccfc 100644 --- a/frontend/src/app/openapi/.openapi-generator/FILES +++ b/frontend/src/app/openapi/.openapi-generator/FILES @@ -1,8 +1,10 @@ api.module.ts api/api.ts -api/default.service.ts +api/authentication.service.ts +api/configuration.service.ts api/events.service.ts api/health.service.ts +api/integrations-pure-variants.service.ts api/metadata.service.ts api/notices.service.ts api/projects-events.service.ts @@ -25,6 +27,7 @@ api/users.service.ts configuration.ts encoder.ts index.ts +model/authorization-response.ts model/backup-pipeline-run.ts model/backup.ts model/base-user.ts diff --git a/frontend/src/app/openapi/api/api.ts b/frontend/src/app/openapi/api/api.ts index 7de12560a..64dcdb524 100644 --- a/frontend/src/app/openapi/api/api.ts +++ b/frontend/src/app/openapi/api/api.ts @@ -9,12 +9,16 @@ + To generate a new version, run `make openapi` in the root directory of this repository. */ -export * from './default.service'; -import { DefaultService } from './default.service'; +export * from './authentication.service'; +import { AuthenticationService } from './authentication.service'; +export * from './configuration.service'; +import { ConfigurationService } from './configuration.service'; export * from './events.service'; import { EventsService } from './events.service'; export * from './health.service'; import { HealthService } from './health.service'; +export * from './integrations-pure-variants.service'; +import { IntegrationsPureVariantsService } from './integrations-pure-variants.service'; export * from './metadata.service'; import { MetadataService } from './metadata.service'; export * from './notices.service'; @@ -53,4 +57,4 @@ export * from './users-token.service'; import { UsersTokenService } from './users-token.service'; export * from './users-workspaces.service'; import { UsersWorkspacesService } from './users-workspaces.service'; -export const APIS = [DefaultService, EventsService, HealthService, MetadataService, NoticesService, ProjectsService, ProjectsEventsService, ProjectsModelsService, ProjectsModelsBackupsService, ProjectsModelsDiagramsService, ProjectsModelsGitService, ProjectsModelsModelComplexityBadgeService, ProjectsModelsRestrictionsService, ProjectsModelsT4CService, SessionsService, SettingsModelsourcesGitService, SettingsModelsourcesT4CService, ToolsService, UsersService, UsersSessionsService, UsersTokenService, UsersWorkspacesService]; +export const APIS = [AuthenticationService, ConfigurationService, EventsService, HealthService, IntegrationsPureVariantsService, MetadataService, NoticesService, ProjectsService, ProjectsEventsService, ProjectsModelsService, ProjectsModelsBackupsService, ProjectsModelsDiagramsService, ProjectsModelsGitService, ProjectsModelsModelComplexityBadgeService, ProjectsModelsRestrictionsService, ProjectsModelsT4CService, SessionsService, SettingsModelsourcesGitService, SettingsModelsourcesT4CService, ToolsService, UsersService, UsersSessionsService, UsersTokenService, UsersWorkspacesService]; diff --git a/frontend/src/app/openapi/api/authentication.service.ts b/frontend/src/app/openapi/api/authentication.service.ts new file mode 100644 index 000000000..c254aeb79 --- /dev/null +++ b/frontend/src/app/openapi/api/authentication.service.ts @@ -0,0 +1,424 @@ +/* + * SPDX-FileCopyrightText: Copyright DB InfraGO AG and contributors + * SPDX-License-Identifier: Apache-2.0 + * + * Capella Collaboration + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit the class manually. + + To generate a new version, run `make openapi` in the root directory of this repository. + */ + +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { AuthorizationResponse } from '../model/authorization-response'; +// @ts-ignore +import { HTTPValidationError } from '../model/http-validation-error'; +// @ts-ignore +import { Role } from '../model/role'; +// @ts-ignore +import { TokenRequest } from '../model/token-request'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + + +@Injectable({ + providedIn: 'root' +}) +export class AuthenticationService { + + protected basePath = 'http://localhost'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; + } + + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + // @ts-ignore + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + + /** + * Get Authorization Url + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getAuthorizationUrl(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getAuthorizationUrl(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getAuthorizationUrl(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getAuthorizationUrl(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/v1/authentication`; + return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Get Identity Token + * @param tokenRequest + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getIdentityToken(tokenRequest: TokenRequest, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getIdentityToken(tokenRequest: TokenRequest, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getIdentityToken(tokenRequest: TokenRequest, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getIdentityToken(tokenRequest: TokenRequest, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (tokenRequest === null || tokenRequest === undefined) { + throw new Error('Required parameter tokenRequest was null or undefined when calling getIdentityToken.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/v1/authentication/tokens`; + return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: tokenRequest, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Logout + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public logout(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public logout(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public logout(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public logout(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/v1/authentication/tokens`; + return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Refresh Identity Token + * @param refreshToken + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public refreshIdentityToken(refreshToken?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public refreshIdentityToken(refreshToken?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public refreshIdentityToken(refreshToken?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public refreshIdentityToken(refreshToken?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/v1/authentication/tokens`; + return this.httpClient.request('put', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Validate Jwt Token + * @param scope + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public validateJwtToken(scope?: Role, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public validateJwtToken(scope?: Role, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public validateJwtToken(scope?: Role, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public validateJwtToken(scope?: Role, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + if (scope !== undefined && scope !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + scope, 'scope'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/v1/authentication/tokens`; + return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + +} diff --git a/frontend/src/app/openapi/api/configuration.service.ts b/frontend/src/app/openapi/api/configuration.service.ts new file mode 100644 index 000000000..bb2d495d5 --- /dev/null +++ b/frontend/src/app/openapi/api/configuration.service.ts @@ -0,0 +1,307 @@ +/* + * SPDX-FileCopyrightText: Copyright DB InfraGO AG and contributors + * SPDX-License-Identifier: Apache-2.0 + * + * Capella Collaboration + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit the class manually. + + To generate a new version, run `make openapi` in the root directory of this repository. + */ + +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { GlobalConfigurationInput } from '../model/global-configuration-input'; +// @ts-ignore +import { GlobalConfigurationOutput } from '../model/global-configuration-output'; +// @ts-ignore +import { HTTPValidationError } from '../model/http-validation-error'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + + +@Injectable({ + providedIn: 'root' +}) +export class ConfigurationService { + + protected basePath = 'http://localhost'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; + } + + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + // @ts-ignore + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + + /** + * Get Configuration + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getConfiguration(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getConfiguration(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getConfiguration(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getConfiguration(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (PersonalAccessToken) required + localVarCredential = this.configuration.lookupCredential('PersonalAccessToken'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/v1/settings/configurations/global`; + return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Get Json Schema + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getJsonSchema(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getJsonSchema(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getJsonSchema(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getJsonSchema(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/v1/settings/configurations/global/schema`; + return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Update Configuration + * @param globalConfigurationInput + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updateConfiguration(globalConfigurationInput: GlobalConfigurationInput, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public updateConfiguration(globalConfigurationInput: GlobalConfigurationInput, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateConfiguration(globalConfigurationInput: GlobalConfigurationInput, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateConfiguration(globalConfigurationInput: GlobalConfigurationInput, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (globalConfigurationInput === null || globalConfigurationInput === undefined) { + throw new Error('Required parameter globalConfigurationInput was null or undefined when calling updateConfiguration.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (PersonalAccessToken) required + localVarCredential = this.configuration.lookupCredential('PersonalAccessToken'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/v1/settings/configurations/global`; + return this.httpClient.request('put', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: globalConfigurationInput, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + +} diff --git a/frontend/src/app/openapi/api/default.service.ts b/frontend/src/app/openapi/api/default.service.ts deleted file mode 100644 index b6094b8cb..000000000 --- a/frontend/src/app/openapi/api/default.service.ts +++ /dev/null @@ -1,960 +0,0 @@ -/* - * SPDX-FileCopyrightText: Copyright DB InfraGO AG and contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Capella Collaboration - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit the class manually. - + To generate a new version, run `make openapi` in the root directory of this repository. - */ - -/* tslint:disable:no-unused-variable member-ordering */ - -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; - -// @ts-ignore -import { GlobalConfigurationInput } from '../model/global-configuration-input'; -// @ts-ignore -import { GlobalConfigurationOutput } from '../model/global-configuration-output'; -// @ts-ignore -import { HTTPValidationError } from '../model/http-validation-error'; -// @ts-ignore -import { PureVariantsLicensesInput } from '../model/pure-variants-licenses-input'; -// @ts-ignore -import { PureVariantsLicensesOutput } from '../model/pure-variants-licenses-output'; -// @ts-ignore -import { Role } from '../model/role'; -// @ts-ignore -import { TokenRequest } from '../model/token-request'; - -// @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; - - - -@Injectable({ - providedIn: 'root' -}) -export class DefaultService { - - protected basePath = 'http://localhost'; - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - public encoder: HttpParameterCodec; - - constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { - if (configuration) { - this.configuration = configuration; - } - if (typeof this.configuration.basePath !== 'string') { - const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; - if (firstBasePath != undefined) { - basePath = firstBasePath; - } - - if (typeof basePath !== 'string') { - basePath = this.basePath; - } - this.configuration.basePath = basePath; - } - this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); - } - - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } - - // @ts-ignore - private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { - if (typeof value === "object" && value instanceof Date === false) { - httpParams = this.addToHttpParamsRecursive(httpParams, value); - } else { - httpParams = this.addToHttpParamsRecursive(httpParams, value, key); - } - return httpParams; - } - - private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { - if (value == null) { - return httpParams; - } - - if (typeof value === "object") { - if (Array.isArray(value)) { - (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); - } else if (value instanceof Date) { - if (key != null) { - httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); - } else { - throw Error("key may not be null if value is Date"); - } - } else { - Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( - httpParams, value[k], key != null ? `${key}.${k}` : k)); - } - } else if (key != null) { - httpParams = httpParams.append(key, value); - } else { - throw Error("key may not be null if value is not object or array"); - } - return httpParams; - } - - /** - * Create The Identity Token - * @param tokenRequest - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public createTheIdentityToken(tokenRequest: TokenRequest, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public createTheIdentityToken(tokenRequest: TokenRequest, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public createTheIdentityToken(tokenRequest: TokenRequest, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public createTheIdentityToken(tokenRequest: TokenRequest, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (tokenRequest === null || tokenRequest === undefined) { - throw new Error('Required parameter tokenRequest was null or undefined when calling createTheIdentityToken.'); - } - - let localVarHeaders = this.defaultHeaders; - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v1/authentication/tokens`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: tokenRequest, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - - /** - * Delete License Key File - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public deleteLicenseKeyFile(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public deleteLicenseKeyFile(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public deleteLicenseKeyFile(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public deleteLicenseKeyFile(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - - let localVarHeaders = this.defaultHeaders; - - let localVarCredential: string | undefined; - // authentication (PersonalAccessToken) required - localVarCredential = this.configuration.lookupCredential('PersonalAccessToken'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); - } - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v1/settings/integrations/pure-variants/license-keys/0`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - - /** - * Get Configuration - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getConfiguration(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getConfiguration(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getConfiguration(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getConfiguration(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - - let localVarHeaders = this.defaultHeaders; - - let localVarCredential: string | undefined; - // authentication (PersonalAccessToken) required - localVarCredential = this.configuration.lookupCredential('PersonalAccessToken'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); - } - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v1/settings/configurations/global`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - - /** - * Get Json Schema - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getJsonSchema(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getJsonSchema(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getJsonSchema(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getJsonSchema(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - - let localVarHeaders = this.defaultHeaders; - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v1/settings/configurations/global/schema`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - - /** - * Get License - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getLicense(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getLicense(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getLicense(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getLicense(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - - let localVarHeaders = this.defaultHeaders; - - let localVarCredential: string | undefined; - // authentication (PersonalAccessToken) required - localVarCredential = this.configuration.lookupCredential('PersonalAccessToken'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); - } - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v1/settings/integrations/pure-variants`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - - /** - * Get The Authorization Url For The Oauth Server - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getTheAuthorizationURLForTheOAuthServer(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<{ [key: string]: string | null; }>; - public getTheAuthorizationURLForTheOAuthServer(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getTheAuthorizationURLForTheOAuthServer(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getTheAuthorizationURLForTheOAuthServer(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - - let localVarHeaders = this.defaultHeaders; - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v1/authentication`; - return this.httpClient.request<{ [key: string]: string | null; }>('get', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - - /** - * Refresh The Identity Token - * @param refreshToken - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public refreshTheIdentityToken(refreshToken?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public refreshTheIdentityToken(refreshToken?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public refreshTheIdentityToken(refreshToken?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public refreshTheIdentityToken(refreshToken?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - - let localVarHeaders = this.defaultHeaders; - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v1/authentication/tokens`; - return this.httpClient.request('put', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - - /** - * Remove The Token (Log Out) - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public removeTheTokenLogOut(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public removeTheTokenLogOut(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public removeTheTokenLogOut(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public removeTheTokenLogOut(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - - let localVarHeaders = this.defaultHeaders; - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v1/authentication/tokens`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - - /** - * Set License - * @param pureVariantsLicensesInput - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public setLicense(pureVariantsLicensesInput: PureVariantsLicensesInput, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public setLicense(pureVariantsLicensesInput: PureVariantsLicensesInput, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public setLicense(pureVariantsLicensesInput: PureVariantsLicensesInput, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public setLicense(pureVariantsLicensesInput: PureVariantsLicensesInput, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (pureVariantsLicensesInput === null || pureVariantsLicensesInput === undefined) { - throw new Error('Required parameter pureVariantsLicensesInput was null or undefined when calling setLicense.'); - } - - let localVarHeaders = this.defaultHeaders; - - let localVarCredential: string | undefined; - // authentication (PersonalAccessToken) required - localVarCredential = this.configuration.lookupCredential('PersonalAccessToken'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); - } - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v1/settings/integrations/pure-variants`; - return this.httpClient.request('patch', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: pureVariantsLicensesInput, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - - /** - * Update Configuration - * @param globalConfigurationInput - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public updateConfiguration(globalConfigurationInput: GlobalConfigurationInput, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public updateConfiguration(globalConfigurationInput: GlobalConfigurationInput, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public updateConfiguration(globalConfigurationInput: GlobalConfigurationInput, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public updateConfiguration(globalConfigurationInput: GlobalConfigurationInput, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (globalConfigurationInput === null || globalConfigurationInput === undefined) { - throw new Error('Required parameter globalConfigurationInput was null or undefined when calling updateConfiguration.'); - } - - let localVarHeaders = this.defaultHeaders; - - let localVarCredential: string | undefined; - // authentication (PersonalAccessToken) required - localVarCredential = this.configuration.lookupCredential('PersonalAccessToken'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); - } - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v1/settings/configurations/global`; - return this.httpClient.request('put', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: globalConfigurationInput, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - - /** - * Upload License Key File - * @param file - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public uploadLicenseKeyFile(file: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public uploadLicenseKeyFile(file: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public uploadLicenseKeyFile(file: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public uploadLicenseKeyFile(file: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (file === null || file === undefined) { - throw new Error('Required parameter file was null or undefined when calling uploadLicenseKeyFile.'); - } - - let localVarHeaders = this.defaultHeaders; - - let localVarCredential: string | undefined; - // authentication (PersonalAccessToken) required - localVarCredential = this.configuration.lookupCredential('PersonalAccessToken'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); - } - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - // to determine the Content-Type header - const consumes: string[] = [ - 'multipart/form-data' - ]; - - const canConsumeForm = this.canConsumeForm(consumes); - - let localVarFormParams: { append(param: string, value: any): any; }; - let localVarUseForm = false; - let localVarConvertFormParamsToString = false; - // use FormData to transmit files using content-type "multipart/form-data" - // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data - localVarUseForm = canConsumeForm; - if (localVarUseForm) { - localVarFormParams = new FormData(); - } else { - localVarFormParams = new HttpParams({encoder: this.encoder}); - } - - if (file !== undefined) { - localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v1/settings/integrations/pure-variants/license-keys`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - - /** - * Validate The Token - * @param scope - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public validateTheToken(scope?: Role, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public validateTheToken(scope?: Role, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public validateTheToken(scope?: Role, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public validateTheToken(scope?: Role, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - if (scope !== undefined && scope !== null) { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - scope, 'scope'); - } - - let localVarHeaders = this.defaultHeaders; - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v1/authentication/tokens`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - -} diff --git a/frontend/src/app/openapi/api/integrations-pure-variants.service.ts b/frontend/src/app/openapi/api/integrations-pure-variants.service.ts new file mode 100644 index 000000000..bd5f818ad --- /dev/null +++ b/frontend/src/app/openapi/api/integrations-pure-variants.service.ts @@ -0,0 +1,421 @@ +/* + * SPDX-FileCopyrightText: Copyright DB InfraGO AG and contributors + * SPDX-License-Identifier: Apache-2.0 + * + * Capella Collaboration + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit the class manually. + + To generate a new version, run `make openapi` in the root directory of this repository. + */ + +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { HTTPValidationError } from '../model/http-validation-error'; +// @ts-ignore +import { PureVariantsLicensesInput } from '../model/pure-variants-licenses-input'; +// @ts-ignore +import { PureVariantsLicensesOutput } from '../model/pure-variants-licenses-output'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + + +@Injectable({ + providedIn: 'root' +}) +export class IntegrationsPureVariantsService { + + protected basePath = 'http://localhost'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; + } + + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + /** + * @param consumes string[] mime-types + * @return true: consumes contains 'multipart/form-data', false: otherwise + */ + private canConsumeForm(consumes: string[]): boolean { + const form = 'multipart/form-data'; + for (const consume of consumes) { + if (form === consume) { + return true; + } + } + return false; + } + + // @ts-ignore + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + + /** + * Delete License Key File + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteLicenseKeyFile(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public deleteLicenseKeyFile(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteLicenseKeyFile(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteLicenseKeyFile(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (PersonalAccessToken) required + localVarCredential = this.configuration.lookupCredential('PersonalAccessToken'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/v1/settings/integrations/pure-variants/license-keys/0`; + return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Get License + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getLicense(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getLicense(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getLicense(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getLicense(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (PersonalAccessToken) required + localVarCredential = this.configuration.lookupCredential('PersonalAccessToken'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/v1/settings/integrations/pure-variants`; + return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Set License + * @param pureVariantsLicensesInput + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public setLicense(pureVariantsLicensesInput: PureVariantsLicensesInput, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public setLicense(pureVariantsLicensesInput: PureVariantsLicensesInput, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public setLicense(pureVariantsLicensesInput: PureVariantsLicensesInput, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public setLicense(pureVariantsLicensesInput: PureVariantsLicensesInput, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (pureVariantsLicensesInput === null || pureVariantsLicensesInput === undefined) { + throw new Error('Required parameter pureVariantsLicensesInput was null or undefined when calling setLicense.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (PersonalAccessToken) required + localVarCredential = this.configuration.lookupCredential('PersonalAccessToken'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/v1/settings/integrations/pure-variants`; + return this.httpClient.request('patch', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: pureVariantsLicensesInput, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Upload License Key File + * @param file + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public uploadLicenseKeyFile(file: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public uploadLicenseKeyFile(file: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public uploadLicenseKeyFile(file: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public uploadLicenseKeyFile(file: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (file === null || file === undefined) { + throw new Error('Required parameter file was null or undefined when calling uploadLicenseKeyFile.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (PersonalAccessToken) required + localVarCredential = this.configuration.lookupCredential('PersonalAccessToken'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + // to determine the Content-Type header + const consumes: string[] = [ + 'multipart/form-data' + ]; + + const canConsumeForm = this.canConsumeForm(consumes); + + let localVarFormParams: { append(param: string, value: any): any; }; + let localVarUseForm = false; + let localVarConvertFormParamsToString = false; + // use FormData to transmit files using content-type "multipart/form-data" + // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data + localVarUseForm = canConsumeForm; + if (localVarUseForm) { + localVarFormParams = new FormData(); + } else { + localVarFormParams = new HttpParams({encoder: this.encoder}); + } + + if (file !== undefined) { + localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/v1/settings/integrations/pure-variants/license-keys`; + return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + +} diff --git a/frontend/src/app/openapi/api/projects-models.service.ts b/frontend/src/app/openapi/api/projects-models.service.ts index 8da3503a2..6d39e9823 100644 --- a/frontend/src/app/openapi/api/projects-models.service.ts +++ b/frontend/src/app/openapi/api/projects-models.service.ts @@ -18,40 +18,14 @@ import { HttpClient, HttpHeaders, HttpParams, import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -// @ts-ignore -import { Backup } from '../model/backup'; -// @ts-ignore -import { BackupPipelineRun } from '../model/backup-pipeline-run'; -// @ts-ignore -import { CreateBackup } from '../model/create-backup'; -// @ts-ignore -import { DiagramCacheMetadata } from '../model/diagram-cache-metadata'; -// @ts-ignore -import { GetRevisionsResponseModel } from '../model/get-revisions-response-model'; -// @ts-ignore -import { GitModel } from '../model/git-model'; // @ts-ignore import { HTTPValidationError } from '../model/http-validation-error'; // @ts-ignore -import { PagePipelineRun } from '../model/page-pipeline-run'; -// @ts-ignore -import { PatchGitModel } from '../model/patch-git-model'; -// @ts-ignore import { PatchToolModel } from '../model/patch-tool-model'; // @ts-ignore -import { PipelineRun } from '../model/pipeline-run'; -// @ts-ignore -import { PostGitModel } from '../model/post-git-model'; -// @ts-ignore import { PostToolModel } from '../model/post-tool-model'; // @ts-ignore -import { SubmitT4CModel } from '../model/submit-t4-c-model'; -// @ts-ignore -import { T4CModel } from '../model/t4-c-model'; -// @ts-ignore import { ToolModel } from '../model/tool-model'; -// @ts-ignore -import { ToolModelRestrictions } from '../model/tool-model-restrictions'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; @@ -124,184 +98,6 @@ export class ProjectsModelsService { return httpParams; } - /** - * Create Backup - * @param projectSlug - * @param modelSlug - * @param createBackup - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public createBackup(projectSlug: string, modelSlug: string, createBackup: CreateBackup, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public createBackup(projectSlug: string, modelSlug: string, createBackup: CreateBackup, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public createBackup(projectSlug: string, modelSlug: string, createBackup: CreateBackup, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public createBackup(projectSlug: string, modelSlug: string, createBackup: CreateBackup, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (projectSlug === null || projectSlug === undefined) { - throw new Error('Required parameter projectSlug was null or undefined when calling createBackup.'); - } - if (modelSlug === null || modelSlug === undefined) { - throw new Error('Required parameter modelSlug was null or undefined when calling createBackup.'); - } - if (createBackup === null || createBackup === undefined) { - throw new Error('Required parameter createBackup was null or undefined when calling createBackup.'); - } - - let localVarHeaders = this.defaultHeaders; - - let localVarCredential: string | undefined; - // authentication (PersonalAccessToken) required - localVarCredential = this.configuration.lookupCredential('PersonalAccessToken'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); - } - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v1/projects/${this.configuration.encodeParam({name: "projectSlug", value: projectSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/models/${this.configuration.encodeParam({name: "modelSlug", value: modelSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/backups/pipelines`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: createBackup, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - - /** - * Create Git Model - * @param projectSlug - * @param modelSlug - * @param postGitModel - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public createGitModel(projectSlug: string, modelSlug: string, postGitModel: PostGitModel, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public createGitModel(projectSlug: string, modelSlug: string, postGitModel: PostGitModel, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public createGitModel(projectSlug: string, modelSlug: string, postGitModel: PostGitModel, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public createGitModel(projectSlug: string, modelSlug: string, postGitModel: PostGitModel, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (projectSlug === null || projectSlug === undefined) { - throw new Error('Required parameter projectSlug was null or undefined when calling createGitModel.'); - } - if (modelSlug === null || modelSlug === undefined) { - throw new Error('Required parameter modelSlug was null or undefined when calling createGitModel.'); - } - if (postGitModel === null || postGitModel === undefined) { - throw new Error('Required parameter postGitModel was null or undefined when calling createGitModel.'); - } - - let localVarHeaders = this.defaultHeaders; - - let localVarCredential: string | undefined; - // authentication (PersonalAccessToken) required - localVarCredential = this.configuration.lookupCredential('PersonalAccessToken'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); - } - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v1/projects/${this.configuration.encodeParam({name: "projectSlug", value: projectSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/models/${this.configuration.encodeParam({name: "modelSlug", value: modelSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/modelsources/git`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: postGitModel, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - /** * Create New Tool Model * @param projectSlug @@ -388,21 +184,21 @@ export class ProjectsModelsService { } /** - * Create New Tool Model + * Delete Tool Model * @param projectSlug - * @param postToolModel + * @param modelSlug * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createNewToolModel_1(projectSlug: string, postToolModel: PostToolModel, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public createNewToolModel_1(projectSlug: string, postToolModel: PostToolModel, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public createNewToolModel_1(projectSlug: string, postToolModel: PostToolModel, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public createNewToolModel_1(projectSlug: string, postToolModel: PostToolModel, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public deleteToolModel(projectSlug: string, modelSlug: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public deleteToolModel(projectSlug: string, modelSlug: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteToolModel(projectSlug: string, modelSlug: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteToolModel(projectSlug: string, modelSlug: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { if (projectSlug === null || projectSlug === undefined) { - throw new Error('Required parameter projectSlug was null or undefined when calling createNewToolModel_1.'); + throw new Error('Required parameter projectSlug was null or undefined when calling deleteToolModel.'); } - if (postToolModel === null || postToolModel === undefined) { - throw new Error('Required parameter postToolModel was null or undefined when calling createNewToolModel_1.'); + if (modelSlug === null || modelSlug === undefined) { + throw new Error('Required parameter modelSlug was null or undefined when calling deleteToolModel.'); } let localVarHeaders = this.defaultHeaders; @@ -437,15 +233,6 @@ export class ProjectsModelsService { } - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - let responseType_: 'text' | 'json' | 'blob' = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { @@ -457,11 +244,10 @@ export class ProjectsModelsService { } } - let localVarPath = `/api/v1/projects/${this.configuration.encodeParam({name: "projectSlug", value: projectSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/models`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + let localVarPath = `/api/v1/projects/${this.configuration.encodeParam({name: "projectSlug", value: projectSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/models/${this.configuration.encodeParam({name: "modelSlug", value: modelSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, - body: postToolModel, responseType: responseType_, withCredentials: this.configuration.withCredentials, headers: localVarHeaders, @@ -473,29 +259,21 @@ export class ProjectsModelsService { } /** - * Create Pipeline Run + * Get Model By Slug * @param projectSlug - * @param pipelineId * @param modelSlug - * @param backupPipelineRun * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createPipelineRun(projectSlug: string, pipelineId: number, modelSlug: string, backupPipelineRun: BackupPipelineRun, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public createPipelineRun(projectSlug: string, pipelineId: number, modelSlug: string, backupPipelineRun: BackupPipelineRun, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public createPipelineRun(projectSlug: string, pipelineId: number, modelSlug: string, backupPipelineRun: BackupPipelineRun, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public createPipelineRun(projectSlug: string, pipelineId: number, modelSlug: string, backupPipelineRun: BackupPipelineRun, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public getModelBySlug(projectSlug: string, modelSlug: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getModelBySlug(projectSlug: string, modelSlug: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getModelBySlug(projectSlug: string, modelSlug: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getModelBySlug(projectSlug: string, modelSlug: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { if (projectSlug === null || projectSlug === undefined) { - throw new Error('Required parameter projectSlug was null or undefined when calling createPipelineRun.'); - } - if (pipelineId === null || pipelineId === undefined) { - throw new Error('Required parameter pipelineId was null or undefined when calling createPipelineRun.'); + throw new Error('Required parameter projectSlug was null or undefined when calling getModelBySlug.'); } if (modelSlug === null || modelSlug === undefined) { - throw new Error('Required parameter modelSlug was null or undefined when calling createPipelineRun.'); - } - if (backupPipelineRun === null || backupPipelineRun === undefined) { - throw new Error('Required parameter backupPipelineRun was null or undefined when calling createPipelineRun.'); + throw new Error('Required parameter modelSlug was null or undefined when calling getModelBySlug.'); } let localVarHeaders = this.defaultHeaders; @@ -530,15 +308,6 @@ export class ProjectsModelsService { } - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - let responseType_: 'text' | 'json' | 'blob' = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { @@ -550,11 +319,10 @@ export class ProjectsModelsService { } } - let localVarPath = `/api/v1/projects/${this.configuration.encodeParam({name: "projectSlug", value: projectSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/models/${this.configuration.encodeParam({name: "modelSlug", value: modelSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/backups/pipelines/${this.configuration.encodeParam({name: "pipelineId", value: pipelineId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: undefined})}/runs`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + let localVarPath = `/api/v1/projects/${this.configuration.encodeParam({name: "projectSlug", value: projectSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/models/${this.configuration.encodeParam({name: "modelSlug", value: modelSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, - body: backupPipelineRun, responseType: responseType_, withCredentials: this.configuration.withCredentials, headers: localVarHeaders, @@ -566,25 +334,17 @@ export class ProjectsModelsService { } /** - * Create T4C Model + * Get Models * @param projectSlug - * @param modelSlug - * @param submitT4CModel * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createT4cModel(projectSlug: string, modelSlug: string, submitT4CModel: SubmitT4CModel, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public createT4cModel(projectSlug: string, modelSlug: string, submitT4CModel: SubmitT4CModel, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public createT4cModel(projectSlug: string, modelSlug: string, submitT4CModel: SubmitT4CModel, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public createT4cModel(projectSlug: string, modelSlug: string, submitT4CModel: SubmitT4CModel, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public getModels(projectSlug: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getModels(projectSlug: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getModels(projectSlug: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getModels(projectSlug: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { if (projectSlug === null || projectSlug === undefined) { - throw new Error('Required parameter projectSlug was null or undefined when calling createT4cModel.'); - } - if (modelSlug === null || modelSlug === undefined) { - throw new Error('Required parameter modelSlug was null or undefined when calling createT4cModel.'); - } - if (submitT4CModel === null || submitT4CModel === undefined) { - throw new Error('Required parameter submitT4CModel was null or undefined when calling createT4cModel.'); + throw new Error('Required parameter projectSlug was null or undefined when calling getModels.'); } let localVarHeaders = this.defaultHeaders; @@ -619,15 +379,6 @@ export class ProjectsModelsService { } - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - let responseType_: 'text' | 'json' | 'blob' = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { @@ -639,11 +390,10 @@ export class ProjectsModelsService { } } - let localVarPath = `/api/v1/projects/${this.configuration.encodeParam({name: "projectSlug", value: projectSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/models/${this.configuration.encodeParam({name: "modelSlug", value: modelSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/modelsources/t4c`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + let localVarPath = `/api/v1/projects/${this.configuration.encodeParam({name: "projectSlug", value: projectSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/models`; + return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, - body: submitT4CModel, responseType: responseType_, withCredentials: this.configuration.withCredentials, headers: localVarHeaders, @@ -655,25 +405,25 @@ export class ProjectsModelsService { } /** - * Delete Git Model By Id + * Patch Tool Model * @param projectSlug - * @param gitModelId * @param modelSlug + * @param patchToolModel * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteGitModelById(projectSlug: string, gitModelId: number, modelSlug: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public deleteGitModelById(projectSlug: string, gitModelId: number, modelSlug: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public deleteGitModelById(projectSlug: string, gitModelId: number, modelSlug: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public deleteGitModelById(projectSlug: string, gitModelId: number, modelSlug: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public patchToolModel(projectSlug: string, modelSlug: string, patchToolModel: PatchToolModel, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public patchToolModel(projectSlug: string, modelSlug: string, patchToolModel: PatchToolModel, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public patchToolModel(projectSlug: string, modelSlug: string, patchToolModel: PatchToolModel, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public patchToolModel(projectSlug: string, modelSlug: string, patchToolModel: PatchToolModel, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { if (projectSlug === null || projectSlug === undefined) { - throw new Error('Required parameter projectSlug was null or undefined when calling deleteGitModelById.'); - } - if (gitModelId === null || gitModelId === undefined) { - throw new Error('Required parameter gitModelId was null or undefined when calling deleteGitModelById.'); + throw new Error('Required parameter projectSlug was null or undefined when calling patchToolModel.'); } if (modelSlug === null || modelSlug === undefined) { - throw new Error('Required parameter modelSlug was null or undefined when calling deleteGitModelById.'); + throw new Error('Required parameter modelSlug was null or undefined when calling patchToolModel.'); + } + if (patchToolModel === null || patchToolModel === undefined) { + throw new Error('Required parameter patchToolModel was null or undefined when calling patchToolModel.'); } let localVarHeaders = this.defaultHeaders; @@ -708,6 +458,15 @@ export class ProjectsModelsService { } + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + let responseType_: 'text' | 'json' | 'blob' = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { @@ -719,2141 +478,8 @@ export class ProjectsModelsService { } } - let localVarPath = `/api/v1/projects/${this.configuration.encodeParam({name: "projectSlug", value: projectSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/models/${this.configuration.encodeParam({name: "modelSlug", value: modelSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/modelsources/git/${this.configuration.encodeParam({name: "gitModelId", value: gitModelId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: undefined})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - - /** - * Delete Pipeline - * @param projectSlug - * @param pipelineId - * @param modelSlug - * @param force - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public deletePipeline(projectSlug: string, pipelineId: number, modelSlug: string, force?: boolean, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public deletePipeline(projectSlug: string, pipelineId: number, modelSlug: string, force?: boolean, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public deletePipeline(projectSlug: string, pipelineId: number, modelSlug: string, force?: boolean, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public deletePipeline(projectSlug: string, pipelineId: number, modelSlug: string, force?: boolean, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (projectSlug === null || projectSlug === undefined) { - throw new Error('Required parameter projectSlug was null or undefined when calling deletePipeline.'); - } - if (pipelineId === null || pipelineId === undefined) { - throw new Error('Required parameter pipelineId was null or undefined when calling deletePipeline.'); - } - if (modelSlug === null || modelSlug === undefined) { - throw new Error('Required parameter modelSlug was null or undefined when calling deletePipeline.'); - } - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - if (force !== undefined && force !== null) { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - force, 'force'); - } - - let localVarHeaders = this.defaultHeaders; - - let localVarCredential: string | undefined; - // authentication (PersonalAccessToken) required - localVarCredential = this.configuration.lookupCredential('PersonalAccessToken'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); - } - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v1/projects/${this.configuration.encodeParam({name: "projectSlug", value: projectSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/models/${this.configuration.encodeParam({name: "modelSlug", value: modelSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/backups/pipelines/${this.configuration.encodeParam({name: "pipelineId", value: pipelineId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: undefined})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - - /** - * Delete T4C Model - * @param projectSlug - * @param t4cModelId - * @param modelSlug - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public deleteT4cModel(projectSlug: string, t4cModelId: number, modelSlug: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public deleteT4cModel(projectSlug: string, t4cModelId: number, modelSlug: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public deleteT4cModel(projectSlug: string, t4cModelId: number, modelSlug: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public deleteT4cModel(projectSlug: string, t4cModelId: number, modelSlug: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (projectSlug === null || projectSlug === undefined) { - throw new Error('Required parameter projectSlug was null or undefined when calling deleteT4cModel.'); - } - if (t4cModelId === null || t4cModelId === undefined) { - throw new Error('Required parameter t4cModelId was null or undefined when calling deleteT4cModel.'); - } - if (modelSlug === null || modelSlug === undefined) { - throw new Error('Required parameter modelSlug was null or undefined when calling deleteT4cModel.'); - } - - let localVarHeaders = this.defaultHeaders; - - let localVarCredential: string | undefined; - // authentication (PersonalAccessToken) required - localVarCredential = this.configuration.lookupCredential('PersonalAccessToken'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); - } - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v1/projects/${this.configuration.encodeParam({name: "projectSlug", value: projectSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/models/${this.configuration.encodeParam({name: "modelSlug", value: modelSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/modelsources/t4c/${this.configuration.encodeParam({name: "t4cModelId", value: t4cModelId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: undefined})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - - /** - * Delete Tool Model - * @param projectSlug - * @param modelSlug - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public deleteToolModel(projectSlug: string, modelSlug: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public deleteToolModel(projectSlug: string, modelSlug: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public deleteToolModel(projectSlug: string, modelSlug: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public deleteToolModel(projectSlug: string, modelSlug: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (projectSlug === null || projectSlug === undefined) { - throw new Error('Required parameter projectSlug was null or undefined when calling deleteToolModel.'); - } - if (modelSlug === null || modelSlug === undefined) { - throw new Error('Required parameter modelSlug was null or undefined when calling deleteToolModel.'); - } - - let localVarHeaders = this.defaultHeaders; - - let localVarCredential: string | undefined; - // authentication (PersonalAccessToken) required - localVarCredential = this.configuration.lookupCredential('PersonalAccessToken'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); - } - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v1/projects/${this.configuration.encodeParam({name: "projectSlug", value: projectSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/models/${this.configuration.encodeParam({name: "modelSlug", value: modelSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - - /** - * Delete Tool Model - * @param projectSlug - * @param modelSlug - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public deleteToolModel_2(projectSlug: string, modelSlug: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public deleteToolModel_2(projectSlug: string, modelSlug: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public deleteToolModel_2(projectSlug: string, modelSlug: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public deleteToolModel_2(projectSlug: string, modelSlug: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (projectSlug === null || projectSlug === undefined) { - throw new Error('Required parameter projectSlug was null or undefined when calling deleteToolModel_2.'); - } - if (modelSlug === null || modelSlug === undefined) { - throw new Error('Required parameter modelSlug was null or undefined when calling deleteToolModel_2.'); - } - - let localVarHeaders = this.defaultHeaders; - - let localVarCredential: string | undefined; - // authentication (PersonalAccessToken) required - localVarCredential = this.configuration.lookupCredential('PersonalAccessToken'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); - } - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v1/projects/${this.configuration.encodeParam({name: "projectSlug", value: projectSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/models/${this.configuration.encodeParam({name: "modelSlug", value: modelSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - - /** - * Edit T4C Model - * @param projectSlug - * @param t4cModelId - * @param modelSlug - * @param submitT4CModel - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public editT4cModel(projectSlug: string, t4cModelId: number, modelSlug: string, submitT4CModel: SubmitT4CModel, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public editT4cModel(projectSlug: string, t4cModelId: number, modelSlug: string, submitT4CModel: SubmitT4CModel, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public editT4cModel(projectSlug: string, t4cModelId: number, modelSlug: string, submitT4CModel: SubmitT4CModel, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public editT4cModel(projectSlug: string, t4cModelId: number, modelSlug: string, submitT4CModel: SubmitT4CModel, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (projectSlug === null || projectSlug === undefined) { - throw new Error('Required parameter projectSlug was null or undefined when calling editT4cModel.'); - } - if (t4cModelId === null || t4cModelId === undefined) { - throw new Error('Required parameter t4cModelId was null or undefined when calling editT4cModel.'); - } - if (modelSlug === null || modelSlug === undefined) { - throw new Error('Required parameter modelSlug was null or undefined when calling editT4cModel.'); - } - if (submitT4CModel === null || submitT4CModel === undefined) { - throw new Error('Required parameter submitT4CModel was null or undefined when calling editT4cModel.'); - } - - let localVarHeaders = this.defaultHeaders; - - let localVarCredential: string | undefined; - // authentication (PersonalAccessToken) required - localVarCredential = this.configuration.lookupCredential('PersonalAccessToken'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); - } - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v1/projects/${this.configuration.encodeParam({name: "projectSlug", value: projectSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/models/${this.configuration.encodeParam({name: "modelSlug", value: modelSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/modelsources/t4c/${this.configuration.encodeParam({name: "t4cModelId", value: t4cModelId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: undefined})}`; - return this.httpClient.request('patch', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: submitT4CModel, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - - /** - * Get Diagram - * @param diagramUuidOrFilename - * @param projectSlug - * @param modelSlug - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getDiagram(diagramUuidOrFilename: string, projectSlug: string, modelSlug: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'image/svg+xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getDiagram(diagramUuidOrFilename: string, projectSlug: string, modelSlug: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'image/svg+xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDiagram(diagramUuidOrFilename: string, projectSlug: string, modelSlug: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'image/svg+xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDiagram(diagramUuidOrFilename: string, projectSlug: string, modelSlug: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'image/svg+xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (diagramUuidOrFilename === null || diagramUuidOrFilename === undefined) { - throw new Error('Required parameter diagramUuidOrFilename was null or undefined when calling getDiagram.'); - } - if (projectSlug === null || projectSlug === undefined) { - throw new Error('Required parameter projectSlug was null or undefined when calling getDiagram.'); - } - if (modelSlug === null || modelSlug === undefined) { - throw new Error('Required parameter modelSlug was null or undefined when calling getDiagram.'); - } - - let localVarHeaders = this.defaultHeaders; - - let localVarCredential: string | undefined; - // authentication (PersonalAccessToken) required - localVarCredential = this.configuration.lookupCredential('PersonalAccessToken'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); - } - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'image/svg+xml', - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - let localVarPath = `/api/v1/projects/${this.configuration.encodeParam({name: "projectSlug", value: projectSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/models/${this.configuration.encodeParam({name: "modelSlug", value: modelSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/diagrams/${this.configuration.encodeParam({name: "diagramUuidOrFilename", value: diagramUuidOrFilename, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: "blob", - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - - /** - * Get Diagram Metadata - * @param projectSlug - * @param modelSlug - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getDiagramMetadata(projectSlug: string, modelSlug: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getDiagramMetadata(projectSlug: string, modelSlug: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDiagramMetadata(projectSlug: string, modelSlug: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDiagramMetadata(projectSlug: string, modelSlug: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (projectSlug === null || projectSlug === undefined) { - throw new Error('Required parameter projectSlug was null or undefined when calling getDiagramMetadata.'); - } - if (modelSlug === null || modelSlug === undefined) { - throw new Error('Required parameter modelSlug was null or undefined when calling getDiagramMetadata.'); - } - - let localVarHeaders = this.defaultHeaders; - - let localVarCredential: string | undefined; - // authentication (PersonalAccessToken) required - localVarCredential = this.configuration.lookupCredential('PersonalAccessToken'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); - } - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v1/projects/${this.configuration.encodeParam({name: "projectSlug", value: projectSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/models/${this.configuration.encodeParam({name: "modelSlug", value: modelSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/diagrams`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - - /** - * Get Git Model By Id - * @param projectSlug - * @param gitModelId - * @param modelSlug - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getGitModelById(projectSlug: string, gitModelId: number, modelSlug: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getGitModelById(projectSlug: string, gitModelId: number, modelSlug: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getGitModelById(projectSlug: string, gitModelId: number, modelSlug: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getGitModelById(projectSlug: string, gitModelId: number, modelSlug: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (projectSlug === null || projectSlug === undefined) { - throw new Error('Required parameter projectSlug was null or undefined when calling getGitModelById.'); - } - if (gitModelId === null || gitModelId === undefined) { - throw new Error('Required parameter gitModelId was null or undefined when calling getGitModelById.'); - } - if (modelSlug === null || modelSlug === undefined) { - throw new Error('Required parameter modelSlug was null or undefined when calling getGitModelById.'); - } - - let localVarHeaders = this.defaultHeaders; - - let localVarCredential: string | undefined; - // authentication (PersonalAccessToken) required - localVarCredential = this.configuration.lookupCredential('PersonalAccessToken'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); - } - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v1/projects/${this.configuration.encodeParam({name: "projectSlug", value: projectSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/models/${this.configuration.encodeParam({name: "modelSlug", value: modelSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/modelsources/git/${this.configuration.encodeParam({name: "gitModelId", value: gitModelId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: undefined})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - - /** - * Get Git Models - * @param projectSlug - * @param modelSlug - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getGitModels(projectSlug: string, modelSlug: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getGitModels(projectSlug: string, modelSlug: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public getGitModels(projectSlug: string, modelSlug: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public getGitModels(projectSlug: string, modelSlug: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (projectSlug === null || projectSlug === undefined) { - throw new Error('Required parameter projectSlug was null or undefined when calling getGitModels.'); - } - if (modelSlug === null || modelSlug === undefined) { - throw new Error('Required parameter modelSlug was null or undefined when calling getGitModels.'); - } - - let localVarHeaders = this.defaultHeaders; - - let localVarCredential: string | undefined; - // authentication (PersonalAccessToken) required - localVarCredential = this.configuration.lookupCredential('PersonalAccessToken'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); - } - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v1/projects/${this.configuration.encodeParam({name: "projectSlug", value: projectSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/models/${this.configuration.encodeParam({name: "modelSlug", value: modelSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/modelsources/git`; - return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - - /** - * Get Logs - * @param projectSlug - * @param pipelineRunId - * @param pipelineId - * @param modelSlug - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getLogs(projectSlug: string, pipelineRunId: number, pipelineId: number, modelSlug: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getLogs(projectSlug: string, pipelineRunId: number, pipelineId: number, modelSlug: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getLogs(projectSlug: string, pipelineRunId: number, pipelineId: number, modelSlug: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getLogs(projectSlug: string, pipelineRunId: number, pipelineId: number, modelSlug: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (projectSlug === null || projectSlug === undefined) { - throw new Error('Required parameter projectSlug was null or undefined when calling getLogs.'); - } - if (pipelineRunId === null || pipelineRunId === undefined) { - throw new Error('Required parameter pipelineRunId was null or undefined when calling getLogs.'); - } - if (pipelineId === null || pipelineId === undefined) { - throw new Error('Required parameter pipelineId was null or undefined when calling getLogs.'); - } - if (modelSlug === null || modelSlug === undefined) { - throw new Error('Required parameter modelSlug was null or undefined when calling getLogs.'); - } - - let localVarHeaders = this.defaultHeaders; - - let localVarCredential: string | undefined; - // authentication (PersonalAccessToken) required - localVarCredential = this.configuration.lookupCredential('PersonalAccessToken'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); - } - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v1/projects/${this.configuration.encodeParam({name: "projectSlug", value: projectSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/models/${this.configuration.encodeParam({name: "modelSlug", value: modelSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/backups/pipelines/${this.configuration.encodeParam({name: "pipelineId", value: pipelineId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: undefined})}/runs/${this.configuration.encodeParam({name: "pipelineRunId", value: pipelineRunId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: undefined})}/logs`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - - /** - * Get Model By Slug - * @param projectSlug - * @param modelSlug - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getModelBySlug(projectSlug: string, modelSlug: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getModelBySlug(projectSlug: string, modelSlug: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getModelBySlug(projectSlug: string, modelSlug: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getModelBySlug(projectSlug: string, modelSlug: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (projectSlug === null || projectSlug === undefined) { - throw new Error('Required parameter projectSlug was null or undefined when calling getModelBySlug.'); - } - if (modelSlug === null || modelSlug === undefined) { - throw new Error('Required parameter modelSlug was null or undefined when calling getModelBySlug.'); - } - - let localVarHeaders = this.defaultHeaders; - - let localVarCredential: string | undefined; - // authentication (PersonalAccessToken) required - localVarCredential = this.configuration.lookupCredential('PersonalAccessToken'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); - } - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v1/projects/${this.configuration.encodeParam({name: "projectSlug", value: projectSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/models/${this.configuration.encodeParam({name: "modelSlug", value: modelSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - - /** - * Get Model By Slug - * @param projectSlug - * @param modelSlug - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getModelBySlug_3(projectSlug: string, modelSlug: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getModelBySlug_3(projectSlug: string, modelSlug: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getModelBySlug_3(projectSlug: string, modelSlug: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getModelBySlug_3(projectSlug: string, modelSlug: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (projectSlug === null || projectSlug === undefined) { - throw new Error('Required parameter projectSlug was null or undefined when calling getModelBySlug_3.'); - } - if (modelSlug === null || modelSlug === undefined) { - throw new Error('Required parameter modelSlug was null or undefined when calling getModelBySlug_3.'); - } - - let localVarHeaders = this.defaultHeaders; - - let localVarCredential: string | undefined; - // authentication (PersonalAccessToken) required - localVarCredential = this.configuration.lookupCredential('PersonalAccessToken'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); - } - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v1/projects/${this.configuration.encodeParam({name: "projectSlug", value: projectSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/models/${this.configuration.encodeParam({name: "modelSlug", value: modelSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - - /** - * Get Model Complexity Badge - * @param projectSlug - * @param modelSlug - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getModelComplexityBadge(projectSlug: string, modelSlug: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'image/svg+xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getModelComplexityBadge(projectSlug: string, modelSlug: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'image/svg+xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getModelComplexityBadge(projectSlug: string, modelSlug: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'image/svg+xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getModelComplexityBadge(projectSlug: string, modelSlug: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'image/svg+xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (projectSlug === null || projectSlug === undefined) { - throw new Error('Required parameter projectSlug was null or undefined when calling getModelComplexityBadge.'); - } - if (modelSlug === null || modelSlug === undefined) { - throw new Error('Required parameter modelSlug was null or undefined when calling getModelComplexityBadge.'); - } - - let localVarHeaders = this.defaultHeaders; - - let localVarCredential: string | undefined; - // authentication (PersonalAccessToken) required - localVarCredential = this.configuration.lookupCredential('PersonalAccessToken'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); - } - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'image/svg+xml', - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - let localVarPath = `/api/v1/projects/${this.configuration.encodeParam({name: "projectSlug", value: projectSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/models/${this.configuration.encodeParam({name: "modelSlug", value: modelSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/badges/complexity`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: "blob", - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - - /** - * Get Models - * @param projectSlug - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getModels(projectSlug: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getModels(projectSlug: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public getModels(projectSlug: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public getModels(projectSlug: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (projectSlug === null || projectSlug === undefined) { - throw new Error('Required parameter projectSlug was null or undefined when calling getModels.'); - } - - let localVarHeaders = this.defaultHeaders; - - let localVarCredential: string | undefined; - // authentication (PersonalAccessToken) required - localVarCredential = this.configuration.lookupCredential('PersonalAccessToken'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); - } - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v1/projects/${this.configuration.encodeParam({name: "projectSlug", value: projectSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/models`; - return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - - /** - * Get Models - * @param projectSlug - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getModels_4(projectSlug: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getModels_4(projectSlug: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public getModels_4(projectSlug: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public getModels_4(projectSlug: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (projectSlug === null || projectSlug === undefined) { - throw new Error('Required parameter projectSlug was null or undefined when calling getModels_4.'); - } - - let localVarHeaders = this.defaultHeaders; - - let localVarCredential: string | undefined; - // authentication (PersonalAccessToken) required - localVarCredential = this.configuration.lookupCredential('PersonalAccessToken'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); - } - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v1/projects/${this.configuration.encodeParam({name: "projectSlug", value: projectSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/models`; - return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - - /** - * Get Pipeline - * @param projectSlug - * @param pipelineId - * @param modelSlug - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getPipeline(projectSlug: string, pipelineId: number, modelSlug: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getPipeline(projectSlug: string, pipelineId: number, modelSlug: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPipeline(projectSlug: string, pipelineId: number, modelSlug: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPipeline(projectSlug: string, pipelineId: number, modelSlug: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (projectSlug === null || projectSlug === undefined) { - throw new Error('Required parameter projectSlug was null or undefined when calling getPipeline.'); - } - if (pipelineId === null || pipelineId === undefined) { - throw new Error('Required parameter pipelineId was null or undefined when calling getPipeline.'); - } - if (modelSlug === null || modelSlug === undefined) { - throw new Error('Required parameter modelSlug was null or undefined when calling getPipeline.'); - } - - let localVarHeaders = this.defaultHeaders; - - let localVarCredential: string | undefined; - // authentication (PersonalAccessToken) required - localVarCredential = this.configuration.lookupCredential('PersonalAccessToken'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); - } - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v1/projects/${this.configuration.encodeParam({name: "projectSlug", value: projectSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/models/${this.configuration.encodeParam({name: "modelSlug", value: modelSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/backups/pipelines/${this.configuration.encodeParam({name: "pipelineId", value: pipelineId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: undefined})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - - /** - * Get Pipeline Run - * @param projectSlug - * @param pipelineRunId - * @param pipelineId - * @param modelSlug - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getPipelineRun(projectSlug: string, pipelineRunId: number, pipelineId: number, modelSlug: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getPipelineRun(projectSlug: string, pipelineRunId: number, pipelineId: number, modelSlug: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPipelineRun(projectSlug: string, pipelineRunId: number, pipelineId: number, modelSlug: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPipelineRun(projectSlug: string, pipelineRunId: number, pipelineId: number, modelSlug: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (projectSlug === null || projectSlug === undefined) { - throw new Error('Required parameter projectSlug was null or undefined when calling getPipelineRun.'); - } - if (pipelineRunId === null || pipelineRunId === undefined) { - throw new Error('Required parameter pipelineRunId was null or undefined when calling getPipelineRun.'); - } - if (pipelineId === null || pipelineId === undefined) { - throw new Error('Required parameter pipelineId was null or undefined when calling getPipelineRun.'); - } - if (modelSlug === null || modelSlug === undefined) { - throw new Error('Required parameter modelSlug was null or undefined when calling getPipelineRun.'); - } - - let localVarHeaders = this.defaultHeaders; - - let localVarCredential: string | undefined; - // authentication (PersonalAccessToken) required - localVarCredential = this.configuration.lookupCredential('PersonalAccessToken'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); - } - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v1/projects/${this.configuration.encodeParam({name: "projectSlug", value: projectSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/models/${this.configuration.encodeParam({name: "modelSlug", value: modelSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/backups/pipelines/${this.configuration.encodeParam({name: "pipelineId", value: pipelineId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: undefined})}/runs/${this.configuration.encodeParam({name: "pipelineRunId", value: pipelineRunId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: undefined})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - - /** - * Get Pipeline Run Events - * @param projectSlug - * @param pipelineRunId - * @param pipelineId - * @param modelSlug - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getPipelineRunEvents(projectSlug: string, pipelineRunId: number, pipelineId: number, modelSlug: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getPipelineRunEvents(projectSlug: string, pipelineRunId: number, pipelineId: number, modelSlug: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPipelineRunEvents(projectSlug: string, pipelineRunId: number, pipelineId: number, modelSlug: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPipelineRunEvents(projectSlug: string, pipelineRunId: number, pipelineId: number, modelSlug: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (projectSlug === null || projectSlug === undefined) { - throw new Error('Required parameter projectSlug was null or undefined when calling getPipelineRunEvents.'); - } - if (pipelineRunId === null || pipelineRunId === undefined) { - throw new Error('Required parameter pipelineRunId was null or undefined when calling getPipelineRunEvents.'); - } - if (pipelineId === null || pipelineId === undefined) { - throw new Error('Required parameter pipelineId was null or undefined when calling getPipelineRunEvents.'); - } - if (modelSlug === null || modelSlug === undefined) { - throw new Error('Required parameter modelSlug was null or undefined when calling getPipelineRunEvents.'); - } - - let localVarHeaders = this.defaultHeaders; - - let localVarCredential: string | undefined; - // authentication (PersonalAccessToken) required - localVarCredential = this.configuration.lookupCredential('PersonalAccessToken'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); - } - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v1/projects/${this.configuration.encodeParam({name: "projectSlug", value: projectSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/models/${this.configuration.encodeParam({name: "modelSlug", value: modelSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/backups/pipelines/${this.configuration.encodeParam({name: "pipelineId", value: pipelineId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: undefined})}/runs/${this.configuration.encodeParam({name: "pipelineRunId", value: pipelineRunId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: undefined})}/events`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - - /** - * Get Pipeline Runs - * @param projectSlug - * @param pipelineId - * @param modelSlug - * @param page Page number - * @param size Page size - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getPipelineRuns(projectSlug: string, pipelineId: number, modelSlug: string, page?: number, size?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getPipelineRuns(projectSlug: string, pipelineId: number, modelSlug: string, page?: number, size?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPipelineRuns(projectSlug: string, pipelineId: number, modelSlug: string, page?: number, size?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPipelineRuns(projectSlug: string, pipelineId: number, modelSlug: string, page?: number, size?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (projectSlug === null || projectSlug === undefined) { - throw new Error('Required parameter projectSlug was null or undefined when calling getPipelineRuns.'); - } - if (pipelineId === null || pipelineId === undefined) { - throw new Error('Required parameter pipelineId was null or undefined when calling getPipelineRuns.'); - } - if (modelSlug === null || modelSlug === undefined) { - throw new Error('Required parameter modelSlug was null or undefined when calling getPipelineRuns.'); - } - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - if (page !== undefined && page !== null) { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); - } - if (size !== undefined && size !== null) { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - size, 'size'); - } - - let localVarHeaders = this.defaultHeaders; - - let localVarCredential: string | undefined; - // authentication (PersonalAccessToken) required - localVarCredential = this.configuration.lookupCredential('PersonalAccessToken'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); - } - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v1/projects/${this.configuration.encodeParam({name: "projectSlug", value: projectSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/models/${this.configuration.encodeParam({name: "modelSlug", value: modelSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/backups/pipelines/${this.configuration.encodeParam({name: "pipelineId", value: pipelineId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: undefined})}/runs`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - - /** - * Get Pipelines - * @param projectSlug - * @param modelSlug - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getPipelines(projectSlug: string, modelSlug: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPipelines(projectSlug: string, modelSlug: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public getPipelines(projectSlug: string, modelSlug: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public getPipelines(projectSlug: string, modelSlug: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (projectSlug === null || projectSlug === undefined) { - throw new Error('Required parameter projectSlug was null or undefined when calling getPipelines.'); - } - if (modelSlug === null || modelSlug === undefined) { - throw new Error('Required parameter modelSlug was null or undefined when calling getPipelines.'); - } - - let localVarHeaders = this.defaultHeaders; - - let localVarCredential: string | undefined; - // authentication (PersonalAccessToken) required - localVarCredential = this.configuration.lookupCredential('PersonalAccessToken'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); - } - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v1/projects/${this.configuration.encodeParam({name: "projectSlug", value: projectSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/models/${this.configuration.encodeParam({name: "modelSlug", value: modelSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/backups/pipelines`; - return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - - /** - * Get Restrictions - * @param projectSlug - * @param modelSlug - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getRestrictions(projectSlug: string, modelSlug: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getRestrictions(projectSlug: string, modelSlug: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getRestrictions(projectSlug: string, modelSlug: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getRestrictions(projectSlug: string, modelSlug: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (projectSlug === null || projectSlug === undefined) { - throw new Error('Required parameter projectSlug was null or undefined when calling getRestrictions.'); - } - if (modelSlug === null || modelSlug === undefined) { - throw new Error('Required parameter modelSlug was null or undefined when calling getRestrictions.'); - } - - let localVarHeaders = this.defaultHeaders; - - let localVarCredential: string | undefined; - // authentication (PersonalAccessToken) required - localVarCredential = this.configuration.lookupCredential('PersonalAccessToken'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); - } - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v1/projects/${this.configuration.encodeParam({name: "projectSlug", value: projectSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/models/${this.configuration.encodeParam({name: "modelSlug", value: modelSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/restrictions`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - - /** - * Get Revisions Of Primary Git Model - * @param projectSlug - * @param modelSlug - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getRevisionsOfPrimaryGitModel(projectSlug: string, modelSlug: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getRevisionsOfPrimaryGitModel(projectSlug: string, modelSlug: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getRevisionsOfPrimaryGitModel(projectSlug: string, modelSlug: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getRevisionsOfPrimaryGitModel(projectSlug: string, modelSlug: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (projectSlug === null || projectSlug === undefined) { - throw new Error('Required parameter projectSlug was null or undefined when calling getRevisionsOfPrimaryGitModel.'); - } - if (modelSlug === null || modelSlug === undefined) { - throw new Error('Required parameter modelSlug was null or undefined when calling getRevisionsOfPrimaryGitModel.'); - } - - let localVarHeaders = this.defaultHeaders; - - let localVarCredential: string | undefined; - // authentication (PersonalAccessToken) required - localVarCredential = this.configuration.lookupCredential('PersonalAccessToken'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); - } - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v1/projects/${this.configuration.encodeParam({name: "projectSlug", value: projectSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/models/${this.configuration.encodeParam({name: "modelSlug", value: modelSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/modelsources/git/primary/revisions`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - - /** - * Get Revisions With Model Credentials - * @param projectSlug - * @param gitModelId - * @param modelSlug - * @param body - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getRevisionsWithModelCredentials(projectSlug: string, gitModelId: number, modelSlug: string, body: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getRevisionsWithModelCredentials(projectSlug: string, gitModelId: number, modelSlug: string, body: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getRevisionsWithModelCredentials(projectSlug: string, gitModelId: number, modelSlug: string, body: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getRevisionsWithModelCredentials(projectSlug: string, gitModelId: number, modelSlug: string, body: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (projectSlug === null || projectSlug === undefined) { - throw new Error('Required parameter projectSlug was null or undefined when calling getRevisionsWithModelCredentials.'); - } - if (gitModelId === null || gitModelId === undefined) { - throw new Error('Required parameter gitModelId was null or undefined when calling getRevisionsWithModelCredentials.'); - } - if (modelSlug === null || modelSlug === undefined) { - throw new Error('Required parameter modelSlug was null or undefined when calling getRevisionsWithModelCredentials.'); - } - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling getRevisionsWithModelCredentials.'); - } - - let localVarHeaders = this.defaultHeaders; - - let localVarCredential: string | undefined; - // authentication (PersonalAccessToken) required - localVarCredential = this.configuration.lookupCredential('PersonalAccessToken'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); - } - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v1/projects/${this.configuration.encodeParam({name: "projectSlug", value: projectSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/models/${this.configuration.encodeParam({name: "modelSlug", value: modelSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/modelsources/git/${this.configuration.encodeParam({name: "gitModelId", value: gitModelId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: undefined})}/revisions`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: body, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - - /** - * Get T4C Model - * @param projectSlug - * @param t4cModelId - * @param modelSlug - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getT4cModel(projectSlug: string, t4cModelId: number, modelSlug: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getT4cModel(projectSlug: string, t4cModelId: number, modelSlug: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getT4cModel(projectSlug: string, t4cModelId: number, modelSlug: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getT4cModel(projectSlug: string, t4cModelId: number, modelSlug: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (projectSlug === null || projectSlug === undefined) { - throw new Error('Required parameter projectSlug was null or undefined when calling getT4cModel.'); - } - if (t4cModelId === null || t4cModelId === undefined) { - throw new Error('Required parameter t4cModelId was null or undefined when calling getT4cModel.'); - } - if (modelSlug === null || modelSlug === undefined) { - throw new Error('Required parameter modelSlug was null or undefined when calling getT4cModel.'); - } - - let localVarHeaders = this.defaultHeaders; - - let localVarCredential: string | undefined; - // authentication (PersonalAccessToken) required - localVarCredential = this.configuration.lookupCredential('PersonalAccessToken'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); - } - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v1/projects/${this.configuration.encodeParam({name: "projectSlug", value: projectSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/models/${this.configuration.encodeParam({name: "modelSlug", value: modelSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/modelsources/t4c/${this.configuration.encodeParam({name: "t4cModelId", value: t4cModelId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: undefined})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - - /** - * List T4C Models - * @param projectSlug - * @param modelSlug - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public listT4cModels(projectSlug: string, modelSlug: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public listT4cModels(projectSlug: string, modelSlug: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public listT4cModels(projectSlug: string, modelSlug: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public listT4cModels(projectSlug: string, modelSlug: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (projectSlug === null || projectSlug === undefined) { - throw new Error('Required parameter projectSlug was null or undefined when calling listT4cModels.'); - } - if (modelSlug === null || modelSlug === undefined) { - throw new Error('Required parameter modelSlug was null or undefined when calling listT4cModels.'); - } - - let localVarHeaders = this.defaultHeaders; - - let localVarCredential: string | undefined; - // authentication (PersonalAccessToken) required - localVarCredential = this.configuration.lookupCredential('PersonalAccessToken'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); - } - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v1/projects/${this.configuration.encodeParam({name: "projectSlug", value: projectSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/models/${this.configuration.encodeParam({name: "modelSlug", value: modelSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/modelsources/t4c`; - return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - - /** - * Patch Tool Model - * @param projectSlug - * @param modelSlug - * @param patchToolModel - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public patchToolModel(projectSlug: string, modelSlug: string, patchToolModel: PatchToolModel, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public patchToolModel(projectSlug: string, modelSlug: string, patchToolModel: PatchToolModel, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public patchToolModel(projectSlug: string, modelSlug: string, patchToolModel: PatchToolModel, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public patchToolModel(projectSlug: string, modelSlug: string, patchToolModel: PatchToolModel, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (projectSlug === null || projectSlug === undefined) { - throw new Error('Required parameter projectSlug was null or undefined when calling patchToolModel.'); - } - if (modelSlug === null || modelSlug === undefined) { - throw new Error('Required parameter modelSlug was null or undefined when calling patchToolModel.'); - } - if (patchToolModel === null || patchToolModel === undefined) { - throw new Error('Required parameter patchToolModel was null or undefined when calling patchToolModel.'); - } - - let localVarHeaders = this.defaultHeaders; - - let localVarCredential: string | undefined; - // authentication (PersonalAccessToken) required - localVarCredential = this.configuration.lookupCredential('PersonalAccessToken'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); - } - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v1/projects/${this.configuration.encodeParam({name: "projectSlug", value: projectSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/models/${this.configuration.encodeParam({name: "modelSlug", value: modelSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('patch', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: patchToolModel, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - - /** - * Patch Tool Model - * @param projectSlug - * @param modelSlug - * @param patchToolModel - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public patchToolModel_5(projectSlug: string, modelSlug: string, patchToolModel: PatchToolModel, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public patchToolModel_5(projectSlug: string, modelSlug: string, patchToolModel: PatchToolModel, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public patchToolModel_5(projectSlug: string, modelSlug: string, patchToolModel: PatchToolModel, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public patchToolModel_5(projectSlug: string, modelSlug: string, patchToolModel: PatchToolModel, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (projectSlug === null || projectSlug === undefined) { - throw new Error('Required parameter projectSlug was null or undefined when calling patchToolModel_5.'); - } - if (modelSlug === null || modelSlug === undefined) { - throw new Error('Required parameter modelSlug was null or undefined when calling patchToolModel_5.'); - } - if (patchToolModel === null || patchToolModel === undefined) { - throw new Error('Required parameter patchToolModel was null or undefined when calling patchToolModel_5.'); - } - - let localVarHeaders = this.defaultHeaders; - - let localVarCredential: string | undefined; - // authentication (PersonalAccessToken) required - localVarCredential = this.configuration.lookupCredential('PersonalAccessToken'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); - } - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v1/projects/${this.configuration.encodeParam({name: "projectSlug", value: projectSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/models/${this.configuration.encodeParam({name: "modelSlug", value: modelSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('patch', `${this.configuration.basePath}${localVarPath}`, + let localVarPath = `/api/v1/projects/${this.configuration.encodeParam({name: "projectSlug", value: projectSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/models/${this.configuration.encodeParam({name: "modelSlug", value: modelSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + return this.httpClient.request('patch', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, body: patchToolModel, @@ -2867,186 +493,4 @@ export class ProjectsModelsService { ); } - /** - * Update Git Model By Id - * @param projectSlug - * @param gitModelId - * @param modelSlug - * @param patchGitModel - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public updateGitModelById(projectSlug: string, gitModelId: number, modelSlug: string, patchGitModel: PatchGitModel, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public updateGitModelById(projectSlug: string, gitModelId: number, modelSlug: string, patchGitModel: PatchGitModel, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public updateGitModelById(projectSlug: string, gitModelId: number, modelSlug: string, patchGitModel: PatchGitModel, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public updateGitModelById(projectSlug: string, gitModelId: number, modelSlug: string, patchGitModel: PatchGitModel, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (projectSlug === null || projectSlug === undefined) { - throw new Error('Required parameter projectSlug was null or undefined when calling updateGitModelById.'); - } - if (gitModelId === null || gitModelId === undefined) { - throw new Error('Required parameter gitModelId was null or undefined when calling updateGitModelById.'); - } - if (modelSlug === null || modelSlug === undefined) { - throw new Error('Required parameter modelSlug was null or undefined when calling updateGitModelById.'); - } - if (patchGitModel === null || patchGitModel === undefined) { - throw new Error('Required parameter patchGitModel was null or undefined when calling updateGitModelById.'); - } - - let localVarHeaders = this.defaultHeaders; - - let localVarCredential: string | undefined; - // authentication (PersonalAccessToken) required - localVarCredential = this.configuration.lookupCredential('PersonalAccessToken'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); - } - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v1/projects/${this.configuration.encodeParam({name: "projectSlug", value: projectSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/models/${this.configuration.encodeParam({name: "modelSlug", value: modelSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/modelsources/git/${this.configuration.encodeParam({name: "gitModelId", value: gitModelId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: undefined})}`; - return this.httpClient.request('put', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: patchGitModel, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - - /** - * Update Restrictions - * @param projectSlug - * @param modelSlug - * @param toolModelRestrictions - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public updateRestrictions(projectSlug: string, modelSlug: string, toolModelRestrictions: ToolModelRestrictions, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public updateRestrictions(projectSlug: string, modelSlug: string, toolModelRestrictions: ToolModelRestrictions, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public updateRestrictions(projectSlug: string, modelSlug: string, toolModelRestrictions: ToolModelRestrictions, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public updateRestrictions(projectSlug: string, modelSlug: string, toolModelRestrictions: ToolModelRestrictions, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (projectSlug === null || projectSlug === undefined) { - throw new Error('Required parameter projectSlug was null or undefined when calling updateRestrictions.'); - } - if (modelSlug === null || modelSlug === undefined) { - throw new Error('Required parameter modelSlug was null or undefined when calling updateRestrictions.'); - } - if (toolModelRestrictions === null || toolModelRestrictions === undefined) { - throw new Error('Required parameter toolModelRestrictions was null or undefined when calling updateRestrictions.'); - } - - let localVarHeaders = this.defaultHeaders; - - let localVarCredential: string | undefined; - // authentication (PersonalAccessToken) required - localVarCredential = this.configuration.lookupCredential('PersonalAccessToken'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); - } - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v1/projects/${this.configuration.encodeParam({name: "projectSlug", value: projectSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/models/${this.configuration.encodeParam({name: "modelSlug", value: modelSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/restrictions`; - return this.httpClient.request('patch', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: toolModelRestrictions, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - } diff --git a/frontend/src/app/openapi/model/patch-user-role-request.ts b/frontend/src/app/openapi/model/authorization-response.ts similarity index 71% rename from frontend/src/app/openapi/model/patch-user-role-request.ts rename to frontend/src/app/openapi/model/authorization-response.ts index fd5312aba..816254081 100644 --- a/frontend/src/app/openapi/model/patch-user-role-request.ts +++ b/frontend/src/app/openapi/model/authorization-response.ts @@ -9,14 +9,12 @@ + To generate a new version, run `make openapi` in the root directory of this repository. */ -import { Role } from './role'; -export interface PatchUserRoleRequest { - role: Role; - reason: string; +export interface AuthorizationResponse { + auth_url: string; + state: string; + nonce: string; + code_verifier: string; } -export namespace PatchUserRoleRequest { -} - diff --git a/frontend/src/app/openapi/model/base-user.ts b/frontend/src/app/openapi/model/base-user.ts index e5f16e749..8fce88990 100644 --- a/frontend/src/app/openapi/model/base-user.ts +++ b/frontend/src/app/openapi/model/base-user.ts @@ -16,6 +16,7 @@ export interface BaseUser { id: number; name: string; idp_identifier: string; + email: string | null; role: Role; } export namespace BaseUser { diff --git a/frontend/src/app/openapi/model/models.ts b/frontend/src/app/openapi/model/models.ts index 098253c3f..fbf5f0361 100644 --- a/frontend/src/app/openapi/model/models.ts +++ b/frontend/src/app/openapi/model/models.ts @@ -9,6 +9,7 @@ + To generate a new version, run `make openapi` in the root directory of this repository. */ +export * from './authorization-response'; export * from './backup'; export * from './backup-pipeline-run'; export * from './base-user'; diff --git a/frontend/src/app/openapi/model/user.ts b/frontend/src/app/openapi/model/user.ts index d3af471a2..ca7bd058c 100644 --- a/frontend/src/app/openapi/model/user.ts +++ b/frontend/src/app/openapi/model/user.ts @@ -16,6 +16,7 @@ export interface User { id: number; name: string; idp_identifier: string; + email: string | null; role: Role; created: string | null; last_login: string | null; diff --git a/frontend/src/app/projects/project-detail/model-overview/model-complexity-badge/service/model-complexity-badge.service.ts b/frontend/src/app/projects/project-detail/model-overview/model-complexity-badge/service/model-complexity-badge.service.ts index 6ecfea3c3..3197ff402 100644 --- a/frontend/src/app/projects/project-detail/model-overview/model-complexity-badge/service/model-complexity-badge.service.ts +++ b/frontend/src/app/projects/project-detail/model-overview/model-complexity-badge/service/model-complexity-badge.service.ts @@ -7,19 +7,21 @@ import { HttpContext } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; import { SKIP_ERROR_HANDLING } from 'src/app/general/error-handling/error-handling.interceptor'; -import { ProjectsModelsService } from 'src/app/openapi'; +import { ProjectsModelsModelComplexityBadgeService } from 'src/app/openapi'; @Injectable({ providedIn: 'root', }) export class ModelComplexityBadgeService { - constructor(private projectModelService: ProjectsModelsService) {} + constructor( + private complexityBadgeService: ProjectsModelsModelComplexityBadgeService, + ) {} getModelComplexityBadge( projectSlug: string, modelSlug: string, ): Observable { - return this.projectModelService.getModelComplexityBadge( + return this.complexityBadgeService.getModelComplexityBadge( projectSlug, modelSlug, undefined, diff --git a/frontend/src/app/services/auth/auth.service.ts b/frontend/src/app/services/auth/auth.service.ts index e4ac3457a..b57114d1b 100644 --- a/frontend/src/app/services/auth/auth.service.ts +++ b/frontend/src/app/services/auth/auth.service.ts @@ -3,48 +3,18 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import { Observable } from 'rxjs'; -import { environment } from 'src/environments/environment'; +import { AuthenticationService } from 'src/app/openapi'; @Injectable({ providedIn: 'root', }) -export class AuthService { - SESSION_STORAGE_NONCE_KEY = 'nonce'; - SESSION_STORAGE_CODE_VERIFIER_KEY = 'coderVerifier'; - LOGGED_IN_KEY = 'loggedIn'; +export class AuthenticationWrapperService { + SESSION_STORAGE_NONCE_KEY = 'CCM_NONCE'; + SESSION_STORAGE_CODE_VERIFIER_KEY = 'CCM_CODE_VERIFIER'; + LOGGED_IN_KEY = 'CCM_LOGGED_IN'; - constructor(private http: HttpClient) {} - - getRedirectURL(): Observable { - return this.http.get( - environment.backend_url + '/authentication', - ); - } - - getIdentityToken( - code: string, - nonce: string, - code_verifier: string, - ): Observable { - return this.http.post( - environment.backend_url + '/authentication/tokens', - { - code, - nonce, - code_verifier, - }, - ); - } - - performTokenRefresh(): Observable { - return this.http.put( - environment.backend_url + '/authentication/tokens', - {}, - ); - } + constructor(private authenticationService: AuthenticationService) {} isLoggedIn(): boolean { const loggedIn = localStorage.getItem(this.LOGGED_IN_KEY); @@ -52,7 +22,7 @@ export class AuthService { } login(redirectTo: string) { - this.getRedirectURL().subscribe((res) => { + this.authenticationService.getAuthorizationUrl().subscribe((res) => { sessionStorage.setItem(res.state, redirectTo); sessionStorage.setItem(this.SESSION_STORAGE_NONCE_KEY, res.nonce); sessionStorage.setItem( @@ -66,15 +36,6 @@ export class AuthService { logOut() { localStorage.setItem('GUAC_AUTH', ''); localStorage.setItem(this.LOGGED_IN_KEY, 'false'); - return this.http - .delete(environment.backend_url + '/authentication/tokens') - .subscribe(); + this.authenticationService.logout().subscribe(); } } - -export interface GetRedirectURLResponse { - auth_url: string; - state: string; - nonce: string; - code_verifier: string; -} diff --git a/frontend/src/app/services/user/user.service.ts b/frontend/src/app/services/user/user.service.ts index 221f09d13..1a20572d3 100644 --- a/frontend/src/app/services/user/user.service.ts +++ b/frontend/src/app/services/user/user.service.ts @@ -6,7 +6,7 @@ import { Injectable } from '@angular/core'; import { BehaviorSubject } from 'rxjs'; import { UsersService, User } from 'src/app/openapi'; -import { AuthService } from '../auth/auth.service'; +import { AuthenticationWrapperService } from '../auth/auth.service'; @Injectable({ providedIn: 'root', @@ -20,7 +20,7 @@ export class UserWrapperService { } constructor( - private authService: AuthService, + private authService: AuthenticationWrapperService, private usersService: UsersService, ) { this.updateOwnUser(); diff --git a/frontend/src/app/sessions/user-sessions-wrapper/active-sessions/active-sessions.stories.ts b/frontend/src/app/sessions/user-sessions-wrapper/active-sessions/active-sessions.stories.ts index d0f5149a5..ad4861bff 100644 --- a/frontend/src/app/sessions/user-sessions-wrapper/active-sessions/active-sessions.stories.ts +++ b/frontend/src/app/sessions/user-sessions-wrapper/active-sessions/active-sessions.stories.ts @@ -207,6 +207,8 @@ export const SessionSharedWithUser: Story = { id: 1, name: 'user_1', role: 'administrator', + email: null, + idp_identifier: 'user_1', }, created_at: '2024-04-29T15:00:00Z', }, @@ -215,6 +217,8 @@ export const SessionSharedWithUser: Story = { id: 2, name: 'user_2', role: 'user', + email: null, + idp_identifier: 'user_2', }, created_at: '2024-04-29T15:00:00Z', }, diff --git a/frontend/src/app/settings/core/tools-settings/tool-details/tool-details.component.html b/frontend/src/app/settings/core/tools-settings/tool-details/tool-details.component.html index 39b68db29..550e60422 100644 --- a/frontend/src/app/settings/core/tools-settings/tool-details/tool-details.component.html +++ b/frontend/src/app/settings/core/tools-settings/tool-details/tool-details.component.html @@ -10,7 +10,7 @@

Common

diff --git a/frontend/src/app/settings/core/tools-settings/tool-details/tool-nature/tool-nature.component.html b/frontend/src/app/settings/core/tools-settings/tool-details/tool-nature/tool-nature.component.html index 132e57f20..62381de40 100644 --- a/frontend/src/app/settings/core/tools-settings/tool-details/tool-nature/tool-nature.component.html +++ b/frontend/src/app/settings/core/tools-settings/tool-details/tool-nature/tool-nature.component.html @@ -7,7 +7,7 @@

Tool Natures

diff --git a/frontend/src/app/settings/core/tools-settings/tool-details/tool-version/tool-version.component.html b/frontend/src/app/settings/core/tools-settings/tool-details/tool-version/tool-version.component.html index 863e98006..48d867f34 100644 --- a/frontend/src/app/settings/core/tools-settings/tool-details/tool-version/tool-version.component.html +++ b/frontend/src/app/settings/core/tools-settings/tool-details/tool-version/tool-version.component.html @@ -7,7 +7,7 @@

Tool Versions

diff --git a/frontend/src/app/settings/core/user-settings/user-settings.component.html b/frontend/src/app/settings/core/user-settings/user-settings.component.html index 8f3e3bef6..20bba48ac 100644 --- a/frontend/src/app/settings/core/user-settings/user-settings.component.html +++ b/frontend/src/app/settings/core/user-settings/user-settings.component.html @@ -65,7 +65,7 @@

Manage Users

- @if (["user"].includes(user.role)) { + @if (user.role === "user") {