shared

package
v0.34.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 3, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BillingCycleRelativeDate

type BillingCycleRelativeDate string
const (
	BillingCycleRelativeDateStartOfTerm BillingCycleRelativeDate = "start_of_term"
	BillingCycleRelativeDateEndOfTerm   BillingCycleRelativeDate = "end_of_term"
)

func (BillingCycleRelativeDate) IsKnown

func (r BillingCycleRelativeDate) IsKnown() bool

type Discount

type Discount struct {
	DiscountType      DiscountDiscountType `json:"discount_type,required"`
	AppliesToPriceIDs interface{}          `json:"applies_to_price_ids"`
	Reason            string               `json:"reason,nullable"`
	// Only available if discount_type is `percentage`. This is a number between 0
	// and 1.
	PercentageDiscount float64 `json:"percentage_discount"`
	// 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"`
	// Only available if discount_type is `amount`.
	AmountDiscount string       `json:"amount_discount"`
	JSON           discountJSON `json:"-"`
	// contains filtered or unexported fields
}

func (Discount) AsUnion

func (r Discount) AsUnion() DiscountUnion

func (*Discount) UnmarshalJSON

func (r *Discount) UnmarshalJSON(data []byte) (err error)

type DiscountAmountDiscount

type DiscountAmountDiscount struct {
	// Only available if discount_type is `amount`.
	AmountDiscount string `json:"amount_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,required"`
	DiscountType      DiscountAmountDiscountDiscountType `json:"discount_type,required"`
	Reason            string                             `json:"reason,nullable"`
	JSON              discountAmountDiscountJSON         `json:"-"`
}

func (*DiscountAmountDiscount) UnmarshalJSON

func (r *DiscountAmountDiscount) UnmarshalJSON(data []byte) (err error)

type DiscountAmountDiscountDiscountType

type DiscountAmountDiscountDiscountType string
const (
	DiscountAmountDiscountDiscountTypeAmount DiscountAmountDiscountDiscountType = "amount"
)

func (DiscountAmountDiscountDiscountType) IsKnown

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 DiscountPercentageDiscount

type DiscountPercentageDiscount struct {
	// 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,required"`
	DiscountType      DiscountPercentageDiscountDiscountType `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"`
	Reason             string                         `json:"reason,nullable"`
	JSON               discountPercentageDiscountJSON `json:"-"`
}

func (*DiscountPercentageDiscount) UnmarshalJSON

func (r *DiscountPercentageDiscount) UnmarshalJSON(data []byte) (err error)

type DiscountPercentageDiscountDiscountType

type DiscountPercentageDiscountDiscountType string
const (
	DiscountPercentageDiscountDiscountTypePercentage DiscountPercentageDiscountDiscountType = "percentage"
)

func (DiscountPercentageDiscountDiscountType) IsKnown

type DiscountTrialDiscount

type DiscountTrialDiscount struct {
	// 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,required"`
	DiscountType      DiscountTrialDiscountDiscountType `json:"discount_type,required"`
	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                    discountTrialDiscountJSON `json:"-"`
}

func (*DiscountTrialDiscount) UnmarshalJSON

func (r *DiscountTrialDiscount) UnmarshalJSON(data []byte) (err error)

type DiscountTrialDiscountDiscountType

type DiscountTrialDiscountDiscountType string
const (
	DiscountTrialDiscountDiscountTypeTrial DiscountTrialDiscountDiscountType = "trial"
)

func (DiscountTrialDiscountDiscountType) IsKnown

type DiscountUnion

type DiscountUnion interface {
	// contains filtered or unexported methods
}

Union satisfied by shared.DiscountPercentageDiscount, shared.DiscountTrialDiscount, shared.DiscountUsageDiscount or shared.DiscountAmountDiscount.

type DiscountUsageDiscount

type DiscountUsageDiscount struct {
	// 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,required"`
	DiscountType      DiscountUsageDiscountDiscountType `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"`
	Reason        string                    `json:"reason,nullable"`
	JSON          discountUsageDiscountJSON `json:"-"`
}

func (*DiscountUsageDiscount) UnmarshalJSON

func (r *DiscountUsageDiscount) UnmarshalJSON(data []byte) (err error)

type DiscountUsageDiscountDiscountType

type DiscountUsageDiscountDiscountType string
const (
	DiscountUsageDiscountDiscountTypeUsage DiscountUsageDiscountDiscountType = "usage"
)

func (DiscountUsageDiscountDiscountType) IsKnown

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 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

type UnionTime time.Time

func (UnionTime) ImplementsSubscriptionPriceIntervalsParamsAddEndDateUnion

func (UnionTime) ImplementsSubscriptionPriceIntervalsParamsAddEndDateUnion()

func (UnionTime) ImplementsSubscriptionPriceIntervalsParamsAddStartDateUnion

func (UnionTime) ImplementsSubscriptionPriceIntervalsParamsAddStartDateUnion()

func (UnionTime) ImplementsSubscriptionPriceIntervalsParamsEditEndDateUnion

func (UnionTime) ImplementsSubscriptionPriceIntervalsParamsEditEndDateUnion()

func (UnionTime) ImplementsSubscriptionPriceIntervalsParamsEditStartDateUnion

func (UnionTime) ImplementsSubscriptionPriceIntervalsParamsEditStartDateUnion()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL