gobay

package module
v0.0.0-...-395300b Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2016 License: MIT Imports: 14 Imported by: 0

README

Gobay - eBay Trading SDK in Go

Incomplete but functioning - pre-alpha stage contribute if you can.

Build Status codecov.io

A simple and direct eBay Trading API SDK in Golang.Please check the Wiki for more information.

The planned API in your go code will be:

import "github.com/jasonknight/gobay"

var r GenericResults
cnf, err := fileGetContents("blahblah.yml") //you need to define this function, 
// or load a file your preferred way...
if err != nil {
    t.Errorf("Failed to load test.yml %v\n", err)
}
ebay,err := gobay.NewEbayCallEx(cnf)
if err != nil {
    panic(err)
}
ebay.SetCallname("AddItems")
p := ebay.NewProduct() // this sets some things up for you...

p.Title = "My Fancy Product"
//... more product setting lines here
// or you can load with
// p.FromYAML([]byte(yaml_string_you_load))


ebay.AddProduct(p)

err := ebay.Execute(&r)

for _,res := range r.Results {
    if res.Success() {
        fmt.Printf("Sent %+v\n",p)
    } else {
        fmt.Printf("Oops, failed\n%+v\n",res)
    }
}

Become A Patron

Documentation

Index

Constants

View Source
const (
	DBG_DEBUG = iota
	DBG_INFO
	DBG_WARN
	DBG_ERROR
	DBG_NONE
)

Variables

View Source
var SiteCodeTypeMap = [...]struct {
	SiteValue string
	SiteID    string
	Currency  string
}{
	{SiteValue: "Australia", SiteID: "15", Currency: "AU"},
	{SiteValue: "Austria", SiteID: "16", Currency: "EU"},
	{SiteValue: "Belgium_Dutch", SiteID: "123", Currency: "EU"},
	{SiteValue: "Belgium_French", SiteID: "23", Currency: "EU"},
	{SiteValue: "Canada", SiteID: "2", Currency: "CAD"},
	{SiteValue: "CanadaFrench", SiteID: "210", Currency: "CAD"},
	{SiteValue: "France", SiteID: "71", Currency: "EU"},
	{SiteValue: "Germany", SiteID: "77", Currency: "EU"},
	{SiteValue: "HongKong", SiteID: "201", Currency: "HK"},
	{SiteValue: "India", SiteID: "203", Currency: "IN"},
	{SiteValue: "Ireland", SiteID: "205", Currency: "EU"},
	{SiteValue: "Italy", SiteID: "101", Currency: "EU"},
	{SiteValue: "Malaysia", SiteID: "207", Currency: "MY"},
	{SiteValue: "Netherlands", SiteID: "146", Currency: "EU"},
	{SiteValue: "Philippines", SiteID: "211", Currency: "PH"},
	{SiteValue: "Poland", SiteID: "212", Currency: "PL"},
	{SiteValue: "Russia", SiteID: "215", Currency: "RUB"},
	{SiteValue: "Singapore", SiteID: "216", Currency: "SG"},
	{SiteValue: "Spain", SiteID: "186", Currency: "EU"},
	{SiteValue: "Switzerland", SiteID: "193", Currency: "CH"},
	{SiteValue: "UK", SiteID: "3", Currency: "GB"},
	{SiteValue: "US", SiteID: "0", Currency: "US"},
}
View Source
var SiteIDMap = [...]struct {
	SiteID      string
	SiteName    string
	GlobalID    string
	TerritoryID string
	Language    string
}{
	{GlobalID: "EBAY-AT", Language: "de-AT", TerritoryID: "AT", SiteName: "eBay Austria   ", SiteID: "16"},
	{GlobalID: "EBAY-AU", Language: "en-AU", TerritoryID: "AU", SiteName: "eBay Australia ", SiteID: "15"},
	{GlobalID: "EBAY-CH", Language: "de-CH", TerritoryID: "CH", SiteName: "eBay Switzerland   ", SiteID: "193"},
	{GlobalID: "EBAY-DE", Language: "en-DE", TerritoryID: "DE", SiteName: "eBay Germany   ", SiteID: "77"},
	{GlobalID: "EBAY-ENCA", Language: "en-CA", TerritoryID: "CA", SiteName: "eBay Canada (English)  ", SiteID: "2"},
	{GlobalID: "EBAY-ES", Language: "es-ES", TerritoryID: "ES", SiteName: "eBay Spain ", SiteID: "186"},
	{GlobalID: "EBAY-FR", Language: "fr-FR", TerritoryID: "FR", SiteName: "eBay France", SiteID: "71"},
	{GlobalID: "EBAY-FRBE", Language: "fr-BE", TerritoryID: "BE", SiteName: "eBay Belgium (French)  ", SiteID: "23"},
	{GlobalID: "EBAY-FRCA", Language: "fr-CA", TerritoryID: "CA", SiteName: "eBay Canada (French)   ", SiteID: "210"},
	{GlobalID: "EBAY-GB", Language: "en-GB", TerritoryID: "GB", SiteName: "eBay UK", SiteID: "3"},
	{GlobalID: "EBAY-HK", Language: "zh-Hant", TerritoryID: "HK", SiteName: "eBay Hong Kong", SiteID: "201"},
	{GlobalID: "EBAY-IE", Language: "en-IE", TerritoryID: "IE", SiteName: "eBay Ireland   ", SiteID: "205"},
	{GlobalID: "EBAY-IN", Language: "en-IN", TerritoryID: "IN", SiteName: "eBay India ", SiteID: "203"},
	{GlobalID: "EBAY-IT", Language: "it-IT", TerritoryID: "IT", SiteName: "eBay Italy ", SiteID: "101"},
	{GlobalID: "EBAY-MOTOR", Language: "en-US", TerritoryID: "US", SiteName: "eBay Motors", SiteID: "100"},
	{GlobalID: "EBAY-MY", Language: "en-MY", TerritoryID: "MY", SiteName: "eBay Malaysia  ", SiteID: "207"},
	{GlobalID: "EBAY-NL", Language: "nl-NL", TerritoryID: "NL", SiteName: "eBay Netherlands   ", SiteID: "146"},
	{GlobalID: "EBAY-NLBE", Language: "nl-BE", TerritoryID: "BE", SiteName: "eBay Belgium (Dutch)   ", SiteID: "123"},
	{GlobalID: "EBAY-PH", Language: "en-PH", TerritoryID: "PH", SiteName: "eBay Philippines   ", SiteID: "211"},
	{GlobalID: "EBAY-PL", Language: "pl-PL", TerritoryID: "PL", SiteName: "eBay Poland", SiteID: "212"},
	{GlobalID: "EBAY-SG", Language: "en-SG", TerritoryID: "SG", SiteName: "eBay Singapore ", SiteID: "216"},
	{GlobalID: "EBAY-US", Language: "en-US", TerritoryID: "US", SiteName: "eBay United States ", SiteID: "0"},
}

