MCPcopy
hub / github.com/slackapi/python-slack-sdk / admin_apps_restrict

Method admin_apps_restrict

slack_sdk/web/client.py:224–252  ·  view source on GitHub ↗

Restrict an app for installation on a workspace. Exactly one of the team_id or enterprise_id arguments is required, not both. Either app_id or request_id is required. These IDs can be obtained either directly via the app_requested event, or by the admin.apps.requests.list met

(
        self,
        *,
        app_id: Optional[str] = None,
        request_id: Optional[str] = None,
        enterprise_id: Optional[str] = None,
        team_id: Optional[str] = None,
        **kwargs,
    )

Source from the content-addressed store, hash-verified

222 return self.api_call("admin.apps.requests.list", http_verb="GET", params=kwargs)
223
224 def admin_apps_restrict(
225 self,
226 *,
227 app_id: Optional[str] = None,
228 request_id: Optional[str] = None,
229 enterprise_id: Optional[str] = None,
230 team_id: Optional[str] = None,
231 **kwargs,
232 ) -> SlackResponse:
233 """Restrict an app for installation on a workspace.
234 Exactly one of the team_id or enterprise_id arguments is required, not both.
235 Either app_id or request_id is required. These IDs can be obtained either directly
236 via the app_requested event, or by the admin.apps.requests.list method.
237 https://docs.slack.dev/reference/methods/admin.apps.restrict
238 """
239 if app_id:
240 kwargs.update({"app_id": app_id})
241 elif request_id:
242 kwargs.update({"request_id": request_id})
243 else:
244 raise e.SlackRequestError("The app_id or request_id argument must be specified.")
245
246 kwargs.update(
247 {
248 "enterprise_id": enterprise_id,
249 "team_id": team_id,
250 }
251 )
252 return self.api_call("admin.apps.restrict", params=kwargs)
253
254 def admin_apps_restricted_list(
255 self,

Callers

nothing calls this directly

Calls 1

api_callMethod · 0.45

Tested by

no test coverage detected