Repository: slackapi/python-slack-sdk (python)

Issue:
Add file input block element support
Refer to https://api.slack.com/reference/block-kit/block-elements#file_input for details. Only `slack_sdk.models` module needs updates for this feature.

### Category (place an `x` in each of the `[ ]`)

- [ ] **slack_sdk.web.WebClient (sync/async)** (Web API client)
- [ ] **slack_sdk.webhook.WebhookClient (sync/async)** (Incoming Webhook, response_url sender)
- [x] **slack_sdk.models** (UI component builders)
- [ ] **slack_sdk.oauth** (OAuth Flow Utilities)
- [ ] **slack_sdk.socket_mode** (Socket Mode client)
- [ ] **slack_sdk.audit_logs** (Audit Logs API client)
- [ ] **slack_sdk.scim** (SCIM API client)
- [ ] **slack_sdk.rtm** (RTM client)
- [ ] **slack_sdk.signature** (Request Signature Verifier)

### Requirements

Please read the [Contributing guidelines](https://github.com/slackapi/python-slack-sdk/blob/main/.github/contributing.md) and [Code of Conduct](https://slackhq.github.io/code-of-conduct) before creating this issue or pull request. By submitting, you are agreeing to those rules.


Pull request:
Fix #1424 Add file input block element support
## Summary

This pull request resolves #1424 

### Category (place an `x` in each of the `[ ]`)

- [ ] **slack_sdk.web.WebClient (sync/async)** (Web API client)
- [ ] **slack_sdk.webhook.WebhookClient (sync/async)** (Incoming Webhook, response_url sender)
- [ ] **slack_sdk.socket_mode** (Socket Mode client)
- [ ] **slack_sdk.signature** (Request Signature Verifier)
- [ ] **slack_sdk.oauth** (OAuth Flow Utilities)
- [x] **slack_sdk.models** (UI component builders)
- [ ] **slack_sdk.scim** (SCIM API client)
- [ ] **slack_sdk.audit_logs** (Audit Logs API client)
- [ ] **slack_sdk.rtm_v2** (RTM client)
- [ ] `/docs-src` (Documents, have you run `./scripts/docs.sh`?)
- [ ] `/docs-src-v2` (Documents, have you run `./scripts/docs-v2.sh`?)
- [ ] `/tutorial` (PythOnBoardingBot tutorial)
- [ ] `tests`/`integration_tests` (Automated tests for this library)

## Requirements (place an `x` in each `[ ]`)

- [x] I've read and understood the [Contributing Guidelines](https://github.com/slackapi/python-slack-sdk/blob/main/.github/contributing.md) and have done my best effort to follow them.
- [x] I've read and agree to the [Code of Conduct](https://slackhq.github.io/code-of-conduct).
- [x] I've run `python3 -m venv .venv && source .venv/bin/activate && ./scripts/run_validation.sh` after making the changes.


Patch:
diff --git a/slack_sdk/models/blocks/block_elements.py b/slack_sdk/models/blocks/block_elements.py
index c65bd7f..8b9ac4e 100644
--- a/slack_sdk/models/blocks/block_elements.py
+++ b/slack_sdk/models/blocks/block_elements.py
@@ -1624,6 +1624,55 @@ class NumberInputElement(InputInteractiveElement):
         self.dispatch_action_config = dispatch_action_config
 
 
+# -------------------------------------------------
+# File Input Element
+# -------------------------------------------------
+
+
+class FileInputElement(InputInteractiveElement):
+    type = "file_input"
+
+    @property
+    def attributes(self) -> Set[str]:
+        return super().attributes.union(
+            {
+                "filetypes",
+                "max_files",
+            }
+        )
+
+    def __init__(
+        self,
+        *,
+        action_id: Optional[str] = None,
+        filetypes: Optional[List[str]] = None,
+        max_files: Optional[int] = None,
+        **others: dict,
+    ):
+        """
+        https://api.slack.com/reference/block-kit/block-elements#file_input
+
+        Args:
+            action_id (required): An identifier for the input value when the parent modal is submitted.
+                You can use this when you receive a view_submission payload to identify the value of the input element.
+                Should be unique among all other action_ids in the containing block. Maximum length is 255 characters.
+            filetypes: An array of valid file extensions that will be accepted for this element.
+                All file extensions will be accepted if filetypes is not specified.
+                This validation is provided for convenience only,
+                and you should perform your own file type validation based on what you expect to receive.
+            max_files: Maximum number of files that can be uploaded for this file_input element.
+                Minimum of 1, maximum of 10. Defaults to 10 if not specified.
+        """
+        super().__init__(
+            type=self.type,
+            action_id=action_id,
+        )
+        show_unknown_key_warning(self, others)
+
+        self.filetypes = filetypes
+        self.max_files = max_files
+
+
 # -------------------------------------------------
 # Radio Buttons Select
 # -------------------------------------------------


Test patch:
diff --git a/tests/slack_sdk/models/test_elements.py b/tests/slack_sdk/models/test_elements.py
index fe63d5f..5a38e14 100644
--- a/tests/slack_sdk/models/test_elements.py
+++ b/tests/slack_sdk/models/test_elements.py
@@ -35,6 +35,7 @@ from slack_sdk.models.blocks.block_elements import (
     UrlInputElement,
     WorkflowButtonElement,
     RichTextInputElement,
+    FileInputElement,
 )
 from . import STRING_3001_CHARS, STRING_301_CHARS
 
@@ -1199,6 +1200,22 @@ class NumberInputElementTests(unittest.TestCase):
         self.assertDictEqual(input, NumberInputElement(**input).to_dict())
 
 
+# -------------------------------------------------
+# File Input Element
+# -------------------------------------------------
+
+
+class FileInputElementTests(unittest.TestCase):
+    def test_element(self):
+        input = {
+            "type": "file_input",
+            "action_id": "file_input-action",
+            "filetypes": ["pdf", "txt"],
+            "max_files": 3,
+        }
+        self.assertDictEqual(input, FileInputElement(**input).to_dict())
+
+
 # -------------------------------------------------
 # Radio Buttons
 # -------------------------------------------------