projectbilling

package
v0.47.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BillingGroupStateTypeChoices added in v0.3.0

func BillingGroupStateTypeChoices() []string

func CreditTypeChoices added in v0.3.0

func CreditTypeChoices() []string

func CurrencyTypeChoices added in v0.3.0

func CurrencyTypeChoices() []string

func InvoiceStateTypeChoices added in v0.3.0

func InvoiceStateTypeChoices() []string

Types

type BillingGroupStateType added in v0.3.0

type BillingGroupStateType string
const (
	BillingGroupStateTypeActive  BillingGroupStateType = "active"
	BillingGroupStateTypeDeleted BillingGroupStateType = "deleted"
)

type CreditOut

type CreditOut struct {
	Code           *string    `json:"code,omitempty"`            // Credit code
	ExpireTime     *time.Time `json:"expire_time,omitempty"`     // Timestamp in ISO 8601 format, always in UTC
	RemainingValue *string    `json:"remaining_value,omitempty"` // Remaining credit value
	StartTime      *time.Time `json:"start_time,omitempty"`      // Timestamp in ISO 8601 format, always in UTC
	Type           CreditType `json:"type,omitempty"`            // Credit type
	Value          *string    `json:"value,omitempty"`           // Original credit value, or for expired credits, the consumed credit value
}

type CreditType added in v0.3.0

type CreditType string
const (
	CreditTypeDiscount    CreditType = "discount"
	CreditTypeEmployee    CreditType = "employee"
	CreditTypeEvaluation  CreditType = "evaluation"
	CreditTypeInternal    CreditType = "internal"
	CreditTypeOther       CreditType = "other"
	CreditTypeOutage      CreditType = "outage"
	CreditTypePartner     CreditType = "partner"
	CreditTypePromotion   CreditType = "promotion"
	CreditTypePurchase    CreditType = "purchase"
	CreditTypeReferral    CreditType = "referral"
	CreditTypeSponsorship CreditType = "sponsorship"
	CreditTypeTrial       CreditType = "trial"
	CreditTypeTrialOver   CreditType = "trial_over"
)

type CurrencyType added in v0.3.0

type CurrencyType string
const (
	CurrencyTypeAud CurrencyType = "AUD"
	CurrencyTypeCad CurrencyType = "CAD"
	CurrencyTypeChf CurrencyType = "CHF"
	CurrencyTypeDkk CurrencyType = "DKK"
	CurrencyTypeEur CurrencyType = "EUR"
	CurrencyTypeGbp CurrencyType = "GBP"
	CurrencyTypeJpy CurrencyType = "JPY"
	CurrencyTypeNok CurrencyType = "NOK"
	CurrencyTypeNzd CurrencyType = "NZD"
	CurrencyTypeSek CurrencyType = "SEK"
	CurrencyTypeSgd CurrencyType = "SGD"
	CurrencyTypeUsd CurrencyType = "USD"
)

type Handler

type Handler interface {
	// InvoiceGet get a single invoice
	// GET /v1/invoices/{invoice_number}
	// https://api.aiven.io/doc/#tag/Billing/operation/InvoiceGet
	InvoiceGet(ctx context.Context, invoiceNumber string) (*InvoiceGetOut, error)

	// ProjectCreditsClaim claim a credit code
	// POST /v1/project/{project}/credits
	// https://api.aiven.io/doc/#tag/Project_Billing/operation/ProjectCreditsClaim
	ProjectCreditsClaim(ctx context.Context, project string, in *ProjectCreditsClaimIn) (*ProjectCreditsClaimOut, error)

	// ProjectCreditsList list project credits
	// GET /v1/project/{project}/credits
	// https://api.aiven.io/doc/#tag/Project_Billing/operation/ProjectCreditsList
	ProjectCreditsList(ctx context.Context, project string) ([]CreditOut, error)

	// ProjectInvoiceList list project invoices
	// GET /v1/project/{project}/invoice
	// https://api.aiven.io/doc/#tag/Project_Billing/operation/ProjectInvoiceList
	ProjectInvoiceList(ctx context.Context, project string) ([]InvoiceOut, error)
}

type InvoiceGetOut added in v0.8.0

type InvoiceGetOut struct {
	BillingGroupId    string    `json:"billing_group_id"`    // Billing Group ID
	BillingGroupName  string    `json:"billing_group_name"`  // Billing Group Name
	BillingGroupState string    `json:"billing_group_state"` // Billing group state
	Currency          string    `json:"currency"`
	DownloadCookie    *string   `json:"download_cookie,omitempty"` // Download Cookie
	GeneratedAt       time.Time `json:"generated_at"`              // Generated At
	InvoiceNumber     string    `json:"invoice_number"`            // Invoice Number
	PeriodBegin       string    `json:"period_begin"`              // Period Begin
	PeriodEnd         string    `json:"period_end"`                // Period End
	State             string    `json:"state"`
	TotalIncVat       string    `json:"total_inc_vat"`  // Total Inc Vat
	TotalVatZero      string    `json:"total_vat_zero"` // Total Vat Zero
}

