From 5bb8cce1eda392357167187a738c16793ba5198b Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Mon, 7 Feb 2022 14:30:01 +0900 Subject: [PATCH] version 3.14.0 --- .../slack_sdk/audit_logs/v1/async_client.html | 13 +- .../slack_sdk/audit_logs/v1/client.html | 21 +- .../slack_sdk/audit_logs/v1/logs.html | 15 +- .../slack_sdk/audit_logs/v1/response.html | 1 + .../models/blocks/block_elements.html | 268 ++++++++++++++++-- .../oauth/installation_store/file/index.html | 2 +- .../oauth/state_store/file/index.html | 2 +- docs/api-docs/slack_sdk/rtm/index.html | 4 +- docs/api-docs/slack_sdk/scim/v1/client.html | 8 +- .../slack_sdk/socket_mode/async_client.html | 15 + .../socket_mode/builtin/internals.html | 6 +- docs/api-docs/slack_sdk/version.html | 2 +- docs/api-docs/slack_sdk/web/async_client.html | 78 +++++ docs/api-docs/slack_sdk/web/base_client.html | 44 +-- docs/api-docs/slack_sdk/web/client.html | 78 +++++ .../slack_sdk/web/legacy_base_client.html | 32 ++- .../api-docs/slack_sdk/web/legacy_client.html | 78 +++++ docs/api-docs/slack_sdk/webhook/client.html | 8 +- slack_sdk/version.py | 2 +- 19 files changed, 606 insertions(+), 71 deletions(-) diff --git a/docs/api-docs/slack_sdk/audit_logs/v1/async_client.html b/docs/api-docs/slack_sdk/audit_logs/v1/async_client.html index 179b449fc..474f0a8ea 100644 --- a/docs/api-docs/slack_sdk/audit_logs/v1/async_client.html +++ b/docs/api-docs/slack_sdk/audit_logs/v1/async_client.html @@ -181,6 +181,7 @@

Module slack_sdk.audit_logs.v1.async_client

action: Optional[str] = None, actor: Optional[str] = None, entity: Optional[str] = None, + cursor: Optional[str] = None, additional_query_params: Optional[Dict[str, Any]] = None, headers: Optional[Dict[str, str]] = None, ) -> AuditLogsResponse: @@ -201,6 +202,7 @@

Module slack_sdk.audit_logs.v1.async_client

action: Name of the action. actor: User ID who initiated the action. entity: ID of the target entity of the action (such as a channel, workspace, organization, file). + cursor: The next page cursor of pagination additional_query_params: Add anything else if you need to use the ones this library does not support headers: Additional request headers @@ -214,6 +216,7 @@

Module slack_sdk.audit_logs.v1.async_client

"action": action, "actor": actor, "entity": entity, + "cursor": cursor, } if additional_query_params is not None: query_params.update(additional_query_params) @@ -567,6 +570,7 @@

Args

action: Optional[str] = None, actor: Optional[str] = None, entity: Optional[str] = None, + cursor: Optional[str] = None, additional_query_params: Optional[Dict[str, Any]] = None, headers: Optional[Dict[str, str]] = None, ) -> AuditLogsResponse: @@ -587,6 +591,7 @@

Args

action: Name of the action. actor: User ID who initiated the action. entity: ID of the target entity of the action (such as a channel, workspace, organization, file). + cursor: The next page cursor of pagination additional_query_params: Add anything else if you need to use the ones this library does not support headers: Additional request headers @@ -600,6 +605,7 @@

Args

"action": action, "actor": actor, "entity": entity, + "cursor": cursor, } if additional_query_params is not None: query_params.update(additional_query_params) @@ -908,7 +914,7 @@

Returns

-async def logs(self, *, latest: Optional[int] = None, oldest: Optional[int] = None, limit: Optional[int] = None, action: Optional[str] = None, actor: Optional[str] = None, entity: Optional[str] = None, additional_query_params: Optional[Dict[str, Any]] = None, headers: Optional[Dict[str, str]] = None) ‑> AuditLogsResponse +async def logs(self, *, latest: Optional[int] = None, oldest: Optional[int] = None, limit: Optional[int] = None, action: Optional[str] = None, actor: Optional[str] = None, entity: Optional[str] = None, cursor: Optional[str] = None, additional_query_params: Optional[Dict[str, Any]] = None, headers: Optional[Dict[str, str]] = None) ‑> AuditLogsResponse

This is the primary endpoint for retrieving actual audit events from your organization. @@ -933,6 +939,8 @@

Args

User ID who initiated the action.
entity
ID of the target entity of the action (such as a channel, workspace, organization, file).
+
cursor
+
The next page cursor of pagination
additional_query_params
Add anything else if you need to use the ones this library does not support
headers
@@ -953,6 +961,7 @@

Returns

action: Optional[str] = None, actor: Optional[str] = None, entity: Optional[str] = None, + cursor: Optional[str] = None, additional_query_params: Optional[Dict[str, Any]] = None, headers: Optional[Dict[str, str]] = None, ) -> AuditLogsResponse: @@ -973,6 +982,7 @@

Returns

action: Name of the action. actor: User ID who initiated the action. entity: ID of the target entity of the action (such as a channel, workspace, organization, file). + cursor: The next page cursor of pagination additional_query_params: Add anything else if you need to use the ones this library does not support headers: Additional request headers @@ -986,6 +996,7 @@

Returns

"action": action, "actor": actor, "entity": entity, + "cursor": cursor, } if additional_query_params is not None: query_params.update(additional_query_params) diff --git a/docs/api-docs/slack_sdk/audit_logs/v1/client.html b/docs/api-docs/slack_sdk/audit_logs/v1/client.html index ae5a6f5ed..556168715 100644 --- a/docs/api-docs/slack_sdk/audit_logs/v1/client.html +++ b/docs/api-docs/slack_sdk/audit_logs/v1/client.html @@ -170,6 +170,7 @@

Module slack_sdk.audit_logs.v1.client

action: Optional[str] = None, actor: Optional[str] = None, entity: Optional[str] = None, + cursor: Optional[str] = None, additional_query_params: Optional[Dict[str, Any]] = None, headers: Optional[Dict[str, str]] = None, ) -> AuditLogsResponse: @@ -190,6 +191,7 @@

Module slack_sdk.audit_logs.v1.client

action: Name of the action. actor: User ID who initiated the action. entity: ID of the target entity of the action (such as a channel, workspace, organization, file). + cursor: The next page cursor of pagination additional_query_params: Add anything else if you need to use the ones this library does not support headers: Additional request headers @@ -203,6 +205,7 @@

Module slack_sdk.audit_logs.v1.client

"action": action, "actor": actor, "entity": entity, + "cursor": cursor, } if additional_query_params is not None: query_params.update(additional_query_params) @@ -287,11 +290,13 @@

Module slack_sdk.audit_logs.v1.client

# read the response body here charset = e.headers.get_content_charset() or "utf-8" response_body: str = e.read().decode(charset) + # As adding new values to HTTPError#headers can be ignored, building a new dict object here + response_headers = dict(e.headers.items()) resp = AuditLogsResponse( url=url, status_code=e.code, raw_body=response_body, - headers=dict(e.headers.items()), + headers=response_headers, ) if e.code == 429: # for backward-compatibility with WebClient (v.2.5.0 or older) @@ -570,6 +575,7 @@

Args

action: Optional[str] = None, actor: Optional[str] = None, entity: Optional[str] = None, + cursor: Optional[str] = None, additional_query_params: Optional[Dict[str, Any]] = None, headers: Optional[Dict[str, str]] = None, ) -> AuditLogsResponse: @@ -590,6 +596,7 @@

Args

action: Name of the action. actor: User ID who initiated the action. entity: ID of the target entity of the action (such as a channel, workspace, organization, file). + cursor: The next page cursor of pagination additional_query_params: Add anything else if you need to use the ones this library does not support headers: Additional request headers @@ -603,6 +610,7 @@

Args

"action": action, "actor": actor, "entity": entity, + "cursor": cursor, } if additional_query_params is not None: query_params.update(additional_query_params) @@ -687,11 +695,13 @@

Args

# read the response body here charset = e.headers.get_content_charset() or "utf-8" response_body: str = e.read().decode(charset) + # As adding new values to HTTPError#headers can be ignored, building a new dict object here + response_headers = dict(e.headers.items()) resp = AuditLogsResponse( url=url, status_code=e.code, raw_body=response_body, - headers=dict(e.headers.items()), + headers=response_headers, ) if e.code == 429: # for backward-compatibility with WebClient (v.2.5.0 or older) @@ -935,7 +945,7 @@

Returns

-def logs(self, *, latest: Optional[int] = None, oldest: Optional[int] = None, limit: Optional[int] = None, action: Optional[str] = None, actor: Optional[str] = None, entity: Optional[str] = None, additional_query_params: Optional[Dict[str, Any]] = None, headers: Optional[Dict[str, str]] = None) ‑> AuditLogsResponse +def logs(self, *, latest: Optional[int] = None, oldest: Optional[int] = None, limit: Optional[int] = None, action: Optional[str] = None, actor: Optional[str] = None, entity: Optional[str] = None, cursor: Optional[str] = None, additional_query_params: Optional[Dict[str, Any]] = None, headers: Optional[Dict[str, str]] = None) ‑> AuditLogsResponse

This is the primary endpoint for retrieving actual audit events from your organization. @@ -960,6 +970,8 @@

Args

User ID who initiated the action.
entity
ID of the target entity of the action (such as a channel, workspace, organization, file).
+
cursor
+
The next page cursor of pagination
additional_query_params
Add anything else if you need to use the ones this library does not support
headers
@@ -980,6 +992,7 @@

Returns

action: Optional[str] = None, actor: Optional[str] = None, entity: Optional[str] = None, + cursor: Optional[str] = None, additional_query_params: Optional[Dict[str, Any]] = None, headers: Optional[Dict[str, str]] = None, ) -> AuditLogsResponse: @@ -1000,6 +1013,7 @@

Returns

action: Name of the action. actor: User ID who initiated the action. entity: ID of the target entity of the action (such as a channel, workspace, organization, file). + cursor: The next page cursor of pagination additional_query_params: Add anything else if you need to use the ones this library does not support headers: Additional request headers @@ -1013,6 +1027,7 @@

Returns

