Skip to content

Commit 3e687a2

Browse files
chore(cloud)!: remove deprecated cloud.inference.deployments.get_api_key
1 parent 8338c44 commit 3e687a2

6 files changed

Lines changed: 2 additions & 228 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 658
1+
configured_endpoints: 657
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-e8141952a77a5faabf98feca4f964baaef5b84aa66d785c8b35357e48928df9c.yml
33
openapi_spec_hash: a5ff6021de586dafea9df886214ceb2c
4-
config_hash: 0adfdd90fff02d0c623f304ff15a85ae
4+
config_hash: 0b9fe3822aef92ebe43ad609b931bfc8

src/gcore/resources/cloud/api.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,6 @@ Methods:
524524
- <code title="get /cloud/v3/inference/{project_id}/deployments">client.cloud.inference.deployments.<a href="./src/gcore/resources/cloud/inference/deployments/deployments.py">list</a>(\*, project_id, \*\*<a href="src/gcore/types/cloud/inference/deployment_list_params.py">params</a>) -> <a href="./src/gcore/types/cloud/inference/inference_deployment.py">SyncOffsetPage[InferenceDeployment]</a></code>
525525
- <code title="delete /cloud/v3/inference/{project_id}/deployments/{deployment_name}">client.cloud.inference.deployments.<a href="./src/gcore/resources/cloud/inference/deployments/deployments.py">delete</a>(deployment_name, \*, project_id) -> <a href="./src/gcore/types/cloud/task_id_list.py">TaskIDList</a></code>
526526
- <code title="get /cloud/v3/inference/{project_id}/deployments/{deployment_name}">client.cloud.inference.deployments.<a href="./src/gcore/resources/cloud/inference/deployments/deployments.py">get</a>(deployment_name, \*, project_id) -> <a href="./src/gcore/types/cloud/inference/inference_deployment.py">InferenceDeployment</a></code>
527-
- <code title="get /cloud/v3/inference/{project_id}/deployments/{deployment_name}/apikey">client.cloud.inference.deployments.<a href="./src/gcore/resources/cloud/inference/deployments/deployments.py">get_api_key</a>(deployment_name, \*, project_id) -> <a href="./src/gcore/types/cloud/inference/inference_deployment_api_key.py">InferenceDeploymentAPIKey</a></code>
528527
- <code title="post /cloud/v3/inference/{project_id}/deployments/{deployment_name}/start">client.cloud.inference.deployments.<a href="./src/gcore/resources/cloud/inference/deployments/deployments.py">start</a>(deployment_name, \*, project_id) -> None</code>
529528
- <code title="post /cloud/v3/inference/{project_id}/deployments/{deployment_name}/stop">client.cloud.inference.deployments.<a href="./src/gcore/resources/cloud/inference/deployments/deployments.py">stop</a>(deployment_name, \*, project_id) -> None</code>
530529

src/gcore/resources/cloud/inference/deployments/deployments.py

Lines changed: 0 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from __future__ import annotations
44

5-
import typing_extensions
65
from typing import Dict, Iterable, Optional
76

87
import httpx
@@ -30,7 +29,6 @@
3029
from .....types.cloud.inference import deployment_list_params, deployment_create_params, deployment_update_params
3130
from .....types.cloud.task_id_list import TaskIDList
3231
from .....types.cloud.inference.inference_deployment import InferenceDeployment
33-
from .....types.cloud.inference.inference_deployment_api_key import InferenceDeploymentAPIKey
3432

3533
__all__ = ["DeploymentsResource", "AsyncDeploymentsResource"]
3634

@@ -439,51 +437,6 @@ def get(
439437
cast_to=InferenceDeployment,
440438
)
441439

