shared

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Discount added in v0.2.0

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

Union satisfied by DiscountPercentageDiscount, DiscountTrialDiscount, DiscountUsageDiscount or DiscountAmountDiscount.

type DiscountAmountDiscount added in v0.2.0

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

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

type DiscountAmountDiscountDiscountType added in v0.2.0

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

type DiscountPercentageDiscount added in v0.2.0

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

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

type DiscountPercentageDiscountDiscountType added in v0.2.0

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

type DiscountTrialDiscount added in v0.2.0

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

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

type DiscountTrialDiscountDiscountType added in v0.2.0

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

type DiscountUsageDiscount added in v0.2.0

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

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

type DiscountUsageDiscountDiscountType added in v0.2.0

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

type Page

type Page[T any] struct {
	Data               []T                    `json:"data,required"`
	PaginationMetadata PagePaginationMetadata `json:"pagination_metadata,required"`
	JSON               pageJSON               `json:"-"`
	// contains filtered or unexported fields
}

func (*Page[T]) GetNextPage

func (r *Page[T]) GetNextPage() (res *Page[T], err error)

NextPage returns the next page as defined by this pagination style. When there is no next page, this function will return a 'nil' for the page value, but will not return an error

func (*Page[T]) SetPageConfig

func (r *Page[T]) SetPageConfig(cfg *requestconfig.RequestConfig, res *http.Response)

func (*Page[T]) UnmarshalJSON

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

type PageAutoPager

type PageAutoPager[T any] struct {
	// contains filtered or unexported fields
}

func NewPageAutoPager

func NewPageAutoPager[T any](page *Page[T], err error) *PageAutoPager[T]

func (*PageAutoPager[T]) Current

func (r *PageAutoPager[T]) Current() T

func (*PageAutoPager[T]) Err

func (r *PageAutoPager[T]) Err() error

func (*PageAutoPager[T]) Index

func (r *PageAutoPager[T]) Index() int

func (*PageAutoPager[T]) Next

func (r *PageAutoPager[T]) Next() bool

type PagePaginationMetadata

type PagePaginationMetadata struct {
	HasMore    bool                       `json:"has_more,required"`
	NextCursor string                     `json:"next_cursor,required,nullable"`
	JSON       pagePaginationMetadataJSON `json:"-"`
}

func (*PagePaginationMetadata) UnmarshalJSON

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

type UnionTime

type UnionTime time.Time

func (UnionTime) ImplementsSubscriptionPriceIntervalsParamsAddEndDate

func (UnionTime) ImplementsSubscriptionPriceIntervalsParamsAddEndDate()

func (UnionTime) ImplementsSubscriptionPriceIntervalsParamsAddStartDate

func (UnionTime) ImplementsSubscriptionPriceIntervalsParamsAddStartDate()

func (UnionTime) ImplementsSubscriptionPriceIntervalsParamsEditEndDate

func (UnionTime) ImplementsSubscriptionPriceIntervalsParamsEditEndDate()

func (UnionTime) ImplementsSubscriptionPriceIntervalsParamsEditStartDate

func (UnionTime) ImplementsSubscriptionPriceIntervalsParamsEditStartDate()

Jump to

Keyboard shortcuts

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