Functions

func AddItemsTemplate

func AddItemsTemplate() string

func EndItemsTemplate

func EndItemsTemplate() string

func GetAllCategoriesTemplate

func GetAllCategoriesTemplate() string

func GetChildCategoriesTemplate

func GetChildCategoriesTemplate() string

func GetMyeBaySellingTemplate

func GetMyeBaySellingTemplate() string

func GeteBayDetailsTemplate

func GeteBayDetailsTemplate() string

func GeteBayOfficialTimeTemplate

func GeteBayOfficialTimeTemplate() string

GeteBayOfficialTimeRequest

func InStringSlice

func InStringSlice(s []string, r string) bool

func ItemTemplate

func ItemTemplate() string

func LoadConfiguration

func LoadConfiguration(y []byte, e *map[interface{}]interface{}) error

func NotificationPreferencesTemplate

func NotificationPreferencesTemplate() string

func SetDebugFunction

func SetDebugFunction(f DebugFunc)

func SetDebugLevel

func SetDebugLevel(l int)

func SetNotificationPreferencesTemplate

func SetNotificationPreferencesTemplate() string

func SiteIDToCode

func SiteIDToCode(id string) string

func ValidateItemSortCodeType

func ValidateItemSortCodeType(t string) bool

func ValidateListingType

func ValidateListingType(t string) bool

func ValidateNotificationRoleCodeType

func ValidateNotificationRoleCodeType(t string) bool

func ValidateOrderStatusFilterType

func ValidateOrderStatusFilterType(t string) bool

func WrapCall

func WrapCall(name string, pre string, text string, post string) string

func WrapTemplate

func WrapTemplate() string

Types

type AddItemResponseContainerStruct

type AddItemResponseContainerStruct struct {
	CorrelationID string
	Errors        []ErrorMessage
}

type AddItemsChild

type AddItemsChild struct {
	Item      *Item
	MessageID string
	Text      string
}

type AddItemsStruct

type AddItemsStruct struct {
	Children []AddItemsChild
}

type ApplicationDeliveryPreference

type ApplicationDeliveryPreference struct {
	ApplicationURL          string              `xml:"ApplicationURL" yaml:"ApplicationURL"`
	ApplicationEnable       string              `xml:"ApplicationEnable" yaml:"ApplicationEnable"`
	AlertEmail              string              `xml:"AlertEmail" yaml:"AlertEmail"`
	AlertEnable             string              `xml:"AlertEnable" yaml:"AlertEnable"`
	NotificationPayloadType string              `xml:"NotificationPayloadType" yaml:"NotificationPayloadType"`
	DeviceType              string              `xml:"DeviceType" yaml:"DeviceType"`
	PayloadEncodingType     string              `xml:"PayloadEncodingType" yaml:"PayloadEncodingType"`
	PayloadVersion          int64               `xml:"PayloadVersion" yaml:"PayloadVersion"`
	DeliveryURLDetails      []DeliveryURLDetail `xml:"DeliveryURLDetails" yaml:"DeliveryURLDetails"`
}

type BuyerStruct

type BuyerStruct struct {
	Email           string
	StaticAlias     string
	UserID          string
	ShippingAddress struct {
		PostalCode string
	}
}

type Category

type Category struct {
	AutoPayEnabled    string
	B2BVATEnabled     string
	BestOfferEnabled  string
	CategoryID        string
	CategoryLevel     string
	CategoryName      string
	CategoryParentIDs []string `xml:"CategoryParentID"`

	Expired      string
	LeafCategory string
	LSD          string
	ORPA         string
	ORRA         string
	Virtual      string
}

func (*Category) Debug

func (o_Category *Category) Debug() string

type DebugFunc

type DebugFunc func(lvl int, s string)

type DeliveryURLDetail

type DeliveryURLDetail struct {
	DeliveryURL     string `xml:"DeliveryURL" yaml:"DeliveryURL"`
	DeliveryURLName string `xml:"DeliveryURLName" yaml:"DeliveryURLName"`
	Status          string `xml:"Status" yaml:"Status"`
}

type DuplicateInvocationDetail

type DuplicateInvocationDetail struct {
	DuplicateInvocationID string
	InvocationTrackingID  string
	Status                string
}

func (*DuplicateInvocationDetail) Debug

func (o_DuplicateInvocationDetail *DuplicateInvocationDetail) Debug() string

type EbayCall

type EbayCall struct {
	DevID                              string
	AppID                              string
	CertID                             string
	CompatLevel                        int64
	SiteID                             string
	EndPoint                           string
	EbayAuthToken                      string
	Country                            string
	Currency                           string
	Language                           string
	MessageID                          string
	MessageIDs                         []string
	WarningLevel                       string
	PayPalEmailAddress                 string
	Callname                           string
	XMLData                            string
	Cache                              string
	AddItemsLimit                      int
	CallDepthLimit                     int
	CallDepth                          int
	Headers                            map[string]string
	Items                              []*Item
	TheClient                          *http.Client
	CategoryCallInfo                   *GetCategoriesStruct
	EbayDetailsCallInfo                *EbayDetails
	NotificationPreferencesCallInfo    *NotificationPreferencesRequest
	SetNotificationPreferencesCallInfo *SetNotificationPreferencesRequest
	MyeBaySellingCallInfo              *MyeBaySelling
}

func NewEbayCall

