feat(api): OpenAPI spec update via Stainless API (#666)

This commit is contained in:
stainless-app[bot] 2024-05-28 13:44:47 +00:00 committed by stainless-bot
parent ae81ac0f25
commit 8ba10d9100
13 changed files with 293 additions and 272 deletions

View file

@ -1,2 +1,2 @@
configured_endpoints: 1318
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-023c801c42e5f9d2443005ad5eb1282684d36ea405dabaa5942edcf1f3e2b29f.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ad688c70f1586b01810d8388213f79137ea8d7158d069b883fa4a9fefee01a2a.yml

28
api.md
View file

@ -3795,7 +3795,7 @@ from cloudflare.types.intel import Whois, WhoisGetResponse
Methods:
- <code title="get /accounts/{account_id}/intel/whois">client.intel.whois.<a href="./src/cloudflare/resources/intel/whois.py">get</a>(\*, account_id, \*\*<a href="src/cloudflare/types/intel/whois_get_params.py">params</a>) -> <a href="./src/cloudflare/types/intel/whois_get_response.py">Optional</a></code>
- <code title="get /accounts/{account_id}/intel/whois">client.intel.whois.<a href="./src/cloudflare/resources/intel/whois.py">get</a>(\*, account_id, \*\*<a href="src/cloudflare/types/intel/whois_get_params.py">params</a>) -> <a href="./src/cloudflare/types/intel/whois_get_response.py">WhoisGetResponse</a></code>
## IndicatorFeeds
@ -7628,14 +7628,14 @@ from cloudflare.types.cloudforce_one import (
Methods:
- <code title="post /accounts/{account_identifier}/cloudforce-one/requests/new">client.cloudforce_one.requests.<a href="./src/cloudflare/resources/cloudforce_one/requests/requests.py">create</a>(account_identifier, \*\*<a href="src/cloudflare/types/cloudforce_one/request_create_params.py">params</a>) -> <a href="./src/cloudflare/types/cloudforce_one/item.py">Optional</a></code>
- <code title="put /accounts/{account_identifier}/cloudforce-one/requests/{request_identifier}">client.cloudforce_one.requests.<a href="./src/cloudflare/resources/cloudforce_one/requests/requests.py">update</a>(request_identifier, \*, account_identifier, \*\*<a href="src/cloudflare/types/cloudforce_one/request_update_params.py">params</a>) -> <a href="./src/cloudflare/types/cloudforce_one/item.py">Optional</a></code>
- <code title="post /accounts/{account_identifier}/cloudforce-one/requests/new">client.cloudforce_one.requests.<a href="./src/cloudflare/resources/cloudforce_one/requests/requests.py">create</a>(account_identifier, \*\*<a href="src/cloudflare/types/cloudforce_one/request_create_params.py">params</a>) -> <a href="./src/cloudflare/types/cloudforce_one/item.py">Item</a></code>
- <code title="put /accounts/{account_identifier}/cloudforce-one/requests/{request_identifier}">client.cloudforce_one.requests.<a href="./src/cloudflare/resources/cloudforce_one/requests/requests.py">update</a>(request_identifier, \*, account_identifier, \*\*<a href="src/cloudflare/types/cloudforce_one/request_update_params.py">params</a>) -> <a href="./src/cloudflare/types/cloudforce_one/item.py">Item</a></code>
- <code title="post /accounts/{account_identifier}/cloudforce-one/requests">client.cloudforce_one.requests.<a href="./src/cloudflare/resources/cloudforce_one/requests/requests.py">list</a>(account_identifier, \*\*<a href="src/cloudflare/types/cloudforce_one/request_list_params.py">params</a>) -> <a href="./src/cloudflare/types/cloudforce_one/list_item.py">SyncV4PagePaginationArray[ListItem]</a></code>
- <code title="delete /accounts/{account_identifier}/cloudforce-one/requests/{request_identifier}">client.cloudforce_one.requests.<a href="./src/cloudflare/resources/cloudforce_one/requests/requests.py">delete</a>(request_identifier, \*, account_identifier) -> <a href="./src/cloudflare/types/cloudforce_one/request_delete_response.py">RequestDeleteResponse</a></code>
- <code title="get /accounts/{account_identifier}/cloudforce-one/requests/constants">client.cloudforce_one.requests.<a href="./src/cloudflare/resources/cloudforce_one/requests/requests.py">constants</a>(account_identifier) -> <a href="./src/cloudflare/types/cloudforce_one/request_constants.py">Optional</a></code>
- <code title="get /accounts/{account_identifier}/cloudforce-one/requests/{request_identifier}">client.cloudforce_one.requests.<a href="./src/cloudflare/resources/cloudforce_one/requests/requests.py">get</a>(request_identifier, \*, account_identifier) -> <a href="./src/cloudflare/types/cloudforce_one/item.py">Optional</a></code>
- <code title="get /accounts/{account_identifier}/cloudforce-one/requests/quota">client.cloudforce_one.requests.<a href="./src/cloudflare/resources/cloudforce_one/requests/requests.py">quota</a>(account_identifier) -> <a href="./src/cloudflare/types/cloudforce_one/quota.py">Optional</a></code>
- <code title="get /accounts/{account_identifier}/cloudforce-one/requests/types">client.cloudforce_one.requests.<a href="./src/cloudflare/resources/cloudforce_one/requests/requests.py">types</a>(account_identifier) -> <a href="./src/cloudflare/types/cloudforce_one/request_types.py">Optional</a></code>
- <code title="get /accounts/{account_identifier}/cloudforce-one/requests/constants">client.cloudforce_one.requests.<a href="./src/cloudflare/resources/cloudforce_one/requests/requests.py">constants</a>(account_identifier) -> <a href="./src/cloudflare/types/cloudforce_one/request_constants.py">RequestConstants</a></code>
- <code title="get /accounts/{account_identifier}/cloudforce-one/requests/{request_identifier}">client.cloudforce_one.requests.<a href="./src/cloudflare/resources/cloudforce_one/requests/requests.py">get</a>(request_identifier, \*, account_identifier) -> <a href="./src/cloudflare/types/cloudforce_one/item.py">Item</a></code>
- <code title="get /accounts/{account_identifier}/cloudforce-one/requests/quota">client.cloudforce_one.requests.<a href="./src/cloudflare/resources/cloudforce_one/requests/requests.py">quota</a>(account_identifier) -> <a href="./src/cloudflare/types/cloudforce_one/quota.py">Quota</a></code>
- <code title="get /accounts/{account_identifier}/cloudforce-one/requests/types">client.cloudforce_one.requests.<a href="./src/cloudflare/resources/cloudforce_one/requests/requests.py">types</a>(account_identifier) -> <a href="./src/cloudflare/types/cloudforce_one/request_types.py">RequestTypes</a></code>
### Message
@ -7651,10 +7651,10 @@ from cloudflare.types.cloudforce_one.requests import (
Methods:
- <code title="post /accounts/{account_identifier}/cloudforce-one/requests/{request_identifier}/message/new">client.cloudforce_one.requests.message.<a href="./src/cloudflare/resources/cloudforce_one/requests/message.py">create</a>(request_identifier, \*, account_identifier, \*\*<a href="src/cloudflare/types/cloudforce_one/requests/message_create_params.py">params</a>) -> <a href="./src/cloudflare/types/cloudforce_one/requests/message.py">Optional</a></code>
- <code title="put /accounts/{account_identifier}/cloudforce-one/requests/{request_identifier}/message/{message_identifer}">client.cloudforce_one.requests.message.<a href="./src/cloudflare/resources/cloudforce_one/requests/message.py">update</a>(message_identifer, \*, account_identifier, request_identifier, \*\*<a href="src/cloudflare/types/cloudforce_one/requests/message_update_params.py">params</a>) -> <a href="./src/cloudflare/types/cloudforce_one/requests/message.py">Optional</a></code>
- <code title="post /accounts/{account_identifier}/cloudforce-one/requests/{request_identifier}/message/new">client.cloudforce_one.requests.message.<a href="./src/cloudflare/resources/cloudforce_one/requests/message.py">create</a>(request_identifier, \*, account_identifier, \*\*<a href="src/cloudflare/types/cloudforce_one/requests/message_create_params.py">params</a>) -> <a href="./src/cloudflare/types/cloudforce_one/requests/message.py">Message</a></code>
- <code title="put /accounts/{account_identifier}/cloudforce-one/requests/{request_identifier}/message/{message_identifer}">client.cloudforce_one.requests.message.<a href="./src/cloudflare/resources/cloudforce_one/requests/message.py">update</a>(message_identifer, \*, account_identifier, request_identifier, \*\*<a href="src/cloudflare/types/cloudforce_one/requests/message_update_params.py">params</a>) -> <a href="./src/cloudflare/types/cloudforce_one/requests/message.py">Message</a></code>
- <code title="delete /accounts/{account_identifier}/cloudforce-one/requests/{request_identifier}/message/{message_identifer}">client.cloudforce_one.requests.message.<a href="./src/cloudflare/resources/cloudforce_one/requests/message.py">delete</a>(message_identifer, \*, account_identifier, request_identifier) -> <a href="./src/cloudflare/types/cloudforce_one/requests/message_delete_response.py">MessageDeleteResponse</a></code>
- <code title="post /accounts/{account_identifier}/cloudforce-one/requests/{request_identifier}/message">client.cloudforce_one.requests.message.<a href="./src/cloudflare/resources/cloudforce_one/requests/message.py">get</a>(request_identifier, \*, account_identifier, \*\*<a href="src/cloudflare/types/cloudforce_one/requests/message_get_params.py">params</a>) -> <a href="./src/cloudflare/types/cloudforce_one/requests/message_get_response.py">Optional</a></code>
- <code title="post /accounts/{account_identifier}/cloudforce-one/requests/{request_identifier}/message">client.cloudforce_one.requests.message.<a href="./src/cloudflare/resources/cloudforce_one/requests/message.py">get</a>(request_identifier, \*, account_identifier, \*\*<a href="src/cloudflare/types/cloudforce_one/requests/message_get_params.py">params</a>) -> <a href="./src/cloudflare/types/cloudforce_one/requests/message_get_response.py">MessageGetResponse</a></code>
### Priority
@ -7671,11 +7671,11 @@ from cloudflare.types.cloudforce_one.requests import (
Methods:
- <code title="post /accounts/{account_identifier}/cloudforce-one/requests/priority/new">client.cloudforce_one.requests.priority.<a href="./src/cloudflare/resources/cloudforce_one/requests/priority.py">create</a>(account_identifier, \*\*<a href="src/cloudflare/types/cloudforce_one/requests/priority_create_params.py">params</a>) -> <a href="./src/cloudflare/types/cloudforce_one/requests/priority.py">Optional</a></code>
- <code title="put /accounts/{account_identifier}/cloudforce-one/requests/priority/{priority_identifer}">client.cloudforce_one.requests.priority.<a href="./src/cloudflare/resources/cloudforce_one/requests/priority.py">update</a>(priority_identifer, \*, account_identifier, \*\*<a href="src/cloudflare/types/cloudforce_one/requests/priority_update_params.py">params</a>) -> <a href="./src/cloudflare/types/cloudforce_one/item.py">Optional</a></code>
- <code title="post /accounts/{account_identifier}/cloudforce-one/requests/priority/new">client.cloudforce_one.requests.priority.<a href="./src/cloudflare/resources/cloudforce_one/requests/priority.py">create</a>(account_identifier, \*\*<a href="src/cloudflare/types/cloudforce_one/requests/priority_create_params.py">params</a>) -> <a href="./src/cloudflare/types/cloudforce_one/requests/priority.py">Priority</a></code>
- <code title="put /accounts/{account_identifier}/cloudforce-one/requests/priority/{priority_identifer}">client.cloudforce_one.requests.priority.<a href="./src/cloudflare/resources/cloudforce_one/requests/priority.py">update</a>(priority_identifer, \*, account_identifier, \*\*<a href="src/cloudflare/types/cloudforce_one/requests/priority_update_params.py">params</a>) -> <a href="./src/cloudflare/types/cloudforce_one/item.py">Item</a></code>
- <code title="delete /accounts/{account_identifier}/cloudforce-one/requests/priority/{priority_identifer}">client.cloudforce_one.requests.priority.<a href="./src/cloudflare/resources/cloudforce_one/requests/priority.py">delete</a>(priority_identifer, \*, account_identifier) -> <a href="./src/cloudflare/types/cloudforce_one/requests/priority_delete_response.py">PriorityDeleteResponse</a></code>
- <code title="get /accounts/{account_identifier}/cloudforce-one/requests/priority/{priority_identifer}">client.cloudforce_one.requests.priority.<a href="./src/cloudflare/resources/cloudforce_one/requests/priority.py">get</a>(priority_identifer, \*, account_identifier) -> <a href="./src/cloudflare/types/cloudforce_one/item.py">Optional</a></code>
- <code title="get /accounts/{account_identifier}/cloudforce-one/requests/priority/quota">client.cloudforce_one.requests.priority.<a href="./src/cloudflare/resources/cloudforce_one/requests/priority.py">quota</a>(account_identifier) -> <a href="./src/cloudflare/types/cloudforce_one/quota.py">Optional</a></code>
- <code title="get /accounts/{account_identifier}/cloudforce-one/requests/priority/{priority_identifer}">client.cloudforce_one.requests.priority.<a href="./src/cloudflare/resources/cloudforce_one/requests/priority.py">get</a>(priority_identifer, \*, account_identifier) -> <a href="./src/cloudflare/types/cloudforce_one/item.py">Item</a></code>
- <code title="get /accounts/{account_identifier}/cloudforce-one/requests/priority/quota">client.cloudforce_one.requests.priority.<a href="./src/cloudflare/resources/cloudforce_one/requests/priority.py">quota</a>(account_identifier) -> <a href="./src/cloudflare/types/cloudforce_one/quota.py">Quota</a></code>
# EventNotifications

View file

@ -2,7 +2,7 @@
from __future__ import annotations
from typing import Type, Union, Optional, cast
from typing import Any, Type, Union, cast
from datetime import datetime
from typing_extensions import Literal
@ -54,7 +54,7 @@ class MessageResource(SyncAPIResource):
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[Message]:
) -> Message:
"""
Creating a request adds the request into the Cloudforce One queue for analysis.
In addition to the content, a short title, type, priority, and releasability
@ -87,9 +87,9 @@ class MessageResource(SyncAPIResource):
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[Optional[Message]]._unwrapper,
post_parser=ResultWrapper[Message]._unwrapper,
),
cast_to=cast(Type[Optional[Message]], ResultWrapper[Message]),
cast_to=cast(Type[Message], ResultWrapper[Message]),
)
def update(
@ -109,7 +109,7 @@ class MessageResource(SyncAPIResource):
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[Message]:
) -> Message:
"""
Update a Request Message
@ -157,9 +157,9 @@ class MessageResource(SyncAPIResource):
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[Optional[Message]]._unwrapper,
post_parser=ResultWrapper[Message]._unwrapper,
),
cast_to=cast(Type[Optional[Message]], ResultWrapper[Message]),
cast_to=cast(Type[Message], ResultWrapper[Message]),
)
def delete(
@ -195,12 +195,21 @@ class MessageResource(SyncAPIResource):
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
if not request_identifier:
raise ValueError(f"Expected a non-empty value for `request_identifier` but received {request_identifier!r}")
return self._delete(
f"/accounts/{account_identifier}/cloudforce-one/requests/{request_identifier}/message/{message_identifer}",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
return cast(
MessageDeleteResponse,
self._delete(
f"/accounts/{account_identifier}/cloudforce-one/requests/{request_identifier}/message/{message_identifer}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[MessageDeleteResponse]._unwrapper,
),
cast_to=cast(
Any, ResultWrapper[MessageDeleteResponse]
), # Union types cannot be passed in as arguments in the type system
),
cast_to=MessageDeleteResponse,
)
def get(
@ -220,7 +229,7 @@ class MessageResource(SyncAPIResource):
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[MessageGetResponse]:
) -> MessageGetResponse:
"""
List Request Messages
@ -271,9 +280,9 @@ class MessageResource(SyncAPIResource):
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[Optional[MessageGetResponse]]._unwrapper,
post_parser=ResultWrapper[MessageGetResponse]._unwrapper,
),
cast_to=cast(Type[Optional[MessageGetResponse]], ResultWrapper[MessageGetResponse]),
cast_to=cast(Type[MessageGetResponse], ResultWrapper[MessageGetResponse]),
)
@ -298,7 +307,7 @@ class AsyncMessageResource(AsyncAPIResource):
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[Message]:
) -> Message:
"""
Creating a request adds the request into the Cloudforce One queue for analysis.
In addition to the content, a short title, type, priority, and releasability
@ -331,9 +340,9 @@ class AsyncMessageResource(AsyncAPIResource):
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[Optional[Message]]._unwrapper,
post_parser=ResultWrapper[Message]._unwrapper,
),
cast_to=cast(Type[Optional[Message]], ResultWrapper[Message]),
cast_to=cast(Type[Message], ResultWrapper[Message]),
)
async def update(
@ -353,7 +362,7 @@ class AsyncMessageResource(AsyncAPIResource):
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[Message]:
) -> Message:
"""
Update a Request Message
@ -401,9 +410,9 @@ class AsyncMessageResource(AsyncAPIResource):
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[Optional[Message]]._unwrapper,
post_parser=ResultWrapper[Message]._unwrapper,
),
cast_to=cast(Type[Optional[Message]], ResultWrapper[Message]),
cast_to=cast(Type[Message], ResultWrapper[Message]),
)
async def delete(
@ -439,12 +448,21 @@ class AsyncMessageResource(AsyncAPIResource):
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
if not request_identifier:
raise ValueError(f"Expected a non-empty value for `request_identifier` but received {request_identifier!r}")
return await self._delete(
f"/accounts/{account_identifier}/cloudforce-one/requests/{request_identifier}/message/{message_identifer}",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
return cast(
MessageDeleteResponse,
await self._delete(
f"/accounts/{account_identifier}/cloudforce-one/requests/{request_identifier}/message/{message_identifer}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[MessageDeleteResponse]._unwrapper,
),
cast_to=cast(
Any, ResultWrapper[MessageDeleteResponse]
), # Union types cannot be passed in as arguments in the type system
),
cast_to=MessageDeleteResponse,
)
async def get(
@ -464,7 +482,7 @@ class AsyncMessageResource(AsyncAPIResource):
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[MessageGetResponse]:
) -> MessageGetResponse:
"""
List Request Messages
@ -515,9 +533,9 @@ class AsyncMessageResource(AsyncAPIResource):
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[Optional[MessageGetResponse]]._unwrapper,
post_parser=ResultWrapper[MessageGetResponse]._unwrapper,
),
cast_to=cast(Type[Optional[MessageGetResponse]], ResultWrapper[MessageGetResponse]),
cast_to=cast(Type[MessageGetResponse], ResultWrapper[MessageGetResponse]),
)

