Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove category enum from plan drives spec #98

Merged
merged 1 commit into from
Jun 7, 2024
Merged
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
12 changes: 1 addition & 11 deletions equinix_metal/equinix_metal/models/plan_specs_drives_inner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down
4 changes: 0 additions & 4 deletions metal_openapi.fixed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3701,10 +3701,6 @@ components:
Plan_specs_drives_inner:
properties:
category:
enum:
- boot
- cache
- storage
type: string
count:
type: integer
Expand Down
1 change: 1 addition & 0 deletions scripts/patch_metal_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -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[]"
Expand Down
Loading