billing

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package billing provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.2 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAcceptQuoteRequest

func NewAcceptQuoteRequest(server string, quote QuoteId) (*http.Request, error)

NewAcceptQuoteRequest constructs an http.Request for the AcceptQuote method

func NewAddWebhookEndpointRequest

func NewAddWebhookEndpointRequest(server string, body AddWebhookEndpointJSONRequestBody) (*http.Request, error)

NewAddWebhookEndpointRequest calls the generic AddWebhookEndpoint builder with application/json body

func NewAddWebhookEndpointRequestWithBody

func NewAddWebhookEndpointRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewAddWebhookEndpointRequestWithBody constructs an http.Request for the AddWebhookEndpoint method, with any body, and a specified content type

func NewApplyCouponRequest

func NewApplyCouponRequest(server string, id Id, body ApplyCouponJSONRequestBody) (*http.Request, error)

NewApplyCouponRequest calls the generic ApplyCoupon builder with application/json body

func NewApplyCouponRequestWithBody

func NewApplyCouponRequestWithBody(server string, id Id, contentType string, body io.Reader) (*http.Request, error)

NewApplyCouponRequestWithBody constructs an http.Request for the ApplyCoupon method, with any body, and a specified content type

func NewCancelCheckoutRequest

func NewCancelCheckoutRequest(server string, checkout openapi_types.UUID) (*http.Request, error)

NewCancelCheckoutRequest constructs an http.Request for the CancelCheckout method

func NewCancelUpgradeRequest

func NewCancelUpgradeRequest(server string, id Id) (*http.Request, error)

NewCancelUpgradeRequest constructs an http.Request for the CancelUpgrade method

func NewCreateCreditNoteRequest

func NewCreateCreditNoteRequest(server string, invoice InvoiceId, body CreateCreditNoteJSONRequestBody) (*http.Request, error)

NewCreateCreditNoteRequest calls the generic CreateCreditNote builder with application/json body

func NewCreateCreditNoteRequestWithBody

func NewCreateCreditNoteRequestWithBody(server string, invoice InvoiceId, contentType string, body io.Reader) (*http.Request, error)

NewCreateCreditNoteRequestWithBody constructs an http.Request for the CreateCreditNote method, with any body, and a specified content type

func NewCreateQuoteRequest

func NewCreateQuoteRequest(server string, body CreateQuoteJSONRequestBody) (*http.Request, error)

NewCreateQuoteRequest calls the generic CreateQuote builder with application/json body

func NewCreateQuoteRequestWithBody

func NewCreateQuoteRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewCreateQuoteRequestWithBody constructs an http.Request for the CreateQuote method, with any body, and a specified content type

func NewCreateRefundRequest

func NewCreateRefundRequest(server string, invoice InvoiceId, body CreateRefundJSONRequestBody) (*http.Request, error)

NewCreateRefundRequest calls the generic CreateRefund builder with application/json body

func NewCreateRefundRequestWithBody

func NewCreateRefundRequestWithBody(server string, invoice InvoiceId, contentType string, body io.Reader) (*http.Request, error)

NewCreateRefundRequestWithBody constructs an http.Request for the CreateRefund method, with any body, and a specified content type

func NewDeleteCouponRequest

func NewDeleteCouponRequest(server string, code Code) (*http.Request, error)

NewDeleteCouponRequest constructs an http.Request for the DeleteCoupon method

func NewDeleteFeatureRequest

func NewDeleteFeatureRequest(server string, code Code) (*http.Request, error)

NewDeleteFeatureRequest constructs an http.Request for the DeleteFeature method

func NewDeleteMeterRequest

func NewDeleteMeterRequest(server string, code Code) (*http.Request, error)

NewDeleteMeterRequest constructs an http.Request for the DeleteMeter method

func NewDeletePlanRequest

func NewDeletePlanRequest(server string, code Code) (*http.Request, error)

NewDeletePlanRequest constructs an http.Request for the DeletePlan method

func NewGetCheckoutRequest

func NewGetCheckoutRequest(server string, checkout openapi_types.UUID) (*http.Request, error)

NewGetCheckoutRequest constructs an http.Request for the GetCheckout method

func NewGetCreditNoteRequest

func NewGetCreditNoteRequest(server string, creditNote CreditNoteId) (*http.Request, error)

NewGetCreditNoteRequest constructs an http.Request for the GetCreditNote method

func NewGetCustomerRequest

func NewGetCustomerRequest(server string, id Id) (*http.Request, error)

NewGetCustomerRequest constructs an http.Request for the GetCustomer method

func NewGetEntitlementsRequest

func NewGetEntitlementsRequest(server string, id Id) (*http.Request, error)

NewGetEntitlementsRequest constructs an http.Request for the GetEntitlements method

func NewGetInvoicePdfRequest

func NewGetInvoicePdfRequest(server string, invoice InvoiceId) (*http.Request, error)

NewGetInvoicePdfRequest constructs an http.Request for the GetInvoicePdf method

func NewGetInvoiceRequest

func NewGetInvoiceRequest(server string, invoice InvoiceId) (*http.Request, error)

NewGetInvoiceRequest constructs an http.Request for the GetInvoice method

func NewGetLockRequest

func NewGetLockRequest(server string) (*http.Request, error)

NewGetLockRequest constructs an http.Request for the GetLock method

func NewGetMeterRequest

func NewGetMeterRequest(server string, code Code) (*http.Request, error)

NewGetMeterRequest constructs an http.Request for the GetMeter method

func NewGetPaymentSettingsRequest

func NewGetPaymentSettingsRequest(server string) (*http.Request, error)

NewGetPaymentSettingsRequest constructs an http.Request for the GetPaymentSettings method

func NewGetPlanRequest

func NewGetPlanRequest(server string, code Code) (*http.Request, error)

NewGetPlanRequest constructs an http.Request for the GetPlan method

func NewGetQuoteRequest

func NewGetQuoteRequest(server string, quote QuoteId) (*http.Request, error)

NewGetQuoteRequest constructs an http.Request for the GetQuote method

func NewGetSubscriptionRequest

func NewGetSubscriptionRequest(server string, id Id) (*http.Request, error)

NewGetSubscriptionRequest constructs an http.Request for the GetSubscription method

func NewGetSummaryRequest

func NewGetSummaryRequest(server string, params *GetSummaryParams) (*http.Request, error)

NewGetSummaryRequest constructs an http.Request for the GetSummary method

func NewListAppsRequest

func NewListAppsRequest(server string) (*http.Request, error)

NewListAppsRequest constructs an http.Request for the ListApps method

func NewListCouponsRequest

func NewListCouponsRequest(server string, params *ListCouponsParams) (*http.Request, error)

NewListCouponsRequest constructs an http.Request for the ListCoupons method

func NewListCreditNotesRequest

func NewListCreditNotesRequest(server string, params *ListCreditNotesParams) (*http.Request, error)

NewListCreditNotesRequest constructs an http.Request for the ListCreditNotes method

func NewListCustomersRequest

func NewListCustomersRequest(server string, params *ListCustomersParams) (*http.Request, error)

NewListCustomersRequest constructs an http.Request for the ListCustomers method

func NewListFeaturesRequest

func NewListFeaturesRequest(server string, params *ListFeaturesParams) (*http.Request, error)

NewListFeaturesRequest constructs an http.Request for the ListFeatures method

func NewListInvoiceCreditNotesRequest

func NewListInvoiceCreditNotesRequest(server string, invoice InvoiceId) (*http.Request, error)

NewListInvoiceCreditNotesRequest constructs an http.Request for the ListInvoiceCreditNotes method

func NewListInvoicesRequest

func NewListInvoicesRequest(server string, params *ListInvoicesParams) (*http.Request, error)

NewListInvoicesRequest constructs an http.Request for the ListInvoices method

func NewListMetersRequest

func NewListMetersRequest(server string, params *ListMetersParams) (*http.Request, error)

NewListMetersRequest constructs an http.Request for the ListMeters method

func NewListPaymentsRequest

func NewListPaymentsRequest(server string, invoice InvoiceId) (*http.Request, error)

NewListPaymentsRequest constructs an http.Request for the ListPayments method

func NewListPlansRequest

func NewListPlansRequest(server string, params *ListPlansParams) (*http.Request, error)

NewListPlansRequest constructs an http.Request for the ListPlans method

func NewListRefundsRequest

func NewListRefundsRequest(server string, invoice InvoiceId) (*http.Request, error)

NewListRefundsRequest constructs an http.Request for the ListRefunds method

func NewListSubscriptionsRequest

func NewListSubscriptionsRequest(server string, params *ListSubscriptionsParams) (*http.Request, error)

NewListSubscriptionsRequest constructs an http.Request for the ListSubscriptions method

func NewListWebhookEndpointsRequest

func NewListWebhookEndpointsRequest(server string) (*http.Request, error)

NewListWebhookEndpointsRequest constructs an http.Request for the ListWebhookEndpoints method

func NewPutAppForwardRequest

func NewPutAppForwardRequest(server string, app AppId, body PutAppForwardJSONRequestBody) (*http.Request, error)

NewPutAppForwardRequest calls the generic PutAppForward builder with application/json body

func NewPutAppForwardRequestWithBody

func NewPutAppForwardRequestWithBody(server string, app AppId, contentType string, body io.Reader) (*http.Request, error)

NewPutAppForwardRequestWithBody constructs an http.Request for the PutAppForward method, with any body, and a specified content type

func NewPutCouponRequest

func NewPutCouponRequest(server string, code Code, body PutCouponJSONRequestBody) (*http.Request, error)

NewPutCouponRequest calls the generic PutCoupon builder with application/json body

func NewPutCouponRequestWithBody

func NewPutCouponRequestWithBody(server string, code Code, contentType string, body io.Reader) (*http.Request, error)

NewPutCouponRequestWithBody constructs an http.Request for the PutCoupon method, with any body, and a specified content type

func NewPutCustomerRequest

func NewPutCustomerRequest(server string, id Id, body PutCustomerJSONRequestBody) (*http.Request, error)

NewPutCustomerRequest calls the generic PutCustomer builder with application/json body

func NewPutCustomerRequestWithBody

func NewPutCustomerRequestWithBody(server string, id Id, contentType string, body io.Reader) (*http.Request, error)

NewPutCustomerRequestWithBody constructs an http.Request for the PutCustomer method, with any body, and a specified content type

func NewPutFeatureRequest

func NewPutFeatureRequest(server string, code Code, body PutFeatureJSONRequestBody) (*http.Request, error)

NewPutFeatureRequest calls the generic PutFeature builder with application/json body

func NewPutFeatureRequestWithBody

func NewPutFeatureRequestWithBody(server string, code Code, contentType string, body io.Reader) (*http.Request, error)

NewPutFeatureRequestWithBody constructs an http.Request for the PutFeature method, with any body, and a specified content type

func NewPutLockRequest

func NewPutLockRequest(server string, body PutLockJSONRequestBody) (*http.Request, error)

NewPutLockRequest calls the generic PutLock builder with application/json body

func NewPutLockRequestWithBody

func NewPutLockRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewPutLockRequestWithBody constructs an http.Request for the PutLock method, with any body, and a specified content type

func NewPutMeterRequest

func NewPutMeterRequest(server string, code Code, body PutMeterJSONRequestBody) (*http.Request, error)

NewPutMeterRequest calls the generic PutMeter builder with application/json body

func NewPutMeterRequestWithBody

func NewPutMeterRequestWithBody(server string, code Code, contentType string, body io.Reader) (*http.Request, error)

NewPutMeterRequestWithBody constructs an http.Request for the PutMeter method, with any body, and a specified content type

func NewPutPaymentSettingsRequest

func NewPutPaymentSettingsRequest(server string, body PutPaymentSettingsJSONRequestBody) (*http.Request, error)

NewPutPaymentSettingsRequest calls the generic PutPaymentSettings builder with application/json body

func NewPutPaymentSettingsRequestWithBody

func NewPutPaymentSettingsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewPutPaymentSettingsRequestWithBody constructs an http.Request for the PutPaymentSettings method, with any body, and a specified content type

func NewPutPlanRequest

func NewPutPlanRequest(server string, code Code, body PutPlanJSONRequestBody) (*http.Request, error)

NewPutPlanRequest calls the generic PutPlan builder with application/json body

func NewPutPlanRequestWithBody

func NewPutPlanRequestWithBody(server string, code Code, contentType string, body io.Reader) (*http.Request, error)

NewPutPlanRequestWithBody constructs an http.Request for the PutPlan method, with any body, and a specified content type

func NewPutSubscriptionRequest

func NewPutSubscriptionRequest(server string, id Id, body PutSubscriptionJSONRequestBody) (*http.Request, error)

NewPutSubscriptionRequest calls the generic PutSubscription builder with application/json body

func NewPutSubscriptionRequestWithBody

func NewPutSubscriptionRequestWithBody(server string, id Id, contentType string, body io.Reader) (*http.Request, error)

NewPutSubscriptionRequestWithBody constructs an http.Request for the PutSubscription method, with any body, and a specified content type

func NewRecordEventsRequest

func NewRecordEventsRequest(server string, body RecordEventsJSONRequestBody) (*http.Request, error)

NewRecordEventsRequest calls the generic RecordEvents builder with application/json body

func NewRecordEventsRequestWithBody

func NewRecordEventsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewRecordEventsRequestWithBody constructs an http.Request for the RecordEvents method, with any body, and a specified content type

func NewRecordPaymentRequest

func NewRecordPaymentRequest(server string, invoice InvoiceId, body RecordPaymentJSONRequestBody) (*http.Request, error)

NewRecordPaymentRequest calls the generic RecordPayment builder with application/json body

func NewRecordPaymentRequestWithBody

func NewRecordPaymentRequestWithBody(server string, invoice InvoiceId, contentType string, body io.Reader) (*http.Request, error)

NewRecordPaymentRequestWithBody constructs an http.Request for the RecordPayment method, with any body, and a specified content type

func NewRemoveWebhookEndpointRequest

func NewRemoveWebhookEndpointRequest(server string, endpoint string) (*http.Request, error)

NewRemoveWebhookEndpointRequest constructs an http.Request for the RemoveWebhookEndpoint method

func NewSetSeatsRequest

func NewSetSeatsRequest(server string, id Id, body SetSeatsJSONRequestBody) (*http.Request, error)

NewSetSeatsRequest calls the generic SetSeats builder with application/json body

func NewSetSeatsRequestWithBody

func NewSetSeatsRequestWithBody(server string, id Id, contentType string, body io.Reader) (*http.Request, error)

NewSetSeatsRequestWithBody constructs an http.Request for the SetSeats method, with any body, and a specified content type

func NewStartCheckoutRequest

func NewStartCheckoutRequest(server string, invoice InvoiceId, body StartCheckoutJSONRequestBody) (*http.Request, error)

NewStartCheckoutRequest calls the generic StartCheckout builder with application/json body

func NewStartCheckoutRequestWithBody

func NewStartCheckoutRequestWithBody(server string, invoice InvoiceId, contentType string, body io.Reader) (*http.Request, error)

NewStartCheckoutRequestWithBody constructs an http.Request for the StartCheckout method, with any body, and a specified content type

func NewTerminateSubscriptionRequest

func NewTerminateSubscriptionRequest(server string, id Id) (*http.Request, error)

NewTerminateSubscriptionRequest constructs an http.Request for the TerminateSubscription method

Types

type AcceptQuoteResponse

type AcceptQuoteResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Errors   []Message `json:"errors"`
		Messages []Message `json:"messages"`
		Result   Quote     `json:"result"`

		// Success True on a 2xx and false otherwise.
		Success bool `json:"success"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParseAcceptQuoteResponse

func ParseAcceptQuoteResponse(rsp *http.Response) (*AcceptQuoteResponse, error)

ParseAcceptQuoteResponse parses an HTTP response from a AcceptQuoteWithResponse call

func (AcceptQuoteResponse) ContentType

func (r AcceptQuoteResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (AcceptQuoteResponse) GetBody

func (r AcceptQuoteResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (AcceptQuoteResponse) GetJSON200

func (r AcceptQuoteResponse) GetJSON200() *struct {
	Errors   []Message `json:"errors"`
	Messages []Message `json:"messages"`
	Result   Quote     `json:"result"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (AcceptQuoteResponse) GetJSONDefault