View file

@ -2,7 +2,7 @@
from __future__ import annotations
from typing import List, Type, Optional, cast
from typing import Any, List, Type, cast
from typing_extensions import Literal
import httpx
@ -57,7 +57,7 @@ class PriorityResource(SyncAPIResource):
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[Priority]:
) -> Priority:
"""
Create a New Priority Requirement
@ -98,9 +98,9 @@ class PriorityResource(SyncAPIResource):
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[Optional[Priority]]._unwrapper,
post_parser=ResultWrapper[Priority]._unwrapper,
),
cast_to=cast(Type[Optional[Priority]], ResultWrapper[Priority]),
cast_to=cast(Type[Priority], ResultWrapper[Priority]),
)
def update(
@ -118,7 +118,7 @@ class PriorityResource(SyncAPIResource):
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[Item]:
) -> Item:
"""
Update a Priority Intelligence Requirement
@ -163,9 +163,9 @@ class PriorityResource(SyncAPIResource):
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[Optional[Item]]._unwrapper,
post_parser=ResultWrapper[Item]._unwrapper,
),
cast_to=cast(Type[Optional[Item]], ResultWrapper[Item]),
cast_to=cast(Type[Item], ResultWrapper[Item]),
)
def delete(
@ -200,12 +200,21 @@ class PriorityResource(SyncAPIResource):
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
if not priority_identifer:
raise ValueError(f"Expected a non-empty value for `priority_identifer` but received {priority_identifer!r}")
return self._delete(
f"/accounts/{account_identifier}/cloudforce-one/requests/priority/{priority_identifer}",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
return cast(
PriorityDeleteResponse,
self._delete(
f"/accounts/{account_identifier}/cloudforce-one/requests/priority/{priority_identifer}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[PriorityDeleteResponse]._unwrapper,
),
cast_to=cast(
Any, ResultWrapper[PriorityDeleteResponse]
), # Union types cannot be passed in as arguments in the type system
),
cast_to=PriorityDeleteResponse,
)
def get(
@ -219,7 +228,7 @@ class PriorityResource(SyncAPIResource):
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[Item]:
) -> Item:
"""
Get a Priority Intelligence Requirement
@ -247,9 +256,9 @@ class PriorityResource(SyncAPIResource):
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[Optional[Item]]._unwrapper,
post_parser=ResultWrapper[Item]._unwrapper,
),
cast_to=cast(Type[Optional[Item]], ResultWrapper[Item]),
cast_to=cast(Type[Item], ResultWrapper[Item]),
)
def quota(
@ -262,7 +271,7 @@ class PriorityResource(SyncAPIResource):
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[Quota]:
) -> Quota:
"""
Get Priority Intelligence Requirement Quota
@ -286,9 +295,9 @@ class PriorityResource(SyncAPIResource):
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[Optional[Quota]]._unwrapper,
post_parser=ResultWrapper[Quota]._unwrapper,
),
cast_to=cast(Type[Optional[Quota]], ResultWrapper[Quota]),
cast_to=cast(Type[Quota], ResultWrapper[Quota]),
)
@ -315,7 +324,7 @@ class AsyncPriorityResource(AsyncAPIResource):
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[Priority]:
) -> Priority:
"""
Create a New Priority Requirement
@ -356,9 +365,9 @@ class AsyncPriorityResource(AsyncAPIResource):
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[Optional[Priority]]._unwrapper,
post_parser=ResultWrapper[Priority]._unwrapper,
),
cast_to=cast(Type[Optional[Priority]], ResultWrapper[Priority]),
cast_to=cast(Type[Priority], ResultWrapper[Priority]),
)
async def update(
@ -376,7 +385,7 @@ class AsyncPriorityResource(AsyncAPIResource):
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[Item]:
) -> Item:
"""
Update a Priority Intelligence Requirement
@ -421,9 +430,9 @@ class AsyncPriorityResource(AsyncAPIResource):
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[Optional[Item]]._unwrapper,
post_parser=ResultWrapper[Item]._unwrapper,
),
cast_to=cast(Type[Optional[Item]], ResultWrapper[Item]),
cast_to=cast(Type[Item], ResultWrapper[Item]),
)
async def delete(
@ -458,12 +467,21 @@ class AsyncPriorityResource(AsyncAPIResource):
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
if not priority_identifer:
raise ValueError(f"Expected a non-empty value for `priority_identifer` but received {priority_identifer!r}")
return await self._delete(
f"/accounts/{account_identifier}/cloudforce-one/requests/priority/{priority_identifer}",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
return cast(
PriorityDeleteResponse,
await self._delete(
f"/accounts/{account_identifier}/cloudforce-one/requests/priority/{priority_identifer}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[PriorityDeleteResponse]._unwrapper,
),
cast_to=cast(
Any, ResultWrapper[PriorityDeleteResponse]
), # Union types cannot be passed in as arguments in the type system
),
cast_to=PriorityDeleteResponse,
)
async def get(
@ -477,7 +495,7 @@ class AsyncPriorityResource(AsyncAPIResource):
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[Item]:
) -> Item:
"""
Get a Priority Intelligence Requirement
@ -505,9 +523,9 @@ class AsyncPriorityResource(AsyncAPIResource):
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[Optional[Item]]._unwrapper,
post_parser=ResultWrapper[Item]._unwrapper,
),
cast_to=cast(Type[Optional[Item]], ResultWrapper[Item]),
cast_to=cast(Type[Item], ResultWrapper[Item]),
)
async def quota(
@ -520,7 +538,7 @@ class AsyncPriorityResource(AsyncAPIResource):
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[Quota]:
) -> Quota:
"""
Get Priority Intelligence Requirement Quota
@ -544,9 +562,9 @@ class AsyncPriorityResource(AsyncAPIResource):
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[Optional[Quota]]._unwrapper,
post_parser=ResultWrapper[Quota]._unwrapper,
),
cast_to=cast(Type[Optional[Quota]], ResultWrapper[Quota]),
cast_to=cast(Type[Quota], ResultWrapper[Quota]),
)

