apitypes

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2023 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const Inf = 1<<63 - 1

Variables

This section is empty.

Functions

func UsageByFeature added in v0.3.8

func UsageByFeature(a, b Usage) bool

Types

type CheckoutRequest added in v0.7.1

type CheckoutRequest struct {
	Org        string   `json:"org"`
	TrialDays  int      `json:"trial_days"`
	Features   []string `json:"features"`
	SuccessURL string   `json:"success_url"`
	CancelURL  string   `json:"cancel_url"`
}

type CheckoutResponse added in v0.7.1

type CheckoutResponse struct {
	URL string `json:"url"`
}

type Error added in v0.5.0

type Error struct {
	Status  int    `json:"status"`
	Code    string `json:"code"` // (e.g. "invalid_request")
	Message string `json:"message"`
}

func (*Error) Error added in v0.5.0

func (e *Error) Error() string

type Feature added in v0.4.2

type Feature struct {
	Title     string `json:"title,omitempty"`
	Base      int    `json:"base,omitempty"`
	Mode      string `json:"mode,omitempty"`
	Aggregate string `json:"aggregate,omitempty"`
	Tiers     []Tier `json:"tiers,omitempty"`
	PermLink  string `json:"permLink,omitempty"`
}

type InvoiceSettings added in v0.7.1

type InvoiceSettings struct {
	DefaultPaymentMethod string `json:"default_payment_method"`
}

type Model added in v0.4.2

type Model struct {
	Plans map[refs.Plan]Plan `json:"plans"`
}

type OrgInfo added in v0.6.0

type OrgInfo struct {
	Email       string            `json:"email"`
	Name        string            `json:"name"`
	Description string            `json:"description"`
	Phone       string            `json:"phone"`
	Metadata    map[string]string `json:"metadata"`

	PaymentMethod   string          `json:"payment_method"`
	InvoiceSettings InvoiceSettings `json:"invoice_settings"`
}

type Phase

type Phase struct {
	Trial     bool      `json:"trial,omitempty"`
	Effective time.Time `json:"effective,omitempty"`
	Features  []string  `json:"features,omitempty"`
}

type PhaseResponse added in v0.3.8

type PhaseResponse struct {
	Effective time.Time          `json:"effective,omitempty"`
	Features  []refs.FeaturePlan `json:"features,omitempty"`
	Plans     []refs.Plan        `json:"plans,omitempty"`
	Fragments []refs.FeaturePlan `json:"fragments,omitempty"`
}

type Plan added in v0.4.2

type Plan struct {
	Title    string                `json:"title,omitempty"`
	Interval string                `json:"interval,omitempty"`
	Currency string                `json:"currency,omitempty"`
	Features map[refs.Name]Feature `json:"features,omitempty"`
}

type PushResponse added in v0.4.2

type PushResponse struct {
	Results []PushResult `json:"results,omitempty"`
}

type PushResult added in v0.4.2

type PushResult struct {
	Feature refs.FeaturePlan `json:"feature"`
	Status  string           `json:"status"`
	Reason  string           `json:"reason"`
}

type ReportRequest

type ReportRequest struct {
	Org     string    `json:"org"`
	Feature refs.Name `json:"feature"`
	N       int       `json:"n"`
	At      time.Time `json:"at"`
	Clobber bool      `json:"clobber"`
}

type ScheduleRequest added in v0.6.0

type ScheduleRequest struct {
	Org    string   `json:"org"`
	Info   *OrgInfo `json:"info"`
	Phases []Phase  `json:"phases"`
}

type ScheduleResponse added in v0.7.1

type ScheduleResponse struct{}

ScheduleResponse is the expected response from a schedule request. It is currently empty, reserved for furture use.

type Tier added in v0.4.2

type Tier struct {
	Upto  int     `json:"upto,omitempty"`
	Price float64 `json:"price,omitempty"`
	Base  int     `json:"base,omitempty"`
}

func (*Tier) MarshalJSON added in v0.4.2

func (t *Tier) MarshalJSON() ([]byte, error)

func (*Tier) UnmarshalJSON added in v0.4.2

func (t *Tier) UnmarshalJSON(data []byte) error

type Usage

type Usage struct {
	Feature refs.Name `json:"feature"`
	Used    int       `json:"used"`
	Limit   int       `json:"limit"`
}

type UsageResponse

type UsageResponse struct {
	Org   string  `json:"org"`
	Usage []Usage `json:"usage"`
}

type WhoAmIResponse added in v0.5.0

type WhoAmIResponse struct {
	ProviderID string    `json:"id"`
	Email      string    `json:"email"`
	Created    time.Time `json:"created"`
	KeySource  string    `json:"key_source"`
	Isolated   bool      `json:"isolated"`
	URL        string    `json:"url"`
}

type WhoIsResponse

type WhoIsResponse struct {
	*OrgInfo
	Org      string `json:"org"`
	StripeID string `json:"stripe_id"`
}

Jump to

Keyboard shortcuts

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