From 8d3d86fd37ce0df919215d2bde660ab5f1f96e80 Mon Sep 17 00:00:00 2001 From: davidgrayston-paddle Date: Fri, 18 Oct 2024 12:17:25 +0100 Subject: [PATCH] fix: Create v2 module (#32) --- README.md | 4 ++-- addresses.go | 2 +- adjustments.go | 2 +- businesses.go | 2 +- collection.go | 4 ++-- collection_test.go | 2 +- context.go | 2 +- currencies.go | 2 +- customers.go | 2 +- discounts.go | 2 +- events.go | 2 +- example_create_test.go | 2 +- example_get_test.go | 2 +- example_list_events_test.go | 2 +- example_list_test.go | 2 +- example_simulations_test.go | 4 ++-- example_update_test.go | 2 +- example_webhook_verifier_test.go | 2 +- go.mod | 2 +- internal/client/client.go | 2 +- internal/client/client_test.go | 6 +++--- internal/client/directive_include_test.go | 2 +- internal/client/transit_id_test.go | 2 +- internal/client/version.txt | 2 +- internal/response/response.go | 2 +- internal/response/response_api_error_handler.go | 2 +- notifications.go | 4 ++-- options.go | 2 +- paddle.go | 2 +- patch_field_test.go | 2 +- prices.go | 2 +- products.go | 2 +- reports.go | 2 +- shared.go | 4 ++-- simulations.go | 2 +- subscriptions.go | 2 +- transactions.go | 2 +- webhook_verifier_test.go | 2 +- 38 files changed, 45 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index b0d182f..402e2a7 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ Then, reference paddle-go-sdk in a Go program with import: ```go import ( - paddle "github.com/PaddleHQ/paddle-go-sdk" + paddle "github.com/PaddleHQ/paddle-go-sdk/v2" ) ``` @@ -51,7 +51,7 @@ Pass your API key while initializing a new Paddle client. ``` go import ( - paddle "github.com/PaddleHQ/paddle-go-sdk" + paddle "github.com/PaddleHQ/paddle-go-sdk/v2" ) client, err := paddle.New( diff --git a/addresses.go b/addresses.go index b3ffc2c..a7d3c23 100644 --- a/addresses.go +++ b/addresses.go @@ -5,7 +5,7 @@ package paddle import ( "context" - paddleerr "github.com/PaddleHQ/paddle-go-sdk/pkg/paddleerr" + paddleerr "github.com/PaddleHQ/paddle-go-sdk/v2/pkg/paddleerr" ) // ErrAddressLocationNotAllowed represents a `address_location_not_allowed` error. diff --git a/adjustments.go b/adjustments.go index d7d59fb..e94bb78 100644 --- a/adjustments.go +++ b/adjustments.go @@ -5,7 +5,7 @@ package paddle import ( "context" - paddleerr "github.com/PaddleHQ/paddle-go-sdk/pkg/paddleerr" + paddleerr "github.com/PaddleHQ/paddle-go-sdk/v2/pkg/paddleerr" ) // ErrAdjustmentTransactionMissingCustomerID represents a `adjustment_transaction_missing_customer_id` error. diff --git a/businesses.go b/businesses.go index 2479020..7f6be6e 100644 --- a/businesses.go +++ b/businesses.go @@ -5,7 +5,7 @@ package paddle import ( "context" - paddleerr "github.com/PaddleHQ/paddle-go-sdk/pkg/paddleerr" + paddleerr "github.com/PaddleHQ/paddle-go-sdk/v2/pkg/paddleerr" ) // ErrBusinessContactEmailDomainNotAllowed represents a `business_contact_email_domain_not_allowed` error. diff --git a/collection.go b/collection.go index 9d2d19f..6e8c49e 100644 --- a/collection.go +++ b/collection.go @@ -8,8 +8,8 @@ import ( "net/url" "sync" - "github.com/PaddleHQ/paddle-go-sdk/internal/client" - "github.com/PaddleHQ/paddle-go-sdk/internal/response" + "github.com/PaddleHQ/paddle-go-sdk/v2/internal/client" + "github.com/PaddleHQ/paddle-go-sdk/v2/internal/response" ) // Collection is the response from a listing endpoint in the Paddle API. diff --git a/collection_test.go b/collection_test.go index d87b50f..b8de086 100644 --- a/collection_test.go +++ b/collection_test.go @@ -6,7 +6,7 @@ import ( "errors" "testing" - paddle "github.com/PaddleHQ/paddle-go-sdk" + paddle "github.com/PaddleHQ/paddle-go-sdk/v2" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/context.go b/context.go index 12c443b..76c111c 100644 --- a/context.go +++ b/context.go @@ -3,7 +3,7 @@ package paddle import ( "context" - "github.com/PaddleHQ/paddle-go-sdk/internal/client" + "github.com/PaddleHQ/paddle-go-sdk/v2/internal/client" ) // ContextWithTransitID returns a new context with the provided transitID. diff --git a/currencies.go b/currencies.go index 410a38b..5adf762 100644 --- a/currencies.go +++ b/currencies.go @@ -1,7 +1,7 @@ // Code generated by the Paddle SDK Generator; DO NOT EDIT. package paddle -import paddleerr "github.com/PaddleHQ/paddle-go-sdk/pkg/paddleerr" +import paddleerr "github.com/PaddleHQ/paddle-go-sdk/v2/pkg/paddleerr" // ErrCurrencyPrimaryBalanceInvalid represents a `currency_primary_balance_invalid` error. // See https://developer.paddle.com/errors/currencies/currency_primary_balance_invalid for more information. diff --git a/customers.go b/customers.go index 3a7023f..acc977c 100644 --- a/customers.go +++ b/customers.go @@ -5,7 +5,7 @@ package paddle import ( "context" - paddleerr "github.com/PaddleHQ/paddle-go-sdk/pkg/paddleerr" + paddleerr "github.com/PaddleHQ/paddle-go-sdk/v2/pkg/paddleerr" ) // ErrCustomerAlreadyExists represents a `customer_already_exists` error. diff --git a/discounts.go b/discounts.go index 41e9783..b01ed74 100644 --- a/discounts.go +++ b/discounts.go @@ -5,7 +5,7 @@ package paddle import ( "context" - paddleerr "github.com/PaddleHQ/paddle-go-sdk/pkg/paddleerr" + paddleerr "github.com/PaddleHQ/paddle-go-sdk/v2/pkg/paddleerr" ) // ErrDiscountExpired represents a `discount_expired` error. diff --git a/events.go b/events.go index ffffe0c..af9ef2c 100644 --- a/events.go +++ b/events.go @@ -6,7 +6,7 @@ import ( "context" "encoding/json" - paddlenotification "github.com/PaddleHQ/paddle-go-sdk/pkg/paddlenotification" + paddlenotification "github.com/PaddleHQ/paddle-go-sdk/v2/pkg/paddlenotification" ) // Event: Represents an event entity. diff --git a/example_create_test.go b/example_create_test.go index 1acd6b7..262da91 100644 --- a/example_create_test.go +++ b/example_create_test.go @@ -6,7 +6,7 @@ import ( "os" "time" - paddle "github.com/PaddleHQ/paddle-go-sdk" + paddle "github.com/PaddleHQ/paddle-go-sdk/v2" ) // Demonstrates how to create a new entity. diff --git a/example_get_test.go b/example_get_test.go index f5f8752..02e6ff3 100644 --- a/example_get_test.go +++ b/example_get_test.go @@ -5,7 +5,7 @@ import ( "fmt" "os" - paddle "github.com/PaddleHQ/paddle-go-sdk" + paddle "github.com/PaddleHQ/paddle-go-sdk/v2" ) // Demonstrates how to get an existing entity. diff --git a/example_list_events_test.go b/example_list_events_test.go index 71b7828..9024a91 100644 --- a/example_list_events_test.go +++ b/example_list_events_test.go @@ -6,7 +6,7 @@ import ( "fmt" "os" - paddle "github.com/PaddleHQ/paddle-go-sdk" + paddle "github.com/PaddleHQ/paddle-go-sdk/v2" ) // Demonstrates how to fetch a list of events and iterate over the provided results. diff --git a/example_list_test.go b/example_list_test.go index 3871e08..5fdf850 100644 --- a/example_list_test.go +++ b/example_list_test.go @@ -5,7 +5,7 @@ import ( "fmt" "os" - paddle "github.com/PaddleHQ/paddle-go-sdk" + paddle "github.com/PaddleHQ/paddle-go-sdk/v2" ) // Demonstrates how to fetch a list and iterate over the provided results. diff --git a/example_simulations_test.go b/example_simulations_test.go index 625d101..8d77690 100644 --- a/example_simulations_test.go +++ b/example_simulations_test.go @@ -6,8 +6,8 @@ import ( "os" "time" - paddle "github.com/PaddleHQ/paddle-go-sdk" - "github.com/PaddleHQ/paddle-go-sdk/pkg/paddlenotification" + paddle "github.com/PaddleHQ/paddle-go-sdk/v2" + "github.com/PaddleHQ/paddle-go-sdk/v2/pkg/paddlenotification" ) // Demonstrates how to create a Simulation with Payload and read the Payload back out of the response diff --git a/example_update_test.go b/example_update_test.go index 83a6316..d3cc3ef 100644 --- a/example_update_test.go +++ b/example_update_test.go @@ -5,7 +5,7 @@ import ( "fmt" "os" - paddle "github.com/PaddleHQ/paddle-go-sdk" + paddle "github.com/PaddleHQ/paddle-go-sdk/v2" ) // Demonstrates how to update an existing entity. diff --git a/example_webhook_verifier_test.go b/example_webhook_verifier_test.go index bb9116f..fa50242 100644 --- a/example_webhook_verifier_test.go +++ b/example_webhook_verifier_test.go @@ -8,7 +8,7 @@ import ( "net/http/httptest" "strings" - paddle "github.com/PaddleHQ/paddle-go-sdk" + paddle "github.com/PaddleHQ/paddle-go-sdk/v2" ) const ( diff --git a/go.mod b/go.mod index 6a654b8..a2ded50 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/PaddleHQ/paddle-go-sdk +module github.com/PaddleHQ/paddle-go-sdk/v2 go 1.21.0 diff --git a/internal/client/client.go b/internal/client/client.go index adcc286..72eabcb 100644 --- a/internal/client/client.go +++ b/internal/client/client.go @@ -13,7 +13,7 @@ import ( "reflect" "strings" - "github.com/PaddleHQ/paddle-go-sdk/internal/response" + "github.com/PaddleHQ/paddle-go-sdk/v2/internal/response" "github.com/ggicci/httpin" "github.com/ggicci/httpin/core" diff --git a/internal/client/client_test.go b/internal/client/client_test.go index adca493..def0541 100644 --- a/internal/client/client_test.go +++ b/internal/client/client_test.go @@ -11,9 +11,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/PaddleHQ/paddle-go-sdk/internal/client" - "github.com/PaddleHQ/paddle-go-sdk/internal/response" - "github.com/PaddleHQ/paddle-go-sdk/pkg/paddleerr" + "github.com/PaddleHQ/paddle-go-sdk/v2/internal/client" + "github.com/PaddleHQ/paddle-go-sdk/v2/internal/response" + "github.com/PaddleHQ/paddle-go-sdk/v2/pkg/paddleerr" ) func ptr[V any](v V) *V { diff --git a/internal/client/directive_include_test.go b/internal/client/directive_include_test.go index fa29435..4b88935 100644 --- a/internal/client/directive_include_test.go +++ b/internal/client/directive_include_test.go @@ -4,7 +4,7 @@ import ( "net/http" "testing" - "github.com/PaddleHQ/paddle-go-sdk/internal/client" + "github.com/PaddleHQ/paddle-go-sdk/v2/internal/client" "github.com/ggicci/httpin" "github.com/stretchr/testify/assert" diff --git a/internal/client/transit_id_test.go b/internal/client/transit_id_test.go index d042700..02a1401 100644 --- a/internal/client/transit_id_test.go +++ b/internal/client/transit_id_test.go @@ -4,7 +4,7 @@ import ( "context" "testing" - "github.com/PaddleHQ/paddle-go-sdk/internal/client" + "github.com/PaddleHQ/paddle-go-sdk/v2/internal/client" "github.com/stretchr/testify/assert" ) diff --git a/internal/client/version.txt b/internal/client/version.txt index 7ec1d6d..3e3c2f1 100644 --- a/internal/client/version.txt +++ b/internal/client/version.txt @@ -1 +1 @@ -2.1.0 +2.1.1 diff --git a/internal/response/response.go b/internal/response/response.go index fff9830..9d85bcd 100644 --- a/internal/response/response.go +++ b/internal/response/response.go @@ -10,7 +10,7 @@ import ( "net/http" "reflect" - "github.com/PaddleHQ/paddle-go-sdk/pkg/paddleerr" + "github.com/PaddleHQ/paddle-go-sdk/v2/pkg/paddleerr" ) // UnmarshalsResponses is an interface implemented by type that must unmarshal responses for themselves. diff --git a/internal/response/response_api_error_handler.go b/internal/response/response_api_error_handler.go index 9bbed90..8e59d35 100644 --- a/internal/response/response_api_error_handler.go +++ b/internal/response/response_api_error_handler.go @@ -8,7 +8,7 @@ import ( "net/http" "strings" - "github.com/PaddleHQ/paddle-go-sdk/pkg/paddleerr" + "github.com/PaddleHQ/paddle-go-sdk/v2/pkg/paddleerr" ) // ErrUnexpectedResponse is returned when an paddle.Error was expected, but instead received nil. diff --git a/notifications.go b/notifications.go index a425ac3..14395db 100644 --- a/notifications.go +++ b/notifications.go @@ -6,8 +6,8 @@ import ( "context" "encoding/json" - paddleerr "github.com/PaddleHQ/paddle-go-sdk/pkg/paddleerr" - paddlenotification "github.com/PaddleHQ/paddle-go-sdk/pkg/paddlenotification" + paddleerr "github.com/PaddleHQ/paddle-go-sdk/v2/pkg/paddleerr" + paddlenotification "github.com/PaddleHQ/paddle-go-sdk/v2/pkg/paddlenotification" ) // ErrNotificationMaximumActiveSettingsReached represents a `notification_maximum_active_settings_reached` error. diff --git a/options.go b/options.go index ec23bb1..6327d5e 100644 --- a/options.go +++ b/options.go @@ -1,7 +1,7 @@ package paddle import ( - "github.com/PaddleHQ/paddle-go-sdk/internal/client" + "github.com/PaddleHQ/paddle-go-sdk/v2/internal/client" ) // Option is a function that configures the Paddle SDK. diff --git a/paddle.go b/paddle.go index 889a0b5..b50fc9e 100644 --- a/paddle.go +++ b/paddle.go @@ -5,7 +5,7 @@ import ( "context" "net/url" - "github.com/PaddleHQ/paddle-go-sdk/internal/client" + "github.com/PaddleHQ/paddle-go-sdk/v2/internal/client" "github.com/hashicorp/go-cleanhttp" ) diff --git a/patch_field_test.go b/patch_field_test.go index 149bfd1..53c7d02 100644 --- a/patch_field_test.go +++ b/patch_field_test.go @@ -4,7 +4,7 @@ import ( "encoding/json" "testing" - paddle "github.com/PaddleHQ/paddle-go-sdk" + paddle "github.com/PaddleHQ/paddle-go-sdk/v2" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/prices.go b/prices.go index 674d852..da72629 100644 --- a/prices.go +++ b/prices.go @@ -5,7 +5,7 @@ package paddle import ( "context" - paddleerr "github.com/PaddleHQ/paddle-go-sdk/pkg/paddleerr" + paddleerr "github.com/PaddleHQ/paddle-go-sdk/v2/pkg/paddleerr" ) // ErrPriceTrialPeriodMissingFields represents a `price_trial_period_missing_fields` error. diff --git a/products.go b/products.go index a7e2ffa..156289f 100644 --- a/products.go +++ b/products.go @@ -5,7 +5,7 @@ package paddle import ( "context" - paddleerr "github.com/PaddleHQ/paddle-go-sdk/pkg/paddleerr" + paddleerr "github.com/PaddleHQ/paddle-go-sdk/v2/pkg/paddleerr" ) // ErrProductTaxCategoryNotApproved represents a `product_tax_category_not_approved` error. diff --git a/reports.go b/reports.go index 8e9dabd..77699a1 100644 --- a/reports.go +++ b/reports.go @@ -6,7 +6,7 @@ import ( "context" "encoding/json" - paddleerr "github.com/PaddleHQ/paddle-go-sdk/pkg/paddleerr" + paddleerr "github.com/PaddleHQ/paddle-go-sdk/v2/pkg/paddleerr" ) // ErrReportCreationLimitExceeded represents a `report_creation_limit_exceeded` error. diff --git a/shared.go b/shared.go index 134b0b4..e39776f 100644 --- a/shared.go +++ b/shared.go @@ -6,8 +6,8 @@ import ( "encoding/json" "strings" - paddleerr "github.com/PaddleHQ/paddle-go-sdk/pkg/paddleerr" - "github.com/PaddleHQ/paddle-go-sdk/pkg/paddlenotification" + paddleerr "github.com/PaddleHQ/paddle-go-sdk/v2/pkg/paddleerr" + "github.com/PaddleHQ/paddle-go-sdk/v2/pkg/paddlenotification" ) // ErrNotFound represents a `not_found` error. diff --git a/simulations.go b/simulations.go index ede0d11..6e47e15 100644 --- a/simulations.go +++ b/simulations.go @@ -7,7 +7,7 @@ import ( "encoding/json" "strings" - "github.com/PaddleHQ/paddle-go-sdk/pkg/paddlenotification" + "github.com/PaddleHQ/paddle-go-sdk/v2/pkg/paddlenotification" ) // Simulation: Represents a simulation entity. diff --git a/subscriptions.go b/subscriptions.go index f1c0ec2..1875755 100644 --- a/subscriptions.go +++ b/subscriptions.go @@ -6,7 +6,7 @@ import ( "context" "encoding/json" - paddleerr "github.com/PaddleHQ/paddle-go-sdk/pkg/paddleerr" + paddleerr "github.com/PaddleHQ/paddle-go-sdk/v2/pkg/paddleerr" ) // ErrSubscriptionLockedRenewal represents a `subscription_locked_renewal` error. diff --git a/transactions.go b/transactions.go index 1c295d6..f78c190 100644 --- a/transactions.go +++ b/transactions.go @@ -6,7 +6,7 @@ import ( "context" "encoding/json" - paddleerr "github.com/PaddleHQ/paddle-go-sdk/pkg/paddleerr" + paddleerr "github.com/PaddleHQ/paddle-go-sdk/v2/pkg/paddleerr" ) // ErrTransactionImmutable represents a `transaction_immutable` error. diff --git a/webhook_verifier_test.go b/webhook_verifier_test.go index 61342be..6b58e41 100644 --- a/webhook_verifier_test.go +++ b/webhook_verifier_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - paddle "github.com/PaddleHQ/paddle-go-sdk" + paddle "github.com/PaddleHQ/paddle-go-sdk/v2" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require"