"action": action, "actor": actor, "entity": entity, + "cursor": cursor, } if additional_query_params is not None: query_params.update(additional_query_params) diff --git a/docs/api-docs/slack_sdk/audit_logs/v1/logs.html b/docs/api-docs/slack_sdk/audit_logs/v1/logs.html index df5b8f0bb..b94123b5a 100644 --- a/docs/api-docs/slack_sdk/audit_logs/v1/logs.html +++ b/docs/api-docs/slack_sdk/audit_logs/v1/logs.html @@ -205,6 +205,7 @@

Module slack_sdk.audit_logs.v1.logs

new_retention_policy: Optional[RetentionPolicy] who_can_post: Optional[ConversationPref] can_thread: Optional[ConversationPref] + is_external_limited: Optional[bool] def __init__( self, @@ -266,6 +267,7 @@

Module slack_sdk.audit_logs.v1.logs

new_retention_policy: Optional[Union[Dict[str, Any], RetentionPolicy]] = None, who_can_post: Optional[Union[Dict[str, List[str]], ConversationPref]] = None, can_thread: Optional[Union[Dict[str, List[str]], ConversationPref]] = None, + is_external_limited: Optional[bool] = None, **kwargs, ) -> None: self.name = name @@ -342,6 +344,7 @@

Module slack_sdk.audit_logs.v1.logs

if isinstance(can_thread, ConversationPref) else ConversationPref(**can_thread) ) + self.is_external_limited = is_external_limited class App: @@ -908,7 +911,7 @@

Class variables

class Details -(*, name: Optional[str] = None, new_value: Union[str, List[str], Dict[str, Any], ForwardRef(None)] = None, previous_value: Union[str, List[str], Dict[str, Any], ForwardRef(None)] = None, expires_on: Optional[int] = None, mobile_only: Optional[bool] = None, web_only: Optional[bool] = None, non_sso_only: Optional[bool] = None, type: Optional[str] = None, is_workflow: Optional[bool] = None, inviter: Union[Dict[str, Any], User, ForwardRef(None)] = None, kicker: Union[Dict[str, Any], User, ForwardRef(None)] = None, shared_to: Optional[str] = None, reason: Optional[str] = None, origin_team: Optional[str] = None, target_team: Optional[str] = None, is_internal_integration: Optional[bool] = None, cleared_resolution: Optional[str] = None, app_owner_id: Optional[str] = None, bot_scopes: Optional[List[str]] = None, new_scopes: Optional[List[str]] = None, previous_scopes: Optional[List[str]] = None, granular_bot_token: Optional[bool] = None, scopes: Optional[List[str]] = None, resolution: Optional[str] = None, app_previously_resolved: Optional[bool] = None, admin_app_id: Optional[str] = None, bot_id: Optional[str] = None, installer_user_id: Optional[str] = None, approver_id: Optional[str] = None, approval_type: Optional[str] = None, app_previously_approved: Optional[bool] = None, old_scopes: Optional[List[str]] = None, channels: Optional[List[str]] = None, permissions: Optional[List[Dict[str, Any]]] = None, new_version_id: Optional[str] = None, trigger: Optional[str] = None, export_type: Optional[str] = None, export_start_ts: Optional[str] = None, export_end_ts: Optional[str] = None, barrier_id: Optional[str] = None, primary_usergroup_id: Optional[str] = None, barriered_from_usergroup_ids: Optional[List[str]] = None, restricted_subjects: Optional[List[str]] = None, duration: Optional[int] = None, desktop_app_browser_quit: Optional[bool] = None, invite_id: Optional[str] = None, external_organization_id: Optional[str] = None, external_organization_name: Optional[str] = None, external_user_id: Optional[str] = None, external_user_email: Optional[str] = None, channel_id: Optional[str] = None, added_team_id: Optional[str] = None, is_token_rotation_enabled_app: Optional[bool] = None, old_retention_policy: Union[Dict[str, Any], RetentionPolicy, ForwardRef(None)] = None, new_retention_policy: Union[Dict[str, Any], RetentionPolicy, ForwardRef(None)] = None, who_can_post: Union[Dict[str, List[str]], ConversationPref, ForwardRef(None)] = None, can_thread: Union[Dict[str, List[str]], ConversationPref, ForwardRef(None)] = None, **kwargs) +(*, name: Optional[str] = None, new_value: Union[str, List[str], Dict[str, Any], ForwardRef(None)] = None, previous_value: Union[str, List[str], Dict[str, Any], ForwardRef(None)] = None, expires_on: Optional[int] = None, mobile_only: Optional[bool] = None, web_only: Optional[bool] = None, non_sso_only: Optional[bool] = None, type: Optional[str] = None, is_workflow: Optional[bool] = None, inviter: Union[Dict[str, Any], User, ForwardRef(None)] = None, kicker: Union[Dict[str, Any], User, ForwardRef(None)] = None, shared_to: Optional[str] = None, reason: Optional[str] = None, origin_team: Optional[str] = None, target_team: Optional[str] = None, is_internal_integration: Optional[bool] = None, cleared_resolution: Optional[str] = None, app_owner_id: Optional[str] = None, bot_scopes: Optional[List[str]] = None, new_scopes: Optional[List[str]] = None, previous_scopes: Optional[List[str]] = None, granular_bot_token: Optional[bool] = None, scopes: Optional[List[str]] = None, resolution: Optional[str] = None, app_previously_resolved: Optional[bool] = None, admin_app_id: Optional[str] = None, bot_id: Optional[str] = None, installer_user_id: Optional[str] = None, approver_id: Optional[str] = None, approval_type: Optional[str] = None, app_previously_approved: Optional[bool] = None, old_scopes: Optional[List[str]] = None, channels: Optional[List[str]] = None, permissions: Optional[List[Dict[str, Any]]] = None, new_version_id: Optional[str] = None, trigger: Optional[str] = None, export_type: Optional[str] = None, export_start_ts: Optional[str] = None, export_end_ts: Optional[str] = None, barrier_id: Optional[str] = None, primary_usergroup_id: Optional[str] = None, barriered_from_usergroup_ids: Optional[List[str]] = None, restricted_subjects: Optional[List[str]] = None, duration: Optional[int] = None, desktop_app_browser_quit: Optional[bool] = None, invite_id: Optional[str] = None, external_organization_id: Optional[str] = None, external_organization_name: Optional[str] = None, external_user_id: Optional[str] = None, external_user_email: Optional[str] = None, channel_id: Optional[str] = None, added_team_id: Optional[str] = None, is_token_rotation_enabled_app: Optional[bool] = None, old_retention_policy: Union[Dict[str, Any], RetentionPolicy, ForwardRef(None)] = None, new_retention_policy: Union[Dict[str, Any], RetentionPolicy, ForwardRef(None)] = None, who_can_post: Union[Dict[str, List[str]], ConversationPref, ForwardRef(None)] = None, can_thread: Union[Dict[str, List[str]], ConversationPref, ForwardRef(None)] = None, is_external_limited: Optional[bool] = None, **kwargs)
@@ -975,6 +978,7 @@

Class variables

new_retention_policy: Optional[RetentionPolicy] who_can_post: Optional[ConversationPref] can_thread: Optional[ConversationPref] + is_external_limited: Optional[bool] def __init__( self, @@ -1036,6 +1040,7 @@

Class variables

new_retention_policy: Optional[Union[Dict[str, Any], RetentionPolicy]] = None, who_can_post: Optional[Union[Dict[str, List[str]], ConversationPref]] = None, can_thread: Optional[Union[Dict[str, List[str]], ConversationPref]] = None, + is_external_limited: Optional[bool] = None, **kwargs, ) -> None: self.name = name @@ -1111,7 +1116,8 @@

Class variables

can_thread if isinstance(can_thread, ConversationPref) else ConversationPref(**can_thread) - ) + ) + self.is_external_limited = is_external_limited

Class variables

@@ -1231,6 +1237,10 @@

Class variables

+
var is_external_limited : Optional[bool]
+
+
+
var is_internal_integration : Optional[bool]
@@ -2091,6 +2101,7 @@

