Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] Add WebApps support to project_management #772

Open
mcosta74 opened this issue Mar 4, 2024 · 1 comment
Open

[FR] Add WebApps support to project_management #772

mcosta74 opened this issue Mar 4, 2024 · 1 comment

Comments

@mcosta74
Copy link

mcosta74 commented Mar 4, 2024

Is your feature request related to a problem? Please describe.
The project_management package miss API to work with webApps resource

Describe the solution you'd like
API to work with WebApps similar to the ones available for iOSApps and AndroidApps

Describe alternatives you've considered
The single alternative I considered was to use the REST requests by hands

Additional context
I implemented a bare minimum solution just extending _ProjectManagementService

from firebase_admin import project_management


class WebApp:
    def __init__(self, app_id, service) -> None:
        self._app_id = app_id
        self._service = service

    @property
    def app_id(self):
        return self._app_id

    def get_metadata(self):
        return self._service.get_web_app_metadata(self._app_id)

    def get_config(self):
        return self._service.get_web_app_config(self._app_id)


class WebAppsService(project_management._ProjectManagementService):
    WEB_APPS_RESOURCE_NAME = 'webApps'

    def __init__(self, app):
        super().__init__(app)

    def list_web_apps(self) -> list[WebApp]:
        return self._list_apps(
            platform_resource_name=WebAppsService.WEB_APPS_RESOURCE_NAME,
            app_class=WebApp
        )

    def get_web_app_metadata(self, app_id):
        path = '/v1beta1/projects/-/{0}/{1}'.format(
            WebAppsService.WEB_APPS_RESOURCE_NAME,
            app_id,
        )
        return self._make_request('get', path)

    def get_web_app_config(self, app_id):
        path = '/v1beta1/projects/-/{0}/{1}/config'.format(
            WebAppsService.WEB_APPS_RESOURCE_NAME,
            app_id,
        )
        return self._make_request('get', path)

but it can be completed with all APIs

@google-oss-bot
Copy link

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants