account

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccessSourceTypeChoices added in v0.3.0

func AccessSourceTypeChoices() []string

func BillingCurrencyTypeChoices added in v0.3.0

func BillingCurrencyTypeChoices() []string

func MemberTypeChoices added in v0.3.0

func MemberTypeChoices() []string

func OrderByTypeChoices

func OrderByTypeChoices() []string

func PaymentMethodTypeChoices added in v0.3.0

func PaymentMethodTypeChoices() []string

Types

type AccessSourceType added in v0.3.0

type AccessSourceType string
const (
	AccessSourceTypeDescendantMembership   AccessSourceType = "descendant_membership"
	AccessSourceTypeOrganizationMembership AccessSourceType = "organization_membership"
	AccessSourceTypeProjectMembership      AccessSourceType = "project_membership"
	AccessSourceTypeTeamMembership         AccessSourceType = "team_membership"
)

type AccountAttachPaymentMethodIn

type AccountAttachPaymentMethodIn struct {
	PaymentMethodId string `json:"payment_method_id"`
}

type AccountAttachPaymentMethodOut

type AccountAttachPaymentMethodOut struct {
	Brand          string   `json:"brand"`
	CardId         string   `json:"card_id"`
	Country        string   `json:"country"`
	CountryCode    string   `json:"country_code"`
	ExpMonth       int      `json:"exp_month"`
	ExpYear        int      `json:"exp_year"`
	Last4          string   `json:"last4"`
	Name           string   `json:"name"`
	OrganizationId string   `json:"organization_id,omitempty"`
	Projects       []string `json:"projects"`
}

type AccountBillingGroupOut

type AccountBillingGroupOut struct {
	AccountId             string              `json:"account_id"`
	AccountName           string              `json:"account_name"`
	AddressLines          []string            `json:"address_lines"`
	BillingAddress        string              `json:"billing_address,omitempty"`
	BillingCurrency       BillingCurrencyType `json:"billing_currency"`
	BillingEmails         []BillingEmailOut   `json:"billing_emails"`
	BillingExtraText      string              `json:"billing_extra_text"`
	BillingGroupId        string              `json:"billing_group_id"`
	BillingGroupName      string              `json:"billing_group_name"`
	CardInfo              CardInfoOut         `json:"card_info"`
	City                  string              `json:"city"`
	Company               string              `json:"company"`
	Country               string              `json:"country"`
	CountryCode           string              `json:"country_code"`
	CreateTime            time.Time           `json:"create_time"`
	EstimatedBalanceLocal string              `json:"estimated_balance_local"`
	EstimatedBalanceUsd   string              `json:"estimated_balance_usd"`
	PaymentMethod         PaymentMethodType   `json:"payment_method"`
	State                 string              `json:"state"`
	VatId                 string              `json:"vat_id"`
	ZipCode               string              `json:"zip_code"`
}

type AccountCreateIn

type AccountCreateIn struct {
	AccountName           string `json:"account_name"`
	ParentAccountId       string `json:"parent_account_id,omitempty"`
	PrimaryBillingGroupId string `json:"primary_billing_group_id,omitempty"`
}

type AccountCreateOut

type AccountCreateOut struct {
	AccessSource          AccessSourceType `json:"access_source,omitempty"`
	AccountId             string           `json:"account_id"`
	AccountName           string           `json:"account_name"`
	AccountOwnerTeamId    string           `json:"account_owner_team_id"`
	CreateTime            time.Time        `json:"create_time"`
	Features              map[string]any   `json:"features,omitempty"`
	IsAccountMember       *bool            `json:"is_account_member,omitempty"`
	IsAccountOwner        bool             `json:"is_account_owner"`
	OrganizationId        string           `json:"organization_id"`
	ParentAccountId       string           `json:"parent_account_id,omitempty"`
	PrimaryBillingGroupId string           `json:"primary_billing_group_id"`
	RootAccountId         string           `json:"root_account_id"`
	TenantId              string           `json:"tenant_id,omitempty"`
	UpdateTime            time.Time        `json:"update_time"`
}

type AccountGetOut