func NewEbayCall() *EbayCall

func NewEbayCallEx

func NewEbayCallEx(conf []byte) (*EbayCall, error)

func (*EbayCall) AddItem

func (o *EbayCall) AddItem(v *Item)

func (*EbayCall) AddItems

func (o *EbayCall) AddItems(r EbayResultSlice) error

func (*EbayCall) Clone

func (o *EbayCall) Clone() *EbayCall

func (*EbayCall) CollectAddItems

func (o *EbayCall) CollectAddItems() (*AddItemsStruct, error)

func (*EbayCall) CollectAddItemsXML

func (o *EbayCall) CollectAddItemsXML(s *AddItemsStruct) (string, error)

func (*EbayCall) Debug

func (o_EbayCall *EbayCall) Debug() string

func (*EbayCall) Execute

func (o *EbayCall) Execute(r EbayResultSlice) error

func (*EbayCall) FilterItems

func (o *EbayCall) FilterItems(f ItemFilter) []*Item

func (*EbayCall) GetAllCategories

func (o *EbayCall) GetAllCategories(r EbayResultSlice) error

func (*EbayCall) GetAppID

func (o *EbayCall) GetAppID() string

func (*EbayCall) GetCallname

func (o *EbayCall) GetCallname() string

func (*EbayCall) GetCategoryCallInfo

func (o *EbayCall) GetCategoryCallInfo() *GetCategoriesStruct

func (*EbayCall) GetCertID

func (o *EbayCall) GetCertID() string

func (*EbayCall) GetCompatLevel

func (o *EbayCall) GetCompatLevel() int64

func (*EbayCall) GetCountry

func (o *EbayCall) GetCountry() string

func (*EbayCall) GetCurrency

func (o *EbayCall) GetCurrency() string

func (*EbayCall) GetDevID

func (o *EbayCall) GetDevID() string

func (*EbayCall) GetEbayAuthToken

func (o *EbayCall) GetEbayAuthToken() string

func (*EbayCall) GetEndPoint

func (o *EbayCall) GetEndPoint() string

func (*EbayCall) GetHeader

func (o *EbayCall) GetHeader(k string) string

func (*EbayCall) GetHeaders

func (o *EbayCall) GetHeaders() map[string]string

func (*EbayCall) GetItem

func (o *EbayCall) GetItem(i int) *Item

func (*EbayCall) GetItemByInternalID

func (o *EbayCall) GetItemByInternalID(id string) (*Item, error)

func (*EbayCall) GetItems

func (o *EbayCall) GetItems() []*Item

func (*EbayCall) GetLanguage

func (o *EbayCall) GetLanguage() string

func (*EbayCall) GetMessageID

func (o *EbayCall) GetMessageID() string

func (*EbayCall) GetMyeBaySelling

func (o *EbayCall) GetMyeBaySelling(r EbayResultSlice) error

func (*EbayCall) GetNotificationPreferences

func (o *EbayCall) GetNotificationPreferences(r EbayResultSlice) error

func (*EbayCall) GetPayPalEmailAddress

func (o *EbayCall) GetPayPalEmailAddress() string

func (*EbayCall) GetSiteID

func (o *EbayCall) GetSiteID() string

func (*EbayCall) GetWarningLevel

func (o *EbayCall) GetWarningLevel() string

func (*EbayCall) GetXMLData

func (o *EbayCall) GetXMLData() string

func (*EbayCall) GeteBayDetails

func (o *EbayCall) GeteBayDetails(r EbayResultSlice) error

func (*EbayCall) GeteBayOfficialTime

func (o *EbayCall) GeteBayOfficialTime(r EbayResultSlice) error

func (*EbayCall) HasItemsToSend

func (o *EbayCall) HasItemsToSend() bool

func (*EbayCall) NewItem

func (o *EbayCall) NewItem() *Item

func (*EbayCall) RemoveItem

func (o *EbayCall) RemoveItem(i int)

func (*EbayCall) Send

func (o *EbayCall) Send(r EbayResultSlice) error
func appendFakeResult(msg string, r EbayResultSlice) {
	e := NewFakeResult(fmt.Sprintf("%s", msg))
	AddToResult(r, *e)
}

func (*EbayCall) SetAppID

func (o *EbayCall) SetAppID(v string)

func (*EbayCall) SetCallname

func (o *EbayCall) SetCallname(v string)

func (*EbayCall) SetCategoryCallInfo

func (o *EbayCall) SetCategoryCallInfo(v *GetCategoriesStruct)

func (*EbayCall) SetCertID

func (o *EbayCall) SetCertID(v string)

func (*EbayCall) SetCompatLevel

func (o *EbayCall) SetCompatLevel(v int64)

func (*EbayCall) SetCountry

func (o *EbayCall) SetCountry(v string)

func (*EbayCall) SetCurrency

func (o *EbayCall) SetCurrency(v string)

func (*EbayCall) SetDevID

func (o *EbayCall) SetDevID(v string)

func (*EbayCall) SetEbayAuthToken

func (o *EbayCall) SetEbayAuthToken(v string)

func (*EbayCall) SetEndPoint

func (o *EbayCall) SetEndPoint(v string)

func (*EbayCall) SetHeader

func (o *EbayCall) SetHeader(k string, v string)

func (*EbayCall) SetHeaders

func (o *EbayCall) SetHeaders(v map[string]string)

func (*EbayCall) SetItems

func (o *EbayCall) SetItems(v []*Item)

func (*EbayCall) SetLanguage

func (o *EbayCall) SetLanguage(v string)

func (*EbayCall) SetMessageID

func (o *EbayCall) SetMessageID(v string)

func (*EbayCall) SetNotificationPreferences

func (o *EbayCall) SetNotificationPreferences(r EbayResultSlice) error

func (*EbayCall) SetPayPalEmailAddress

func (o *EbayCall) SetPayPalEmailAddress(v string)

func (*EbayCall) SetSiteID

func (o *EbayCall) SetSiteID(v string)

func (*EbayCall) SetWarningLevel

func (o *EbayCall) SetWarningLevel(v string)

func (*EbayCall) SetXMLData

func (o *EbayCall) SetXMLData(v string)

