aeza_sdk

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: MIT Imports: 5 Imported by: 0

README

go-aeza-sdk

Simple API client library for Aeza.net

Installation

# Go Modules
require github.com/carlsmei/go-aeza-sdk v1.0.0

OR

go get -u github.com/carlsmei/go-aeza-sdk

Documentation

Index

Constants

View Source
const Version = "1.0.0"

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	ID              int     `json:"id"`
	EMail           string  `json:"email"`
	Balance         float64 `json:"balance"`
	BonusBalance    float64 `json:"bonusBalance"`
	BonusUsed       float64 `json:"bonusUsed"`
	BonusState      string  `json:"bonusState"`
	CreatedAt       int64   `json:"createdAt"`
	IsSupportLocked bool    `json:"isSupportLocked"`
	IsOnline        bool    `json:"isOnline"`
}

type BuyProductDTO

type BuyProductDTO struct {
	AutoProlong bool       `json:"autoProlong"`
	Backups     bool       `json:"backups"`
	Count       int        `json:"count"`
	Method      string     `json:"method"`
	Parameters  Parameters `json:"parameters"`
	Name        string     `json:"name"`
	ProductID   int        `json:"productId"`
	Term        string     `json:"term"`
}

type ChangeServicePasswordDTO

type ChangeServicePasswordDTO struct {
	Password string `json:"password"`
}

type Client

type Client struct {
	BaseURL string
	// contains filtered or unexported fields
}

func New

func New(apiKey string) *Client

func (*Client) BuyProduct

func (client *Client) BuyProduct(name string, autoProlong bool, osId int, productId int, term string) (*Service, *Transaction, error)

func (*Client) ChangeServicePassword

func (client *Client) ChangeServicePassword(id int, password string) (*Service, error)

func (*Client) DeleteService

func (client *Client) DeleteService(id int) (bool, error)

func (*Client) GetAccount

func (client *Client) GetAccount() (*Account, error)

func (*Client) GetAccountLimits

func (client *Client) GetAccountLimits() ([]Limit, error)

func (*Client) GetOS

func (client *Client) GetOS(id int) (*OS, error)

func (*Client) GetOSList

func (client *Client) GetOSList() ([]OS, error)

func (*Client) GetProduct

func (client *Client) GetProduct(id int) (*Product, error)

func (*Client) GetProducts

func (client *Client) GetProducts() ([]Product, error)

func (*Client) GetService

func (client *Client) GetService(id int) (*Service, error)

func (*Client) GetServices

func (client *Client) GetServices() ([]Service, error)

type Configuration

type Configuration struct {
	Max  int    `json:"max"`
	Base int    `json:"base"`
	Slug string `json:"slug"`
	Type string `json:"type"`
}

type DeleteServiceResponse

type DeleteServiceResponse struct {
	Data  string `json:"data,omitempty"`
	Error *Error `json:"error,omitempty"`
}

type Error

type Error struct {
	Slug    string            `json:"slug"`
	Message string            `json:"message"`
	Data    map[string]string `json:"data"`
}

type Group

type Group struct {
	ID    int     `json:"id"`
	Order int     `json:"order"`
	Name  string  `json:"name"`
	Type  string  `json:"type"`
	Role  *string `json:"role"`
}

type Limit

type Limit struct {
	ID        int
	Name      string
	Groups    []int
	Grades    map[string]int
	Available int
	Used      int
}

type OS

type OS struct {
	ID         int    `json:"id"`
	Name       string `json:"name"`
	Repository string `json:"repository"`
	Group      string `json:"group"`
	Enabled    bool   `json:"enabled"`
}

type Parameters

type Parameters struct {
	ISOUrl            string  `json:"isoUrl"`
	OSID              int     `json:"os"`
	Recipe            *int    `json:"recipe,omitempty"`
	PanelUsername     *string `json:"panelUsername,omitempty"`
	DDoSNotifications *bool   `json:"ddosNotifications,omitempty"`
}

type Price

type Price struct {
	Value           int    `json:"value"`
	Suffix          string `json:"suffix"`
	DefaultCurrency bool   `json:"defaultCurrency"`
	Slug            string `json:"slug"`
}

type Product

type Product struct {
	ID           int    `json:"id"`
	Type         string `json:"type"`
	GroupID      int    `json:"groupId"`
	Order        int    `json:"order"`
	InstallPrice int    `json:"installPrice"`
	Name         string `json:"name"`
	// DefaultParameters
	Configuration  []Configuration  `json:"configuration"`
	RawPrices      map[string]int   `json:"rawPrices"`
	IsPrivate      bool             `json:"isPrivate"`
	Group          Group            `json:"group"`
	Prices         map[string]Price `json:"prices"`
	ServiceHandler string           `json:"serviceHandler"`
}

type Response

type Response struct {
	Data struct {
		SelectorMode *string         `json:"selectorMode,omitempty"`
		Items        json.RawMessage `json:"items"`
		TotalItems   *int            `json:"total,omitempty"`
		Transaction  *Transaction    `json:"transaction,omitempty"`
	} `json:"data,omitempty"`
	Error Error `json:"error,omitempty"`
}

type SecureParameters

type SecureParameters struct {
	UnSecure bool              `json:"unsecure"`
	Data     map[string]string `json:"data"`
}

type Service

type Service struct {
	ID               int              `json:"id"`
	OwnerID          int              `json:"ownerId"`
	ProductID        int              `json:"productId"`
	Name             string           `json:"name"`
	IP               string           `json:"ip"`
	PaymentTerm      string           `json:"paymentTerm"`
	Parameters       Parameters       `json:"parameters"`
	SecureParameters SecureParameters `json:"secureParameters"`
	AutoProlong      bool             `json:"autoProlong"`
	Backups          bool             `json:"backups"`
	Status           string           `json:"status"`
	LastStatus       string           `json:"lastStatus"`
	Product          Product          `json:"product"`
	LocationCode     string           `json:"locationCode"`
	Prices           map[string]Price `json:"prices"`
	CurrentStatus    string           `json:"currentStatus"`
}

type Transaction

type Transaction struct {
	ID          int             `json:"id"`
	OwnerId     int             `json:"ownerId"`
	Amount      int             `json:"amount"`
	BonusAmount int             `json:"bonusAmount"`
	Mode        string          `json:"mode"`
	Status      string          `json:"status"`
	PerformedAt int             `json:"performedAt"`
	CreatedAt   int             `json:"createdAt"`
	Type        string          `json:"type"`
	OrderInfo   json.RawMessage `json:"orderInfo"`
}

Jump to

Keyboard shortcuts

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