type AccountGetOut struct {
	AccessSource          AccessSourceType `json:"access_source,omitempty"`
	AccountId             string           `json:"account_id"`
	AccountName           string           `json:"account_name"`
	AccountOwnerTeamId    string           `json:"account_owner_team_id"`
	CreateTime            time.Time        `json:"create_time"`
	Features              map[string]any   `json:"features,omitempty"`
	IsAccountMember       *bool            `json:"is_account_member,omitempty"`
	IsAccountOwner        bool             `json:"is_account_owner"`
	OrganizationId        string           `json:"organization_id"`
	ParentAccountId       string           `json:"parent_account_id,omitempty"`
	PrimaryBillingGroupId string           `json:"primary_billing_group_id"`
	RootAccountId         string           `json:"root_account_id"`
	TenantId              string           `json:"tenant_id,omitempty"`
	UpdateTime            time.Time        `json:"update_time"`
}

type AccountHandler

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

func NewHandler

func NewHandler(doer doer) AccountHandler

func (*AccountHandler) AccountAttachPaymentMethod

func (h *AccountHandler) AccountAttachPaymentMethod(ctx context.Context, accountId string, in *AccountAttachPaymentMethodIn) (*AccountAttachPaymentMethodOut, error)

func (*AccountHandler) AccountBillingGroupList

func (h *AccountHandler) AccountBillingGroupList(ctx context.Context, accountId string) ([]AccountBillingGroupOut, error)

func (*AccountHandler) AccountCreate

func (h *AccountHandler) AccountCreate(ctx context.Context, in *AccountCreateIn) (*AccountCreateOut, error)

func (*AccountHandler) AccountDelete

func (h *AccountHandler) AccountDelete(ctx context.Context, accountId string) error

func (*AccountHandler) AccountEventList

func (h *AccountHandler) AccountEventList(ctx context.Context, accountId string) ([]EventOut, error)

func (*AccountHandler) AccountGet

func (h *AccountHandler) AccountGet(ctx context.Context, accountId string) (*AccountGetOut, error)

func (*AccountHandler) AccountList

func (h *AccountHandler) AccountList(ctx context.Context) ([]AccountOut, error)

func (*AccountHandler) AccountMove

func (h *AccountHandler) AccountMove(ctx context.Context, accountId string, in *AccountMoveIn) (*AccountMoveOut, error)

func (*AccountHandler) AccountPaymentMethodDelete

func (h *AccountHandler) AccountPaymentMethodDelete(ctx context.Context, accountId string, cardId string) error

func (*AccountHandler) AccountPaymentMethodsList

func (h *AccountHandler) AccountPaymentMethodsList(ctx context.Context, accountId string) ([]CardOut, error)

func (*AccountHandler) AccountProjectsList

func (h *AccountHandler) AccountProjectsList(ctx context.Context, accountId string) (*AccountProjectsListOut, error)

func (*AccountHandler) AccountUpdate

func (h *AccountHandler) AccountUpdate(ctx context.Context, accountId string, in *AccountUpdateIn) (*AccountUpdateOut, error)

func (*AccountHandler) AccountUserProjectsList

func (h *AccountHandler) AccountUserProjectsList(ctx context.Context, accountId string, userId string) ([]UserProjectOut, error)

func (*AccountHandler) AccountUsersSearch

func (h *AccountHandler) AccountUsersSearch(ctx context.Context, accountId string, in *AccountUsersSearchIn) ([]UserOut, error)

type AccountMoveIn

type AccountMoveIn struct {
	ParentAccountId string `json:"parent_account_id"`
}

type AccountMoveOut

type AccountMoveOut struct {
	AccessSource          AccessSourceType `json:"access_source,omitempty"`
	AccountId             string           `json:"account_id"`
	AccountName           string           `json:"account_name"`
	AccountOwnerTeamId    string           `json:"account_owner_team_id"`
	CreateTime            time.Time        `json:"create_time"`
	Features              map[string]any   `json:"features,omitempty"`
	IsAccountMember       *bool            `json:"is_account_member,omitempty"`
	IsAccountOwner        bool             `json:"is_account_owner"`
	OrganizationId        string           `json:"organization_id"`
	ParentAccountId       string           `json:"parent_account_id,omitempty"`
	PrimaryBillingGroupId string           `json:"primary_billing_group_id"`
	RootAccountId         string           `json:"root_account_id"`
	TenantId              string           `json:"tenant_id,omitempty"`
	UpdateTime            time.Time        `json:"update_time"`
}

type AccountOut