type EbayDetails

type EbayDetails struct {
	DetailNames []string
}

func NewGetEbayDetailsStruct

func NewGetEbayDetailsStruct() *EbayDetails

type EbayResultSlice

type EbayResultSlice interface {
	AddXML([]byte) error
	AddString(string)
}

type EndItemRequestContainer

type EndItemRequestContainer struct {
	EndingReason      string `xml:"EndingReason" yaml:"EndingReason"`
	ItemID            string `xml:"ItemID" yaml:"ItemID"`
	MessageID         string `xml:"MessageID" yaml:"MessageID"`
	SellerInventoryID string `xml:"SellerInventoryID" yaml:"SellerInventoryID"`
}

type EndItemResultContainer

type EndItemResultContainer struct {
	Errors        []ErrorMessage
	EndTime       string `xml:"EndTime" yaml:"EndTime"`
	CorrelationID int64  `xml:"CorrelationID" yaml:"CorrelationID"`
}

type EndItemsRequest

type EndItemsRequest struct {
	EndItemRequestContainer []EndItemRequestContainer `xml:"EndItemRequestContainer" yaml:"EndItemRequestContainer"`
}

func NewEndItemsRequest

func NewEndItemsRequest() *EndItemsRequest

func (*EndItemsRequest) FromXML

func (o *EndItemsRequest) FromXML(data []byte) error

func (*EndItemsRequest) FromYAML

func (o *EndItemsRequest) FromYAML(data []byte) error

type EndItemsResult

type EndItemsResult struct {
	Timestamp              string
	Ack                    string
	Version                string
	Build                  string
	Errors                 []ErrorMessage
	EndItemResultContainer []EndItemResultContainer `xml:"EndItemResponseContainer" yaml:"EndItemResponseContainer"`
}

func NewEndItemsResult

func NewEndItemsResult() *EndItemsResult

func NewFakeEndItemsResult

func NewFakeEndItemsResult(msg string) *EndItemsResult

func (*EndItemsResult) FromXML

func (o *EndItemsResult) FromXML(data []byte) error

func (*EndItemsResult) FromYAML

func (o *EndItemsResult) FromYAML(data []byte) error

type ErrorMessage

type ErrorMessage struct {
	ShortMessage        string
	LongMessage         string
	ErrorCode           int64
	SeverityCode        string
	ErrorClassification string
	UserDisplayHint     string
	ErrorParameters     []ErrorParameter
}

func (*ErrorMessage) Debug

func (o_ErrorMessage *ErrorMessage) Debug() string

type ErrorParameter

type ErrorParameter struct {
	Value   string
	ParamID string `xml:"ParamID,attr"`
}

func (*ErrorParameter) Debug

func (o_ErrorParameter *ErrorParameter) Debug() string

type EventProperty

type EventProperty struct {
	EventType string `xml:"EventType" yaml:"EventType"`
	Name      string `xml:"Name" yaml:"Name"`
	Value     string `xml:"Value" yaml:"Value"`
}

type Fee

type Fee struct {
	Name       string `xml:"Name"`
	Amount     string `xml:"Fee"`
	CurrencyID string `xml:"currencyID,attr"`
}

func (*Fee) Debug

func (o_Fee *Fee) Debug() string

type FeedbackComment

type FeedbackComment struct {
	CommentingUser      string
	CommentingUserScore string
	CommentText         string
	CommentTime         string
	CommentType         string
	ItemID              string
	Role                string
	FeedbackID          string
	TransactionID       string
	ItemTitle           string
	ItemPrice           string
}

type GenericEndItemsResults

type GenericEndItemsResults struct {
	Results []EndItemsResult
}

func (*GenericEndItemsResults) AddString

func (r *GenericEndItemsResults) AddString(b string)

func (*GenericEndItemsResults) AddXML

func (r *GenericEndItemsResults) AddXML(b []byte) error

type GenericMyeBaySellingResults

type GenericMyeBaySellingResults struct {
	Results []MyeBaySellingResult
}

func (*GenericMyeBaySellingResults) AddString

func (r *GenericMyeBaySellingResults) AddString(b string)

func (*GenericMyeBaySellingResults) AddXML

func (r *GenericMyeBaySellingResults) AddXML(b []byte) error

type GenericNotificationPreferenceResults

type GenericNotificationPreferenceResults struct {
	Results []NotificationPreferencesResult
}

func (*GenericNotificationPreferenceResults) AddString

func (*GenericNotificationPreferenceResults) AddXML

type GenericResults

type GenericResults struct {
	Results []Result
}

func (*GenericResults) AddString

func (r *GenericResults) AddString(b string)

func (*GenericResults) AddXML

func (r *GenericResults) AddXML(b []byte) error

type GetCategoriesStruct

type GetCategoriesStruct struct {
	CategoryParent  []string
	SiteID          string
	LevelLimit      string
	ViewAllNodes    string
	DetailLevels    []string `xml:"DetailLevel"`
	OutputSelectors []string `xml:"OutputSelector"`
}

func NewGetCategoriesStruct

func NewGetCategoriesStruct() *GetCategoriesStruct

type Item

type Item struct {
	EbayID             string             `yaml:"EbayID"`
	SKU                string             `yaml:"SKU"`
	Title              string             `yaml:"Title"`
	Description        string             `yaml:"Description"`
	StartPrice         string             `yaml:"StartPrice"`
	Quantity           string             `yaml:"Quantity"`
	ListingType        string             `yaml:"ListingType"`
	Country            string             `yaml:"Country"`
	Currency           string             `yaml:"Currency"`
	Location           string             `yaml:"Location"`
	PayPalEmailAddress string             `yaml:"PayPalEmailAddress"`
	PrimaryCategory    string             `yaml:"PrimaryCategory"`
	Site               string             `yaml:"Site"`
	StoreCategoryID    string             `yaml:"StoreCategoryID" xml:"StoreFront>StoreCategoryID"`
	DispatchTimeMax    string             `yaml:"DispatchTimeMax"`
	ListingDuration    string             `yaml:"ListingDuration"`
	ReturnPolicy       ReturnPolicyStruct `yaml:"ReturnPolicy"`
	ScheduleTime       string             `yaml:"ScheduleTime"`

	ShipToLocations                     []ShipToLocation        `yaml:"ShipToLocations"`
	PictureDetails                      []PictureDetail         `yaml:"PictureDetails"`
	PaymentMethods                      []PaymentMethod         `yaml:"PaymentMethods"`
	ShippingServiceOptions              []ShippingServiceOption `yaml:"ShippingServiceOptions"`
	InternationalShippingServiceOptions []ShippingServiceOption `yaml:"InternationalShippingServiceOptions"`

	ErrorsFromEbay []ErrorMessage
	// contains filtered or unexported fields
}

