shared

package
v0.64.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: Apache-2.0 Imports: 5 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) 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"`
	// This field can have the runtime type of [[]string].
	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

AsUnion returns a DiscountUnion interface which you can cast to the specific types for more type safety.

Possible runtime types of the union are shared.DiscountPercentageDiscount, shared.DiscountTrialDiscount, shared.DiscountUsageDiscount, shared.DiscountAmountDiscount.

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 DiscountAmountDiscountParam added in v0.35.0

type DiscountAmountDiscountParam struct {
	// Only available if discount_type is `amount`.
	AmountDiscount param.Field[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 param.Field[[]string]                           `json:"applies_to_price_ids,required"`
	DiscountType      param.Field[DiscountAmountDiscountDiscountType] `json:"discount_type,required"`
	Reason            param.Field[string]                             `json:"reason"`
}

func (DiscountAmountDiscountParam) MarshalJSON added in v0.35.0

func (r DiscountAmountDiscountParam) MarshalJSON() (data []byte, err error)

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"`
	AppliesToPriceIDs param.Field[interface{}]          `json:"applies_to_price_ids"`
	Reason            param.Field[string]               `json:"reason"`
	// Only available if discount_type is `percentage`. This is a number between 0
	// and 1.
	PercentageDiscount param.Field[float64] `json:"percentage_discount"`
	// 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"`
	// Only available if discount_type is `amount`.
	AmountDiscount param.Field[string] `json:"amount_discount"`
}

func (DiscountParam) MarshalJSON added in v0.35.0

func (r DiscountParam) MarshalJSON() (data []byte, err error)

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 DiscountPercentageDiscountParam added in v0.35.0

type DiscountPercentageDiscountParam struct {
	// 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,required"`
	DiscountType      param.Field[DiscountPercentageDiscountDiscountType] `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"`
	Reason             param.Field[string]  `json:"reason"`
}

func (DiscountPercentageDiscountParam) MarshalJSON added in v0.35.0

func (r DiscountPercentageDiscountParam) MarshalJSON() (data []byte, err error)

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 DiscountTrialDiscountParam added in v0.35.0

type DiscountTrialDiscountParam struct {
	// 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,required"`
	DiscountType      param.Field[DiscountTrialDiscountDiscountType] `json:"discount_type,required"`
	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 (DiscountTrialDiscountParam) MarshalJSON added in v0.35.0

func (r DiscountTrialDiscountParam) MarshalJSON() (data []byte, err error)

type DiscountUnion

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

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

type DiscountUnionParam added in v0.35.0

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

Satisfied by shared.DiscountPercentageDiscountParam, shared.DiscountTrialDiscountParam, shared.DiscountUsageDiscountParam, shared.DiscountAmountDiscountParam, DiscountParam.

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 DiscountUsageDiscountParam added in v0.35.0

type DiscountUsageDiscountParam struct {
	// 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,required"`
	DiscountType      param.Field[DiscountUsageDiscountDiscountType] `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"`
	Reason        param.Field[string]  `json:"reason"`
}

func (DiscountUsageDiscountParam) MarshalJSON added in v0.35.0

func (r DiscountUsageDiscountParam) MarshalJSON() (data []byte, err error)

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

Jump to

Keyboard shortcuts

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