type AccountOut struct {
	AccessSource          AccessSourceType `json:"access_source,omitempty"`
	AccountId             string           `json:"account_id"`
	AccountName           string           `json:"account_name"`
	AccountOwnerTeamId    string           `json:"account_owner_team_id"`
	CreateTime            time.Time        `json:"create_time"`
	Features              map[string]any   `json:"features,omitempty"`
	IsAccountMember       *bool            `json:"is_account_member,omitempty"`
	IsAccountOwner        bool             `json:"is_account_owner"`
	OrganizationId        string           `json:"organization_id"`
	ParentAccountId       string           `json:"parent_account_id,omitempty"`
	PrimaryBillingGroupId string           `json:"primary_billing_group_id"`
	RootAccountId         string           `json:"root_account_id"`
	TenantId              string           `json:"tenant_id,omitempty"`
	UpdateTime            time.Time        `json:"update_time"`
}

type AccountProjectsListOut

type AccountProjectsListOut struct {
	Projects          []ProjectOut `json:"projects"`
	TotalProjectCount *int         `json:"total_project_count,omitempty"`
}

type AccountUpdateIn

type AccountUpdateIn struct {
	AccountName           string `json:"account_name,omitempty"`
	PrimaryBillingGroupId string `json:"primary_billing_group_id,omitempty"`
}

type AccountUpdateOut

type AccountUpdateOut struct {
	AccessSource          AccessSourceType `json:"access_source,omitempty"`
	AccountId             string           `json:"account_id"`
	AccountName           string           `json:"account_name"`
	AccountOwnerTeamId    string           `json:"account_owner_team_id"`
	CreateTime            time.Time        `json:"create_time"`
	Features              map[string]any   `json:"features,omitempty"`
	IsAccountMember       *bool            `json:"is_account_member,omitempty"`
	IsAccountOwner        bool             `json:"is_account_owner"`
	OrganizationId        string           `json:"organization_id"`
	ParentAccountId       string           `json:"parent_account_id,omitempty"`
	PrimaryBillingGroupId string           `json:"primary_billing_group_id"`
	RootAccountId         string           `json:"root_account_id"`
	TenantId              string           `json:"tenant_id,omitempty"`
	UpdateTime            time.Time        `json:"update_time"`
}

type AccountUsersSearchIn

type AccountUsersSearchIn struct {
	Limit   *int        `json:"limit,omitempty"`
	OrderBy OrderByType `json:"order_by,omitempty"`
	Query   string      `json:"query,omitempty"`
}

type BillingCurrencyType added in v0.3.0

type BillingCurrencyType string
const (
	BillingCurrencyTypeAud BillingCurrencyType = "AUD"
	BillingCurrencyTypeCad BillingCurrencyType = "CAD"
	BillingCurrencyTypeChf BillingCurrencyType = "CHF"
	BillingCurrencyTypeDkk BillingCurrencyType = "DKK"
	BillingCurrencyTypeEur BillingCurrencyType = "EUR"
	BillingCurrencyTypeGbp BillingCurrencyType = "GBP"
	BillingCurrencyTypeJpy BillingCurrencyType = "JPY"
	BillingCurrencyTypeNok BillingCurrencyType = "NOK"
	BillingCurrencyTypeNzd BillingCurrencyType = "NZD"
	BillingCurrencyTypeSek BillingCurrencyType = "SEK"
	BillingCurrencyTypeSgd BillingCurrencyType = "SGD"
	BillingCurrencyTypeUsd BillingCurrencyType = "USD"
)

type BillingEmailOut

type BillingEmailOut struct {
	Email string `json:"email"`
}

type CardInfoOut

type CardInfoOut struct {
	Brand       string `json:"brand"`
	CardId      string `json:"card_id"`
	Country     string `json:"country"`
	CountryCode string `json:"country_code"`
	ExpMonth    int    `json:"exp_month"`
	ExpYear     int    `json:"exp_year"`
	Last4       string `json:"last4"`
	Name        string `json:"name"`
	UserEmail   string `json:"user_email"`
}

type CardOut

type CardOut struct {
	Brand       string `json:"brand"`
	CardId      string `json:"card_id"`
	Country     string `json:"country"`
	CountryCode string `json:"country_code"`
	ExpMonth    int    `json:"exp_month"`
	ExpYear     int    `json:"exp_year"`
	Last4       string `json:"last4"`
	Name        string `json:"name"`
}

type ElasticsearchOut

type ElasticsearchOut struct {
	EolDate string `json:"eol_date"`
	Version string `json:"version"`
}

type EndOfLifeExtensionOut

