Skip to content

Commit 8a0c802

Browse files
authored
Add explicit arguments for files_info (#1085)
1 parent c2b5c29 commit 8a0c802

File tree

3 files changed

+69
-6
lines changed

3 files changed

+69
-6
lines changed

slack_sdk/web/async_client.py

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1680,13 +1680,34 @@ async def files_delete(self, *, file: str, **kwargs) -> AsyncSlackResponse:
16801680
kwargs.update({"file": file})
16811681
return await self.api_call("files.delete", json=kwargs)
16821682

1683-
async def files_info(self, *, file: str, **kwargs) -> AsyncSlackResponse:
1683+
async def files_info(
1684+
self,
1685+
*,
1686+
file: str,
1687+
count: Optional[int] = None,
1688+
cursor: Optional[str] = None,
1689+
limit: Optional[int] = None,
1690+
page: Optional[int] = None,
1691+
**kwargs
1692+
) -> AsyncSlackResponse:
16841693
"""Gets information about a team file.
16851694
16861695
Args:
16871696
file (str): The file id. e.g. 'F1234467890'
1697+
count (int): An optional number of items to return per page
1698+
cursor (str): An optional parameter for pagination
1699+
limit (int): An optional parameter defining the maximum number of items to return
1700+
page (int): An optional parameter defining the page number of results to return
16881701
"""
1689-
kwargs.update({"file": file})
1702+
kwargs.update(
1703+
{
1704+
"file": file,
1705+
"count": count,
1706+
"cursor": cursor,
1707+
"limit": limit,
1708+
"page": page,
1709+
}
1710+
)
16901711
return await self.api_call("files.info", http_verb="GET", params=kwargs)
16911712

16921713
async def files_list(self, **kwargs) -> AsyncSlackResponse:

slack_sdk/web/client.py

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,13 +1575,34 @@ def files_delete(self, *, file: str, **kwargs) -> SlackResponse:
15751575
kwargs.update({"file": file})
15761576
return self.api_call("files.delete", json=kwargs)
15771577

1578-
def files_info(self, *, file: str, **kwargs) -> SlackResponse:
1578+
def files_info(
1579+
self,
1580+
*,
1581+
file: str,
1582+
count: Optional[int] = None,
1583+
cursor: Optional[str] = None,
1584+
limit: Optional[int] = None,
1585+
page: Optional[int] = None,
1586+
**kwargs
1587+
) -> SlackResponse:
15791588
"""Gets information about a team file.
15801589
15811590
Args:
15821591
file (str): The file id. e.g. 'F1234467890'
1592+
count (int): An optional number of items to return per page
1593+
cursor (str): An optional parameter for pagination
1594+
limit (int): An optional parameter defining the maximum number of items to return
1595+
page (int): An optional parameter defining the page number of results to return
15831596
"""
1584-
kwargs.update({"file": file})
1597+
kwargs.update(
1598+
{
1599+
"file": file,
1600+
"count": count,
1601+
"cursor": cursor,
1602+
"limit": limit,
1603+
"page": page,
1604+
}
1605+
)
15851606
return self.api_call("files.info", http_verb="GET", params=kwargs)
15861607

15871608
def files_list(self, **kwargs) -> SlackResponse:

slack_sdk/web/legacy_client.py

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1668,13 +1668,34 @@ def files_delete(self, *, file: str, **kwargs) -> Union[Future, SlackResponse]:
16681668
kwargs.update({"file": file})
16691669
return self.api_call("files.delete", json=kwargs)
16701670

1671-
def files_info(self, *, file: str, **kwargs) -> Union[Future, SlackResponse]:
1671+
def files_info(
1672+
self,
1673+
*,
1674+
file: str,
1675+
count: Optional[int] = None,
1676+
cursor: Optional[str] = None,
1677+
limit: Optional[int] = None,
1678+
page: Optional[int] = None,
1679+
**kwargs
1680+
) -> Union[Future, SlackResponse]:
16721681
"""Gets information about a team file.
16731682
16741683
Args:
16751684
file (str): The file id. e.g. 'F1234467890'
1685+
count (int): An optional number of items to return per page
1686+
cursor (str): An optional parameter for pagination
1687+
limit (int): An optional parameter defining the maximum number of items to return
1688+
page (int): An optional parameter defining the page number of results to return
16761689
"""
1677-
kwargs.update({"file": file})
1690+
kwargs.update(
1691+
{
1692+
"file": file,
1693+
"count": count,
1694+
"cursor": cursor,
1695+
"limit": limit,
1696+
"page": page,
1697+
}
1698+
)
16781699
return self.api_call("files.info", http_verb="GET", params=kwargs)
16791700

16801701
def files_list(self, **kwargs) -> Union[Future, SlackResponse]:

0 commit comments

Comments
 (0)