lenovo

package module
v0.0.0-...-3d03d6c Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

README

lenovo

GoDoc

Lenovo Support API

Documentation

Index

Constants

View Source
const (
	InvalidCountry = "**INVALID**"
)

Variables

View Source
var (
	ErrNotEnoughSerials = errors.New("not enough serials provided require at least two")
	ErrRequestFailed    = errors.New("request failed")
	ErrInvalidResponse  = errors.New("invalid response")
)
View Source
var (
	ErrNoClientID = errors.New("no ClientID set")
)

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(options ...ClientOptionFunc) (*Client, error)

NewClient creates a new client to work with Lenovo eSupport.

func (*Client) WarrantiesBySerials

func (c *Client) WarrantiesBySerials(serials []string) ([]Warranty, error)

func (*Client) WarrantyBySerial

func (c *Client) WarrantyBySerial(serial string) (*Warranty, error)

type ClientOptionFunc

type ClientOptionFunc func(*Client) error

func SetClientID

func SetClientID(id string) ClientOptionFunc

SetClientID defines the ClientID which is needed to authenticate with Lenovo eSupport.

func SetHttpClient

func SetHttpClient(httpClient *http.Client) ClientOptionFunc

SetHttpClient can be used to specify the http.Client to use when making HTTP requests to Lenovo eSupport.

type Time

type Time struct {
	time.Time
}

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(data []byte) error

type Warranty

type Warranty struct {
	Serial       string
	ErrorCode    int
	ErrorMessage string
	Product      string
	InWarranty   bool
	Purchased    *Time
	Shipped      *Time
	Country      string
	UpgradeURL   string `json:"UpgradeUrl"`
	Warranty     []WarrantyWarranty
	Contract     []WarrantyContract
}

type WarrantyContract

type WarrantyContract struct {
	Contract        string
	Quantity        int
	ItemNumber      string
	ChargeCode      string
	SLA             string
	EntitlementCode string
	Status          string
	Start           Time
	End             Time
}

type WarrantyWarranty

type WarrantyWarranty struct {
	ID          string
	Name        string
	Description string
	Type        string
	Start       Time
	End         Time
}

Jump to

Keyboard shortcuts

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