func NewItem

func NewItem() *Item

func (*Item) AddPaymentMethod

func (o *Item) AddPaymentMethod(v PaymentMethod)

func (*Item) AddPictureDetail

func (o *Item) AddPictureDetail(v PictureDetail)

func (*Item) AddShipToLocation

func (o *Item) AddShipToLocation(v ShipToLocation)

func (*Item) Clone

func (o *Item) Clone() *Item

func (*Item) Debug

func (o_Item *Item) Debug() string

func (*Item) FilterPaymentMethods

func (o *Item) FilterPaymentMethods(f PaymentMethodFilter) []PaymentMethod

func (*Item) FilterPictureDetails

func (o *Item) FilterPictureDetails(f PictureDetailFilter) []PictureDetail

func (*Item) FilterShipToLocations

func (o *Item) FilterShipToLocations(f ShipToLocationFilter) []ShipToLocation

func (*Item) FromYAML

func (o *Item) FromYAML(data []byte) error

func (*Item) GetInternalID

func (i *Item) GetInternalID() string

func (*Item) GetListingType

func (o *Item) GetListingType() string

func (*Item) GetPaymentMethod

func (o *Item) GetPaymentMethod(i int) PaymentMethod

func (*Item) GetPaymentMethods

func (o *Item) GetPaymentMethods() []PaymentMethod

func (*Item) GetPictureDetail

func (o *Item) GetPictureDetail(i int) PictureDetail

func (*Item) GetPictureDetails

func (o *Item) GetPictureDetails() []PictureDetail

func (*Item) GetPrice

func (o *Item) GetPrice() string

func (*Item) GetQuantity

func (o *Item) GetQuantity() string

func (*Item) GetSKU

func (o *Item) GetSKU() string

func (*Item) GetShipToLocation

func (o *Item) GetShipToLocation(i int) ShipToLocation

func (*Item) GetShipToLocations

func (o *Item) GetShipToLocations() []ShipToLocation

func (*Item) GetTitle

func (o *Item) GetTitle() string

func (*Item) RemovePaymentMethod

func (o *Item) RemovePaymentMethod(i int)

func (*Item) RemovePictureDetail

func (o *Item) RemovePictureDetail(i int)

func (*Item) RemoveShipToLocation

func (o *Item) RemoveShipToLocation(i int)

func (*Item) SetListingType

func (o *Item) SetListingType(v string)

func (*Item) SetPaymentMethods

func (o *Item) SetPaymentMethods(v []PaymentMethod)

func (*Item) SetPictureDetails

func (o *Item) SetPictureDetails(v []PictureDetail)

func (*Item) SetPrice

func (o *Item) SetPrice(v string)

func (*Item) SetQuantity

func (o *Item) SetQuantity(v string)

func (*Item) SetSKU

func (o *Item) SetSKU(v string)

func (*Item) SetShipToLocations

func (o *Item) SetShipToLocations(v []ShipToLocation)

func (*Item) SetTitle

func (o *Item) SetTitle(v string)

type ItemArrayStruct

type ItemArrayStruct struct {
	Items      []ItemResultStruct `xml:"Item"`
	Pagination PaginationStruct   `xml:PaginationResult`
}

type ItemFilter

type ItemFilter func(o *Item) bool

type ItemResultStruct

type ItemResultStruct struct {
	BestOfferDetails struct {
		BestOfferCount string
	}
	BuyItNowPrice             string
	ClassifiedAdPayPerLeadFee string

	HideFromSearch       string
	ID                   string
	ListingDetails       ListingDetailsStruct
	ListingDuration      string
	ListingType          string
	PrivateNotes         string
	Quantity             string
	QuantityAvailable    string
	QuestionCount        string
	ReasonHideFromSearch string
	ReservePrice         string
	SKU                  string
	StartPrice           string
	TimeLeft             string
	Title                string
	WatchCount           string
	PictureDetails       PictureDetail
	SellingStatus        SellingStatusStruct
	ShippingDetails      ShippingDetailsStruct
	Variations           []VariationStruct `xml:"Variations>Variation"`
	// contains filtered or unexported fields
}

type ListingDetailsStruct

type ListingDetailsStruct struct {
	ConvertedBuyItNowPrice string
	ConvertedReservePrice  string
	ConvertedStartPrice    string
	StartTime              string
	EndTime                string
}

type ListingRecommendation

type ListingRecommendation struct {
	Code      string
	FieldName string
	Group     string
	Message   string
	Metas     []Metadata `xml:"Metadata"`
	Type      string
	Values    []string `xml:"Value"`
}

func (*ListingRecommendation) Debug

func (o_ListingRecommendation *ListingRecommendation) Debug() string

type Metadata

type Metadata struct {
	Name  []string
	Value []string
}

func (*Metadata) Debug

func (o_Metadata *Metadata) Debug() string

type MyeBaySelling

type MyeBaySelling struct {
	ActiveList            MyeBaySellingOpts
	SoldList              MyeBaySellingOpts
	UnsoldList            MyeBaySellingOpts
	BidList               MyeBaySellingOpts
	DeletedFromSoldList   MyeBaySellingOpts
	DeletedFromUnsoldList MyeBaySellingOpts
	ScheduledList         MyeBaySellingOpts
	DetailLevels          []string `xml:"DetailLevel"`
	OutputSelectors       []string `xml:"OutputSelector"`
	SellingSummary        struct {
		Include bool
	}
	HideVariations bool
}

func NewMyeBaySelling

func NewMyeBaySelling() *MyeBaySelling

