Skip to content

Commit

Permalink
fix(reports)!: Regenerates Reports with oneOf design (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeymike authored Aug 8, 2024
1 parent c625dad commit 8ceeeb9
Show file tree
Hide file tree
Showing 5 changed files with 227 additions and 128 deletions.
16 changes: 13 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

Check our main [developer changelog](https://developer.paddle.com/?utm_source=dx&utm_medium=paddle-go-sdk) for information about changes to the Paddle Billing platform, the Paddle API, and other developer tools.

## 0.6.0 - 2024-08-07

### Changed

- Reports architecture has changed to a oneOf design

### Fixed

- Report filter values incorrectly typed as a `string` when it requires either `string` or `[]string` depending on the filter name.

## 0.5.0 - 2024-07-26

### Breaking changes
### Changed

- Paddle API enum types are now correctly enforced where applicable
- Notifications and Events `EventType` property now use `EventTypeName` instead of `string` type
Expand All @@ -33,7 +43,7 @@ Check our main [developer changelog](https://developer.paddle.com/?utm_source=dx

## 0.4.0 - 2024-06-26

### Breaking changes
### Changed

- Shared types `TransactionSubscriptionPriceCreateWithProduct` and `TransactionSubscriptionPriceCreateWithProductID` have diverged into 2 new types for Transactions and Subscriptions
- Include entity types are unified with their non-include variant, e.g. `ProductWithIncludes` and `Product` are now just `Product`
Expand All @@ -49,7 +59,7 @@ Check our main [developer changelog](https://developer.paddle.com/?utm_source=dx

## 0.3.0 - 2024-05-27

### Breaking changes
### Changed

- `Event` and `NotificationsEvent` are now an interfaces.
- `NotificationsEvent` has moved package to `paddlenotification`.
Expand Down
26 changes: 26 additions & 0 deletions UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,32 @@

All breaking changes prior to v1 will be documented in this file to assist with upgrading.

## v0.6.0

1. This update makes a significant change to the way the SDK works with the [Reports API](https://developer.paddle.com/api-reference/reports/overview)

When updating to this version if you're integrating with Reports you will need to refactor the code accordingly as it now closely matches the oneOf design of the API.

An example generating a product/price report:

```go
res, err := client.CreateReport(ctx,
paddle.NewCreateReportRequestProductsAndPricesReport(&paddle.ProductsAndPricesReport{
Type: paddle.ReportTypeProductsPricesProductsPrices,
Filters: []paddle.ReportFiltersProductPrices{
paddle.ReportFiltersProductPrices{
Name: paddle.FilterNameProductPricesPriceStatus,
Value: []string{"archived"},
},
paddle.ReportFiltersProductPrices{
Name: paddle.FilterNameProductPricesProductStatus,
Value: []string{"archived"},
},
},
}),
)
```

## v0.5.0

1. This update fixes correctly resolves generated enum types. Prior to this enum types in our spec were using there respective basic type `string`
Expand Down
2 changes: 1 addition & 1 deletion internal/client/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.4.0
v0.6.0
86 changes: 43 additions & 43 deletions pkg/paddlenotification/reports.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8ceeeb9

Please sign in to comment.