View file

@ -2,7 +2,7 @@
from __future__ import annotations
from typing import Type, Union, Optional, cast
from typing import Any, Type, Union, cast
from datetime import datetime
from typing_extensions import Literal
@ -86,7 +86,7 @@ class RequestsResource(SyncAPIResource):
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[Item]:
) -> Item:
"""
Creating a request adds the request into the Cloudforce One queue for analysis.
In addition to the content, a short title, type, priority, and releasability
@ -132,9 +132,9 @@ class RequestsResource(SyncAPIResource):
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[Optional[Item]]._unwrapper,
post_parser=ResultWrapper[Item]._unwrapper,
),
cast_to=cast(Type[Optional[Item]], ResultWrapper[Item]),
cast_to=cast(Type[Item], ResultWrapper[Item]),
)
def update(
@ -153,7 +153,7 @@ class RequestsResource(SyncAPIResource):
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[Item]:
) -> Item:
"""Updating a request alters the request in the Cloudforce One queue.
This API may
@ -204,9 +204,9 @@ class RequestsResource(SyncAPIResource):
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[Optional[Item]]._unwrapper,
post_parser=ResultWrapper[Item]._unwrapper,
),
cast_to=cast(Type[Optional[Item]], ResultWrapper[Item]),
cast_to=cast(Type[Item], ResultWrapper[Item]),
)
def list(
@ -323,12 +323,21 @@ class RequestsResource(SyncAPIResource):
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
if not request_identifier:
raise ValueError(f"Expected a non-empty value for `request_identifier` but received {request_identifier!r}")
return self._delete(
f"/accounts/{account_identifier}/cloudforce-one/requests/{request_identifier}",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
return cast(
RequestDeleteResponse,
self._delete(
f"/accounts/{account_identifier}/cloudforce-one/requests/{request_identifier}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[RequestDeleteResponse]._unwrapper,
),
cast_to=cast(
Any, ResultWrapper[RequestDeleteResponse]
), # Union types cannot be passed in as arguments in the type system
),
cast_to=RequestDeleteResponse,
)
def constants(
@ -341,7 +350,7 @@ class RequestsResource(SyncAPIResource):
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[RequestConstants]:
) -> RequestConstants:
"""
Get Request Priority, Status, and TLP constants
@ -365,9 +374,9 @@ class RequestsResource(SyncAPIResource):
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[Optional[RequestConstants]]._unwrapper,
post_parser=ResultWrapper[RequestConstants]._unwrapper,
),
cast_to=cast(Type[Optional[RequestConstants]], ResultWrapper[RequestConstants]),
cast_to=cast(Type[RequestConstants], ResultWrapper[RequestConstants]),
)
def get(
@ -381,7 +390,7 @@ class RequestsResource(SyncAPIResource):
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[Item]:
) -> Item:
"""
Get a Request
@ -409,9 +418,9 @@ class RequestsResource(SyncAPIResource):
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[Optional[Item]]._unwrapper,
post_parser=ResultWrapper[Item]._unwrapper,
),
cast_to=cast(Type[Optional[Item]], ResultWrapper[Item]),
cast_to=cast(Type[Item], ResultWrapper[Item]),
)
def quota(
@ -424,7 +433,7 @@ class RequestsResource(SyncAPIResource):
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[Quota]:
) -> Quota:
"""
Get Request Quota
@ -448,9 +457,9 @@ class RequestsResource(SyncAPIResource):
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[Optional[Quota]]._unwrapper,
post_parser=ResultWrapper[Quota]._unwrapper,
),
cast_to=cast(Type[Optional[Quota]], ResultWrapper[Quota]),
cast_to=cast(Type[Quota], ResultWrapper[Quota]),
)
def types(
@ -463,7 +472,7 @@ class RequestsResource(SyncAPIResource):
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[RequestTypes]:
) -> RequestTypes:
"""
Get Request Types
@ -487,9 +496,9 @@ class RequestsResource(SyncAPIResource):
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[Optional[RequestTypes]]._unwrapper,
post_parser=ResultWrapper[RequestTypes]._unwrapper,
),
cast_to=cast(Type[Optional[RequestTypes]], ResultWrapper[RequestTypes]),
cast_to=cast(Type[RequestTypes], ResultWrapper[RequestTypes]),
)
@ -525,7 +534,7 @@ class AsyncRequestsResource(AsyncAPIResource):
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[Item]:
) -> Item:
"""
Creating a request adds the request into the Cloudforce One queue for analysis.
In addition to the content, a short title, type, priority, and releasability
@ -571,9 +580,9 @@ class AsyncRequestsResource(AsyncAPIResource):
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[Optional[Item]]._unwrapper,
post_parser=ResultWrapper[Item]._unwrapper,
),
cast_to=cast(Type[Optional[Item]], ResultWrapper[Item]),
cast_to=cast(Type[Item], ResultWrapper[Item]),
)
async def update(
@ -592,7 +601,7 @@ class AsyncRequestsResource(AsyncAPIResource):
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[Item]:
) -> Item:
"""Updating a request alters the request in the Cloudforce One queue.
This API may
@ -643,9 +652,9 @@ class AsyncRequestsResource(AsyncAPIResource):
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[Optional[Item]]._unwrapper,
post_parser=ResultWrapper[Item]._unwrapper,
),
cast_to=cast(Type[Optional[Item]], ResultWrapper[Item]),
cast_to=cast(Type[Item], ResultWrapper[Item]),
)
def list(
@ -762,12 +771,21 @@ class AsyncRequestsResource(AsyncAPIResource):
raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}")
if not request_identifier:
raise ValueError(f"Expected a non-empty value for `request_identifier` but received {request_identifier!r}")
return await self._delete(
f"/accounts/{account_identifier}/cloudforce-one/requests/{request_identifier}",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
return cast(
RequestDeleteResponse,
await self._delete(
f"/accounts/{account_identifier}/cloudforce-one/requests/{request_identifier}",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[RequestDeleteResponse]._unwrapper,
),
cast_to=cast(
Any, ResultWrapper[RequestDeleteResponse]
), # Union types cannot be passed in as arguments in the type system
),
cast_to=RequestDeleteResponse,
)
async def constants(
@ -780,7 +798,7 @@ class AsyncRequestsResource(AsyncAPIResource):
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[RequestConstants]:
) -> RequestConstants:
"""
Get Request Priority, Status, and TLP constants
@ -804,9 +822,9 @@ class AsyncRequestsResource(AsyncAPIResource):
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[Optional[RequestConstants]]._unwrapper,
post_parser=ResultWrapper[RequestConstants]._unwrapper,
),
cast_to=cast(Type[Optional[RequestConstants]], ResultWrapper[RequestConstants]),
cast_to=cast(Type[RequestConstants], ResultWrapper[RequestConstants]),
)
async def get(
@ -820,7 +838,7 @@ class AsyncRequestsResource(AsyncAPIResource):
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[Item]:
) -> Item:
"""
Get a Request
@ -848,9 +866,9 @@ class AsyncRequestsResource(AsyncAPIResource):
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[Optional[Item]]._unwrapper,
post_parser=ResultWrapper[Item]._unwrapper,
),
cast_to=cast(Type[Optional[Item]], ResultWrapper[Item]),
cast_to=cast(Type[Item], ResultWrapper[Item]),
)
async def quota(
@ -863,7 +881,7 @@ class AsyncRequestsResource(AsyncAPIResource):
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[Quota]:
) -> Quota:
"""
Get Request Quota
@ -887,9 +905,9 @@ class AsyncRequestsResource(AsyncAPIResource):
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[Optional[Quota]]._unwrapper,
post_parser=ResultWrapper[Quota]._unwrapper,
),
cast_to=cast(Type[Optional[Quota]], ResultWrapper[Quota]),
cast_to=cast(Type[Quota], ResultWrapper[Quota]),
)
async def types(
@ -902,7 +920,7 @@ class AsyncRequestsResource(AsyncAPIResource):
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[RequestTypes]:
) -> RequestTypes:
"""
Get Request Types
@ -926,9 +944,9 @@ class AsyncRequestsResource(AsyncAPIResource):
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[Optional[RequestTypes]]._unwrapper,
post_parser=ResultWrapper[RequestTypes]._unwrapper,
),
cast_to=cast(Type[Optional[RequestTypes]], ResultWrapper[RequestTypes]),
cast_to=cast(Type[RequestTypes], ResultWrapper[RequestTypes]),
)