installer_user_id
  • invite_id
  • inviter
  • +
  • is_external_limited
  • is_internal_integration
  • is_token_rotation_enabled_app
  • is_workflow
  • diff --git a/docs/api-docs/slack_sdk/audit_logs/v1/response.html b/docs/api-docs/slack_sdk/audit_logs/v1/response.html index 7a07671d1..25892e94b 100644 --- a/docs/api-docs/slack_sdk/audit_logs/v1/response.html +++ b/docs/api-docs/slack_sdk/audit_logs/v1/response.html @@ -32,6 +32,7 @@

    Module slack_sdk.audit_logs.v1.response

    from slack_sdk.audit_logs.v1.logs import LogsResponse +# TODO: Unlike WebClient's responses, this class has not yet provided __iter__ method class AuditLogsResponse: url: str status_code: int diff --git a/docs/api-docs/slack_sdk/models/blocks/block_elements.html b/docs/api-docs/slack_sdk/models/blocks/block_elements.html index 1f078937c..a30c82328 100644 --- a/docs/api-docs/slack_sdk/models/blocks/block_elements.html +++ b/docs/api-docs/slack_sdk/models/blocks/block_elements.html @@ -132,6 +132,8 @@

    Module slack_sdk.models.blocks.block_elements

    Module slack_sdk.models.blocks.block_elementsModule slack_sdk.models.blocks.block_elementsModule slack_sdk.models.blocks.block_elementsModule slack_sdk.models.blocks.block_elementsModule slack_sdk.models.blocks.block_elementsModule slack_sdk.models.blocks.block_elementsModule slack_sdk.models.blocks.block_elementsModule slack_sdk.models.blocks.block_elementsModule slack_sdk.models.blocks.block_elementsModule slack_sdk.models.blocks.block_elementsModule slack_sdk.models.blocks.block_elementsModule slack_sdk.models.blocks.block_elementsModule slack_sdk.models.blocks.block_elementsModule slack_sdk.models.blocks.block_elementsModule slack_sdk.models.blocks.block_elementsModule slack_sdk.models.blocks.block_elementsModule slack_sdk.models.blocks.block_elementsModule slack_sdk.models.blocks.block_elementsModule slack_sdk.models.blocks.block_elementsModule slack_sdk.models.blocks.block_elementsModule slack_sdk.models.blocks.block_elementsModule slack_sdk.models.blocks.block_elementsModule slack_sdk.models.blocks.block_elementsModule slack_sdk.models.blocks.block_elementsModule slack_sdk.models.blocks.block_elementsModule slack_sdk.models.blocks.block_elementsModule slack_sdk.models.blocks.block_elementsModule slack_sdk.models.blocks.block_elementsModule slack_sdk.models.blocks.block_elementsModule slack_sdk.models.blocks.block_elementsModule slack_sdk.models.blocks.block_elementsModule slack_sdk.models.blocks.block_elementsModule slack_sdk.models.blocks.block_elementsModule slack_sdk.models.blocks.block_elementsModule slack_sdk.models.blocks.block_elementsModule slack_sdk.models.blocks.block_elementsModule slack_sdk.models.blocks.block_elementsModule slack_sdk.models.blocks.block_elementsModule slack_sdk.models.blocks.block_elementsModule slack_sdk.models.blocks.block_elementsClasses return OverflowMenuElement(**d) elif t == DatePickerElement.type: return DatePickerElement(**d) + elif t == TimePickerElement.type: + return TimePickerElement(**d) else: cls.logger.warning( f"Unknown element detected and skipped ({block_element})" @@ -1684,6 +1770,8 @@

    Static methods

    return OverflowMenuElement(**d) elif t == DatePickerElement.type: return DatePickerElement(**d) + elif t == TimePickerElement.type: + return TimePickerElement(**d) else: cls.logger.warning( f"Unknown element detected and skipped ({block_element})" @@ -1749,7 +1837,7 @@

    Inherited members

    class ButtonElement -(*, text: Union[str, dict, TextObject], action_id: Optional[str] = None, url: Optional[str] = None, value: Optional[str] = None, style: Optional[str] = None, confirm: Union[dict, ConfirmObject, ForwardRef(None)] = None, **others: dict) +(*, text: Union[str, dict, TextObject], action_id: Optional[str] = None, url: Optional[str] = None, value: Optional[str] = None, style: Optional[str] = None, confirm: Union[dict, ConfirmObject, ForwardRef(None)] = None, accessibility_label: Optional[str] = None, **others: dict)

    Block Elements are things that exists inside of your Blocks. @@ -1785,6 +1873,10 @@

    Args

    If you don't include this field, the default button style will be used.
    confirm
    A confirm object that defines an optional confirmation dialog after the button is clicked.
    +
    accessibility_label
    +
    A label for longer descriptive text about a button element. +This label will be read out by screen readers instead of the button text object. +Maximum length for this field is 75 characters.
    @@ -1798,7 +1890,9 @@

    Args

    @property def attributes(self) -> Set[str]: - return super().attributes.union({"text", "url", "value", "style", "confirm"}) + return super().attributes.union( + {"text", "url", "value", "style", "confirm", "accessibility_label"} + ) def __init__( self, @@ -1809,6 +1903,7 @@

    Args

    value: Optional[str] = None, style: Optional[str] = None, # primary, danger confirm: Optional[Union[dict, ConfirmObject]] = None, + accessibility_label: Optional[str] = None, **others: dict, ): """An interactive element that inserts a button. The button can be a trigger for @@ -1836,6 +1931,9 @@

    Args

    Use "danger" even more sparingly than "primary". If you don't include this field, the default button style will be used. confirm: A confirm object that defines an optional confirmation dialog after the button is clicked. + accessibility_label: A label for longer descriptive text about a button element. + This label will be read out by screen readers instead of the button text object. + Maximum length for this field is 75 characters. """ super().__init__(action_id=action_id, type=self.type) show_unknown_key_warning(self, others) @@ -1846,6 +1944,7 @@

    Args

    self.value = value self.style = style self.confirm = ConfirmObject.parse(confirm) + self.accessibility_label = accessibility_label @JsonValidator(f"text attribute cannot exceed {text_max_length} characters") def _validate_text_length(self) -> bool: @@ -1865,7 +1964,16 @@

    Args

    @EnumValidator("style", ButtonStyles) def _validate_style_valid(self): - return self.style is None or self.style in ButtonStyles + return self.style is None or self.style in ButtonStyles + + @JsonValidator( + f"accessibility_label attribute cannot exceed {text_max_length} characters" + ) + def _validate_accessibility_label_length(self) -> bool: + return ( + self.accessibility_label is None + or len(self.accessibility_label) <= self.text_max_length + )

    Ancestors

    class ChannelMultiSelectElement -(*, placeholder: Union[str, dict, TextObject, ForwardRef(None)] = None, action_id: Optional[str] = None, initial_channels: Optional[Sequence[str]] = None, confirm: Union[dict, ConfirmObject, ForwardRef(None)] = None, max_selected_items: Optional[int] = None, **others: dict) +(*, placeholder: Union[str, dict, TextObject, ForwardRef(None)] = None, action_id: Optional[str] = None, initial_channels: Optional[Sequence[str]] = None, confirm: Union[dict, ConfirmObject, ForwardRef(None)] = None, max_selected_items: Optional[int] = None, focus_on_load: Optional[bool] = None, **others: dict)

    Block Elements are things that exists inside of your Blocks. @@ -1938,6 +2046,9 @@

    Args

    max_selected_items
    Specifies the maximum number of items that can be selected in the menu. Minimum number is 1.
    +
    focus_on_load
    +
    Indicates whether the element will be set to auto focus within the view object. +Only one element can be set to true. Defaults to false.
    @@ -1958,6 +2069,7 @@

    Args

    initial_channels: Optional[Sequence[str]] = None, confirm: Optional[Union[dict, ConfirmObject]] = None, max_selected_items: Optional[int] = None, + focus_on_load: Optional[bool] = None, **others: dict, ): """ @@ -1978,12 +2090,15 @@

    Args

    before the multi-select choices are submitted. max_selected_items: Specifies the maximum number of items that can be selected in the menu. Minimum number is 1. + focus_on_load: Indicates whether the element will be set to auto focus within the view object. + Only one element can be set to true. Defaults to false. """ super().__init__( type=self.type, action_id=action_id, placeholder=TextObject.parse(placeholder, PlainTextObject.type), confirm=ConfirmObject.parse(confirm), + focus_on_load=focus_on_load, ) show_unknown_key_warning(self, others) @@ -2023,7 +2138,7 @@

    Inherited members

    class ChannelSelectElement -(*, placeholder: Union[str, dict, TextObject, ForwardRef(None)] = None, action_id: Optional[str] = None, initial_channel: Optional[str] = None, confirm: Union[dict, ConfirmObject, ForwardRef(None)] = None, response_url_enabled: Optional[bool] = None, **others: dict) +(*, placeholder: Union[str, dict, TextObject, ForwardRef(None)] = None, action_id: Optional[str] = None, initial_channel: Optional[str] = None, confirm: Union[dict, ConfirmObject, ForwardRef(None)] = None, response_url_enabled: Optional[bool] = None, focus_on_load: Optional[bool] = None, **others: dict)

    Block Elements are things that exists inside of your Blocks. @@ -2051,6 +2166,9 @@

    Args

    When set to true, the view_submission payload from the menu's parent view will contain a response_url. This response_url can be used for message responses. The target channel for the message will be determined by the value of this select menu
    +
    focus_on_load
    +
    Indicates whether the element will be set to auto focus within the view object. +Only one element can be set to true. Defaults to false.
    @@ -2071,6 +2189,7 @@

    Args

    initial_channel: Optional[str] = None, confirm: Optional[Union[dict, ConfirmObject]] = None, response_url_enabled: Optional[bool] = None, + focus_on_load: Optional[bool] = None, **others: dict, ): """ @@ -2092,12 +2211,15 @@

    Args

    When set to true, the view_submission payload from the menu's parent view will contain a response_url. This response_url can be used for message responses. The target channel for the message will be determined by the value of this select menu + focus_on_load: Indicates whether the element will be set to auto focus within the view object. + Only one element can be set to true. Defaults to false. """ super().__init__( type=self.type, action_id=action_id, placeholder=TextObject.parse(placeholder, PlainTextObject.type), confirm=ConfirmObject.parse(confirm), + focus_on_load=focus_on_load, ) show_unknown_key_warning(self, others) @@ -2137,7 +2259,7 @@

    Inherited members

    class CheckboxesElement -(*, action_id: Optional[str] = None, options: Optional[Sequence[Union[dict, Option]]] = None, initial_options: Optional[Sequence[Union[dict, Option]]] = None, confirm: Union[dict, ConfirmObject, ForwardRef(None)] = None, **others: dict) +(*, action_id: Optional[str] = None, options: Optional[Sequence[Union[dict, Option]]] = None, initial_options: Optional[Sequence[Union[dict, Option]]] = None, confirm: Union[dict, ConfirmObject, ForwardRef(None)] = None, focus_on_load: Optional[bool] = None, **others: dict)

    Block Elements are things that exists inside of your Blocks. @@ -2159,6 +2281,9 @@

    Args

    confirm
    A confirm object that defines an optional confirmation dialog that appears after clicking one of the checkboxes in this element.
    +
    focus_on_load
    +
    Indicates whether the element will be set to auto focus within the view object. +Only one element can be set to true. Defaults to false.
    @@ -2178,6 +2303,7 @@

    Args

    options: Optional[Sequence[Union[dict, Option]]] = None, initial_options: Optional[Sequence[Union[dict, Option]]] = None, confirm: Optional[Union[dict, ConfirmObject]] = None, + focus_on_load: Optional[bool] = None, **others: dict, ): """A checkbox group that allows a user to choose multiple items from a list of possible options. @@ -2193,11 +2319,14 @@

    Args

    These options will be selected when the checkbox group initially loads. confirm: A confirm object that defines an optional confirmation dialog that appears after clicking one of the checkboxes in this element. + focus_on_load: Indicates whether the element will be set to auto focus within the view object. + Only one element can be set to true. Defaults to false. """ super().__init__( type=self.type, action_id=action_id, confirm=ConfirmObject.parse(confirm), + focus_on_load=focus_on_load, ) show_unknown_key_warning(self, others) @@ -2358,7 +2487,7 @@

    Inherited members

    class ConversationMultiSelectElement -(*, placeholder: Union[str, dict, TextObject, ForwardRef(None)] = None, action_id: Optional[str] = None, initial_conversations: Optional[Sequence[str]] = None, confirm: Union[dict, ConfirmObject, ForwardRef(None)] = None, max_selected_items: Optional[int] = None, default_to_current_conversation: Optional[bool] = None, filter: Union[dict, ConversationFilter, ForwardRef(None)] = None, **others: dict) +(*, placeholder: Union[str, dict, TextObject, ForwardRef(None)] = None, action_id: Optional[str] = None, initial_conversations: Optional[Sequence[str]] = None, confirm: Union[dict, ConfirmObject, ForwardRef(None)] = None, max_selected_items: Optional[int] = None, default_to_current_conversation: Optional[bool] = None, filter: Union[dict, ConversationFilter, ForwardRef(None)] = None, focus_on_load: Optional[bool] = None, **others: dict)

    Block Elements are things that exists inside of your Blocks. @@ -2391,6 +2520,9 @@

    Args

    the user was viewing when they opened the modal, if available. Default is false.
    filter
    A filter object that reduces the list of available conversations using the specified criteria.
    +
    focus_on_load
    +
    Indicates whether the element will be set to auto focus within the view object. +Only one element can be set to true. Defaults to false.
    @@ -2420,6 +2552,7 @@

    Args

    max_selected_items: Optional[int] = None, default_to_current_conversation: Optional[bool] = None, filter: Optional[Union[dict, ConversationFilter]] = None, # skipcq: PYL-W0622 + focus_on_load: Optional[bool] = None, **others: dict, ): """ @@ -2444,12 +2577,15 @@

    Args

    default_to_current_conversation: Pre-populates the select menu with the conversation that the user was viewing when they opened the modal, if available. Default is false. filter: A filter object that reduces the list of available conversations using the specified criteria. + focus_on_load: Indicates whether the element will be set to auto focus within the view object. + Only one element can be set to true. Defaults to false. """ super().__init__( type=self.type, action_id=action_id, placeholder=TextObject.parse(placeholder, PlainTextObject.type), confirm=ConfirmObject.parse(confirm), + focus_on_load=focus_on_load, ) show_unknown_key_warning(self, others) @@ -2491,7 +2627,7 @@

    Inherited members

    class ConversationSelectElement -(*, placeholder: Union[str, dict, TextObject, ForwardRef(None)] = None, action_id: Optional[str] = None, initial_conversation: Optional[str] = None, confirm: Union[dict, ConfirmObject, ForwardRef(None)] = None, response_url_enabled: Optional[bool] = None, default_to_current_conversation: Optional[bool] = None, filter: Optional[ConversationFilter] = None, **others: dict) +(*, placeholder: Union[str, dict, TextObject, ForwardRef(None)] = None, action_id: Optional[str] = None, initial_conversation: Optional[str] = None, confirm: Union[dict, ConfirmObject, ForwardRef(None)] = None, response_url_enabled: Optional[bool] = None, default_to_current_conversation: Optional[bool] = None, filter: Optional[ConversationFilter] = None, focus_on_load: Optional[bool] = None, **others: dict)

    Block Elements are things that exists inside of your Blocks. @@ -2525,6 +2661,9 @@

    Args

    that the user was viewing when they opened the modal, if available. Default is false.
    filter
    A filter object that reduces the list of available conversations using the specified criteria.
    +
    focus_on_load
    +
    Indicates whether the element will be set to auto focus within the view object. +Only one element can be set to true. Defaults to false.
    @@ -2554,6 +2693,7 @@

    Args

    response_url_enabled: Optional[bool] = None, default_to_current_conversation: Optional[bool] = None, filter: Optional[ConversationFilter] = None, # skipcq: PYL-W0622 + focus_on_load: Optional[bool] = None, **others: dict, ): """ @@ -2579,12 +2719,15 @@

    Args

    default_to_current_conversation: Pre-populates the select menu with the conversation that the user was viewing when they opened the modal, if available. Default is false. filter: A filter object that reduces the list of available conversations using the specified criteria. + focus_on_load: Indicates whether the element will be set to auto focus within the view object. + Only one element can be set to true. Defaults to false. """ super().__init__( type=self.type, action_id=action_id, placeholder=TextObject.parse(placeholder, PlainTextObject.type), confirm=ConfirmObject.parse(confirm), + focus_on_load=focus_on_load, ) show_unknown_key_warning(self, others) @@ -2626,7 +2769,7 @@

    Inherited members

    class DatePickerElement -(*, action_id: Optional[str] = None, placeholder: Union[str, dict, TextObject, ForwardRef(None)] = None, initial_date: Optional[str] = None, confirm: Union[dict, ConfirmObject, ForwardRef(None)] = None, **others: dict) +(*, action_id: Optional[str] = None, placeholder: Union[str, dict, TextObject, ForwardRef(None)] = None, initial_date: Optional[str] = None, confirm: Union[dict, ConfirmObject, ForwardRef(None)] = None, focus_on_load: Optional[bool] = None, **others: dict)

    Block Elements are things that exists inside of your Blocks. @@ -2650,6 +2793,9 @@

    Args

    confirm
    A confirm object that defines an optional confirmation dialog that appears after a date is selected.
    +
    focus_on_load
    +
    Indicates whether the element will be set to auto focus within the view object. +Only one element can be set to true. Defaults to false.
    @@ -2669,6 +2815,7 @@

    Args

    placeholder: Optional[Union[str, dict, TextObject]] = None, initial_date: Optional[str] = None, confirm: Optional[Union[dict, ConfirmObject]] = None, + focus_on_load: Optional[bool] = None, **others: dict, ): """ @@ -2687,12 +2834,15 @@

    Args

    This should be in the format YYYY-MM-DD. confirm: A confirm object that defines an optional confirmation dialog that appears after a date is selected. + focus_on_load: Indicates whether the element will be set to auto focus within the view object. + Only one element can be set to true. Defaults to false. """ super().__init__( type=self.type, action_id=action_id, placeholder=TextObject.parse(placeholder, PlainTextObject.type), confirm=ConfirmObject.parse(confirm), + focus_on_load=focus_on_load, ) show_unknown_key_warning(self, others) @@ -2741,7 +2891,7 @@

    Inherited members

    class ExternalDataMultiSelectElement -(*, placeholder: Union[str, dict, TextObject, ForwardRef(None)] = None, action_id: Optional[str] = None, min_query_length: Optional[int] = None, initial_options: Optional[Sequence[Union[dict, Option]]] = None, confirm: Union[dict, ConfirmObject, ForwardRef(None)] = None, max_selected_items: Optional[int] = None, **others: dict) +(*, placeholder: Union[str, dict, TextObject, ForwardRef(None)] = None, action_id: Optional[str] = None, min_query_length: Optional[int] = None, initial_options: Optional[Sequence[Union[dict, Option]]] = None, confirm: Union[dict, ConfirmObject, ForwardRef(None)] = None, max_selected_items: Optional[int] = None, focus_on_load: Optional[bool] = None, **others: dict)

    Block Elements are things that exists inside of your Blocks. @@ -2774,6 +2924,9 @@

    Args

    max_selected_items
    Specifies the maximum number of items that can be selected in the menu. Minimum number is 1.
    +
    focus_on_load
    +
    Indicates whether the element will be set to auto focus within the view object. +Only one element can be set to true. Defaults to false.
    @@ -2797,6 +2950,7 @@

    Args

    initial_options: Optional[Sequence[Union[dict, Option]]] = None, confirm: Optional[Union[dict, ConfirmObject]] = None, max_selected_items: Optional[int] = None, + focus_on_load: Optional[bool] = None, **others: dict, ): """ @@ -2822,12 +2976,15 @@

    Args

    before the multi-select choices are submitted. max_selected_items: Specifies the maximum number of items that can be selected in the menu. Minimum number is 1. + focus_on_load: Indicates whether the element will be set to auto focus within the view object. + Only one element can be set to true. Defaults to false. """ super().__init__( type=self.type, action_id=action_id, placeholder=TextObject.parse(placeholder, PlainTextObject.type), confirm=ConfirmObject.parse(confirm), + focus_on_load=focus_on_load, ) show_unknown_key_warning(self, others) @@ -2868,7 +3025,7 @@

    Inherited members

    class ExternalDataSelectElement -(*, action_id: Optional[str] = None, placeholder: Union[str, TextObject, ForwardRef(None)] = None, initial_option: Union[Option, ForwardRef(None), OptionGroup] = None, min_query_length: Optional[int] = None, confirm: Union[dict, ConfirmObject, ForwardRef(None)] = None, **others: dict) +(*, action_id: Optional[str] = None, placeholder: Union[str, TextObject, ForwardRef(None)] = None, initial_option: Union[Option, ForwardRef(None), OptionGroup] = None, min_query_length: Optional[int] = None, confirm: Union[dict, ConfirmObject, ForwardRef(None)] = None, focus_on_load: Optional[bool] = None, **others: dict)

    Block Elements are things that exists inside of your Blocks. @@ -2899,6 +3056,9 @@

    Args

    confirm
    A confirm object that defines an optional confirmation dialog that appears after a menu item is selected.
    +
    focus_on_load
    +
    Indicates whether the element will be set to auto focus within the view object. +Only one element can be set to true. Defaults to false.
    @@ -2919,6 +3079,7 @@

    Args

    initial_option: Union[Optional[Option], Optional[OptionGroup]] = None, min_query_length: Optional[int] = None, confirm: Optional[Union[dict, ConfirmObject]] = None, + focus_on_load: Optional[bool] = None, **others: dict, ): """ @@ -2943,12 +3104,15 @@

    Args

    The default value is 3. confirm: A confirm object that defines an optional confirmation dialog that appears after a menu item is selected. + focus_on_load: Indicates whether the element will be set to auto focus within the view object. + Only one element can be set to true. Defaults to false. """ super().__init__( type=self.type, action_id=action_id, placeholder=TextObject.parse(placeholder, PlainTextObject.type), confirm=ConfirmObject.parse(confirm), + focus_on_load=focus_on_load, ) show_unknown_key_warning(self, others) @@ -3100,7 +3264,7 @@

    Inherited members

    class InputInteractiveElement -(*, action_id: Optional[str] = None, placeholder: Union[str, TextObject, ForwardRef(None)] = None, type: Optional[str] = None, subtype: Optional[str] = None, confirm: Union[dict, ConfirmObject, ForwardRef(None)] = None, **others: dict) +(*, action_id: Optional[str] = None, placeholder: Union[str, TextObject, ForwardRef(None)] = None, type: Optional[str] = None, subtype: Optional[str] = None, confirm: Union[dict, ConfirmObject, ForwardRef(None)] = None, focus_on_load: Optional[bool] = None, **others: dict)

    Block Elements are things that exists inside of your Blocks. @@ -3114,7 +3278,7 @@

    Inherited members

    class InputInteractiveElement(InteractiveElement, metaclass=ABCMeta):
         placeholder_max_length = 150
     
    -    attributes = {"type", "action_id", "placeholder", "confirm"}
    +    attributes = {"type", "action_id", "placeholder", "confirm", "focus_on_load"}
     
         @property
         def subtype(self) -> Optional[str]:
    @@ -3128,6 +3292,7 @@ 

    Inherited members

    type: Optional[str] = None, # skipcq: PYL-W0622 subtype: Optional[str] = None, confirm: Optional[Union[dict, ConfirmObject]] = None, + focus_on_load: Optional[bool] = None, **others: dict, ): """InteractiveElement that is usable in input blocks @@ -3144,6 +3309,7 @@

    Inherited members

    self.placeholder = TextObject.parse(placeholder) self.confirm = ConfirmObject.parse(confirm) + self.focus_on_load = focus_on_load @JsonValidator( f"placeholder attribute cannot exceed {placeholder_max_length} characters" @@ -3538,7 +3704,7 @@

    Inherited members

    class PlainTextInputElement -(*, action_id: Optional[str] = None, placeholder: Union[str, dict, TextObject, ForwardRef(None)] = None, initial_value: Optional[str] = None, multiline: Optional[bool] = None, min_length: Optional[int] = None, max_length: Optional[int] = None, dispatch_action_config: Union[dict, DispatchActionConfig, ForwardRef(None)] = None, **others: dict) +(*, action_id: Optional[str] = None, placeholder: Union[str, dict, TextObject, ForwardRef(None)] = None, initial_value: Optional[str] = None, multiline: Optional[bool] = None, min_length: Optional[int] = None, max_length: Optional[int] = None, dispatch_action_config: Union[dict, DispatchActionConfig, ForwardRef(None)] = None, focus_on_load: Optional[bool] = None, **others: dict)

    Block Elements are things that exists inside of your Blocks. @@ -3572,6 +3738,9 @@

    Args

    dispatch_action_config
    A dispatch configuration object that determines when during text input the element returns a block_actions payload.
    +
    focus_on_load
    +
    Indicates whether the element will be set to auto focus within the view object. +Only one element can be set to true. Defaults to false.
    @@ -3602,6 +3771,7 @@

    Args

    min_length: Optional[int] = None, max_length: Optional[int] = None, dispatch_action_config: Optional[Union[dict, DispatchActionConfig]] = None, + focus_on_load: Optional[bool] = None, **others: dict, ): """ @@ -3627,11 +3797,14 @@

    Args

    they will receive an error. dispatch_action_config: A dispatch configuration object that determines when during text input the element returns a block_actions payload. + focus_on_load: Indicates whether the element will be set to auto focus within the view object. + Only one element can be set to true. Defaults to false. """ super().__init__( type=self.type, action_id=action_id, placeholder=TextObject.parse(placeholder, PlainTextObject.type), + focus_on_load=focus_on_load, ) show_unknown_key_warning(self, others) @@ -3674,7 +3847,7 @@

    Inherited members

    class RadioButtonsElement -(*, action_id: Optional[str] = None, options: Optional[Sequence[Union[dict, Option]]] = None, initial_option: Union[dict, Option, ForwardRef(None)] = None, confirm: Union[dict, ConfirmObject, ForwardRef(None)] = None, **others: dict) +(*, action_id: Optional[str] = None, options: Optional[Sequence[Union[dict, Option]]] = None, initial_option: Union[dict, Option, ForwardRef(None)] = None, confirm: Union[dict, ConfirmObject, ForwardRef(None)] = None, focus_on_load: Optional[bool] = None, **others: dict)

    Block Elements are things that exists inside of your Blocks. @@ -3696,6 +3869,9 @@

    Args

    confirm
    A confirm object that defines an optional confirmation dialog that appears after clicking one of the radio buttons in this element.
    +
    focus_on_load
    +
    Indicates whether the element will be set to auto focus within the view object. +Only one element can be set to true. Defaults to false.
    @@ -3715,6 +3891,7 @@

    Args

    options: Optional[Sequence[Union[dict, Option]]] = None, initial_option: Optional[Union[dict, Option]] = None, confirm: Optional[Union[dict, ConfirmObject]] = None, + focus_on_load: Optional[bool] = None, **others: dict, ): """A radio button group that allows a user to choose one item from a list of possible options. @@ -3730,11 +3907,14 @@

    Args

    This option will be selected when the radio button group initially loads. confirm: A confirm object that defines an optional confirmation dialog that appears after clicking one of the radio buttons in this element. + focus_on_load: Indicates whether the element will be set to auto focus within the view object. + Only one element can be set to true. Defaults to false. """ super().__init__( type=self.type, action_id=action_id, confirm=ConfirmObject.parse(confirm), + focus_on_load=focus_on_load, ) show_unknown_key_warning(self, others) @@ -3774,7 +3954,7 @@

    Inherited members

    class SelectElement -(*, action_id: Optional[str] = None, placeholder: Optional[str] = None, options: Optional[Sequence[Option]] = None, option_groups: Optional[Sequence[OptionGroup]] = None, initial_option: Optional[Option] = None, confirm: Union[dict, ConfirmObject, ForwardRef(None)] = None, **others: dict) +(*, action_id: Optional[str] = None, placeholder: Optional[str] = None, options: Optional[Sequence[Option]] = None, option_groups: Optional[Sequence[OptionGroup]] = None, initial_option: Optional[Option] = None, confirm: Union[dict, ConfirmObject, ForwardRef(None)] = None, focus_on_load: Optional[bool] = None, **others: dict)

    Block Elements are things that exists inside of your Blocks. @@ -3805,6 +3985,9 @@

    Args

    confirm
    A confirm object that defines an optional confirmation dialog that appears after a menu item is selected.
    +
    focus_on_load
    +
    Indicates whether the element will be set to auto focus within the view object. +Only one element can be set to true. Defaults to false.
    @@ -3828,6 +4011,7 @@

    Args

    option_groups: Optional[Sequence[OptionGroup]] = None, initial_option: Optional[Option] = None, confirm: Optional[Union[dict, ConfirmObject]] = None, + focus_on_load: Optional[bool] = None, **others: dict, ): """This is the simplest form of select menu, with a static list of options passed in when defining the element. @@ -3850,12 +4034,15 @@

    Args

    This option will be selected when the menu initially loads. confirm: A confirm object that defines an optional confirmation dialog that appears after a menu item is selected. + focus_on_load: Indicates whether the element will be set to auto focus within the view object. + Only one element can be set to true. Defaults to false. """ super().__init__( type=self.type, action_id=action_id, placeholder=TextObject.parse(placeholder, PlainTextObject.type), confirm=ConfirmObject.parse(confirm), + focus_on_load=focus_on_load, ) show_unknown_key_warning(self, others) @@ -3925,7 +4112,7 @@

    Inherited members

    class StaticMultiSelectElement -(*, placeholder: Union[str, dict, TextObject, ForwardRef(None)] = None, action_id: Optional[str] = None, options: Optional[Sequence[Option]] = None, option_groups: Optional[Sequence[OptionGroup]] = None, initial_options: Optional[Sequence[Option]] = None, confirm: Union[dict, ConfirmObject, ForwardRef(None)] = None, max_selected_items: Optional[int] = None, **others: dict) +(*, placeholder: Union[str, dict, TextObject, ForwardRef(None)] = None, action_id: Optional[str] = None, options: Optional[Sequence[Option]] = None, option_groups: Optional[Sequence[OptionGroup]] = None, initial_options: Optional[Sequence[Option]] = None, confirm: Union[dict, ConfirmObject, ForwardRef(None)] = None, max_selected_items: Optional[int] = None, focus_on_load: Optional[bool] = None, **others: dict)

    Block Elements are things that exists inside of your Blocks. @@ -3959,6 +4146,9 @@

    Args

    max_selected_items
    Specifies the maximum number of items that can be selected in the menu. Minimum number is 1.
    +
    focus_on_load
    +
    Indicates whether the element will be set to auto focus within the view object. +Only one element can be set to true. Defaults to false.
    @@ -3985,6 +4175,7 @@

    Args

    initial_options: Optional[Sequence[Option]] = None, confirm: Optional[Union[dict, ConfirmObject]] = None, max_selected_items: Optional[int] = None, + focus_on_load: Optional[bool] = None, **others: dict, ): """ @@ -4010,12 +4201,15 @@

    Args

    that appears before the multi-select choices are submitted. max_selected_items: Specifies the maximum number of items that can be selected in the menu. Minimum number is 1. + focus_on_load: Indicates whether the element will be set to auto focus within the view object. + Only one element can be set to true. Defaults to false. """ super().__init__( type=self.type, action_id=action_id, placeholder=TextObject.parse(placeholder, PlainTextObject.type), confirm=ConfirmObject.parse(confirm), + focus_on_load=focus_on_load, ) show_unknown_key_warning(self, others) @@ -4086,7 +4280,7 @@

    Inherited members

    class StaticSelectElement -(*, placeholder: Union[str, dict, TextObject, ForwardRef(None)] = None, action_id: Optional[str] = None, options: Optional[Sequence[Union[dict, Option]]] = None, option_groups: Optional[Sequence[Union[dict, OptionGroup]]] = None, initial_option: Union[dict, Option, ForwardRef(None)] = None, confirm: Union[dict, ConfirmObject, ForwardRef(None)] = None, **others: dict) +(*, placeholder: Union[str, dict, TextObject, ForwardRef(None)] = None, action_id: Optional[str] = None, options: Optional[Sequence[Union[dict, Option]]] = None, option_groups: Optional[Sequence[Union[dict, OptionGroup]]] = None, initial_option: Union[dict, Option, ForwardRef(None)] = None, confirm: Union[dict, ConfirmObject, ForwardRef(None)] = None, focus_on_load: Optional[bool] = None, **others: dict)

    Block Elements are things that exists inside of your Blocks. @@ -4117,6 +4311,9 @@

    Args

    confirm
    A confirm object that defines an optional confirmation dialog that appears after a menu item is selected.
    +
    focus_on_load
    +
    Indicates whether the element will be set to auto focus within the view object. +Only one element can be set to true. Defaults to false.
    @@ -4140,6 +4337,7 @@

    Args

    option_groups: Optional[Sequence[Union[dict, OptionGroup]]] = None, initial_option: Optional[Union[dict, Option]] = None, confirm: Optional[Union[dict, ConfirmObject]] = None, + focus_on_load: Optional[bool] = None, **others: dict, ): """This is the simplest form of select menu, with a static list of options passed in when defining the element. @@ -4162,12 +4360,15 @@

    Args

    This option will be selected when the menu initially loads. confirm: A confirm object that defines an optional confirmation dialog that appears after a menu item is selected. + focus_on_load: Indicates whether the element will be set to auto focus within the view object. + Only one element can be set to true. Defaults to false. """ super().__init__( type=self.type, action_id=action_id, placeholder=TextObject.parse(placeholder, PlainTextObject.type), confirm=ConfirmObject.parse(confirm), + focus_on_load=focus_on_load, ) show_unknown_key_warning(self, others) @@ -4237,7 +4438,7 @@

    Inherited members

    class TimePickerElement -(*, action_id: Optional[str] = None, placeholder: Union[str, dict, TextObject, ForwardRef(None)] = None, initial_time: Optional[str] = None, confirm: Union[dict, ConfirmObject, ForwardRef(None)] = None, **others: dict) +(*, action_id: Optional[str] = None, placeholder: Union[str, dict, TextObject, ForwardRef(None)] = None, initial_time: Optional[str] = None, confirm: Union[dict, ConfirmObject, ForwardRef(None)] = None, focus_on_load: Optional[bool] = None, **others: dict)

    Block Elements are things that exists inside of your Blocks. @@ -4264,6 +4465,9 @@

    Args

    confirm
    A confirm object that defines an optional confirmation dialog that appears after a time is selected.
    +
    focus_on_load
    +
    Indicates whether the element will be set to auto focus within the view object. +Only one element can be set to true. Defaults to false.
    @@ -4283,6 +4487,7 @@

    Args

    placeholder: Optional[Union[str, dict, TextObject]] = None, initial_time: Optional[str] = None, confirm: Optional[Union[dict, ConfirmObject]] = None, + focus_on_load: Optional[bool] = None, **others: dict, ): """ @@ -4304,12 +4509,15 @@

    Args

    and mm is minutes with leading zeros (00 to 59), for example 22:25 for 10:25pm. confirm: A confirm object that defines an optional confirmation dialog that appears after a time is selected. + focus_on_load: Indicates whether the element will be set to auto focus within the view object. + Only one element can be set to true. Defaults to false. """ super().__init__( type=self.type, action_id=action_id, placeholder=TextObject.parse(placeholder, PlainTextObject.type), confirm=ConfirmObject.parse(confirm), + focus_on_load=focus_on_load, ) show_unknown_key_warning(self, others) @@ -4356,7 +4564,7 @@

    Inherited members

    class UserMultiSelectElement -(*, action_id: Optional[str] = None, placeholder: Union[str, dict, TextObject, ForwardRef(None)] = None, initial_users: Optional[Sequence[str]] = None, confirm: Union[dict, ConfirmObject, ForwardRef(None)] = None, max_selected_items: Optional[int] = None, **others: dict) +(*, action_id: Optional[str] = None, placeholder: Union[str, dict, TextObject, ForwardRef(None)] = None, initial_users: Optional[Sequence[str]] = None, confirm: Union[dict, ConfirmObject, ForwardRef(None)] = None, max_selected_items: Optional[int] = None, focus_on_load: Optional[bool] = None, **others: dict)

    Block Elements are things that exists inside of your Blocks. @@ -4382,6 +4590,9 @@

    Args

    max_selected_items
    Specifies the maximum number of items that can be selected in the menu. Minimum number is 1.
    +
    focus_on_load
    +
    Indicates whether the element will be set to auto focus within the view object. +Only one element can be set to true. Defaults to false.
    @@ -4402,6 +4613,7 @@

    Args

    initial_users: Optional[Sequence[str]] = None, confirm: Optional[Union[dict, ConfirmObject]] = None, max_selected_items: Optional[int] = None, + focus_on_load: Optional[bool] = None, **others: dict, ): """ @@ -4421,12 +4633,15 @@

    Args

    before the multi-select choices are submitted. max_selected_items: Specifies the maximum number of items that can be selected in the menu. Minimum number is 1. + focus_on_load: Indicates whether the element will be set to auto focus within the view object. + Only one element can be set to true. Defaults to false. """ super().__init__( type=self.type, action_id=action_id, placeholder=TextObject.parse(placeholder, PlainTextObject.type), confirm=ConfirmObject.parse(confirm), + focus_on_load=focus_on_load, ) show_unknown_key_warning(self, others) @@ -4466,7 +4681,7 @@

    Inherited members

    class UserSelectElement -(*, placeholder: Union[str, dict, TextObject, ForwardRef(None)] = None, action_id: Optional[str] = None, initial_user: Optional[str] = None, confirm: Union[dict, ConfirmObject, ForwardRef(None)] = None, **others: dict) +(*, placeholder: Union[str, dict, TextObject, ForwardRef(None)] = None, action_id: Optional[str] = None, initial_user: Optional[str] = None, confirm: Union[dict, ConfirmObject, ForwardRef(None)] = None, focus_on_load: Optional[bool] = None, **others: dict)

    Block Elements are things that exists inside of your Blocks. @@ -4489,6 +4704,9 @@

    Args

    confirm
    A confirm object that defines an optional confirmation dialog that appears after a menu item is selected.
    +
    focus_on_load
    +
    Indicates whether the element will be set to auto focus within the view object. +Only one element can be set to true. Defaults to false.
    @@ -4508,6 +4726,7 @@

    Args

    action_id: Optional[str] = None, initial_user: Optional[str] = None, confirm: Optional[Union[dict, ConfirmObject]] = None, + focus_on_load: Optional[bool] = None, **others: dict, ): """ @@ -4525,12 +4744,15 @@

    Args

    initial_user: The user ID of any valid user to be pre-selected when the menu loads. confirm: A confirm object that defines an optional confirmation dialog that appears after a menu item is selected. + focus_on_load: Indicates whether the element will be set to auto focus within the view object. + Only one element can be set to true. Defaults to false. """ super().__init__( type=self.type, action_id=action_id, placeholder=TextObject.parse(placeholder, PlainTextObject.type), confirm=ConfirmObject.parse(confirm), + focus_on_load=focus_on_load, ) show_unknown_key_warning(self, others) diff --git a/docs/api-docs/slack_sdk/oauth/installation_store/file/index.html b/docs/api-docs/slack_sdk/oauth/installation_store/file/index.html index 3560bd5c8..b0c0f6e9c 100644 --- a/docs/api-docs/slack_sdk/oauth/installation_store/file/index.html +++ b/docs/api-docs/slack_sdk/oauth/installation_store/file/index.html @@ -275,7 +275,7 @@

    Classes

    class FileInstallationStore -(*, base_dir: str = '/Users/ksera/.bolt-app-installation', historical_data_enabled: bool = True, client_id: Optional[str] = None, logger: logging.Logger = <Logger slack_sdk.oauth.installation_store.file (WARNING)>) +(*, base_dir: str = '/Users/kazuhiro.sera/.bolt-app-installation', historical_data_enabled: bool = True, client_id: Optional[str] = None, logger: logging.Logger = <Logger slack_sdk.oauth.installation_store.file (WARNING)>)

    The installation store interface.

    diff --git a/docs/api-docs/slack_sdk/oauth/state_store/file/index.html b/docs/api-docs/slack_sdk/oauth/state_store/file/index.html index 571114e67..416e6d781 100644 --- a/docs/api-docs/slack_sdk/oauth/state_store/file/index.html +++ b/docs/api-docs/slack_sdk/oauth/state_store/file/index.html @@ -110,7 +110,7 @@

    Classes

    class FileOAuthStateStore -(*, expiration_seconds: int, base_dir: str = '/Users/ksera/.bolt-app-oauth-state', client_id: Optional[str] = None, logger: logging.Logger = <Logger slack_sdk.oauth.state_store.file (WARNING)>) +(*, expiration_seconds: int, base_dir: str = '/Users/kazuhiro.sera/.bolt-app-oauth-state', client_id: Optional[str] = None, logger: logging.Logger = <Logger slack_sdk.oauth.state_store.file (WARNING)>)
    diff --git a/docs/api-docs/slack_sdk/rtm/index.html b/docs/api-docs/slack_sdk/rtm/index.html index 5d1a08373..71c8eda23 100644 --- a/docs/api-docs/slack_sdk/rtm/index.html +++ b/docs/api-docs/slack_sdk/rtm/index.html @@ -603,7 +603,7 @@

    Module slack_sdk.rtm

    if hasattr(exception, "response"): wait_time = exception.response.get("headers", {}).get( "Retry-After", - min((2 ** self._connection_attempts) + random.random(), max_wait_time), + min((2**self._connection_attempts) + random.random(), max_wait_time), ) self._logger.debug("Waiting %s seconds before reconnecting.", wait_time) await asyncio.sleep(float(wait_time)) @@ -1282,7 +1282,7 @@

    Note

    if hasattr(exception, "response"): wait_time = exception.response.get("headers", {}).get( "Retry-After", - min((2 ** self._connection_attempts) + random.random(), max_wait_time), + min((2**self._connection_attempts) + random.random(), max_wait_time), ) self._logger.debug("Waiting %s seconds before reconnecting.", wait_time) await asyncio.sleep(float(wait_time)) diff --git a/docs/api-docs/slack_sdk/scim/v1/client.html b/docs/api-docs/slack_sdk/scim/v1/client.html index 84ab5f885..6ef3d0bf2 100644 --- a/docs/api-docs/slack_sdk/scim/v1/client.html +++ b/docs/api-docs/slack_sdk/scim/v1/client.html @@ -365,11 +365,13 @@

    Module slack_sdk.scim.v1.client

    # read the response body here charset = e.headers.get_content_charset() or "utf-8" response_body: str = e.read().decode(charset) + # As adding new values to HTTPError#headers can be ignored, building a new dict object here + response_headers = dict(e.headers.items()) resp = SCIMResponse( url=url, status_code=e.code, raw_body=response_body, - headers=dict(e.headers.items()), + headers=response_headers, ) if e.code == 429: # for backward-compatibility with WebClient (v.2.5.0 or older) @@ -816,11 +818,13 @@

    Args

    # read the response body here charset = e.headers.get_content_charset() or "utf-8" response_body: str = e.read().decode(charset) + # As adding new values to HTTPError#headers can be ignored, building a new dict object here + response_headers = dict(e.headers.items()) resp = SCIMResponse( url=url, status_code=e.code, raw_body=response_body, - headers=dict(e.headers.items()), + headers=response_headers, ) if e.code == 429: # for backward-compatibility with WebClient (v.2.5.0 or older) diff --git a/docs/api-docs/slack_sdk/socket_mode/async_client.html b/docs/api-docs/slack_sdk/socket_mode/async_client.html index a72ac04eb..3c9b0dbd4 100644 --- a/docs/api-docs/slack_sdk/socket_mode/async_client.html +++ b/docs/api-docs/slack_sdk/socket_mode/async_client.html @@ -150,6 +150,11 @@

    Module slack_sdk.socket_mode.async_client

    while not self.closed: try: await self.process_message() + except asyncio.CancelledError: + # if self.closed is True, the connection is already closed + # In this case, we can ignore the exception here + if not self.closed: + raise except Exception as e: self.logger.exception( f"Failed to process a message: {e}, session: {session_id}" @@ -339,6 +344,11 @@

    Classes

    while not self.closed: try: await self.process_message() + except asyncio.CancelledError: + # if self.closed is True, the connection is already closed + # In this case, we can ignore the exception here + if not self.closed: + raise except Exception as e: self.logger.exception( f"Failed to process a message: {e}, session: {session_id}" @@ -622,6 +632,11 @@

    Methods

    while not self.closed: try: await self.process_message() + except asyncio.CancelledError: + # if self.closed is True, the connection is already closed + # In this case, we can ignore the exception here + if not self.closed: + raise except Exception as e: self.logger.exception( f"Failed to process a message: {e}, session: {session_id}" diff --git a/docs/api-docs/slack_sdk/socket_mode/builtin/internals.html b/docs/api-docs/slack_sdk/socket_mode/builtin/internals.html index b9ba0d9ac..05fd5c75d 100644 --- a/docs/api-docs/slack_sdk/socket_mode/builtin/internals.html +++ b/docs/api-docs/slack_sdk/socket_mode/builtin/internals.html @@ -40,7 +40,7 @@

    Module slack_sdk.socket_mode.builtin.internalsModule slack_sdk.socket_mode.builtin.internalsModule slack_sdk.version

    Expand source code
    """Check the latest version at https://pypi.org/project/slack-sdk/"""
    -__version__ = "3.12.0"
    +__version__ = "3.14.0"
    diff --git a/docs/api-docs/slack_sdk/web/async_client.html b/docs/api-docs/slack_sdk/web/async_client.html index dc292014a..3a1202f9b 100644 --- a/docs/api-docs/slack_sdk/web/async_client.html +++ b/docs/api-docs/slack_sdk/web/async_client.html @@ -206,6 +206,28 @@

    Module slack_sdk.web.async_client

    "admin.apps.clearResolution", http_verb="POST", params=kwargs ) + async def admin_apps_requests_cancel( + self, + *, + request_id: str, + enterprise_id: Optional[str] = None, + team_id: Optional[str] = None, + **kwargs, + ) -> AsyncSlackResponse: + """List app requests for a team/workspace. + https://api.slack.com/methods/admin.apps.requests.cancel + """ + kwargs.update( + { + "request_id": request_id, + "enterprise_id": enterprise_id, + "team_id": team_id, + } + ) + return await self.api_call( + "admin.apps.requests.cancel", http_verb="POST", params=kwargs + ) + async def admin_apps_requests_list( self, *, @@ -4631,6 +4653,28 @@

    Note

    "admin.apps.clearResolution", http_verb="POST", params=kwargs ) + async def admin_apps_requests_cancel( + self, + *, + request_id: str, + enterprise_id: Optional[str] = None, + team_id: Optional[str] = None, + **kwargs, + ) -> AsyncSlackResponse: + """List app requests for a team/workspace. + https://api.slack.com/methods/admin.apps.requests.cancel + """ + kwargs.update( + { + "request_id": request_id, + "enterprise_id": enterprise_id, + "team_id": team_id, + } + ) + return await self.api_call( + "admin.apps.requests.cancel", http_verb="POST", params=kwargs + ) + async def admin_apps_requests_list( self, *, @@ -8988,6 +9032,39 @@

    Methods

    )
    +
    +async def admin_apps_requests_cancel(self, *, request_id: str, enterprise_id: Optional[str] = None, team_id: Optional[str] = None, **kwargs) ‑> AsyncSlackResponse +
    +
    +

    List app requests for a team/workspace. +https://api.slack.com/methods/admin.apps.requests.cancel

    +
    + +Expand source code + +
    async def admin_apps_requests_cancel(
    +    self,
    +    *,
    +    request_id: str,
    +    enterprise_id: Optional[str] = None,
    +    team_id: Optional[str] = None,
    +    **kwargs,
    +) -> AsyncSlackResponse:
    +    """List app requests for a team/workspace.
    +    https://api.slack.com/methods/admin.apps.requests.cancel
    +    """
    +    kwargs.update(
    +        {
    +            "request_id": request_id,
    +            "enterprise_id": enterprise_id,
    +            "team_id": team_id,
    +        }
    +    )
    +    return await self.api_call(
    +        "admin.apps.requests.cancel", http_verb="POST", params=kwargs
    +    )
    +
    +
    async def admin_apps_requests_list(self, *, cursor: Optional[str] = None, limit: Optional[int] = None, team_id: Optional[str] = None, **kwargs) ‑> AsyncSlackResponse
    @@ -15787,6 +15864,7 @@

    admin_apps_approve
  • admin_apps_approved_list
  • admin_apps_clearResolution
  • +
  • admin_apps_requests_cancel
  • admin_apps_requests_list
  • admin_apps_restrict
  • admin_apps_restricted_list
  • diff --git a/docs/api-docs/slack_sdk/web/base_client.html b/docs/api-docs/slack_sdk/web/base_client.html index b97e9a62d..11ba08903 100644 --- a/docs/api-docs/slack_sdk/web/base_client.html +++ b/docs/api-docs/slack_sdk/web/base_client.html @@ -443,19 +443,25 @@

    Module slack_sdk.web.base_client

    return resp except HTTPError as e: - resp = {"status": e.code, "headers": e.headers} + # As adding new values to HTTPError#headers can be ignored, building a new dict object here + response_headers = dict(e.headers.items()) + resp = {"status": e.code, "headers": response_headers} if e.code == 429: # for compatibility with aiohttp if ( - "retry-after" not in resp["headers"] - and "Retry-After" in resp["headers"] + "retry-after" not in response_headers + and "Retry-After" in response_headers ): - resp["headers"]["retry-after"] = resp["headers"]["Retry-After"] + response_headers["retry-after"] = response_headers[ + "Retry-After" + ] if ( - "Retry-After" not in resp["headers"] - and "retry-after" in resp["headers"] + "Retry-After" not in response_headers + and "retry-after" in response_headers ): - resp["headers"]["Retry-After"] = resp["headers"]["retry-after"] + response_headers["Retry-After"] = response_headers[ + "retry-after" + ] # read the response body here charset = e.headers.get_content_charset() or "utf-8" @@ -466,7 +472,7 @@

    Module slack_sdk.web.base_client

    retry_request = RetryHttpRequest.from_urllib_http_request(req) retry_response = RetryHttpResponse( status_code=e.code, - headers={k: [v] for k, v in e.headers.items()}, + headers={k: [v] for k, v in response_headers.items()}, data=response_body.encode("utf-8") if response_body is not None else None, @@ -1035,19 +1041,25 @@

    Classes

    return resp except HTTPError as e: - resp = {"status": e.code, "headers": e.headers} + # As adding new values to HTTPError#headers can be ignored, building a new dict object here + response_headers = dict(e.headers.items()) + resp = {"status": e.code, "headers": response_headers} if e.code == 429: # for compatibility with aiohttp if ( - "retry-after" not in resp["headers"] - and "Retry-After" in resp["headers"] + "retry-after" not in response_headers + and "Retry-After" in response_headers ): - resp["headers"]["retry-after"] = resp["headers"]["Retry-After"] + response_headers["retry-after"] = response_headers[ + "Retry-After" + ] if ( - "Retry-After" not in resp["headers"] - and "retry-after" in resp["headers"] + "Retry-After" not in response_headers + and "retry-after" in response_headers ): - resp["headers"]["Retry-After"] = resp["headers"]["retry-after"] + response_headers["Retry-After"] = response_headers[ + "retry-after" + ] # read the response body here charset = e.headers.get_content_charset() or "utf-8" @@ -1058,7 +1070,7 @@

    Classes

    retry_request = RetryHttpRequest.from_urllib_http_request(req) retry_response = RetryHttpResponse( status_code=e.code, - headers={k: [v] for k, v in e.headers.items()}, + headers={k: [v] for k, v in response_headers.items()}, data=response_body.encode("utf-8") if response_body is not None else None, diff --git a/docs/api-docs/slack_sdk/web/client.html b/docs/api-docs/slack_sdk/web/client.html index 7a06ced06..8ee5780af 100644 --- a/docs/api-docs/slack_sdk/web/client.html +++ b/docs/api-docs/slack_sdk/web/client.html @@ -195,6 +195,28 @@

    Module slack_sdk.web.client

    "admin.apps.clearResolution", http_verb="POST", params=kwargs ) + def admin_apps_requests_cancel( + self, + *, + request_id: str, + enterprise_id: Optional[str] = None, + team_id: Optional[str] = None, + **kwargs, + ) -> SlackResponse: + """List app requests for a team/workspace. + https://api.slack.com/methods/admin.apps.requests.cancel + """ + kwargs.update( + { + "request_id": request_id, + "enterprise_id": enterprise_id, + "team_id": team_id, + } + ) + return self.api_call( + "admin.apps.requests.cancel", http_verb="POST", params=kwargs + ) + def admin_apps_requests_list( self, *, @@ -4560,6 +4582,28 @@

    Note

    "admin.apps.clearResolution", http_verb="POST", params=kwargs ) + def admin_apps_requests_cancel( + self, + *, + request_id: str, + enterprise_id: Optional[str] = None, + team_id: Optional[str] = None, + **kwargs, + ) -> SlackResponse: + """List app requests for a team/workspace. + https://api.slack.com/methods/admin.apps.requests.cancel + """ + kwargs.update( + { + "request_id": request_id, + "enterprise_id": enterprise_id, + "team_id": team_id, + } + ) + return self.api_call( + "admin.apps.requests.cancel", http_verb="POST", params=kwargs + ) + def admin_apps_requests_list( self, *, @@ -8857,6 +8901,39 @@

    Methods

    )
    +
    +def admin_apps_requests_cancel(self, *, request_id: str, enterprise_id: Optional[str] = None, team_id: Optional[str] = None, **kwargs) ‑> SlackResponse +
    +
    +

    List app requests for a team/workspace. +https://api.slack.com/methods/admin.apps.requests.cancel

    +
    + +Expand source code + +
    def admin_apps_requests_cancel(
    +    self,
    +    *,
    +    request_id: str,
    +    enterprise_id: Optional[str] = None,
    +    team_id: Optional[str] = None,
    +    **kwargs,
    +) -> SlackResponse:
    +    """List app requests for a team/workspace.
    +    https://api.slack.com/methods/admin.apps.requests.cancel
    +    """
    +    kwargs.update(
    +        {
    +            "request_id": request_id,
    +            "enterprise_id": enterprise_id,
    +            "team_id": team_id,
    +        }
    +    )
    +    return self.api_call(
    +        "admin.apps.requests.cancel", http_verb="POST", params=kwargs
    +    )
    +
    +
    def admin_apps_requests_list(self, *, cursor: Optional[str] = None, limit: Optional[int] = None, team_id: Optional[str] = None, **kwargs) ‑> SlackResponse
    @@ -15599,6 +15676,7 @@

    admin_apps_approve
  • admin_apps_approved_list
  • admin_apps_clearResolution
  • +
  • admin_apps_requests_cancel
  • admin_apps_requests_list
  • admin_apps_restrict
  • admin_apps_restricted_list
  • diff --git a/docs/api-docs/slack_sdk/web/legacy_base_client.html b/docs/api-docs/slack_sdk/web/legacy_base_client.html index 75507d7fb..5aef0a8b4 100644 --- a/docs/api-docs/slack_sdk/web/legacy_base_client.html +++ b/docs/api-docs/slack_sdk/web/legacy_base_client.html @@ -537,19 +537,21 @@

    Module slack_sdk.web.legacy_base_client

    return {"status": resp.code, "headers": resp.headers, "body": body} raise SlackRequestError(f"Invalid URL detected: {url}") except HTTPError as e: - resp = {"status": e.code, "headers": e.headers} + # As adding new values to HTTPError#headers can be ignored, building a new dict object here + response_headers = dict(e.headers.items()) + resp = {"status": e.code, "headers": response_headers} if e.code == 429: # for compatibility with aiohttp if ( - "retry-after" not in resp["headers"] - and "Retry-After" in resp["headers"] + "retry-after" not in response_headers + and "Retry-After" in response_headers ): - resp["headers"]["retry-after"] = resp["headers"]["Retry-After"] + response_headers["retry-after"] = response_headers["Retry-After"] if ( - "Retry-After" not in resp["headers"] - and "retry-after" in resp["headers"] + "Retry-After" not in response_headers + and "retry-after" in response_headers ): - resp["headers"]["Retry-After"] = resp["headers"]["retry-after"] + response_headers["Retry-After"] = response_headers["retry-after"] # read the response body here charset = e.headers.get_content_charset() or "utf-8" @@ -1103,19 +1105,21 @@

    Classes

    return {"status": resp.code, "headers": resp.headers, "body": body} raise SlackRequestError(f"Invalid URL detected: {url}") except HTTPError as e: - resp = {"status": e.code, "headers": e.headers} + # As adding new values to HTTPError#headers can be ignored, building a new dict object here + response_headers = dict(e.headers.items()) + resp = {"status": e.code, "headers": response_headers} if e.code == 429: # for compatibility with aiohttp if ( - "retry-after" not in resp["headers"] - and "Retry-After" in resp["headers"] + "retry-after" not in response_headers + and "Retry-After" in response_headers ): - resp["headers"]["retry-after"] = resp["headers"]["Retry-After"] + response_headers["retry-after"] = response_headers["Retry-After"] if ( - "Retry-After" not in resp["headers"] - and "retry-after" in resp["headers"] + "Retry-After" not in response_headers + and "retry-after" in response_headers ): - resp["headers"]["Retry-After"] = resp["headers"]["retry-after"] + response_headers["Retry-After"] = response_headers["retry-after"] # read the response body here charset = e.headers.get_content_charset() or "utf-8" diff --git a/docs/api-docs/slack_sdk/web/legacy_client.html b/docs/api-docs/slack_sdk/web/legacy_client.html index 81177c44d..52c962d5c 100644 --- a/docs/api-docs/slack_sdk/web/legacy_client.html +++ b/docs/api-docs/slack_sdk/web/legacy_client.html @@ -205,6 +205,28 @@

    Module slack_sdk.web.legacy_client

    "admin.apps.clearResolution", http_verb="POST", params=kwargs ) + def admin_apps_requests_cancel( + self, + *, + request_id: str, + enterprise_id: Optional[str] = None, + team_id: Optional[str] = None, + **kwargs, + ) -> Union[Future, SlackResponse]: + """List app requests for a team/workspace. + https://api.slack.com/methods/admin.apps.requests.cancel + """ + kwargs.update( + { + "request_id": request_id, + "enterprise_id": enterprise_id, + "team_id": team_id, + } + ) + return self.api_call( + "admin.apps.requests.cancel", http_verb="POST", params=kwargs + ) + def admin_apps_requests_list( self, *, @@ -4570,6 +4592,28 @@

    Note

    "admin.apps.clearResolution", http_verb="POST", params=kwargs ) + def admin_apps_requests_cancel( + self, + *, + request_id: str, + enterprise_id: Optional[str] = None, + team_id: Optional[str] = None, + **kwargs, + ) -> Union[Future, SlackResponse]: + """List app requests for a team/workspace. + https://api.slack.com/methods/admin.apps.requests.cancel + """ + kwargs.update( + { + "request_id": request_id, + "enterprise_id": enterprise_id, + "team_id": team_id, + } + ) + return self.api_call( + "admin.apps.requests.cancel", http_verb="POST", params=kwargs + ) + def admin_apps_requests_list( self, *, @@ -8867,6 +8911,39 @@

    Methods

    )
    +
    +def admin_apps_requests_cancel(self, *, request_id: str, enterprise_id: Optional[str] = None, team_id: Optional[str] = None, **kwargs) ‑> Union[_asyncio.Future, LegacySlackResponse] +
    +
    +

    List app requests for a team/workspace. +https://api.slack.com/methods/admin.apps.requests.cancel

    +
    + +Expand source code + +
    def admin_apps_requests_cancel(
    +    self,
    +    *,
    +    request_id: str,
    +    enterprise_id: Optional[str] = None,
    +    team_id: Optional[str] = None,
    +    **kwargs,
    +) -> Union[Future, SlackResponse]:
    +    """List app requests for a team/workspace.
    +    https://api.slack.com/methods/admin.apps.requests.cancel
    +    """
    +    kwargs.update(
    +        {
    +            "request_id": request_id,
    +            "enterprise_id": enterprise_id,
    +            "team_id": team_id,
    +        }
    +    )
    +    return self.api_call(
    +        "admin.apps.requests.cancel", http_verb="POST", params=kwargs
    +    )
    +
    +
    def admin_apps_requests_list(self, *, cursor: Optional[str] = None, limit: Optional[int] = None, team_id: Optional[str] = None, **kwargs) ‑> Union[_asyncio.Future, LegacySlackResponse]
    @@ -15609,6 +15686,7 @@

    admin_apps_approve
  • admin_apps_approved_list
  • admin_apps_clearResolution
  • +
  • admin_apps_requests_cancel
  • admin_apps_requests_list
  • admin_apps_restrict
  • admin_apps_restricted_list
  • diff --git a/docs/api-docs/slack_sdk/webhook/client.html b/docs/api-docs/slack_sdk/webhook/client.html index 7960bad58..d1fdf2dc8 100644 --- a/docs/api-docs/slack_sdk/webhook/client.html +++ b/docs/api-docs/slack_sdk/webhook/client.html @@ -206,11 +206,13 @@

    Module slack_sdk.webhook.client

    # read the response body here charset = e.headers.get_content_charset() or "utf-8" response_body: str = e.read().decode(charset) + # As adding new values to HTTPError#headers can be ignored, building a new dict object here + response_headers = dict(e.headers.items()) resp = WebhookResponse( url=url, status_code=e.code, body=response_body, - headers=dict(e.headers.items()), + headers=response_headers, ) if e.code == 429: # for backward-compatibility with WebClient (v.2.5.0 or older) @@ -525,11 +527,13 @@

    Args

    # read the response body here charset = e.headers.get_content_charset() or "utf-8" response_body: str = e.read().decode(charset) + # As adding new values to HTTPError#headers can be ignored, building a new dict object here + response_headers = dict(e.headers.items()) resp = WebhookResponse( url=url, status_code=e.code, body=response_body, - headers=dict(e.headers.items()), + headers=response_headers, ) if e.code == 429: # for backward-compatibility with WebClient (v.2.5.0 or older) diff --git a/slack_sdk/version.py b/slack_sdk/version.py index c94c3fcff..2235b3830 100644 --- a/slack_sdk/version.py +++ b/slack_sdk/version.py @@ -1,2 +1,2 @@ """Check the latest version at https://pypi.org/project/slack-sdk/""" -__version__ = "3.13.0" +__version__ = "3.14.0"