Documentation
¶
Index ¶
- type AmountDiscount
- type AmountDiscountDiscountType
- type AmountDiscountFilter
- type AmountDiscountFilterParam
- type AmountDiscountFiltersField
- type AmountDiscountFiltersOperator
- type AmountDiscountParam
- type BillingCycleRelativeDate
- func (r BillingCycleRelativeDate) ImplementsSubscriptionPriceIntervalsParamsAddAdjustmentsEndDateUnion()
- func (r BillingCycleRelativeDate) ImplementsSubscriptionPriceIntervalsParamsAddAdjustmentsStartDateUnion()
- func (r BillingCycleRelativeDate) ImplementsSubscriptionPriceIntervalsParamsAddEndDateUnion()
- func (r BillingCycleRelativeDate) ImplementsSubscriptionPriceIntervalsParamsAddStartDateUnion()
- func (r BillingCycleRelativeDate) ImplementsSubscriptionPriceIntervalsParamsEditAdjustmentsEndDateUnion()
- func (r BillingCycleRelativeDate) ImplementsSubscriptionPriceIntervalsParamsEditAdjustmentsStartDateUnion()
- func (r BillingCycleRelativeDate) ImplementsSubscriptionPriceIntervalsParamsEditEndDateUnion()
- func (r BillingCycleRelativeDate) ImplementsSubscriptionPriceIntervalsParamsEditStartDateUnion()
- func (r BillingCycleRelativeDate) IsKnown() bool
- type Discount
- type DiscountDiscountType
- type DiscountParam
- type DiscountUnion
- type DiscountUnionParam
- type InvoiceLevelDiscount
- type InvoiceLevelDiscountDiscountType
- type InvoiceLevelDiscountUnion
- type PaginationMetadata
- type PercentageDiscount
- type PercentageDiscountDiscountType
- type PercentageDiscountFilter
- type PercentageDiscountFilterParam
- type PercentageDiscountFiltersField
- type PercentageDiscountFiltersOperator
- type PercentageDiscountParam
- type TrialDiscount
- type TrialDiscountDiscountType
- type TrialDiscountFilter
- type TrialDiscountFilterParam
- type TrialDiscountFiltersField
- type TrialDiscountFiltersOperator
- type TrialDiscountParam
- type UnionBool
- type UnionFloat
- type UnionString
- type UnionTime
- func (UnionTime) ImplementsSubscriptionPriceIntervalsParamsAddAdjustmentsEndDateUnion()
- func (UnionTime) ImplementsSubscriptionPriceIntervalsParamsAddAdjustmentsStartDateUnion()
- func (UnionTime) ImplementsSubscriptionPriceIntervalsParamsAddEndDateUnion()
- func (UnionTime) ImplementsSubscriptionPriceIntervalsParamsAddStartDateUnion()
- func (UnionTime) ImplementsSubscriptionPriceIntervalsParamsEditAdjustmentsEndDateUnion()
- func (UnionTime) ImplementsSubscriptionPriceIntervalsParamsEditAdjustmentsStartDateUnion()
- func (UnionTime) ImplementsSubscriptionPriceIntervalsParamsEditEndDateUnion()
- func (UnionTime) ImplementsSubscriptionPriceIntervalsParamsEditStartDateUnion()
- func (UnionTime) ImplementsSubscriptionUpdateTrialParamsTrialEndDateUnion()
- type UsageDiscount
- type UsageDiscountDiscountType
- type UsageDiscountFilter
- type UsageDiscountFilterParam
- type UsageDiscountFiltersField
- type UsageDiscountFiltersOperator
- type UsageDiscountParam
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AmountDiscount ¶ added in v0.67.0
type AmountDiscount struct {
// Only available if discount_type is `amount`.
AmountDiscount string `json:"amount_discount,required"`
DiscountType AmountDiscountDiscountType `json:"discount_type,required"`
// List of price_ids that this discount applies to. For plan/plan phase discounts,
// this can be a subset of prices.
AppliesToPriceIDs []string `json:"applies_to_price_ids,nullable"`
// The filters that determine which prices to apply this discount to.
Filters []AmountDiscountFilter `json:"filters,nullable"`
Reason string `json:"reason,nullable"`
JSON amountDiscountJSON `json:"-"`
}
func (AmountDiscount) ImplementsCouponDiscount ¶ added in v0.67.0
func (r AmountDiscount) ImplementsCouponDiscount()
func (AmountDiscount) ImplementsDiscount ¶ added in v0.89.1
func (r AmountDiscount) ImplementsDiscount()
func (AmountDiscount) ImplementsInvoiceLevelDiscount ¶ added in v0.89.1
func (r AmountDiscount) ImplementsInvoiceLevelDiscount()
func (*AmountDiscount) UnmarshalJSON ¶ added in v0.67.0
func (r *AmountDiscount) UnmarshalJSON(data []byte) (err error)
type AmountDiscountDiscountType ¶ added in v0.67.0
type AmountDiscountDiscountType string
const (
AmountDiscountDiscountTypeAmount AmountDiscountDiscountType = "amount"
)
func (AmountDiscountDiscountType) IsKnown ¶ added in v0.67.0
func (r AmountDiscountDiscountType) IsKnown() bool
type AmountDiscountFilter ¶ added in v0.120.0
type AmountDiscountFilter struct {
// The property of the price to filter on.
Field AmountDiscountFiltersField `json:"field,required"`
// Should prices that match the filter be included or excluded.
Operator AmountDiscountFiltersOperator `json:"operator,required"`
// The IDs or values that match this filter.
Values []string `json:"values,required"`
JSON amountDiscountFilterJSON `json:"-"`
}
func (*AmountDiscountFilter) UnmarshalJSON ¶ added in v0.120.0
func (r *AmountDiscountFilter) UnmarshalJSON(data []byte) (err error)
type AmountDiscountFilterParam ¶ added in v0.120.0
type AmountDiscountFilterParam struct {
// The property of the price to filter on.
Field param.Field[AmountDiscountFiltersField] `json:"field,required"`
// Should prices that match the filter be included or excluded.
Operator param.Field[AmountDiscountFiltersOperator] `json:"operator,required"`
// The IDs or values that match this filter.
Values param.Field[[]string] `json:"values,required"`
}
func (AmountDiscountFilterParam) MarshalJSON ¶ added in v0.120.0
func (r AmountDiscountFilterParam) MarshalJSON() (data []byte, err error)
type AmountDiscountFiltersField ¶ added in v0.120.0
type AmountDiscountFiltersField string
The property of the price to filter on.
const ( AmountDiscountFiltersFieldPriceID AmountDiscountFiltersField = "price_id" AmountDiscountFiltersFieldItemID AmountDiscountFiltersField = "item_id" AmountDiscountFiltersFieldPriceType AmountDiscountFiltersField = "price_type" AmountDiscountFiltersFieldCurrency AmountDiscountFiltersField = "currency" AmountDiscountFiltersFieldPricingUnitID AmountDiscountFiltersField = "pricing_unit_id" )
func (AmountDiscountFiltersField) IsKnown ¶ added in v0.120.0
func (r AmountDiscountFiltersField) IsKnown() bool
type AmountDiscountFiltersOperator ¶ added in v0.120.0
type AmountDiscountFiltersOperator string
Should prices that match the filter be included or excluded.
const ( AmountDiscountFiltersOperatorIncludes AmountDiscountFiltersOperator = "includes" AmountDiscountFiltersOperatorExcludes AmountDiscountFiltersOperator = "excludes" )
func (AmountDiscountFiltersOperator) IsKnown ¶ added in v0.120.0
func (r AmountDiscountFiltersOperator) IsKnown() bool
type AmountDiscountParam ¶ added in v0.67.0
type AmountDiscountParam struct {
// Only available if discount_type is `amount`.
AmountDiscount param.Field[string] `json:"amount_discount,required"`
DiscountType param.Field[AmountDiscountDiscountType] `json:"discount_type,required"`
// List of price_ids that this discount applies to. For plan/plan phase discounts,
// this can be a subset of prices.
AppliesToPriceIDs param.Field[[]string] `json:"applies_to_price_ids"`
// The filters that determine which prices to apply this discount to.
Filters param.Field[[]AmountDiscountFilterParam] `json:"filters"`
Reason param.Field[string] `json:"reason"`
}
func (AmountDiscountParam) ImplementsDiscountUnionParam ¶ added in v0.89.1
func (r AmountDiscountParam) ImplementsDiscountUnionParam()
func (AmountDiscountParam) MarshalJSON ¶ added in v0.67.0
func (r AmountDiscountParam) MarshalJSON() (data []byte, err error)
type BillingCycleRelativeDate ¶
type BillingCycleRelativeDate string
const ( BillingCycleRelativeDateStartOfTerm BillingCycleRelativeDate = "start_of_term" BillingCycleRelativeDateEndOfTerm BillingCycleRelativeDate = "end_of_term" )
func (BillingCycleRelativeDate) ImplementsSubscriptionPriceIntervalsParamsAddAdjustmentsEndDateUnion ¶ added in v0.37.1
func (r BillingCycleRelativeDate) ImplementsSubscriptionPriceIntervalsParamsAddAdjustmentsEndDateUnion()
func (BillingCycleRelativeDate) ImplementsSubscriptionPriceIntervalsParamsAddAdjustmentsStartDateUnion ¶ added in v0.37.1
func (r BillingCycleRelativeDate) ImplementsSubscriptionPriceIntervalsParamsAddAdjustmentsStartDateUnion()
func (BillingCycleRelativeDate) ImplementsSubscriptionPriceIntervalsParamsAddEndDateUnion ¶ added in v0.37.1
func (r BillingCycleRelativeDate) ImplementsSubscriptionPriceIntervalsParamsAddEndDateUnion()
func (BillingCycleRelativeDate) ImplementsSubscriptionPriceIntervalsParamsAddStartDateUnion ¶ added in v0.37.1
func (r BillingCycleRelativeDate) ImplementsSubscriptionPriceIntervalsParamsAddStartDateUnion()
func (BillingCycleRelativeDate) ImplementsSubscriptionPriceIntervalsParamsEditAdjustmentsEndDateUnion ¶ added in v0.37.1
func (r BillingCycleRelativeDate) ImplementsSubscriptionPriceIntervalsParamsEditAdjustmentsEndDateUnion()
func (BillingCycleRelativeDate) ImplementsSubscriptionPriceIntervalsParamsEditAdjustmentsStartDateUnion ¶ added in v0.37.1
func (r BillingCycleRelativeDate) ImplementsSubscriptionPriceIntervalsParamsEditAdjustmentsStartDateUnion()
func (BillingCycleRelativeDate) ImplementsSubscriptionPriceIntervalsParamsEditEndDateUnion ¶ added in v0.37.1
func (r BillingCycleRelativeDate) ImplementsSubscriptionPriceIntervalsParamsEditEndDateUnion()
func (BillingCycleRelativeDate) ImplementsSubscriptionPriceIntervalsParamsEditStartDateUnion ¶ added in v0.37.1
func (r BillingCycleRelativeDate) ImplementsSubscriptionPriceIntervalsParamsEditStartDateUnion()
func (BillingCycleRelativeDate) IsKnown ¶
func (r BillingCycleRelativeDate) IsKnown() bool
type Discount ¶
type Discount struct {
DiscountType DiscountDiscountType `json:"discount_type,required"`
// Only available if discount_type is `amount`.
AmountDiscount string `json:"amount_discount"`
// This field can have the runtime type of [[]string].
AppliesToPriceIDs interface{} `json:"applies_to_price_ids"`
// This field can have the runtime type of [[]PercentageDiscountFilter],
// [[]TrialDiscountFilter], [[]UsageDiscountFilter], [[]AmountDiscountFilter].
Filters interface{} `json:"filters"`
// Only available if discount_type is `percentage`. This is a number between 0
// and 1.
PercentageDiscount float64 `json:"percentage_discount"`
Reason string `json:"reason,nullable"`
// Only available if discount_type is `trial`
TrialAmountDiscount string `json:"trial_amount_discount,nullable"`
// Only available if discount_type is `trial`
TrialPercentageDiscount float64 `json:"trial_percentage_discount,nullable"`
// Only available if discount_type is `usage`. Number of usage units that this
// discount is for
UsageDiscount float64 `json:"usage_discount"`
JSON discountJSON `json:"-"`
// contains filtered or unexported fields
}
func (Discount) AsUnion ¶
func (r Discount) AsUnion() DiscountUnion
AsUnion returns a DiscountUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are PercentageDiscount, TrialDiscount, UsageDiscount, AmountDiscount.
func (*Discount) UnmarshalJSON ¶
type DiscountDiscountType ¶
type DiscountDiscountType string
const ( DiscountDiscountTypePercentage DiscountDiscountType = "percentage" DiscountDiscountTypeTrial DiscountDiscountType = "trial" DiscountDiscountTypeUsage DiscountDiscountType = "usage" DiscountDiscountTypeAmount DiscountDiscountType = "amount" )
func (DiscountDiscountType) IsKnown ¶
func (r DiscountDiscountType) IsKnown() bool
type DiscountParam ¶ added in v0.35.0
type DiscountParam struct {
DiscountType param.Field[DiscountDiscountType] `json:"discount_type,required"`
// Only available if discount_type is `amount`.
AmountDiscount param.Field[string] `json:"amount_discount"`
AppliesToPriceIDs param.Field[interface{}] `json:"applies_to_price_ids"`
Filters param.Field[interface{}] `json:"filters"`
// Only available if discount_type is `percentage`. This is a number between 0
// and 1.
PercentageDiscount param.Field[float64] `json:"percentage_discount"`
Reason param.Field[string] `json:"reason"`
// Only available if discount_type is `trial`
TrialAmountDiscount param.Field[string] `json:"trial_amount_discount"`
// Only available if discount_type is `trial`
TrialPercentageDiscount param.Field[float64] `json:"trial_percentage_discount"`
// Only available if discount_type is `usage`. Number of usage units that this
// discount is for
UsageDiscount param.Field[float64] `json:"usage_discount"`
}
func (DiscountParam) ImplementsDiscountUnionParam ¶ added in v0.89.1
func (r DiscountParam) ImplementsDiscountUnionParam()
func (DiscountParam) MarshalJSON ¶ added in v0.35.0
func (r DiscountParam) MarshalJSON() (data []byte, err error)
type DiscountUnion ¶
type DiscountUnion interface {
ImplementsDiscount()
}
Union satisfied by PercentageDiscount, TrialDiscount, UsageDiscount or AmountDiscount.
type DiscountUnionParam ¶ added in v0.35.0
type DiscountUnionParam interface {
ImplementsDiscountUnionParam()
}
Satisfied by shared.PercentageDiscountParam, shared.TrialDiscountParam, shared.UsageDiscountParam, shared.AmountDiscountParam, DiscountParam.
type InvoiceLevelDiscount ¶ added in v0.67.0
type InvoiceLevelDiscount struct {
DiscountType InvoiceLevelDiscountDiscountType `json:"discount_type,required"`
// Only available if discount_type is `amount`.
AmountDiscount string `json:"amount_discount"`
// This field can have the runtime type of [[]string].
AppliesToPriceIDs interface{} `json:"applies_to_price_ids"`
// This field can have the runtime type of [[]PercentageDiscountFilter],
// [[]AmountDiscountFilter], [[]TrialDiscountFilter].
Filters interface{} `json:"filters"`
// Only available if discount_type is `percentage`. This is a number between 0
// and 1.
PercentageDiscount float64 `json:"percentage_discount"`
Reason string `json:"reason,nullable"`
// Only available if discount_type is `trial`
TrialAmountDiscount string `json:"trial_amount_discount,nullable"`
// Only available if discount_type is `trial`
TrialPercentageDiscount float64 `json:"trial_percentage_discount,nullable"`
JSON invoiceLevelDiscountJSON `json:"-"`
// contains filtered or unexported fields
}
func (InvoiceLevelDiscount) AsUnion ¶ added in v0.67.0
func (r InvoiceLevelDiscount) AsUnion() InvoiceLevelDiscountUnion
AsUnion returns a InvoiceLevelDiscountUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are PercentageDiscount, AmountDiscount, TrialDiscount.
func (*InvoiceLevelDiscount) UnmarshalJSON ¶ added in v0.67.0
func (r *InvoiceLevelDiscount) UnmarshalJSON(data []byte) (err error)
type InvoiceLevelDiscountDiscountType ¶ added in v0.67.0
type InvoiceLevelDiscountDiscountType string
const ( InvoiceLevelDiscountDiscountTypePercentage InvoiceLevelDiscountDiscountType = "percentage" InvoiceLevelDiscountDiscountTypeAmount InvoiceLevelDiscountDiscountType = "amount" InvoiceLevelDiscountDiscountTypeTrial InvoiceLevelDiscountDiscountType = "trial" )
func (InvoiceLevelDiscountDiscountType) IsKnown ¶ added in v0.67.0
func (r InvoiceLevelDiscountDiscountType) IsKnown() bool
type InvoiceLevelDiscountUnion ¶ added in v0.67.0
type InvoiceLevelDiscountUnion interface {
ImplementsInvoiceLevelDiscount()
}
Union satisfied by PercentageDiscount, AmountDiscount or TrialDiscount.
type PaginationMetadata ¶
type PaginationMetadata struct {
HasMore bool `json:"has_more,required"`
NextCursor string `json:"next_cursor,required,nullable"`
JSON paginationMetadataJSON `json:"-"`
}
func (*PaginationMetadata) UnmarshalJSON ¶
func (r *PaginationMetadata) UnmarshalJSON(data []byte) (err error)
type PercentageDiscount ¶ added in v0.67.0
type PercentageDiscount struct {
DiscountType PercentageDiscountDiscountType `json:"discount_type,required"`
// Only available if discount_type is `percentage`. This is a number between 0
// and 1.
PercentageDiscount float64 `json:"percentage_discount,required"`
// List of price_ids that this discount applies to. For plan/plan phase discounts,
// this can be a subset of prices.
AppliesToPriceIDs []string `json:"applies_to_price_ids,nullable"`
// The filters that determine which prices to apply this discount to.
Filters []PercentageDiscountFilter `json:"filters,nullable"`
Reason string `json:"reason,nullable"`
JSON percentageDiscountJSON `json:"-"`
}
func (PercentageDiscount) ImplementsCouponDiscount ¶ added in v0.67.0
func (r PercentageDiscount) ImplementsCouponDiscount()
func (PercentageDiscount) ImplementsDiscount ¶ added in v0.89.1
func (r PercentageDiscount) ImplementsDiscount()
func (PercentageDiscount) ImplementsInvoiceLevelDiscount ¶ added in v0.89.1
func (r PercentageDiscount) ImplementsInvoiceLevelDiscount()
func (*PercentageDiscount) UnmarshalJSON ¶ added in v0.67.0
func (r *PercentageDiscount) UnmarshalJSON(data []byte) (err error)
type PercentageDiscountDiscountType ¶ added in v0.67.0
type PercentageDiscountDiscountType string
const (
PercentageDiscountDiscountTypePercentage PercentageDiscountDiscountType = "percentage"
)
func (PercentageDiscountDiscountType) IsKnown ¶ added in v0.67.0
func (r PercentageDiscountDiscountType) IsKnown() bool
type PercentageDiscountFilter ¶ added in v0.120.0
type PercentageDiscountFilter struct {
// The property of the price to filter on.
Field PercentageDiscountFiltersField `json:"field,required"`
// Should prices that match the filter be included or excluded.
Operator PercentageDiscountFiltersOperator `json:"operator,required"`
// The IDs or values that match this filter.
Values []string `json:"values,required"`
JSON percentageDiscountFilterJSON `json:"-"`
}
func (*PercentageDiscountFilter) UnmarshalJSON ¶ added in v0.120.0
func (r *PercentageDiscountFilter) UnmarshalJSON(data []byte) (err error)
type PercentageDiscountFilterParam ¶ added in v0.120.0
type PercentageDiscountFilterParam struct {
// The property of the price to filter on.
Field param.Field[PercentageDiscountFiltersField] `json:"field,required"`
// Should prices that match the filter be included or excluded.
Operator param.Field[PercentageDiscountFiltersOperator] `json:"operator,required"`
// The IDs or values that match this filter.
Values param.Field[[]string] `json:"values,required"`
}
func (PercentageDiscountFilterParam) MarshalJSON ¶ added in v0.120.0
func (r PercentageDiscountFilterParam) MarshalJSON() (data []byte, err error)
type PercentageDiscountFiltersField ¶ added in v0.120.0
type PercentageDiscountFiltersField string
The property of the price to filter on.
const ( PercentageDiscountFiltersFieldPriceID PercentageDiscountFiltersField = "price_id" PercentageDiscountFiltersFieldItemID PercentageDiscountFiltersField = "item_id" PercentageDiscountFiltersFieldPriceType PercentageDiscountFiltersField = "price_type" PercentageDiscountFiltersFieldCurrency PercentageDiscountFiltersField = "currency" PercentageDiscountFiltersFieldPricingUnitID PercentageDiscountFiltersField = "pricing_unit_id" )
func (PercentageDiscountFiltersField) IsKnown ¶ added in v0.120.0
func (r PercentageDiscountFiltersField) IsKnown() bool
type PercentageDiscountFiltersOperator ¶ added in v0.120.0
type PercentageDiscountFiltersOperator string
Should prices that match the filter be included or excluded.
const ( PercentageDiscountFiltersOperatorIncludes PercentageDiscountFiltersOperator = "includes" PercentageDiscountFiltersOperatorExcludes PercentageDiscountFiltersOperator = "excludes" )
func (PercentageDiscountFiltersOperator) IsKnown ¶ added in v0.120.0
func (r PercentageDiscountFiltersOperator) IsKnown() bool
type PercentageDiscountParam ¶ added in v0.67.0
type PercentageDiscountParam struct {
DiscountType param.Field[PercentageDiscountDiscountType] `json:"discount_type,required"`
// Only available if discount_type is `percentage`. This is a number between 0
// and 1.
PercentageDiscount param.Field[float64] `json:"percentage_discount,required"`
// List of price_ids that this discount applies to. For plan/plan phase discounts,
// this can be a subset of prices.
AppliesToPriceIDs param.Field[[]string] `json:"applies_to_price_ids"`
// The filters that determine which prices to apply this discount to.
Filters param.Field[[]PercentageDiscountFilterParam] `json:"filters"`
Reason param.Field[string] `json:"reason"`
}
func (PercentageDiscountParam) ImplementsDiscountUnionParam ¶ added in v0.89.1
func (r PercentageDiscountParam) ImplementsDiscountUnionParam()
func (PercentageDiscountParam) MarshalJSON ¶ added in v0.67.0
func (r PercentageDiscountParam) MarshalJSON() (data []byte, err error)
type TrialDiscount ¶ added in v0.67.0
type TrialDiscount struct {
DiscountType TrialDiscountDiscountType `json:"discount_type,required"`
// List of price_ids that this discount applies to. For plan/plan phase discounts,
// this can be a subset of prices.
AppliesToPriceIDs []string `json:"applies_to_price_ids,nullable"`
// The filters that determine which prices to apply this discount to.
Filters []TrialDiscountFilter `json:"filters,nullable"`
Reason string `json:"reason,nullable"`
// Only available if discount_type is `trial`
TrialAmountDiscount string `json:"trial_amount_discount,nullable"`
// Only available if discount_type is `trial`
TrialPercentageDiscount float64 `json:"trial_percentage_discount,nullable"`
JSON trialDiscountJSON `json:"-"`
}
func (TrialDiscount) ImplementsDiscount ¶ added in v0.89.1
func (r TrialDiscount) ImplementsDiscount()
func (TrialDiscount) ImplementsInvoiceLevelDiscount ¶ added in v0.89.1
func (r TrialDiscount) ImplementsInvoiceLevelDiscount()
func (*TrialDiscount) UnmarshalJSON ¶ added in v0.67.0
func (r *TrialDiscount) UnmarshalJSON(data []byte) (err error)
type TrialDiscountDiscountType ¶ added in v0.67.0
type TrialDiscountDiscountType string
const (
TrialDiscountDiscountTypeTrial TrialDiscountDiscountType = "trial"
)
func (TrialDiscountDiscountType) IsKnown ¶ added in v0.67.0
func (r TrialDiscountDiscountType) IsKnown() bool
type TrialDiscountFilter ¶ added in v0.120.0
type TrialDiscountFilter struct {
// The property of the price to filter on.
Field TrialDiscountFiltersField `json:"field,required"`
// Should prices that match the filter be included or excluded.
Operator TrialDiscountFiltersOperator `json:"operator,required"`
// The IDs or values that match this filter.
Values []string `json:"values,required"`
JSON trialDiscountFilterJSON `json:"-"`
}
func (*TrialDiscountFilter) UnmarshalJSON ¶ added in v0.120.0
func (r *TrialDiscountFilter) UnmarshalJSON(data []byte) (err error)
type TrialDiscountFilterParam ¶ added in v0.120.0
type TrialDiscountFilterParam struct {
// The property of the price to filter on.
Field param.Field[TrialDiscountFiltersField] `json:"field,required"`
// Should prices that match the filter be included or excluded.
Operator param.Field[TrialDiscountFiltersOperator] `json:"operator,required"`
// The IDs or values that match this filter.
Values param.Field[[]string] `json:"values,required"`
}
func (TrialDiscountFilterParam) MarshalJSON ¶ added in v0.120.0
func (r TrialDiscountFilterParam) MarshalJSON() (data []byte, err error)
type TrialDiscountFiltersField ¶ added in v0.120.0
type TrialDiscountFiltersField string
The property of the price to filter on.
const ( TrialDiscountFiltersFieldPriceID TrialDiscountFiltersField = "price_id" TrialDiscountFiltersFieldItemID TrialDiscountFiltersField = "item_id" TrialDiscountFiltersFieldPriceType TrialDiscountFiltersField = "price_type" TrialDiscountFiltersFieldCurrency TrialDiscountFiltersField = "currency" TrialDiscountFiltersFieldPricingUnitID TrialDiscountFiltersField = "pricing_unit_id" )
func (TrialDiscountFiltersField) IsKnown ¶ added in v0.120.0
func (r TrialDiscountFiltersField) IsKnown() bool
type TrialDiscountFiltersOperator ¶ added in v0.120.0
type TrialDiscountFiltersOperator string
Should prices that match the filter be included or excluded.
const ( TrialDiscountFiltersOperatorIncludes TrialDiscountFiltersOperator = "includes" TrialDiscountFiltersOperatorExcludes TrialDiscountFiltersOperator = "excludes" )
func (TrialDiscountFiltersOperator) IsKnown ¶ added in v0.120.0
func (r TrialDiscountFiltersOperator) IsKnown() bool
type TrialDiscountParam ¶ added in v0.67.0
type TrialDiscountParam struct {
DiscountType param.Field[TrialDiscountDiscountType] `json:"discount_type,required"`
// List of price_ids that this discount applies to. For plan/plan phase discounts,
// this can be a subset of prices.
AppliesToPriceIDs param.Field[[]string] `json:"applies_to_price_ids"`
// The filters that determine which prices to apply this discount to.
Filters param.Field[[]TrialDiscountFilterParam] `json:"filters"`
Reason param.Field[string] `json:"reason"`
// Only available if discount_type is `trial`
TrialAmountDiscount param.Field[string] `json:"trial_amount_discount"`
// Only available if discount_type is `trial`
TrialPercentageDiscount param.Field[float64] `json:"trial_percentage_discount"`
}
func (TrialDiscountParam) ImplementsDiscountUnionParam ¶ added in v0.89.1
func (r TrialDiscountParam) ImplementsDiscountUnionParam()
func (TrialDiscountParam) MarshalJSON ¶ added in v0.67.0
func (r TrialDiscountParam) MarshalJSON() (data []byte, err error)
type UnionBool ¶
type UnionBool bool
func (UnionBool) ImplementsEvaluatePriceGroupGroupingValuesUnion ¶
func (UnionBool) ImplementsEvaluatePriceGroupGroupingValuesUnion()
type UnionFloat ¶
type UnionFloat float64
func (UnionFloat) ImplementsEvaluatePriceGroupGroupingValuesUnion ¶
func (UnionFloat) ImplementsEvaluatePriceGroupGroupingValuesUnion()
type UnionString ¶
type UnionString string
func (UnionString) ImplementsEvaluatePriceGroupGroupingValuesUnion ¶
func (UnionString) ImplementsEvaluatePriceGroupGroupingValuesUnion()
type UnionTime ¶
func (UnionTime) ImplementsSubscriptionPriceIntervalsParamsAddAdjustmentsEndDateUnion ¶ added in v0.35.0
func (UnionTime) ImplementsSubscriptionPriceIntervalsParamsAddAdjustmentsEndDateUnion()
func (UnionTime) ImplementsSubscriptionPriceIntervalsParamsAddAdjustmentsStartDateUnion ¶ added in v0.35.0
func (UnionTime) ImplementsSubscriptionPriceIntervalsParamsAddAdjustmentsStartDateUnion()
func (UnionTime) ImplementsSubscriptionPriceIntervalsParamsAddEndDateUnion ¶
func (UnionTime) ImplementsSubscriptionPriceIntervalsParamsAddEndDateUnion()
func (UnionTime) ImplementsSubscriptionPriceIntervalsParamsAddStartDateUnion ¶
func (UnionTime) ImplementsSubscriptionPriceIntervalsParamsAddStartDateUnion()
func (UnionTime) ImplementsSubscriptionPriceIntervalsParamsEditAdjustmentsEndDateUnion ¶ added in v0.35.0
func (UnionTime) ImplementsSubscriptionPriceIntervalsParamsEditAdjustmentsEndDateUnion()
func (UnionTime) ImplementsSubscriptionPriceIntervalsParamsEditAdjustmentsStartDateUnion ¶ added in v0.35.0
func (UnionTime) ImplementsSubscriptionPriceIntervalsParamsEditAdjustmentsStartDateUnion()
func (UnionTime) ImplementsSubscriptionPriceIntervalsParamsEditEndDateUnion ¶
func (UnionTime) ImplementsSubscriptionPriceIntervalsParamsEditEndDateUnion()
func (UnionTime) ImplementsSubscriptionPriceIntervalsParamsEditStartDateUnion ¶
func (UnionTime) ImplementsSubscriptionPriceIntervalsParamsEditStartDateUnion()
func (UnionTime) ImplementsSubscriptionUpdateTrialParamsTrialEndDateUnion ¶ added in v0.74.0
func (UnionTime) ImplementsSubscriptionUpdateTrialParamsTrialEndDateUnion()
type UsageDiscount ¶ added in v0.105.0
type UsageDiscount struct {
DiscountType UsageDiscountDiscountType `json:"discount_type,required"`
// Only available if discount_type is `usage`. Number of usage units that this
// discount is for
UsageDiscount float64 `json:"usage_discount,required"`
// List of price_ids that this discount applies to. For plan/plan phase discounts,
// this can be a subset of prices.
AppliesToPriceIDs []string `json:"applies_to_price_ids,nullable"`
// The filters that determine which prices to apply this discount to.
Filters []UsageDiscountFilter `json:"filters,nullable"`
Reason string `json:"reason,nullable"`
JSON usageDiscountJSON `json:"-"`
}
func (UsageDiscount) ImplementsDiscount ¶ added in v0.105.0
func (r UsageDiscount) ImplementsDiscount()
func (*UsageDiscount) UnmarshalJSON ¶ added in v0.105.0
func (r *UsageDiscount) UnmarshalJSON(data []byte) (err error)
type UsageDiscountDiscountType ¶ added in v0.105.0
type UsageDiscountDiscountType string
const (
UsageDiscountDiscountTypeUsage UsageDiscountDiscountType = "usage"
)
func (UsageDiscountDiscountType) IsKnown ¶ added in v0.105.0
func (r UsageDiscountDiscountType) IsKnown() bool
type UsageDiscountFilter ¶ added in v0.120.0
type UsageDiscountFilter struct {
// The property of the price to filter on.
Field UsageDiscountFiltersField `json:"field,required"`
// Should prices that match the filter be included or excluded.
Operator UsageDiscountFiltersOperator `json:"operator,required"`
// The IDs or values that match this filter.
Values []string `json:"values,required"`
JSON usageDiscountFilterJSON `json:"-"`
}
func (*UsageDiscountFilter) UnmarshalJSON ¶ added in v0.120.0
func (r *UsageDiscountFilter) UnmarshalJSON(data []byte) (err error)
type UsageDiscountFilterParam ¶ added in v0.120.0
type UsageDiscountFilterParam struct {
// The property of the price to filter on.
Field param.Field[UsageDiscountFiltersField] `json:"field,required"`
// Should prices that match the filter be included or excluded.
Operator param.Field[UsageDiscountFiltersOperator] `json:"operator,required"`
// The IDs or values that match this filter.
Values param.Field[[]string] `json:"values,required"`
}
func (UsageDiscountFilterParam) MarshalJSON ¶ added in v0.120.0
func (r UsageDiscountFilterParam) MarshalJSON() (data []byte, err error)
type UsageDiscountFiltersField ¶ added in v0.120.0
type UsageDiscountFiltersField string
The property of the price to filter on.
const ( UsageDiscountFiltersFieldPriceID UsageDiscountFiltersField = "price_id" UsageDiscountFiltersFieldItemID UsageDiscountFiltersField = "item_id" UsageDiscountFiltersFieldPriceType UsageDiscountFiltersField = "price_type" UsageDiscountFiltersFieldCurrency UsageDiscountFiltersField = "currency" UsageDiscountFiltersFieldPricingUnitID UsageDiscountFiltersField = "pricing_unit_id" )
func (UsageDiscountFiltersField) IsKnown ¶ added in v0.120.0
func (r UsageDiscountFiltersField) IsKnown() bool
type UsageDiscountFiltersOperator ¶ added in v0.120.0
type UsageDiscountFiltersOperator string
Should prices that match the filter be included or excluded.
const ( UsageDiscountFiltersOperatorIncludes UsageDiscountFiltersOperator = "includes" UsageDiscountFiltersOperatorExcludes UsageDiscountFiltersOperator = "excludes" )
func (UsageDiscountFiltersOperator) IsKnown ¶ added in v0.120.0
func (r UsageDiscountFiltersOperator) IsKnown() bool
type UsageDiscountParam ¶ added in v0.105.0
type UsageDiscountParam struct {
DiscountType param.Field[UsageDiscountDiscountType] `json:"discount_type,required"`
// Only available if discount_type is `usage`. Number of usage units that this
// discount is for
UsageDiscount param.Field[float64] `json:"usage_discount,required"`
// List of price_ids that this discount applies to. For plan/plan phase discounts,
// this can be a subset of prices.
AppliesToPriceIDs param.Field[[]string] `json:"applies_to_price_ids"`
// The filters that determine which prices to apply this discount to.
Filters param.Field[[]UsageDiscountFilterParam] `json:"filters"`
Reason param.Field[string] `json:"reason"`
}
func (UsageDiscountParam) ImplementsDiscountUnionParam ¶ added in v0.105.0
func (r UsageDiscountParam) ImplementsDiscountUnionParam()
func (UsageDiscountParam) MarshalJSON ¶ added in v0.105.0
func (r UsageDiscountParam) MarshalJSON() (data []byte, err error)