View file

@ -2,7 +2,7 @@
from __future__ import annotations
from typing import Type, Optional, cast
from typing import Type, cast
import httpx
@ -49,7 +49,7 @@ class WhoisResource(SyncAPIResource):
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[WhoisGetResponse]:
) -> WhoisGetResponse:
"""
Get WHOIS Record
@ -74,9 +74,9 @@ class WhoisResource(SyncAPIResource):
extra_body=extra_body,
timeout=timeout,
query=maybe_transform({"domain": domain}, whois_get_params.WhoisGetParams),
post_parser=ResultWrapper[Optional[WhoisGetResponse]]._unwrapper,
post_parser=ResultWrapper[WhoisGetResponse]._unwrapper,
),
cast_to=cast(Type[Optional[WhoisGetResponse]], ResultWrapper[WhoisGetResponse]),
cast_to=cast(Type[WhoisGetResponse], ResultWrapper[WhoisGetResponse]),
)
@ -100,7 +100,7 @@ class AsyncWhoisResource(AsyncAPIResource):
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[WhoisGetResponse]:
) -> WhoisGetResponse:
"""
Get WHOIS Record
@ -125,9 +125,9 @@ class AsyncWhoisResource(AsyncAPIResource):
extra_body=extra_body,
timeout=timeout,
query=await async_maybe_transform({"domain": domain}, whois_get_params.WhoisGetParams),
post_parser=ResultWrapper[Optional[WhoisGetResponse]]._unwrapper,
post_parser=ResultWrapper[WhoisGetResponse]._unwrapper,
),
cast_to=cast(Type[Optional[WhoisGetResponse]], ResultWrapper[WhoisGetResponse]),
cast_to=cast(Type[WhoisGetResponse], ResultWrapper[WhoisGetResponse]),
)

