Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#383)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Apr 30, 2024
1 parent 9ab962f commit ddfd969
Show file tree
Hide file tree
Showing 13 changed files with 102 additions and 102 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 1259
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1f0167c5fee5c0cadf72c222f47f8fc3ba43905607b21f6a88853c061117b77b.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-543a9898a4efc4501e7101d78908dcfaa303efd8f2abb7164299dd85be87749d.yml
12 changes: 6 additions & 6 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3409,8 +3409,8 @@ from cloudflare.types.brand_protection import (

Methods:

- <code title="post /accounts/{account_id}/brand-protection/submit">client.brand_protection.<a href="./src/cloudflare/resources/brand_protection.py">submit</a>(\*, account_id, \*\*<a href="src/cloudflare/types/brand_protection/brand_protection_submit_params.py">params</a>) -> <a href="./src/cloudflare/types/brand_protection/submit.py">Submit</a></code>
- <code title="get /accounts/{account_id}/brand-protection/url-info">client.brand_protection.<a href="./src/cloudflare/resources/brand_protection.py">url_info</a>(\*, account_id, \*\*<a href="src/cloudflare/types/brand_protection/brand_protection_url_info_params.py">params</a>) -> <a href="./src/cloudflare/types/brand_protection/info.py">Info</a></code>
- <code title="post /accounts/{account_id}/brand-protection/submit">client.brand_protection.<a href="./src/cloudflare/resources/brand_protection.py">submit</a>(\*, account_id, \*\*<a href="src/cloudflare/types/brand_protection/brand_protection_submit_params.py">params</a>) -> <a href="./src/cloudflare/types/brand_protection/submit.py">Optional</a></code>
- <code title="get /accounts/{account_id}/brand-protection/url-info">client.brand_protection.<a href="./src/cloudflare/resources/brand_protection.py">url_info</a>(\*, account_id, \*\*<a href="src/cloudflare/types/brand_protection/brand_protection_url_info_params.py">params</a>) -> <a href="./src/cloudflare/types/brand_protection/info.py">Optional</a></code>

# Diagnostics

Expand Down Expand Up @@ -3528,7 +3528,7 @@ Methods:

Methods:

- <code title="get /accounts/{account_id}/intel/asn/{asn}">client.intel.asn.<a href="./src/cloudflare/resources/intel/asn/asn.py">get</a>(asn, \*, account_id) -> <a href="./src/cloudflare/types/shared/asn.py">ASN</a></code>
- <code title="get /accounts/{account_id}/intel/asn/{asn}">client.intel.asn.<a href="./src/cloudflare/resources/intel/asn/asn.py">get</a>(asn, \*, account_id) -> <a href="./src/cloudflare/types/shared/asn.py">Optional</a></code>

### Subnets

Expand Down Expand Up @@ -3564,7 +3564,7 @@ from cloudflare.types.intel import Domain

Methods:

- <code title="get /accounts/{account_id}/intel/domain">client.intel.domains.<a href="./src/cloudflare/resources/intel/domains/domains.py">get</a>(\*, account_id, \*\*<a href="src/cloudflare/types/intel/domain_get_params.py">params</a>) -> <a href="./src/cloudflare/types/intel/domain.py">Domain</a></code>
- <code title="get /accounts/{account_id}/intel/domain">client.intel.domains.<a href="./src/cloudflare/resources/intel/domains/domains.py">get</a>(\*, account_id, \*\*<a href="src/cloudflare/types/intel/domain_get_params.py">params</a>) -> <a href="./src/cloudflare/types/intel/domain.py">Optional</a></code>

### Bulks

Expand Down Expand Up @@ -3624,7 +3624,7 @@ from cloudflare.types.intel import MiscategorizationCreateResponse

Methods:

- <code title="post /accounts/{account_id}/intel/miscategorization">client.intel.miscategorizations.<a href="./src/cloudflare/resources/intel/miscategorizations.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/intel/miscategorization_create_params.py">params</a>) -> <a href="./src/cloudflare/types/intel/miscategorization_create_response.py">MiscategorizationCreateResponse</a></code>
- <code title="post /accounts/{account_id}/intel/miscategorization">client.intel.miscategorizations.<a href="./src/cloudflare/resources/intel/miscategorizations.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/intel/miscategorization_create_params.py">params</a>) -> <a href="./src/cloudflare/types/intel/miscategorization_create_response.py">Optional</a></code>

## Whois