InvoiceGetOut InvoiceModel

type InvoiceOut

type InvoiceOut struct {
	BillingGroupId    string                `json:"billing_group_id"`       // Billing group ID
	BillingGroupName  string                `json:"billing_group_name"`     // Billing group name
	BillingGroupState BillingGroupStateType `json:"billing_group_state"`    // Billing group state
	Currency          CurrencyType          `json:"currency"`               // Billing currency
	DownloadCookie    string                `json:"download_cookie"`        // Authentication cookie for downloads
	GeneratedAt       *time.Time            `json:"generated_at,omitempty"` // The time when the invoice was generated
	InvoiceNumber     string                `json:"invoice_number"`         // Unique invoice reference code
	PeriodBegin       string                `json:"period_begin"`           // Period begin
	PeriodEnd         string                `json:"period_end"`             // Period end
	State             InvoiceStateType      `json:"state"`                  // State of this invoice
	TotalIncVat       string                `json:"total_inc_vat"`          // Total including taxes
	TotalVatZero      string                `json:"total_vat_zero"`         // Total excluding taxes
}

type InvoiceStateType added in v0.3.0

type InvoiceStateType string
const (
	InvoiceStateTypeAccrual                              InvoiceStateType = "accrual"
	InvoiceStateTypeConsolidated                         InvoiceStateType = "consolidated"
	InvoiceStateTypeDue                                  InvoiceStateType = "due"
	InvoiceStateTypeEstimate                             InvoiceStateType = "estimate"
	InvoiceStateTypeFailedCreditCardCharge               InvoiceStateType = "failed_credit_card_charge"
	InvoiceStateTypeFailedNoCreditCard                   InvoiceStateType = "failed_no_credit_card"
	InvoiceStateTypeMailed                               InvoiceStateType = "mailed"
	InvoiceStateTypeNoPaymentExpected                    InvoiceStateType = "no_payment_expected"
	InvoiceStateTypePaid                                 InvoiceStateType = "paid"
	InvoiceStateTypePartnerMetering                      InvoiceStateType = "partner_metering"
	InvoiceStateTypeUncollectible                        InvoiceStateType = "uncollectible"
	InvoiceStateTypeWaived                               InvoiceStateType = "waived"
	InvoiceStateTypeDueOnlyProjectChargesCalculated      InvoiceStateType = "due_only_project_charges_calculated"
	InvoiceStateTypeEstimateOnlyProjectChargesCalculated InvoiceStateType = "estimate_only_project_charges_calculated"
)

type ProjectBillingHandler

type ProjectBillingHandler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(doer doer) ProjectBillingHandler

func (*ProjectBillingHandler) InvoiceGet added in v0.8.0

func (h *ProjectBillingHandler) InvoiceGet(ctx context.Context, invoiceNumber string) (*InvoiceGetOut, error)

func (*ProjectBillingHandler) ProjectCreditsClaim

func (h *ProjectBillingHandler) ProjectCreditsClaim(ctx context.Context, project string, in *ProjectCreditsClaimIn) (*ProjectCreditsClaimOut, error)

func (*ProjectBillingHandler) ProjectCreditsList

func (h *ProjectBillingHandler) ProjectCreditsList(ctx context.Context, project string) ([]CreditOut, error)

func (*ProjectBillingHandler) ProjectInvoiceList

func (h *ProjectBillingHandler) ProjectInvoiceList(ctx context.Context, project string) ([]InvoiceOut, error)

type ProjectCreditsClaimIn

type ProjectCreditsClaimIn struct {
	Code string `json:"code"` // Credit code
}

ProjectCreditsClaimIn ProjectCreditsClaimRequestBody

type ProjectCreditsClaimOut

type ProjectCreditsClaimOut struct {
	Code           *string    `json:"code,omitempty"`            // Credit code
	ExpireTime     *time.Time `json:"expire_time,omitempty"`     // Timestamp in ISO 8601 format, always in UTC
	RemainingValue *string    `json:"remaining_value,omitempty"` // Remaining credit value
	StartTime      *time.Time `json:"start_time,omitempty"`      // Timestamp in ISO 8601 format, always in UTC
	Type           CreditType `json:"type,omitempty"`            // Credit type
	Value          *string    `json:"value,omitempty"`           // Original credit value, or for expired credits, the consumed credit value
}

ProjectCreditsClaimOut Assigned credit

Jump to

Keyboard shortcuts

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