From de61c4a517483d1ce7dea777bfe8e06afb74ccef Mon Sep 17 00:00:00 2001 From: Charles Treatman Date: Thu, 6 Jun 2024 13:57:40 -0500 Subject: [PATCH] fix: remove category enum from plan drives spec --- .../equinix_metal/models/plan_specs_drives_inner.py | 12 +----------- metal_openapi.fixed.yaml | 4 ---- scripts/patch_metal_spec.py | 1 + 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/equinix_metal/equinix_metal/models/plan_specs_drives_inner.py b/equinix_metal/equinix_metal/models/plan_specs_drives_inner.py index 46f3067a..22aa6cad 100644 --- a/equinix_metal/equinix_metal/models/plan_specs_drives_inner.py +++ b/equinix_metal/equinix_metal/models/plan_specs_drives_inner.py @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self @@ -34,16 +34,6 @@ class PlanSpecsDrivesInner(BaseModel): type: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["category", "count", "href", "size", "type"] - @field_validator('category') - def category_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['boot', 'cache', 'storage']): - raise ValueError("must be one of enum values ('boot', 'cache', 'storage')") - return value - model_config = ConfigDict( populate_by_name=True, validate_assignment=True, diff --git a/metal_openapi.fixed.yaml b/metal_openapi.fixed.yaml index 1c74989b..7c156023 100644 --- a/metal_openapi.fixed.yaml +++ b/metal_openapi.fixed.yaml @@ -3701,10 +3701,6 @@ components: Plan_specs_drives_inner: properties: category: - enum: - - boot - - cache - - storage type: string count: type: integer diff --git a/scripts/patch_metal_spec.py b/scripts/patch_metal_spec.py index a31f6f08..8d41be3f 100755 --- a/scripts/patch_metal_spec.py +++ b/scripts/patch_metal_spec.py @@ -82,6 +82,7 @@ def loadYaml(fn): # https://github.com/equinix-labs/metal-python/pull/63 del fixedSpec['components']['schemas']['Plan_specs_drives_inner']['properties']['type']['enum'] +del fixedSpec['components']['schemas']['Plan_specs_drives_inner']['properties']['category']['enum'] del fixedSpec['components']['schemas']['Plan_specs_nics_inner']['properties']['type']['enum'] # FIX 13. rename query attribute categories to "categories[]"