we

package
v0.0.0-...-3b1c0a0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client describes we api client.

func New

func New(email, password string) *Client

New returns new we client initialized with email and password.

func (*Client) Login

func (c *Client) Login() (*CustomerInfo, error)

Login submits email and password to be checked by backend.

func (*Client) LoyaltyPoints

func (c *Client) LoyaltyPoints() (*LoyaltyPointsInfo, error)

LoyaltyPoints returns 4U points of logged in user.

func (*Client) RemainingDays

func (c *Client) RemainingDays() (*RemainingDaysInfo, error)

RemainingDays returns service subscription of logged in user.

func (*Client) Usage

func (c *Client) Usage() (*UsageInfo, error)

Usage returns UsageInfo of logged in user.

type Credentials

type Credentials struct {
	Password string `json:"password"`
	UID      string `json:"uid"`
}

Credentials represents login credentials.

type CustomerInfo

type CustomerInfo struct {
	CustomerInformationDto struct {
		ADSLSpeed      string `json:"adslSpeed"`
		City           string `json:"cityEN"`
		District       string `json:"districtEN"`
		MobileNumber   string `json:"mobileNumber1WithPrefix"`
		CustomerNumber string `json:"customerNumber"`
		EmailAddress   string `json:"emailAddress"`
		ADSLAreaCode   int    `json:"adslAreaCode"`
		ADSLNumber     int    `json:"adslNumber"`
		CustomerName   string `json:"customerName"`
	} `json:"customerInformationDto"`
}

CustomerInfo describes customer info.

type ErrorInfo

type ErrorInfo struct {
	Exception struct {
		MessageEn string `json:"messageEn"`
	} `json:"exception"`
}

ErrorInfo describes response errors.

type LoyaltyPointsInfo

type LoyaltyPointsInfo struct {
	LoyaltyPoints int `json:"loyaltyPoints"`
}

LoyaltyPointsInfo describes 4U points.

type RemainingDaysInfo

type RemainingDaysInfo struct {
	RemainingDays struct {
		ADSLExpiryDate string  `json:"adslExpiryDateString"`
		RemainingDays  int     `json:"remainingDays"`
		PackageName    string  `json:"packageName"`
		AmountDue      float64 `json:"amountDue"`
	} `json:"remainingDays"`
}

RemainingDaysInfo describes subscription date and remaining service days.

type UsageInfo

type UsageInfo struct {
	AdslUsage struct {
		StartDate int64   `json:"startDate"`
		Quota     float64 `json:"quata"`
		TotalUsed float64 `json:"totalUsed"`
	} `json:"adslUsage"`
}

UsageInfo describes ADSL usage info.

Jump to

Keyboard shortcuts

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