Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

Commit

Permalink
fix: remove plan drive type and nic type enums (#156)
Browse files Browse the repository at this point in the history
The [previous fix for plan drive
type](https://github.com/equinix-labs/metal-go/155) did not work; it
turns out that the API plan data includes plans with drive type `NVMe`
_and_ plans with drive type `NVME`. As mentioned on the previous PR,
adding both options to the enum generates invalid code, and we don't
have a practical way to enable case-insensitive comparisons for string
enums.

Reverting the plan drive type to a plain string uncovered a different
issue with the nic type enum: some plans (`storage` type, possibly
others) include the following for drives and nics:

```json
                "drives": [
                    {
                        "count": 0,
                        "size": "",
                        "type": ""
                    }
                ],
                "nics": [
                    {
                        "count": 0,
                        "type": ""
                    }
                ]
```

Rather than test `nullable: true` here, I opted to change the nic type
to a plain string as well.
  • Loading branch information
ctreatma committed Sep 21, 2023
1 parent 5b0fdf2 commit 44b4c1a
Show file tree
Hide file tree
Showing 14 changed files with 131 additions and 400 deletions.
2 changes: 0 additions & 2 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -570,11 +570,9 @@ Class | Method | HTTP request | Description
- [PlanSpecsCpusInner](docs/PlanSpecsCpusInner.md)
- [PlanSpecsDrivesInner](docs/PlanSpecsDrivesInner.md)
- [PlanSpecsDrivesInnerCategory](docs/PlanSpecsDrivesInnerCategory.md)
- [PlanSpecsDrivesInnerType](docs/PlanSpecsDrivesInnerType.md)
- [PlanSpecsFeatures](docs/PlanSpecsFeatures.md)
- [PlanSpecsMemory](docs/PlanSpecsMemory.md)
- [PlanSpecsNicsInner](docs/PlanSpecsNicsInner.md)
- [PlanSpecsNicsInnerType](docs/PlanSpecsNicsInnerType.md)
- [PlanType](docs/PlanType.md)
- [Port](docs/Port.md)
- [PortAssignInput](docs/PortAssignInput.md)
Expand Down
Loading

0 comments on commit 44b4c1a

Please sign in to comment.