Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 2194
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0ce49e6bb0d3819f135b9a567b661205fdf5df21cff157eab2b7abd7b5b50347.yml
openapi_spec_hash: 512a5bb3a32860590c8949765605d65a
config_hash: 5367ae3e3a9a0d6578c2756965a99e3a
configured_endpoints: 2184
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-95d8075980561cae9cc6ce09b5f930b84eae6f0864cb155abe47db94df2ee294.yml
openapi_spec_hash: 86610e8d69a7b3f8b83cb5f6a0a7c96e
config_hash: 95239e8fc62638979bc21e538307bbe3
8 changes: 5 additions & 3 deletions scripts/mock
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ set -e

cd "$(dirname "$0")/.."

MOCK_PORT="${MOCK_PORT:-4012}"

if [[ -n "$1" && "$1" != '--'* ]]; then
URL="$1"
shift
Expand All @@ -17,14 +19,14 @@ if [ -z "$URL" ]; then
exit 1
fi

echo "==> Starting mock server with URL ${URL}"
echo "==> Starting mock server with URL ${URL} on port ${MOCK_PORT}"

# Run prism mock on the given spec
if [ "$1" == "--daemon" ]; then
# Pre-install the package so the download doesn't eat into the startup timeout
npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism --version

npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log &
npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" -p "$MOCK_PORT" &> .prism.log &

# Wait for server to come online (max 30s)
echo -n "Waiting for server"
Expand All @@ -48,5 +50,5 @@ if [ "$1" == "--daemon" ]; then

echo
else
npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL"
npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" -p "$MOCK_PORT"
fi
6 changes: 4 additions & 2 deletions scripts/test
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ GREEN='\033[0;32m'
YELLOW='\033[0;33m'
NC='\033[0m' # No Color

MOCK_PORT="${MOCK_PORT:-4012}"

function prism_is_running() {
curl --silent "http://localhost:4010" >/dev/null 2>&1
curl --silent "http://localhost:${MOCK_PORT}" >/dev/null 2>&1
}

kill_server_on_port() {
Expand All @@ -27,7 +29,7 @@ function is_overriding_api_base_url() {

if ! is_overriding_api_base_url && ! prism_is_running ; then
# When we exit this script, make sure to kill the background mock server process
trap 'kill_server_on_port 4010' EXIT
trap 'kill_server_on_port $MOCK_PORT' EXIT

# Start the dev server
./scripts/mock --daemon
Expand Down
74 changes: 34 additions & 40 deletions src/cloudflare/resources/aisearch/instances/instances.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def create(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InstanceCreateResponse:
"""Create a new instances.
"""Create a new instance.

Args:
id: AI Search instance ID.
Expand Down Expand Up @@ -420,13 +420,10 @@ def update(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InstanceUpdateResponse:
"""Update instances.
"""
Update instance.

Args:
id: AI Search instance ID.

Lowercase alphanumeric, hyphens, and underscores.

index_method: Controls which storage backends are used during indexing. Defaults to
vector-only.

Expand Down Expand Up @@ -496,7 +493,7 @@ def list(
self,
*,
account_id: str,
namespace: Optional[str] | Omit = omit,
namespace: str | Omit = omit,
order_by: Literal["created_at"] | Omit = omit,
order_by_direction: Literal["asc", "desc"] | Omit = omit,
page: int | Omit = omit,
Expand All @@ -513,11 +510,17 @@ def list(
List instances.

Args:
order_by: Order By Column Name
namespace: Filter by namespace.

order_by_direction: Order By Direction
order_by: Field to order results by.

search: Search by id
order_by_direction: Order direction.

page: Page number (1-indexed).

per_page: Number of results per page.

search: Filter instances whose id contains this string (case-insensitive).

extra_headers: Send extra headers

Expand Down Expand Up @@ -564,13 +567,10 @@ def delete(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InstanceDeleteResponse:
"""Delete instances.
"""
Delete instance.

Args:
id: AI Search instance ID.

Lowercase alphanumeric, hyphens, and underscores.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand Down Expand Up @@ -693,13 +693,10 @@ def read(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InstanceReadResponse:
"""Read instances.
"""
Read instance.

Args:
id: AI Search instance ID.

Lowercase alphanumeric, hyphens, and underscores.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand Down Expand Up @@ -969,7 +966,7 @@ async def create(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InstanceCreateResponse:
"""Create a new instances.
"""Create a new instance.

Args:
id: AI Search instance ID.
Expand Down Expand Up @@ -1197,13 +1194,10 @@ async def update(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InstanceUpdateResponse:
"""Update instances.
"""
Update instance.

Args:
id: AI Search instance ID.

Lowercase alphanumeric, hyphens, and underscores.

index_method: Controls which storage backends are used during indexing. Defaults to
vector-only.

Expand Down Expand Up @@ -1273,7 +1267,7 @@ def list(
self,
*,
account_id: str,
namespace: Optional[str] | Omit = omit,
namespace: str | Omit = omit,
order_by: Literal["created_at"] | Omit = omit,
order_by_direction: Literal["asc", "desc"] | Omit = omit,
page: int | Omit = omit,
Expand All @@ -1290,11 +1284,17 @@ def list(
List instances.

Args:
order_by: Order By Column Name
namespace: Filter by namespace.

order_by_direction: Order By Direction
order_by: Field to order results by.

search: Search by id
order_by_direction: Order direction.

page: Page number (1-indexed).

per_page: Number of results per page.

search: Filter instances whose id contains this string (case-insensitive).

extra_headers: Send extra headers

Expand Down Expand Up @@ -1341,13 +1341,10 @@ async def delete(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InstanceDeleteResponse:
"""Delete instances.
"""
Delete instance.

Args:
id: AI Search instance ID.

Lowercase alphanumeric, hyphens, and underscores.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand Down Expand Up @@ -1470,13 +1467,10 @@ async def read(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InstanceReadResponse:
"""Read instances.
"""
Read instance.

Args:
id: AI Search instance ID.

Lowercase alphanumeric, hyphens, and underscores.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand Down
Loading
Loading