type EndOfLifeExtensionOut struct {
	Elasticsearch *ElasticsearchOut `json:"elasticsearch,omitempty"`
}

type EventOut

type EventOut struct {
	AccountId         string    `json:"account_id"`
	ActionDescription string    `json:"action_description"`
	ActionType        string    `json:"action_type"`
	Actor             string    `json:"actor"`
	ActorUserId       string    `json:"actor_user_id"`
	CreateTime        time.Time `json:"create_time"`
	LogEntryId        int       `json:"log_entry_id"`
	TeamId            string    `json:"team_id"`
}

type Handler

type Handler interface {
	// AccountAttachPaymentMethod attach payment method for account
	// POST /v1/account/{account_id}/payment_methods
	// https://api.aiven.io/doc/#tag/Account/operation/AccountAttachPaymentMethod
	AccountAttachPaymentMethod(ctx context.Context, accountId string, in *AccountAttachPaymentMethodIn) (*AccountAttachPaymentMethodOut, error)

	// AccountBillingGroupList list account billing groups
	// GET /v1/account/{account_id}/billing-group
	// https://api.aiven.io/doc/#tag/Account/operation/AccountBillingGroupList
	AccountBillingGroupList(ctx context.Context, accountId string) ([]AccountBillingGroupOut, error)

	// AccountCreate create a new account
	// POST /v1/account
	// https://api.aiven.io/doc/#tag/Account/operation/AccountCreate
	AccountCreate(ctx context.Context, in *AccountCreateIn) (*AccountCreateOut, error)

	// AccountDelete delete empty account
	// DELETE /v1/account/{account_id}
	// https://api.aiven.io/doc/#tag/Account/operation/AccountDelete
	AccountDelete(ctx context.Context, accountId string) error

	// AccountEventList list account events
	// GET /v1/account/{account_id}/events
	// https://api.aiven.io/doc/#tag/Account/operation/AccountEventList
	AccountEventList(ctx context.Context, accountId string) ([]EventOut, error)

	// AccountGet get account details
	// GET /v1/account/{account_id}
	// https://api.aiven.io/doc/#tag/Account/operation/AccountGet
	AccountGet(ctx context.Context, accountId string) (*AccountGetOut, error)

	// AccountList list accounts you have access to
	// GET /v1/account
	// https://api.aiven.io/doc/#tag/Account/operation/AccountList
	AccountList(ctx context.Context) ([]AccountOut, error)

	// AccountMove move an existing organization unitself
	// PUT /v1/account/{account_id}/parent_account
	// https://api.aiven.io/doc/#tag/Account/operation/AccountMove
	AccountMove(ctx context.Context, accountId string, in *AccountMoveIn) (*AccountMoveOut, error)

	// AccountPaymentMethodDelete delete credit card attached to the account as a payment method
	// DELETE /v1/account/{account_id}/payment_method/{card_id}
	// https://api.aiven.io/doc/#tag/Account/operation/AccountPaymentMethodDelete
	AccountPaymentMethodDelete(ctx context.Context, accountId string, cardId string) error

	// AccountPaymentMethodsList list credit cards attached as a payment method to the account
	// GET /v1/account/{account_id}/payment_methods
	// https://api.aiven.io/doc/#tag/Account/operation/AccountPaymentMethodsList
	AccountPaymentMethodsList(ctx context.Context, accountId string) ([]CardOut, error)

	// AccountProjectsList list projects belonging to account
	// GET /v1/account/{account_id}/projects
	// https://api.aiven.io/doc/#tag/Account/operation/AccountProjectsList
	AccountProjectsList(ctx context.Context, accountId string) (*AccountProjectsListOut, error)

	// AccountUpdate update existing account
	// PUT /v1/account/{account_id}
	// https://api.aiven.io/doc/#tag/Account/operation/AccountUpdate
	AccountUpdate(ctx context.Context, accountId string, in *AccountUpdateIn) (*AccountUpdateOut, error)

	// AccountUserProjectsList list projects associated with this account that user has access to
	// GET /v1/account/{account_id}/user/{user_id}/projects
	// https://api.aiven.io/doc/#tag/Account/operation/AccountUserProjectsList
	AccountUserProjectsList(ctx context.Context, accountId string, userId string) ([]UserProjectOut, error)

	// AccountUsersSearch list/search users who are members of any team on this account
	// POST /v1/account/{account_id}/users/search
	// https://api.aiven.io/doc/#tag/Account/operation/AccountUsersSearch
	AccountUsersSearch(ctx context.Context, accountId string, in *AccountUsersSearchIn) ([]UserOut, error)
}