func (r AcceptQuoteResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (AcceptQuoteResponse) Status

func (r AcceptQuoteResponse) Status() string

Status returns HTTPResponse.Status

func (AcceptQuoteResponse) StatusCode

func (r AcceptQuoteResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type AddOn

type AddOn struct {
	// Plan The add-on plan's code.
	Plan string `json:"plan"`

	// Seats Only on an add-on plan with seats.
	Seats *int `json:"seats,omitempty"`
}

AddOn defines model for AddOn.

type AddWebhookEndpointJSONBody

type AddWebhookEndpointJSONBody struct {
	// Url An https URL on the public internet.
	Url string `json:"url"`
}

AddWebhookEndpointJSONBody defines parameters for AddWebhookEndpoint.

type AddWebhookEndpointJSONRequestBody

type AddWebhookEndpointJSONRequestBody AddWebhookEndpointJSONBody

AddWebhookEndpointJSONRequestBody defines body for AddWebhookEndpoint for application/json ContentType.

type AddWebhookEndpointResponse

type AddWebhookEndpointResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON201 the response for an HTTP 201 `application/json` response
	JSON201 *struct {
		Errors   []Message          `json:"errors"`
		Messages []Message          `json:"messages"`
		Result   NewWebhookEndpoint `json:"result"`

		// Success True on a 2xx and false otherwise.
		Success bool `json:"success"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParseAddWebhookEndpointResponse

func ParseAddWebhookEndpointResponse(rsp *http.Response) (*AddWebhookEndpointResponse, error)

ParseAddWebhookEndpointResponse parses an HTTP response from a AddWebhookEndpointWithResponse call

func (AddWebhookEndpointResponse) ContentType

func (r AddWebhookEndpointResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (AddWebhookEndpointResponse) GetBody

func (r AddWebhookEndpointResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (AddWebhookEndpointResponse) GetJSON201

func (r AddWebhookEndpointResponse) GetJSON201() *struct {
	Errors   []Message          `json:"errors"`
	Messages []Message          `json:"messages"`
	Result   NewWebhookEndpoint `json:"result"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

GetJSON201 returns the response for an HTTP 201 `application/json` response

func (AddWebhookEndpointResponse) GetJSONDefault

func (r AddWebhookEndpointResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (AddWebhookEndpointResponse) Status

Status returns HTTPResponse.Status

func (AddWebhookEndpointResponse) StatusCode

func (r AddWebhookEndpointResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Address

type Address struct {
	City *string `json:"city,omitempty"`

	// Country ISO 3166-1 alpha-2.
	Country *string `json:"country,omitempty"`
	Line1   *string `json:"line1,omitempty"`
	Line2   *string `json:"line2,omitempty"`
	State   *string `json:"state,omitempty"`
	Zip     *string `json:"zip,omitempty"`
}

Address defines model for Address.

type App

type App struct {
	Caps struct {
		OffSession    bool `json:"off_session"`
		PartialRefund bool `json:"partial_refund"`
		Refund        bool `json:"refund"`
		Status        bool `json:"status"`
	} `json:"caps"`
	Currencies []string `json:"currencies"`

	// Fields The install form.
	Fields []struct {
		Key      string `json:"key"`
		Label    string `json:"label"`
		Required bool   `json:"required"`

		// Secret Never shown again once saved.
		Secret bool `json:"secret"`
	} `json:"fields"`

	// ForwardUrl Where your own notifications go; absent when not forwarding.
	ForwardUrl *string `json:"forward_url,omitempty"`

	// Forwards Whether your own notifications can be forwarded (PUT …/forward).
	Forwards bool `json:"forwards"`

	// Id Example: qi
	Id        string `json:"id"`
	Installed bool   `json:"installed"`
	Name      string `json:"name"`

	// RejectedAt When the gateway refused the saved settings; absent unless it has.
	RejectedAt *time.Time `json:"rejected_at,omitempty"`

	// Settings The saved fields, secret ones empty. Empty when not installed.
	Settings map[string]string `json:"settings"`

	// WebhookUrl Where the gateway sends its notifications for this project.
	WebhookUrl string `json:"webhook_url"`
}

App defines model for App.

type AppId

type AppId = string

AppId defines model for appId.

type ApplyCouponJSONBody

type ApplyCouponJSONBody struct {
	Code string `json:"code"`
}

ApplyCouponJSONBody defines parameters for ApplyCoupon.

type ApplyCouponJSONRequestBody

type ApplyCouponJSONRequestBody ApplyCouponJSONBody

ApplyCouponJSONRequestBody defines body for ApplyCoupon for application/json ContentType.

type ApplyCouponResponse

type ApplyCouponResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *Done
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParseApplyCouponResponse

func ParseApplyCouponResponse(rsp *http.Response) (*ApplyCouponResponse, error)

ParseApplyCouponResponse parses an HTTP response from a ApplyCouponWithResponse call

func (ApplyCouponResponse) ContentType

func (r ApplyCouponResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ApplyCouponResponse) GetBody

func (r ApplyCouponResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ApplyCouponResponse) GetJSON200

func (r ApplyCouponResponse) GetJSON200() *Done

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ApplyCouponResponse) GetJSONDefault

func (r ApplyCouponResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (ApplyCouponResponse) Status

func (r ApplyCouponResponse) Status() string

Status returns HTTPResponse.Status

func (ApplyCouponResponse) StatusCode

func (r ApplyCouponResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type CancelCheckoutResponse

type CancelCheckoutResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Errors   []Message `json:"errors"`
		Messages []Message `json:"messages"`
		Result   Checkout  `json:"result"`

		// Success True on a 2xx and false otherwise.
		Success bool `json:"success"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParseCancelCheckoutResponse

func ParseCancelCheckoutResponse(rsp *http.Response) (*CancelCheckoutResponse, error)

ParseCancelCheckoutResponse parses an HTTP response from a CancelCheckoutWithResponse call

func (CancelCheckoutResponse) ContentType

func (r CancelCheckoutResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (CancelCheckoutResponse) GetBody

func (r CancelCheckoutResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (CancelCheckoutResponse) GetJSON200

func (r CancelCheckoutResponse) GetJSON200() *struct {
	Errors   []Message `json:"errors"`
	Messages []Message `json:"messages"`
	Result   Checkout  `json:"result"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (CancelCheckoutResponse) GetJSONDefault

func (r CancelCheckoutResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (CancelCheckoutResponse) Status

func (r CancelCheckoutResponse) Status() string

Status returns HTTPResponse.Status

func (CancelCheckoutResponse) StatusCode

func (r CancelCheckoutResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type CancelUpgradeResponse

type CancelUpgradeResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Errors   []Message    `json:"errors"`
		Messages []Message    `json:"messages"`
		Result   Subscription `json:"result"`

		// Success True on a 2xx and false otherwise.
		Success bool `json:"success"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParseCancelUpgradeResponse

func ParseCancelUpgradeResponse(rsp *http.Response) (*CancelUpgradeResponse, error)

ParseCancelUpgradeResponse parses an HTTP response from a CancelUpgradeWithResponse call

func (CancelUpgradeResponse) ContentType

func (r CancelUpgradeResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (CancelUpgradeResponse) GetBody

func (r CancelUpgradeResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (CancelUpgradeResponse) GetJSON200

func (r CancelUpgradeResponse) GetJSON200() *struct {
	Errors   []Message    `json:"errors"`
	Messages []Message    `json:"messages"`
	Result   Subscription `json:"result"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (CancelUpgradeResponse) GetJSONDefault

func (r CancelUpgradeResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (CancelUpgradeResponse) Status

func (r CancelUpgradeResponse) Status() string

Status returns HTTPResponse.Status

func (CancelUpgradeResponse) StatusCode

func (r CancelUpgradeResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Charge

type Charge struct {
	Meter string      `json:"meter"`
	Model ChargeModel `json:"model"`

	// Price A price per unit, which may be finer than the currency's minor unit.
	Price *Rate   `json:"price,omitempty"`
	Tiers *[]Tier `json:"tiers,omitempty"`
}

Charge Prices one meter, billed at the end of each period.

type ChargeModel

type ChargeModel string

ChargeModel defines model for Charge.Model.

const (
	Graduated ChargeModel = "graduated"
	PerUnit   ChargeModel = "per_unit"
)

Defines values for ChargeModel.

func (ChargeModel) Valid

func (e ChargeModel) Valid() bool

Valid indicates whether the value is a known member of the ChargeModel enum.

type Checkout

type Checkout struct {
	Amount Money `json:"amount"`

	// App The app it was charged through; null for one you reported.
	App *string `json:"app"`

	// ExpiresAt When the gateway stops taking the payment.
	ExpiresAt time.Time `json:"expires_at"`
	Id        string    `json:"id"`
	Invoice   string    `json:"invoice"`

	// PaidAt When the money moved; absent until it has.
	PaidAt *time.Time `json:"paid_at,omitempty"`

	// PayerUrl The gateway's page to send the payer to; absent until the gateway answers.
	PayerUrl   *string   `json:"payer_url,omitempty"`
	RecordedAt time.Time `json:"recorded_at"`

	// Reference Your own reference for the payment.
	Reference string         `json:"reference"`
	Status    CheckoutStatus `json:"status"`
}

Checkout defines model for Checkout.

type CheckoutBody

type CheckoutBody struct {
	Amount *Money `json:"amount,omitempty"`

	// App An installed app's id, such as qi.
	App string `json:"app"`

	// Reference Your own reference for the payment, unique in the project.
	Reference string `json:"reference"`

	// ReturnUrl Where the gateway sends the payer afterwards. Nothing that arrives on it is trusted.
	ReturnUrl string `json:"return_url"`
}

CheckoutBody defines model for CheckoutBody.

type CheckoutStatus

type CheckoutStatus string

CheckoutStatus defines model for Checkout.Status.

const (
	CheckoutStatusAuthorized CheckoutStatus = "authorized"
	CheckoutStatusCancelled  CheckoutStatus = "cancelled"
	CheckoutStatusExpired    CheckoutStatus = "expired"
	CheckoutStatusFailed     CheckoutStatus = "failed"
	CheckoutStatusPending    CheckoutStatus = "pending"
	CheckoutStatusSucceeded  CheckoutStatus = "succeeded"
)

Defines values for CheckoutStatus.

func (CheckoutStatus) Valid

func (e CheckoutStatus) Valid() bool

Valid indicates whether the value is a known member of the CheckoutStatus enum.

type Client

type Client struct {
	// The endpoint of the server conforming to this interface, with scheme,
	// https://api.deepmap.com for example. This can contain a path relative
	// to the server, such as https://api.deepmap.com/dev-test, and all the
	// paths in the swagger spec will be appended to the server.
	Server string

	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client HttpRequestDoer

	// A list of callbacks for modifying requests which are generated before sending over
	// the network.
	RequestEditors []RequestEditorFn
}

Client which conforms to the OpenAPI3 specification for this service.

func NewClient

func NewClient(server string, opts ...ClientOption) (*Client, error)

Creates a new Client, with reasonable defaults

func (*Client) AcceptQuote

func (c *Client) AcceptQuote(ctx context.Context, quote QuoteId, reqEditors ...RequestEditorFn) (*http.Response, error)

AcceptQuote Make the quoted change at the quote's prices

A new subscription is made from the plans as they were quoted, so its first invoice is the quote even if a plan changed since. With pay_first, it gives nothing until that invoice is paid. Accepting again returns the first acceptance, so it's safe to retry. An expired quote is refused (422): quote again. A renewal's quote can't be accepted (422).

Corresponds with POST /v1/billing/quotes/{quote}/accept (the `AcceptQuote` operationId).

func (*Client) AddWebhookEndpoint

func (c *Client) AddWebhookEndpoint(ctx context.Context, body AddWebhookEndpointJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

AddWebhookEndpoint Register a webhook endpoint

Billing posts invoice.issued, invoice.paid, invoice.voided, credit_note.created, refund.succeeded, refund.failed and entitlements.updated events to it, signed per Standard Webhooks (https://www.standardwebhooks.com) with the secret returned here, once. Anything but a 2xx is retried with backoff for about three weeks; the same event keeps its webhook-id across retries.

Takes a body of the `application/json` content type.

Corresponds with POST /v1/billing/webhook-endpoints (the `AddWebhookEndpoint` operationId).

func (*Client) AddWebhookEndpointWithBody

func (c *Client) AddWebhookEndpointWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

AddWebhookEndpointWithBody Register a webhook endpoint

Billing posts invoice.issued, invoice.paid, invoice.voided, credit_note.created, refund.succeeded, refund.failed and entitlements.updated events to it, signed per Standard Webhooks (https://www.standardwebhooks.com) with the secret returned here, once. Anything but a 2xx is retried with backoff for about three weeks; the same event keeps its webhook-id across retries.

Takes any type of body and a specified content type.

Corresponds with POST /v1/billing/webhook-endpoints (the `AddWebhookEndpoint` operationId).

func (*Client) ApplyCoupon

func (c *Client) ApplyCoupon(ctx context.Context, id Id, body ApplyCouponJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

ApplyCoupon Give the customer a coupon

Takes a body of the `application/json` content type.

Corresponds with POST /v1/billing/customers/{id}/coupons (the `ApplyCoupon` operationId).

func (*Client) ApplyCouponWithBody

func (c *Client) ApplyCouponWithBody(ctx context.Context, id Id, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

ApplyCouponWithBody Give the customer a coupon

Takes any type of body and a specified content type.

Corresponds with POST /v1/billing/customers/{id}/coupons (the `ApplyCoupon` operationId).

func (*Client) CancelCheckout

func (c *Client) CancelCheckout(ctx context.Context, checkout openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error)

CancelCheckout Cancel a checkout the payer hasn't finished

Stops the payment at its gateway, so it can no longer be paid and stops holding its invoice: start another for the payer who gave up on the gateway's page. Cancelling one cancelled already returns it. A checkout with an outcome, or one its gateway is processing or has paid, is a 409. Billing also cancels checkouts itself once money recorded on their invoice leaves no room for them.

Corresponds with POST /v1/billing/checkouts/{checkout}/cancel (the `CancelCheckout` operationId).

func (*Client) CancelUpgrade

func (c *Client) CancelUpgrade(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*http.Response, error)

CancelUpgrade Take back an unpaid upgrade

Voids the upgrade's invoice and puts the subscription back on its old plan, at the prices it was bought at, from the next period; its old plan, seats and add-ons apply to this period's end. Under the unpaid_upgrades setting revert, billing does this itself once the invoice is past due. 409 when the subscription has no unpaid upgrade, 503 until the upgrade's invoice is issued, and 422 for an upgrade that changed the plan's fee, which can't be taken back.

Corresponds with POST /v1/billing/subscriptions/{id}/upgrade/cancel (the `CancelUpgrade` operationId).

func (*Client) CreateCreditNote

func (c *Client) CreateCreditNote(ctx context.Context, invoice InvoiceId, body CreateCreditNoteJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

CreateCreditNote Take value off an issued invoice

Credits the invoice, whole or in part, by amount or by line, with a reason. What's still due comes off first; the rest goes back as `return` says, as a refund or as credit off the customer's next invoices, and needs money paid on the invoice to come from. A credit note is final, and numbered in the project's one sequence. The reference is your own and makes this safe to send again: the same reference returns the first credit note, and one reused for a different one is a 409. Once nothing is due, the invoice is marked paid. A 503 after that means the credit note is recorded but the invoice isn't yet marked paid; send the same request again.

Takes a body of the `application/json` content type.

Corresponds with POST /v1/billing/invoices/{invoice}/credit-notes (the `CreateCreditNote` operationId).

func (*Client) CreateCreditNoteWithBody

func (c *Client) CreateCreditNoteWithBody(ctx context.Context, invoice InvoiceId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

CreateCreditNoteWithBody Take value off an issued invoice

Credits the invoice, whole or in part, by amount or by line, with a reason. What's still due comes off first; the rest goes back as `return` says, as a refund or as credit off the customer's next invoices, and needs money paid on the invoice to come from. A credit note is final, and numbered in the project's one sequence. The reference is your own and makes this safe to send again: the same reference returns the first credit note, and one reused for a different one is a 409. Once nothing is due, the invoice is marked paid. A 503 after that means the credit note is recorded but the invoice isn't yet marked paid; send the same request again.

Takes any type of body and a specified content type.

Corresponds with POST /v1/billing/invoices/{invoice}/credit-notes (the `CreateCreditNote` operationId).

func (*Client) CreateQuote

func (c *Client) CreateQuote(ctx context.Context, body CreateQuoteJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

CreateQuote Price a new subscription, a seat change or a renewal, as of now

Prices exactly one of subscription, seats and renewal: the lines billed at once, as the invoice will have them. Lines billed in arrears, coupons and credits aren't in it. The quote is kept until the end of its UTC day, since proration is by the day. A new subscription starts when the quote is accepted, so it takes no starts_at. A plan change on an existing subscription isn't quoted (422).

Takes a body of the `application/json` content type.

Corresponds with POST /v1/billing/quotes (the `CreateQuote` operationId).

func (*Client) CreateQuoteWithBody

func (c *Client) CreateQuoteWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

CreateQuoteWithBody Price a new subscription, a seat change or a renewal, as of now

Prices exactly one of subscription, seats and renewal: the lines billed at once, as the invoice will have them. Lines billed in arrears, coupons and credits aren't in it. The quote is kept until the end of its UTC day, since proration is by the day. A new subscription starts when the quote is accepted, so it takes no starts_at. A plan change on an existing subscription isn't quoted (422).

Takes any type of body and a specified content type.

Corresponds with POST /v1/billing/quotes (the `CreateQuote` operationId).

func (*Client) CreateRefund

func (c *Client) CreateRefund(ctx context.Context, invoice InvoiceId, body CreateRefundJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

CreateRefund Give money back on one of an invoice's payments

Pays out a credit note's refund part, or gives back money paid twice. Without `refunded_at`, billing refunds through the app the payment was made on, and follows the refund until it has an outcome; a refund made at the gateway's own dashboard for the same amount is taken as this one instead of refunding again. With it, it records money you gave back yourself, on a payment its app can't refund. Billing never holds the money: it comes from your own gateway account. The reference is your own and makes this safe to send again: the same reference returns the first refund, and one reused for a different refund is a 409.

Takes a body of the `application/json` content type.

Corresponds with POST /v1/billing/invoices/{invoice}/refunds (the `CreateRefund` operationId).

func (*Client) CreateRefundWithBody

func (c *Client) CreateRefundWithBody(ctx context.Context, invoice InvoiceId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

CreateRefundWithBody Give money back on one of an invoice's payments

Pays out a credit note's refund part, or gives back money paid twice. Without `refunded_at`, billing refunds through the app the payment was made on, and follows the refund until it has an outcome; a refund made at the gateway's own dashboard for the same amount is taken as this one instead of refunding again. With it, it records money you gave back yourself, on a payment its app can't refund. Billing never holds the money: it comes from your own gateway account. The reference is your own and makes this safe to send again: the same reference returns the first refund, and one reused for a different refund is a 409.

Takes any type of body and a specified content type.

Corresponds with POST /v1/billing/invoices/{invoice}/refunds (the `CreateRefund` operationId).

func (*Client) DeleteCoupon

func (c *Client) DeleteCoupon(ctx context.Context, code Code, reqEditors ...RequestEditorFn) (*http.Response, error)

DeleteCoupon Delete a coupon. Customers who already have it keep it.

Corresponds with DELETE /v1/billing/coupons/{code} (the `DeleteCoupon` operationId).

func (*Client) DeleteFeature

func (c *Client) DeleteFeature(ctx context.Context, code Code, reqEditors ...RequestEditorFn) (*http.Response, error)

DeleteFeature Delete a feature, and remove it from every plan

Corresponds with DELETE /v1/billing/features/{code} (the `DeleteFeature` operationId).

func (*Client) DeleteMeter

func (c *Client) DeleteMeter(ctx context.Context, code Code, reqEditors ...RequestEditorFn) (*http.Response, error)

DeleteMeter Delete a meter, and every charge on it

Corresponds with DELETE /v1/billing/meters/{code} (the `DeleteMeter` operationId).

func (*Client) DeletePlan

func (c *Client) DeletePlan(ctx context.Context, code Code, reqEditors ...RequestEditorFn) (*http.Response, error)

DeletePlan Delete a plan

Refused (422) while a subscription is on the plan or waits to move to it, since its features come from the plan.

Corresponds with DELETE /v1/billing/plans/{code} (the `DeletePlan` operationId).

func (*Client) GetCheckout

func (c *Client) GetCheckout(ctx context.Context, checkout openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error)

GetCheckout Get a checkout, to show its outcome

Corresponds with GET /v1/billing/checkouts/{checkout} (the `GetCheckout` operationId).

func (*Client) GetCreditNote

func (c *Client) GetCreditNote(ctx context.Context, creditNote CreditNoteId, reqEditors ...RequestEditorFn) (*http.Response, error)

GetCreditNote Get a credit note

Corresponds with GET /v1/billing/credit-notes/{credit_note} (the `GetCreditNote` operationId).

func (*Client) GetCustomer

func (c *Client) GetCustomer(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*http.Response, error)

GetCustomer Get a customer

Corresponds with GET /v1/billing/customers/{id} (the `GetCustomer` operationId).

func (*Client) GetEntitlements

func (c *Client) GetEntitlements(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*http.Response, error)

GetEntitlements What the customer may use now

The features of every plan the customer holds an active subscription to. Keep your own copy and gate on it; don't call this on each of your requests.

Corresponds with GET /v1/billing/customers/{id}/entitlements (the `GetEntitlements` operationId).

func (*Client) GetInvoice

func (c *Client) GetInvoice(ctx context.Context, invoice InvoiceId, reqEditors ...RequestEditorFn) (*http.Response, error)

GetInvoice Get an invoice

Corresponds with GET /v1/billing/invoices/{invoice} (the `GetInvoice` operationId).

func (*Client) GetInvoicePdf

func (c *Client) GetInvoicePdf(ctx context.Context, invoice InvoiceId, reqEditors ...RequestEditorFn) (*http.Response, error)

GetInvoicePdf Download an invoice as a PDF

The PDF is rendered on first request; until it is ready this answers 503 with Retry-After.

Corresponds with GET /v1/billing/invoices/{invoice}/pdf (the `GetInvoicePdf` operationId).

func (*Client) GetLock

func (c *Client) GetLock(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

GetLock Whether unpaid invoices lock customers' features

Corresponds with GET /v1/billing/lock (the `GetLock` operationId).

func (*Client) GetMeter

func (c *Client) GetMeter(ctx context.Context, code Code, reqEditors ...RequestEditorFn) (*http.Response, error)

GetMeter Get a meter

Corresponds with GET /v1/billing/meters/{code} (the `GetMeter` operationId).

func (*Client) GetPaymentSettings

func (c *Client) GetPaymentSettings(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

GetPaymentSettings What a pending checkout holds

Corresponds with GET /v1/billing/payment-settings (the `GetPaymentSettings` operationId).

func (*Client) GetPlan

func (c *Client) GetPlan(ctx context.Context, code Code, reqEditors ...RequestEditorFn) (*http.Response, error)

GetPlan Get a plan

Corresponds with GET /v1/billing/plans/{code} (the `GetPlan` operationId).

func (*Client) GetQuote

func (c *Client) GetQuote(ctx context.Context, quote QuoteId, reqEditors ...RequestEditorFn) (*http.Response, error)

GetQuote Get a quote

Corresponds with GET /v1/billing/quotes/{quote} (the `GetQuote` operationId).

func (*Client) GetSubscription

func (c *Client) GetSubscription(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*http.Response, error)

GetSubscription Get a subscription

Corresponds with GET /v1/billing/subscriptions/{id} (the `GetSubscription` operationId).

func (*Client) GetSummary

func (c *Client) GetSummary(ctx context.Context, params *GetSummaryParams, reqEditors ...RequestEditorFn) (*http.Response, error)

GetSummary How the project bills, and what it invoiced lately

The project's country, currency and when billing was turned on, and the invoices issued since a date: how many, and their totals, one per currency, since billing never converts. Voided invoices count for neither.

Corresponds with GET /v1/billing/summary (the `GetSummary` operationId).

func (*Client) ListApps

func (c *Client) ListApps(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

ListApps List the payment apps a project can install, with its installs

Corresponds with GET /v1/billing/apps (the `ListApps` operationId).

func (*Client) ListCoupons

func (c *Client) ListCoupons(ctx context.Context, params *ListCouponsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListCoupons List coupons

Corresponds with GET /v1/billing/coupons (the `ListCoupons` operationId).

func (*Client) ListCreditNotes

func (c *Client) ListCreditNotes(ctx context.Context, params *ListCreditNotesParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListCreditNotes List the project's credit notes

Corresponds with GET /v1/billing/credit-notes (the `ListCreditNotes` operationId).

func (*Client) ListCustomers

func (c *Client) ListCustomers(ctx context.Context, params *ListCustomersParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListCustomers List customers

Corresponds with GET /v1/billing/customers (the `ListCustomers` operationId).

func (*Client) ListFeatures

func (c *Client) ListFeatures(ctx context.Context, params *ListFeaturesParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListFeatures List features

Corresponds with GET /v1/billing/features (the `ListFeatures` operationId).

func (*Client) ListInvoiceCreditNotes

func (c *Client) ListInvoiceCreditNotes(ctx context.Context, invoice InvoiceId, reqEditors ...RequestEditorFn) (*http.Response, error)

ListInvoiceCreditNotes List an invoice's credit notes

Corresponds with GET /v1/billing/invoices/{invoice}/credit-notes (the `ListInvoiceCreditNotes` operationId).

func (*Client) ListInvoices

func (c *Client) ListInvoices(ctx context.Context, params *ListInvoicesParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListInvoices List invoices

Corresponds with GET /v1/billing/invoices (the `ListInvoices` operationId).

func (*Client) ListMeters

func (c *Client) ListMeters(ctx context.Context, params *ListMetersParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListMeters List meters

Corresponds with GET /v1/billing/meters (the `ListMeters` operationId).

func (*Client) ListPayments

func (c *Client) ListPayments(ctx context.Context, invoice InvoiceId, reqEditors ...RequestEditorFn) (*http.Response, error)

ListPayments List the payments recorded against an invoice

Corresponds with GET /v1/billing/invoices/{invoice}/payments (the `ListPayments` operationId).

func (*Client) ListPlans

func (c *Client) ListPlans(ctx context.Context, params *ListPlansParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListPlans List plans

Corresponds with GET /v1/billing/plans (the `ListPlans` operationId).

func (*Client) ListRefunds

func (c *Client) ListRefunds(ctx context.Context, invoice InvoiceId, reqEditors ...RequestEditorFn) (*http.Response, error)

ListRefunds List an invoice's refunds

Corresponds with GET /v1/billing/invoices/{invoice}/refunds (the `ListRefunds` operationId).

func (*Client) ListSubscriptions

func (c *Client) ListSubscriptions(ctx context.Context, params *ListSubscriptionsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListSubscriptions List a customer's active and pending subscriptions

Corresponds with GET /v1/billing/subscriptions (the `ListSubscriptions` operationId).

func (*Client) ListWebhookEndpoints

func (c *Client) ListWebhookEndpoints(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

ListWebhookEndpoints List the project's webhook endpoints

Corresponds with GET /v1/billing/webhook-endpoints (the `ListWebhookEndpoints` operationId).

func (*Client) PutAppForward

func (c *Client) PutAppForward(ctx context.Context, app AppId, body PutAppForwardJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

PutAppForward Set where your own notifications from the gateway go

For an app whose gateway has one notification address per merchant (`forwards` is true), billing posts each notification that isn't about one of its own payments to this URL, as received, with `Edgescale-Forwarded: billing` added. Anything but a 2xx is retried for about three weeks. An empty URL stops forwarding.

Only a notification whose gateway signature checks out is forwarded, and a replay of one only once a day, so the app's signing setting comes first: for Qi, its public key. Setting a URL without it is a 409. One that doesn't check out is answered 400, so the gateway sends a real one again.

Takes a body of the `application/json` content type.

Corresponds with PUT /v1/billing/apps/{app}/forward (the `PutAppForward` operationId).

func (*Client) PutAppForwardWithBody

func (c *Client) PutAppForwardWithBody(ctx context.Context, app AppId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

PutAppForwardWithBody Set where your own notifications from the gateway go

For an app whose gateway has one notification address per merchant (`forwards` is true), billing posts each notification that isn't about one of its own payments to this URL, as received, with `Edgescale-Forwarded: billing` added. Anything but a 2xx is retried for about three weeks. An empty URL stops forwarding.

Only a notification whose gateway signature checks out is forwarded, and a replay of one only once a day, so the app's signing setting comes first: for Qi, its public key. Setting a URL without it is a 409. One that doesn't check out is answered 400, so the gateway sends a real one again.

Takes any type of body and a specified content type.

Corresponds with PUT /v1/billing/apps/{app}/forward (the `PutAppForward` operationId).

func (*Client) PutCoupon

func (c *Client) PutCoupon(ctx context.Context, code Code, body PutCouponJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

PutCoupon Create or update a coupon

Takes a body of the `application/json` content type.

Corresponds with PUT /v1/billing/coupons/{code} (the `PutCoupon` operationId).

func (*Client) PutCouponWithBody

func (c *Client) PutCouponWithBody(ctx context.Context, code Code, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

PutCouponWithBody Create or update a coupon

Takes any type of body and a specified content type.

Corresponds with PUT /v1/billing/coupons/{code} (the `PutCoupon` operationId).

func (*Client) PutCustomer

func (c *Client) PutCustomer(ctx context.Context, id Id, body PutCustomerJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

PutCustomer Create or update a customer, under your own ID for it

Takes a body of the `application/json` content type.

Corresponds with PUT /v1/billing/customers/{id} (the `PutCustomer` operationId).

func (*Client) PutCustomerWithBody

func (c *Client) PutCustomerWithBody(ctx context.Context, id Id, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

PutCustomerWithBody Create or update a customer, under your own ID for it

Takes any type of body and a specified content type.

Corresponds with PUT /v1/billing/customers/{id} (the `PutCustomer` operationId).

func (*Client) PutFeature

func (c *Client) PutFeature(ctx context.Context, code Code, body PutFeatureJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

PutFeature Create or update a feature

Takes a body of the `application/json` content type.

Corresponds with PUT /v1/billing/features/{code} (the `PutFeature` operationId).

func (*Client) PutFeatureWithBody

func (c *Client) PutFeatureWithBody(ctx context.Context, code Code, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

PutFeatureWithBody Create or update a feature

Takes any type of body and a specified content type.

Corresponds with PUT /v1/billing/features/{code} (the `PutFeature` operationId).

func (*Client) PutLock

func (c *Client) PutLock(ctx context.Context, body PutLockJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

PutLock Set whether unpaid invoices lock customers' features

A change sends entitlements.updated for every customer with an active subscription.

Takes a body of the `application/json` content type.

Corresponds with PUT /v1/billing/lock (the `PutLock` operationId).

func (*Client) PutLockWithBody

func (c *Client) PutLockWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

PutLockWithBody Set whether unpaid invoices lock customers' features

A change sends entitlements.updated for every customer with an active subscription.

Takes any type of body and a specified content type.

Corresponds with PUT /v1/billing/lock (the `PutLock` operationId).

func (*Client) PutMeter

func (c *Client) PutMeter(ctx context.Context, code Code, body PutMeterJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

PutMeter Create or update a meter

Takes a body of the `application/json` content type.

Corresponds with PUT /v1/billing/meters/{code} (the `PutMeter` operationId).

func (*Client) PutMeterWithBody

func (c *Client) PutMeterWithBody(ctx context.Context, code Code, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

PutMeterWithBody Create or update a meter

Takes any type of body and a specified content type.

Corresponds with PUT /v1/billing/meters/{code} (the `PutMeter` operationId).

func (*Client) PutPaymentSettings

func (c *Client) PutPaymentSettings(ctx context.Context, body PutPaymentSettingsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

PutPaymentSettings Set what a pending checkout holds

A change applies to checkouts started after it.

Takes a body of the `application/json` content type.

Corresponds with PUT /v1/billing/payment-settings (the `PutPaymentSettings` operationId).

func (*Client) PutPaymentSettingsWithBody

func (c *Client) PutPaymentSettingsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

PutPaymentSettingsWithBody Set what a pending checkout holds

A change applies to checkouts started after it.

Takes any type of body and a specified content type.

Corresponds with PUT /v1/billing/payment-settings (the `PutPaymentSettings` operationId).

func (*Client) PutPlan

func (c *Client) PutPlan(ctx context.Context, code Code, body PutPlanJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

PutPlan Create or update a plan

The plan's charges and features become exactly the ones sent; one left out is removed. A subscription keeps the prices its plan had when it subscribed, so a price change reaches only subscriptions made or moved to the plan after it. A feature change reaches every subscription to the plan at once.

Takes a body of the `application/json` content type.

Corresponds with PUT /v1/billing/plans/{code} (the `PutPlan` operationId).

func (*Client) PutPlanWithBody

func (c *Client) PutPlanWithBody(ctx context.Context, code Code, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

PutPlanWithBody Create or update a plan

The plan's charges and features become exactly the ones sent; one left out is removed. A subscription keeps the prices its plan had when it subscribed, so a price change reaches only subscriptions made or moved to the plan after it. A feature change reaches every subscription to the plan at once.

Takes any type of body and a specified content type.

Corresponds with PUT /v1/billing/plans/{code} (the `PutPlan` operationId).

func (*Client) PutSubscription

func (c *Client) PutSubscription(ctx context.Context, id Id, body PutSubscriptionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

PutSubscription Create a subscription, or change its plan or seats

A new ID creates the subscription. For an existing one, a different plan moves it: an upgrade starts now, and a downgrade waits for the end of the period, showing meanwhile as next_plan. Seats are set to the number sent, so send the current count to leave them alone.

Takes a body of the `application/json` content type.

Corresponds with PUT /v1/billing/subscriptions/{id} (the `PutSubscription` operationId).

func (*Client) PutSubscriptionWithBody

func (c *Client) PutSubscriptionWithBody(ctx context.Context, id Id, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

PutSubscriptionWithBody Create a subscription, or change its plan or seats

A new ID creates the subscription. For an existing one, a different plan moves it: an upgrade starts now, and a downgrade waits for the end of the period, showing meanwhile as next_plan. Seats are set to the number sent, so send the current count to leave them alone.

Takes any type of body and a specified content type.

Corresponds with PUT /v1/billing/subscriptions/{id} (the `PutSubscription` operationId).

func (*Client) RecordEvents

func (c *Client) RecordEvents(ctx context.Context, body RecordEventsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

RecordEvents Report usage

Up to 100 events at a time. An event whose id was recorded before is skipped, so a batch can be sent again safely.

Takes a body of the `application/json` content type.

Corresponds with POST /v1/billing/events (the `RecordEvents` operationId).

func (*Client) RecordEventsWithBody

func (c *Client) RecordEventsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

RecordEventsWithBody Report usage

Up to 100 events at a time. An event whose id was recorded before is skipped, so a batch can be sent again safely.

Takes any type of body and a specified content type.

Corresponds with POST /v1/billing/events (the `RecordEvents` operationId).

func (*Client) RecordPayment

func (c *Client) RecordPayment(ctx context.Context, invoice InvoiceId, body RecordPaymentJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

RecordPayment Report a payment you collected yourself

Records money you collected outside billing, by your own gateway, a transfer or cash, against the invoice. The reference is your own and makes this safe to send again: the same reference returns the first payment, and a reference reused for a different payment is a 409. Once the payments cover the invoice it is marked paid. A 503 after that means the payment is recorded but the invoice is not yet marked paid; send the same request again.

Takes a body of the `application/json` content type.

Corresponds with POST /v1/billing/invoices/{invoice}/payments (the `RecordPayment` operationId).

func (*Client) RecordPaymentWithBody

func (c *Client) RecordPaymentWithBody(ctx context.Context, invoice InvoiceId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

RecordPaymentWithBody Report a payment you collected yourself

Records money you collected outside billing, by your own gateway, a transfer or cash, against the invoice. The reference is your own and makes this safe to send again: the same reference returns the first payment, and a reference reused for a different payment is a 409. Once the payments cover the invoice it is marked paid. A 503 after that means the payment is recorded but the invoice is not yet marked paid; send the same request again.

Takes any type of body and a specified content type.

Corresponds with POST /v1/billing/invoices/{invoice}/payments (the `RecordPayment` operationId).

func (*Client) RemoveWebhookEndpoint

func (c *Client) RemoveWebhookEndpoint(ctx context.Context, endpoint string, reqEditors ...RequestEditorFn) (*http.Response, error)

RemoveWebhookEndpoint Remove a webhook endpoint, and stop its pending deliveries

Corresponds with DELETE /v1/billing/webhook-endpoints/{endpoint} (the `RemoveWebhookEndpoint` operationId).

func (*Client) SetSeats

func (c *Client) SetSeats(ctx context.Context, id Id, body SetSeatsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

SetSeats Set the seats of the subscription's plan and its add-ons from now on

Seats billed in advance bill an increase now, prorated, all on one invoice, and a decrease from the next period. Seats billed in arrears change now.

Takes a body of the `application/json` content type.

Corresponds with PUT /v1/billing/subscriptions/{id}/seats (the `SetSeats` operationId).

func (*Client) SetSeatsWithBody

func (c *Client) SetSeatsWithBody(ctx context.Context, id Id, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

SetSeatsWithBody Set the seats of the subscription's plan and its add-ons from now on

Seats billed in advance bill an increase now, prorated, all on one invoice, and a decrease from the next period. Seats billed in arrears change now.

Takes any type of body and a specified content type.

Corresponds with PUT /v1/billing/subscriptions/{id}/seats (the `SetSeats` operationId).

func (*Client) StartCheckout

func (c *Client) StartCheckout(ctx context.Context, invoice InvoiceId, body StartCheckoutJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

StartCheckout Start a payment through an installed app

Opens a payment on one of the project's apps and returns the gateway's page to send the payer to, `payer_url`. The reference is your own and makes this safe to send again: the same reference returns the first checkout, and one reused for another invoice, amount or app is a 409. The amount defaults to what is still due, and can't be more. Unless the project's payment settings allow overlapping checkouts, a pending checkout holds its amount: the default amount is what's left, and one that doesn't fit is a 409 naming the pending checkouts, so you can send the payer back to one. Billing follows the payment itself and marks the invoice paid once its payments cover it; read the checkout on your return page to show the outcome. A checkout without `payer_url` hasn't reached the gateway yet: send the same request again. While the app's gateway refuses the project's settings, this is a 409 until they're updated.

Takes a body of the `application/json` content type.

Corresponds with POST /v1/billing/invoices/{invoice}/checkouts (the `StartCheckout` operationId).

func (*Client) StartCheckoutWithBody

func (c *Client) StartCheckoutWithBody(ctx context.Context, invoice InvoiceId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

StartCheckoutWithBody Start a payment through an installed app

Opens a payment on one of the project's apps and returns the gateway's page to send the payer to, `payer_url`. The reference is your own and makes this safe to send again: the same reference returns the first checkout, and one reused for another invoice, amount or app is a 409. The amount defaults to what is still due, and can't be more. Unless the project's payment settings allow overlapping checkouts, a pending checkout holds its amount: the default amount is what's left, and one that doesn't fit is a 409 naming the pending checkouts, so you can send the payer back to one. Billing follows the payment itself and marks the invoice paid once its payments cover it; read the checkout on your return page to show the outcome. A checkout without `payer_url` hasn't reached the gateway yet: send the same request again. While the app's gateway refuses the project's settings, this is a 409 until they're updated.

Takes any type of body and a specified content type.

Corresponds with POST /v1/billing/invoices/{invoice}/checkouts (the `StartCheckout` operationId).

func (*Client) TerminateSubscription

func (c *Client) TerminateSubscription(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*http.Response, error)

TerminateSubscription End a subscription now and bill what is due

Corresponds with DELETE /v1/billing/subscriptions/{id} (the `TerminateSubscription` operationId).

type ClientInterface

type ClientInterface interface {

	// ListApps List the payment apps a project can install, with its installs
	//
	// Corresponds with GET /v1/billing/apps (the `ListApps` operationId).
	ListApps(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PutAppForwardWithBody Set where your own notifications from the gateway go
	//
	// For an app whose gateway has one notification address per merchant
	// (`forwards` is true), billing posts each notification that isn't
	// about one of its own payments to this URL, as received, with
	// `Edgescale-Forwarded: billing` added. Anything but a 2xx is retried
	// for about three weeks. An empty URL stops forwarding.
	//
	// Only a notification whose gateway signature checks out is forwarded,
	// and a replay of one only once a day, so the app's signing setting
	// comes first: for Qi, its public key. Setting a URL without it is a
	// 409. One that doesn't check out is answered 400, so the gateway sends
	// a real one again.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with PUT /v1/billing/apps/{app}/forward (the `PutAppForward` operationId).
	PutAppForwardWithBody(ctx context.Context, app AppId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PutAppForward Set where your own notifications from the gateway go
	//
	// For an app whose gateway has one notification address per merchant
	// (`forwards` is true), billing posts each notification that isn't
	// about one of its own payments to this URL, as received, with
	// `Edgescale-Forwarded: billing` added. Anything but a 2xx is retried
	// for about three weeks. An empty URL stops forwarding.
	//
	// Only a notification whose gateway signature checks out is forwarded,
	// and a replay of one only once a day, so the app's signing setting
	// comes first: for Qi, its public key. Setting a URL without it is a
	// 409. One that doesn't check out is answered 400, so the gateway sends
	// a real one again.
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with PUT /v1/billing/apps/{app}/forward (the `PutAppForward` operationId).
	PutAppForward(ctx context.Context, app AppId, body PutAppForwardJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetCheckout Get a checkout, to show its outcome
	//
	// Corresponds with GET /v1/billing/checkouts/{checkout} (the `GetCheckout` operationId).
	GetCheckout(ctx context.Context, checkout openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CancelCheckout Cancel a checkout the payer hasn't finished
	//
	// Stops the payment at its gateway, so it can no longer be paid and
	// stops holding its invoice: start another for the payer who gave up
	// on the gateway's page. Cancelling one cancelled already returns it.
	// A checkout with an outcome, or one its gateway is processing or has
	// paid, is a 409. Billing also cancels checkouts itself once money
	// recorded on their invoice leaves no room for them.
	//
	// Corresponds with POST /v1/billing/checkouts/{checkout}/cancel (the `CancelCheckout` operationId).
	CancelCheckout(ctx context.Context, checkout openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListCoupons List coupons
	//
	// Corresponds with GET /v1/billing/coupons (the `ListCoupons` operationId).
	ListCoupons(ctx context.Context, params *ListCouponsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DeleteCoupon Delete a coupon. Customers who already have it keep it.
	//
	// Corresponds with DELETE /v1/billing/coupons/{code} (the `DeleteCoupon` operationId).
	DeleteCoupon(ctx context.Context, code Code, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PutCouponWithBody Create or update a coupon
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with PUT /v1/billing/coupons/{code} (the `PutCoupon` operationId).
	PutCouponWithBody(ctx context.Context, code Code, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PutCoupon Create or update a coupon
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with PUT /v1/billing/coupons/{code} (the `PutCoupon` operationId).
	PutCoupon(ctx context.Context, code Code, body PutCouponJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListCreditNotes List the project's credit notes
	//
	// Corresponds with GET /v1/billing/credit-notes (the `ListCreditNotes` operationId).
	ListCreditNotes(ctx context.Context, params *ListCreditNotesParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetCreditNote Get a credit note
	//
	// Corresponds with GET /v1/billing/credit-notes/{credit_note} (the `GetCreditNote` operationId).
	GetCreditNote(ctx context.Context, creditNote CreditNoteId, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListCustomers List customers
	//
	// Corresponds with GET /v1/billing/customers (the `ListCustomers` operationId).
	ListCustomers(ctx context.Context, params *ListCustomersParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetCustomer Get a customer
	//
	// Corresponds with GET /v1/billing/customers/{id} (the `GetCustomer` operationId).
	GetCustomer(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PutCustomerWithBody Create or update a customer, under your own ID for it
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with PUT /v1/billing/customers/{id} (the `PutCustomer` operationId).
	PutCustomerWithBody(ctx context.Context, id Id, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PutCustomer Create or update a customer, under your own ID for it
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with PUT /v1/billing/customers/{id} (the `PutCustomer` operationId).
	PutCustomer(ctx context.Context, id Id, body PutCustomerJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ApplyCouponWithBody Give the customer a coupon
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /v1/billing/customers/{id}/coupons (the `ApplyCoupon` operationId).
	ApplyCouponWithBody(ctx context.Context, id Id, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ApplyCoupon Give the customer a coupon
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /v1/billing/customers/{id}/coupons (the `ApplyCoupon` operationId).
	ApplyCoupon(ctx context.Context, id Id, body ApplyCouponJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetEntitlements What the customer may use now
	//
	// The features of every plan the customer holds an active subscription to. Keep your own copy and gate on it; don't call this on each of your requests.
	//
	// Corresponds with GET /v1/billing/customers/{id}/entitlements (the `GetEntitlements` operationId).
	GetEntitlements(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*http.Response, error)

	// RecordEventsWithBody Report usage
	//
	// Up to 100 events at a time. An event whose id was recorded before is skipped, so a batch can be sent again safely.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /v1/billing/events (the `RecordEvents` operationId).
	RecordEventsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// RecordEvents Report usage
	//
	// Up to 100 events at a time. An event whose id was recorded before is skipped, so a batch can be sent again safely.
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /v1/billing/events (the `RecordEvents` operationId).
	RecordEvents(ctx context.Context, body RecordEventsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListFeatures List features
	//
	// Corresponds with GET /v1/billing/features (the `ListFeatures` operationId).
	ListFeatures(ctx context.Context, params *ListFeaturesParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DeleteFeature Delete a feature, and remove it from every plan
	//
	// Corresponds with DELETE /v1/billing/features/{code} (the `DeleteFeature` operationId).
	DeleteFeature(ctx context.Context, code Code, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PutFeatureWithBody Create or update a feature
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with PUT /v1/billing/features/{code} (the `PutFeature` operationId).
	PutFeatureWithBody(ctx context.Context, code Code, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PutFeature Create or update a feature
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with PUT /v1/billing/features/{code} (the `PutFeature` operationId).
	PutFeature(ctx context.Context, code Code, body PutFeatureJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListInvoices List invoices
	//
	// Corresponds with GET /v1/billing/invoices (the `ListInvoices` operationId).
	ListInvoices(ctx context.Context, params *ListInvoicesParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetInvoice Get an invoice
	//
	// Corresponds with GET /v1/billing/invoices/{invoice} (the `GetInvoice` operationId).
	GetInvoice(ctx context.Context, invoice InvoiceId, reqEditors ...RequestEditorFn) (*http.Response, error)

	// StartCheckoutWithBody Start a payment through an installed app
	//
	// Opens a payment on one of the project's apps and returns the
	// gateway's page to send the payer to, `payer_url`. The reference is
	// your own and makes this safe to send again: the same reference
	// returns the first checkout, and one reused for another invoice,
	// amount or app is a 409. The amount defaults to what is still due,
	// and can't be more. Unless the project's payment settings allow
	// overlapping checkouts, a pending checkout holds its amount: the
	// default amount is what's left, and one that doesn't fit is a 409
	// naming the pending checkouts, so you can send the payer back to one.
	// Billing follows the payment itself and marks the
	// invoice paid once its payments cover it; read the checkout on your
	// return page to show the outcome. A checkout without `payer_url`
	// hasn't reached the gateway yet: send the same request again. While
	// the app's gateway refuses the project's settings, this is a 409
	// until they're updated.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /v1/billing/invoices/{invoice}/checkouts (the `StartCheckout` operationId).
	StartCheckoutWithBody(ctx context.Context, invoice InvoiceId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// StartCheckout Start a payment through an installed app
	//
	// Opens a payment on one of the project's apps and returns the
	// gateway's page to send the payer to, `payer_url`. The reference is
	// your own and makes this safe to send again: the same reference
	// returns the first checkout, and one reused for another invoice,
	// amount or app is a 409. The amount defaults to what is still due,
	// and can't be more. Unless the project's payment settings allow
	// overlapping checkouts, a pending checkout holds its amount: the
	// default amount is what's left, and one that doesn't fit is a 409
	// naming the pending checkouts, so you can send the payer back to one.
	// Billing follows the payment itself and marks the
	// invoice paid once its payments cover it; read the checkout on your
	// return page to show the outcome. A checkout without `payer_url`
	// hasn't reached the gateway yet: send the same request again. While
	// the app's gateway refuses the project's settings, this is a 409
	// until they're updated.
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /v1/billing/invoices/{invoice}/checkouts (the `StartCheckout` operationId).
	StartCheckout(ctx context.Context, invoice InvoiceId, body StartCheckoutJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListInvoiceCreditNotes List an invoice's credit notes
	//
	// Corresponds with GET /v1/billing/invoices/{invoice}/credit-notes (the `ListInvoiceCreditNotes` operationId).
	ListInvoiceCreditNotes(ctx context.Context, invoice InvoiceId, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateCreditNoteWithBody Take value off an issued invoice
	//
	// Credits the invoice, whole or in part, by amount or by line, with a
	// reason. What's still due comes off first; the rest goes back as
	// `return` says, as a refund or as credit off the customer's next
	// invoices, and needs money paid on the invoice to come from. A credit
	// note is final, and numbered in the project's one sequence. The
	// reference is your own and makes this safe to send again: the same
	// reference returns the first credit note, and one reused for a
	// different one is a 409. Once nothing is due, the invoice is marked
	// paid. A 503 after that means the credit note is recorded but the
	// invoice isn't yet marked paid; send the same request again.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /v1/billing/invoices/{invoice}/credit-notes (the `CreateCreditNote` operationId).
	CreateCreditNoteWithBody(ctx context.Context, invoice InvoiceId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateCreditNote Take value off an issued invoice
	//
	// Credits the invoice, whole or in part, by amount or by line, with a
	// reason. What's still due comes off first; the rest goes back as
	// `return` says, as a refund or as credit off the customer's next
	// invoices, and needs money paid on the invoice to come from. A credit
	// note is final, and numbered in the project's one sequence. The
	// reference is your own and makes this safe to send again: the same
	// reference returns the first credit note, and one reused for a
	// different one is a 409. Once nothing is due, the invoice is marked
	// paid. A 503 after that means the credit note is recorded but the
	// invoice isn't yet marked paid; send the same request again.
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /v1/billing/invoices/{invoice}/credit-notes (the `CreateCreditNote` operationId).
	CreateCreditNote(ctx context.Context, invoice InvoiceId, body CreateCreditNoteJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListPayments List the payments recorded against an invoice
	//
	// Corresponds with GET /v1/billing/invoices/{invoice}/payments (the `ListPayments` operationId).
	ListPayments(ctx context.Context, invoice InvoiceId, reqEditors ...RequestEditorFn) (*http.Response, error)

	// RecordPaymentWithBody Report a payment you collected yourself
	//
	// Records money you collected outside billing, by your own gateway, a
	// transfer or cash, against the invoice. The reference is your own and
	// makes this safe to send again: the same reference returns the first
	// payment, and a reference reused for a different payment is a 409. Once
	// the payments cover the invoice it is marked paid. A 503 after that
	// means the payment is recorded but the invoice is not yet marked paid;
	// send the same request again.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /v1/billing/invoices/{invoice}/payments (the `RecordPayment` operationId).
	RecordPaymentWithBody(ctx context.Context, invoice InvoiceId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// RecordPayment Report a payment you collected yourself
	//
	// Records money you collected outside billing, by your own gateway, a
	// transfer or cash, against the invoice. The reference is your own and
	// makes this safe to send again: the same reference returns the first
	// payment, and a reference reused for a different payment is a 409. Once
	// the payments cover the invoice it is marked paid. A 503 after that
	// means the payment is recorded but the invoice is not yet marked paid;
	// send the same request again.
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /v1/billing/invoices/{invoice}/payments (the `RecordPayment` operationId).
	RecordPayment(ctx context.Context, invoice InvoiceId, body RecordPaymentJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetInvoicePdf Download an invoice as a PDF
	//
	// The PDF is rendered on first request; until it is ready this answers 503 with Retry-After.
	//
	// Corresponds with GET /v1/billing/invoices/{invoice}/pdf (the `GetInvoicePdf` operationId).
	GetInvoicePdf(ctx context.Context, invoice InvoiceId, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListRefunds List an invoice's refunds
	//
	// Corresponds with GET /v1/billing/invoices/{invoice}/refunds (the `ListRefunds` operationId).
	ListRefunds(ctx context.Context, invoice InvoiceId, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateRefundWithBody Give money back on one of an invoice's payments
	//
	// Pays out a credit note's refund part, or gives back money paid twice.
	// Without `refunded_at`, billing refunds through the app the payment
	// was made on, and follows the refund until it has an outcome; a
	// refund made at the gateway's own dashboard for the same amount is
	// taken as this one instead of refunding again. With it, it records
	// money you gave back yourself, on a payment its app can't refund.
	// Billing never holds the money: it comes from your own gateway
	// account. The reference is your own and makes this safe to send
	// again: the same reference returns the first refund, and one reused
	// for a different refund is a 409.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /v1/billing/invoices/{invoice}/refunds (the `CreateRefund` operationId).
	CreateRefundWithBody(ctx context.Context, invoice InvoiceId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateRefund Give money back on one of an invoice's payments
	//
	// Pays out a credit note's refund part, or gives back money paid twice.
	// Without `refunded_at`, billing refunds through the app the payment
	// was made on, and follows the refund until it has an outcome; a
	// refund made at the gateway's own dashboard for the same amount is
	// taken as this one instead of refunding again. With it, it records
	// money you gave back yourself, on a payment its app can't refund.
	// Billing never holds the money: it comes from your own gateway
	// account. The reference is your own and makes this safe to send
	// again: the same reference returns the first refund, and one reused
	// for a different refund is a 409.
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /v1/billing/invoices/{invoice}/refunds (the `CreateRefund` operationId).
	CreateRefund(ctx context.Context, invoice InvoiceId, body CreateRefundJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetLock Whether unpaid invoices lock customers' features
	//
	// Corresponds with GET /v1/billing/lock (the `GetLock` operationId).
	GetLock(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PutLockWithBody Set whether unpaid invoices lock customers' features
	//
	// A change sends entitlements.updated for every customer with an active subscription.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with PUT /v1/billing/lock (the `PutLock` operationId).
	PutLockWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PutLock Set whether unpaid invoices lock customers' features
	//
	// A change sends entitlements.updated for every customer with an active subscription.
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with PUT /v1/billing/lock (the `PutLock` operationId).
	PutLock(ctx context.Context, body PutLockJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListMeters List meters
	//
	// Corresponds with GET /v1/billing/meters (the `ListMeters` operationId).
	ListMeters(ctx context.Context, params *ListMetersParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DeleteMeter Delete a meter, and every charge on it
	//
	// Corresponds with DELETE /v1/billing/meters/{code} (the `DeleteMeter` operationId).
	DeleteMeter(ctx context.Context, code Code, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetMeter Get a meter
	//
	// Corresponds with GET /v1/billing/meters/{code} (the `GetMeter` operationId).
	GetMeter(ctx context.Context, code Code, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PutMeterWithBody Create or update a meter
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with PUT /v1/billing/meters/{code} (the `PutMeter` operationId).
	PutMeterWithBody(ctx context.Context, code Code, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PutMeter Create or update a meter
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with PUT /v1/billing/meters/{code} (the `PutMeter` operationId).
	PutMeter(ctx context.Context, code Code, body PutMeterJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetPaymentSettings What a pending checkout holds
	//
	// Corresponds with GET /v1/billing/payment-settings (the `GetPaymentSettings` operationId).
	GetPaymentSettings(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PutPaymentSettingsWithBody Set what a pending checkout holds
	//
	// A change applies to checkouts started after it.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with PUT /v1/billing/payment-settings (the `PutPaymentSettings` operationId).
	PutPaymentSettingsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PutPaymentSettings Set what a pending checkout holds
	//
	// A change applies to checkouts started after it.
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with PUT /v1/billing/payment-settings (the `PutPaymentSettings` operationId).
	PutPaymentSettings(ctx context.Context, body PutPaymentSettingsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListPlans List plans
	//
	// Corresponds with GET /v1/billing/plans (the `ListPlans` operationId).
	ListPlans(ctx context.Context, params *ListPlansParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DeletePlan Delete a plan
	//
	// Refused (422) while a subscription is on the plan or waits to move to it, since its
	// features come from the plan.
	//
	// Corresponds with DELETE /v1/billing/plans/{code} (the `DeletePlan` operationId).
	DeletePlan(ctx context.Context, code Code, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetPlan Get a plan
	//
	// Corresponds with GET /v1/billing/plans/{code} (the `GetPlan` operationId).
	GetPlan(ctx context.Context, code Code, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PutPlanWithBody Create or update a plan
	//
	// The plan's charges and features become exactly the ones sent; one left out is removed.
	// A subscription keeps the prices its plan had when it subscribed, so a price change
	// reaches only subscriptions made or moved to the plan after it. A feature change reaches
	// every subscription to the plan at once.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with PUT /v1/billing/plans/{code} (the `PutPlan` operationId).
	PutPlanWithBody(ctx context.Context, code Code, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PutPlan Create or update a plan
	//
	// The plan's charges and features become exactly the ones sent; one left out is removed.
	// A subscription keeps the prices its plan had when it subscribed, so a price change
	// reaches only subscriptions made or moved to the plan after it. A feature change reaches
	// every subscription to the plan at once.
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with PUT /v1/billing/plans/{code} (the `PutPlan` operationId).
	PutPlan(ctx context.Context, code Code, body PutPlanJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateQuoteWithBody Price a new subscription, a seat change or a renewal, as of now
	//
	// Prices exactly one of subscription, seats and renewal: the lines billed at once, as the invoice will have them. Lines billed in arrears, coupons and credits aren't in it. The quote is kept until the end of its UTC day, since proration is by the day. A new subscription starts when the quote is accepted, so it takes no starts_at. A plan change on an existing subscription isn't quoted (422).
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /v1/billing/quotes (the `CreateQuote` operationId).
	CreateQuoteWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateQuote Price a new subscription, a seat change or a renewal, as of now
	//
	// Prices exactly one of subscription, seats and renewal: the lines billed at once, as the invoice will have them. Lines billed in arrears, coupons and credits aren't in it. The quote is kept until the end of its UTC day, since proration is by the day. A new subscription starts when the quote is accepted, so it takes no starts_at. A plan change on an existing subscription isn't quoted (422).
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /v1/billing/quotes (the `CreateQuote` operationId).
	CreateQuote(ctx context.Context, body CreateQuoteJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetQuote Get a quote
	//
	// Corresponds with GET /v1/billing/quotes/{quote} (the `GetQuote` operationId).
	GetQuote(ctx context.Context, quote QuoteId, reqEditors ...RequestEditorFn) (*http.Response, error)

	// AcceptQuote Make the quoted change at the quote's prices
	//
	// A new subscription is made from the plans as they were quoted, so its first invoice is the quote even if a plan changed since. With pay_first, it gives nothing until that invoice is paid. Accepting again returns the first acceptance, so it's safe to retry. An expired quote is refused (422): quote again. A renewal's quote can't be accepted (422).
	//
	// Corresponds with POST /v1/billing/quotes/{quote}/accept (the `AcceptQuote` operationId).
	AcceptQuote(ctx context.Context, quote QuoteId, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListSubscriptions List a customer's active and pending subscriptions
	//
	// Corresponds with GET /v1/billing/subscriptions (the `ListSubscriptions` operationId).
	ListSubscriptions(ctx context.Context, params *ListSubscriptionsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// TerminateSubscription End a subscription now and bill what is due
	//
	// Corresponds with DELETE /v1/billing/subscriptions/{id} (the `TerminateSubscription` operationId).
	TerminateSubscription(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetSubscription Get a subscription
	//
	// Corresponds with GET /v1/billing/subscriptions/{id} (the `GetSubscription` operationId).
	GetSubscription(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PutSubscriptionWithBody Create a subscription, or change its plan or seats
	//
	// A new ID creates the subscription. For an existing one, a different
	// plan moves it: an upgrade starts now, and a downgrade waits for the end
	// of the period, showing meanwhile as next_plan. Seats are set to the
	// number sent, so send the current count to leave them alone.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with PUT /v1/billing/subscriptions/{id} (the `PutSubscription` operationId).
	PutSubscriptionWithBody(ctx context.Context, id Id, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PutSubscription Create a subscription, or change its plan or seats
	//
	// A new ID creates the subscription. For an existing one, a different
	// plan moves it: an upgrade starts now, and a downgrade waits for the end
	// of the period, showing meanwhile as next_plan. Seats are set to the
	// number sent, so send the current count to leave them alone.
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with PUT /v1/billing/subscriptions/{id} (the `PutSubscription` operationId).
	PutSubscription(ctx context.Context, id Id, body PutSubscriptionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// SetSeatsWithBody Set the seats of the subscription's plan and its add-ons from now on
	//
	// Seats billed in advance bill an increase now, prorated, all on one invoice, and a decrease from the next period. Seats billed in arrears change now.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with PUT /v1/billing/subscriptions/{id}/seats (the `SetSeats` operationId).
	SetSeatsWithBody(ctx context.Context, id Id, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// SetSeats Set the seats of the subscription's plan and its add-ons from now on
	//
	// Seats billed in advance bill an increase now, prorated, all on one invoice, and a decrease from the next period. Seats billed in arrears change now.
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with PUT /v1/billing/subscriptions/{id}/seats (the `SetSeats` operationId).
	SetSeats(ctx context.Context, id Id, body SetSeatsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CancelUpgrade Take back an unpaid upgrade
	//
	// Voids the upgrade's invoice and puts the subscription back on its old plan, at the prices it was bought at, from the next period; its old plan, seats and add-ons apply to this period's end. Under the unpaid_upgrades setting revert, billing does this itself once the invoice is past due. 409 when the subscription has no unpaid upgrade, 503 until the upgrade's invoice is issued, and 422 for an upgrade that changed the plan's fee, which can't be taken back.
	//
	// Corresponds with POST /v1/billing/subscriptions/{id}/upgrade/cancel (the `CancelUpgrade` operationId).
	CancelUpgrade(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetSummary How the project bills, and what it invoiced lately
	//
	// The project's country, currency and when billing was turned on, and
	// the invoices issued since a date: how many, and their totals, one per
	// currency, since billing never converts. Voided invoices count for
	// neither.
	//
	// Corresponds with GET /v1/billing/summary (the `GetSummary` operationId).
	GetSummary(ctx context.Context, params *GetSummaryParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListWebhookEndpoints List the project's webhook endpoints
	//
	// Corresponds with GET /v1/billing/webhook-endpoints (the `ListWebhookEndpoints` operationId).
	ListWebhookEndpoints(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// AddWebhookEndpointWithBody Register a webhook endpoint
	//
	// Billing posts invoice.issued, invoice.paid, invoice.voided,
	// credit_note.created, refund.succeeded, refund.failed and
	// entitlements.updated events to it, signed per Standard Webhooks (https://www.standardwebhooks.com)
	// with the secret returned here, once. Anything but a 2xx is retried
	// with backoff for about three weeks; the same event keeps its
	// webhook-id across retries.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /v1/billing/webhook-endpoints (the `AddWebhookEndpoint` operationId).
	AddWebhookEndpointWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// AddWebhookEndpoint Register a webhook endpoint
	//
	// Billing posts invoice.issued, invoice.paid, invoice.voided,
	// credit_note.created, refund.succeeded, refund.failed and
	// entitlements.updated events to it, signed per Standard Webhooks (https://www.standardwebhooks.com)
	// with the secret returned here, once. Anything but a 2xx is retried
	// with backoff for about three weeks; the same event keeps its
	// webhook-id across retries.
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /v1/billing/webhook-endpoints (the `AddWebhookEndpoint` operationId).
	AddWebhookEndpoint(ctx context.Context, body AddWebhookEndpointJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// RemoveWebhookEndpoint Remove a webhook endpoint, and stop its pending deliveries
	//
	// Corresponds with DELETE /v1/billing/webhook-endpoints/{endpoint} (the `RemoveWebhookEndpoint` operationId).
	RemoveWebhookEndpoint(ctx context.Context, endpoint string, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientOption

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

func WithHTTPClient

func WithHTTPClient(doer HttpRequestDoer) ClientOption

WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.

func WithRequestEditorFn

func WithRequestEditorFn(fn RequestEditorFn) ClientOption

WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.

type ClientWithResponses

type ClientWithResponses struct {
	ClientInterface
}

ClientWithResponses builds on ClientInterface to offer response payloads

func NewClientWithResponses

func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)

NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling

func (*ClientWithResponses) AcceptQuoteWithResponse

func (c *ClientWithResponses) AcceptQuoteWithResponse(ctx context.Context, quote QuoteId, reqEditors ...RequestEditorFn) (*AcceptQuoteResponse, error)

AcceptQuoteWithResponse Make the quoted change at the quote's prices

A new subscription is made from the plans as they were quoted, so its first invoice is the quote even if a plan changed since. With pay_first, it gives nothing until that invoice is paid. Accepting again returns the first acceptance, so it's safe to retry. An expired quote is refused (422): quote again. A renewal's quote can't be accepted (422).

Returns a wrapper object for the known response body format(s).

Corresponds with POST /v1/billing/quotes/{quote}/accept (the `AcceptQuote` operationId).

func (*ClientWithResponses) AddWebhookEndpointWithBodyWithResponse

func (c *ClientWithResponses) AddWebhookEndpointWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddWebhookEndpointResponse, error)

AddWebhookEndpointWithBodyWithResponse Register a webhook endpoint

Billing posts invoice.issued, invoice.paid, invoice.voided, credit_note.created, refund.succeeded, refund.failed and entitlements.updated events to it, signed per Standard Webhooks (https://www.standardwebhooks.com) with the secret returned here, once. Anything but a 2xx is retried with backoff for about three weeks; the same event keeps its webhook-id across retries.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /v1/billing/webhook-endpoints (the `AddWebhookEndpoint` operationId).

func (*ClientWithResponses) AddWebhookEndpointWithResponse

func (c *ClientWithResponses) AddWebhookEndpointWithResponse(ctx context.Context, body AddWebhookEndpointJSONRequestBody, reqEditors ...RequestEditorFn) (*AddWebhookEndpointResponse, error)

AddWebhookEndpointWithResponse Register a webhook endpoint

Billing posts invoice.issued, invoice.paid, invoice.voided, credit_note.created, refund.succeeded, refund.failed and entitlements.updated events to it, signed per Standard Webhooks (https://www.standardwebhooks.com) with the secret returned here, once. Anything but a 2xx is retried with backoff for about three weeks; the same event keeps its webhook-id across retries.

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /v1/billing/webhook-endpoints (the `AddWebhookEndpoint` operationId).

func (*ClientWithResponses) ApplyCouponWithBodyWithResponse

func (c *ClientWithResponses) ApplyCouponWithBodyWithResponse(ctx context.Context, id Id, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApplyCouponResponse, error)

ApplyCouponWithBodyWithResponse Give the customer a coupon

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /v1/billing/customers/{id}/coupons (the `ApplyCoupon` operationId).

func (*ClientWithResponses) ApplyCouponWithResponse

func (c *ClientWithResponses) ApplyCouponWithResponse(ctx context.Context, id Id, body ApplyCouponJSONRequestBody, reqEditors ...RequestEditorFn) (*ApplyCouponResponse, error)

ApplyCouponWithResponse Give the customer a coupon

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /v1/billing/customers/{id}/coupons (the `ApplyCoupon` operationId).

func (*ClientWithResponses) CancelCheckoutWithResponse

func (c *ClientWithResponses) CancelCheckoutWithResponse(ctx context.Context, checkout openapi_types.UUID, reqEditors ...RequestEditorFn) (*CancelCheckoutResponse, error)

CancelCheckoutWithResponse Cancel a checkout the payer hasn't finished

Stops the payment at its gateway, so it can no longer be paid and stops holding its invoice: start another for the payer who gave up on the gateway's page. Cancelling one cancelled already returns it. A checkout with an outcome, or one its gateway is processing or has paid, is a 409. Billing also cancels checkouts itself once money recorded on their invoice leaves no room for them.

Returns a wrapper object for the known response body format(s).

Corresponds with POST /v1/billing/checkouts/{checkout}/cancel (the `CancelCheckout` operationId).

func (*ClientWithResponses) CancelUpgradeWithResponse

func (c *ClientWithResponses) CancelUpgradeWithResponse(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*CancelUpgradeResponse, error)

CancelUpgradeWithResponse Take back an unpaid upgrade

Voids the upgrade's invoice and puts the subscription back on its old plan, at the prices it was bought at, from the next period; its old plan, seats and add-ons apply to this period's end. Under the unpaid_upgrades setting revert, billing does this itself once the invoice is past due. 409 when the subscription has no unpaid upgrade, 503 until the upgrade's invoice is issued, and 422 for an upgrade that changed the plan's fee, which can't be taken back.

Returns a wrapper object for the known response body format(s).

Corresponds with POST /v1/billing/subscriptions/{id}/upgrade/cancel (the `CancelUpgrade` operationId).

func (*ClientWithResponses) CreateCreditNoteWithBodyWithResponse

func (c *ClientWithResponses) CreateCreditNoteWithBodyWithResponse(ctx context.Context, invoice InvoiceId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateCreditNoteResponse, error)

CreateCreditNoteWithBodyWithResponse Take value off an issued invoice

Credits the invoice, whole or in part, by amount or by line, with a reason. What's still due comes off first; the rest goes back as `return` says, as a refund or as credit off the customer's next invoices, and needs money paid on the invoice to come from. A credit note is final, and numbered in the project's one sequence. The reference is your own and makes this safe to send again: the same reference returns the first credit note, and one reused for a different one is a 409. Once nothing is due, the invoice is marked paid. A 503 after that means the credit note is recorded but the invoice isn't yet marked paid; send the same request again.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /v1/billing/invoices/{invoice}/credit-notes (the `CreateCreditNote` operationId).

func (*ClientWithResponses) CreateCreditNoteWithResponse

func (c *ClientWithResponses) CreateCreditNoteWithResponse(ctx context.Context, invoice InvoiceId, body CreateCreditNoteJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateCreditNoteResponse, error)

CreateCreditNoteWithResponse Take value off an issued invoice

Credits the invoice, whole or in part, by amount or by line, with a reason. What's still due comes off first; the rest goes back as `return` says, as a refund or as credit off the customer's next invoices, and needs money paid on the invoice to come from. A credit note is final, and numbered in the project's one sequence. The reference is your own and makes this safe to send again: the same reference returns the first credit note, and one reused for a different one is a 409. Once nothing is due, the invoice is marked paid. A 503 after that means the credit note is recorded but the invoice isn't yet marked paid; send the same request again.

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /v1/billing/invoices/{invoice}/credit-notes (the `CreateCreditNote` operationId).

func (*ClientWithResponses) CreateQuoteWithBodyWithResponse

func (c *ClientWithResponses) CreateQuoteWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateQuoteResponse, error)

CreateQuoteWithBodyWithResponse Price a new subscription, a seat change or a renewal, as of now

Prices exactly one of subscription, seats and renewal: the lines billed at once, as the invoice will have them. Lines billed in arrears, coupons and credits aren't in it. The quote is kept until the end of its UTC day, since proration is by the day. A new subscription starts when the quote is accepted, so it takes no starts_at. A plan change on an existing subscription isn't quoted (422).

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /v1/billing/quotes (the `CreateQuote` operationId).

func (*ClientWithResponses) CreateQuoteWithResponse

func (c *ClientWithResponses) CreateQuoteWithResponse(ctx context.Context, body CreateQuoteJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateQuoteResponse, error)

CreateQuoteWithResponse Price a new subscription, a seat change or a renewal, as of now

Prices exactly one of subscription, seats and renewal: the lines billed at once, as the invoice will have them. Lines billed in arrears, coupons and credits aren't in it. The quote is kept until the end of its UTC day, since proration is by the day. A new subscription starts when the quote is accepted, so it takes no starts_at. A plan change on an existing subscription isn't quoted (422).

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /v1/billing/quotes (the `CreateQuote` operationId).

func (*ClientWithResponses) CreateRefundWithBodyWithResponse

func (c *ClientWithResponses) CreateRefundWithBodyWithResponse(ctx context.Context, invoice InvoiceId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateRefundResponse, error)

CreateRefundWithBodyWithResponse Give money back on one of an invoice's payments

Pays out a credit note's refund part, or gives back money paid twice. Without `refunded_at`, billing refunds through the app the payment was made on, and follows the refund until it has an outcome; a refund made at the gateway's own dashboard for the same amount is taken as this one instead of refunding again. With it, it records money you gave back yourself, on a payment its app can't refund. Billing never holds the money: it comes from your own gateway account. The reference is your own and makes this safe to send again: the same reference returns the first refund, and one reused for a different refund is a 409.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /v1/billing/invoices/{invoice}/refunds (the `CreateRefund` operationId).

func (*ClientWithResponses) CreateRefundWithResponse

func (c *ClientWithResponses) CreateRefundWithResponse(ctx context.Context, invoice InvoiceId, body CreateRefundJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateRefundResponse, error)

CreateRefundWithResponse Give money back on one of an invoice's payments

Pays out a credit note's refund part, or gives back money paid twice. Without `refunded_at`, billing refunds through the app the payment was made on, and follows the refund until it has an outcome; a refund made at the gateway's own dashboard for the same amount is taken as this one instead of refunding again. With it, it records money you gave back yourself, on a payment its app can't refund. Billing never holds the money: it comes from your own gateway account. The reference is your own and makes this safe to send again: the same reference returns the first refund, and one reused for a different refund is a 409.

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /v1/billing/invoices/{invoice}/refunds (the `CreateRefund` operationId).

func (*ClientWithResponses) DeleteCouponWithResponse

func (c *ClientWithResponses) DeleteCouponWithResponse(ctx context.Context, code Code, reqEditors ...RequestEditorFn) (*DeleteCouponResponse, error)

DeleteCouponWithResponse Delete a coupon. Customers who already have it keep it.

Returns a wrapper object for the known response body format(s).

Corresponds with DELETE /v1/billing/coupons/{code} (the `DeleteCoupon` operationId).

func (*ClientWithResponses) DeleteFeatureWithResponse

func (c *ClientWithResponses) DeleteFeatureWithResponse(ctx context.Context, code Code, reqEditors ...RequestEditorFn) (*DeleteFeatureResponse, error)

DeleteFeatureWithResponse Delete a feature, and remove it from every plan

Returns a wrapper object for the known response body format(s).

Corresponds with DELETE /v1/billing/features/{code} (the `DeleteFeature` operationId).

func (*ClientWithResponses) DeleteMeterWithResponse

func (c *ClientWithResponses) DeleteMeterWithResponse(ctx context.Context, code Code, reqEditors ...RequestEditorFn) (*DeleteMeterResponse, error)

DeleteMeterWithResponse Delete a meter, and every charge on it

Returns a wrapper object for the known response body format(s).

Corresponds with DELETE /v1/billing/meters/{code} (the `DeleteMeter` operationId).

func (*ClientWithResponses) DeletePlanWithResponse

func (c *ClientWithResponses) DeletePlanWithResponse(ctx context.Context, code Code, reqEditors ...RequestEditorFn) (*DeletePlanResponse, error)

DeletePlanWithResponse Delete a plan

Refused (422) while a subscription is on the plan or waits to move to it, since its features come from the plan.

Returns a wrapper object for the known response body format(s).

Corresponds with DELETE /v1/billing/plans/{code} (the `DeletePlan` operationId).

func (*ClientWithResponses) GetCheckoutWithResponse

func (c *ClientWithResponses) GetCheckoutWithResponse(ctx context.Context, checkout openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetCheckoutResponse, error)

GetCheckoutWithResponse Get a checkout, to show its outcome

Returns a wrapper object for the known response body format(s).

Corresponds with GET /v1/billing/checkouts/{checkout} (the `GetCheckout` operationId).

func (*ClientWithResponses) GetCreditNoteWithResponse

func (c *ClientWithResponses) GetCreditNoteWithResponse(ctx context.Context, creditNote CreditNoteId, reqEditors ...RequestEditorFn) (*GetCreditNoteResponse, error)

GetCreditNoteWithResponse Get a credit note

Returns a wrapper object for the known response body format(s).

Corresponds with GET /v1/billing/credit-notes/{credit_note} (the `GetCreditNote` operationId).

func (*ClientWithResponses) GetCustomerWithResponse

func (c *ClientWithResponses) GetCustomerWithResponse(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*GetCustomerResponse, error)

GetCustomerWithResponse Get a customer

Returns a wrapper object for the known response body format(s).

Corresponds with GET /v1/billing/customers/{id} (the `GetCustomer` operationId).

func (*ClientWithResponses) GetEntitlementsWithResponse

func (c *ClientWithResponses) GetEntitlementsWithResponse(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*GetEntitlementsResponse, error)

GetEntitlementsWithResponse What the customer may use now

The features of every plan the customer holds an active subscription to. Keep your own copy and gate on it; don't call this on each of your requests.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /v1/billing/customers/{id}/entitlements (the `GetEntitlements` operationId).

func (*ClientWithResponses) GetInvoicePdfWithResponse

func (c *ClientWithResponses) GetInvoicePdfWithResponse(ctx context.Context, invoice InvoiceId, reqEditors ...RequestEditorFn) (*GetInvoicePdfResponse, error)

GetInvoicePdfWithResponse Download an invoice as a PDF

The PDF is rendered on first request; until it is ready this answers 503 with Retry-After.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /v1/billing/invoices/{invoice}/pdf (the `GetInvoicePdf` operationId).

func (*ClientWithResponses) GetInvoiceWithResponse

func (c *ClientWithResponses) GetInvoiceWithResponse(ctx context.Context, invoice InvoiceId, reqEditors ...RequestEditorFn) (*GetInvoiceResponse, error)

GetInvoiceWithResponse Get an invoice

Returns a wrapper object for the known response body format(s).

Corresponds with GET /v1/billing/invoices/{invoice} (the `GetInvoice` operationId).

func (*ClientWithResponses) GetLockWithResponse

func (c *ClientWithResponses) GetLockWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetLockResponse, error)

GetLockWithResponse Whether unpaid invoices lock customers' features

Returns a wrapper object for the known response body format(s).

Corresponds with GET /v1/billing/lock (the `GetLock` operationId).

func (*ClientWithResponses) GetMeterWithResponse

func (c *ClientWithResponses) GetMeterWithResponse(ctx context.Context, code Code, reqEditors ...RequestEditorFn) (*GetMeterResponse, error)

GetMeterWithResponse Get a meter

Returns a wrapper object for the known response body format(s).

Corresponds with GET /v1/billing/meters/{code} (the `GetMeter` operationId).

func (*ClientWithResponses) GetPaymentSettingsWithResponse

func (c *ClientWithResponses) GetPaymentSettingsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetPaymentSettingsResponse, error)

GetPaymentSettingsWithResponse What a pending checkout holds

Returns a wrapper object for the known response body format(s).

Corresponds with GET /v1/billing/payment-settings (the `GetPaymentSettings` operationId).

func (*ClientWithResponses) GetPlanWithResponse

func (c *ClientWithResponses) GetPlanWithResponse(ctx context.Context, code Code, reqEditors ...RequestEditorFn) (*GetPlanResponse, error)

GetPlanWithResponse Get a plan

Returns a wrapper object for the known response body format(s).

Corresponds with GET /v1/billing/plans/{code} (the `GetPlan` operationId).

func (*ClientWithResponses) GetQuoteWithResponse

func (c *ClientWithResponses) GetQuoteWithResponse(ctx context.Context, quote QuoteId, reqEditors ...RequestEditorFn) (*GetQuoteResponse, error)

GetQuoteWithResponse Get a quote

Returns a wrapper object for the known response body format(s).

Corresponds with GET /v1/billing/quotes/{quote} (the `GetQuote` operationId).

func (*ClientWithResponses) GetSubscriptionWithResponse

func (c *ClientWithResponses) GetSubscriptionWithResponse(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*GetSubscriptionResponse, error)

GetSubscriptionWithResponse Get a subscription

Returns a wrapper object for the known response body format(s).

Corresponds with GET /v1/billing/subscriptions/{id} (the `GetSubscription` operationId).

func (*ClientWithResponses) GetSummaryWithResponse

func (c *ClientWithResponses) GetSummaryWithResponse(ctx context.Context, params *GetSummaryParams, reqEditors ...RequestEditorFn) (*GetSummaryResponse, error)

GetSummaryWithResponse How the project bills, and what it invoiced lately

The project's country, currency and when billing was turned on, and the invoices issued since a date: how many, and their totals, one per currency, since billing never converts. Voided invoices count for neither.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /v1/billing/summary (the `GetSummary` operationId).

func (*ClientWithResponses) ListAppsWithResponse

func (c *ClientWithResponses) ListAppsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListAppsResponse, error)

ListAppsWithResponse List the payment apps a project can install, with its installs

Returns a wrapper object for the known response body format(s).

Corresponds with GET /v1/billing/apps (the `ListApps` operationId).

func (*ClientWithResponses) ListCouponsWithResponse

func (c *ClientWithResponses) ListCouponsWithResponse(ctx context.Context, params *ListCouponsParams, reqEditors ...RequestEditorFn) (*ListCouponsResponse, error)

ListCouponsWithResponse List coupons

Returns a wrapper object for the known response body format(s).

Corresponds with GET /v1/billing/coupons (the `ListCoupons` operationId).

func (*ClientWithResponses) ListCreditNotesWithResponse

func (c *ClientWithResponses) ListCreditNotesWithResponse(ctx context.Context, params *ListCreditNotesParams, reqEditors ...RequestEditorFn) (*ListCreditNotesResponse, error)

ListCreditNotesWithResponse List the project's credit notes

Returns a wrapper object for the known response body format(s).

Corresponds with GET /v1/billing/credit-notes (the `ListCreditNotes` operationId).

func (*ClientWithResponses) ListCustomersWithResponse

func (c *ClientWithResponses) ListCustomersWithResponse(ctx context.Context, params *ListCustomersParams, reqEditors ...RequestEditorFn) (*ListCustomersResponse, error)

ListCustomersWithResponse List customers

Returns a wrapper object for the known response body format(s).

Corresponds with GET /v1/billing/customers (the `ListCustomers` operationId).

func (*ClientWithResponses) ListFeaturesWithResponse

func (c *ClientWithResponses) ListFeaturesWithResponse(ctx context.Context, params *ListFeaturesParams, reqEditors ...RequestEditorFn) (*ListFeaturesResponse, error)

ListFeaturesWithResponse List features

Returns a wrapper object for the known response body format(s).

Corresponds with GET /v1/billing/features (the `ListFeatures` operationId).

func (*ClientWithResponses) ListInvoiceCreditNotesWithResponse

func (c *ClientWithResponses) ListInvoiceCreditNotesWithResponse(ctx context.Context, invoice InvoiceId, reqEditors ...RequestEditorFn) (*ListInvoiceCreditNotesResponse, error)

ListInvoiceCreditNotesWithResponse List an invoice's credit notes

Returns a wrapper object for the known response body format(s).

Corresponds with GET /v1/billing/invoices/{invoice}/credit-notes (the `ListInvoiceCreditNotes` operationId).

func (*ClientWithResponses) ListInvoicesWithResponse

func (c *ClientWithResponses) ListInvoicesWithResponse(ctx context.Context, params *ListInvoicesParams, reqEditors ...RequestEditorFn) (*ListInvoicesResponse, error)

ListInvoicesWithResponse List invoices

Returns a wrapper object for the known response body format(s).

Corresponds with GET /v1/billing/invoices (the `ListInvoices` operationId).

func (*ClientWithResponses) ListMetersWithResponse

func (c *ClientWithResponses) ListMetersWithResponse(ctx context.Context, params *ListMetersParams, reqEditors ...RequestEditorFn) (*ListMetersResponse, error)

ListMetersWithResponse List meters

Returns a wrapper object for the known response body format(s).

Corresponds with GET /v1/billing/meters (the `ListMeters` operationId).

func (*ClientWithResponses) ListPaymentsWithResponse

func (c *ClientWithResponses) ListPaymentsWithResponse(ctx context.Context, invoice InvoiceId, reqEditors ...RequestEditorFn) (*ListPaymentsResponse, error)

ListPaymentsWithResponse List the payments recorded against an invoice

Returns a wrapper object for the known response body format(s).

Corresponds with GET /v1/billing/invoices/{invoice}/payments (the `ListPayments` operationId).

func (*ClientWithResponses) ListPlansWithResponse

func (c *ClientWithResponses) ListPlansWithResponse(ctx context.Context, params *ListPlansParams, reqEditors ...RequestEditorFn) (*ListPlansResponse, error)

ListPlansWithResponse List plans

Returns a wrapper object for the known response body format(s).

Corresponds with GET /v1/billing/plans (the `ListPlans` operationId).

func (*ClientWithResponses) ListRefundsWithResponse

func (c *ClientWithResponses) ListRefundsWithResponse(ctx context.Context, invoice InvoiceId, reqEditors ...RequestEditorFn) (*ListRefundsResponse, error)

ListRefundsWithResponse List an invoice's refunds

Returns a wrapper object for the known response body format(s).

Corresponds with GET /v1/billing/invoices/{invoice}/refunds (the `ListRefunds` operationId).

func (*ClientWithResponses) ListSubscriptionsWithResponse

func (c *ClientWithResponses) ListSubscriptionsWithResponse(ctx context.Context, params *ListSubscriptionsParams, reqEditors ...RequestEditorFn) (*ListSubscriptionsResponse, error)

ListSubscriptionsWithResponse List a customer's active and pending subscriptions

Returns a wrapper object for the known response body format(s).

Corresponds with GET /v1/billing/subscriptions (the `ListSubscriptions` operationId).

func (*ClientWithResponses) ListWebhookEndpointsWithResponse

func (c *ClientWithResponses) ListWebhookEndpointsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListWebhookEndpointsResponse, error)

ListWebhookEndpointsWithResponse List the project's webhook endpoints

Returns a wrapper object for the known response body format(s).

Corresponds with GET /v1/billing/webhook-endpoints (the `ListWebhookEndpoints` operationId).

func (*ClientWithResponses) PutAppForwardWithBodyWithResponse

func (c *ClientWithResponses) PutAppForwardWithBodyWithResponse(ctx context.Context, app AppId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutAppForwardResponse, error)

PutAppForwardWithBodyWithResponse Set where your own notifications from the gateway go

For an app whose gateway has one notification address per merchant (`forwards` is true), billing posts each notification that isn't about one of its own payments to this URL, as received, with `Edgescale-Forwarded: billing` added. Anything but a 2xx is retried for about three weeks. An empty URL stops forwarding.

Only a notification whose gateway signature checks out is forwarded, and a replay of one only once a day, so the app's signing setting comes first: for Qi, its public key. Setting a URL without it is a 409. One that doesn't check out is answered 400, so the gateway sends a real one again.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with PUT /v1/billing/apps/{app}/forward (the `PutAppForward` operationId).

func (*ClientWithResponses) PutAppForwardWithResponse

func (c *ClientWithResponses) PutAppForwardWithResponse(ctx context.Context, app AppId, body PutAppForwardJSONRequestBody, reqEditors ...RequestEditorFn) (*PutAppForwardResponse, error)

PutAppForwardWithResponse Set where your own notifications from the gateway go

For an app whose gateway has one notification address per merchant (`forwards` is true), billing posts each notification that isn't about one of its own payments to this URL, as received, with `Edgescale-Forwarded: billing` added. Anything but a 2xx is retried for about three weeks. An empty URL stops forwarding.

Only a notification whose gateway signature checks out is forwarded, and a replay of one only once a day, so the app's signing setting comes first: for Qi, its public key. Setting a URL without it is a 409. One that doesn't check out is answered 400, so the gateway sends a real one again.

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with PUT /v1/billing/apps/{app}/forward (the `PutAppForward` operationId).

func (*ClientWithResponses) PutCouponWithBodyWithResponse

func (c *ClientWithResponses) PutCouponWithBodyWithResponse(ctx context.Context, code Code, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutCouponResponse, error)

PutCouponWithBodyWithResponse Create or update a coupon

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with PUT /v1/billing/coupons/{code} (the `PutCoupon` operationId).

func (*ClientWithResponses) PutCouponWithResponse

func (c *ClientWithResponses) PutCouponWithResponse(ctx context.Context, code Code, body PutCouponJSONRequestBody, reqEditors ...RequestEditorFn) (*PutCouponResponse, error)

PutCouponWithResponse Create or update a coupon

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with PUT /v1/billing/coupons/{code} (the `PutCoupon` operationId).

func (*ClientWithResponses) PutCustomerWithBodyWithResponse

func (c *ClientWithResponses) PutCustomerWithBodyWithResponse(ctx context.Context, id Id, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutCustomerResponse, error)

PutCustomerWithBodyWithResponse Create or update a customer, under your own ID for it

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with PUT /v1/billing/customers/{id} (the `PutCustomer` operationId).

func (*ClientWithResponses) PutCustomerWithResponse

func (c *ClientWithResponses) PutCustomerWithResponse(ctx context.Context, id Id, body PutCustomerJSONRequestBody, reqEditors ...RequestEditorFn) (*PutCustomerResponse, error)

PutCustomerWithResponse Create or update a customer, under your own ID for it

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with PUT /v1/billing/customers/{id} (the `PutCustomer` operationId).

func (*ClientWithResponses) PutFeatureWithBodyWithResponse

func (c *ClientWithResponses) PutFeatureWithBodyWithResponse(ctx context.Context, code Code, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutFeatureResponse, error)

PutFeatureWithBodyWithResponse Create or update a feature

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with PUT /v1/billing/features/{code} (the `PutFeature` operationId).

func (*ClientWithResponses) PutFeatureWithResponse

func (c *ClientWithResponses) PutFeatureWithResponse(ctx context.Context, code Code, body PutFeatureJSONRequestBody, reqEditors ...RequestEditorFn) (*PutFeatureResponse, error)

PutFeatureWithResponse Create or update a feature

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with PUT /v1/billing/features/{code} (the `PutFeature` operationId).

func (*ClientWithResponses) PutLockWithBodyWithResponse

func (c *ClientWithResponses) PutLockWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutLockResponse, error)

PutLockWithBodyWithResponse Set whether unpaid invoices lock customers' features

A change sends entitlements.updated for every customer with an active subscription.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with PUT /v1/billing/lock (the `PutLock` operationId).

func (*ClientWithResponses) PutLockWithResponse

func (c *ClientWithResponses) PutLockWithResponse(ctx context.Context, body PutLockJSONRequestBody, reqEditors ...RequestEditorFn) (*PutLockResponse, error)

PutLockWithResponse Set whether unpaid invoices lock customers' features

A change sends entitlements.updated for every customer with an active subscription.

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with PUT /v1/billing/lock (the `PutLock` operationId).

func (*ClientWithResponses) PutMeterWithBodyWithResponse

func (c *ClientWithResponses) PutMeterWithBodyWithResponse(ctx context.Context, code Code, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutMeterResponse, error)

PutMeterWithBodyWithResponse Create or update a meter

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with PUT /v1/billing/meters/{code} (the `PutMeter` operationId).

func (*ClientWithResponses) PutMeterWithResponse

func (c *ClientWithResponses) PutMeterWithResponse(ctx context.Context, code Code, body PutMeterJSONRequestBody, reqEditors ...RequestEditorFn) (*PutMeterResponse, error)

PutMeterWithResponse Create or update a meter

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with PUT /v1/billing/meters/{code} (the `PutMeter` operationId).

func (*ClientWithResponses) PutPaymentSettingsWithBodyWithResponse

func (c *ClientWithResponses) PutPaymentSettingsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutPaymentSettingsResponse, error)

PutPaymentSettingsWithBodyWithResponse Set what a pending checkout holds

A change applies to checkouts started after it.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with PUT /v1/billing/payment-settings (the `PutPaymentSettings` operationId).

func (*ClientWithResponses) PutPaymentSettingsWithResponse

func (c *ClientWithResponses) PutPaymentSettingsWithResponse(ctx context.Context, body PutPaymentSettingsJSONRequestBody, reqEditors ...RequestEditorFn) (*PutPaymentSettingsResponse, error)

PutPaymentSettingsWithResponse Set what a pending checkout holds

A change applies to checkouts started after it.

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with PUT /v1/billing/payment-settings (the `PutPaymentSettings` operationId).

func (*ClientWithResponses) PutPlanWithBodyWithResponse

func (c *ClientWithResponses) PutPlanWithBodyWithResponse(ctx context.Context, code Code, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutPlanResponse, error)

PutPlanWithBodyWithResponse Create or update a plan

The plan's charges and features become exactly the ones sent; one left out is removed. A subscription keeps the prices its plan had when it subscribed, so a price change reaches only subscriptions made or moved to the plan after it. A feature change reaches every subscription to the plan at once.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with PUT /v1/billing/plans/{code} (the `PutPlan` operationId).

func (*ClientWithResponses) PutPlanWithResponse

func (c *ClientWithResponses) PutPlanWithResponse(ctx context.Context, code Code, body PutPlanJSONRequestBody, reqEditors ...RequestEditorFn) (*PutPlanResponse, error)

PutPlanWithResponse Create or update a plan

The plan's charges and features become exactly the ones sent; one left out is removed. A subscription keeps the prices its plan had when it subscribed, so a price change reaches only subscriptions made or moved to the plan after it. A feature change reaches every subscription to the plan at once.

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with PUT /v1/billing/plans/{code} (the `PutPlan` operationId).

func (*ClientWithResponses) PutSubscriptionWithBodyWithResponse

func (c *ClientWithResponses) PutSubscriptionWithBodyWithResponse(ctx context.Context, id Id, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutSubscriptionResponse, error)

PutSubscriptionWithBodyWithResponse Create a subscription, or change its plan or seats

A new ID creates the subscription. For an existing one, a different plan moves it: an upgrade starts now, and a downgrade waits for the end of the period, showing meanwhile as next_plan. Seats are set to the number sent, so send the current count to leave them alone.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with PUT /v1/billing/subscriptions/{id} (the `PutSubscription` operationId).

func (*ClientWithResponses) PutSubscriptionWithResponse

func (c *ClientWithResponses) PutSubscriptionWithResponse(ctx context.Context, id Id, body PutSubscriptionJSONRequestBody, reqEditors ...RequestEditorFn) (*PutSubscriptionResponse, error)

PutSubscriptionWithResponse Create a subscription, or change its plan or seats

A new ID creates the subscription. For an existing one, a different plan moves it: an upgrade starts now, and a downgrade waits for the end of the period, showing meanwhile as next_plan. Seats are set to the number sent, so send the current count to leave them alone.

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with PUT /v1/billing/subscriptions/{id} (the `PutSubscription` operationId).

func (*ClientWithResponses) RecordEventsWithBodyWithResponse

func (c *ClientWithResponses) RecordEventsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RecordEventsResponse, error)

RecordEventsWithBodyWithResponse Report usage

Up to 100 events at a time. An event whose id was recorded before is skipped, so a batch can be sent again safely.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /v1/billing/events (the `RecordEvents` operationId).

func (*ClientWithResponses) RecordEventsWithResponse

func (c *ClientWithResponses) RecordEventsWithResponse(ctx context.Context, body RecordEventsJSONRequestBody, reqEditors ...RequestEditorFn) (*RecordEventsResponse, error)

RecordEventsWithResponse Report usage

Up to 100 events at a time. An event whose id was recorded before is skipped, so a batch can be sent again safely.

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /v1/billing/events (the `RecordEvents` operationId).

func (*ClientWithResponses) RecordPaymentWithBodyWithResponse

func (c *ClientWithResponses) RecordPaymentWithBodyWithResponse(ctx context.Context, invoice InvoiceId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RecordPaymentResponse, error)

RecordPaymentWithBodyWithResponse Report a payment you collected yourself

Records money you collected outside billing, by your own gateway, a transfer or cash, against the invoice. The reference is your own and makes this safe to send again: the same reference returns the first payment, and a reference reused for a different payment is a 409. Once the payments cover the invoice it is marked paid. A 503 after that means the payment is recorded but the invoice is not yet marked paid; send the same request again.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /v1/billing/invoices/{invoice}/payments (the `RecordPayment` operationId).

func (*ClientWithResponses) RecordPaymentWithResponse

func (c *ClientWithResponses) RecordPaymentWithResponse(ctx context.Context, invoice InvoiceId, body RecordPaymentJSONRequestBody, reqEditors ...RequestEditorFn) (*RecordPaymentResponse, error)

RecordPaymentWithResponse Report a payment you collected yourself

Records money you collected outside billing, by your own gateway, a transfer or cash, against the invoice. The reference is your own and makes this safe to send again: the same reference returns the first payment, and a reference reused for a different payment is a 409. Once the payments cover the invoice it is marked paid. A 503 after that means the payment is recorded but the invoice is not yet marked paid; send the same request again.

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /v1/billing/invoices/{invoice}/payments (the `RecordPayment` operationId).

func (*ClientWithResponses) RemoveWebhookEndpointWithResponse

func (c *ClientWithResponses) RemoveWebhookEndpointWithResponse(ctx context.Context, endpoint string, reqEditors ...RequestEditorFn) (*RemoveWebhookEndpointResponse, error)

RemoveWebhookEndpointWithResponse Remove a webhook endpoint, and stop its pending deliveries

Returns a wrapper object for the known response body format(s).

Corresponds with DELETE /v1/billing/webhook-endpoints/{endpoint} (the `RemoveWebhookEndpoint` operationId).

func (*ClientWithResponses) SetSeatsWithBodyWithResponse

func (c *ClientWithResponses) SetSeatsWithBodyWithResponse(ctx context.Context, id Id, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetSeatsResponse, error)

SetSeatsWithBodyWithResponse Set the seats of the subscription's plan and its add-ons from now on

Seats billed in advance bill an increase now, prorated, all on one invoice, and a decrease from the next period. Seats billed in arrears change now.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with PUT /v1/billing/subscriptions/{id}/seats (the `SetSeats` operationId).

func (*ClientWithResponses) SetSeatsWithResponse

func (c *ClientWithResponses) SetSeatsWithResponse(ctx context.Context, id Id, body SetSeatsJSONRequestBody, reqEditors ...RequestEditorFn) (*SetSeatsResponse, error)

SetSeatsWithResponse Set the seats of the subscription's plan and its add-ons from now on

Seats billed in advance bill an increase now, prorated, all on one invoice, and a decrease from the next period. Seats billed in arrears change now.

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with PUT /v1/billing/subscriptions/{id}/seats (the `SetSeats` operationId).

func (*ClientWithResponses) StartCheckoutWithBodyWithResponse

func (c *ClientWithResponses) StartCheckoutWithBodyWithResponse(ctx context.Context, invoice InvoiceId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*StartCheckoutResponse, error)

StartCheckoutWithBodyWithResponse Start a payment through an installed app

Opens a payment on one of the project's apps and returns the gateway's page to send the payer to, `payer_url`. The reference is your own and makes this safe to send again: the same reference returns the first checkout, and one reused for another invoice, amount or app is a 409. The amount defaults to what is still due, and can't be more. Unless the project's payment settings allow overlapping checkouts, a pending checkout holds its amount: the default amount is what's left, and one that doesn't fit is a 409 naming the pending checkouts, so you can send the payer back to one. Billing follows the payment itself and marks the invoice paid once its payments cover it; read the checkout on your return page to show the outcome. A checkout without `payer_url` hasn't reached the gateway yet: send the same request again. While the app's gateway refuses the project's settings, this is a 409 until they're updated.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /v1/billing/invoices/{invoice}/checkouts (the `StartCheckout` operationId).

func (*ClientWithResponses) StartCheckoutWithResponse

func (c *ClientWithResponses) StartCheckoutWithResponse(ctx context.Context, invoice InvoiceId, body StartCheckoutJSONRequestBody, reqEditors ...RequestEditorFn) (*StartCheckoutResponse, error)

StartCheckoutWithResponse Start a payment through an installed app

Opens a payment on one of the project's apps and returns the gateway's page to send the payer to, `payer_url`. The reference is your own and makes this safe to send again: the same reference returns the first checkout, and one reused for another invoice, amount or app is a 409. The amount defaults to what is still due, and can't be more. Unless the project's payment settings allow overlapping checkouts, a pending checkout holds its amount: the default amount is what's left, and one that doesn't fit is a 409 naming the pending checkouts, so you can send the payer back to one. Billing follows the payment itself and marks the invoice paid once its payments cover it; read the checkout on your return page to show the outcome. A checkout without `payer_url` hasn't reached the gateway yet: send the same request again. While the app's gateway refuses the project's settings, this is a 409 until they're updated.

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /v1/billing/invoices/{invoice}/checkouts (the `StartCheckout` operationId).

func (*ClientWithResponses) TerminateSubscriptionWithResponse

func (c *ClientWithResponses) TerminateSubscriptionWithResponse(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*TerminateSubscriptionResponse, error)

TerminateSubscriptionWithResponse End a subscription now and bill what is due

Returns a wrapper object for the known response body format(s).

Corresponds with DELETE /v1/billing/subscriptions/{id} (the `TerminateSubscription` operationId).

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {

	// ListAppsWithResponse List the payment apps a project can install, with its installs
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/billing/apps (the `ListApps` operationId).
	ListAppsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListAppsResponse, error)

	// PutAppForwardWithBodyWithResponse Set where your own notifications from the gateway go
	//
	// For an app whose gateway has one notification address per merchant
	// (`forwards` is true), billing posts each notification that isn't
	// about one of its own payments to this URL, as received, with
	// `Edgescale-Forwarded: billing` added. Anything but a 2xx is retried
	// for about three weeks. An empty URL stops forwarding.
	//
	// Only a notification whose gateway signature checks out is forwarded,
	// and a replay of one only once a day, so the app's signing setting
	// comes first: for Qi, its public key. Setting a URL without it is a
	// 409. One that doesn't check out is answered 400, so the gateway sends
	// a real one again.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with PUT /v1/billing/apps/{app}/forward (the `PutAppForward` operationId).
	PutAppForwardWithBodyWithResponse(ctx context.Context, app AppId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutAppForwardResponse, error)

	// PutAppForwardWithResponse Set where your own notifications from the gateway go
	//
	// For an app whose gateway has one notification address per merchant
	// (`forwards` is true), billing posts each notification that isn't
	// about one of its own payments to this URL, as received, with
	// `Edgescale-Forwarded: billing` added. Anything but a 2xx is retried
	// for about three weeks. An empty URL stops forwarding.
	//
	// Only a notification whose gateway signature checks out is forwarded,
	// and a replay of one only once a day, so the app's signing setting
	// comes first: for Qi, its public key. Setting a URL without it is a
	// 409. One that doesn't check out is answered 400, so the gateway sends
	// a real one again.
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with PUT /v1/billing/apps/{app}/forward (the `PutAppForward` operationId).
	PutAppForwardWithResponse(ctx context.Context, app AppId, body PutAppForwardJSONRequestBody, reqEditors ...RequestEditorFn) (*PutAppForwardResponse, error)

	// GetCheckoutWithResponse Get a checkout, to show its outcome
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/billing/checkouts/{checkout} (the `GetCheckout` operationId).
	GetCheckoutWithResponse(ctx context.Context, checkout openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetCheckoutResponse, error)

	// CancelCheckoutWithResponse Cancel a checkout the payer hasn't finished
	//
	// Stops the payment at its gateway, so it can no longer be paid and
	// stops holding its invoice: start another for the payer who gave up
	// on the gateway's page. Cancelling one cancelled already returns it.
	// A checkout with an outcome, or one its gateway is processing or has
	// paid, is a 409. Billing also cancels checkouts itself once money
	// recorded on their invoice leaves no room for them.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /v1/billing/checkouts/{checkout}/cancel (the `CancelCheckout` operationId).
	CancelCheckoutWithResponse(ctx context.Context, checkout openapi_types.UUID, reqEditors ...RequestEditorFn) (*CancelCheckoutResponse, error)

	// ListCouponsWithResponse List coupons
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/billing/coupons (the `ListCoupons` operationId).
	ListCouponsWithResponse(ctx context.Context, params *ListCouponsParams, reqEditors ...RequestEditorFn) (*ListCouponsResponse, error)

	// DeleteCouponWithResponse Delete a coupon. Customers who already have it keep it.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with DELETE /v1/billing/coupons/{code} (the `DeleteCoupon` operationId).
	DeleteCouponWithResponse(ctx context.Context, code Code, reqEditors ...RequestEditorFn) (*DeleteCouponResponse, error)

	// PutCouponWithBodyWithResponse Create or update a coupon
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with PUT /v1/billing/coupons/{code} (the `PutCoupon` operationId).
	PutCouponWithBodyWithResponse(ctx context.Context, code Code, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutCouponResponse, error)

	// PutCouponWithResponse Create or update a coupon
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with PUT /v1/billing/coupons/{code} (the `PutCoupon` operationId).
	PutCouponWithResponse(ctx context.Context, code Code, body PutCouponJSONRequestBody, reqEditors ...RequestEditorFn) (*PutCouponResponse, error)

	// ListCreditNotesWithResponse List the project's credit notes
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/billing/credit-notes (the `ListCreditNotes` operationId).
	ListCreditNotesWithResponse(ctx context.Context, params *ListCreditNotesParams, reqEditors ...RequestEditorFn) (*ListCreditNotesResponse, error)

	// GetCreditNoteWithResponse Get a credit note
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/billing/credit-notes/{credit_note} (the `GetCreditNote` operationId).
	GetCreditNoteWithResponse(ctx context.Context, creditNote CreditNoteId, reqEditors ...RequestEditorFn) (*GetCreditNoteResponse, error)

	// ListCustomersWithResponse List customers
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/billing/customers (the `ListCustomers` operationId).
	ListCustomersWithResponse(ctx context.Context, params *ListCustomersParams, reqEditors ...RequestEditorFn) (*ListCustomersResponse, error)

	// GetCustomerWithResponse Get a customer
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/billing/customers/{id} (the `GetCustomer` operationId).
	GetCustomerWithResponse(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*GetCustomerResponse, error)

	// PutCustomerWithBodyWithResponse Create or update a customer, under your own ID for it
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with PUT /v1/billing/customers/{id} (the `PutCustomer` operationId).
	PutCustomerWithBodyWithResponse(ctx context.Context, id Id, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutCustomerResponse, error)

	// PutCustomerWithResponse Create or update a customer, under your own ID for it
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with PUT /v1/billing/customers/{id} (the `PutCustomer` operationId).
	PutCustomerWithResponse(ctx context.Context, id Id, body PutCustomerJSONRequestBody, reqEditors ...RequestEditorFn) (*PutCustomerResponse, error)

	// ApplyCouponWithBodyWithResponse Give the customer a coupon
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /v1/billing/customers/{id}/coupons (the `ApplyCoupon` operationId).
	ApplyCouponWithBodyWithResponse(ctx context.Context, id Id, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApplyCouponResponse, error)

	// ApplyCouponWithResponse Give the customer a coupon
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /v1/billing/customers/{id}/coupons (the `ApplyCoupon` operationId).
	ApplyCouponWithResponse(ctx context.Context, id Id, body ApplyCouponJSONRequestBody, reqEditors ...RequestEditorFn) (*ApplyCouponResponse, error)

	// GetEntitlementsWithResponse What the customer may use now
	//
	// The features of every plan the customer holds an active subscription to. Keep your own copy and gate on it; don't call this on each of your requests.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/billing/customers/{id}/entitlements (the `GetEntitlements` operationId).
	GetEntitlementsWithResponse(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*GetEntitlementsResponse, error)

	// RecordEventsWithBodyWithResponse Report usage
	//
	// Up to 100 events at a time. An event whose id was recorded before is skipped, so a batch can be sent again safely.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /v1/billing/events (the `RecordEvents` operationId).
	RecordEventsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RecordEventsResponse, error)

	// RecordEventsWithResponse Report usage
	//
	// Up to 100 events at a time. An event whose id was recorded before is skipped, so a batch can be sent again safely.
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /v1/billing/events (the `RecordEvents` operationId).
	RecordEventsWithResponse(ctx context.Context, body RecordEventsJSONRequestBody, reqEditors ...RequestEditorFn) (*RecordEventsResponse, error)

	// ListFeaturesWithResponse List features
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/billing/features (the `ListFeatures` operationId).
	ListFeaturesWithResponse(ctx context.Context, params *ListFeaturesParams, reqEditors ...RequestEditorFn) (*ListFeaturesResponse, error)

	// DeleteFeatureWithResponse Delete a feature, and remove it from every plan
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with DELETE /v1/billing/features/{code} (the `DeleteFeature` operationId).
	DeleteFeatureWithResponse(ctx context.Context, code Code, reqEditors ...RequestEditorFn) (*DeleteFeatureResponse, error)

	// PutFeatureWithBodyWithResponse Create or update a feature
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with PUT /v1/billing/features/{code} (the `PutFeature` operationId).
	PutFeatureWithBodyWithResponse(ctx context.Context, code Code, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutFeatureResponse, error)

	// PutFeatureWithResponse Create or update a feature
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with PUT /v1/billing/features/{code} (the `PutFeature` operationId).
	PutFeatureWithResponse(ctx context.Context, code Code, body PutFeatureJSONRequestBody, reqEditors ...RequestEditorFn) (*PutFeatureResponse, error)

	// ListInvoicesWithResponse List invoices
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/billing/invoices (the `ListInvoices` operationId).
	ListInvoicesWithResponse(ctx context.Context, params *ListInvoicesParams, reqEditors ...RequestEditorFn) (*ListInvoicesResponse, error)

	// GetInvoiceWithResponse Get an invoice
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/billing/invoices/{invoice} (the `GetInvoice` operationId).
	GetInvoiceWithResponse(ctx context.Context, invoice InvoiceId, reqEditors ...RequestEditorFn) (*GetInvoiceResponse, error)

	// StartCheckoutWithBodyWithResponse Start a payment through an installed app
	//
	// Opens a payment on one of the project's apps and returns the
	// gateway's page to send the payer to, `payer_url`. The reference is
	// your own and makes this safe to send again: the same reference
	// returns the first checkout, and one reused for another invoice,
	// amount or app is a 409. The amount defaults to what is still due,
	// and can't be more. Unless the project's payment settings allow
	// overlapping checkouts, a pending checkout holds its amount: the
	// default amount is what's left, and one that doesn't fit is a 409
	// naming the pending checkouts, so you can send the payer back to one.
	// Billing follows the payment itself and marks the
	// invoice paid once its payments cover it; read the checkout on your
	// return page to show the outcome. A checkout without `payer_url`
	// hasn't reached the gateway yet: send the same request again. While
	// the app's gateway refuses the project's settings, this is a 409
	// until they're updated.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /v1/billing/invoices/{invoice}/checkouts (the `StartCheckout` operationId).
	StartCheckoutWithBodyWithResponse(ctx context.Context, invoice InvoiceId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*StartCheckoutResponse, error)

	// StartCheckoutWithResponse Start a payment through an installed app
	//
	// Opens a payment on one of the project's apps and returns the
	// gateway's page to send the payer to, `payer_url`. The reference is
	// your own and makes this safe to send again: the same reference
	// returns the first checkout, and one reused for another invoice,
	// amount or app is a 409. The amount defaults to what is still due,
	// and can't be more. Unless the project's payment settings allow
	// overlapping checkouts, a pending checkout holds its amount: the
	// default amount is what's left, and one that doesn't fit is a 409
	// naming the pending checkouts, so you can send the payer back to one.
	// Billing follows the payment itself and marks the
	// invoice paid once its payments cover it; read the checkout on your
	// return page to show the outcome. A checkout without `payer_url`
	// hasn't reached the gateway yet: send the same request again. While
	// the app's gateway refuses the project's settings, this is a 409
	// until they're updated.
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /v1/billing/invoices/{invoice}/checkouts (the `StartCheckout` operationId).
	StartCheckoutWithResponse(ctx context.Context, invoice InvoiceId, body StartCheckoutJSONRequestBody, reqEditors ...RequestEditorFn) (*StartCheckoutResponse, error)

	// ListInvoiceCreditNotesWithResponse List an invoice's credit notes
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/billing/invoices/{invoice}/credit-notes (the `ListInvoiceCreditNotes` operationId).
	ListInvoiceCreditNotesWithResponse(ctx context.Context, invoice InvoiceId, reqEditors ...RequestEditorFn) (*ListInvoiceCreditNotesResponse, error)

	// CreateCreditNoteWithBodyWithResponse Take value off an issued invoice
	//
	// Credits the invoice, whole or in part, by amount or by line, with a
	// reason. What's still due comes off first; the rest goes back as
	// `return` says, as a refund or as credit off the customer's next
	// invoices, and needs money paid on the invoice to come from. A credit
	// note is final, and numbered in the project's one sequence. The
	// reference is your own and makes this safe to send again: the same
	// reference returns the first credit note, and one reused for a
	// different one is a 409. Once nothing is due, the invoice is marked
	// paid. A 503 after that means the credit note is recorded but the
	// invoice isn't yet marked paid; send the same request again.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /v1/billing/invoices/{invoice}/credit-notes (the `CreateCreditNote` operationId).
	CreateCreditNoteWithBodyWithResponse(ctx context.Context, invoice InvoiceId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateCreditNoteResponse, error)

	// CreateCreditNoteWithResponse Take value off an issued invoice
	//
	// Credits the invoice, whole or in part, by amount or by line, with a
	// reason. What's still due comes off first; the rest goes back as
	// `return` says, as a refund or as credit off the customer's next
	// invoices, and needs money paid on the invoice to come from. A credit
	// note is final, and numbered in the project's one sequence. The
	// reference is your own and makes this safe to send again: the same
	// reference returns the first credit note, and one reused for a
	// different one is a 409. Once nothing is due, the invoice is marked
	// paid. A 503 after that means the credit note is recorded but the
	// invoice isn't yet marked paid; send the same request again.
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /v1/billing/invoices/{invoice}/credit-notes (the `CreateCreditNote` operationId).
	CreateCreditNoteWithResponse(ctx context.Context, invoice InvoiceId, body CreateCreditNoteJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateCreditNoteResponse, error)

	// ListPaymentsWithResponse List the payments recorded against an invoice
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/billing/invoices/{invoice}/payments (the `ListPayments` operationId).
	ListPaymentsWithResponse(ctx context.Context, invoice InvoiceId, reqEditors ...RequestEditorFn) (*ListPaymentsResponse, error)

	// RecordPaymentWithBodyWithResponse Report a payment you collected yourself
	//
	// Records money you collected outside billing, by your own gateway, a
	// transfer or cash, against the invoice. The reference is your own and
	// makes this safe to send again: the same reference returns the first
	// payment, and a reference reused for a different payment is a 409. Once
	// the payments cover the invoice it is marked paid. A 503 after that
	// means the payment is recorded but the invoice is not yet marked paid;
	// send the same request again.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /v1/billing/invoices/{invoice}/payments (the `RecordPayment` operationId).
	RecordPaymentWithBodyWithResponse(ctx context.Context, invoice InvoiceId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RecordPaymentResponse, error)

	// RecordPaymentWithResponse Report a payment you collected yourself
	//
	// Records money you collected outside billing, by your own gateway, a
	// transfer or cash, against the invoice. The reference is your own and
	// makes this safe to send again: the same reference returns the first
	// payment, and a reference reused for a different payment is a 409. Once
	// the payments cover the invoice it is marked paid. A 503 after that
	// means the payment is recorded but the invoice is not yet marked paid;
	// send the same request again.
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /v1/billing/invoices/{invoice}/payments (the `RecordPayment` operationId).
	RecordPaymentWithResponse(ctx context.Context, invoice InvoiceId, body RecordPaymentJSONRequestBody, reqEditors ...RequestEditorFn) (*RecordPaymentResponse, error)

	// GetInvoicePdfWithResponse Download an invoice as a PDF
	//
	// The PDF is rendered on first request; until it is ready this answers 503 with Retry-After.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/billing/invoices/{invoice}/pdf (the `GetInvoicePdf` operationId).
	GetInvoicePdfWithResponse(ctx context.Context, invoice InvoiceId, reqEditors ...RequestEditorFn) (*GetInvoicePdfResponse, error)

	// ListRefundsWithResponse List an invoice's refunds
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/billing/invoices/{invoice}/refunds (the `ListRefunds` operationId).
	ListRefundsWithResponse(ctx context.Context, invoice InvoiceId, reqEditors ...RequestEditorFn) (*ListRefundsResponse, error)

	// CreateRefundWithBodyWithResponse Give money back on one of an invoice's payments
	//
	// Pays out a credit note's refund part, or gives back money paid twice.
	// Without `refunded_at`, billing refunds through the app the payment
	// was made on, and follows the refund until it has an outcome; a
	// refund made at the gateway's own dashboard for the same amount is
	// taken as this one instead of refunding again. With it, it records
	// money you gave back yourself, on a payment its app can't refund.
	// Billing never holds the money: it comes from your own gateway
	// account. The reference is your own and makes this safe to send
	// again: the same reference returns the first refund, and one reused
	// for a different refund is a 409.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /v1/billing/invoices/{invoice}/refunds (the `CreateRefund` operationId).
	CreateRefundWithBodyWithResponse(ctx context.Context, invoice InvoiceId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateRefundResponse, error)

	// CreateRefundWithResponse Give money back on one of an invoice's payments
	//
	// Pays out a credit note's refund part, or gives back money paid twice.
	// Without `refunded_at`, billing refunds through the app the payment
	// was made on, and follows the refund until it has an outcome; a
	// refund made at the gateway's own dashboard for the same amount is
	// taken as this one instead of refunding again. With it, it records
	// money you gave back yourself, on a payment its app can't refund.
	// Billing never holds the money: it comes from your own gateway
	// account. The reference is your own and makes this safe to send
	// again: the same reference returns the first refund, and one reused
	// for a different refund is a 409.
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /v1/billing/invoices/{invoice}/refunds (the `CreateRefund` operationId).
	CreateRefundWithResponse(ctx context.Context, invoice InvoiceId, body CreateRefundJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateRefundResponse, error)

	// GetLockWithResponse Whether unpaid invoices lock customers' features
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/billing/lock (the `GetLock` operationId).
	GetLockWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetLockResponse, error)

	// PutLockWithBodyWithResponse Set whether unpaid invoices lock customers' features
	//
	// A change sends entitlements.updated for every customer with an active subscription.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with PUT /v1/billing/lock (the `PutLock` operationId).
	PutLockWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutLockResponse, error)

	// PutLockWithResponse Set whether unpaid invoices lock customers' features
	//
	// A change sends entitlements.updated for every customer with an active subscription.
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with PUT /v1/billing/lock (the `PutLock` operationId).
	PutLockWithResponse(ctx context.Context, body PutLockJSONRequestBody, reqEditors ...RequestEditorFn) (*PutLockResponse, error)

	// ListMetersWithResponse List meters
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/billing/meters (the `ListMeters` operationId).
	ListMetersWithResponse(ctx context.Context, params *ListMetersParams, reqEditors ...RequestEditorFn) (*ListMetersResponse, error)

	// DeleteMeterWithResponse Delete a meter, and every charge on it
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with DELETE /v1/billing/meters/{code} (the `DeleteMeter` operationId).
	DeleteMeterWithResponse(ctx context.Context, code Code, reqEditors ...RequestEditorFn) (*DeleteMeterResponse, error)

	// GetMeterWithResponse Get a meter
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/billing/meters/{code} (the `GetMeter` operationId).
	GetMeterWithResponse(ctx context.Context, code Code, reqEditors ...RequestEditorFn) (*GetMeterResponse, error)

	// PutMeterWithBodyWithResponse Create or update a meter
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with PUT /v1/billing/meters/{code} (the `PutMeter` operationId).
	PutMeterWithBodyWithResponse(ctx context.Context, code Code, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutMeterResponse, error)

	// PutMeterWithResponse Create or update a meter
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with PUT /v1/billing/meters/{code} (the `PutMeter` operationId).
	PutMeterWithResponse(ctx context.Context, code Code, body PutMeterJSONRequestBody, reqEditors ...RequestEditorFn) (*PutMeterResponse, error)

	// GetPaymentSettingsWithResponse What a pending checkout holds
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/billing/payment-settings (the `GetPaymentSettings` operationId).
	GetPaymentSettingsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetPaymentSettingsResponse, error)

	// PutPaymentSettingsWithBodyWithResponse Set what a pending checkout holds
	//
	// A change applies to checkouts started after it.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with PUT /v1/billing/payment-settings (the `PutPaymentSettings` operationId).
	PutPaymentSettingsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutPaymentSettingsResponse, error)

	// PutPaymentSettingsWithResponse Set what a pending checkout holds
	//
	// A change applies to checkouts started after it.
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with PUT /v1/billing/payment-settings (the `PutPaymentSettings` operationId).
	PutPaymentSettingsWithResponse(ctx context.Context, body PutPaymentSettingsJSONRequestBody, reqEditors ...RequestEditorFn) (*PutPaymentSettingsResponse, error)

	// ListPlansWithResponse List plans
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/billing/plans (the `ListPlans` operationId).
	ListPlansWithResponse(ctx context.Context, params *ListPlansParams, reqEditors ...RequestEditorFn) (*ListPlansResponse, error)

	// DeletePlanWithResponse Delete a plan
	//
	// Refused (422) while a subscription is on the plan or waits to move to it, since its
	// features come from the plan.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with DELETE /v1/billing/plans/{code} (the `DeletePlan` operationId).
	DeletePlanWithResponse(ctx context.Context, code Code, reqEditors ...RequestEditorFn) (*DeletePlanResponse, error)

	// GetPlanWithResponse Get a plan
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/billing/plans/{code} (the `GetPlan` operationId).
	GetPlanWithResponse(ctx context.Context, code Code, reqEditors ...RequestEditorFn) (*GetPlanResponse, error)

	// PutPlanWithBodyWithResponse Create or update a plan
	//
	// The plan's charges and features become exactly the ones sent; one left out is removed.
	// A subscription keeps the prices its plan had when it subscribed, so a price change
	// reaches only subscriptions made or moved to the plan after it. A feature change reaches
	// every subscription to the plan at once.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with PUT /v1/billing/plans/{code} (the `PutPlan` operationId).
	PutPlanWithBodyWithResponse(ctx context.Context, code Code, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutPlanResponse, error)

	// PutPlanWithResponse Create or update a plan
	//
	// The plan's charges and features become exactly the ones sent; one left out is removed.
	// A subscription keeps the prices its plan had when it subscribed, so a price change
	// reaches only subscriptions made or moved to the plan after it. A feature change reaches
	// every subscription to the plan at once.
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with PUT /v1/billing/plans/{code} (the `PutPlan` operationId).
	PutPlanWithResponse(ctx context.Context, code Code, body PutPlanJSONRequestBody, reqEditors ...RequestEditorFn) (*PutPlanResponse, error)

	// CreateQuoteWithBodyWithResponse Price a new subscription, a seat change or a renewal, as of now
	//
	// Prices exactly one of subscription, seats and renewal: the lines billed at once, as the invoice will have them. Lines billed in arrears, coupons and credits aren't in it. The quote is kept until the end of its UTC day, since proration is by the day. A new subscription starts when the quote is accepted, so it takes no starts_at. A plan change on an existing subscription isn't quoted (422).
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /v1/billing/quotes (the `CreateQuote` operationId).
	CreateQuoteWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateQuoteResponse, error)

	// CreateQuoteWithResponse Price a new subscription, a seat change or a renewal, as of now
	//
	// Prices exactly one of subscription, seats and renewal: the lines billed at once, as the invoice will have them. Lines billed in arrears, coupons and credits aren't in it. The quote is kept until the end of its UTC day, since proration is by the day. A new subscription starts when the quote is accepted, so it takes no starts_at. A plan change on an existing subscription isn't quoted (422).
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /v1/billing/quotes (the `CreateQuote` operationId).
	CreateQuoteWithResponse(ctx context.Context, body CreateQuoteJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateQuoteResponse, error)

	// GetQuoteWithResponse Get a quote
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/billing/quotes/{quote} (the `GetQuote` operationId).
	GetQuoteWithResponse(ctx context.Context, quote QuoteId, reqEditors ...RequestEditorFn) (*GetQuoteResponse, error)

	// AcceptQuoteWithResponse Make the quoted change at the quote's prices
	//
	// A new subscription is made from the plans as they were quoted, so its first invoice is the quote even if a plan changed since. With pay_first, it gives nothing until that invoice is paid. Accepting again returns the first acceptance, so it's safe to retry. An expired quote is refused (422): quote again. A renewal's quote can't be accepted (422).
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /v1/billing/quotes/{quote}/accept (the `AcceptQuote` operationId).
	AcceptQuoteWithResponse(ctx context.Context, quote QuoteId, reqEditors ...RequestEditorFn) (*AcceptQuoteResponse, error)

	// ListSubscriptionsWithResponse List a customer's active and pending subscriptions
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/billing/subscriptions (the `ListSubscriptions` operationId).
	ListSubscriptionsWithResponse(ctx context.Context, params *ListSubscriptionsParams, reqEditors ...RequestEditorFn) (*ListSubscriptionsResponse, error)

	// TerminateSubscriptionWithResponse End a subscription now and bill what is due
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with DELETE /v1/billing/subscriptions/{id} (the `TerminateSubscription` operationId).
	TerminateSubscriptionWithResponse(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*TerminateSubscriptionResponse, error)

	// GetSubscriptionWithResponse Get a subscription
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/billing/subscriptions/{id} (the `GetSubscription` operationId).
	GetSubscriptionWithResponse(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*GetSubscriptionResponse, error)

	// PutSubscriptionWithBodyWithResponse Create a subscription, or change its plan or seats
	//
	// A new ID creates the subscription. For an existing one, a different
	// plan moves it: an upgrade starts now, and a downgrade waits for the end
	// of the period, showing meanwhile as next_plan. Seats are set to the
	// number sent, so send the current count to leave them alone.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with PUT /v1/billing/subscriptions/{id} (the `PutSubscription` operationId).
	PutSubscriptionWithBodyWithResponse(ctx context.Context, id Id, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutSubscriptionResponse, error)

	// PutSubscriptionWithResponse Create a subscription, or change its plan or seats
	//
	// A new ID creates the subscription. For an existing one, a different
	// plan moves it: an upgrade starts now, and a downgrade waits for the end
	// of the period, showing meanwhile as next_plan. Seats are set to the
	// number sent, so send the current count to leave them alone.
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with PUT /v1/billing/subscriptions/{id} (the `PutSubscription` operationId).
	PutSubscriptionWithResponse(ctx context.Context, id Id, body PutSubscriptionJSONRequestBody, reqEditors ...RequestEditorFn) (*PutSubscriptionResponse, error)

	// SetSeatsWithBodyWithResponse Set the seats of the subscription's plan and its add-ons from now on
	//
	// Seats billed in advance bill an increase now, prorated, all on one invoice, and a decrease from the next period. Seats billed in arrears change now.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with PUT /v1/billing/subscriptions/{id}/seats (the `SetSeats` operationId).
	SetSeatsWithBodyWithResponse(ctx context.Context, id Id, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetSeatsResponse, error)

	// SetSeatsWithResponse Set the seats of the subscription's plan and its add-ons from now on
	//
	// Seats billed in advance bill an increase now, prorated, all on one invoice, and a decrease from the next period. Seats billed in arrears change now.
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with PUT /v1/billing/subscriptions/{id}/seats (the `SetSeats` operationId).
	SetSeatsWithResponse(ctx context.Context, id Id, body SetSeatsJSONRequestBody, reqEditors ...RequestEditorFn) (*SetSeatsResponse, error)

	// CancelUpgradeWithResponse Take back an unpaid upgrade
	//
	// Voids the upgrade's invoice and puts the subscription back on its old plan, at the prices it was bought at, from the next period; its old plan, seats and add-ons apply to this period's end. Under the unpaid_upgrades setting revert, billing does this itself once the invoice is past due. 409 when the subscription has no unpaid upgrade, 503 until the upgrade's invoice is issued, and 422 for an upgrade that changed the plan's fee, which can't be taken back.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /v1/billing/subscriptions/{id}/upgrade/cancel (the `CancelUpgrade` operationId).
	CancelUpgradeWithResponse(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*CancelUpgradeResponse, error)

	// GetSummaryWithResponse How the project bills, and what it invoiced lately
	//
	// The project's country, currency and when billing was turned on, and
	// the invoices issued since a date: how many, and their totals, one per
	// currency, since billing never converts. Voided invoices count for
	// neither.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/billing/summary (the `GetSummary` operationId).
	GetSummaryWithResponse(ctx context.Context, params *GetSummaryParams, reqEditors ...RequestEditorFn) (*GetSummaryResponse, error)

	// ListWebhookEndpointsWithResponse List the project's webhook endpoints
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/billing/webhook-endpoints (the `ListWebhookEndpoints` operationId).
	ListWebhookEndpointsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListWebhookEndpointsResponse, error)

	// AddWebhookEndpointWithBodyWithResponse Register a webhook endpoint
	//
	// Billing posts invoice.issued, invoice.paid, invoice.voided,
	// credit_note.created, refund.succeeded, refund.failed and
	// entitlements.updated events to it, signed per Standard Webhooks (https://www.standardwebhooks.com)
	// with the secret returned here, once. Anything but a 2xx is retried
	// with backoff for about three weeks; the same event keeps its
	// webhook-id across retries.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /v1/billing/webhook-endpoints (the `AddWebhookEndpoint` operationId).
	AddWebhookEndpointWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddWebhookEndpointResponse, error)

	// AddWebhookEndpointWithResponse Register a webhook endpoint
	//
	// Billing posts invoice.issued, invoice.paid, invoice.voided,
	// credit_note.created, refund.succeeded, refund.failed and
	// entitlements.updated events to it, signed per Standard Webhooks (https://www.standardwebhooks.com)
	// with the secret returned here, once. Anything but a 2xx is retried
	// with backoff for about three weeks; the same event keeps its
	// webhook-id across retries.
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /v1/billing/webhook-endpoints (the `AddWebhookEndpoint` operationId).
	AddWebhookEndpointWithResponse(ctx context.Context, body AddWebhookEndpointJSONRequestBody, reqEditors ...RequestEditorFn) (*AddWebhookEndpointResponse, error)

	// RemoveWebhookEndpointWithResponse Remove a webhook endpoint, and stop its pending deliveries
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with DELETE /v1/billing/webhook-endpoints/{endpoint} (the `RemoveWebhookEndpoint` operationId).
	RemoveWebhookEndpointWithResponse(ctx context.Context, endpoint string, reqEditors ...RequestEditorFn) (*RemoveWebhookEndpointResponse, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type Code

type Code = string

Code defines model for code.

type Coupon

type Coupon struct {
	AmountOff *Money         `json:"amount_off,omitempty"`
	Code      string         `json:"code"`
	Duration  CouponDuration `json:"duration"`
	ExpiresAt *time.Time     `json:"expires_at,omitempty"`
	Name      string         `json:"name"`

	// PercentOff A percentage to two decimal places.
	//
	// Example: 12.5
	PercentOff *string `json:"percent_off,omitempty"`

	// Periods Billing periods, when duration is repeating.
	Periods *int `json:"periods,omitempty"`
}

Coupon defines model for Coupon.

type CouponBody

type CouponBody struct {
	AmountOff *Money             `json:"amount_off,omitempty"`
	Duration  CouponBodyDuration `json:"duration"`
	ExpiresAt *time.Time         `json:"expires_at,omitempty"`
	Name      string             `json:"name"`

	// PercentOff A percentage to two decimal places.
	//
	// Example: 12.5
	PercentOff *string `json:"percent_off,omitempty"`

	// Periods Billing periods, when duration is repeating.
	Periods *int `json:"periods,omitempty"`
}

CouponBody Takes exactly one of amount_off and percent_off.

type CouponBodyDuration

type CouponBodyDuration string

CouponBodyDuration defines model for CouponBody.Duration.

const (
	CouponBodyDurationForever   CouponBodyDuration = "forever"
	CouponBodyDurationOnce      CouponBodyDuration = "once"
	CouponBodyDurationRepeating CouponBodyDuration = "repeating"
)

Defines values for CouponBodyDuration.

func (CouponBodyDuration) Valid

func (e CouponBodyDuration) Valid() bool

Valid indicates whether the value is a known member of the CouponBodyDuration enum.

type CouponDuration

type CouponDuration string

CouponDuration defines model for Coupon.Duration.

const (
	CouponDurationForever   CouponDuration = "forever"
	CouponDurationOnce      CouponDuration = "once"
	CouponDurationRepeating CouponDuration = "repeating"
)

Defines values for CouponDuration.

func (CouponDuration) Valid

func (e CouponDuration) Valid() bool

Valid indicates whether the value is a known member of the CouponDuration enum.

type CreateCreditNoteJSONRequestBody

type CreateCreditNoteJSONRequestBody = CreditNoteBody

CreateCreditNoteJSONRequestBody defines body for CreateCreditNote for application/json ContentType.

type CreateCreditNoteResponse

type CreateCreditNoteResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Errors   []Message  `json:"errors"`
		Messages []Message  `json:"messages"`
		Result   CreditNote `json:"result"`

		// Success True on a 2xx and false otherwise.
		Success bool `json:"success"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParseCreateCreditNoteResponse

func ParseCreateCreditNoteResponse(rsp *http.Response) (*CreateCreditNoteResponse, error)

ParseCreateCreditNoteResponse parses an HTTP response from a CreateCreditNoteWithResponse call

func (CreateCreditNoteResponse) ContentType

func (r CreateCreditNoteResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (CreateCreditNoteResponse) GetBody

func (r CreateCreditNoteResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (CreateCreditNoteResponse) GetJSON200

func (r CreateCreditNoteResponse) GetJSON200() *struct {
	Errors   []Message  `json:"errors"`
	Messages []Message  `json:"messages"`
	Result   CreditNote `json:"result"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (CreateCreditNoteResponse) GetJSONDefault

func (r CreateCreditNoteResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (CreateCreditNoteResponse) Status

func (r CreateCreditNoteResponse) Status() string

Status returns HTTPResponse.Status

func (CreateCreditNoteResponse) StatusCode

func (r CreateCreditNoteResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type CreateQuoteJSONRequestBody

type CreateQuoteJSONRequestBody = QuoteBody

CreateQuoteJSONRequestBody defines body for CreateQuote for application/json ContentType.

type CreateQuoteResponse

type CreateQuoteResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Errors   []Message `json:"errors"`
		Messages []Message `json:"messages"`
		Result   Quote     `json:"result"`

		// Success True on a 2xx and false otherwise.
		Success bool `json:"success"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParseCreateQuoteResponse

func ParseCreateQuoteResponse(rsp *http.Response) (*CreateQuoteResponse, error)

ParseCreateQuoteResponse parses an HTTP response from a CreateQuoteWithResponse call

func (CreateQuoteResponse) ContentType

func (r CreateQuoteResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (CreateQuoteResponse) GetBody

func (r CreateQuoteResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (CreateQuoteResponse) GetJSON200

func (r CreateQuoteResponse) GetJSON200() *struct {
	Errors   []Message `json:"errors"`
	Messages []Message `json:"messages"`
	Result   Quote     `json:"result"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (CreateQuoteResponse) GetJSONDefault

func (r CreateQuoteResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (CreateQuoteResponse) Status

func (r CreateQuoteResponse) Status() string

Status returns HTTPResponse.Status

func (CreateQuoteResponse) StatusCode

func (r CreateQuoteResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type CreateRefundJSONRequestBody

type CreateRefundJSONRequestBody = RefundBody

CreateRefundJSONRequestBody defines body for CreateRefund for application/json ContentType.

type CreateRefundResponse

type CreateRefundResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Errors   []Message `json:"errors"`
		Messages []Message `json:"messages"`
		Result   Refund    `json:"result"`

		// Success True on a 2xx and false otherwise.
		Success bool `json:"success"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParseCreateRefundResponse

func ParseCreateRefundResponse(rsp *http.Response) (*CreateRefundResponse, error)

ParseCreateRefundResponse parses an HTTP response from a CreateRefundWithResponse call

func (CreateRefundResponse) ContentType

func (r CreateRefundResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (CreateRefundResponse) GetBody

func (r CreateRefundResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (CreateRefundResponse) GetJSON200

func (r CreateRefundResponse) GetJSON200() *struct {
	Errors   []Message `json:"errors"`
	Messages []Message `json:"messages"`
	Result   Refund    `json:"result"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (CreateRefundResponse) GetJSONDefault

func (r CreateRefundResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (CreateRefundResponse) Status

func (r CreateRefundResponse) Status() string

Status returns HTTPResponse.Status

func (CreateRefundResponse) StatusCode

func (r CreateRefundResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type CreditNote

type CreditNote struct {
	CreatedAt   time.Time          `json:"created_at"`
	Credit      Money              `json:"credit"`
	Customer    string             `json:"customer"`
	Description string             `json:"description"`
	Id          openapi_types.UUID `json:"id"`
	Invoice     string             `json:"invoice"`

	// Lines Empty when credited by amount.
	Lines []struct {
		Amount      Money  `json:"amount"`
		Description string `json:"description"`
		Line        string `json:"line"`
	} `json:"lines"`

	// Number The project's sequence, such as CN-000042.
	Number    string           `json:"number"`
	Offset    Money            `json:"offset"`
	Reason    CreditNoteReason `json:"reason"`
	Reference string           `json:"reference"`
	Refund    Money            `json:"refund"`
	Refunded  Money            `json:"refunded"`

	// TakenBackAt When the upgrade that made it was taken back. It then counts for nothing on its invoice, and its credit was taken back; a later upgrade credits those lines again.
	TakenBackAt *time.Time `json:"taken_back_at,omitempty"`
	Total       Money      `json:"total"`
}

CreditNote defines model for CreditNote.

type CreditNoteBody

type CreditNoteBody struct {
	// Amount An amount off the invoice's total. Send this or lines.
	Amount      *Money  `json:"amount,omitempty"`
	Description *string `json:"description,omitempty"`

	// Lines An amount off each line named, on an invoice without discounts or taxes. Send this or amount.
	Lines *[]struct {
		Amount Money `json:"amount"`

		// Line The line's id, from the invoice.
		Line string `json:"line"`
	} `json:"lines,omitempty"`
	Reason CreditNoteBodyReason `json:"reason"`

	// Reference Your own reference for the credit note, unique in the project.
	Reference string `json:"reference"`

	// Return Where the part beyond what's due goes back: refund, money you give back through refunds, or credit, taken off the customer's next invoices. Required when any part goes back.
	Return *CreditNoteBodyReturn `json:"return,omitempty"`
}

CreditNoteBody defines model for CreditNoteBody.

type CreditNoteBodyReason

type CreditNoteBodyReason string

CreditNoteBodyReason defines model for CreditNoteBody.Reason.

const (
	CreditNoteBodyReasonDuplicate             CreditNoteBodyReason = "duplicate"
	CreditNoteBodyReasonFraudulent            CreditNoteBodyReason = "fraudulent"
	CreditNoteBodyReasonOrderCancellation     CreditNoteBodyReason = "order_cancellation"
	CreditNoteBodyReasonOrderChange           CreditNoteBodyReason = "order_change"
	CreditNoteBodyReasonOther                 CreditNoteBodyReason = "other"
	CreditNoteBodyReasonProductUnsatisfactory CreditNoteBodyReason = "product_unsatisfactory"
)

Defines values for CreditNoteBodyReason.

func (CreditNoteBodyReason) Valid

func (e CreditNoteBodyReason) Valid() bool

Valid indicates whether the value is a known member of the CreditNoteBodyReason enum.

type CreditNoteBodyReturn

type CreditNoteBodyReturn string

CreditNoteBodyReturn Where the part beyond what's due goes back: refund, money you give back through refunds, or credit, taken off the customer's next invoices. Required when any part goes back.

const (
	CreditNoteBodyReturnCredit CreditNoteBodyReturn = "credit"
	CreditNoteBodyReturnRefund CreditNoteBodyReturn = "refund"
)

Defines values for CreditNoteBodyReturn.

func (CreditNoteBodyReturn) Valid

func (e CreditNoteBodyReturn) Valid() bool

Valid indicates whether the value is a known member of the CreditNoteBodyReturn enum.

type CreditNoteId

type CreditNoteId = openapi_types.UUID

CreditNoteId defines model for creditNoteId.

type CreditNoteReason

type CreditNoteReason string

CreditNoteReason defines model for CreditNote.Reason.

const (
	CreditNoteReasonDuplicate             CreditNoteReason = "duplicate"
	CreditNoteReasonFraudulent            CreditNoteReason = "fraudulent"
	CreditNoteReasonOrderCancellation     CreditNoteReason = "order_cancellation"
	CreditNoteReasonOrderChange           CreditNoteReason = "order_change"
	CreditNoteReasonOther                 CreditNoteReason = "other"
	CreditNoteReasonProductUnsatisfactory CreditNoteReason = "product_unsatisfactory"
)

Defines values for CreditNoteReason.

func (CreditNoteReason) Valid

func (e CreditNoteReason) Valid() bool

Valid indicates whether the value is a known member of the CreditNoteReason enum.

type Customer

type Customer struct {
	Address *Address `json:"address,omitempty"`

	// Credit On the read of one customer: the credit its credit notes gave it, not yet taken off its invoices. Absent before its currency is set.
	Credit *Money `json:"credit,omitempty"`

	// Currency Fixed by the customer's first subscription if left out.
	Currency  *string `json:"currency,omitempty"`
	Email     *string `json:"email,omitempty"`
	Id        string  `json:"id"`
	LegalName *string `json:"legal_name,omitempty"`
	Name      *string `json:"name,omitempty"`
	TaxId     *string `json:"tax_id,omitempty"`
}

Customer defines model for Customer.

type CustomerBody

type CustomerBody struct {
	Address *Address `json:"address,omitempty"`

	// Currency Fixed by the customer's first subscription if left out.
	Currency  *string `json:"currency,omitempty"`
	Email     *string `json:"email,omitempty"`
	LegalName *string `json:"legal_name,omitempty"`
	Name      *string `json:"name,omitempty"`
	TaxId     *string `json:"tax_id,omitempty"`
}

CustomerBody defines model for CustomerBody.

type DeleteCouponResponse

type DeleteCouponResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *Done
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParseDeleteCouponResponse

func ParseDeleteCouponResponse(rsp *http.Response) (*DeleteCouponResponse, error)

ParseDeleteCouponResponse parses an HTTP response from a DeleteCouponWithResponse call

func (DeleteCouponResponse) ContentType

func (r DeleteCouponResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (DeleteCouponResponse) GetBody

func (r DeleteCouponResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (DeleteCouponResponse) GetJSON200

func (r DeleteCouponResponse) GetJSON200() *Done

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (DeleteCouponResponse) GetJSONDefault

func (r DeleteCouponResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (DeleteCouponResponse) Status

func (r DeleteCouponResponse) Status() string

Status returns HTTPResponse.Status

func (DeleteCouponResponse) StatusCode

func (r DeleteCouponResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DeleteFeatureResponse

type DeleteFeatureResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *Done
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParseDeleteFeatureResponse

func ParseDeleteFeatureResponse(rsp *http.Response) (*DeleteFeatureResponse, error)

ParseDeleteFeatureResponse parses an HTTP response from a DeleteFeatureWithResponse call

func (DeleteFeatureResponse) ContentType

func (r DeleteFeatureResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (DeleteFeatureResponse) GetBody

func (r DeleteFeatureResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (DeleteFeatureResponse) GetJSON200

func (r DeleteFeatureResponse) GetJSON200() *Done

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (DeleteFeatureResponse) GetJSONDefault

func (r DeleteFeatureResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (DeleteFeatureResponse) Status

func (r DeleteFeatureResponse) Status() string

Status returns HTTPResponse.Status

func (DeleteFeatureResponse) StatusCode

func (r DeleteFeatureResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DeleteMeterResponse

type DeleteMeterResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *Done
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParseDeleteMeterResponse

func ParseDeleteMeterResponse(rsp *http.Response) (*DeleteMeterResponse, error)

ParseDeleteMeterResponse parses an HTTP response from a DeleteMeterWithResponse call

func (DeleteMeterResponse) ContentType

func (r DeleteMeterResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (DeleteMeterResponse) GetBody

func (r DeleteMeterResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (DeleteMeterResponse) GetJSON200

func (r DeleteMeterResponse) GetJSON200() *Done

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (DeleteMeterResponse) GetJSONDefault

func (r DeleteMeterResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (DeleteMeterResponse) Status

func (r DeleteMeterResponse) Status() string

Status returns HTTPResponse.Status

func (DeleteMeterResponse) StatusCode

func (r DeleteMeterResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DeletePlanResponse

type DeletePlanResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *Done
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParseDeletePlanResponse

func ParseDeletePlanResponse(rsp *http.Response) (*DeletePlanResponse, error)

ParseDeletePlanResponse parses an HTTP response from a DeletePlanWithResponse call

func (DeletePlanResponse) ContentType

func (r DeletePlanResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (DeletePlanResponse) GetBody

func (r DeletePlanResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (DeletePlanResponse) GetJSON200

func (r DeletePlanResponse) GetJSON200() *Done

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (DeletePlanResponse) GetJSONDefault

func (r DeletePlanResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (DeletePlanResponse) Status

func (r DeletePlanResponse) Status() string

Status returns HTTPResponse.Status

func (DeletePlanResponse) StatusCode

func (r DeletePlanResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Done

type Done struct {
	Errors   []Message   `json:"errors"`
	Messages []Message   `json:"messages"`
	Result   interface{} `json:"result"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

Done defines model for Done.

type EntitledAddOn

type EntitledAddOn struct {
	Plan string `json:"plan"`

	// Seats The add-on's seats usable now, counted as the plan's are.
	Seats int `json:"seats"`
}

EntitledAddOn defines model for EntitledAddOn.

type EntitledSubscription

type EntitledSubscription struct {
	AddOns []EntitledAddOn `json:"add_ons"`
	EndsAt *time.Time      `json:"ends_at,omitempty"`
	Id     string          `json:"id"`

	// Invoice With pending_payment, the invoice to pay, once it's issued.
	Invoice   *string   `json:"invoice,omitempty"`
	PeriodEnd time.Time `json:"period_end"`
	Plan      string    `json:"plan"`

	// Seats The seats usable now. Billed in advance, they're the included ones plus those its invoices billed for this period: on a pay_first plan the paid ones and the renewal, on any other all of them. Billed in arrears, they're the count set. 0 on a plan without seats.
	Seats int `json:"seats"`

	// Status pending_payment until the first invoice of a subscription to a pay_first plan is paid; its features don't count meanwhile.
	Status EntitledSubscriptionStatus `json:"status"`

	// Upgrade An upgrade on a pay_first plan waiting for its invoice to be paid. Meanwhile plan, seats and add_ons are the old ones, still in force, and status stays active. Once it's paid, the new plan's apply.
	Upgrade *struct {
		// Invoice The upgrade's invoice, once it's issued.
		Invoice *string `json:"invoice,omitempty"`

		// Plan The plan the upgrade moves to.
		Plan string `json:"plan"`
	} `json:"upgrade,omitempty"`
}

EntitledSubscription defines model for EntitledSubscription.

type EntitledSubscriptionStatus

type EntitledSubscriptionStatus string

EntitledSubscriptionStatus pending_payment until the first invoice of a subscription to a pay_first plan is paid; its features don't count meanwhile.

const (
	EntitledSubscriptionStatusActive         EntitledSubscriptionStatus = "active"
	EntitledSubscriptionStatusPendingPayment EntitledSubscriptionStatus = "pending_payment"
)

Defines values for EntitledSubscriptionStatus.

func (EntitledSubscriptionStatus) Valid

func (e EntitledSubscriptionStatus) Valid() bool

Valid indicates whether the value is a known member of the EntitledSubscriptionStatus enum.

type Entitlements

type Entitlements struct {
	// Customer The customer's id.
	Customer string `json:"customer"`

	// Features The feature codes usable now, sorted.
	Features []string `json:"features"`

	// Invoice With past_due and locked, the oldest unpaid invoice past due.
	Invoice *string `json:"invoice,omitempty"`

	// LocksAt With past_due and locked, when the features lock.
	LocksAt *time.Time `json:"locks_at,omitempty"`

	// Status active: the features apply. past_due: an invoice is unpaid past its due date, and the features apply until locks_at. locked: that invoice is still unpaid at locks_at, so features is empty. pending_payment: every subscription waits for its first invoice to be paid (pay_first), so features is empty. none: no active subscription, so features is empty. past_due and locked come only with the project's lock on (GET /lock), and win over the others.
	Status EntitlementsStatus `json:"status"`

	// Subscriptions Every active subscription, by id, with what it gives now.
	Subscriptions *[]EntitledSubscription `json:"subscriptions,omitempty"`
}

Entitlements defines model for Entitlements.

type EntitlementsStatus

type EntitlementsStatus string

EntitlementsStatus active: the features apply. past_due: an invoice is unpaid past its due date, and the features apply until locks_at. locked: that invoice is still unpaid at locks_at, so features is empty. pending_payment: every subscription waits for its first invoice to be paid (pay_first), so features is empty. none: no active subscription, so features is empty. past_due and locked come only with the project's lock on (GET /lock), and win over the others.

const (
	EntitlementsStatusActive         EntitlementsStatus = "active"
	EntitlementsStatusLocked         EntitlementsStatus = "locked"
	EntitlementsStatusNone           EntitlementsStatus = "none"
	EntitlementsStatusPastDue        EntitlementsStatus = "past_due"
	EntitlementsStatusPendingPayment EntitlementsStatus = "pending_payment"
)

Defines values for EntitlementsStatus.

func (EntitlementsStatus) Valid

func (e EntitlementsStatus) Valid() bool

Valid indicates whether the value is a known member of the EntitlementsStatus enum.

type Envelope

type Envelope struct {
	Errors   []Message `json:"errors"`
	Messages []Message `json:"messages"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

Envelope defines model for Envelope.

type Event

type Event struct {
	// At Omit for now.
	At *time.Time `json:"at,omitempty"`

	// Id Your idempotency key, unique per project.
	Id    string `json:"id"`
	Meter string `json:"meter"`

	// Properties Event fields, such as the one a meter aggregates.
	Properties   *map[string]string `json:"properties,omitempty"`
	Subscription string             `json:"subscription"`
}

Event defines model for Event.

type Failure

type Failure struct {
	Errors   []Message   `json:"errors"`
	Messages []Message   `json:"messages"`
	Result   interface{} `json:"result"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

Failure defines model for Failure.

type Feature

type Feature struct {
	Code        string  `json:"code"`
	Description *string `json:"description,omitempty"`
	Name        string  `json:"name"`
}

Feature Something a plan can include, which your app unlocks for customers whose subscriptions include it.

type FeatureBody

type FeatureBody struct {
	Description *string `json:"description,omitempty"`
	Name        string  `json:"name"`
}

FeatureBody defines model for FeatureBody.

type GetCheckoutResponse

type GetCheckoutResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Errors   []Message `json:"errors"`
		Messages []Message `json:"messages"`
		Result   Checkout  `json:"result"`

		// Success True on a 2xx and false otherwise.
		Success bool `json:"success"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParseGetCheckoutResponse

func ParseGetCheckoutResponse(rsp *http.Response) (*GetCheckoutResponse, error)

ParseGetCheckoutResponse parses an HTTP response from a GetCheckoutWithResponse call

func (GetCheckoutResponse) ContentType

func (r GetCheckoutResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetCheckoutResponse) GetBody

func (r GetCheckoutResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetCheckoutResponse) GetJSON200

func (r GetCheckoutResponse) GetJSON200() *struct {
	Errors   []Message `json:"errors"`
	Messages []Message `json:"messages"`
	Result   Checkout  `json:"result"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetCheckoutResponse) GetJSONDefault

func (r GetCheckoutResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (GetCheckoutResponse) Status

func (r GetCheckoutResponse) Status() string

Status returns HTTPResponse.Status

func (GetCheckoutResponse) StatusCode

func (r GetCheckoutResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetCreditNoteResponse

type GetCreditNoteResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Errors   []Message  `json:"errors"`
		Messages []Message  `json:"messages"`
		Result   CreditNote `json:"result"`

		// Success True on a 2xx and false otherwise.
		Success bool `json:"success"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParseGetCreditNoteResponse

func ParseGetCreditNoteResponse(rsp *http.Response) (*GetCreditNoteResponse, error)

ParseGetCreditNoteResponse parses an HTTP response from a GetCreditNoteWithResponse call

func (GetCreditNoteResponse) ContentType

func (r GetCreditNoteResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetCreditNoteResponse) GetBody

func (r GetCreditNoteResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetCreditNoteResponse) GetJSON200

func (r GetCreditNoteResponse) GetJSON200() *struct {
	Errors   []Message  `json:"errors"`
	Messages []Message  `json:"messages"`
	Result   CreditNote `json:"result"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetCreditNoteResponse) GetJSONDefault

func (r GetCreditNoteResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (GetCreditNoteResponse) Status

func (r GetCreditNoteResponse) Status() string

Status returns HTTPResponse.Status

func (GetCreditNoteResponse) StatusCode

func (r GetCreditNoteResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetCustomerResponse

type GetCustomerResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Errors   []Message `json:"errors"`
		Messages []Message `json:"messages"`
		Result   Customer  `json:"result"`

		// Success True on a 2xx and false otherwise.
		Success bool `json:"success"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParseGetCustomerResponse

func ParseGetCustomerResponse(rsp *http.Response) (*GetCustomerResponse, error)

ParseGetCustomerResponse parses an HTTP response from a GetCustomerWithResponse call

func (GetCustomerResponse) ContentType

func (r GetCustomerResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetCustomerResponse) GetBody

func (r GetCustomerResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetCustomerResponse) GetJSON200

func (r GetCustomerResponse) GetJSON200() *struct {
	Errors   []Message `json:"errors"`
	Messages []Message `json:"messages"`
	Result   Customer  `json:"result"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetCustomerResponse) GetJSONDefault

func (r GetCustomerResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (GetCustomerResponse) Status

func (r GetCustomerResponse) Status() string

Status returns HTTPResponse.Status

func (GetCustomerResponse) StatusCode

func (r GetCustomerResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetEntitlementsResponse

type GetEntitlementsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Errors   []Message    `json:"errors"`
		Messages []Message    `json:"messages"`
		Result   Entitlements `json:"result"`

		// Success True on a 2xx and false otherwise.
		Success bool `json:"success"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParseGetEntitlementsResponse

func ParseGetEntitlementsResponse(rsp *http.Response) (*GetEntitlementsResponse, error)

ParseGetEntitlementsResponse parses an HTTP response from a GetEntitlementsWithResponse call

func (GetEntitlementsResponse) ContentType

func (r GetEntitlementsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetEntitlementsResponse) GetBody

func (r GetEntitlementsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetEntitlementsResponse) GetJSON200

func (r GetEntitlementsResponse) GetJSON200() *struct {
	Errors   []Message    `json:"errors"`
	Messages []Message    `json:"messages"`
	Result   Entitlements `json:"result"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetEntitlementsResponse) GetJSONDefault

func (r GetEntitlementsResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (GetEntitlementsResponse) Status

func (r GetEntitlementsResponse) Status() string

Status returns HTTPResponse.Status

func (GetEntitlementsResponse) StatusCode

func (r GetEntitlementsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetInvoicePdfResponse

type GetInvoicePdfResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParseGetInvoicePdfResponse

func ParseGetInvoicePdfResponse(rsp *http.Response) (*GetInvoicePdfResponse, error)

ParseGetInvoicePdfResponse parses an HTTP response from a GetInvoicePdfWithResponse call

func (GetInvoicePdfResponse) ContentType

func (r GetInvoicePdfResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetInvoicePdfResponse) GetBody

func (r GetInvoicePdfResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetInvoicePdfResponse) GetJSONDefault

func (r GetInvoicePdfResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (GetInvoicePdfResponse) Status

func (r GetInvoicePdfResponse) Status() string

Status returns HTTPResponse.Status

func (GetInvoicePdfResponse) StatusCode

func (r GetInvoicePdfResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetInvoiceResponse

type GetInvoiceResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Errors   []Message `json:"errors"`
		Messages []Message `json:"messages"`
		Result   Invoice   `json:"result"`

		// Success True on a 2xx and false otherwise.
		Success bool `json:"success"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParseGetInvoiceResponse

func ParseGetInvoiceResponse(rsp *http.Response) (*GetInvoiceResponse, error)

ParseGetInvoiceResponse parses an HTTP response from a GetInvoiceWithResponse call

func (GetInvoiceResponse) ContentType

func (r GetInvoiceResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetInvoiceResponse) GetBody

func (r GetInvoiceResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetInvoiceResponse) GetJSON200

func (r GetInvoiceResponse) GetJSON200() *struct {
	Errors   []Message `json:"errors"`
	Messages []Message `json:"messages"`
	Result   Invoice   `json:"result"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetInvoiceResponse) GetJSONDefault

func (r GetInvoiceResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (GetInvoiceResponse) Status

func (r GetInvoiceResponse) Status() string

Status returns HTTPResponse.Status

func (GetInvoiceResponse) StatusCode

func (r GetInvoiceResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetLockResponse

type GetLockResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Errors   []Message `json:"errors"`
		Messages []Message `json:"messages"`
		Result   Lock      `json:"result"`

		// Success True on a 2xx and false otherwise.
		Success bool `json:"success"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParseGetLockResponse

func ParseGetLockResponse(rsp *http.Response) (*GetLockResponse, error)

ParseGetLockResponse parses an HTTP response from a GetLockWithResponse call

func (GetLockResponse) ContentType

func (r GetLockResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetLockResponse) GetBody

func (r GetLockResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetLockResponse) GetJSON200

func (r GetLockResponse) GetJSON200() *struct {
	Errors   []Message `json:"errors"`
	Messages []Message `json:"messages"`
	Result   Lock      `json:"result"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetLockResponse) GetJSONDefault

func (r GetLockResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (GetLockResponse) Status

func (r GetLockResponse) Status() string

Status returns HTTPResponse.Status

func (GetLockResponse) StatusCode

func (r GetLockResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetMeterResponse

type GetMeterResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Errors   []Message `json:"errors"`
		Messages []Message `json:"messages"`
		Result   Meter     `json:"result"`

		// Success True on a 2xx and false otherwise.
		Success bool `json:"success"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParseGetMeterResponse

func ParseGetMeterResponse(rsp *http.Response) (*GetMeterResponse, error)

ParseGetMeterResponse parses an HTTP response from a GetMeterWithResponse call

func (GetMeterResponse) ContentType

func (r GetMeterResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetMeterResponse) GetBody

func (r GetMeterResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetMeterResponse) GetJSON200

func (r GetMeterResponse) GetJSON200() *struct {
	Errors   []Message `json:"errors"`
	Messages []Message `json:"messages"`
	Result   Meter     `json:"result"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetMeterResponse) GetJSONDefault

func (r GetMeterResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (GetMeterResponse) Status

func (r GetMeterResponse) Status() string

Status returns HTTPResponse.Status

func (GetMeterResponse) StatusCode

func (r GetMeterResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetPaymentSettingsResponse

type GetPaymentSettingsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Errors   []Message       `json:"errors"`
		Messages []Message       `json:"messages"`
		Result   PaymentSettings `json:"result"`

		// Success True on a 2xx and false otherwise.
		Success bool `json:"success"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParseGetPaymentSettingsResponse

func ParseGetPaymentSettingsResponse(rsp *http.Response) (*GetPaymentSettingsResponse, error)

ParseGetPaymentSettingsResponse parses an HTTP response from a GetPaymentSettingsWithResponse call

func (GetPaymentSettingsResponse) ContentType

func (r GetPaymentSettingsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetPaymentSettingsResponse) GetBody

func (r GetPaymentSettingsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetPaymentSettingsResponse) GetJSON200

func (r GetPaymentSettingsResponse) GetJSON200() *struct {
	Errors   []Message       `json:"errors"`
	Messages []Message       `json:"messages"`
	Result   PaymentSettings `json:"result"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetPaymentSettingsResponse) GetJSONDefault

func (r GetPaymentSettingsResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (GetPaymentSettingsResponse) Status

Status returns HTTPResponse.Status

func (GetPaymentSettingsResponse) StatusCode

func (r GetPaymentSettingsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetPlanResponse

type GetPlanResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Errors   []Message `json:"errors"`
		Messages []Message `json:"messages"`
		Result   Plan      `json:"result"`

		// Success True on a 2xx and false otherwise.
		Success bool `json:"success"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParseGetPlanResponse

func ParseGetPlanResponse(rsp *http.Response) (*GetPlanResponse, error)

ParseGetPlanResponse parses an HTTP response from a GetPlanWithResponse call

func (GetPlanResponse) ContentType

func (r GetPlanResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetPlanResponse) GetBody

func (r GetPlanResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetPlanResponse) GetJSON200

func (r GetPlanResponse) GetJSON200() *struct {
	Errors   []Message `json:"errors"`
	Messages []Message `json:"messages"`
	Result   Plan      `json:"result"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetPlanResponse) GetJSONDefault

func (r GetPlanResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (GetPlanResponse) Status

func (r GetPlanResponse) Status() string

Status returns HTTPResponse.Status

func (GetPlanResponse) StatusCode

func (r GetPlanResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetQuoteResponse

type GetQuoteResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Errors   []Message `json:"errors"`
		Messages []Message `json:"messages"`
		Result   Quote     `json:"result"`

		// Success True on a 2xx and false otherwise.
		Success bool `json:"success"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParseGetQuoteResponse

func ParseGetQuoteResponse(rsp *http.Response) (*GetQuoteResponse, error)

ParseGetQuoteResponse parses an HTTP response from a GetQuoteWithResponse call

func (GetQuoteResponse) ContentType

func (r GetQuoteResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetQuoteResponse) GetBody

func (r GetQuoteResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetQuoteResponse) GetJSON200

func (r GetQuoteResponse) GetJSON200() *struct {
	Errors   []Message `json:"errors"`
	Messages []Message `json:"messages"`
	Result   Quote     `json:"result"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetQuoteResponse) GetJSONDefault

func (r GetQuoteResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (GetQuoteResponse) Status

func (r GetQuoteResponse) Status() string

Status returns HTTPResponse.Status

func (GetQuoteResponse) StatusCode

func (r GetQuoteResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetSubscriptionResponse

type GetSubscriptionResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Errors   []Message    `json:"errors"`
		Messages []Message    `json:"messages"`
		Result   Subscription `json:"result"`

		// Success True on a 2xx and false otherwise.
		Success bool `json:"success"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParseGetSubscriptionResponse

func ParseGetSubscriptionResponse(rsp *http.Response) (*GetSubscriptionResponse, error)

ParseGetSubscriptionResponse parses an HTTP response from a GetSubscriptionWithResponse call

func (GetSubscriptionResponse) ContentType

func (r GetSubscriptionResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetSubscriptionResponse) GetBody

func (r GetSubscriptionResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetSubscriptionResponse) GetJSON200

func (r GetSubscriptionResponse) GetJSON200() *struct {
	Errors   []Message    `json:"errors"`
	Messages []Message    `json:"messages"`
	Result   Subscription `json:"result"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetSubscriptionResponse) GetJSONDefault

func (r GetSubscriptionResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (GetSubscriptionResponse) Status

func (r GetSubscriptionResponse) Status() string

Status returns HTTPResponse.Status

func (GetSubscriptionResponse) StatusCode

func (r GetSubscriptionResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetSummaryParams

type GetSummaryParams struct {
	// Since Count invoices issued on this date (UTC) or after. Thirty days ago when left out.
	Since *openapi_types.Date `form:"since,omitempty" json:"since,omitempty"`
}

GetSummaryParams defines parameters for GetSummary.

type GetSummaryResponse

type GetSummaryResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Errors   []Message `json:"errors"`
		Messages []Message `json:"messages"`
		Result   Summary   `json:"result"`

		// Success True on a 2xx and false otherwise.
		Success bool `json:"success"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParseGetSummaryResponse

func ParseGetSummaryResponse(rsp *http.Response) (*GetSummaryResponse, error)

ParseGetSummaryResponse parses an HTTP response from a GetSummaryWithResponse call

func (GetSummaryResponse) ContentType

func (r GetSummaryResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetSummaryResponse) GetBody

func (r GetSummaryResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetSummaryResponse) GetJSON200

func (r GetSummaryResponse) GetJSON200() *struct {
	Errors   []Message `json:"errors"`
	Messages []Message `json:"messages"`
	Result   Summary   `json:"result"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetSummaryResponse) GetJSONDefault

func (r GetSummaryResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (GetSummaryResponse) Status

func (r GetSummaryResponse) Status() string

Status returns HTTPResponse.Status

func (GetSummaryResponse) StatusCode

func (r GetSummaryResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type HttpRequestDoer

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer performs HTTP requests.

The standard http.Client implements this interface.

type Id

type Id = string

Id defines model for id.

type Invoice

type Invoice struct {
	Credited Money               `json:"credited"`
	Customer string              `json:"customer"`
	Due      Money               `json:"due"`
	DueAt    *openapi_types.Date `json:"due_at,omitempty"`
	Id       string              `json:"id"`
	IssuedAt openapi_types.Date  `json:"issued_at"`

	// Lines On the read of one invoice only.
	Lines *[]InvoiceLine `json:"lines,omitempty"`

	// Number The number printed on the invoice.
	Number string `json:"number"`

	// Status paid: nothing is due, by payments or credit notes.
	Status   InvoiceStatus `json:"status"`
	ToRefund Money         `json:"to_refund"`
	Total    Money         `json:"total"`
}

Invoice defines model for Invoice.

type InvoiceId

type InvoiceId = string

InvoiceId defines model for invoiceId.

type InvoiceLine

type InvoiceLine struct {
	Amount      Money     `json:"amount"`
	Creditable  Money     `json:"creditable"`
	Description string    `json:"description"`
	From        time.Time `json:"from"`

	// Id What a credit note names the line by.
	Id   string          `json:"id"`
	Kind InvoiceLineKind `json:"kind"`
	To   time.Time       `json:"to"`
}

InvoiceLine defines model for InvoiceLine.

type InvoiceLineKind

type InvoiceLineKind string

InvoiceLineKind defines model for InvoiceLine.Kind.

const (
	InvoiceLineKindFee    InvoiceLineKind = "fee"
	InvoiceLineKindOneOff InvoiceLineKind = "one_off"
	InvoiceLineKindSeats  InvoiceLineKind = "seats"
	InvoiceLineKindUsage  InvoiceLineKind = "usage"
)

Defines values for InvoiceLineKind.

func (InvoiceLineKind) Valid

func (e InvoiceLineKind) Valid() bool

Valid indicates whether the value is a known member of the InvoiceLineKind enum.

type InvoiceStatus

type InvoiceStatus string

InvoiceStatus paid: nothing is due, by payments or credit notes.

const (
	InvoiceStatusIssued InvoiceStatus = "issued"
	InvoiceStatusPaid   InvoiceStatus = "paid"
	InvoiceStatusVoided InvoiceStatus = "voided"
)

Defines values for InvoiceStatus.

func (InvoiceStatus) Valid

func (e InvoiceStatus) Valid() bool

Valid indicates whether the value is a known member of the InvoiceStatus enum.

type ListAppsResponse

type ListAppsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Errors   []Message `json:"errors"`
		Messages []Message `json:"messages"`
		Result   []App     `json:"result"`

		// Success True on a 2xx and false otherwise.
		Success bool `json:"success"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParseListAppsResponse

func ParseListAppsResponse(rsp *http.Response) (*ListAppsResponse, error)

ParseListAppsResponse parses an HTTP response from a ListAppsWithResponse call

func (ListAppsResponse) ContentType

func (r ListAppsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListAppsResponse) GetBody

func (r ListAppsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListAppsResponse) GetJSON200

func (r ListAppsResponse) GetJSON200() *struct {
	Errors   []Message `json:"errors"`
	Messages []Message `json:"messages"`
	Result   []App     `json:"result"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListAppsResponse) GetJSONDefault

func (r ListAppsResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (ListAppsResponse) Status

func (r ListAppsResponse) Status() string

Status returns HTTPResponse.Status

func (ListAppsResponse) StatusCode

func (r ListAppsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListCouponsParams

type ListCouponsParams struct {
	Page    *Page    `form:"page,omitempty" json:"page,omitempty"`
	PerPage *PerPage `form:"per_page,omitempty" json:"per_page,omitempty"`
}

ListCouponsParams defines parameters for ListCoupons.

type ListCouponsResponse

type ListCouponsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Errors     []Message `json:"errors"`
		Messages   []Message `json:"messages"`
		Result     []Coupon  `json:"result"`
		ResultInfo PageInfo  `json:"result_info"`

		// Success True on a 2xx and false otherwise.
		Success bool `json:"success"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParseListCouponsResponse

func ParseListCouponsResponse(rsp *http.Response) (*ListCouponsResponse, error)

ParseListCouponsResponse parses an HTTP response from a ListCouponsWithResponse call

func (ListCouponsResponse) ContentType

func (r ListCouponsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListCouponsResponse) GetBody

func (r ListCouponsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListCouponsResponse) GetJSON200

func (r ListCouponsResponse) GetJSON200() *struct {
	Errors     []Message `json:"errors"`
	Messages   []Message `json:"messages"`
	Result     []Coupon  `json:"result"`
	ResultInfo PageInfo  `json:"result_info"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListCouponsResponse) GetJSONDefault

func (r ListCouponsResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (ListCouponsResponse) Status

func (r ListCouponsResponse) Status() string

Status returns HTTPResponse.Status

func (ListCouponsResponse) StatusCode

func (r ListCouponsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListCreditNotesParams

type ListCreditNotesParams struct {
	// Customer Only this customer's.
	Customer *string  `form:"customer,omitempty" json:"customer,omitempty"`
	Page     *Page    `form:"page,omitempty" json:"page,omitempty"`
	PerPage  *PerPage `form:"per_page,omitempty" json:"per_page,omitempty"`
}

ListCreditNotesParams defines parameters for ListCreditNotes.

type ListCreditNotesResponse

type ListCreditNotesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Errors     []Message    `json:"errors"`
		Messages   []Message    `json:"messages"`
		Result     []CreditNote `json:"result"`
		ResultInfo PageInfo     `json:"result_info"`

		// Success True on a 2xx and false otherwise.
		Success bool `json:"success"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParseListCreditNotesResponse

func ParseListCreditNotesResponse(rsp *http.Response) (*ListCreditNotesResponse, error)

ParseListCreditNotesResponse parses an HTTP response from a ListCreditNotesWithResponse call

func (ListCreditNotesResponse) ContentType

func (r ListCreditNotesResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListCreditNotesResponse) GetBody

func (r ListCreditNotesResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListCreditNotesResponse) GetJSON200

func (r ListCreditNotesResponse) GetJSON200() *struct {
	Errors     []Message    `json:"errors"`
	Messages   []Message    `json:"messages"`
	Result     []CreditNote `json:"result"`
	ResultInfo PageInfo     `json:"result_info"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListCreditNotesResponse) GetJSONDefault

func (r ListCreditNotesResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (ListCreditNotesResponse) Status

func (r ListCreditNotesResponse) Status() string

Status returns HTTPResponse.Status

func (ListCreditNotesResponse) StatusCode

func (r ListCreditNotesResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListCustomersParams

type ListCustomersParams struct {
	Page    *Page    `form:"page,omitempty" json:"page,omitempty"`
	PerPage *PerPage `form:"per_page,omitempty" json:"per_page,omitempty"`
}

ListCustomersParams defines parameters for ListCustomers.

type ListCustomersResponse

type ListCustomersResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Errors     []Message  `json:"errors"`
		Messages   []Message  `json:"messages"`
		Result     []Customer `json:"result"`
		ResultInfo PageInfo   `json:"result_info"`

		// Success True on a 2xx and false otherwise.
		Success bool `json:"success"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParseListCustomersResponse

func ParseListCustomersResponse(rsp *http.Response) (*ListCustomersResponse, error)

ParseListCustomersResponse parses an HTTP response from a ListCustomersWithResponse call

func (ListCustomersResponse) ContentType

func (r ListCustomersResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListCustomersResponse) GetBody

func (r ListCustomersResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListCustomersResponse) GetJSON200

func (r ListCustomersResponse) GetJSON200() *struct {
	Errors     []Message  `json:"errors"`
	Messages   []Message  `json:"messages"`
	Result     []Customer `json:"result"`
	ResultInfo PageInfo   `json:"result_info"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListCustomersResponse) GetJSONDefault

func (r ListCustomersResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (ListCustomersResponse) Status

func (r ListCustomersResponse) Status() string

Status returns HTTPResponse.Status

func (ListCustomersResponse) StatusCode

func (r ListCustomersResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListFeaturesParams

type ListFeaturesParams struct {
	Page    *Page    `form:"page,omitempty" json:"page,omitempty"`
	PerPage *PerPage `form:"per_page,omitempty" json:"per_page,omitempty"`
}

ListFeaturesParams defines parameters for ListFeatures.

type ListFeaturesResponse

type ListFeaturesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Errors     []Message `json:"errors"`
		Messages   []Message `json:"messages"`
		Result     []Feature `json:"result"`
		ResultInfo PageInfo  `json:"result_info"`

		// Success True on a 2xx and false otherwise.
		Success bool `json:"success"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParseListFeaturesResponse

func ParseListFeaturesResponse(rsp *http.Response) (*ListFeaturesResponse, error)

ParseListFeaturesResponse parses an HTTP response from a ListFeaturesWithResponse call

func (ListFeaturesResponse) ContentType

func (r ListFeaturesResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListFeaturesResponse) GetBody

func (r ListFeaturesResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListFeaturesResponse) GetJSON200

func (r ListFeaturesResponse) GetJSON200() *struct {
	Errors     []Message `json:"errors"`
	Messages   []Message `json:"messages"`
	Result     []Feature `json:"result"`
	ResultInfo PageInfo  `json:"result_info"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListFeaturesResponse) GetJSONDefault

func (r ListFeaturesResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (ListFeaturesResponse) Status

func (r ListFeaturesResponse) Status() string

Status returns HTTPResponse.Status

func (ListFeaturesResponse) StatusCode

func (r ListFeaturesResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListInvoiceCreditNotesResponse

type ListInvoiceCreditNotesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Errors   []Message    `json:"errors"`
		Messages []Message    `json:"messages"`
		Result   []CreditNote `json:"result"`

		// Success True on a 2xx and false otherwise.
		Success bool `json:"success"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParseListInvoiceCreditNotesResponse

func ParseListInvoiceCreditNotesResponse(rsp *http.Response) (*ListInvoiceCreditNotesResponse, error)

ParseListInvoiceCreditNotesResponse parses an HTTP response from a ListInvoiceCreditNotesWithResponse call

func (ListInvoiceCreditNotesResponse) ContentType

func (r ListInvoiceCreditNotesResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListInvoiceCreditNotesResponse) GetBody

func (r ListInvoiceCreditNotesResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListInvoiceCreditNotesResponse) GetJSON200

func (r ListInvoiceCreditNotesResponse) GetJSON200() *struct {
	Errors   []Message    `json:"errors"`
	Messages []Message    `json:"messages"`
	Result   []CreditNote `json:"result"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListInvoiceCreditNotesResponse) GetJSONDefault

func (r ListInvoiceCreditNotesResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (ListInvoiceCreditNotesResponse) Status

Status returns HTTPResponse.Status

func (ListInvoiceCreditNotesResponse) StatusCode

func (r ListInvoiceCreditNotesResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListInvoicesParams

type ListInvoicesParams struct {
	// Customer Only this customer's.
	Customer *string                   `form:"customer,omitempty" json:"customer,omitempty"`
	Status   *ListInvoicesParamsStatus `form:"status,omitempty" json:"status,omitempty"`
	Page     *Page                     `form:"page,omitempty" json:"page,omitempty"`
	PerPage  *PerPage                  `form:"per_page,omitempty" json:"per_page,omitempty"`
}

ListInvoicesParams defines parameters for ListInvoices.

type ListInvoicesParamsStatus

type ListInvoicesParamsStatus string

ListInvoicesParamsStatus defines parameters for ListInvoices.

const (
	ListInvoicesParamsStatusIssued ListInvoicesParamsStatus = "issued"
	ListInvoicesParamsStatusPaid   ListInvoicesParamsStatus = "paid"
	ListInvoicesParamsStatusVoided ListInvoicesParamsStatus = "voided"
)

Defines values for ListInvoicesParamsStatus.

func (ListInvoicesParamsStatus) Valid

func (e ListInvoicesParamsStatus) Valid() bool

Valid indicates whether the value is a known member of the ListInvoicesParamsStatus enum.

type ListInvoicesResponse

type ListInvoicesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Errors     []Message `json:"errors"`
		Messages   []Message `json:"messages"`
		Result     []Invoice `json:"result"`
		ResultInfo PageInfo  `json:"result_info"`

		// Success True on a 2xx and false otherwise.
		Success bool `json:"success"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParseListInvoicesResponse

func ParseListInvoicesResponse(rsp *http.Response) (*ListInvoicesResponse, error)

ParseListInvoicesResponse parses an HTTP response from a ListInvoicesWithResponse call

func (ListInvoicesResponse) ContentType

func (r ListInvoicesResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListInvoicesResponse) GetBody

func (r ListInvoicesResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListInvoicesResponse) GetJSON200

func (r ListInvoicesResponse) GetJSON200() *struct {
	Errors     []Message `json:"errors"`
	Messages   []Message `json:"messages"`
	Result     []Invoice `json:"result"`
	ResultInfo PageInfo  `json:"result_info"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListInvoicesResponse) GetJSONDefault

func (r ListInvoicesResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (ListInvoicesResponse) Status

func (r ListInvoicesResponse) Status() string

Status returns HTTPResponse.Status

func (ListInvoicesResponse) StatusCode

func (r ListInvoicesResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListMetersParams

type ListMetersParams struct {
	Page    *Page    `form:"page,omitempty" json:"page,omitempty"`
	PerPage *PerPage `form:"per_page,omitempty" json:"per_page,omitempty"`
}

ListMetersParams defines parameters for ListMeters.

type ListMetersResponse

type ListMetersResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Errors     []Message `json:"errors"`
		Messages   []Message `json:"messages"`
		Result     []Meter   `json:"result"`
		ResultInfo PageInfo  `json:"result_info"`

		// Success True on a 2xx and false otherwise.
		Success bool `json:"success"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParseListMetersResponse

func ParseListMetersResponse(rsp *http.Response) (*ListMetersResponse, error)

ParseListMetersResponse parses an HTTP response from a ListMetersWithResponse call

func (ListMetersResponse) ContentType

func (r ListMetersResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListMetersResponse) GetBody

func (r ListMetersResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListMetersResponse) GetJSON200

func (r ListMetersResponse) GetJSON200() *struct {
	Errors     []Message `json:"errors"`
	Messages   []Message `json:"messages"`
	Result     []Meter   `json:"result"`
	ResultInfo PageInfo  `json:"result_info"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListMetersResponse) GetJSONDefault

func (r ListMetersResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (ListMetersResponse) Status

func (r ListMetersResponse) Status() string

Status returns HTTPResponse.Status

func (ListMetersResponse) StatusCode

func (r ListMetersResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListPaymentsResponse

type ListPaymentsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Errors   []Message `json:"errors"`
		Messages []Message `json:"messages"`
		Result   []Payment `json:"result"`

		// Success True on a 2xx and false otherwise.
		Success bool `json:"success"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParseListPaymentsResponse

func ParseListPaymentsResponse(rsp *http.Response) (*ListPaymentsResponse, error)

ParseListPaymentsResponse parses an HTTP response from a ListPaymentsWithResponse call

func (ListPaymentsResponse) ContentType

func (r ListPaymentsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListPaymentsResponse) GetBody

func (r ListPaymentsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListPaymentsResponse) GetJSON200

func (r ListPaymentsResponse) GetJSON200() *struct {
	Errors   []Message `json:"errors"`
	Messages []Message `json:"messages"`
	Result   []Payment `json:"result"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListPaymentsResponse) GetJSONDefault

func (r ListPaymentsResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (ListPaymentsResponse) Status

func (r ListPaymentsResponse) Status() string

Status returns HTTPResponse.Status

func (ListPaymentsResponse) StatusCode

func (r ListPaymentsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListPlansParams

type ListPlansParams struct {
	Page    *Page    `form:"page,omitempty" json:"page,omitempty"`
	PerPage *PerPage `form:"per_page,omitempty" json:"per_page,omitempty"`
}

ListPlansParams defines parameters for ListPlans.

type ListPlansResponse

type ListPlansResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Errors     []Message `json:"errors"`
		Messages   []Message `json:"messages"`
		Result     []Plan    `json:"result"`
		ResultInfo PageInfo  `json:"result_info"`

		// Success True on a 2xx and false otherwise.
		Success bool `json:"success"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParseListPlansResponse

func ParseListPlansResponse(rsp *http.Response) (*ListPlansResponse, error)

ParseListPlansResponse parses an HTTP response from a ListPlansWithResponse call

func (ListPlansResponse) ContentType

func (r ListPlansResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListPlansResponse) GetBody

func (r ListPlansResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListPlansResponse) GetJSON200

func (r ListPlansResponse) GetJSON200() *struct {
	Errors     []Message `json:"errors"`
	Messages   []Message `json:"messages"`
	Result     []Plan    `json:"result"`
	ResultInfo PageInfo  `json:"result_info"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListPlansResponse) GetJSONDefault

func (r ListPlansResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (ListPlansResponse) Status

func (r ListPlansResponse) Status() string

Status returns HTTPResponse.Status

func (ListPlansResponse) StatusCode

func (r ListPlansResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListRefundsResponse

type ListRefundsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Errors   []Message `json:"errors"`
		Messages []Message `json:"messages"`
		Result   []Refund  `json:"result"`

		// Success True on a 2xx and false otherwise.
		Success bool `json:"success"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParseListRefundsResponse

func ParseListRefundsResponse(rsp *http.Response) (*ListRefundsResponse, error)

ParseListRefundsResponse parses an HTTP response from a ListRefundsWithResponse call

func (ListRefundsResponse) ContentType

func (r ListRefundsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListRefundsResponse) GetBody

func (r ListRefundsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListRefundsResponse) GetJSON200

func (r ListRefundsResponse) GetJSON200() *struct {
	Errors   []Message `json:"errors"`
	Messages []Message `json:"messages"`
	Result   []Refund  `json:"result"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListRefundsResponse) GetJSONDefault

func (r ListRefundsResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (ListRefundsResponse) Status

func (r ListRefundsResponse) Status() string

Status returns HTTPResponse.Status

func (ListRefundsResponse) StatusCode

func (r ListRefundsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListSubscriptionsParams

type ListSubscriptionsParams struct {
	Customer string   `form:"customer" json:"customer"`
	Page     *Page    `form:"page,omitempty" json:"page,omitempty"`
	PerPage  *PerPage `form:"per_page,omitempty" json:"per_page,omitempty"`
}

ListSubscriptionsParams defines parameters for ListSubscriptions.

type ListSubscriptionsResponse

type ListSubscriptionsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Errors     []Message      `json:"errors"`
		Messages   []Message      `json:"messages"`
		Result     []Subscription `json:"result"`
		ResultInfo PageInfo       `json:"result_info"`

		// Success True on a 2xx and false otherwise.
		Success bool `json:"success"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParseListSubscriptionsResponse

func ParseListSubscriptionsResponse(rsp *http.Response) (*ListSubscriptionsResponse, error)

ParseListSubscriptionsResponse parses an HTTP response from a ListSubscriptionsWithResponse call

func (ListSubscriptionsResponse) ContentType

func (r ListSubscriptionsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListSubscriptionsResponse) GetBody

func (r ListSubscriptionsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListSubscriptionsResponse) GetJSON200

func (r ListSubscriptionsResponse) GetJSON200() *struct {
	Errors     []Message      `json:"errors"`
	Messages   []Message      `json:"messages"`
	Result     []Subscription `json:"result"`
	ResultInfo PageInfo       `json:"result_info"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListSubscriptionsResponse) GetJSONDefault

func (r ListSubscriptionsResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (ListSubscriptionsResponse) Status

func (r ListSubscriptionsResponse) Status() string

Status returns HTTPResponse.Status

func (ListSubscriptionsResponse) StatusCode

func (r ListSubscriptionsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListWebhookEndpointsResponse

type ListWebhookEndpointsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Errors   []Message         `json:"errors"`
		Messages []Message         `json:"messages"`
		Result   []WebhookEndpoint `json:"result"`

		// Success True on a 2xx and false otherwise.
		Success bool `json:"success"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParseListWebhookEndpointsResponse

func ParseListWebhookEndpointsResponse(rsp *http.Response) (*ListWebhookEndpointsResponse, error)

ParseListWebhookEndpointsResponse parses an HTTP response from a ListWebhookEndpointsWithResponse call

func (ListWebhookEndpointsResponse) ContentType

func (r ListWebhookEndpointsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListWebhookEndpointsResponse) GetBody

func (r ListWebhookEndpointsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListWebhookEndpointsResponse) GetJSON200

func (r ListWebhookEndpointsResponse) GetJSON200() *struct {
	Errors   []Message         `json:"errors"`
	Messages []Message         `json:"messages"`
	Result   []WebhookEndpoint `json:"result"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListWebhookEndpointsResponse) GetJSONDefault

func (r ListWebhookEndpointsResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (ListWebhookEndpointsResponse) Status

Status returns HTTPResponse.Status

func (ListWebhookEndpointsResponse) StatusCode

func (r ListWebhookEndpointsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Lock

type Lock struct {
	// AfterDays Days after an invoice is past due (from 00:00 UTC the day after its due date) that its customer's features lock, while it stays unpaid. null, the default, never locks.
	AfterDays *int `json:"after_days"`
}

Lock defines model for Lock.

type Message

type Message struct {
	// Code Which failure it is; branch on this. 1000 our failure, 1001 no
	// valid credentials, 1002 not allowed, 1003 not found, 1004 the
	// request can't be read, 1005 a field is invalid, 1006 conflict,
	// 1007 too many requests, 1008 briefly unavailable (see
	// Retry-After), 1009 misconfigured on our side, 1010 a second
	// factor is required, 1011 the route doesn't take this method
	// (see Allow). In `messages`, which aren't failures: 2000 a
	// subscription ends inside a period a credit note has credited, so
	// the days after its end aren't credited; issue another credit note
	// if more is owed.
	Code             int     `json:"code"`
	DocumentationUrl *string `json:"documentation_url,omitempty"`

	// Message For people. Its wording may change.
	Message string `json:"message"`
	Source  *struct {
		// Pointer A JSON Pointer to the field at fault.
		Pointer *string `json:"pointer,omitempty"`
	} `json:"source,omitempty"`
}

Message defines model for Message.

type Meter

type Meter struct {
	// Aggregation How a period's events become a quantity.
	Aggregation MeterAggregation `json:"aggregation"`
	Code        string           `json:"code"`

	// Field The event property aggregated. Required unless aggregation is count.
	Field *string `json:"field,omitempty"`
	Name  string  `json:"name"`
}

Meter defines model for Meter.

type MeterAggregation

type MeterAggregation string

MeterAggregation How a period's events become a quantity.

const (
	MeterAggregationCount       MeterAggregation = "count"
	MeterAggregationLatest      MeterAggregation = "latest"
	MeterAggregationMax         MeterAggregation = "max"
	MeterAggregationSum         MeterAggregation = "sum"
	MeterAggregationUniqueCount MeterAggregation = "unique_count"
)

Defines values for MeterAggregation.

func (MeterAggregation) Valid

func (e MeterAggregation) Valid() bool

Valid indicates whether the value is a known member of the MeterAggregation enum.

type MeterBody

type MeterBody struct {
	// Aggregation How a period's events become a quantity.
	Aggregation MeterBodyAggregation `json:"aggregation"`

	// Field The event property aggregated. Required unless aggregation is count.
	Field *string `json:"field,omitempty"`
	Name  string  `json:"name"`
}

MeterBody defines model for MeterBody.

type MeterBodyAggregation

type MeterBodyAggregation string

MeterBodyAggregation How a period's events become a quantity.

const (
	MeterBodyAggregationCount       MeterBodyAggregation = "count"
	MeterBodyAggregationLatest      MeterBodyAggregation = "latest"
	MeterBodyAggregationMax         MeterBodyAggregation = "max"
	MeterBodyAggregationSum         MeterBodyAggregation = "sum"
	MeterBodyAggregationUniqueCount MeterBodyAggregation = "unique_count"
)

Defines values for MeterBodyAggregation.

func (MeterBodyAggregation) Valid

func (e MeterBodyAggregation) Valid() bool

Valid indicates whether the value is a known member of the MeterBodyAggregation enum.

type Money

type Money struct {
	// Amount At most the currency's own decimals.
	//
	// Example: 49.00
	Amount string `json:"amount"`

	// Currency ISO 4217.
	//
	// Example: USD
	Currency string `json:"currency"`
}

Money defines model for Money.

type NewWebhookEndpoint

type NewWebhookEndpoint struct {
	CreatedAt time.Time `json:"created_at"`
	Id        string    `json:"id"`

	// Secret Example: whsec_…
	Secret string `json:"secret"`
	Url    string `json:"url"`
}

NewWebhookEndpoint defines model for NewWebhookEndpoint.

type Page

type Page = int

Page defines model for page.

type PageInfo

type PageInfo struct {
	// Count The length of `result`.
	Count      int `json:"count"`
	Page       int `json:"page"`
	PerPage    int `json:"per_page"`
	TotalCount int `json:"total_count"`
	TotalPages int `json:"total_pages"`
}

PageInfo defines model for PageInfo.

type Payment

type Payment struct {
	Amount Money `json:"amount"`

	// App The app it was charged through; null for one you reported.
	App     *string `json:"app"`
	Id      string  `json:"id"`
	Invoice string  `json:"invoice"`

	// PaidAt When the money moved; absent until it has.
	PaidAt     *time.Time `json:"paid_at,omitempty"`
	RecordedAt time.Time  `json:"recorded_at"`

	// Reference Your own reference for the payment.
	Reference string        `json:"reference"`
	Status    PaymentStatus `json:"status"`
}

Payment defines model for Payment.

type PaymentBody

type PaymentBody struct {
	Amount Money `json:"amount"`

	// PaidAt When the money moved.
	PaidAt time.Time `json:"paid_at"`

	// Reference Your own reference for the payment, unique in the project.
	Reference string `json:"reference"`
}

PaymentBody defines model for PaymentBody.

type PaymentSettings

type PaymentSettings struct {
	// PendingCheckouts reserve, the default: a pending checkout holds its amount, so a new one fits only in what's left due, and two checkouts never pay an invoice twice. allow: a pending checkout holds nothing, so two checkouts can each be paid in full, and you refund the extra yourself. Either way, a payment you report is recorded whatever is pending, since its money has already moved.
	PendingCheckouts PaymentSettingsPendingCheckouts `json:"pending_checkouts"`

	// UnpaidUpgrades What an upgrade does once its invoice is past due, unpaid. revert, the default: billing takes it back, so the customer keeps the plan they paid for to the period's end, and renews on it. lock: the invoice is like any other, and the lock decides. Omitted on a PUT, it stays as it is.
	UnpaidUpgrades *PaymentSettingsUnpaidUpgrades `json:"unpaid_upgrades,omitempty"`
}

PaymentSettings defines model for PaymentSettings.

type PaymentSettingsPendingCheckouts

type PaymentSettingsPendingCheckouts string

PaymentSettingsPendingCheckouts reserve, the default: a pending checkout holds its amount, so a new one fits only in what's left due, and two checkouts never pay an invoice twice. allow: a pending checkout holds nothing, so two checkouts can each be paid in full, and you refund the extra yourself. Either way, a payment you report is recorded whatever is pending, since its money has already moved.

const (
	Allow   PaymentSettingsPendingCheckouts = "allow"
	Reserve PaymentSettingsPendingCheckouts = "reserve"
)

Defines values for PaymentSettingsPendingCheckouts.

func (PaymentSettingsPendingCheckouts) Valid

Valid indicates whether the value is a known member of the PaymentSettingsPendingCheckouts enum.

type PaymentSettingsUnpaidUpgrades

type PaymentSettingsUnpaidUpgrades string

PaymentSettingsUnpaidUpgrades What an upgrade does once its invoice is past due, unpaid. revert, the default: billing takes it back, so the customer keeps the plan they paid for to the period's end, and renews on it. lock: the invoice is like any other, and the lock decides. Omitted on a PUT, it stays as it is.

const (
	PaymentSettingsUnpaidUpgradesLock   PaymentSettingsUnpaidUpgrades = "lock"
	PaymentSettingsUnpaidUpgradesRevert PaymentSettingsUnpaidUpgrades = "revert"
)

Defines values for PaymentSettingsUnpaidUpgrades.

func (PaymentSettingsUnpaidUpgrades) Valid

Valid indicates whether the value is a known member of the PaymentSettingsUnpaidUpgrades enum.

type PaymentStatus

type PaymentStatus string

PaymentStatus defines model for Payment.Status.

const (
	PaymentStatusAuthorized PaymentStatus = "authorized"
	PaymentStatusCancelled  PaymentStatus = "cancelled"
	PaymentStatusExpired    PaymentStatus = "expired"
	PaymentStatusFailed     PaymentStatus = "failed"
	PaymentStatusPending    PaymentStatus = "pending"
	PaymentStatusSucceeded  PaymentStatus = "succeeded"
)

Defines values for PaymentStatus.

func (PaymentStatus) Valid

func (e PaymentStatus) Valid() bool

Valid indicates whether the value is a known member of the PaymentStatus enum.

type PerPage

type PerPage = int

PerPage defines model for perPage.

type Plan

type Plan struct {
	Charges *[]Charge `json:"charges,omitempty"`
	Code    string    `json:"code"`

	// Features The codes of the features the plan includes. Leaving it out means none.
	Features *[]string `json:"features,omitempty"`
	Fee      Money     `json:"fee"`

	// FeeInAdvance Bill the fee at the start of each period.
	FeeInAdvance *bool `json:"fee_in_advance,omitempty"`

	// Interval semiannual renews every six months.
	Interval PlanInterval `json:"interval"`
	Name     string       `json:"name"`

	// PayFirst A new subscription gives nothing until its first invoice is paid, and seats added during a period count once their invoice is paid. A renewal holds nothing back; the lock decides what an unpaid one does. Like features, it follows the plan as it is now. A plan with it can't have trial days.
	PayFirst *bool `json:"pay_first,omitempty"`

	// Seats The seats billed are the count set, or minimum if that is more, less included, never below zero. Each costs extra per period, prorated by day.
	Seats     *Seats `json:"seats,omitempty"`
	TrialDays *int   `json:"trial_days,omitempty"`
}

Plan defines model for Plan.

type PlanBody

type PlanBody struct {
	Charges *[]Charge `json:"charges,omitempty"`

	// Features The codes of the features the plan includes. Leaving it out means none.
	Features *[]string `json:"features,omitempty"`
	Fee      Money     `json:"fee"`

	// FeeInAdvance Bill the fee at the start of each period.
	FeeInAdvance *bool `json:"fee_in_advance,omitempty"`

	// Interval semiannual renews every six months.
	Interval PlanBodyInterval `json:"interval"`
	Name     string           `json:"name"`

	// PayFirst A new subscription gives nothing until its first invoice is paid, and seats added during a period count once their invoice is paid. A renewal holds nothing back; the lock decides what an unpaid one does. Like features, it follows the plan as it is now. A plan with it can't have trial days.
	PayFirst *bool `json:"pay_first,omitempty"`

	// Seats The seats billed are the count set, or minimum if that is more, less included, never below zero. Each costs extra per period, prorated by day.
	Seats     *Seats `json:"seats,omitempty"`
	TrialDays *int   `json:"trial_days,omitempty"`
}

PlanBody defines model for PlanBody.

type PlanBodyInterval

type PlanBodyInterval string

PlanBodyInterval semiannual renews every six months.

const (
	PlanBodyIntervalMonthly    PlanBodyInterval = "monthly"
	PlanBodyIntervalQuarterly  PlanBodyInterval = "quarterly"
	PlanBodyIntervalSemiannual PlanBodyInterval = "semiannual"
	PlanBodyIntervalWeekly     PlanBodyInterval = "weekly"
	PlanBodyIntervalYearly     PlanBodyInterval = "yearly"
)

Defines values for PlanBodyInterval.

func (PlanBodyInterval) Valid

func (e PlanBodyInterval) Valid() bool

Valid indicates whether the value is a known member of the PlanBodyInterval enum.

type PlanInterval

type PlanInterval string

PlanInterval semiannual renews every six months.

const (
	PlanIntervalMonthly    PlanInterval = "monthly"
	PlanIntervalQuarterly  PlanInterval = "quarterly"
	PlanIntervalSemiannual PlanInterval = "semiannual"
	PlanIntervalWeekly     PlanInterval = "weekly"
	PlanIntervalYearly     PlanInterval = "yearly"
)

Defines values for PlanInterval.

func (PlanInterval) Valid

func (e PlanInterval) Valid() bool

Valid indicates whether the value is a known member of the PlanInterval enum.

type PutAppForwardJSONBody

type PutAppForwardJSONBody struct {
	// Url An https URL on the public internet, or empty.
	Url string `json:"url"`
}

PutAppForwardJSONBody defines parameters for PutAppForward.

type PutAppForwardJSONRequestBody

type PutAppForwardJSONRequestBody PutAppForwardJSONBody

PutAppForwardJSONRequestBody defines body for PutAppForward for application/json ContentType.

type PutAppForwardResponse

type PutAppForwardResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Errors   []Message `json:"errors"`
		Messages []Message `json:"messages"`
		Result   App       `json:"result"`

		// Success True on a 2xx and false otherwise.
		Success bool `json:"success"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParsePutAppForwardResponse

func ParsePutAppForwardResponse(rsp *http.Response) (*PutAppForwardResponse, error)

ParsePutAppForwardResponse parses an HTTP response from a PutAppForwardWithResponse call

func (PutAppForwardResponse) ContentType

func (r PutAppForwardResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (PutAppForwardResponse) GetBody

func (r PutAppForwardResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (PutAppForwardResponse) GetJSON200

func (r PutAppForwardResponse) GetJSON200() *struct {
	Errors   []Message `json:"errors"`
	Messages []Message `json:"messages"`
	Result   App       `json:"result"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (PutAppForwardResponse) GetJSONDefault

func (r PutAppForwardResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (PutAppForwardResponse) Status

func (r PutAppForwardResponse) Status() string

Status returns HTTPResponse.Status

func (PutAppForwardResponse) StatusCode

func (r PutAppForwardResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type PutCouponJSONRequestBody

type PutCouponJSONRequestBody = CouponBody

PutCouponJSONRequestBody defines body for PutCoupon for application/json ContentType.

type PutCouponResponse

type PutCouponResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Errors   []Message `json:"errors"`
		Messages []Message `json:"messages"`
		Result   Coupon    `json:"result"`

		// Success True on a 2xx and false otherwise.
		Success bool `json:"success"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParsePutCouponResponse

func ParsePutCouponResponse(rsp *http.Response) (*PutCouponResponse, error)

ParsePutCouponResponse parses an HTTP response from a PutCouponWithResponse call

func (PutCouponResponse) ContentType

func (r PutCouponResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (PutCouponResponse) GetBody

func (r PutCouponResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (PutCouponResponse) GetJSON200

func (r PutCouponResponse) GetJSON200() *struct {
	Errors   []Message `json:"errors"`
	Messages []Message `json:"messages"`
	Result   Coupon    `json:"result"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (PutCouponResponse) GetJSONDefault

func (r PutCouponResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (PutCouponResponse) Status

func (r PutCouponResponse) Status() string

Status returns HTTPResponse.Status

func (PutCouponResponse) StatusCode

func (r PutCouponResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type PutCustomerJSONRequestBody

type PutCustomerJSONRequestBody = CustomerBody

PutCustomerJSONRequestBody defines body for PutCustomer for application/json ContentType.

type PutCustomerResponse

type PutCustomerResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Errors   []Message `json:"errors"`
		Messages []Message `json:"messages"`
		Result   Customer  `json:"result"`

		// Success True on a 2xx and false otherwise.
		Success bool `json:"success"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParsePutCustomerResponse

func ParsePutCustomerResponse(rsp *http.Response) (*PutCustomerResponse, error)

ParsePutCustomerResponse parses an HTTP response from a PutCustomerWithResponse call

func (PutCustomerResponse) ContentType

func (r PutCustomerResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (PutCustomerResponse) GetBody

func (r PutCustomerResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (PutCustomerResponse) GetJSON200

func (r PutCustomerResponse) GetJSON200() *struct {
	Errors   []Message `json:"errors"`
	Messages []Message `json:"messages"`
	Result   Customer  `json:"result"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (PutCustomerResponse) GetJSONDefault

func (r PutCustomerResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (PutCustomerResponse) Status

func (r PutCustomerResponse) Status() string

Status returns HTTPResponse.Status

func (PutCustomerResponse) StatusCode

func (r PutCustomerResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type PutFeatureJSONRequestBody

type PutFeatureJSONRequestBody = FeatureBody

PutFeatureJSONRequestBody defines body for PutFeature for application/json ContentType.

type PutFeatureResponse

type PutFeatureResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Errors   []Message `json:"errors"`
		Messages []Message `json:"messages"`

		// Result Something a plan can include, which your app unlocks for customers whose subscriptions include it.
		Result Feature `json:"result"`

		// Success True on a 2xx and false otherwise.
		Success bool `json:"success"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParsePutFeatureResponse

func ParsePutFeatureResponse(rsp *http.Response) (*PutFeatureResponse, error)

ParsePutFeatureResponse parses an HTTP response from a PutFeatureWithResponse call

func (PutFeatureResponse) ContentType

func (r PutFeatureResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (PutFeatureResponse) GetBody

func (r PutFeatureResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (PutFeatureResponse) GetJSON200

func (r PutFeatureResponse) GetJSON200() *struct {
	Errors   []Message `json:"errors"`
	Messages []Message `json:"messages"`

	// Result Something a plan can include, which your app unlocks for customers whose subscriptions include it.
	Result Feature `json:"result"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (PutFeatureResponse) GetJSONDefault

func (r PutFeatureResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (PutFeatureResponse) Status

func (r PutFeatureResponse) Status() string

Status returns HTTPResponse.Status

func (PutFeatureResponse) StatusCode

func (r PutFeatureResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type PutLockJSONRequestBody

type PutLockJSONRequestBody = Lock

PutLockJSONRequestBody defines body for PutLock for application/json ContentType.

type PutLockResponse

type PutLockResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Errors   []Message `json:"errors"`
		Messages []Message `json:"messages"`
		Result   Lock      `json:"result"`

		// Success True on a 2xx and false otherwise.
		Success bool `json:"success"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParsePutLockResponse

func ParsePutLockResponse(rsp *http.Response) (*PutLockResponse, error)

ParsePutLockResponse parses an HTTP response from a PutLockWithResponse call

func (PutLockResponse) ContentType

func (r PutLockResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (PutLockResponse) GetBody

func (r PutLockResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (PutLockResponse) GetJSON200

func (r PutLockResponse) GetJSON200() *struct {
	Errors   []Message `json:"errors"`
	Messages []Message `json:"messages"`
	Result   Lock      `json:"result"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (PutLockResponse) GetJSONDefault

func (r PutLockResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (PutLockResponse) Status

func (r PutLockResponse) Status() string

Status returns HTTPResponse.Status

func (PutLockResponse) StatusCode

func (r PutLockResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type PutMeterJSONRequestBody

type PutMeterJSONRequestBody = MeterBody

PutMeterJSONRequestBody defines body for PutMeter for application/json ContentType.

type PutMeterResponse

type PutMeterResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Errors   []Message `json:"errors"`
		Messages []Message `json:"messages"`
		Result   Meter     `json:"result"`

		// Success True on a 2xx and false otherwise.
		Success bool `json:"success"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParsePutMeterResponse

func ParsePutMeterResponse(rsp *http.Response) (*PutMeterResponse, error)

ParsePutMeterResponse parses an HTTP response from a PutMeterWithResponse call

func (PutMeterResponse) ContentType

func (r PutMeterResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (PutMeterResponse) GetBody

func (r PutMeterResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (PutMeterResponse) GetJSON200

func (r PutMeterResponse) GetJSON200() *struct {
	Errors   []Message `json:"errors"`
	Messages []Message `json:"messages"`
	Result   Meter     `json:"result"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (PutMeterResponse) GetJSONDefault

func (r PutMeterResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (PutMeterResponse) Status

func (r PutMeterResponse) Status() string

Status returns HTTPResponse.Status

func (PutMeterResponse) StatusCode

func (r PutMeterResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type PutPaymentSettingsJSONRequestBody

type PutPaymentSettingsJSONRequestBody = PaymentSettings

PutPaymentSettingsJSONRequestBody defines body for PutPaymentSettings for application/json ContentType.

type PutPaymentSettingsResponse

type PutPaymentSettingsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Errors   []Message       `json:"errors"`
		Messages []Message       `json:"messages"`
		Result   PaymentSettings `json:"result"`

		// Success True on a 2xx and false otherwise.
		Success bool `json:"success"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParsePutPaymentSettingsResponse

func ParsePutPaymentSettingsResponse(rsp *http.Response) (*PutPaymentSettingsResponse, error)

ParsePutPaymentSettingsResponse parses an HTTP response from a PutPaymentSettingsWithResponse call

func (PutPaymentSettingsResponse) ContentType

func (r PutPaymentSettingsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (PutPaymentSettingsResponse) GetBody

func (r PutPaymentSettingsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (PutPaymentSettingsResponse) GetJSON200

func (r PutPaymentSettingsResponse) GetJSON200() *struct {
	Errors   []Message       `json:"errors"`
	Messages []Message       `json:"messages"`
	Result   PaymentSettings `json:"result"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (PutPaymentSettingsResponse) GetJSONDefault

func (r PutPaymentSettingsResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (PutPaymentSettingsResponse) Status

Status returns HTTPResponse.Status

func (PutPaymentSettingsResponse) StatusCode

func (r PutPaymentSettingsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type PutPlanJSONRequestBody

type PutPlanJSONRequestBody = PlanBody

PutPlanJSONRequestBody defines body for PutPlan for application/json ContentType.

type PutPlanResponse

type PutPlanResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Errors   []Message `json:"errors"`
		Messages []Message `json:"messages"`
		Result   Plan      `json:"result"`

		// Success True on a 2xx and false otherwise.
		Success bool `json:"success"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParsePutPlanResponse

func ParsePutPlanResponse(rsp *http.Response) (*PutPlanResponse, error)

ParsePutPlanResponse parses an HTTP response from a PutPlanWithResponse call

func (PutPlanResponse) ContentType

func (r PutPlanResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (PutPlanResponse) GetBody

func (r PutPlanResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (PutPlanResponse) GetJSON200

func (r PutPlanResponse) GetJSON200() *struct {
	Errors   []Message `json:"errors"`
	Messages []Message `json:"messages"`
	Result   Plan      `json:"result"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (PutPlanResponse) GetJSONDefault

func (r PutPlanResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (PutPlanResponse) Status

func (r PutPlanResponse) Status() string

Status returns HTTPResponse.Status

func (PutPlanResponse) StatusCode

func (r PutPlanResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type PutSubscriptionJSONRequestBody

type PutSubscriptionJSONRequestBody = SubscriptionBody

PutSubscriptionJSONRequestBody defines body for PutSubscription for application/json ContentType.

type PutSubscriptionResponse

type PutSubscriptionResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Errors   []Message    `json:"errors"`
		Messages []Message    `json:"messages"`
		Result   Subscription `json:"result"`

		// Success True on a 2xx and false otherwise.
		Success bool `json:"success"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParsePutSubscriptionResponse

func ParsePutSubscriptionResponse(rsp *http.Response) (*PutSubscriptionResponse, error)

ParsePutSubscriptionResponse parses an HTTP response from a PutSubscriptionWithResponse call

func (PutSubscriptionResponse) ContentType

func (r PutSubscriptionResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (PutSubscriptionResponse) GetBody

func (r PutSubscriptionResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (PutSubscriptionResponse) GetJSON200

func (r PutSubscriptionResponse) GetJSON200() *struct {
	Errors   []Message    `json:"errors"`
	Messages []Message    `json:"messages"`
	Result   Subscription `json:"result"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (PutSubscriptionResponse) GetJSONDefault

func (r PutSubscriptionResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (PutSubscriptionResponse) Status

func (r PutSubscriptionResponse) Status() string

Status returns HTTPResponse.Status

func (PutSubscriptionResponse) StatusCode

func (r PutSubscriptionResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Quote

type Quote struct {
	AcceptedAt *time.Time `json:"accepted_at,omitempty"`
	CreatedAt  time.Time  `json:"created_at"`

	// ExpiresAt The end of the UTC day it was made.
	ExpiresAt time.Time          `json:"expires_at"`
	Id        openapi_types.UUID `json:"id"`
	Lines     []QuoteLine        `json:"lines"`

	// Renewal What a subscription's next period bills at its start, as it stands. For showing; it can't be accepted.
	Renewal *QuoteRenewal `json:"renewal,omitempty"`

	// Seats A subscription's seats set to new counts, as PUT /subscriptions/{id}/seats would set them.
	Seats *QuoteSeats `json:"seats,omitempty"`

	// Subscription A new subscription, as PUT /subscriptions/{id} would make it, without starts_at. Or an active one's upgrade, with change: upgrade, between plans with no fee billed in advance: its lines are the upgrade's invoice, each charge's new price for the rest of the period, and a credit line for each line the period paid in advance, for the days left. A downgrade or a change of term isn't quoted.
	Subscription *QuoteSubscription `json:"subscription,omitempty"`
	Total        Money              `json:"total"`
}

Quote defines model for Quote.

type QuoteBody

type QuoteBody struct {
	// Renewal What a subscription's next period bills at its start, as it stands. For showing; it can't be accepted.
	Renewal *QuoteRenewal `json:"renewal,omitempty"`

	// Seats A subscription's seats set to new counts, as PUT /subscriptions/{id}/seats would set them.
	Seats *QuoteSeats `json:"seats,omitempty"`

	// Subscription A new subscription, as PUT /subscriptions/{id} would make it, without starts_at. Or an active one's upgrade, with change: upgrade, between plans with no fee billed in advance: its lines are the upgrade's invoice, each charge's new price for the rest of the period, and a credit line for each line the period paid in advance, for the days left. A downgrade or a change of term isn't quoted.
	Subscription *QuoteSubscription `json:"subscription,omitempty"`
}

QuoteBody Exactly one of subscription, seats and renewal.

type QuoteId

type QuoteId = openapi_types.UUID

QuoteId defines model for quoteId.

type QuoteLine

type QuoteLine struct {
	// AddOn The add-on plan's code it bills; left out for the subscription's own plan.
	AddOn  *string `json:"add_on,omitempty"`
	Amount Money   `json:"amount"`

	// Description The plan's name, an add-on's, or Seats.
	Description string    `json:"description"`
	From        time.Time `json:"from"`

	// Kind fee: the plan's or an add-on's fee. seats: seats billed. credit: an upgrade's only, what a credit note gives back of what the period paid in advance, which comes off its invoice; its amount is negative.
	Kind QuoteLineKind `json:"kind"`

	// Renewal It bills a period the subscription renews into.
	Renewal *bool `json:"renewal,omitempty"`

	// Seats A seats line's seats, before proration.
	Seats *int `json:"seats,omitempty"`

	// To The period's last second.
	To time.Time `json:"to"`
}

QuoteLine One line the change bills at once, as its invoice will have it.

type QuoteLineKind

type QuoteLineKind string

QuoteLineKind fee: the plan's or an add-on's fee. seats: seats billed. credit: an upgrade's only, what a credit note gives back of what the period paid in advance, which comes off its invoice; its amount is negative.

const (
	QuoteLineKindCredit QuoteLineKind = "credit"
	QuoteLineKindFee    QuoteLineKind = "fee"
	QuoteLineKindSeats  QuoteLineKind = "seats"
)

Defines values for QuoteLineKind.

func (QuoteLineKind) Valid

func (e QuoteLineKind) Valid() bool

Valid indicates whether the value is a known member of the QuoteLineKind enum.

type QuoteRenewal

type QuoteRenewal struct {
	Subscription string `json:"subscription"`
}

QuoteRenewal What a subscription's next period bills at its start, as it stands. For showing; it can't be accepted.

type QuoteSeats

type QuoteSeats struct {
	// AddOns Each add-on's seats, by its plan's code. An add-on left out keeps its seats.
	AddOns *map[string]int `json:"add_ons,omitempty"`

	// Quantity The plan's seats.
	Quantity     int    `json:"quantity"`
	Subscription string `json:"subscription"`
}

QuoteSeats A subscription's seats set to new counts, as PUT /subscriptions/{id}/seats would set them.

type QuoteSubscription

type QuoteSubscription struct {
	// AddOns Plans sold on the subscription, billed on its invoices, their features joining its own. Each has the plan's interval and currency, and no usage charges or trial. A PUT replaces them: one added bills now, at its prices now; one left out bills nothing from the next period, or from now for what it bills in arrears.
	AddOns *[]AddOn `json:"add_ons,omitempty"`

	// Anniversary Periods run from starts_at instead of calendar periods.
	Anniversary *bool `json:"anniversary,omitempty"`

	// Change Required when an active subscription moves to another plan, and read at no other time. upgrade is made now: the new plan's prices for the rest of the period, less what the period paid for in advance, on one invoice. It keeps the interval and currency, keeps whatever was paid for in advance, and starts with the seats it has; fewer seats wait for the next period. downgrade is made at the period's end. Either is refused where billing can't make it that way: then end the subscription at its period_end and start a new one then, with continues.
	Change *QuoteSubscriptionChange `json:"change,omitempty"`

	// Continues Set only when the subscription is made: the ID of another of the customer's subscriptions, whose ends_at is this one's starts_at. This one's first period then opens like a renewal, so on a pay_first plan its first invoice holds nothing back, and the lock decides if it's unpaid. After a downgrade made at the period's end, it is the subscription's own ID.
	Continues *string `json:"continues,omitempty"`

	// Customer The customer's id.
	Customer string `json:"customer"`

	// EndsAt Ends the subscription as this day starts, within the hour, without renewing it then. It must be 00:00 UTC, after now and after starts_at. To cancel at the period's end, send period_end. For a fixed term with anniversary periods, send the day starts_at falls on plus the term. Omit it to renew until the subscription is ended, since a PUT replaces the subscription.
	EndsAt *time.Time `json:"ends_at,omitempty"`

	// Id Your own ID for it.
	Id string `json:"id"`

	// Plan The plan's code.
	Plan string `json:"plan"`

	// Seats Only on a plan with seats.
	Seats *int `json:"seats,omitempty"`

	// StartsAt Omit to start now.
	StartsAt *time.Time `json:"starts_at,omitempty"`
}

QuoteSubscription A new subscription, as PUT /subscriptions/{id} would make it, without starts_at. Or an active one's upgrade, with change: upgrade, between plans with no fee billed in advance: its lines are the upgrade's invoice, each charge's new price for the rest of the period, and a credit line for each line the period paid in advance, for the days left. A downgrade or a change of term isn't quoted.

type QuoteSubscriptionChange

type QuoteSubscriptionChange string

QuoteSubscriptionChange Required when an active subscription moves to another plan, and read at no other time. upgrade is made now: the new plan's prices for the rest of the period, less what the period paid for in advance, on one invoice. It keeps the interval and currency, keeps whatever was paid for in advance, and starts with the seats it has; fewer seats wait for the next period. downgrade is made at the period's end. Either is refused where billing can't make it that way: then end the subscription at its period_end and start a new one then, with continues.

const (
	QuoteSubscriptionChangeDowngrade QuoteSubscriptionChange = "downgrade"
	QuoteSubscriptionChangeUpgrade   QuoteSubscriptionChange = "upgrade"
)

Defines values for QuoteSubscriptionChange.

func (QuoteSubscriptionChange) Valid

func (e QuoteSubscriptionChange) Valid() bool

Valid indicates whether the value is a known member of the QuoteSubscriptionChange enum.

type Rate

type Rate struct {
	// Amount Up to 12 decimals.
	//
	// Example: 0.002
	Amount string `json:"amount"`

	// Currency Example: USD
	Currency string `json:"currency"`
}

Rate A price per unit, which may be finer than the currency's minor unit.

type RecordEventsJSONBody

type RecordEventsJSONBody struct {
	Events []Event `json:"events"`
}

RecordEventsJSONBody defines parameters for RecordEvents.

type RecordEventsJSONRequestBody

type RecordEventsJSONRequestBody RecordEventsJSONBody

RecordEventsJSONRequestBody defines body for RecordEvents for application/json ContentType.

type RecordEventsResponse

type RecordEventsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON202 the response for an HTTP 202 `application/json` response
	JSON202 *Done
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParseRecordEventsResponse

func ParseRecordEventsResponse(rsp *http.Response) (*RecordEventsResponse, error)

ParseRecordEventsResponse parses an HTTP response from a RecordEventsWithResponse call

func (RecordEventsResponse) ContentType

func (r RecordEventsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (RecordEventsResponse) GetBody

func (r RecordEventsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (RecordEventsResponse) GetJSON202

func (r RecordEventsResponse) GetJSON202() *Done

GetJSON202 returns the response for an HTTP 202 `application/json` response

func (RecordEventsResponse) GetJSONDefault

func (r RecordEventsResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (RecordEventsResponse) Status

func (r RecordEventsResponse) Status() string

Status returns HTTPResponse.Status

func (RecordEventsResponse) StatusCode

func (r RecordEventsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type RecordPaymentJSONRequestBody

type RecordPaymentJSONRequestBody = PaymentBody

RecordPaymentJSONRequestBody defines body for RecordPayment for application/json ContentType.

type RecordPaymentResponse

type RecordPaymentResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Errors   []Message `json:"errors"`
		Messages []Message `json:"messages"`
		Result   Payment   `json:"result"`

		// Success True on a 2xx and false otherwise.
		Success bool `json:"success"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParseRecordPaymentResponse

func ParseRecordPaymentResponse(rsp *http.Response) (*RecordPaymentResponse, error)

ParseRecordPaymentResponse parses an HTTP response from a RecordPaymentWithResponse call

func (RecordPaymentResponse) ContentType

func (r RecordPaymentResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (RecordPaymentResponse) GetBody

func (r RecordPaymentResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (RecordPaymentResponse) GetJSON200

func (r RecordPaymentResponse) GetJSON200() *struct {
	Errors   []Message `json:"errors"`
	Messages []Message `json:"messages"`
	Result   Payment   `json:"result"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (RecordPaymentResponse) GetJSONDefault

func (r RecordPaymentResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (RecordPaymentResponse) Status

func (r RecordPaymentResponse) Status() string

Status returns HTTPResponse.Status

func (RecordPaymentResponse) StatusCode

func (r RecordPaymentResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Refund

type Refund struct {
	Amount Money `json:"amount"`

	// App The app it was refunded through; null for one you reported.
	App        *string             `json:"app,omitempty"`
	CreditNote *openapi_types.UUID `json:"credit_note,omitempty"`
	Id         openapi_types.UUID  `json:"id"`
	Invoice    string              `json:"invoice"`
	Payment    openapi_types.UUID  `json:"payment"`

	// Reason A failed one's: why, as the gateway said.
	Reason     *string   `json:"reason,omitempty"`
	RecordedAt time.Time `json:"recorded_at"`
	Reference  string    `json:"reference"`

	// RefundedAt When the money moved; absent until it has.
	RefundedAt *time.Time   `json:"refunded_at,omitempty"`
	Status     RefundStatus `json:"status"`
}

Refund defines model for Refund.

type RefundBody

type RefundBody struct {
	Amount Money `json:"amount"`

	// CreditNote The credit note whose refund part this pays out. Leave it out to give back money paid twice.
	CreditNote *openapi_types.UUID `json:"credit_note,omitempty"`

	// Payment The payment on the invoice the money goes back on.
	Payment openapi_types.UUID `json:"payment"`

	// Reference Your own reference for the refund, unique in the project among refunds.
	Reference string `json:"reference"`

	// RefundedAt For money you gave back yourself, by transfer or cash: when. Leave it out to refund through the app the payment was made on.
	RefundedAt *time.Time `json:"refunded_at,omitempty"`
}

RefundBody defines model for RefundBody.

type RefundStatus

type RefundStatus string

RefundStatus defines model for Refund.Status.

const (
	RefundStatusFailed    RefundStatus = "failed"
	RefundStatusPending   RefundStatus = "pending"
	RefundStatusSucceeded RefundStatus = "succeeded"
)

Defines values for RefundStatus.

func (RefundStatus) Valid

func (e RefundStatus) Valid() bool

Valid indicates whether the value is a known member of the RefundStatus enum.

type RemoveWebhookEndpointResponse

type RemoveWebhookEndpointResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *Done
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParseRemoveWebhookEndpointResponse

func ParseRemoveWebhookEndpointResponse(rsp *http.Response) (*RemoveWebhookEndpointResponse, error)

ParseRemoveWebhookEndpointResponse parses an HTTP response from a RemoveWebhookEndpointWithResponse call

func (RemoveWebhookEndpointResponse) ContentType

func (r RemoveWebhookEndpointResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (RemoveWebhookEndpointResponse) GetBody

func (r RemoveWebhookEndpointResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (RemoveWebhookEndpointResponse) GetJSON200

func (r RemoveWebhookEndpointResponse) GetJSON200() *Done

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (RemoveWebhookEndpointResponse) GetJSONDefault

func (r RemoveWebhookEndpointResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (RemoveWebhookEndpointResponse) Status

Status returns HTTPResponse.Status

func (RemoveWebhookEndpointResponse) StatusCode

func (r RemoveWebhookEndpointResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

type Seats

type Seats struct {
	Extra Money `json:"extra"`

	// InAdvance Bill the seats at the start of each period, and seats added during one at once, prorated; fewer seats take effect at the next period. Otherwise they're billed at the period's end.
	InAdvance *bool `json:"in_advance,omitempty"`

	// Included Seats the fee covers.
	Included int `json:"included"`

	// Minimum The fewest seats billed, however few are set.
	Minimum *int `json:"minimum,omitempty"`
}

Seats The seats billed are the count set, or minimum if that is more, less included, never below zero. Each costs extra per period, prorated by day.

type SetSeatsJSONBody

type SetSeatsJSONBody struct {
	// AddOns Each add-on's seats, by its plan's code. An add-on left out keeps its seats.
	AddOns *map[string]int `json:"add_ons,omitempty"`

	// Quantity The plan's seats.
	Quantity int `json:"quantity"`
}

SetSeatsJSONBody defines parameters for SetSeats.

type SetSeatsJSONRequestBody

type SetSeatsJSONRequestBody SetSeatsJSONBody

SetSeatsJSONRequestBody defines body for SetSeats for application/json ContentType.

type SetSeatsResponse

type SetSeatsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *Done
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParseSetSeatsResponse

func ParseSetSeatsResponse(rsp *http.Response) (*SetSeatsResponse, error)

ParseSetSeatsResponse parses an HTTP response from a SetSeatsWithResponse call

func (SetSeatsResponse) ContentType

func (r SetSeatsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (SetSeatsResponse) GetBody

func (r SetSeatsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (SetSeatsResponse) GetJSON200

func (r SetSeatsResponse) GetJSON200() *Done

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (SetSeatsResponse) GetJSONDefault

func (r SetSeatsResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (SetSeatsResponse) Status

func (r SetSeatsResponse) Status() string

Status returns HTTPResponse.Status

func (SetSeatsResponse) StatusCode

func (r SetSeatsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type StartCheckoutJSONRequestBody

type StartCheckoutJSONRequestBody = CheckoutBody

StartCheckoutJSONRequestBody defines body for StartCheckout for application/json ContentType.

type StartCheckoutResponse

type StartCheckoutResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Errors   []Message `json:"errors"`
		Messages []Message `json:"messages"`
		Result   Checkout  `json:"result"`

		// Success True on a 2xx and false otherwise.
		Success bool `json:"success"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParseStartCheckoutResponse

func ParseStartCheckoutResponse(rsp *http.Response) (*StartCheckoutResponse, error)

ParseStartCheckoutResponse parses an HTTP response from a StartCheckoutWithResponse call

func (StartCheckoutResponse) ContentType

func (r StartCheckoutResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (StartCheckoutResponse) GetBody

func (r StartCheckoutResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (StartCheckoutResponse) GetJSON200

func (r StartCheckoutResponse) GetJSON200() *struct {
	Errors   []Message `json:"errors"`
	Messages []Message `json:"messages"`
	Result   Checkout  `json:"result"`

	// Success True on a 2xx and false otherwise.
	Success bool `json:"success"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (StartCheckoutResponse) GetJSONDefault

func (r StartCheckoutResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (StartCheckoutResponse) Status

func (r StartCheckoutResponse) Status() string

Status returns HTTPResponse.Status

func (StartCheckoutResponse) StatusCode

func (r StartCheckoutResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Subscription

type Subscription struct {
	// AddOns Plans sold on the subscription, billed on its invoices, their features joining its own. Each has the plan's interval and currency, and no usage charges or trial. A PUT replaces them: one added bills now, at its prices now; one left out bills nothing from the next period, or from now for what it bills in arrears.
	AddOns *[]AddOn `json:"add_ons,omitempty"`

	// Anniversary Periods run from starts_at instead of calendar periods.
	Anniversary *bool `json:"anniversary,omitempty"`

	// Change Required when an active subscription moves to another plan, and read at no other time. upgrade is made now: the new plan's prices for the rest of the period, less what the period paid for in advance, on one invoice. It keeps the interval and currency, keeps whatever was paid for in advance, and starts with the seats it has; fewer seats wait for the next period. downgrade is made at the period's end. Either is refused where billing can't make it that way: then end the subscription at its period_end and start a new one then, with continues.
	Change *SubscriptionChange `json:"change,omitempty"`

	// Continues Set only when the subscription is made: the ID of another of the customer's subscriptions, whose ends_at is this one's starts_at. This one's first period then opens like a renewal, so on a pay_first plan its first invoice holds nothing back, and the lock decides if it's unpaid. After a downgrade made at the period's end, it is the subscription's own ID.
	Continues *string `json:"continues,omitempty"`

	// Customer The customer's id.
	Customer string `json:"customer"`

	// EndsAt Ends the subscription as this day starts, within the hour, without renewing it then. It must be 00:00 UTC, after now and after starts_at. To cancel at the period's end, send period_end. For a fixed term with anniversary periods, send the day starts_at falls on plus the term. Omit it to renew until the subscription is ended, since a PUT replaces the subscription.
	EndsAt *time.Time `json:"ends_at,omitempty"`
	Id     string     `json:"id"`

	// NextPlan A downgrade waiting for the end of the period.
	NextPlan *string `json:"next_plan,omitempty"`

	// PeriodEnd The end of an active subscription's current billing period, which is the next one's start, at 00:00 UTC.
	PeriodEnd *time.Time `json:"period_end,omitempty"`

	// PeriodStart An active subscription's current billing period starts here.
	PeriodStart *time.Time `json:"period_start,omitempty"`

	// Plan The plan's code.
	Plan string `json:"plan"`

	// Seats Only on a plan with seats.
	Seats *int `json:"seats,omitempty"`

	// StartsAt Omit to start now.
	StartsAt *time.Time         `json:"starts_at,omitempty"`
	Status   SubscriptionStatus `json:"status"`
}

Subscription defines model for Subscription.

type SubscriptionBody

type SubscriptionBody struct {
	// AddOns Plans sold on the subscription, billed on its invoices, their features joining its own. Each has the plan's interval and currency, and no usage charges or trial. A PUT replaces them: one added bills now, at its prices now; one left out bills nothing from the next period, or from now for what it bills in arrears.
	AddOns *[]AddOn `json:"add_ons,omitempty"`

	// Anniversary Periods run from starts_at instead of calendar periods.
	Anniversary *bool `json:"anniversary,omitempty"`

	// Change Required when an active subscription moves to another plan, and read at no other time. upgrade is made now: the new plan's prices for the rest of the period, less what the period paid for in advance, on one invoice. It keeps the interval and currency, keeps whatever was paid for in advance, and starts with the seats it has; fewer seats wait for the next period. downgrade is made at the period's end. Either is refused where billing can't make it that way: then end the subscription at its period_end and start a new one then, with continues.
	Change *SubscriptionBodyChange `json:"change,omitempty"`

	// Continues Set only when the subscription is made: the ID of another of the customer's subscriptions, whose ends_at is this one's starts_at. This one's first period then opens like a renewal, so on a pay_first plan its first invoice holds nothing back, and the lock decides if it's unpaid. After a downgrade made at the period's end, it is the subscription's own ID.
	Continues *string `json:"continues,omitempty"`

	// Customer The customer's id.
	Customer string `json:"customer"`

	// EndsAt Ends the subscription as this day starts, within the hour, without renewing it then. It must be 00:00 UTC, after now and after starts_at. To cancel at the period's end, send period_end. For a fixed term with anniversary periods, send the day starts_at falls on plus the term. Omit it to renew until the subscription is ended, since a PUT replaces the subscription.
	EndsAt *time.Time `json:"ends_at,omitempty"`

	// Plan The plan's code.
	Plan string `json:"plan"`

	// Seats Only on a plan with seats.
	Seats *int `json:"seats,omitempty"`

	// StartsAt Omit to start now.
	StartsAt *time.Time `json:"starts_at,omitempty"`
}

SubscriptionBody defines model for SubscriptionBody.

type SubscriptionBodyChange

type SubscriptionBodyChange string

SubscriptionBodyChange Required when an active subscription moves to another plan, and read at no other time. upgrade is made now: the new plan's prices for the rest of the period, less what the period paid for in advance, on one invoice. It keeps the interval and currency, keeps whatever was paid for in advance, and starts with the seats it has; fewer seats wait for the next period. downgrade is made at the period's end. Either is refused where billing can't make it that way: then end the subscription at its period_end and start a new one then, with continues.

const (
	SubscriptionBodyChangeDowngrade SubscriptionBodyChange = "downgrade"
	SubscriptionBodyChangeUpgrade   SubscriptionBodyChange = "upgrade"
)

Defines values for SubscriptionBodyChange.

func (SubscriptionBodyChange) Valid

func (e SubscriptionBodyChange) Valid() bool

Valid indicates whether the value is a known member of the SubscriptionBodyChange enum.

type SubscriptionChange

type SubscriptionChange string

SubscriptionChange Required when an active subscription moves to another plan, and read at no other time. upgrade is made now: the new plan's prices for the rest of the period, less what the period paid for in advance, on one invoice. It keeps the interval and currency, keeps whatever was paid for in advance, and starts with the seats it has; fewer seats wait for the next period. downgrade is made at the period's end. Either is refused where billing can't make it that way: then end the subscription at its period_end and start a new one then, with continues.

const (
	SubscriptionChangeDowngrade SubscriptionChange = "downgrade"
	SubscriptionChangeUpgrade   SubscriptionChange = "upgrade"
)

Defines values for SubscriptionChange.

func (SubscriptionChange) Valid

func (e SubscriptionChange) Valid() bool

Valid indicates whether the value is a known member of the SubscriptionChange enum.

type SubscriptionStatus

type SubscriptionStatus string

SubscriptionStatus defines model for Subscription.Status.

const (
	SubscriptionStatusActive     SubscriptionStatus = "active"
	SubscriptionStatusPending    SubscriptionStatus = "pending"
	SubscriptionStatusTerminated SubscriptionStatus = "terminated"
)

Defines values for SubscriptionStatus.

func (SubscriptionStatus) Valid

func (e SubscriptionStatus) Valid() bool

Valid indicates whether the value is a known member of the SubscriptionStatus enum.

type Summary

type Summary struct {
	// BillingSince When billing was turned on for the project.
	BillingSince time.Time `json:"billing_since"`

	// Country Where the project sells from, ISO 3166-1. It can't change.
	//
	// Example: IQ
	Country string `json:"country"`

	// Currency The default invoice currency. It can't change.
	//
	// Example: IQD
	Currency string `json:"currency"`
	Invoices struct {
		// Issued Invoices issued from that day on, voided ones left out.
		Issued int `json:"issued"`

		// Since The first day counted.
		Since openapi_types.Date `json:"since"`

		// Totals Their totals, one per currency, the project's own first. Empty when none were issued.
		Totals []Money `json:"totals"`
	} `json:"invoices"`
}

Summary defines model for Summary.

type TerminateSubscriptionResponse

type TerminateSubscriptionResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *Done
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Failure
}

func ParseTerminateSubscriptionResponse

func ParseTerminateSubscriptionResponse(rsp *http.Response) (*TerminateSubscriptionResponse, error)

ParseTerminateSubscriptionResponse parses an HTTP response from a TerminateSubscriptionWithResponse call

func (TerminateSubscriptionResponse) ContentType

func (r TerminateSubscriptionResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (TerminateSubscriptionResponse) GetBody

func (r TerminateSubscriptionResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (TerminateSubscriptionResponse) GetJSON200

func (r TerminateSubscriptionResponse) GetJSON200() *Done

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (TerminateSubscriptionResponse) GetJSONDefault

func (r TerminateSubscriptionResponse) GetJSONDefault() *Failure

GetJSONDefault returns the response for an HTTP default `application/json` response

func (TerminateSubscriptionResponse) Status

Status returns HTTPResponse.Status

func (TerminateSubscriptionResponse) StatusCode

func (r TerminateSubscriptionResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Tier

type Tier struct {
	Flat *Money `json:"flat,omitempty"`

	// Price A price per unit, which may be finer than the currency's minor unit.
	Price Rate `json:"price"`

	// UpTo The tier's last unit. Omitted on the last tier.
	UpTo *int64 `json:"up_to,omitempty"`
}

Tier defines model for Tier.

type WebhookEndpoint

type WebhookEndpoint struct {
	CreatedAt time.Time `json:"created_at"`
	Id        string    `json:"id"`
	Url       string    `json:"url"`
}

WebhookEndpoint defines model for WebhookEndpoint.

Jump to

Keyboard shortcuts

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