func (*MyeBaySelling) AddActiveList

func (o *MyeBaySelling) AddActiveList()

func (*MyeBaySelling) AddBidList

func (o *MyeBaySelling) AddBidList()

func (*MyeBaySelling) AddDeletedFromSoldList

func (o *MyeBaySelling) AddDeletedFromSoldList()

func (*MyeBaySelling) AddDeletedFromUnsoldList

func (o *MyeBaySelling) AddDeletedFromUnsoldList()

func (*MyeBaySelling) AddScheduledList

func (o *MyeBaySelling) AddScheduledList()

func (*MyeBaySelling) AddSoldList

func (o *MyeBaySelling) AddSoldList()

func (*MyeBaySelling) AddUnsoldList

func (o *MyeBaySelling) AddUnsoldList()

func (*MyeBaySelling) FromXML

func (o *MyeBaySelling) FromXML(data []byte) error

type MyeBaySellingOpts

type MyeBaySellingOpts struct {
	Include           bool
	IncludeNotes      bool
	ListingType       string
	OrderStatusFilter string
	Pagination        PaginationOpts

	Sort           string
	DurationInDays int
}

type MyeBaySellingResult

type MyeBaySellingResult struct {
	Ack                             string
	Build                           string
	CorrelationID                   string
	HardExpirationWarning           string
	Timestamp                       string
	Version                         string
	Summary                         SummaryStruct
	SellingSummary                  SummaryStruct
	ActiveList                      []ItemArrayStruct       `xml:"ActiveList>ItemArray"`
	DeletedFromSoldList             []OrderTransactionArray `xml:"DeletedFromSoldList>OrderTransactionArray"`
	DeletedFromUnsoldList           []ItemArrayStruct       `xml:"DeletedFromUnsoldList>ItemArray"`
	ScheduledList                   []ItemArrayStruct       `xml:"ScheduledList>ItemArray"`
	SoldList                        []OrderTransactionArray `xml:"SoldList>OrderTransactionArray"`
	UnsoldList                      []ItemArrayStruct       `xml:"UnsoldList>ItemArray"`
	ActiveListPagination            PaginationStruct        `xml:"ActiveList>PaginationResult"`
	DeletedFromSoldListPagination   PaginationStruct        `xml:"DeletedFromSoldList>PaginationResult"`
	DeletedFromUnsoldListPagination PaginationStruct        `xml:"DeletedFromUnsoldList>PaginationResult"`
	ScheduledListPagination         PaginationStruct        `xml:"ScheduledList>PaginationResult"`
	SoldListPagination              PaginationStruct        `xml:"SoldList>PaginationResult"`
	UnsoldListPagination            PaginationStruct        `xml:"UnsoldList>PaginationResult"`
	Errors                          []ErrorMessage
}

func NewFakeMyeBaySellingResult

func NewFakeMyeBaySellingResult(msg string) *MyeBaySellingResult

func NewMyeBaySellingResult

func NewMyeBaySellingResult() *MyeBaySellingResult

func (*MyeBaySellingResult) Failure

func (o *MyeBaySellingResult) Failure() bool

func (*MyeBaySellingResult) FromXML

func (o *MyeBaySellingResult) FromXML(data []byte) error

func (*MyeBaySellingResult) FromYAML

func (o *MyeBaySellingResult) FromYAML(data []byte) error

func (*MyeBaySellingResult) Success

func (o *MyeBaySellingResult) Success() bool

func (*MyeBaySellingResult) Warning

func (o *MyeBaySellingResult) Warning() bool

type NotificationEnable

type NotificationEnable struct {
	EventType   string `xml:"EventType" yaml:"EventType"`
	EventEnable string `xml:"EventEnable" yaml:"EventEnable"`
}

type NotificationFeedback

type NotificationFeedback struct {
	Comments []FeedbackComment `xml:"FeedbackDetail"`
}

type NotificationPreferencesRequest

type NotificationPreferencesRequest struct {
	PreferenceLevel string `xml:"PreferenceLevel" yaml:"PreferenceLevel"`
}

func NewNotificationPreferencesRequest

func NewNotificationPreferencesRequest() *NotificationPreferencesRequest

func (*NotificationPreferencesRequest) FromXML

func (o *NotificationPreferencesRequest) FromXML(data []byte) error

func (*NotificationPreferencesRequest) FromYAML

func (o *NotificationPreferencesRequest) FromYAML(data []byte) error

type NotificationPreferencesResult

type NotificationPreferencesResult struct {
	Timestamp                      string                        `xml:"Timestamp" yaml:"Timestamp"`
	Ack                            string                        `xml:"Ack" yaml:"Ack"`
	Version                        int64                         `xml:"Version" yaml:"Version"`
	Build                          string                        `xml:"Build" yaml:"Build"`
	ApplicationDeliveryPreferences ApplicationDeliveryPreference `xml:"ApplicationDeliveryPreferences" yaml:"ApplicationDeliveryPreferences"`
	UserDeliveryPreferenceArray    UserDeliveryPreference        `xml:"UserDeliveryPreferenceArray" yaml:"UserDeliveryPreferenceArray"`
	Errors                         []ErrorMessage
}

func NewFakeNotificationPreferencesResult

func NewFakeNotificationPreferencesResult(msg string) *NotificationPreferencesResult

func NewNotificationPreferencesResult

func NewNotificationPreferencesResult() *NotificationPreferencesResult

func (*NotificationPreferencesResult) Failure

func (o *NotificationPreferencesResult) Failure() bool

func (*NotificationPreferencesResult) FromXML

func (o *NotificationPreferencesResult) FromXML(data []byte) error

func (*NotificationPreferencesResult) FromYAML

func (o *NotificationPreferencesResult) FromYAML(data []byte) error

func (*NotificationPreferencesResult) Success

func (o *NotificationPreferencesResult) Success() bool

func (*NotificationPreferencesResult) Warning

func (o *NotificationPreferencesResult) Warning() bool

type NotificationResult