type MemberType added in v0.3.0

type MemberType string
const (
	MemberTypeAdmin     MemberType = "admin"
	MemberTypeDeveloper MemberType = "developer"
	MemberTypeOperator  MemberType = "operator"
	MemberTypeReadOnly  MemberType = "read_only"
)

type OrderByType

type OrderByType string
const (
	OrderByTypeUserEmailasc  OrderByType = "user_email:asc"
	OrderByTypeUserEmaildesc OrderByType = "user_email:desc"
	OrderByTypeUserIdasc     OrderByType = "user_id:asc"
	OrderByTypeUserIddesc    OrderByType = "user_id:desc"
	OrderByTypeRealNameasc   OrderByType = "real_name:asc"
	OrderByTypeRealNamedesc  OrderByType = "real_name:desc"
)

type PaymentMethodType added in v0.3.0

type PaymentMethodType string
const (
	PaymentMethodTypeAccrual           PaymentMethodType = "accrual"
	PaymentMethodTypeCard              PaymentMethodType = "card"
	PaymentMethodTypeDisabled          PaymentMethodType = "disabled"
	PaymentMethodTypeEmail             PaymentMethodType = "email"
	PaymentMethodTypeNoPaymentExpected PaymentMethodType = "no_payment_expected"
	PaymentMethodTypePartner           PaymentMethodType = "partner"
)

type ProjectOut

type ProjectOut struct {
	AccountId             string                 `json:"account_id"`
	AccountName           string                 `json:"account_name,omitempty"`
	AddressLines          []string               `json:"address_lines,omitempty"`
	AvailableCredits      string                 `json:"available_credits,omitempty"`
	BillingAddress        string                 `json:"billing_address"`
	BillingCurrency       BillingCurrencyType    `json:"billing_currency,omitempty"`
	BillingEmails         []BillingEmailOut      `json:"billing_emails"`
	BillingExtraText      string                 `json:"billing_extra_text,omitempty"`
	BillingGroupId        string                 `json:"billing_group_id"`
	BillingGroupName      string                 `json:"billing_group_name"`
	CardInfo              *CardInfoOut           `json:"card_info,omitempty"`
	City                  string                 `json:"city,omitempty"`
	Company               string                 `json:"company,omitempty"`
	Country               string                 `json:"country"`
	CountryCode           string                 `json:"country_code"`
	DefaultCloud          string                 `json:"default_cloud"`
	EndOfLifeExtension    *EndOfLifeExtensionOut `json:"end_of_life_extension,omitempty"`
	EstimatedBalance      string                 `json:"estimated_balance"`
	EstimatedBalanceLocal string                 `json:"estimated_balance_local,omitempty"`
	Features              map[string]any         `json:"features,omitempty"`
	OrganizationId        string                 `json:"organization_id"`
	PaymentMethod         string                 `json:"payment_method"`
	ProjectName           string                 `json:"project_name"`
	State                 string                 `json:"state,omitempty"`
	Tags                  map[string]string      `json:"tags,omitempty"`
	TechEmails            []TechEmailOut         `json:"tech_emails,omitempty"`
	TenantId              string                 `json:"tenant_id,omitempty"`
	TrialExpirationTime   *time.Time             `json:"trial_expiration_time,omitempty"`
	VatId                 string                 `json:"vat_id"`
	ZipCode               string                 `json:"zip_code,omitempty"`
}

type TechEmailOut

type TechEmailOut struct {
	Email string `json:"email"`
}

type UserOut

type UserOut struct {
	RealName  string `json:"real_name"`
	UserEmail string `json:"user_email"`
	UserId    string `json:"user_id"`
}

type UserProjectOut

type UserProjectOut struct {
	AccessType  string     `json:"access_type,omitempty"`
	AccountId   string     `json:"account_id"`
	CreateTime  time.Time  `json:"create_time"`
	MemberType  MemberType `json:"member_type"`
	ProjectName string     `json:"project_name"`
	RealName    string     `json:"real_name"`
	TeamId      string     `json:"team_id"`
	TeamName    string     `json:"team_name"`
	UserEmail   string     `json:"user_email"`
}

Jump to

Keyboard shortcuts

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