Skip to content

Commit 17a3ce1

Browse files
feat(api): api update (#2291)
1 parent db76849 commit 17a3ce1

File tree

4 files changed

+41
-41
lines changed

4 files changed

+41
-41
lines changed

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 1480
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-940940879e4920ccdb9e851d6a4f0f3c313303b4917c6e3c49e81b7e44f1506c.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-18ccd4bfa5225ea54ecb087df6d6542117dc16f65b932d7e33a3e05d6c8e3c7e.yml

src/cloudflare/resources/accounts/logs/audit.py

+13-13
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from __future__ import annotations
44

55
from typing import Union
6-
from datetime import date, datetime
6+
from datetime import date
77
from typing_extensions import Literal
88

99
import httpx
@@ -50,8 +50,8 @@ def list(
5050
self,
5151
*,
5252
account_id: str,
53-
before: Union[Union[str, date], Union[str, datetime]],
54-
since: Union[Union[str, date], Union[str, datetime]],
53+
before: Union[str, date],
54+
since: Union[str, date],
5555
account_name: str | NotGiven = NOT_GIVEN,
5656
action_result: Literal["success", "failure"] | NotGiven = NOT_GIVEN,
5757
action_type: Literal["create", "delete", "view", "update"] | NotGiven = NOT_GIVEN,
@@ -94,11 +94,11 @@ def list(
9494
Args:
9595
account_id: The unique id that identifies the account.
9696
97-
before: Filters actions based on a given timestamp, returning only logs that occurred
98-
before the specified date.
97+
before: Filters actions based on a given timestamp in the format yyyy-mm-dd, returning
98+
only logs that occurred on and before the specified date.
9999
100-
since: Filters actions based on a given timestamp, returning only logs that occurred
101-
after the specified date.
100+
since: Filters actions based on a given timestamp in the format yyyy-mm-dd, returning
101+
only logs that occurred on and after the specified date.
102102
103103
account_name: Filters by the account name.
104104
@@ -232,8 +232,8 @@ def list(
232232
self,
233233
*,
234234
account_id: str,
235-
before: Union[Union[str, date], Union[str, datetime]],
236-
since: Union[Union[str, date], Union[str, datetime]],
235+
before: Union[str, date],
236+
since: Union[str, date],
237237
account_name: str | NotGiven = NOT_GIVEN,
238238
action_result: Literal["success", "failure"] | NotGiven = NOT_GIVEN,
239239
action_type: Literal["create", "delete", "view", "update"] | NotGiven = NOT_GIVEN,
@@ -276,11 +276,11 @@ def list(
276276
Args:
277277
account_id: The unique id that identifies the account.
278278
279-
before: Filters actions based on a given timestamp, returning only logs that occurred
280-
before the specified date.
279+
before: Filters actions based on a given timestamp in the format yyyy-mm-dd, returning
280+
only logs that occurred on and before the specified date.
281281
282-
since: Filters actions based on a given timestamp, returning only logs that occurred
283-
after the specified date.
282+
since: Filters actions based on a given timestamp in the format yyyy-mm-dd, returning
283+
only logs that occurred on and after the specified date.
284284
285285
account_name: Filters by the account name.
286286

src/cloudflare/types/accounts/logs/audit_list_params.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from __future__ import annotations
44

55
from typing import Union
6-
from datetime import date, datetime
6+
from datetime import date
77
from typing_extensions import Literal, Required, Annotated, TypedDict
88

99
from ...._utils import PropertyInfo
@@ -15,16 +15,16 @@ class AuditListParams(TypedDict, total=False):
1515
account_id: Required[str]
1616
"""The unique id that identifies the account."""
1717

18-
before: Required[Annotated[Union[Union[str, date], Union[str, datetime]], PropertyInfo(format="iso8601")]]
18+
before: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]]
1919
"""
20-
Filters actions based on a given timestamp, returning only logs that occurred
21-
before the specified date.
20+
Filters actions based on a given timestamp in the format yyyy-mm-dd, returning
21+
only logs that occurred on and before the specified date.
2222
"""
2323

24-
since: Required[Annotated[Union[Union[str, date], Union[str, datetime]], PropertyInfo(format="iso8601")]]
24+
since: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]]
2525
"""
26-
Filters actions based on a given timestamp, returning only logs that occurred
27-
after the specified date.
26+
Filters actions based on a given timestamp in the format yyyy-mm-dd, returning
27+
only logs that occurred on and after the specified date.
2828
"""
2929

3030
account_name: str

tests/api_resources/accounts/logs/test_audit.py

+20-20
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ class TestAudit:
2323
def test_method_list(self, client: Cloudflare) -> None:
2424
audit = client.accounts.logs.audit.list(
2525
account_id="a67e14daa5f8dceeb91fe5449ba496ef",
26-
before=parse_date("2014-10-30"),
27-
since=parse_date("2014-10-30"),
26+
before=parse_date("2024-10-31"),
27+
since=parse_date("2024-10-30"),
2828
)
2929
assert_matches_type(SyncCursorLimitPagination[AuditListResponse], audit, path=["response"])
3030

3131
@parametrize
3232
def test_method_list_with_all_params(self, client: Cloudflare) -> None:
3333
audit = client.accounts.logs.audit.list(
3434
account_id="a67e14daa5f8dceeb91fe5449ba496ef",
35-
before=parse_date("2014-10-30"),
36-
since=parse_date("2014-10-30"),
35+
before=parse_date("2024-10-31"),
36+
since=parse_date("2024-10-30"),
3737
account_name="account_name",
3838
action_result="success",
3939
action_type="create",
@@ -65,8 +65,8 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None:
6565
def test_raw_response_list(self, client: Cloudflare) -> None:
6666
response = client.accounts.logs.audit.with_raw_response.list(
6767
account_id="a67e14daa5f8dceeb91fe5449ba496ef",
68-
before=parse_date("2014-10-30"),
69-
since=parse_date("2014-10-30"),
68+
before=parse_date("2024-10-31"),
69+
since=parse_date("2024-10-30"),
7070
)
7171

7272
assert response.is_closed is True
@@ -78,8 +78,8 @@ def test_raw_response_list(self, client: Cloudflare) -> None:
7878
def test_streaming_response_list(self, client: Cloudflare) -> None:
7979
with client.accounts.logs.audit.with_streaming_response.list(
8080
account_id="a67e14daa5f8dceeb91fe5449ba496ef",
81-
before=parse_date("2014-10-30"),
82-
since=parse_date("2014-10-30"),
81+
before=parse_date("2024-10-31"),
82+
since=parse_date("2024-10-30"),
8383
) as response:
8484
assert not response.is_closed
8585
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -94,8 +94,8 @@ def test_path_params_list(self, client: Cloudflare) -> None:
9494
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
9595
client.accounts.logs.audit.with_raw_response.list(
9696
account_id="",
97-
before=parse_date("2014-10-30"),
98-
since=parse_date("2014-10-30"),
97+
before=parse_date("2024-10-31"),
98+
since=parse_date("2024-10-30"),
9999
)
100100

101101

@@ -106,17 +106,17 @@ class TestAsyncAudit:
106106
async def test_method_list(self, async_client: AsyncCloudflare) -> None:
107107
audit = await async_client.accounts.logs.audit.list(
108108
account_id="a67e14daa5f8dceeb91fe5449ba496ef",
109-
before=parse_date("2014-10-30"),
110-
since=parse_date("2014-10-30"),
109+
before=parse_date("2024-10-31"),
110+
since=parse_date("2024-10-30"),
111111
)
112112
assert_matches_type(AsyncCursorLimitPagination[AuditListResponse], audit, path=["response"])
113113

114114
@parametrize
115115
async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None:
116116
audit = await async_client.accounts.logs.audit.list(
117117
account_id="a67e14daa5f8dceeb91fe5449ba496ef",
118-
before=parse_date("2014-10-30"),
119-
since=parse_date("2014-10-30"),
118+
before=parse_date("2024-10-31"),
119+
since=parse_date("2024-10-30"),
120120
account_name="account_name",
121121
action_result="success",
122122
action_type="create",
@@ -148,8 +148,8 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare)
148148
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
149149
response = await async_client.accounts.logs.audit.with_raw_response.list(
150150
account_id="a67e14daa5f8dceeb91fe5449ba496ef",
151-
before=parse_date("2014-10-30"),
152-
since=parse_date("2014-10-30"),
151+
before=parse_date("2024-10-31"),
152+
since=parse_date("2024-10-30"),
153153
)
154154

155155
assert response.is_closed is True
@@ -161,8 +161,8 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
161161
async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None:
162162
async with async_client.accounts.logs.audit.with_streaming_response.list(
163163
account_id="a67e14daa5f8dceeb91fe5449ba496ef",
164-
before=parse_date("2014-10-30"),
165-
since=parse_date("2014-10-30"),
164+
before=parse_date("2024-10-31"),
165+
since=parse_date("2024-10-30"),
166166
) as response:
167167
assert not response.is_closed
168168
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -177,6 +177,6 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None:
177177
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
178178
await async_client.accounts.logs.audit.with_raw_response.list(
179179
account_id="",
180-
before=parse_date("2014-10-30"),
181-
since=parse_date("2014-10-30"),
180+
before=parse_date("2024-10-31"),
181+
since=parse_date("2024-10-30"),
182182
)

0 commit comments

Comments
 (0)