From 96d34e7fc216b7d5ccaa9f8819c01b191bdb7172 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Semp=C3=A9?= Date: Mon, 24 Apr 2023 11:53:04 +0200 Subject: [PATCH] misc: Change Id to ID for naming --- charge.go | 2 +- coupon.go | 6 +++--- fee.go | 4 ++-- invoice.go | 2 +- wallet.go | 14 +++++++------- wallet_transaction.go | 6 +++--- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/charge.go b/charge.go index 526391a..fff3a46 100644 --- a/charge.go +++ b/charge.go @@ -27,6 +27,6 @@ type Charge struct { } type GroupProperties struct { - GroupId uuid.UUID `json:"group_id"` + GroupID uuid.UUID `json:"group_id"` Values map[string]interface{} `json:"values"` } diff --git a/coupon.go b/coupon.go index 22a9a6f..fa9932f 100644 --- a/coupon.go +++ b/coupon.go @@ -110,7 +110,7 @@ type AppliedCouponListInput struct { PerPage int `json:"per_page,omitempty,string"` Page int `json:"page,omitempty,string"` Status AppliedCouponStatus `json:"status,omitempty,string"` - ExternalCustomerId string `json:"external_customer_id,omitempty,string"` + ExternalCustomerID string `json:"external_customer_id,omitempty,string"` } type ApplyCouponParams struct { @@ -337,8 +337,8 @@ func (cr *CouponRequest) ApplyToCustomer(ctx context.Context, applyCouponInput * return appliedCouponResult.AppliedCoupon, nil } -func (acr *AppliedCouponRequest) AppliedCouponDelete(ctx context.Context, externalCustomerId string, appliedCouponId string) (*AppliedCoupon, *Error) { - subPath := fmt.Sprintf("%s/%s/%s/%s", "customers", externalCustomerId, "applied_coupons", appliedCouponId) +func (acr *AppliedCouponRequest) AppliedCouponDelete(ctx context.Context, externalCustomerID string, appliedCouponID string) (*AppliedCoupon, *Error) { + subPath := fmt.Sprintf("%s/%s/%s/%s", "customers", externalCustomerID, "applied_coupons", appliedCouponID) clientRequest := &ClientRequest{ Path: subPath, Result: &AppliedCouponResult{}, diff --git a/fee.go b/fee.go index c22bcba..92e64ae 100644 --- a/fee.go +++ b/fee.go @@ -59,8 +59,8 @@ type FeeListInput struct { FeeType FeeType `json:"fee_type,omitempty"` PaymentStatus FeePaymentStatus `json:"payment_status,omitempty"` - ExternalSubscriptionId string `json:"external_subscription_id,omitempty"` - ExternalCustomerId string `json:"external_customer_id,omitempty"` + ExternalSubscriptionID string `json:"external_subscription_id,omitempty"` + ExternalCustomerID string `json:"external_customer_id,omitempty"` BillableMetricCode string `json:"billable_metric_code,omitempty"` diff --git a/invoice.go b/invoice.go index b193b05..9b59288 100644 --- a/invoice.go +++ b/invoice.go @@ -75,7 +75,7 @@ type InvoiceListInput struct { IssuingDateFrom string `json:"issuing_date_from,omitempty"` IssuingDateTo string `json:"issuing_date_to,omitempty"` - ExternalCustomerId string `json:"external_customer_id,omitempty"` + ExternalCustomerID string `json:"external_customer_id,omitempty"` Status InvoiceStatus `json:"status,omitempty"` PaymentStatus InvoicePaymentStatus `json:"payment_status,omitempty"` } diff --git a/wallet.go b/wallet.go index 6b4017a..4492510 100644 --- a/wallet.go +++ b/wallet.go @@ -31,7 +31,7 @@ type WalletInput struct { PaidCredits string `json:"paid_credits,omitempty"` GrantedCredits string `json:"granted_credits,omitempty"` ExpirationAt *time.Time `json:"expiration_at,omitempty"` - ExternalCustomerId string `json:"external_customer_id,omitempty"` + ExternalCustomerID string `json:"external_customer_id,omitempty"` } type WalletListInput struct { @@ -71,8 +71,8 @@ func (c *Client) Wallet() *WalletRequest { } } -func (bmr *WalletRequest) Get(ctx context.Context, walletId string) (*Wallet, *Error) { - subPath := fmt.Sprintf("%s/%s", "wallets", walletId) +func (bmr *WalletRequest) Get(ctx context.Context, walletID string) (*Wallet, *Error) { + subPath := fmt.Sprintf("%s/%s", "wallets", walletID) clientRequest := &ClientRequest{ Path: subPath, Result: &WalletResult{}, @@ -145,8 +145,8 @@ func (bmr *WalletRequest) Create(ctx context.Context, walletInput *WalletInput) return walletResult.Wallet, nil } -func (bmr *WalletRequest) Update(ctx context.Context, walletInput *WalletInput, walletId string) (*Wallet, *Error) { - subPath := fmt.Sprintf("%s/%s", "wallets", walletId) +func (bmr *WalletRequest) Update(ctx context.Context, walletInput *WalletInput, walletID string) (*Wallet, *Error) { + subPath := fmt.Sprintf("%s/%s", "wallets", walletID) clientRequest := &ClientRequest{ Path: subPath, Result: &WalletResult{}, @@ -166,8 +166,8 @@ func (bmr *WalletRequest) Update(ctx context.Context, walletInput *WalletInput, return walletResult.Wallet, nil } -func (bmr *WalletRequest) Delete(ctx context.Context, walletId string) (*Wallet, *Error) { - subPath := fmt.Sprintf("%s/%s", "wallets", walletId) +func (bmr *WalletRequest) Delete(ctx context.Context, walletID string) (*Wallet, *Error) { + subPath := fmt.Sprintf("%s/%s", "wallets", walletID) clientRequest := &ClientRequest{ Path: subPath, Result: &WalletResult{}, diff --git a/wallet_transaction.go b/wallet_transaction.go index 2faf82c..6db408d 100644 --- a/wallet_transaction.go +++ b/wallet_transaction.go @@ -30,7 +30,7 @@ type WalletTransactionRequest struct { type WalletTransactionListInput struct { PerPage int `json:"per_page,omitempty,string"` Page int `json:"page,omitempty,string"` - WalletId string `json:"wallet_id,omitempty"` + WalletID string `json:"wallet_id,omitempty"` Status WalletTransactionStatus `json:"status,omitempty"` TransactionType TransactionType `json:"transaction_type,omitempty"` } @@ -40,7 +40,7 @@ type WalletTransactionParams struct { } type WalletTransactionInput struct { - WalletId string `json:"wallet_id,omitempty"` + WalletID string `json:"wallet_id,omitempty"` PaidCredits string `json:"paid_credits,omitempty"` GrantedCredits string `json:"granted_credits,omitempty"` } @@ -101,7 +101,7 @@ func (wtr *WalletTransactionRequest) GetList(ctx context.Context, walletTransact return nil, &Error{Err: err} } - subPath := fmt.Sprintf("%s/%s/%s", "wallets", walletTransactionListInput.WalletId, "wallet_transactions") + subPath := fmt.Sprintf("%s/%s/%s", "wallets", walletTransactionListInput.WalletID, "wallet_transactions") clientRequest := &ClientRequest{ Path: subPath, QueryParams: queryParams,