Skip to content
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.31.0"
".": "1.32.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 118
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-cbce25283cb9c3282e03e08b7ee81395436af7d0eb480ffcbab307b5bf1c92a0.yml
openapi_spec_hash: c286edf46db95dee05eb6f180ac24ab0
config_hash: 1f73a949b649ecfe6ec68ba1bb459dc2
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-ef726ad139fa29757029206ee08150434fc6c52005fec6d42c7d2bcd3aa7ab47.yml
openapi_spec_hash: e622beb7c26f9b0dd641bd5c92735a5b
config_hash: dd4343ce95871032ef6e0735a4ca038c
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 1.32.0 (2025-10-29)

Full Changelog: [v1.31.0...v1.32.0](https://github.com/orbcorp/orb-go/compare/v1.31.0...v1.32.0)

### Features

* **api:** api update ([e4fcf82](https://github.com/orbcorp/orb-go/commit/e4fcf82dc846e8feed6e6a391c1bf8e092f6110b))

## 1.31.0 (2025-10-23)

Full Changelog: [v1.30.0...v1.31.0](https://github.com/orbcorp/orb-go/compare/v1.30.0...v1.31.0)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Or to pin the version:
<!-- x-release-please-start-version -->

```sh
go get -u 'github.com/orbcorp/orb-go@v1.31.0'
go get -u 'github.com/orbcorp/orb-go@v1.32.0'
```

<!-- x-release-please-end -->
Expand Down
34 changes: 34 additions & 0 deletions aliases.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,40 @@ type AggregatedCost = shared.AggregatedCost
// This is an alias to an internal type.
type Allocation = shared.Allocation

// This is an alias to an internal type.
type AllocationFilter = shared.AllocationFilter

// The property of the price to filter on.
//
// This is an alias to an internal type.
type AllocationFiltersField = shared.AllocationFiltersField

// This is an alias to an internal value.
const AllocationFiltersFieldPriceID = shared.AllocationFiltersFieldPriceID

// This is an alias to an internal value.
const AllocationFiltersFieldItemID = shared.AllocationFiltersFieldItemID

// This is an alias to an internal value.
const AllocationFiltersFieldPriceType = shared.AllocationFiltersFieldPriceType

// This is an alias to an internal value.
const AllocationFiltersFieldCurrency = shared.AllocationFiltersFieldCurrency

// This is an alias to an internal value.
const AllocationFiltersFieldPricingUnitID = shared.AllocationFiltersFieldPricingUnitID

// Should prices that match the filter be included or excluded.
//
// This is an alias to an internal type.
type AllocationFiltersOperator = shared.AllocationFiltersOperator

// This is an alias to an internal value.
const AllocationFiltersOperatorIncludes = shared.AllocationFiltersOperatorIncludes

// This is an alias to an internal value.
const AllocationFiltersOperatorExcludes = shared.AllocationFiltersOperatorExcludes

// This is an alias to an internal type.
type AmountDiscount = shared.AmountDiscount

Expand Down
174 changes: 153 additions & 21 deletions customer.go

Large diffs are not rendered by default.

35 changes: 20 additions & 15 deletions customer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,10 @@ func TestCustomerNewWithOptionalParams(t *testing.T) {
State: orb.F("state"),
}),
TaxConfiguration: orb.F[orb.CustomerNewParamsTaxConfigurationUnion](orb.NewAvalaraTaxConfigurationParam{
TaxExempt: orb.F(true),
TaxProvider: orb.F(orb.NewAvalaraTaxConfigurationTaxProviderAvalara),
TaxExemptionCode: orb.F("tax_exemption_code"),
TaxExempt: orb.F(true),
TaxProvider: orb.F(orb.NewAvalaraTaxConfigurationTaxProviderAvalara),
AutomaticTaxEnabled: orb.F(true),
TaxExemptionCode: orb.F("tax_exemption_code"),
}),
TaxID: orb.F(shared.CustomerTaxIDParam{
Country: orb.F(shared.CustomerTaxIDCountryAd),
Expand Down Expand Up @@ -115,9 +116,10 @@ func TestCustomerUpdateWithOptionalParams(t *testing.T) {
}}),
Excluded: orb.F(true),
}),
AdditionalEmails: orb.F([]string{"string"}),
AutoCollection: orb.F(true),
AutoIssuance: orb.F(true),
AdditionalEmails: orb.F([]string{"string"}),
AutoCollection: orb.F(true),
AutoIssuance: orb.F(true),
AutomaticTaxEnabled: orb.F(true),
BillingAddress: orb.F(orb.AddressInputParam{
City: orb.F("city"),
Country: orb.F("country"),
Expand Down Expand Up @@ -152,9 +154,10 @@ func TestCustomerUpdateWithOptionalParams(t *testing.T) {
State: orb.F("state"),
}),
TaxConfiguration: orb.F[orb.CustomerUpdateParamsTaxConfigurationUnion](orb.NewAvalaraTaxConfigurationParam{
TaxExempt: orb.F(true),
TaxProvider: orb.F(orb.NewAvalaraTaxConfigurationTaxProviderAvalara),
TaxExemptionCode: orb.F("tax_exemption_code"),
TaxExempt: orb.F(true),
TaxProvider: orb.F(orb.NewAvalaraTaxConfigurationTaxProviderAvalara),
AutomaticTaxEnabled: orb.F(true),
TaxExemptionCode: orb.F("tax_exemption_code"),
}),
TaxID: orb.F(shared.CustomerTaxIDParam{
Country: orb.F(shared.CustomerTaxIDCountryAd),
Expand Down Expand Up @@ -334,9 +337,10 @@ func TestCustomerUpdateByExternalIDWithOptionalParams(t *testing.T) {
}}),
Excluded: orb.F(true),
}),
AdditionalEmails: orb.F([]string{"string"}),
AutoCollection: orb.F(true),
AutoIssuance: orb.F(true),
AdditionalEmails: orb.F([]string{"string"}),
AutoCollection: orb.F(true),
AutoIssuance: orb.F(true),
AutomaticTaxEnabled: orb.F(true),
BillingAddress: orb.F(orb.AddressInputParam{
City: orb.F("city"),
Country: orb.F("country"),
Expand Down Expand Up @@ -371,9 +375,10 @@ func TestCustomerUpdateByExternalIDWithOptionalParams(t *testing.T) {
State: orb.F("state"),
}),
TaxConfiguration: orb.F[orb.CustomerUpdateByExternalIDParamsTaxConfigurationUnion](orb.NewAvalaraTaxConfigurationParam{
TaxExempt: orb.F(true),
TaxProvider: orb.F(orb.NewAvalaraTaxConfigurationTaxProviderAvalara),
TaxExemptionCode: orb.F("tax_exemption_code"),
TaxExempt: orb.F(true),
TaxProvider: orb.F(orb.NewAvalaraTaxConfigurationTaxProviderAvalara),
AutomaticTaxEnabled: orb.F(true),
TaxExemptionCode: orb.F("tax_exemption_code"),
}),
TaxID: orb.F(shared.CustomerTaxIDParam{
Country: orb.F(shared.CustomerTaxIDCountryAd),
Expand Down
58 changes: 29 additions & 29 deletions customercreditledger.go
Original file line number Diff line number Diff line change
Expand Up @@ -670,18 +670,18 @@ func (r *CustomerCreditLedgerService) ListByExternalIDAutoPaging(ctx context.Con
}

type AffectedBlock struct {
ID string `json:"id,required"`
BlockFilters []AffectedBlockBlockFilter `json:"block_filters,required,nullable"`
ExpiryDate time.Time `json:"expiry_date,required,nullable" format:"date-time"`
PerUnitCostBasis string `json:"per_unit_cost_basis,required,nullable"`
JSON affectedBlockJSON `json:"-"`
ID string `json:"id,required"`
ExpiryDate time.Time `json:"expiry_date,required,nullable" format:"date-time"`
Filters []AffectedBlockFilter `json:"filters,required"`
PerUnitCostBasis string `json:"per_unit_cost_basis,required,nullable"`
JSON affectedBlockJSON `json:"-"`
}

// affectedBlockJSON contains the JSON metadata for the struct [AffectedBlock]
type affectedBlockJSON struct {
ID apijson.Field
BlockFilters apijson.Field
ExpiryDate apijson.Field
Filters apijson.Field
PerUnitCostBasis apijson.Field
raw string
ExtraFields map[string]apijson.Field
Expand All @@ -695,64 +695,64 @@ func (r affectedBlockJSON) RawJSON() string {
return r.raw
}

type AffectedBlockBlockFilter struct {
type AffectedBlockFilter struct {
// The property of the price to filter on.
Field AffectedBlockBlockFiltersField `json:"field,required"`
Field AffectedBlockFiltersField `json:"field,required"`
// Should prices that match the filter be included or excluded.
Operator AffectedBlockBlockFiltersOperator `json:"operator,required"`
Operator AffectedBlockFiltersOperator `json:"operator,required"`
// The IDs or values that match this filter.
Values []string `json:"values,required"`
JSON affectedBlockBlockFilterJSON `json:"-"`
Values []string `json:"values,required"`
JSON affectedBlockFilterJSON `json:"-"`
}

// affectedBlockBlockFilterJSON contains the JSON metadata for the struct
// [AffectedBlockBlockFilter]
type affectedBlockBlockFilterJSON struct {
// affectedBlockFilterJSON contains the JSON metadata for the struct
// [AffectedBlockFilter]
type affectedBlockFilterJSON struct {
Field apijson.Field
Operator apijson.Field
Values apijson.Field
raw string
ExtraFields map[string]apijson.Field
}

func (r *AffectedBlockBlockFilter) UnmarshalJSON(data []byte) (err error) {
func (r *AffectedBlockFilter) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}

func (r affectedBlockBlockFilterJSON) RawJSON() string {
func (r affectedBlockFilterJSON) RawJSON() string {
return r.raw
}

// The property of the price to filter on.
type AffectedBlockBlockFiltersField string
type AffectedBlockFiltersField string

const (
AffectedBlockBlockFiltersFieldPriceID AffectedBlockBlockFiltersField = "price_id"
AffectedBlockBlockFiltersFieldItemID AffectedBlockBlockFiltersField = "item_id"
AffectedBlockBlockFiltersFieldPriceType AffectedBlockBlockFiltersField = "price_type"
AffectedBlockBlockFiltersFieldCurrency AffectedBlockBlockFiltersField = "currency"
AffectedBlockBlockFiltersFieldPricingUnitID AffectedBlockBlockFiltersField = "pricing_unit_id"
AffectedBlockFiltersFieldPriceID AffectedBlockFiltersField = "price_id"
AffectedBlockFiltersFieldItemID AffectedBlockFiltersField = "item_id"
AffectedBlockFiltersFieldPriceType AffectedBlockFiltersField = "price_type"
AffectedBlockFiltersFieldCurrency AffectedBlockFiltersField = "currency"
AffectedBlockFiltersFieldPricingUnitID AffectedBlockFiltersField = "pricing_unit_id"
)

func (r AffectedBlockBlockFiltersField) IsKnown() bool {
func (r AffectedBlockFiltersField) IsKnown() bool {
switch r {
case AffectedBlockBlockFiltersFieldPriceID, AffectedBlockBlockFiltersFieldItemID, AffectedBlockBlockFiltersFieldPriceType, AffectedBlockBlockFiltersFieldCurrency, AffectedBlockBlockFiltersFieldPricingUnitID:
case AffectedBlockFiltersFieldPriceID, AffectedBlockFiltersFieldItemID, AffectedBlockFiltersFieldPriceType, AffectedBlockFiltersFieldCurrency, AffectedBlockFiltersFieldPricingUnitID:
return true
}
return false
}

// Should prices that match the filter be included or excluded.
type AffectedBlockBlockFiltersOperator string
type AffectedBlockFiltersOperator string

const (
AffectedBlockBlockFiltersOperatorIncludes AffectedBlockBlockFiltersOperator = "includes"
AffectedBlockBlockFiltersOperatorExcludes AffectedBlockBlockFiltersOperator = "excludes"
AffectedBlockFiltersOperatorIncludes AffectedBlockFiltersOperator = "includes"
AffectedBlockFiltersOperatorExcludes AffectedBlockFiltersOperator = "excludes"
)

func (r AffectedBlockBlockFiltersOperator) IsKnown() bool {
func (r AffectedBlockFiltersOperator) IsKnown() bool {
switch r {
case AffectedBlockBlockFiltersOperatorIncludes, AffectedBlockBlockFiltersOperatorExcludes:
case AffectedBlockFiltersOperatorIncludes, AffectedBlockFiltersOperatorExcludes:
return true
}
return false
Expand Down
2 changes: 1 addition & 1 deletion internal/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

package internal

const PackageVersion = "1.31.0" // x-release-please-version
const PackageVersion = "1.32.0" // x-release-please-version
73 changes: 69 additions & 4 deletions shared/shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,17 +247,19 @@ func (r aggregatedCostJSON) RawJSON() string {
}

type Allocation struct {
AllowsRollover bool `json:"allows_rollover,required"`
Currency string `json:"currency,required"`
CustomExpiration CustomExpiration `json:"custom_expiration,required,nullable"`
JSON allocationJSON `json:"-"`
AllowsRollover bool `json:"allows_rollover,required"`
Currency string `json:"currency,required"`
CustomExpiration CustomExpiration `json:"custom_expiration,required,nullable"`
Filters []AllocationFilter `json:"filters"`
JSON allocationJSON `json:"-"`
}

// allocationJSON contains the JSON metadata for the struct [Allocation]
type allocationJSON struct {
AllowsRollover apijson.Field
Currency apijson.Field
CustomExpiration apijson.Field
Filters apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
Expand All @@ -270,6 +272,69 @@ func (r allocationJSON) RawJSON() string {
return r.raw
}

type AllocationFilter struct {
// The property of the price to filter on.
Field AllocationFiltersField `json:"field,required"`
// Should prices that match the filter be included or excluded.
Operator AllocationFiltersOperator `json:"operator,required"`
// The IDs or values that match this filter.
Values []string `json:"values,required"`
JSON allocationFilterJSON `json:"-"`
}

// allocationFilterJSON contains the JSON metadata for the struct
// [AllocationFilter]
type allocationFilterJSON struct {
Field apijson.Field
Operator apijson.Field
Values apijson.Field
raw string
ExtraFields map[string]apijson.Field
}

func (r *AllocationFilter) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}

func (r allocationFilterJSON) RawJSON() string {
return r.raw
}

// The property of the price to filter on.
type AllocationFiltersField string

const (
AllocationFiltersFieldPriceID AllocationFiltersField = "price_id"
AllocationFiltersFieldItemID AllocationFiltersField = "item_id"
AllocationFiltersFieldPriceType AllocationFiltersField = "price_type"
AllocationFiltersFieldCurrency AllocationFiltersField = "currency"
AllocationFiltersFieldPricingUnitID AllocationFiltersField = "pricing_unit_id"
)

func (r AllocationFiltersField) IsKnown() bool {
switch r {
case AllocationFiltersFieldPriceID, AllocationFiltersFieldItemID, AllocationFiltersFieldPriceType, AllocationFiltersFieldCurrency, AllocationFiltersFieldPricingUnitID:
return true
}
return false
}

// Should prices that match the filter be included or excluded.
type AllocationFiltersOperator string

const (
AllocationFiltersOperatorIncludes AllocationFiltersOperator = "includes"
AllocationFiltersOperatorExcludes AllocationFiltersOperator = "excludes"
)

func (r AllocationFiltersOperator) IsKnown() bool {
switch r {
case AllocationFiltersOperatorIncludes, AllocationFiltersOperatorExcludes:
return true
}
return false
}

type AmountDiscount struct {
// Only available if discount_type is `amount`.
AmountDiscount string `json:"amount_discount,required"`
Expand Down