diff --git a/src/imagekitio/types/custom_metadata_field_create_params.py b/src/imagekitio/types/custom_metadata_field_create_params.py index 0e265b0..f36471e 100644 --- a/src/imagekitio/types/custom_metadata_field_create_params.py +++ b/src/imagekitio/types/custom_metadata_field_create_params.py @@ -30,9 +30,6 @@ class CustomMetadataFieldCreateParams(TypedDict, total=False): class Schema(TypedDict, total=False): - type: Required[Literal["Text", "Textarea", "Number", "Date", "Boolean", "SingleSelect", "MultiSelect"]] - """Type of the custom metadata field.""" - default_value: Annotated[ Union[str, float, bool, SequenceNotStr[Union[str, float, bool]]], PropertyInfo(alias="defaultValue") ] @@ -83,3 +80,6 @@ class Schema(TypedDict, total=False): This property is only required if `type` property is set to `SingleSelect` or `MultiSelect`. """ + + type: Literal["Text", "Textarea", "Number", "Date", "Boolean", "SingleSelect", "MultiSelect"] + """Type of the custom metadata field.""" diff --git a/tests/api_resources/test_custom_metadata_fields.py b/tests/api_resources/test_custom_metadata_fields.py index ec73bab..7b9c838 100644 --- a/tests/api_resources/test_custom_metadata_fields.py +++ b/tests/api_resources/test_custom_metadata_fields.py @@ -27,7 +27,7 @@ def test_method_create(self, client: ImageKit) -> None: custom_metadata_field = client.custom_metadata_fields.create( label="price", name="price", - schema={"type": "Number"}, + schema={}, ) assert_matches_type(CustomMetadataField, custom_metadata_field, path=["response"]) @@ -38,7 +38,6 @@ def test_method_create_with_all_params(self, client: ImageKit) -> None: label="price", name="price", schema={ - "type": "Number", "default_value": [True, 10, "Hello"], "is_value_required": True, "max_length": 0, @@ -46,6 +45,7 @@ def test_method_create_with_all_params(self, client: ImageKit) -> None: "min_length": 0, "min_value": 1000, "select_options": ["small", "medium", "large", 30, 40, True], + "type": "Number", }, ) assert_matches_type(CustomMetadataField, custom_metadata_field, path=["response"]) @@ -56,7 +56,7 @@ def test_raw_response_create(self, client: ImageKit) -> None: response = client.custom_metadata_fields.with_raw_response.create( label="price", name="price", - schema={"type": "Number"}, + schema={}, ) assert response.is_closed is True @@ -70,7 +70,7 @@ def test_streaming_response_create(self, client: ImageKit) -> None: with client.custom_metadata_fields.with_streaming_response.create( label="price", name="price", - schema={"type": "Number"}, + schema={}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -231,7 +231,7 @@ async def test_method_create(self, async_client: AsyncImageKit) -> None: custom_metadata_field = await async_client.custom_metadata_fields.create( label="price", name="price", - schema={"type": "Number"}, + schema={}, ) assert_matches_type(CustomMetadataField, custom_metadata_field, path=["response"]) @@ -242,7 +242,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncImageKit) label="price", name="price", schema={ - "type": "Number", "default_value": [True, 10, "Hello"], "is_value_required": True, "max_length": 0, @@ -250,6 +249,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncImageKit) "min_length": 0, "min_value": 1000, "select_options": ["small", "medium", "large", 30, 40, True], + "type": "Number", }, ) assert_matches_type(CustomMetadataField, custom_metadata_field, path=["response"]) @@ -260,7 +260,7 @@ async def test_raw_response_create(self, async_client: AsyncImageKit) -> None: response = await async_client.custom_metadata_fields.with_raw_response.create( label="price", name="price", - schema={"type": "Number"}, + schema={}, ) assert response.is_closed is True @@ -274,7 +274,7 @@ async def test_streaming_response_create(self, async_client: AsyncImageKit) -> N async with async_client.custom_metadata_fields.with_streaming_response.create( label="price", name="price", - schema={"type": "Number"}, + schema={}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python"