Skip to content

Commit

Permalink
Restored legacy PagedResponse structs and added deprecation notice (#539
Browse files Browse the repository at this point in the history
)
  • Loading branch information
ezilber-akamai committed Jul 3, 2024
1 parent 87439ea commit a9a7dcf
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
55 changes: 55 additions & 0 deletions paged_response_structs.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package linodego

// Deprecated: AccountAvailabilityPagedResponse exists for historical compatibility and should not be used.
type AccountAvailabilityPagedResponse legacyPagedResponse[AccountAvailability]

// Deprecated: AccountBetasPagedResponse exists for historical compatibility and should not be used.
type AccountBetasPagedResponse legacyPagedResponse[AccountBetaProgram]

// Deprecated: BetaProgramPagedResponse exists for historical compatibility and should not be used.
type BetaProgramPagedResponse legacyPagedResponse[BetaProgram]

// Deprecated: DatabaseEnginesPagedResponse exists for historical compatibility and should not be used.
type DatabaseEnginesPagedResponse legacyPagedResponse[DatabaseEngine]

// Deprecated: DatabaseTypesPagedResponse exists for historical compatibility and should not be used.
type DatabaseTypesPagedResponse legacyPagedResponse[DatabaseType]

// Deprecated: DatabasesPagedResponse exists for historical compatibility and should not be used.
type DatabasesPagedResponse legacyPagedResponse[Database]

// Deprecated: DomainRecordsPagedResponse exists for historical compatibility and should not be used.
type DomainRecordsPagedResponse legacyPagedResponse[DomainRecord]

// Deprecated: DomainsPagedResponse exists for historical compatibility and should not be used.
type DomainsPagedResponse legacyPagedResponse[Domain]

// Deprecated: EventsPagedResponse exists for historical compatibility and should not be used.
type EventsPagedResponse legacyPagedResponse[Event]

// Deprecated: FirewallDevicesPagedResponse exists for historical compatibility and should not be used.
type FirewallDevicesPagedResponse legacyPagedResponse[FirewallDevice]

// Deprecated: ImagesPagedResponse exists for historical compatibility and should not be used.
type ImagesPagedResponse legacyPagedResponse[Image]

// Deprecated: InvoiceItemsPagedResponse exists for historical compatibility and should not be used.
type InvoiceItemsPagedResponse legacyPagedResponse[InvoiceItem]

// Deprecated: InvoicesPagedResponse exists for historical compatibility and should not be used.
type InvoicesPagedResponse legacyPagedResponse[Invoice]

// Deprecated: LoginsPagedResponse exists for historical compatibility and should not be used.
type LoginsPagedResponse legacyPagedResponse[Login]

// Deprecated: NotificationsPagedResponse exists for historical compatibility and should not be used.
type NotificationsPagedResponse legacyPagedResponse[Notification]

// Deprecated: OAuthClientsPagedResponse exists for historical compatibility and should not be used.
type OAuthClientsPagedResponse legacyPagedResponse[OAuthClient]

// Deprecated: PaymentsPagedResponse exists for historical compatibility and should not be used.
type PaymentsPagedResponse legacyPagedResponse[Payment]

// Deprecated: UsersPagedResponse exists for historical compatibility and should not be used.
type UsersPagedResponse legacyPagedResponse[User]
5 changes: 5 additions & 0 deletions pagination.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,3 +197,8 @@ func queryFieldToString(value reflect.Value) (string, error) {
return "", fmt.Errorf("unsupported query param type: %s", value.Type().Name())
}
}

type legacyPagedResponse[T any] struct {
*PageOptions
Data []T `json:"data"`
}

0 comments on commit a9a7dcf

Please sign in to comment.