Skip to content

Commit

Permalink
fix: remove quotation mark when date or datetime is used in query par…
Browse files Browse the repository at this point in the history
  • Loading branch information
box-sdk-build committed Jun 11, 2024
1 parent 9400fc8 commit 77cfb0e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .codegen.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "engineHash": "3ed6b56", "specHash": "5e023b9", "version": "1.0.0" }
{ "engineHash": "240a5b0", "specHash": "5e023b9", "version": "1.0.0" }
7 changes: 6 additions & 1 deletion docs/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ See the endpoint docs at
<!-- sample get_events -->

```python
client.events.get_events(stream_type=GetEventsStreamType.CHANGES.value)
client.events.get_events(
stream_type=GetEventsStreamType.ADMIN_LOGS.value,
limit=1,
created_after=created_after_date,
created_before=created_before_date,
)
```

### Arguments
Expand Down
16 changes: 16 additions & 0 deletions test/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

from box_sdk_gen.schemas.realtime_server import RealtimeServer

from box_sdk_gen.internal.utils import DateTime

from test.commons import get_default_client

from box_sdk_gen.schemas.event_source import EventSource
Expand All @@ -24,6 +26,8 @@

from box_sdk_gen.schemas.user import User

from box_sdk_gen.internal.utils import date_time_from_string

client: BoxClient = get_default_client()


Expand Down Expand Up @@ -81,3 +85,15 @@ def testGetEventsWithLongPolling():
server: RealtimeServer = servers.entries[0]
assert to_string(server.type) == 'realtime_server'
assert not server.url == ''


def testGetEventsWithDateFilters():
created_after_date: DateTime = date_time_from_string('2024-06-09T00:00:00Z')
created_before_date: DateTime = date_time_from_string('2025-06-09T00:00:00Z')
servers: Events = client.events.get_events(
stream_type=GetEventsStreamType.ADMIN_LOGS.value,
limit=1,
created_after=created_after_date,
created_before=created_before_date,
)
assert len(servers.entries) == 1

0 comments on commit 77cfb0e

Please sign in to comment.