Skip to content

Commit 1fcdcf9

Browse files
feat: add support for elevate methods (#1703)
* feat: add support for elevate apis * Update test_web_client_coverage.py
1 parent 2f75504 commit 1fcdcf9

File tree

4 files changed

+193
-2
lines changed

4 files changed

+193
-2
lines changed

slack_sdk/web/async_client.py

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,60 @@ async def admin_auth_policy_removeEntities(
437437
kwargs.update({"entity_type": entity_type})
438438
return await self.api_call("admin.auth.policy.removeEntities", http_verb="POST", params=kwargs)
439439

440+
async def admin_conversations_createForObjects(
441+
self,
442+
*,
443+
object_id: str,
444+
salesforce_org_id: str,
445+
invite_object_team: Optional[bool] = None,
446+
**kwargs,
447+
) -> AsyncSlackResponse:
448+
"""Create a Salesforce channel for the corresponding object provided.
449+
https://api.slack.com/methods/admin.conversations.createForObjects
450+
"""
451+
kwargs.update(
452+
{"object_id": object_id, "salesforce_org_id": salesforce_org_id, "invite_object_team": invite_object_team}
453+
)
454+
return await self.api_call("admin.conversations.createForObjects", params=kwargs)
455+
456+
async def admin_conversations_linkObjects(
457+
self,
458+
*,
459+
channel: str,
460+
record_id: str,
461+
salesforce_org_id: str,
462+
**kwargs,
463+
) -> AsyncSlackResponse:
464+
"""Link a Salesforce record to a channel.
465+
https://api.slack.com/methods/admin.conversations.linkObjects
466+
"""
467+
kwargs.update(
468+
{
469+
"channel": channel,
470+
"record_id": record_id,
471+
"salesforce_org_id": salesforce_org_id,
472+
}
473+
)
474+
return await self.api_call("admin.conversations.linkObjects", params=kwargs)
475+
476+
async def admin_conversations_unlinkObjects(
477+
self,
478+
*,
479+
channel: str,
480+
new_name: str,
481+
**kwargs,
482+
) -> AsyncSlackResponse:
483+
"""Unlink a Salesforce record from a channel.
484+
https://api.slack.com/methods/admin.conversations.unlinkObjects
485+
"""
486+
kwargs.update(
487+
{
488+
"channel": channel,
489+
"new_name": new_name,
490+
}
491+
)
492+
return await self.api_call("admin.conversations.unlinkObjects", params=kwargs)
493+
440494
async def admin_barriers_create(
441495
self,
442496
*,

slack_sdk/web/client.py

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,60 @@ def admin_auth_policy_removeEntities(
427427
kwargs.update({"entity_type": entity_type})
428428
return self.api_call("admin.auth.policy.removeEntities", http_verb="POST", params=kwargs)
429429

430+
def admin_conversations_createForObjects(
431+
self,
432+
*,
433+
object_id: str,
434+
salesforce_org_id: str,
435+
invite_object_team: Optional[bool] = None,
436+
**kwargs,
437+
) -> SlackResponse:
438+
"""Create a Salesforce channel for the corresponding object provided.
439+
https://api.slack.com/methods/admin.conversations.createForObjects
440+
"""
441+
kwargs.update(
442+
{"object_id": object_id, "salesforce_org_id": salesforce_org_id, "invite_object_team": invite_object_team}
443+
)
444+
return self.api_call("admin.conversations.createForObjects", params=kwargs)
445+
446+
def admin_conversations_linkObjects(
447+
self,
448+
*,
449+
channel: str,
450+
record_id: str,
451+
salesforce_org_id: str,
452+
**kwargs,
453+
) -> SlackResponse:
454+
"""Link a Salesforce record to a channel.
455+
https://api.slack.com/methods/admin.conversations.linkObjects
456+
"""
457+
kwargs.update(
458+
{
459+
"channel": channel,
460+
"record_id": record_id,
461+
"salesforce_org_id": salesforce_org_id,
462+
}
463+
)
464+
return self.api_call("admin.conversations.linkObjects", params=kwargs)
465+
466+
def admin_conversations_unlinkObjects(
467+
self,
468+
*,
469+
channel: str,
470+
new_name: str,
471+
**kwargs,
472+
) -> SlackResponse:
473+
"""Unlink a Salesforce record from a channel.
474+
https://api.slack.com/methods/admin.conversations.unlinkObjects
475+
"""
476+
kwargs.update(
477+
{
478+
"channel": channel,
479+
"new_name": new_name,
480+
}
481+
)
482+
return self.api_call("admin.conversations.unlinkObjects", params=kwargs)
483+
430484
def admin_barriers_create(
431485
self,
432486
*,

slack_sdk/web/legacy_client.py

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,60 @@ def admin_auth_policy_removeEntities(
439439
kwargs.update({"entity_type": entity_type})
440440
return self.api_call("admin.auth.policy.removeEntities", http_verb="POST", params=kwargs)
441441

442+
def admin_conversations_createForObjects(
443+
self,
444+
*,
445+
object_id: str,
446+
salesforce_org_id: str,
447+
invite_object_team: Optional[bool] = None,
448+
**kwargs,
449+
) -> Union[Future, SlackResponse]:
450+
"""Create a Salesforce channel for the corresponding object provided.
451+
https://api.slack.com/methods/admin.conversations.createForObjects
452+
"""
453+
kwargs.update(
454+
{"object_id": object_id, "salesforce_org_id": salesforce_org_id, "invite_object_team": invite_object_team}
455+
)
456+
return self.api_call("admin.conversations.createForObjects", params=kwargs)
457+
458+
def admin_conversations_linkObjects(
459+
self,
460+
*,
461+
channel: str,
462+
record_id: str,
463+
salesforce_org_id: str,
464+
**kwargs,
465+
) -> Union[Future, SlackResponse]:
466+
"""Link a Salesforce record to a channel.
467+
https://api.slack.com/methods/admin.conversations.linkObjects
468+
"""
469+
kwargs.update(
470+
{
471+
"channel": channel,
472+
"record_id": record_id,
473+
"salesforce_org_id": salesforce_org_id,
474+
}
475+
)
476+
return self.api_call("admin.conversations.linkObjects", params=kwargs)
477+
478+
def admin_conversations_unlinkObjects(
479+
self,
480+
*,
481+
channel: str,
482+
new_name: str,
483+
**kwargs,
484+
) -> Union[Future, SlackResponse]:
485+
"""Unlink a Salesforce record from a channel.
486+
https://api.slack.com/methods/admin.conversations.unlinkObjects
487+
"""
488+
kwargs.update(
489+
{
490+
"channel": channel,
491+
"new_name": new_name,
492+
}
493+
)
494+
return self.api_call("admin.conversations.unlinkObjects", params=kwargs)
495+
442496
def admin_barriers_create(
443497
self,
444498
*,

0 commit comments

Comments
 (0)