Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Go SDK to version 9.0.0 #37

Merged
merged 9 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions .github/.example/go.mod
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module example

go 1.23.3
go 1.23.4

replace github.com/talon-one/talon_go/v8 => ../..
replace github.com/talon-one/talon_go/v9 => ../..

require github.com/talon-one/talon_go/v8 v8.0.0
require github.com/talon-one/talon_go/v9 v9.0.0

require golang.org/x/oauth2 v0.23.0 // indirect
require golang.org/x/oauth2 v0.25.0 // indirect
4 changes: 2 additions & 2 deletions .github/.example/go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs=
golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
golang.org/x/oauth2 v0.25.0 h1:CY4y7XT9v0cRI9oupztF8AgiIu99L/ksR/Xp/6jrZ70=
golang.org/x/oauth2 v0.25.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
2 changes: 1 addition & 1 deletion .github/.example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"
"os"

talon "github.com/talon-one/talon_go/v8"
talon "github.com/talon-one/talon_go/v9"
)

func main() {
Expand Down
1,120 changes: 536 additions & 584 deletions README.md

Large diffs are not rendered by default.

2,769 changes: 1,557 additions & 1,212 deletions api/openapi.yaml

Large diffs are not rendered by default.

57 changes: 48 additions & 9 deletions api_integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
_ioutil "io/ioutil"
_nethttp "net/http"
_neturl "net/url"
"reflect"
"strings"
"time"
)
Expand Down Expand Up @@ -221,16 +222,22 @@ func (r apiCreateCouponReservationRequest) Body(body CouponReservations) apiCrea
CreateCouponReservation Create coupon reservation
Create a coupon reservation for the specified customer profiles on the specified coupon.
You can also create a reservation via the Campaign Manager using the
[Create coupon code reservation effect](https://docs.talon.one/docs/product/rules/effects/using-effects#reserving-a-coupon-code).
[Create coupon code reservation](https://docs.talon.one/docs/product/rules/effects/using-effects#reserving-a-coupon-code) effect.

**Note:**

- If the **Reservation mandatory** option was selected when creating the specified coupon,
the endpoint creates a **hard** reservation, meaning only users who have this coupon code reserved can redeem it.
Otherwise, the endpoint creates a **soft** reservation, meaning the coupon will be associated with the specified customer profiles (they show up when using the [List customer data](https://docs.talon.one/integration-api#operation/getCustomerInventory) endpoint), but any user can redeem it.
Otherwise, the endpoint creates a **soft** reservation, meaning the coupon is associated with the specified customer profiles (they show up when using the [List customer data](https://docs.talon.one/integration-api#operation/getCustomerInventory) endpoint), but any user can redeem it.
This can be useful, for example, to display a _coupon wallet_ for customers when they visit your store.
- If the **Coupon visibility** option was selected when creating the specified coupon,

- If the **Coupon visibility** option was selected when creating the specified coupon,
the coupon code is implicitly soft-reserved for all customers, and the code will be returned for all customer profiles in the [List customer data](https://docs.talon.one/integration-api#operation/getCustomerInventory) endpoint.

- This endpoint overrides the coupon reservation limit set when [the coupon is created](https://docs.talon.one/docs/product/campaigns/coupons/creating-coupons).
To ensure that coupons cannot be reserved after the reservation limit is reached, use the [Create coupon code reservation](https://docs.talon.one/docs/product/rules/effects/using-effects#reserving-a-coupon-code) effect in the Rule Builder
and the [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint.

To delete a reservation, use the [Delete reservation](https://docs.talon.one/integration-api#tag/Coupons/operation/deleteCouponReservation) endpoint.

- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
Expand Down Expand Up @@ -1121,9 +1128,17 @@ type apiDeleteCustomerDataRequest struct {
DeleteCustomerData Delete customer's personal data
Delete all attributes on the customer profile and on entities that reference this customer profile.

**Important:** To preserve performance, we recommend avoiding deleting customer data during peak-traffic hours.
**Important:**

- Customer data is deleted from all Applications in the [environment](https://docs.talon.one/docs/product/applications/overview#application-environments)
that the API key belongs to. For example, if you use this endpoint with an API key that belongs to a sandbox Application,
customer data will be deleted from all sandbox Applications. This is because customer data is shared
between Applications from the same environment.

- To preserve performance, we recommend avoiding deleting customer data during peak-traffic hours.

- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

- @param integrationId The integration ID of the customer profile. You can get the `integrationId` of a profile using: - A customer session integration ID with the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint.

@return apiDeleteCustomerDataRequest
Expand Down Expand Up @@ -1787,9 +1802,9 @@ func (r apiGetLoyaltyBalancesRequest) IncludeProjectedTier(includeProjectedTier
}

/*
GetLoyaltyBalances Get customer's loyalty points
GetLoyaltyBalances Get customer's loyalty balances
Retrieve loyalty ledger balances for the given Integration ID in the specified loyalty program.
You can filter balances by date and subledger ID.
You can filter balances by date and subledger ID, and include tier-related information in the response.

**Note**: If no filtering options are applied, you retrieve all loyalty balances on the current date for the given integration ID.

Expand Down Expand Up @@ -2035,7 +2050,15 @@ func (r apiGetLoyaltyCardBalancesRequest) Execute() (LoyaltyCardBalances, *_neth
localVarQueryParams.Add("endDate", parameterToString(*r.endDate, ""))
}
if r.subledgerId != nil {
localVarQueryParams.Add("subledgerId", parameterToString(*r.subledgerId, "csv"))
t := *r.subledgerId
if reflect.TypeOf(t).Kind() == reflect.Slice {
s := reflect.ValueOf(t)
for i := 0; i < s.Len(); i++ {
localVarQueryParams.Add("subledgerId", parameterToString(s.Index(i), "multi"))
}
} else {
localVarQueryParams.Add("subledgerId", parameterToString(t, "multi"))
}
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
Expand Down Expand Up @@ -2234,7 +2257,15 @@ func (r apiGetLoyaltyCardPointsRequest) Execute() (InlineResponse2003, *_nethttp
localVarQueryParams.Add("status", parameterToString(*r.status, ""))
}
if r.subledgerId != nil {
localVarQueryParams.Add("subledgerId", parameterToString(*r.subledgerId, "csv"))
t := *r.subledgerId
if reflect.TypeOf(t).Kind() == reflect.Slice {
s := reflect.ValueOf(t)
for i := 0; i < s.Len(); i++ {
localVarQueryParams.Add("subledgerId", parameterToString(s.Index(i), "multi"))
}
} else {
localVarQueryParams.Add("subledgerId", parameterToString(t, "multi"))
}
}
if r.pageSize != nil {
localVarQueryParams.Add("pageSize", parameterToString(*r.pageSize, ""))
Expand Down Expand Up @@ -2444,7 +2475,15 @@ func (r apiGetLoyaltyCardTransactionsRequest) Execute() (InlineResponse2001, *_n
}

if r.subledgerId != nil {
localVarQueryParams.Add("subledgerId", parameterToString(*r.subledgerId, "csv"))
t := *r.subledgerId
if reflect.TypeOf(t).Kind() == reflect.Slice {
s := reflect.ValueOf(t)
for i := 0; i < s.Len(); i++ {
localVarQueryParams.Add("subledgerId", parameterToString(s.Index(i), "multi"))
}
} else {
localVarQueryParams.Add("subledgerId", parameterToString(t, "multi"))
}
}
if r.loyaltyTransactionType != nil {
localVarQueryParams.Add("loyaltyTransactionType", parameterToString(*r.loyaltyTransactionType, ""))
Expand Down
Loading
Loading