from flask import g from artists.services.artist_roster_projects_list_services import ArtistRosterProjectsListService from auth.auth_view import RegisteredAuthorizedView from artists.schemas import ( artist_roster_project_response_model_schema, artist_roster_projects_request_schema ) from flask_apispec import marshal_with, doc, use_kwargs @doc(tags=['ArtistRosterProject']) class ArtistRosterProjectsView(RegisteredAuthorizedView): service = ArtistRosterProjectsListService() @doc(description='Retrieve artist roster project data') @use_kwargs(artist_roster_projects_request_schema, location='query') @marshal_with( artist_roster_project_response_model_schema(many=True), code=200, description='List with artist roster projects info.' ) @marshal_with(schema=None, code=401, description='User is not authenticated.') def get(self, params, artist_external_id: str): return self.service.get_artist_project_list_for_expansion(g.user_id, artist_external_id, params)