View file

@ -1,18 +1,7 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import List
from typing_extensions import Literal
from ..._models import BaseModel
from ..shared.response_info import ResponseInfo
from typing import List, Union
__all__ = ["RequestDeleteResponse"]
class RequestDeleteResponse(BaseModel):
errors: List[ResponseInfo]
messages: List[ResponseInfo]
success: Literal[True]
"""Whether the API call was successful"""
RequestDeleteResponse = Union[List[object], str, object]

View file

@ -1,18 +1,7 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import List
from typing_extensions import Literal
from ...._models import BaseModel
from ...shared.response_info import ResponseInfo
from typing import List, Union
__all__ = ["MessageDeleteResponse"]
class MessageDeleteResponse(BaseModel):
errors: List[ResponseInfo]
messages: List[ResponseInfo]
success: Literal[True]
"""Whether the API call was successful"""
MessageDeleteResponse = Union[List[object], str, object]

View file

@ -1,18 +1,7 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import List
from typing_extensions import Literal
from ...._models import BaseModel
from ...shared.response_info import ResponseInfo
from typing import List, Union
__all__ = ["PriorityDeleteResponse"]
class PriorityDeleteResponse(BaseModel):
errors: List[ResponseInfo]
messages: List[ResponseInfo]
success: Literal[True]
"""Whether the API call was successful"""
PriorityDeleteResponse = Union[List[object], str, object]

View file

@ -3,7 +3,7 @@
from __future__ import annotations
import os
from typing import Any, Optional, cast
from typing import Any, cast
import pytest
@ -28,7 +28,7 @@ class TestMessage:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
)
assert_matches_type(Optional[Message], message, path=["response"])
assert_matches_type(Message, message, path=["response"])
@parametrize
def test_method_create_with_all_params(self, client: Cloudflare) -> None:
@ -37,7 +37,7 @@ class TestMessage:
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
content="Can you elaborate on the type of DoS that occurred?",
)
assert_matches_type(Optional[Message], message, path=["response"])
assert_matches_type(Message, message, path=["response"])
@parametrize
def test_raw_response_create(self, client: Cloudflare) -> None:
@ -49,7 +49,7 @@ class TestMessage:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
message = response.parse()
assert_matches_type(Optional[Message], message, path=["response"])
assert_matches_type(Message, message, path=["response"])
@parametrize
def test_streaming_response_create(self, client: Cloudflare) -> None:
@ -61,7 +61,7 @@ class TestMessage:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
message = response.parse()
assert_matches_type(Optional[Message], message, path=["response"])
assert_matches_type(Message, message, path=["response"])
assert cast(Any, response.is_closed) is True
@ -86,7 +86,7 @@ class TestMessage:
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
request_identifier="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
)
assert_matches_type(Optional[Message], message, path=["response"])
assert_matches_type(Message, message, path=["response"])
@parametrize
def test_method_update_with_all_params(self, client: Cloudflare) -> None:
@ -100,7 +100,7 @@ class TestMessage:
summary="DoS attack",
tlp="clear",
)
assert_matches_type(Optional[Message], message, path=["response"])
assert_matches_type(Message, message, path=["response"])
@parametrize
def test_raw_response_update(self, client: Cloudflare) -> None:
@ -113,7 +113,7 @@ class TestMessage:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
message = response.parse()
assert_matches_type(Optional[Message], message, path=["response"])
assert_matches_type(Message, message, path=["response"])
@parametrize
def test_streaming_response_update(self, client: Cloudflare) -> None:
@ -126,7 +126,7 @@ class TestMessage:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
message = response.parse()
assert_matches_type(Optional[Message], message, path=["response"])
assert_matches_type(Message, message, path=["response"])
assert cast(Any, response.is_closed) is True
@ -207,7 +207,7 @@ class TestMessage:
page=0,
per_page=10,
)
assert_matches_type(Optional[MessageGetResponse], message, path=["response"])
assert_matches_type(MessageGetResponse, message, path=["response"])
@parametrize
def test_method_get_with_all_params(self, client: Cloudflare) -> None:
@ -221,7 +221,7 @@ class TestMessage:
sort_by="created",
sort_order="asc",
)
assert_matches_type(Optional[MessageGetResponse], message, path=["response"])
assert_matches_type(MessageGetResponse, message, path=["response"])
@parametrize
def test_raw_response_get(self, client: Cloudflare) -> None:
@ -235,7 +235,7 @@ class TestMessage:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
message = response.parse()
assert_matches_type(Optional[MessageGetResponse], message, path=["response"])
assert_matches_type(MessageGetResponse, message, path=["response"])
@parametrize
def test_streaming_response_get(self, client: Cloudflare) -> None:
@ -249,7 +249,7 @@ class TestMessage:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
message = response.parse()
assert_matches_type(Optional[MessageGetResponse], message, path=["response"])
assert_matches_type(MessageGetResponse, message, path=["response"])
assert cast(Any, response.is_closed) is True
@ -281,7 +281,7 @@ class TestAsyncMessage:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
)
assert_matches_type(Optional[Message], message, path=["response"])
assert_matches_type(Message, message, path=["response"])
@parametrize
async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None:
@ -290,7 +290,7 @@ class TestAsyncMessage:
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
content="Can you elaborate on the type of DoS that occurred?",
)
assert_matches_type(Optional[Message], message, path=["response"])
assert_matches_type(Message, message, path=["response"])
@parametrize
async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
@ -302,7 +302,7 @@ class TestAsyncMessage:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
message = await response.parse()
assert_matches_type(Optional[Message], message, path=["response"])
assert_matches_type(Message, message, path=["response"])
@parametrize
async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None:
@ -314,7 +314,7 @@ class TestAsyncMessage:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
message = await response.parse()
assert_matches_type(Optional[Message], message, path=["response"])
assert_matches_type(Message, message, path=["response"])
assert cast(Any, response.is_closed) is True
@ -339,7 +339,7 @@ class TestAsyncMessage:
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
request_identifier="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
)
assert_matches_type(Optional[Message], message, path=["response"])
assert_matches_type(Message, message, path=["response"])
@parametrize
async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None:
@ -353,7 +353,7 @@ class TestAsyncMessage:
summary="DoS attack",
tlp="clear",
)
assert_matches_type(Optional[Message], message, path=["response"])
assert_matches_type(Message, message, path=["response"])
@parametrize
async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None:
@ -366,7 +366,7 @@ class TestAsyncMessage:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
message = await response.parse()
assert_matches_type(Optional[Message], message, path=["response"])
assert_matches_type(Message, message, path=["response"])
@parametrize
async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None:
@ -379,7 +379,7 @@ class TestAsyncMessage:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
message = await response.parse()
assert_matches_type(Optional[Message], message, path=["response"])
assert_matches_type(Message, message, path=["response"])
assert cast(Any, response.is_closed) is True
@ -460,7 +460,7 @@ class TestAsyncMessage:
page=0,
per_page=10,
)
assert_matches_type(Optional[MessageGetResponse], message, path=["response"])
assert_matches_type(MessageGetResponse, message, path=["response"])
@parametrize
async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None:
@ -474,7 +474,7 @@ class TestAsyncMessage:
sort_by="created",
sort_order="asc",
)
assert_matches_type(Optional[MessageGetResponse], message, path=["response"])
assert_matches_type(MessageGetResponse, message, path=["response"])
@parametrize
async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
@ -488,7 +488,7 @@ class TestAsyncMessage:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
message = await response.parse()
assert_matches_type(Optional[MessageGetResponse], message, path=["response"])
assert_matches_type(MessageGetResponse, message, path=["response"])
@parametrize
async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None:
@ -502,7 +502,7 @@ class TestAsyncMessage:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
message = await response.parse()
assert_matches_type(Optional[MessageGetResponse], message, path=["response"])
assert_matches_type(MessageGetResponse, message, path=["response"])
assert cast(Any, response.is_closed) is True

