Skip to content

Commit

Permalink
fix(iso): invalid field include_wildcard_architecture
Browse files Browse the repository at this point in the history
Fix a field naming mismatch with the ISO endpoint and the clients:
- https://docs.hetzner.cloud/#isos-get-all-isos uses `include_architecture_wildcard`
- https://hcloud-python.readthedocs.io/en/stable/api.clients.isos.html#hcloud.isos.client.IsosClient uses `include_wildcard_architecture`
- https://pkg.go.dev/github.com/hetznercloud/hcloud-go/hcloud?utm_source=godoc#ISOListOpts uses `IncludeWildcardArchitecture`
  • Loading branch information
jooola committed Jun 26, 2023
1 parent e40d05f commit 188b68a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion hcloud/iso.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ type ISOListOpts struct {
Architecture []Architecture
// IncludeWildcardArchitecture must be set to also return custom ISOs that have no architecture set, if you are
// also setting the Architecture field.
// Deprecated: Use the IncludeArchitectureWildcard field instead.

This comment has been minimized.

Copy link
@apricote

apricote Jun 26, 2023

Member

You can create a reference to another Go field by wrapping the identifier in square brackets:

// Deprecated: Use [ISOListOpts.IncludeArchitectureWildcard] instead.
IncludeWildcardArchitecture bool
// IncludeWildcardArchitecture must be set to also return custom ISOs that have no architecture set, if you are
// also setting the Architecture field.
IncludeArchitectureWildcard bool
}

func (l ISOListOpts) values() url.Values {
Expand All @@ -103,7 +107,7 @@ func (l ISOListOpts) values() url.Values {
for _, arch := range l.Architecture {
vals.Add("architecture", string(arch))
}
if l.IncludeWildcardArchitecture {
if l.IncludeArchitectureWildcard || l.IncludeWildcardArchitecture {
vals.Add("include_architecture_wildcard", "true")
}
return vals
Expand Down

0 comments on commit 188b68a

Please sign in to comment.