type NotificationResult struct {
	Body struct {
		InnerXML         string                 `xml:",innerxml"`
		Feedback         []NotificationFeedback `xml:"GetFeedbackResponse>FeedbackDetailArray"`
		PaginationResult struct {
			TotalNumberOfPages   string
			TotalNumberOfEntries string
		} `xml:"GetFeedbackResponse>PaginationResult"`
		EntriesPerPage        string `xml:"GetFeedbackResponse>EntriesPerPage"`
		PageNumber            string `xml:"GetFeedbackResponse>PageNumber"`
		NotificationEventName string `xml:"GetFeedbackResponse>NotificationEventName"`
		RecipientUserID       string `xml:"GetFeedbackResponse>RecipientUserID"`
	}

	Header struct {
		InnerXML string `xml:",innerxml"`
	}
}

func NewNotificationResultEx

func NewNotificationResultEx(data []byte) (*NotificationResult, error)

type OrderStruct

type OrderStruct struct {
	ID           string `xml:"OrderID"`
	Subtotal     string
	Transactions []TransactionStruct `xml:"TransactionArray>Transaction"`
}

type OrderTransactionArray

type OrderTransactionArray struct {
	Order        OrderStruct         `xml:"OrderTransaction>Order"`
	Transactions []TransactionStruct `xml:"Transaction"`
	Pagination   PaginationStruct    `xml:"PaginationResult"`
}

type PaginationOpts

type PaginationOpts struct {
	EntriesPerPage int
	PageNumber     int
}

type PaginationStruct

type PaginationStruct struct {
	TotalNumberOfEntries string
	TotalNumberOfPages   string
}

type PaymentMethod

type PaymentMethod string

type PaymentMethodFilter

type PaymentMethodFilter func(o PaymentMethod) bool

type PictureDetail

type PictureDetail struct {
	GalleryDuration string `yaml:"GalleryDuration"`
	GalleryType     string `yaml:"GalleryType"`
	GalleryURL      string `yaml:"GalleryURL"`
	PhotoDisplay    string `yaml:"PhotoDisplay"`
	PictureURL      string `yaml:"PictureURL"`
}

func NewPictureDetail

func NewPictureDetail() *PictureDetail

func (*PictureDetail) Clone

func (o *PictureDetail) Clone() *PictureDetail

func (*PictureDetail) Debug

func (o_PictureDetail *PictureDetail) Debug() string

func (*PictureDetail) GetGalleryDuration

func (o *PictureDetail) GetGalleryDuration() string

func (*PictureDetail) GetGalleryType

func (o *PictureDetail) GetGalleryType() string

func (*PictureDetail) GetGalleryURL

func (o *PictureDetail) GetGalleryURL() string

func (*PictureDetail) GetPhotoDisplay

func (o *PictureDetail) GetPhotoDisplay() string

func (*PictureDetail) GetPictureURL

func (o *PictureDetail) GetPictureURL() string

func (*PictureDetail) SetGalleryDuration

func (o *PictureDetail) SetGalleryDuration(v string)

func (*PictureDetail) SetGalleryType

func (o *PictureDetail) SetGalleryType(v string)

func (*PictureDetail) SetGalleryURL

func (o *PictureDetail) SetGalleryURL(v string)

func (*PictureDetail) SetPhotoDisplay

func (o *PictureDetail) SetPhotoDisplay(v string)

func (*PictureDetail) SetPictureURL

func (o *PictureDetail) SetPictureURL(v string)

type PictureDetailFilter

type PictureDetailFilter func(o PictureDetail) bool

type Result

type Result struct {
	Timestamp             string
	Ack                   string
	Version               string
	Build                 string
	ItemID                string
	SKU                   string
	StartTime             string
	EndTime               string
	Category2ID           string
	CategoryID            string
	CorrelationID         string
	HardExpirationWarning string
	Message               string
	CategoryCount         string
	CategoryVersion       string
	MinimumReservePrice   string
	ReduceReserveAllowed  string
	ReservePriceAllowed   string
	UpdateTime            string

	Items      []Result   `xml:"AddItemResponseContainer"`
	Categories []Category `xml:"CategoryArray>Category"`

	DiscountReasons            []string `xml:"DiscountReason"`
	Errors                     []ErrorMessage
	DuplicateInvocationDetails []DuplicateInvocationDetail
	Fees                       []Fee `xml:"Fees>Fee"`
	ListingRecommendations     []ListingRecommendation
}

func NewFakeResult

func NewFakeResult(msg string) *Result
	return nil, errors.New("could not detect result type")
}

func (*Result) Debug

func (o_Result *Result) Debug() string

func (*Result) Failure

func (r *Result) Failure() bool

func (*Result) FromXML

func (r *Result) FromXML(b []byte) error

func (*Result) Success

func (r *Result) Success() bool

func (*Result) Warning

func (r *Result) Warning() bool

type ReturnPolicyStruct

type ReturnPolicyStruct struct {
	Description              string `yaml:"Description"`
	EAN                      string `yaml:"EAN"`
	ExtendedHolidayReturns   string `yaml:"ExtendedHolidayReturns"`
	Refund                   string `yaml:"Refund"`
	RefundOption             string `yaml:"RefundOption"`
	RestockingFeeValue       string `yaml:"RestockingFeeValue"`
	RestockingFeeValueOption string `yaml:"RestockingFeeValueOption"`
	ReturnsAccepted          string `yaml:"ReturnsAccepted"`
	ReturnsAcceptedOption    string `yaml:"ReturnsAcceptedOption"`
	ReturnsWithin            string `yaml:"ReturnsWithin"`
	ReturnsWithinOption      string `yaml:"ReturnsWithinOption"`
	ShippingCostPaidBy       string `yaml:"ShippingCostPaidBy"`
	ShippingCostPaidByOption string `yaml:"ShippingCostPaidByOption"`
	WarrantyDuration         string `yaml:"WarrantyDuration"`
	WarrantyDurationOption   string `yaml:"WarrantyDurationOption"`
	WarrantyOffered          string `yaml:"WarrantyOffered"`
	WarrantyOfferedOption    string `yaml:"WarrantyOfferedOption"`
	WarrantyType             string `yaml:"WarrantyType"`
	WarrantyTypeOption       string `yaml:"WarrantyTypeOption"`
}

type SMSSubscription