Expand All @@ -3636,7 +3636,7 @@ from cloudflare.types.intel import Whois

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.py">Whois</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.py">Optional</a></code>

## IndicatorFeeds

Expand Down
26 changes: 13 additions & 13 deletions src/cloudflare/resources/brand_protection.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import Type, cast
from typing import Type, Optional, cast

import httpx

Expand Down Expand Up @@ -50,7 +50,7 @@ def submit(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Submit:
) -> Optional[Submit]:
"""
Submit suspicious URL for scanning
Expand All @@ -77,9 +77,9 @@ def submit(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[Submit]._unwrapper,
post_parser=ResultWrapper[Optional[Submit]]._unwrapper,
),
cast_to=cast(Type[Submit], ResultWrapper[Submit]),
cast_to=cast(Type[Optional[Submit]], ResultWrapper[Submit]),
)

def url_info(
Expand All @@ -94,7 +94,7 @@ def url_info(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Info:
) -> Optional[Info]:
"""
Get results for a URL scan
Expand Down Expand Up @@ -125,9 +125,9 @@ def url_info(
},
brand_protection_url_info_params.BrandProtectionURLInfoParams,
),
post_parser=ResultWrapper[Info]._unwrapper,
post_parser=ResultWrapper[Optional[Info]]._unwrapper,
),
cast_to=cast(Type[Info], ResultWrapper[Info]),
cast_to=cast(Type[Optional[Info]], ResultWrapper[Info]),
)


Expand All @@ -151,7 +151,7 @@ async def submit(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Submit:
) -> Optional[Submit]:
"""
Submit suspicious URL for scanning
Expand All @@ -178,9 +178,9 @@ async def submit(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[Submit]._unwrapper,
post_parser=ResultWrapper[Optional[Submit]]._unwrapper,
),
cast_to=cast(Type[Submit], ResultWrapper[Submit]),
cast_to=cast(Type[Optional[Submit]], ResultWrapper[Submit]),
)

async def url_info(
Expand All @@ -195,7 +195,7 @@ async def url_info(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Info:
) -> Optional[Info]:
"""
Get results for a URL scan
Expand Down Expand Up @@ -226,9 +226,9 @@ async def url_info(
},
brand_protection_url_info_params.BrandProtectionURLInfoParams,
),
post_parser=ResultWrapper[Info]._unwrapper,
post_parser=ResultWrapper[Optional[Info]]._unwrapper,
),
cast_to=cast(Type[Info], ResultWrapper[Info]),
cast_to=cast(Type[Optional[Info]], ResultWrapper[Info]),
)


Expand Down
14 changes: 7 additions & 7 deletions src/cloudflare/resources/intel/asn/asn.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import Type, cast
from typing import Type, Optional, cast

import httpx

Expand Down Expand Up @@ -56,7 +56,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> ASN:
) -> Optional[ASN]:
"""
Get ASN Overview
Expand All @@ -80,9 +80,9 @@ def get(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[ASN]._unwrapper,
post_parser=ResultWrapper[Optional[ASN]]._unwrapper,
),
cast_to=cast(Type[ASN], ResultWrapper[int]),
cast_to=cast(Type[Optional[ASN]], ResultWrapper[int]),
)


Expand Down Expand Up @@ -110,7 +110,7 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> ASN:
) -> Optional[ASN]:
"""
Get ASN Overview
Expand All @@ -134,9 +134,9 @@ async def get(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[ASN]._unwrapper,
post_parser=ResultWrapper[Optional[ASN]]._unwrapper,
),
cast_to=cast(Type[ASN], ResultWrapper[int]),
cast_to=cast(Type[Optional[ASN]], ResultWrapper[int]),
)


Expand Down
14 changes: 7 additions & 7 deletions src/cloudflare/resources/intel/domains/domains.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import Type, cast
from typing import Type, Optional, cast

import httpx