View file

@ -3,7 +3,7 @@
from __future__ import annotations
import os
from typing import Any, Optional, cast
from typing import Any, cast
import pytest
@ -30,7 +30,7 @@ class TestPriority:
requirement="DoS attacks carried out by CVEs",
tlp="clear",
)
assert_matches_type(Optional[Priority], priority, path=["response"])
assert_matches_type(Priority, priority, path=["response"])
@parametrize
def test_raw_response_create(self, client: Cloudflare) -> None:
@ -45,7 +45,7 @@ class TestPriority:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
priority = response.parse()
assert_matches_type(Optional[Priority], priority, path=["response"])
assert_matches_type(Priority, priority, path=["response"])
@parametrize
def test_streaming_response_create(self, client: Cloudflare) -> None:
@ -60,7 +60,7 @@ class TestPriority:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
priority = response.parse()
assert_matches_type(Optional[Priority], priority, path=["response"])
assert_matches_type(Priority, priority, path=["response"])
assert cast(Any, response.is_closed) is True
@ -85,7 +85,7 @@ class TestPriority:
requirement="DoS attacks carried out by CVEs",
tlp="clear",
)
assert_matches_type(Optional[Item], priority, path=["response"])
assert_matches_type(Item, priority, path=["response"])
@parametrize
def test_raw_response_update(self, client: Cloudflare) -> None:
@ -101,7 +101,7 @@ class TestPriority:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
priority = response.parse()
assert_matches_type(Optional[Item], priority, path=["response"])
assert_matches_type(Item, priority, path=["response"])
@parametrize
def test_streaming_response_update(self, client: Cloudflare) -> None:
@ -117,7 +117,7 @@ class TestPriority:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
priority = response.parse()
assert_matches_type(Optional[Item], priority, path=["response"])
assert_matches_type(Item, priority, path=["response"])
assert cast(Any, response.is_closed) is True
@ -197,7 +197,7 @@ class TestPriority:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
)
assert_matches_type(Optional[Item], priority, path=["response"])
assert_matches_type(Item, priority, path=["response"])
@parametrize
def test_raw_response_get(self, client: Cloudflare) -> None:
@ -209,7 +209,7 @@ class TestPriority:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
priority = response.parse()
assert_matches_type(Optional[Item], priority, path=["response"])
assert_matches_type(Item, priority, path=["response"])
@parametrize
def test_streaming_response_get(self, client: Cloudflare) -> None:
@ -221,7 +221,7 @@ class TestPriority:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
priority = response.parse()
assert_matches_type(Optional[Item], priority, path=["response"])
assert_matches_type(Item, priority, path=["response"])
assert cast(Any, response.is_closed) is True
@ -244,7 +244,7 @@ class TestPriority:
priority = client.cloudforce_one.requests.priority.quota(
"023e105f4ecef8ad9ca31a8372d0c353",
)
assert_matches_type(Optional[Quota], priority, path=["response"])
assert_matches_type(Quota, priority, path=["response"])
@parametrize
def test_raw_response_quota(self, client: Cloudflare) -> None:
@ -255,7 +255,7 @@ class TestPriority:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
priority = response.parse()
assert_matches_type(Optional[Quota], priority, path=["response"])
assert_matches_type(Quota, priority, path=["response"])
@parametrize
def test_streaming_response_quota(self, client: Cloudflare) -> None:
@ -266,7 +266,7 @@ class TestPriority:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
priority = response.parse()
assert_matches_type(Optional[Quota], priority, path=["response"])
assert_matches_type(Quota, priority, path=["response"])
assert cast(Any, response.is_closed) is True
@ -290,7 +290,7 @@ class TestAsyncPriority:
requirement="DoS attacks carried out by CVEs",
tlp="clear",
)
assert_matches_type(Optional[Priority], priority, path=["response"])
assert_matches_type(Priority, priority, path=["response"])
@parametrize
async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
@ -305,7 +305,7 @@ class TestAsyncPriority:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
priority = await response.parse()
assert_matches_type(Optional[Priority], priority, path=["response"])
assert_matches_type(Priority, priority, path=["response"])
@parametrize
async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None:
@ -320,7 +320,7 @@ class TestAsyncPriority:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
priority = await response.parse()
assert_matches_type(Optional[Priority], priority, path=["response"])
assert_matches_type(Priority, priority, path=["response"])
assert cast(Any, response.is_closed) is True
@ -345,7 +345,7 @@ class TestAsyncPriority:
requirement="DoS attacks carried out by CVEs",
tlp="clear",
)
assert_matches_type(Optional[Item], priority, path=["response"])
assert_matches_type(Item, priority, path=["response"])
@parametrize
async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None:
@ -361,7 +361,7 @@ class TestAsyncPriority:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
priority = await response.parse()
assert_matches_type(Optional[Item], priority, path=["response"])
assert_matches_type(Item, priority, path=["response"])
@parametrize
async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None:
@ -377,7 +377,7 @@ class TestAsyncPriority:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
priority = await response.parse()
assert_matches_type(Optional[Item], priority, path=["response"])
assert_matches_type(Item, priority, path=["response"])
assert cast(Any, response.is_closed) is True
@ -457,7 +457,7 @@ class TestAsyncPriority:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
)
assert_matches_type(Optional[Item], priority, path=["response"])
assert_matches_type(Item, priority, path=["response"])
@parametrize
async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
@ -469,7 +469,7 @@ class TestAsyncPriority:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
priority = await response.parse()
assert_matches_type(Optional[Item], priority, path=["response"])
assert_matches_type(Item, priority, path=["response"])
@parametrize
async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None:
@ -481,7 +481,7 @@ class TestAsyncPriority:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
priority = await response.parse()
assert_matches_type(Optional[Item], priority, path=["response"])
assert_matches_type(Item, priority, path=["response"])
assert cast(Any, response.is_closed) is True
@ -504,7 +504,7 @@ class TestAsyncPriority:
priority = await async_client.cloudforce_one.requests.priority.quota(
"023e105f4ecef8ad9ca31a8372d0c353",
)
assert_matches_type(Optional[Quota], priority, path=["response"])
assert_matches_type(Quota, priority, path=["response"])
@parametrize
async def test_raw_response_quota(self, async_client: AsyncCloudflare) -> None:
@ -515,7 +515,7 @@ class TestAsyncPriority:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
priority = await response.parse()
assert_matches_type(Optional[Quota], priority, path=["response"])
assert_matches_type(Quota, priority, path=["response"])
@parametrize
async def test_streaming_response_quota(self, async_client: AsyncCloudflare) -> None:
@ -526,7 +526,7 @@ class TestAsyncPriority:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
priority = await response.parse()
assert_matches_type(Optional[Quota], priority, path=["response"])
assert_matches_type(Quota, priority, path=["response"])
assert cast(Any, response.is_closed) is True