442-
@typing_extensions.deprecated("deprecated")
443-
def get_api_key(
444-
self,
445-
deployment_name: str,
446-
*,
447-
project_id: int | None = None,
448-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
449-
# The extra values given here take precedence over values defined on the client or passed to this method.
450-
extra_headers: Headers | None = None,
451-
extra_query: Query | None = None,
452-
extra_body: Body | None = None,
453-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
454-
) -> InferenceDeploymentAPIKey:
455-
"""
456-
Get inference deployment API key
457-
458-
Args:
459-
project_id: Project ID
460-
461-
deployment_name: Inference instance name.
462-
463-
extra_headers: Send extra headers
464-
465-
extra_query: Add additional query parameters to the request
466-
467-
extra_body: Add additional JSON properties to the request
468-
469-
timeout: Override the client-level default timeout for this request, in seconds
470-
"""
471-
if project_id is None:
472-
project_id = self._client._get_cloud_project_id_path_param()
473-
if not deployment_name:
474-
raise ValueError(f"Expected a non-empty value for `deployment_name` but received {deployment_name!r}")
475-
return self._get(
476-
path_template(
477-
"/cloud/v3/inference/{project_id}/deployments/{deployment_name}/apikey",
478-
project_id=project_id,
479-
deployment_name=deployment_name,
480-
),
481-
options=make_request_options(
482-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
483-
),
484-
cast_to=InferenceDeploymentAPIKey,
485-
)
486-
487440
def start(
488441
self,
489442
deployment_name: str,
@@ -1166,51 +1119,6 @@ async def get(
11661119
cast_to=InferenceDeployment,
11671120
)
11681121

1169-
@typing_extensions.deprecated("deprecated")
1170-
async def get_api_key(
1171-
self,
1172-
deployment_name: str,
1173-
*,
1174-
project_id: int | None = None,
1175-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1176-
# The extra values given here take precedence over values defined on the client or passed to this method.
1177-
extra_headers: Headers | None = None,
1178-
extra_query: Query | None = None,
1179-
extra_body: Body | None = None,
1180-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
1181-
) -> InferenceDeploymentAPIKey:
1182-
"""
1183-
Get inference deployment API key
1184-
1185-
Args:
1186-
project_id: Project ID
1187-
1188-
deployment_name: Inference instance name.
1189-
1190-
extra_headers: Send extra headers
1191-
1192-
extra_query: Add additional query parameters to the request
1193-
1194-
extra_body: Add additional JSON properties to the request
1195-
1196-
timeout: Override the client-level default timeout for this request, in seconds
1197-
"""
1198-
if project_id is None:
1199-
project_id = self._client._get_cloud_project_id_path_param()
1200-
if not deployment_name:
1201-
raise ValueError(f"Expected a non-empty value for `deployment_name` but received {deployment_name!r}")
1202-
return await self._get(
1203-
path_template(
1204-
"/cloud/v3/inference/{project_id}/deployments/{deployment_name}/apikey",
1205-
project_id=project_id,
1206-
deployment_name=deployment_name,
1207-
),
1208-
options=make_request_options(
1209-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1210-
),
1211-
cast_to=InferenceDeploymentAPIKey,
1212-
)
1213-
12141122
async def start(
12151123
self,
12161124
deployment_name: str,
@@ -1508,11 +1416,6 @@ def __init__(self, deployments: DeploymentsResource) -> None:
15081416
self.get = to_raw_response_wrapper(
15091417
deployments.get,
15101418
)
1511-
self.get_api_key = ( # pyright: ignore[reportDeprecated]
1512-
to_raw_response_wrapper(
1513-
deployments.get_api_key, # pyright: ignore[reportDeprecated],
1514-
)
1515-
)
15161419
self.start = to_raw_response_wrapper(
15171420
deployments.start,
15181421
)
@@ -1553,11 +1456,6 @@ def __init__(self, deployments: AsyncDeploymentsResource) -> None:
15531456
self.get = async_to_raw_response_wrapper(
15541457
deployments.get,
15551458
)
1556-
self.get_api_key = ( # pyright: ignore[reportDeprecated]
1557-
async_to_raw_response_wrapper(
1558-
deployments.get_api_key, # pyright: ignore[reportDeprecated],
1559-
)
1560-
)
15611459
self.start = async_to_raw_response_wrapper(
15621460
deployments.start,
15631461
)
@@ -1598,11 +1496,6 @@ def __init__(self, deployments: DeploymentsResource) -> None:
15981496
self.get = to_streamed_response_wrapper(
15991497
deployments.get,
16001498
)
1601-
self.get_api_key = ( # pyright: ignore[reportDeprecated]
1602-
to_streamed_response_wrapper(
1603-
deployments.get_api_key, # pyright: ignore[reportDeprecated],
1604-
)
1605-
)
16061499
self.start = to_streamed_response_wrapper(
16071500
deployments.start,
16081501
)
@@ -1643,11 +1536,6 @@ def __init__(self, deployments: AsyncDeploymentsResource) -> None:
16431536
self.get = async_to_streamed_response_wrapper(
16441537
deployments.get,
16451538
)
1646-
self.get_api_key = ( # pyright: ignore[reportDeprecated]
1647-
async_to_streamed_response_wrapper(
1648-
deployments.get_api_key, # pyright: ignore[reportDeprecated],
1649-
)
1650-
)
16511539
self.start = async_to_streamed_response_wrapper(
16521540
deployments.start,
16531541
)

src/gcore/types/cloud/inference/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
from .deployment_create_params import DeploymentCreateParams as DeploymentCreateParams
2323
from .deployment_update_params import DeploymentUpdateParams as DeploymentUpdateParams
2424
from .inference_api_key_created import InferenceAPIKeyCreated as InferenceAPIKeyCreated
25-
from .inference_deployment_api_key import InferenceDeploymentAPIKey as InferenceDeploymentAPIKey
2625
from .inference_registry_credentials import InferenceRegistryCredentials as InferenceRegistryCredentials
2726
from .registry_credential_list_params import RegistryCredentialListParams as RegistryCredentialListParams
2827
from .registry_credential_create_params import RegistryCredentialCreateParams as RegistryCredentialCreateParams

src/gcore/types/cloud/inference/inference_deployment_api_key.py

Lines changed: 0 additions & 15 deletions
This file was deleted.

tests/api_resources/cloud/inference/test_deployments.py

Lines changed: 0 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,8 @@
1313
from gcore.types.cloud import TaskIDList
1414
from gcore.types.cloud.inference import (
1515
InferenceDeployment,
16-
InferenceDeploymentAPIKey,
1716
)
1817

19-
# pyright: reportDeprecated=false
20-
2118
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
2219

2320

@@ -496,53 +493,6 @@ def test_path_params_get(self, client: Gcore) -> None:
496493
project_id=1,
497494
)
498495

499-
@parametrize
500-
def test_method_get_api_key(self, client: Gcore) -> None:
501-
with pytest.warns(DeprecationWarning):
502-
deployment = client.cloud.inference.deployments.get_api_key(
503-
deployment_name="my-instance",
504-
project_id=1,
505-
)
506-
507-
assert_matches_type(InferenceDeploymentAPIKey, deployment, path=["response"])
508-
509-
@parametrize
510-
def test_raw_response_get_api_key(self, client: Gcore) -> None:
511-
with pytest.warns(DeprecationWarning):
512-
response = client.cloud.inference.deployments.with_raw_response.get_api_key(
513-
deployment_name="my-instance",
514-
project_id=1,
515-
)
516-
517-
assert response.is_closed is True
518-
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
519-
deployment = response.parse()
520-
assert_matches_type(InferenceDeploymentAPIKey, deployment, path=["response"])
521-
522-
@parametrize
523-
def test_streaming_response_get_api_key(self, client: Gcore) -> None:
524-
with pytest.warns(DeprecationWarning):
525-
with client.cloud.inference.deployments.with_streaming_response.get_api_key(
526-
deployment_name="my-instance",
527-
project_id=1,
528-
) as response:
529-
assert not response.is_closed
530-
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
531-
532-
deployment = response.parse()
533-
assert_matches_type(InferenceDeploymentAPIKey, deployment, path=["response"])
534-
535-
assert cast(Any, response.is_closed) is True
536-
537-
@parametrize
538-
def test_path_params_get_api_key(self, client: Gcore) -> None:
539-
with pytest.warns(DeprecationWarning):
540-
with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_name` but received ''"):
541-
client.cloud.inference.deployments.with_raw_response.get_api_key(
542-
deployment_name="",
543-
project_id=1,
544-
)
545-
546496
@parametrize
547497
def test_method_start(self, client: Gcore) -> None:
548498
deployment = client.cloud.inference.deployments.start(
@@ -1105,53 +1055,6 @@ async def test_path_params_get(self, async_client: AsyncGcore) -> None:
11051055
project_id=1,
11061056
)
11071057

1108-
@parametrize
1109-
async def test_method_get_api_key(self, async_client: AsyncGcore) -> None:
1110-
with pytest.warns(DeprecationWarning):
1111-
deployment = await async_client.cloud.inference.deployments.get_api_key(
1112-
deployment_name="my-instance",
1113-
project_id=1,
1114-
)
1115-
1116-
assert_matches_type(InferenceDeploymentAPIKey, deployment, path=["response"])
1117-
1118-
@parametrize
1119-
async def test_raw_response_get_api_key(self, async_client: AsyncGcore) -> None:
1120-
with pytest.warns(DeprecationWarning):
1121-
response = await async_client.cloud.inference.deployments.with_raw_response.get_api_key(
1122-
deployment_name="my-instance",
1123-
project_id=1,
1124-
)
1125-
1126-
assert response.is_closed is True
1127-
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
1128-
deployment = await response.parse()
1129-
assert_matches_type(InferenceDeploymentAPIKey, deployment, path=["response"])
1130-
1131-
@parametrize
1132-
async def test_streaming_response_get_api_key(self, async_client: AsyncGcore) -> None:
1133-
with pytest.warns(DeprecationWarning):
1134-
async with async_client.cloud.inference.deployments.with_streaming_response.get_api_key(
1135-
deployment_name="my-instance",
1136-
project_id=1,
1137-
) as response:
1138-
assert not response.is_closed
1139-
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
1140-
1141-
deployment = await response.parse()
1142-
assert_matches_type(InferenceDeploymentAPIKey, deployment, path=["response"])
1143-
1144-
assert cast(Any, response.is_closed) is True
1145-
1146-
@parametrize
1147-
async def test_path_params_get_api_key(self, async_client: AsyncGcore) -> None:
1148-
with pytest.warns(DeprecationWarning):
1149-
with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_name` but received ''"):
1150-
await async_client.cloud.inference.deployments.with_raw_response.get_api_key(
1151-
deployment_name="",
1152-
project_id=1,
1153-
)
1154-
11551058
@parametrize
11561059
async def test_method_start(self, async_client: AsyncGcore) -> None:
11571060
deployment = await async_client.cloud.inference.deployments.start(

0 commit comments

Comments
 (0)