Expand Down Expand Up @@ -61,7 +61,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Domain:
) -> Optional[Domain]:
"""
Get Domain Details
Expand All @@ -86,9 +86,9 @@ def get(
extra_body=extra_body,
timeout=timeout,
query=maybe_transform({"domain": domain}, domain_get_params.DomainGetParams),
post_parser=ResultWrapper[Domain]._unwrapper,
post_parser=ResultWrapper[Optional[Domain]]._unwrapper,
),
cast_to=cast(Type[Domain], ResultWrapper[Domain]),
cast_to=cast(Type[Optional[Domain]], ResultWrapper[Domain]),
)


Expand Down Expand Up @@ -116,7 +116,7 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Domain:
) -> Optional[Domain]:
"""
Get Domain Details
Expand All @@ -141,9 +141,9 @@ async def get(
extra_body=extra_body,
timeout=timeout,
query=await async_maybe_transform({"domain": domain}, domain_get_params.DomainGetParams),
post_parser=ResultWrapper[Domain]._unwrapper,
post_parser=ResultWrapper[Optional[Domain]]._unwrapper,
),
cast_to=cast(Type[Domain], ResultWrapper[Domain]),
cast_to=cast(Type[Optional[Domain]], ResultWrapper[Domain]),
)


Expand Down
14 changes: 7 additions & 7 deletions src/cloudflare/resources/intel/miscategorizations.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import Any, Iterable, cast
from typing import Any, Iterable, Optional, cast
from typing_extensions import Literal

import httpx
Expand Down Expand Up @@ -56,7 +56,7 @@ def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> MiscategorizationCreateResponse:
) -> Optional[MiscategorizationCreateResponse]:
"""
Create Miscategorization
Expand Down Expand Up @@ -88,7 +88,7 @@ def create(
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return cast(
MiscategorizationCreateResponse,
Optional[MiscategorizationCreateResponse],
self._post(
f"/accounts/{account_id}/intel/miscategorization",
body=maybe_transform(
Expand All @@ -108,7 +108,7 @@ def create(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[MiscategorizationCreateResponse]._unwrapper,
post_parser=ResultWrapper[Optional[MiscategorizationCreateResponse]]._unwrapper,
),
cast_to=cast(
Any, ResultWrapper[MiscategorizationCreateResponse]
Expand Down Expand Up @@ -143,7 +143,7 @@ async def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> MiscategorizationCreateResponse:
) -> Optional[MiscategorizationCreateResponse]:
"""
Create Miscategorization
Expand Down Expand Up @@ -175,7 +175,7 @@ async def create(
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return cast(
MiscategorizationCreateResponse,
Optional[MiscategorizationCreateResponse],
await self._post(
f"/accounts/{account_id}/intel/miscategorization",
body=await async_maybe_transform(
Expand All @@ -195,7 +195,7 @@ async def create(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[MiscategorizationCreateResponse]._unwrapper,
post_parser=ResultWrapper[Optional[MiscategorizationCreateResponse]]._unwrapper,
),
cast_to=cast(
Any, ResultWrapper[MiscategorizationCreateResponse]
Expand Down
14 changes: 7 additions & 7 deletions src/cloudflare/resources/intel/whois.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import Type, cast
from typing import Type, Optional, cast

import httpx

Expand Down Expand Up @@ -49,7 +49,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Whois:
) -> Optional[Whois]:
"""
Get WHOIS Record
Expand All @@ -74,9 +74,9 @@ def get(
extra_body=extra_body,
timeout=timeout,
query=maybe_transform({"domain": domain}, whois_get_params.WhoisGetParams),
post_parser=ResultWrapper[Whois]._unwrapper,
post_parser=ResultWrapper[Optional[Whois]]._unwrapper,
),
cast_to=cast(Type[Whois], ResultWrapper[Whois]),
cast_to=cast(Type[Optional[Whois]], ResultWrapper[Whois]),
)


Expand All @@ -100,7 +100,7 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Whois:
) -> Optional[Whois]:
"""
Get WHOIS Record
Expand All @@ -125,9 +125,9 @@ async def get(
extra_body=extra_body,
timeout=timeout,
query=await async_maybe_transform({"domain": domain}, whois_get_params.WhoisGetParams),
post_parser=ResultWrapper[Whois]._unwrapper,
post_parser=ResultWrapper[Optional[Whois]]._unwrapper,
),
cast_to=cast(Type[Whois], ResultWrapper[Whois]),
cast_to=cast(Type[Optional[Whois]], ResultWrapper[Whois]),
)


Expand Down
6 changes: 3 additions & 3 deletions src/cloudflare/types/intel/dns_list_response.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import List
from typing import List, Optional
from typing_extensions import Literal

from .dns import DNS
Expand All @@ -15,7 +15,7 @@ class DNSListResponse(BaseModel):

messages: List[ResponseInfo]

result: DNS

success: Literal[True]
"""Whether the API call was successful"""

result: Optional[DNS] = None
Loading

0 comments on commit ddfd969

Please sign in to comment.