type SMSSubscription struct {
	CarrierID         string `xml:"CarrierID" yaml:"CarrierID"`
	ErrorCode         string `xml:"ErrorCode" yaml:"ErrorCode"`
	ItemToUnsubscribe string `xml:"ItemToUnsubscribe" yaml:"ItemToUnsubscribe"`
	SMSPhone          string `xml:"SMSPhone" yaml:"SMSPhone"`
	UserStatus        string `xml:"UserStatus" yaml:"UserStatus"`
}

type SellingStatusStruct

type SellingStatusStruct struct {
	ConvertedCurrentPrice string
	CurrentPrice          string
	QuantitySold          string
	ReserveMet            string
	BidCount              string
	BidderCount           string
	HighBidder            struct {
		FeedbackRatingStar string
		FeedbackScore      string
		UserID             string
	}
	PromotionalSaleDetails struct {
		EndTime       string
		OriginalPrice string
		StartTime     string
	}
}

type SetNotificationPreferencesRequest

type SetNotificationPreferencesRequest struct {
	ApplicationDeliveryPreferences ApplicationDeliveryPreference `xml:"ApplicationDeliveryPreferences" yaml:"ApplicationDeliveryPreferences"`
	DeliveryURLName                string                        `xml:"DeliveryURLName" yaml:"DeliveryURLName"`
	EventProperties                []EventProperty               `xml:"EventProperty" yaml:"EventProperty"`
	UserData                       UserData                      `xml:"UserData" yaml:"UserData"`
	UserDeliveryPreferenceArray    UserDeliveryPreference        `xml:"UserDeliveryPreferenceArray" yaml:"UserDeliveryPreferenceArray"`
}

func NewSetNotificationPreferencesRequest

func NewSetNotificationPreferencesRequest() *SetNotificationPreferencesRequest

func (*SetNotificationPreferencesRequest) FromXML

func (o *SetNotificationPreferencesRequest) FromXML(data []byte) error

func (*SetNotificationPreferencesRequest) FromYAML

func (o *SetNotificationPreferencesRequest) FromYAML(data []byte) error

type ShipToLocation

type ShipToLocation string

type ShipToLocationFilter

type ShipToLocationFilter func(o ShipToLocation) bool

type ShippingDetailsStruct

type ShippingDetailsStruct struct {
	GlobalShipping         string
	ShippingType           string
	ShippingServiceOptions []struct {
		LocalPickup         string
		LogisticPlanType    string
		ShippingServiceCost string
		ShippingSurcharge   string
	}
}

type ShippingServiceOption

type ShippingServiceOption struct {
	Service   string           `yaml:"Service"`
	Cost      string           `yaml:"Cost"`
	Priority  string           `yaml:"Priority"`
	Locations []ShipToLocation `yaml:"Locations" xml:"ShipToLocation"`
}

func NewShippingServiceOption

func NewShippingServiceOption() *ShippingServiceOption

func (*ShippingServiceOption) Clone

func (*ShippingServiceOption) Debug

func (o_ShippingServiceOption *ShippingServiceOption) Debug() string

func (*ShippingServiceOption) GetCost

func (o *ShippingServiceOption) GetCost() string

func (*ShippingServiceOption) GetPriority

func (o *ShippingServiceOption) GetPriority() string

func (*ShippingServiceOption) GetService

func (o *ShippingServiceOption) GetService() string

func (*ShippingServiceOption) SetCost

func (o *ShippingServiceOption) SetCost(v string)

func (*ShippingServiceOption) SetPriority

func (o *ShippingServiceOption) SetPriority(v string)

func (*ShippingServiceOption) SetService

func (o *ShippingServiceOption) SetService(v string)

type SummarySchedule

type SummarySchedule struct {
	EventType     string `xml:"EventType" yaml:"EventType"`
	Frequency     string `xml:"Frequency" yaml:"Frequency"`
	SummaryPeriod string `xml:"SummaryPeriod" yaml:"SummaryPeriod"`
}

type SummaryStruct

type SummaryStruct struct {
	ActiveAuctionCount       string
	AmountLimitRemaining     string
	AuctionBidCount          string
	AuctionSellingCount      string
	ClassifiedAdCount        string
	ClassifiedAdOfferCount   string
	QuantityLimitRemaining   string
	SoldDurationInDays       string
	TotalAuctionSellingValue string
	TotalLeadCount           string
	TotalListingsWithLeads   string
	TotalSoldCount           string
	TotalSoldValue           string
}

type TransactionStruct

type TransactionStruct struct {
	ConvertedTransactionPrice string
	CreatedDate               string
	IsMultiLegShipping        string
	LineItemID                string
	PaidTime                  string
	PaisaPayID                string
	Platform                  string
	QuantityPurchased         string
	SellerPaidStatus          string
	ShippedTime               string
	ID                        string `xml:"TransactionID"`
	Price                     string
	Buyer                     BuyerStruct `xml:"Buyer>BuyerInfo"`
	OrderLineItemID           string

	FeedbackLeft string `xml:"FeedbackLeft>CommentType"`

	FeedbackReceived string `xml:"FeedbackReceived>CommentType"`

	Item ItemResultStruct `xml:"Item"`

	Status struct {
		PaymentHold string
	}
}

type UserData

type UserData struct {
	ExternalUserData string            `xml:"ExternalUserData" yaml:"ExternalUserData"`
	SMSSubscription  SMSSubscription   `xml:"SMSSubscription" yaml:"SMSSubscription"`
	SummarySchedules []SummarySchedule `xml:"SummarySchedule" yaml:"SummarySchedule"`
}

type UserDeliveryPreference

type UserDeliveryPreference struct {
	EnabledNotifications []NotificationEnable `xml:"NotificationEnable" yaml:"NotificationEnable"`
}

type VariationStruct

type VariationStruct struct {
	PrivateNotes   string
	Quantity       string
	SKU            string
	StartPrice     string
	VariationTitle string
	WatchCount     string
	SellingStatus  SellingStatusStruct

	VariationSpecifics []struct {
		NameValueList []struct {
			Name   string
			Values []string `xml:"Value"`
		}
	}
}

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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