diff --git a/slack_sdk/web/async_client.py b/slack_sdk/web/async_client.py index 050e9329..cedaa86d 100644 --- a/slack_sdk/web/async_client.py +++ b/slack_sdk/web/async_client.py @@ -22,7 +22,7 @@ from ..models.attachments import Attachment from ..models.blocks import Block -from ..models.metadata import Metadata, EventAndEntityMetadata +from ..models.metadata import Metadata, EntityMetadata, EventAndEntityMetadata from .async_base_client import AsyncBaseClient, AsyncSlackResponse from .internal_utils import ( _parse_web_class_objects, @@ -3650,10 +3650,10 @@ async def emoji_list( async def entity_presentDetails( self, trigger_id: str, - metadata: Optional[dict] = None, + metadata: Optional[Union[Dict, EntityMetadata]] = None, user_auth_required: Optional[bool] = None, user_auth_url: Optional[str] = None, - error: Optional[Dict[str, str]] = None, + error: Optional[Dict[str, Any]] = None, **kwargs, ) -> AsyncSlackResponse: """Provides entity details for the flexpane. @@ -3668,6 +3668,7 @@ async def entity_presentDetails( kwargs.update({"user_auth_url": user_auth_url}) if error is not None: kwargs.update({"error": error}) + _parse_web_class_objects(kwargs) return await self.api_call("entity.presentDetails", json=kwargs) async def files_comments_delete( diff --git a/slack_sdk/web/client.py b/slack_sdk/web/client.py index 830f481d..4be33e8d 100644 --- a/slack_sdk/web/client.py +++ b/slack_sdk/web/client.py @@ -12,7 +12,7 @@ from ..models.attachments import Attachment from ..models.blocks import Block -from ..models.metadata import Metadata, EventAndEntityMetadata +from ..models.metadata import Metadata, EntityMetadata, EventAndEntityMetadata from .base_client import BaseClient, SlackResponse from .internal_utils import ( _parse_web_class_objects, @@ -3640,10 +3640,10 @@ def emoji_list( def entity_presentDetails( self, trigger_id: str, - metadata: Optional[dict] = None, + metadata: Optional[Union[Dict, EntityMetadata]] = None, user_auth_required: Optional[bool] = None, user_auth_url: Optional[str] = None, - error: Optional[Dict[str, str]] = None, + error: Optional[Dict[str, Any]] = None, **kwargs, ) -> SlackResponse: """Provides entity details for the flexpane. @@ -3658,6 +3658,7 @@ def entity_presentDetails( kwargs.update({"user_auth_url": user_auth_url}) if error is not None: kwargs.update({"error": error}) + _parse_web_class_objects(kwargs) return self.api_call("entity.presentDetails", json=kwargs) def files_comments_delete( diff --git a/slack_sdk/web/internal_utils.py b/slack_sdk/web/internal_utils.py index 57afc6be..87139559 100644 --- a/slack_sdk/web/internal_utils.py +++ b/slack_sdk/web/internal_utils.py @@ -212,7 +212,11 @@ def to_dict(obj: Union[Dict, Block, Attachment, Metadata, EventAndEntityMetadata kwargs.update({"attachments": dict_attachments}) metadata = kwargs.get("metadata", None) - if metadata is not None and (isinstance(metadata, Metadata) or isinstance(metadata, EventAndEntityMetadata)): + if metadata is not None and ( + isinstance(metadata, Metadata) + or isinstance(metadata, EntityMetadata) + or isinstance(metadata, EventAndEntityMetadata) + ): kwargs.update({"metadata": to_dict(metadata)}) diff --git a/slack_sdk/web/legacy_client.py b/slack_sdk/web/legacy_client.py index cce4bd1a..3aaa36f7 100644 --- a/slack_sdk/web/legacy_client.py +++ b/slack_sdk/web/legacy_client.py @@ -23,7 +23,7 @@ from ..models.attachments import Attachment from ..models.blocks import Block -from ..models.metadata import Metadata, EventAndEntityMetadata +from ..models.metadata import Metadata, EntityMetadata, EventAndEntityMetadata from .legacy_base_client import LegacyBaseClient, SlackResponse from .internal_utils import ( _parse_web_class_objects, @@ -3588,10 +3588,10 @@ def emoji_list( def entity_presentDetails( self, trigger_id: str, - metadata: Optional[dict] = None, + metadata: Optional[Union[Dict, EntityMetadata]] = None, user_auth_required: Optional[bool] = None, user_auth_url: Optional[str] = None, - error: Optional[Dict[str, str]] = None, + error: Optional[Dict[str, Any]] = None, **kwargs, ) -> Union[Future, SlackResponse]: """Provides entity details for the flexpane. @@ -3606,6 +3606,7 @@ def entity_presentDetails( kwargs.update({"user_auth_url": user_auth_url}) if error is not None: kwargs.update({"error": error}) + _parse_web_class_objects(kwargs) return self.api_call("entity.presentDetails", json=kwargs) def files_comments_delete(