View file

@ -3,7 +3,7 @@
from __future__ import annotations
import os
from typing import Any, Optional, cast
from typing import Any, cast
import pytest
@ -31,7 +31,7 @@ class TestRequests:
request = client.cloudforce_one.requests.create(
"023e105f4ecef8ad9ca31a8372d0c353",
)
assert_matches_type(Optional[Item], request, path=["response"])
assert_matches_type(Item, request, path=["response"])
@parametrize
def test_method_create_with_all_params(self, client: Cloudflare) -> None:
@ -43,7 +43,7 @@ class TestRequests:
summary="DoS attack",
tlp="clear",
)
assert_matches_type(Optional[Item], request, path=["response"])
assert_matches_type(Item, request, path=["response"])
@parametrize
def test_raw_response_create(self, client: Cloudflare) -> None:
@ -54,7 +54,7 @@ class TestRequests:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
request = response.parse()
assert_matches_type(Optional[Item], request, path=["response"])
assert_matches_type(Item, request, path=["response"])
@parametrize
def test_streaming_response_create(self, client: Cloudflare) -> None:
@ -65,7 +65,7 @@ class TestRequests:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
request = response.parse()
assert_matches_type(Optional[Item], request, path=["response"])
assert_matches_type(Item, request, path=["response"])
assert cast(Any, response.is_closed) is True
@ -82,7 +82,7 @@ class TestRequests:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
)
assert_matches_type(Optional[Item], request, path=["response"])
assert_matches_type(Item, request, path=["response"])
@parametrize
def test_method_update_with_all_params(self, client: Cloudflare) -> None:
@ -95,7 +95,7 @@ class TestRequests:
summary="DoS attack",
tlp="clear",
)
assert_matches_type(Optional[Item], request, path=["response"])
assert_matches_type(Item, request, path=["response"])
@parametrize
def test_raw_response_update(self, client: Cloudflare) -> None:
@ -107,7 +107,7 @@ class TestRequests:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
request = response.parse()
assert_matches_type(Optional[Item], request, path=["response"])
assert_matches_type(Item, request, path=["response"])
@parametrize
def test_streaming_response_update(self, client: Cloudflare) -> None:
@ -119,7 +119,7 @@ class TestRequests:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
request = response.parse()
assert_matches_type(Optional[Item], request, path=["response"])
assert_matches_type(Item, request, path=["response"])
assert cast(Any, response.is_closed) is True
@ -253,7 +253,7 @@ class TestRequests:
request = client.cloudforce_one.requests.constants(
"023e105f4ecef8ad9ca31a8372d0c353",
)
assert_matches_type(Optional[RequestConstants], request, path=["response"])
assert_matches_type(RequestConstants, request, path=["response"])
@parametrize
def test_raw_response_constants(self, client: Cloudflare) -> None:
@ -264,7 +264,7 @@ class TestRequests:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
request = response.parse()
assert_matches_type(Optional[RequestConstants], request, path=["response"])
assert_matches_type(RequestConstants, request, path=["response"])
@parametrize
def test_streaming_response_constants(self, client: Cloudflare) -> None:
@ -275,7 +275,7 @@ class TestRequests:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
request = response.parse()
assert_matches_type(Optional[RequestConstants], request, path=["response"])
assert_matches_type(RequestConstants, request, path=["response"])
assert cast(Any, response.is_closed) is True
@ -292,7 +292,7 @@ class TestRequests:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
)
assert_matches_type(Optional[Item], request, path=["response"])
assert_matches_type(Item, request, path=["response"])
@parametrize
def test_raw_response_get(self, client: Cloudflare) -> None:
@ -304,7 +304,7 @@ class TestRequests:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
request = response.parse()
assert_matches_type(Optional[Item], request, path=["response"])
assert_matches_type(Item, request, path=["response"])
@parametrize
def test_streaming_response_get(self, client: Cloudflare) -> None:
@ -316,7 +316,7 @@ class TestRequests:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
request = response.parse()
assert_matches_type(Optional[Item], request, path=["response"])
assert_matches_type(Item, request, path=["response"])
assert cast(Any, response.is_closed) is True
@ -339,7 +339,7 @@ class TestRequests:
request = client.cloudforce_one.requests.quota(
"023e105f4ecef8ad9ca31a8372d0c353",
)
assert_matches_type(Optional[Quota], request, path=["response"])
assert_matches_type(Quota, request, path=["response"])
@parametrize
def test_raw_response_quota(self, client: Cloudflare) -> None:
@ -350,7 +350,7 @@ class TestRequests:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
request = response.parse()
assert_matches_type(Optional[Quota], request, path=["response"])
assert_matches_type(Quota, request, path=["response"])
@parametrize
def test_streaming_response_quota(self, client: Cloudflare) -> None:
@ -361,7 +361,7 @@ class TestRequests:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
request = response.parse()
assert_matches_type(Optional[Quota], request, path=["response"])
assert_matches_type(Quota, request, path=["response"])
assert cast(Any, response.is_closed) is True
@ -377,7 +377,7 @@ class TestRequests:
request = client.cloudforce_one.requests.types(
"023e105f4ecef8ad9ca31a8372d0c353",
)
assert_matches_type(Optional[RequestTypes], request, path=["response"])
assert_matches_type(RequestTypes, request, path=["response"])
@parametrize
def test_raw_response_types(self, client: Cloudflare) -> None:
@ -388,7 +388,7 @@ class TestRequests:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
request = response.parse()
assert_matches_type(Optional[RequestTypes], request, path=["response"])
assert_matches_type(RequestTypes, request, path=["response"])
@parametrize
def test_streaming_response_types(self, client: Cloudflare) -> None:
@ -399,7 +399,7 @@ class TestRequests:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
request = response.parse()
assert_matches_type(Optional[RequestTypes], request, path=["response"])
assert_matches_type(RequestTypes, request, path=["response"])
assert cast(Any, response.is_closed) is True
@ -419,7 +419,7 @@ class TestAsyncRequests:
request = await async_client.cloudforce_one.requests.create(
"023e105f4ecef8ad9ca31a8372d0c353",
)
assert_matches_type(Optional[Item], request, path=["response"])
assert_matches_type(Item, request, path=["response"])
@parametrize
async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None:
@ -431,7 +431,7 @@ class TestAsyncRequests:
summary="DoS attack",
tlp="clear",
)
assert_matches_type(Optional[Item], request, path=["response"])
assert_matches_type(Item, request, path=["response"])
@parametrize
async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
@ -442,7 +442,7 @@ class TestAsyncRequests:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
request = await response.parse()
assert_matches_type(Optional[Item], request, path=["response"])
assert_matches_type(Item, request, path=["response"])
@parametrize
async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None:
@ -453,7 +453,7 @@ class TestAsyncRequests:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
request = await response.parse()
assert_matches_type(Optional[Item], request, path=["response"])
assert_matches_type(Item, request, path=["response"])
assert cast(Any, response.is_closed) is True
@ -470,7 +470,7 @@ class TestAsyncRequests:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
)
assert_matches_type(Optional[Item], request, path=["response"])
assert_matches_type(Item, request, path=["response"])
@parametrize
async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None:
@ -483,7 +483,7 @@ class TestAsyncRequests:
summary="DoS attack",
tlp="clear",
)
assert_matches_type(Optional[Item], request, path=["response"])
assert_matches_type(Item, request, path=["response"])
@parametrize
async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None:
@ -495,7 +495,7 @@ class TestAsyncRequests:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
request = await response.parse()
assert_matches_type(Optional[Item], request, path=["response"])
assert_matches_type(Item, request, path=["response"])
@parametrize
async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None:
@ -507,7 +507,7 @@ class TestAsyncRequests:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
request = await response.parse()
assert_matches_type(Optional[Item], request, path=["response"])
assert_matches_type(Item, request, path=["response"])
assert cast(Any, response.is_closed) is True
@ -641,7 +641,7 @@ class TestAsyncRequests:
request = await async_client.cloudforce_one.requests.constants(
"023e105f4ecef8ad9ca31a8372d0c353",
)
assert_matches_type(Optional[RequestConstants], request, path=["response"])
assert_matches_type(RequestConstants, request, path=["response"])
@parametrize
async def test_raw_response_constants(self, async_client: AsyncCloudflare) -> None:
@ -652,7 +652,7 @@ class TestAsyncRequests:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
request = await response.parse()
assert_matches_type(Optional[RequestConstants], request, path=["response"])
assert_matches_type(RequestConstants, request, path=["response"])
@parametrize
async def test_streaming_response_constants(self, async_client: AsyncCloudflare) -> None:
@ -663,7 +663,7 @@ class TestAsyncRequests:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
request = await response.parse()
assert_matches_type(Optional[RequestConstants], request, path=["response"])
assert_matches_type(RequestConstants, request, path=["response"])
assert cast(Any, response.is_closed) is True
@ -680,7 +680,7 @@ class TestAsyncRequests:
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_identifier="023e105f4ecef8ad9ca31a8372d0c353",
)
assert_matches_type(Optional[Item], request, path=["response"])
assert_matches_type(Item, request, path=["response"])
@parametrize
async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
@ -692,7 +692,7 @@ class TestAsyncRequests:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
request = await response.parse()
assert_matches_type(Optional[Item], request, path=["response"])
assert_matches_type(Item, request, path=["response"])
@parametrize
async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None:
@ -704,7 +704,7 @@ class TestAsyncRequests:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
request = await response.parse()
assert_matches_type(Optional[Item], request, path=["response"])
assert_matches_type(Item, request, path=["response"])
assert cast(Any, response.is_closed) is True
@ -727,7 +727,7 @@ class TestAsyncRequests:
request = await async_client.cloudforce_one.requests.quota(
"023e105f4ecef8ad9ca31a8372d0c353",
)
assert_matches_type(Optional[Quota], request, path=["response"])
assert_matches_type(Quota, request, path=["response"])
@parametrize
async def test_raw_response_quota(self, async_client: AsyncCloudflare) -> None:
@ -738,7 +738,7 @@ class TestAsyncRequests:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
request = await response.parse()
assert_matches_type(Optional[Quota], request, path=["response"])
assert_matches_type(Quota, request, path=["response"])
@parametrize
async def test_streaming_response_quota(self, async_client: AsyncCloudflare) -> None:
@ -749,7 +749,7 @@ class TestAsyncRequests:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
request = await response.parse()
assert_matches_type(Optional[Quota], request, path=["response"])
assert_matches_type(Quota, request, path=["response"])
assert cast(Any, response.is_closed) is True
@ -765,7 +765,7 @@ class TestAsyncRequests:
request = await async_client.cloudforce_one.requests.types(
"023e105f4ecef8ad9ca31a8372d0c353",
)
assert_matches_type(Optional[RequestTypes], request, path=["response"])
assert_matches_type(RequestTypes, request, path=["response"])
@parametrize
async def test_raw_response_types(self, async_client: AsyncCloudflare) -> None:
@ -776,7 +776,7 @@ class TestAsyncRequests:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
request = await response.parse()
assert_matches_type(Optional[RequestTypes], request, path=["response"])
assert_matches_type(RequestTypes, request, path=["response"])
@parametrize
async def test_streaming_response_types(self, async_client: AsyncCloudflare) -> None:
@ -787,7 +787,7 @@ class TestAsyncRequests:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
request = await response.parse()
assert_matches_type(Optional[RequestTypes], request, path=["response"])
assert_matches_type(RequestTypes, request, path=["response"])
assert cast(Any, response.is_closed) is True

