firebase / firebase/firebase-admin-python

[FR] Add WebApps support to project_management

未關閉
#772 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
type: feature request
主要語言
Python
星號
1.2k
分支
359
平均合併
5 天 6 分鐘
30 天內合併 PR
2

描述

**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`

```py
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

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。