|
| 1 | +class AdvancedSettings: |
| 2 | + def __init__(self, britive, base_url: str = '/apps/{}/advanced-settings') -> None: |
| 3 | + self.britive = britive |
| 4 | + self.base_url = self.britive.base_url + base_url |
| 5 | + |
| 6 | + def create(self, entity_id: str, settings: dict) -> dict: |
| 7 | + """ |
| 8 | + Create Advanced Settings for a specific application or profile. |
| 9 | +
|
| 10 | + :param entity_id: The ID of the application or profile to create Advanced Settings for. |
| 11 | + :param settings: The Advanced Settings settings. |
| 12 | + :return: Details of the created Advanced Settings. |
| 13 | + """ |
| 14 | + |
| 15 | + return self.britive.post(self.base_url.format(entity_id), json=settings) |
| 16 | + |
| 17 | + def get(self, entity_id: str) -> dict: |
| 18 | + """ |
| 19 | + Get Advanced Settings for a specific application or profile. |
| 20 | +
|
| 21 | + :param entity_id: The ID of the application or profile to retrieve Advanced Settings for. |
| 22 | + :return: Details of the Advanced Settings. |
| 23 | + """ |
| 24 | + |
| 25 | + return self.britive.get(self.base_url.format(entity_id)) |
| 26 | + |
| 27 | + def update(self, entity_id: str, settings: dict) -> dict: |
| 28 | + """ |
| 29 | + Update Advanced Settings for a specific application or profile. |
| 30 | +
|
| 31 | + :param entity_id: The ID of the application or profile to update Advanced Settings for. |
| 32 | + :param settings: The Advanced Settings settings to update. |
| 33 | + :return: Details of the updated Advanced Settings. |
| 34 | + """ |
| 35 | + |
| 36 | + return self.britive.put(self.base_url.format(entity_id), json=settings) |
| 37 | + |
| 38 | + def delete(self, entity_id: str, settings_id: str) -> None: |
| 39 | + """ |
| 40 | + Delete Advanced Settings for a specific application or profile. |
| 41 | +
|
| 42 | + :param entity_id: The ID of the application or profile associated with the Advanced Settings. |
| 43 | + :param settings_id: The ID of the Advanced Settings settings to delete. |
| 44 | + :return: None. |
| 45 | + """ |
| 46 | + |
| 47 | + self.britive.delete(f'{self.base_url.format(entity_id)}/{settings_id}') |
0 commit comments