View file

@ -3,7 +3,7 @@
from __future__ import annotations
import os
from typing import Any, Optional, cast
from typing import Any, cast
import pytest
@ -22,7 +22,7 @@ class TestWhois:
whois = client.intel.whois.get(
account_id="023e105f4ecef8ad9ca31a8372d0c353",
)
assert_matches_type(Optional[WhoisGetResponse], whois, path=["response"])
assert_matches_type(WhoisGetResponse, whois, path=["response"])
@parametrize
def test_method_get_with_all_params(self, client: Cloudflare) -> None:
@ -30,7 +30,7 @@ class TestWhois:
account_id="023e105f4ecef8ad9ca31a8372d0c353",
domain="string",
)
assert_matches_type(Optional[WhoisGetResponse], whois, path=["response"])
assert_matches_type(WhoisGetResponse, whois, path=["response"])
@parametrize
def test_raw_response_get(self, client: Cloudflare) -> None:
@ -41,7 +41,7 @@ class TestWhois:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
whois = response.parse()
assert_matches_type(Optional[WhoisGetResponse], whois, path=["response"])
assert_matches_type(WhoisGetResponse, whois, path=["response"])
@parametrize
def test_streaming_response_get(self, client: Cloudflare) -> None:
@ -52,7 +52,7 @@ class TestWhois:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
whois = response.parse()
assert_matches_type(Optional[WhoisGetResponse], whois, path=["response"])
assert_matches_type(WhoisGetResponse, whois, path=["response"])
assert cast(Any, response.is_closed) is True
@ -72,7 +72,7 @@ class TestAsyncWhois:
whois = await async_client.intel.whois.get(
account_id="023e105f4ecef8ad9ca31a8372d0c353",
)
assert_matches_type(Optional[WhoisGetResponse], whois, path=["response"])
assert_matches_type(WhoisGetResponse, whois, path=["response"])
@parametrize
async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None:
@ -80,7 +80,7 @@ class TestAsyncWhois:
account_id="023e105f4ecef8ad9ca31a8372d0c353",
domain="string",
)
assert_matches_type(Optional[WhoisGetResponse], whois, path=["response"])
assert_matches_type(WhoisGetResponse, whois, path=["response"])
@parametrize
async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
@ -91,7 +91,7 @@ class TestAsyncWhois:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
whois = await response.parse()
assert_matches_type(Optional[WhoisGetResponse], whois, path=["response"])
assert_matches_type(WhoisGetResponse, whois, path=["response"])
@parametrize
async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None:
@ -102,7 +102,7 @@ class TestAsyncWhois:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
whois = await response.parse()
assert_matches_type(Optional[WhoisGetResponse], whois, path=["response"])
assert_matches_type(WhoisGetResponse, whois, path=["response"])
assert cast(Any, response.is_closed) is True