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 46a458a8..71f8399f 100644 --- a/equinix_metal/equinix_metal/models/plan_specs_drives_inner.py +++ b/equinix_metal/equinix_metal/models/plan_specs_drives_inner.py @@ -43,16 +43,6 @@ def category_validate_enum(cls, value): raise ValueError("must be one of enum values ('boot', 'cache', 'storage')") return value - @validator('type') - def type_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in ('HDD', 'SSD', 'NVME'): - raise ValueError("must be one of enum values ('HDD', 'SSD', 'NVME')") - return value - class Config: """Pydantic configuration""" allow_population_by_field_name = True diff --git a/equinix_metal/equinix_metal/models/plan_specs_nics_inner.py b/equinix_metal/equinix_metal/models/plan_specs_nics_inner.py index d6ca9d31..694acfcc 100644 --- a/equinix_metal/equinix_metal/models/plan_specs_nics_inner.py +++ b/equinix_metal/equinix_metal/models/plan_specs_nics_inner.py @@ -20,7 +20,7 @@ from typing import Optional -from pydantic import BaseModel, StrictInt, StrictStr, validator +from pydantic import BaseModel, StrictInt, StrictStr class PlanSpecsNicsInner(BaseModel): """ @@ -31,16 +31,6 @@ class PlanSpecsNicsInner(BaseModel): type: Optional[StrictStr] = None __properties = ["count", "href", "type"] - @validator('type') - def type_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in ('1Gbps', '10Gbps', '25Gbps'): - raise ValueError("must be one of enum values ('1Gbps', '10Gbps', '25Gbps')") - return value - class Config: """Pydantic configuration""" allow_population_by_field_name = True diff --git a/equinix_metal/test/test_device.py b/equinix_metal/test/test_device.py index 05d121f5..4dfd24a0 100644 --- a/equinix_metal/test/test_device.py +++ b/equinix_metal/test/test_device.py @@ -213,7 +213,7 @@ class = 'm3.large.x86', count = 56, href = '', size = '3.84TB', - type = 'HDD', ) + type = '', ) ], features = equinix_metal.models.plan_specs_features.Plan_specs_features( href = '', @@ -228,7 +228,7 @@ class = 'm3.large.x86', equinix_metal.models.plan_specs_nics_inner.Plan_specs_nics_inner( count = 2, href = '', - type = '1Gbps', ) + type = '', ) ], ), type = 'standard', ), project = None, diff --git a/equinix_metal/test/test_device_list.py b/equinix_metal/test/test_device_list.py index 08405d8a..df50131c 100644 --- a/equinix_metal/test/test_device_list.py +++ b/equinix_metal/test/test_device_list.py @@ -208,7 +208,7 @@ class = 'm3.large.x86', count = 56, href = '', size = '3.84TB', - type = 'HDD', ) + type = '', ) ], features = equinix_metal.models.plan_specs_features.Plan_specs_features( href = '', @@ -223,7 +223,7 @@ class = 'm3.large.x86', equinix_metal.models.plan_specs_nics_inner.Plan_specs_nics_inner( count = 2, href = '', - type = '1Gbps', ) + type = '', ) ], ), type = 'standard', ), project = null, diff --git a/equinix_metal/test/test_hardware_reservation.py b/equinix_metal/test/test_hardware_reservation.py index 94fce0bf..23a1b9ac 100644 --- a/equinix_metal/test/test_hardware_reservation.py +++ b/equinix_metal/test/test_hardware_reservation.py @@ -209,7 +209,7 @@ class = 'm3.large.x86', count = 56, href = '', size = '3.84TB', - type = 'HDD', ) + type = '', ) ], features = equinix_metal.models.plan_specs_features.Plan_specs_features( href = '', @@ -224,7 +224,7 @@ class = 'm3.large.x86', equinix_metal.models.plan_specs_nics_inner.Plan_specs_nics_inner( count = 2, href = '', - type = '1Gbps', ) + type = '', ) ], ), type = 'standard', ), project = null, @@ -363,7 +363,7 @@ class = 'm3.large.x86', count = 56, href = '', size = '3.84TB', - type = 'HDD', ) + type = '', ) ], features = equinix_metal.models.plan_specs_features.Plan_specs_features( href = '', @@ -378,7 +378,7 @@ class = 'm3.large.x86', equinix_metal.models.plan_specs_nics_inner.Plan_specs_nics_inner( count = 2, href = '', - type = '1Gbps', ) + type = '', ) ], ), type = 'standard', ), project = equinix_metal.models.project.Project( diff --git a/equinix_metal/test/test_hardware_reservation_list.py b/equinix_metal/test/test_hardware_reservation_list.py index 44066980..1dd6f31f 100644 --- a/equinix_metal/test/test_hardware_reservation_list.py +++ b/equinix_metal/test/test_hardware_reservation_list.py @@ -211,7 +211,7 @@ class = 'm3.large.x86', count = 56, href = '', size = '3.84TB', - type = 'HDD', ) + type = '', ) ], features = equinix_metal.models.plan_specs_features.Plan_specs_features( href = '', @@ -226,7 +226,7 @@ class = 'm3.large.x86', equinix_metal.models.plan_specs_nics_inner.Plan_specs_nics_inner( count = 2, href = '', - type = '1Gbps', ) + type = '', ) ], ), type = 'standard', ), project = null, diff --git a/equinix_metal/test/test_invoice.py b/equinix_metal/test/test_invoice.py index 78be796c..2f3a1af7 100644 --- a/equinix_metal/test/test_invoice.py +++ b/equinix_metal/test/test_invoice.py @@ -95,7 +95,7 @@ class = 'm3.large.x86', count = 56, href = '', size = '3.84TB', - type = 'HDD', ) + type = '', ) ], features = equinix_metal.models.plan_specs_features.Plan_specs_features( href = '', @@ -110,7 +110,7 @@ class = 'm3.large.x86', equinix_metal.models.plan_specs_nics_inner.Plan_specs_nics_inner( count = 2, href = '', - type = '1Gbps', ) + type = '', ) ], ), type = 'standard', ), unit = '', diff --git a/equinix_metal/test/test_invoice_list.py b/equinix_metal/test/test_invoice_list.py index 1e8cf579..10121c71 100644 --- a/equinix_metal/test/test_invoice_list.py +++ b/equinix_metal/test/test_invoice_list.py @@ -98,7 +98,7 @@ class = 'm3.large.x86', count = 56, href = '', size = '3.84TB', - type = 'HDD', ) + type = '', ) ], features = equinix_metal.models.plan_specs_features.Plan_specs_features( href = '', @@ -113,7 +113,7 @@ class = 'm3.large.x86', equinix_metal.models.plan_specs_nics_inner.Plan_specs_nics_inner( count = 2, href = '', - type = '1Gbps', ) + type = '', ) ], ), type = 'standard', ), unit = '', diff --git a/equinix_metal/test/test_line_item.py b/equinix_metal/test/test_line_item.py index 25ef5318..388ccc41 100644 --- a/equinix_metal/test/test_line_item.py +++ b/equinix_metal/test/test_line_item.py @@ -84,7 +84,7 @@ class = 'm3.large.x86', count = 56, href = '', size = '3.84TB', - type = 'HDD', ) + type = '', ) ], features = equinix_metal.models.plan_specs_features.Plan_specs_features( href = '', @@ -99,7 +99,7 @@ class = 'm3.large.x86', equinix_metal.models.plan_specs_nics_inner.Plan_specs_nics_inner( count = 2, href = '', - type = '1Gbps', ) + type = '', ) ], ), type = 'standard', ), unit = '', diff --git a/equinix_metal/test/test_plan.py b/equinix_metal/test/test_plan.py index 79fd0129..150e347a 100644 --- a/equinix_metal/test/test_plan.py +++ b/equinix_metal/test/test_plan.py @@ -81,7 +81,7 @@ def make_instance(self, include_optional): count = 56, href = '', size = '3.84TB', - type = 'HDD', ) + type = '', ) ], features = equinix_metal.models.plan_specs_features.Plan_specs_features( href = '', @@ -96,7 +96,7 @@ def make_instance(self, include_optional): equinix_metal.models.plan_specs_nics_inner.Plan_specs_nics_inner( count = 2, href = '', - type = '1Gbps', ) + type = '', ) ], ), type = 'standard' ) diff --git a/equinix_metal/test/test_plan_list.py b/equinix_metal/test/test_plan_list.py index 5be53d81..58921d4b 100644 --- a/equinix_metal/test/test_plan_list.py +++ b/equinix_metal/test/test_plan_list.py @@ -81,7 +81,7 @@ class = 'm3.large.x86', count = 56, href = '', size = '3.84TB', - type = 'HDD', ) + type = '', ) ], features = equinix_metal.models.plan_specs_features.Plan_specs_features( href = '', @@ -96,7 +96,7 @@ class = 'm3.large.x86', equinix_metal.models.plan_specs_nics_inner.Plan_specs_nics_inner( count = 2, href = '', - type = '1Gbps', ) + type = '', ) ], ), type = 'standard', ) ] diff --git a/equinix_metal/test/test_plan_specs.py b/equinix_metal/test/test_plan_specs.py index 417a787f..bf93161f 100644 --- a/equinix_metal/test/test_plan_specs.py +++ b/equinix_metal/test/test_plan_specs.py @@ -51,7 +51,7 @@ def make_instance(self, include_optional): count = 56, href = '', size = '3.84TB', - type = 'HDD', ) + type = '', ) ], features = equinix_metal.models.plan_specs_features.Plan_specs_features( href = '', @@ -66,7 +66,7 @@ def make_instance(self, include_optional): equinix_metal.models.plan_specs_nics_inner.Plan_specs_nics_inner( count = 2, href = '', - type = '1Gbps', ) + type = '', ) ] ) else : diff --git a/equinix_metal/test/test_plan_specs_drives_inner.py b/equinix_metal/test/test_plan_specs_drives_inner.py index 8283b6bb..262c90e3 100644 --- a/equinix_metal/test/test_plan_specs_drives_inner.py +++ b/equinix_metal/test/test_plan_specs_drives_inner.py @@ -43,7 +43,7 @@ def make_instance(self, include_optional): count = 56, href = '', size = '3.84TB', - type = 'HDD' + type = '' ) else : return PlanSpecsDrivesInner( diff --git a/equinix_metal/test/test_plan_specs_nics_inner.py b/equinix_metal/test/test_plan_specs_nics_inner.py index 2ffc384e..bf419ec6 100644 --- a/equinix_metal/test/test_plan_specs_nics_inner.py +++ b/equinix_metal/test/test_plan_specs_nics_inner.py @@ -41,7 +41,7 @@ def make_instance(self, include_optional): return PlanSpecsNicsInner( count = 2, href = '', - type = '1Gbps' + type = '' ) else : return PlanSpecsNicsInner( diff --git a/metal_openapi.fixed.yaml b/metal_openapi.fixed.yaml index 15db57b5..b2fc5d6a 100644 --- a/metal_openapi.fixed.yaml +++ b/metal_openapi.fixed.yaml @@ -3510,10 +3510,6 @@ components: example: 3.84TB type: string type: - enum: - - HDD - - SSD - - NVME type: string type: object Plan_specs_features: @@ -3545,10 +3541,6 @@ components: format: uri type: string type: - enum: - - 1Gbps - - 10Gbps - - 25Gbps type: string type: object Port: diff --git a/scripts/patch_metal_spec.py b/scripts/patch_metal_spec.py index a33c2d70..1dfc4114 100755 --- a/scripts/patch_metal_spec.py +++ b/scripts/patch_metal_spec.py @@ -78,6 +78,11 @@ def loadYaml(fn): del fixedSpec['components']['schemas']['Address']['required'] +# FIX 12. Remove enums from Plan schema - they don't match the real API +# 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_nics_inner']['properties']['type']['enum'] # Mark paginated operation with `x-equinix-metal-paginated-property`