Skip to content

Commit

Permalink
feat(iso): support deprecation info API
Browse files Browse the repository at this point in the history
  • Loading branch information
apricote committed Oct 12, 2023
1 parent a34074f commit 077a9cf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
9 changes: 3 additions & 6 deletions hcloud/iso.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,9 @@ type ISO struct {
Description string
Type ISOType
Architecture *Architecture
Deprecated time.Time
}

// IsDeprecated returns true if the ISO is deprecated.
func (iso *ISO) IsDeprecated() bool {
return !iso.Deprecated.IsZero()
// Deprecated: Use [ISO.Deprecation] instead.
Deprecated time.Time
DeprecatableResource
}

// ISOType specifies the type of an ISO image.
Expand Down
3 changes: 3 additions & 0 deletions hcloud/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ func ISOFromSchema(s schema.ISO) *ISO {
Description: s.Description,
Type: ISOType(s.Type),
Deprecated: s.Deprecated,
DeprecatableResource: DeprecatableResource{
DeprecationFromSchema(s.Deprecation),
},
}
if s.Architecture != nil {
iso.Architecture = Ptr(Architecture(*s.Architecture))
Expand Down
1 change: 1 addition & 0 deletions hcloud/schema/iso.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ type ISO struct {
Type string `json:"type"`
Architecture *string `json:"architecture"`
Deprecated time.Time `json:"deprecated"`
DeprecatableResource
}

// ISOGetResponse defines the schema of the response when retrieving a single ISO.
Expand Down

0 comments on commit 077a9cf

Please sign in to comment.