amiando

package module
v0.0.0-...-5be74d0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2012 License: MIT Imports: 10 Imported by: 0

README

Go library for the Amiando API

See: http://developers.amiando.com/

Documentation

Overview

Support for the Amiando API.

Used by http://startuplive.in

Index

Constants

View Source
const (
	Male   = 1
	Female = 2
)
View Source
const DateFormat = "2006-01-02T15:04:05"

Variables

This section is empty.

Functions

func CreateAPIKey

func CreateAPIKey(name string) (key string, err error)

func PrettifyJSON

func PrettifyJSON(compactJSON []byte) string

func TestAmiandoWebHook

func TestAmiandoWebHook(posturl string) error

Types

type Address

type Address struct {
	Street  string
	Street2 string
	City    string
	ZipCode string
	Country string
}

type AmiandoUser

type AmiandoUser struct {
	Id        ID     `json:"id"`
	FirstName string `json:"firstName"`
	LastName  string `json:"lastName"`
	Username  string `json:"username"`
	Password  string `json:"password"`
	Language  string `json:"language"`
}

type Api

type Api struct {
	Key string
	// contains filtered or unexported fields
}

func NewApi

func NewApi(key string) *Api

func (*Api) ActivateEvent

func (self *Api) ActivateEvent(id string) error

func (*Api) AddBillingInfoToUser

func (self *Api) AddBillingInfoToUser(userid, firstName, lastName, company, street, zipCode, city, country string) error

func (*Api) AddPaymentToUser

func (self *Api) AddPaymentToUser(userid, accountHolder, bankName, swift, iban, country string) error

func (*Api) Call

func (self *Api) Call(resourceFormat string, resourceArg interface{}, result ErrorReporter) (err error)

func (*Api) Call_debug

func (self *Api) Call_debug(resourceFormat string, resourceArg interface{}, result ErrorReporter) (err error)

func (*Api) CreateAmiandoUser

func (self *Api) CreateAmiandoUser(firstname, lastname, username, password, language string) (id string, err error)

func (*Api) CreateEvent

func (self *Api) CreateEvent(hostId string, title string, country string, date string, identifier string) (id string, err error)

func (*Api) CreateTicketCategory

func (self *Api) CreateTicketCategory(event, name, price, available, salestart, saleend string) (id string, err error)

func (*Api) HostId

func (self *Api) HostId(username string) (ids []ID, err error)

func (*Api) Payment

func (self *Api) Payment(id ID, out interface{}) (err error)

func (*Api) Ticket

func (self *Api) Ticket(id ID, out interface{}) (err error)

func (*Api) TicketIDsOfPayment

func (self *Api) TicketIDsOfPayment(paymentID ID) (ids []ID, err error)

func (*Api) User

func (self *Api) User(id ID, out interface{}) (err error)

type ApiKey

type ApiKey struct {
	ID         ID     `json:"id"`
	Enabled    bool   `json:"enabled"`
	Key        string `json:"key"`
	Identifier string `json:"identifier"`
	Name       string `json:"name"`
}

type BasicEventData

type BasicEventData struct {
	HostID                 ID      `json:"hostId"`
	Title                  string  `json:"title"`
	Country                string  `json:"country"`
	Language               string  `json:"language"`
	StartDate              string  `json:"selectedDate"`
	EndDate                string  `json:"selectedEndDate"`
	Timezone               string  `json:"timezone"`
	Visibility             string  `json:"visibility"`
	Identifier             string  `json:"identifier"`
	Description            string  `json:"description"`
	ShortDescription       string  `json:"shortDescription"`
	EventType              string  `json:"eventType"`
	OrganisatorDisplayName string  `json:"organisatorDisplayName"`
	PartnerEventUrl        string  `json:"partnerEventUrl"`
	Location               string  `json:"location"`
	LocationDescription    string  `json:"locationDescription"`
	Street                 string  `json:"street2"`
	ZipCode                string  `json:"zipCode"`
	City                   string  `json:"city"`
	State                  string  `json:"state"`
	CreationTime           string  `json:"creationTime"`
	LastModified           string  `json:"lastModified"`
	Longitude              float64 `json:"longitude"`
	Latitude               float64 `json:"latitude"`
}

type Error

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

func (*Error) Error

func (self *Error) Error() string

type ErrorReporter

type ErrorReporter interface {
	Err() error
	Reset()
}

type Event

type Event struct {
	ResultBase
	Data       BasicEventData `json:"event"`
	Api        *Api           `json:"-"`
	Identifier string         `json:"-"`
	InternalID ID             `json:"-"`
}

func CreateNewEvent

func CreateNewEvent(api *Api, identifier string) (event *Event, err error)

func NewEvent

func NewEvent(api *Api, identifier string) (event *Event, err error)

func (*Event) EnumParticipants

func (self *Event) EnumParticipants() (<-chan *Participant, <-chan error)

func (*Event) EnumParticipantsByPayment

func (self *Event) EnumParticipantsByPayment(payment string) (<-chan *Participant, <-chan error)

func (*Event) PaymentIDs

func (self *Event) PaymentIDs() (ids []ID, err error)

func (*Event) Read

func (self *Event) Read(out ErrorReporter) (err error)

func (*Event) TicketIDs

func (self *Event) TicketIDs() (ids []ID, err error)

type ID

type ID int64

func (ID) String

func (self ID) String() string

type JsonResult

type JsonResult struct {
	ResultBase
	JSON []byte
}

Has to be used as a pointer to member of a struct

func (*JsonResult) Reset

func (self *JsonResult) Reset()

func (*JsonResult) String

func (self *JsonResult) String() string

func (*JsonResult) UnmarshalJSON

func (self *JsonResult) UnmarshalJSON(jsonData []byte) error

type Participant

type Participant struct {
	Event *Event `json:"-"`

	PaymentID     ID            `json:"-"`
	PaymentUserID ID            `json:"buyerId"`      // payment
	PaymentStatus PaymentStatus `json:"status"`       // payment
	InvoiceNumber string        `json:"identifier"`   // payment
	CreatedDate   string        `json:"creationTime"` // payment
	ModifiedDate  string        `json:"lastModified"` // payment

	UserData []UserData `json:"userData"` // payment & ticket

	TicketID           ID         `json:"-"`
	FirstName          string     `json:"firstName"`         // ticket
	LastName           string     `json:"lastName"`          // ticket
	Email              string     `json:"email"`             // ticket
	CheckedDate        string     `json:"lastChecked"`       // ticket
	CancelledDate      string     `json:"cancelled"`         // ticket
	TicketType         TicketType `json:"ticketType"`        // ticket
	RegistrationNumber string     `json:"displayIdentifier"` // ticket
}

func (*Participant) FindRequiredUserData

func (self *Participant) FindRequiredUserData(title string, restrictToTypes ...UserDataType) (userData *UserData, err error)

func (*Participant) FindUserData

func (self *Participant) FindUserData(title string, restrictToTypes ...UserDataType) (userData *UserData, found bool)

Returns nil if no UserData with title is found

type PaymentStatus

type PaymentStatus string
const (
	PaymentNew        PaymentStatus = "new"
	PaymentAuthorized PaymentStatus = "authorized"
	PaymentPaid       PaymentStatus = "paid"
	PaymentDisbursed  PaymentStatus = "disbursed"
	PaymentCancelled  PaymentStatus = "cancelled"
)

type Product

type Product struct {
	Product     string
	Price       string
	Available   string
	Description string
}

type ResultBase

type ResultBase struct {
	Success bool     `json:"success"`
	Errors  []string `json:"errors"`
}

func (*ResultBase) Err

func (self *ResultBase) Err() error

func (*ResultBase) Reset

func (self *ResultBase) Reset()

type TicketType

type TicketType string
const (
	BadgeTicket        TicketType = "com.amiando.ticket.type.Badge"        // Means that the ticket is a badge.
	ETicketTicket      TicketType = "com.amiando.ticket.type.ETicket"      // Means that the ticket will be sent via email.
	PaperTicket        TicketType = "com.amiando.ticket.type.Paper"        // Means that the ticket is a confirmation.
	ConfirmationTicket TicketType = "com.amiando.ticket.type.Confirmation" // Means that the payment was bought using prepayment.
	OnSiteTicket       TicketType = "com.amiando.ticket.type.OnSite"       // Means that the ticket was bought via EasyEntry.
)

type UserData

type UserData struct {
	Title string       `json:"title"`
	Type  UserDataType `json:"type"`
	Value interface{}  `json:"value"`
}

func (*UserData) Address

func (self *UserData) Address() *Address

func (*UserData) String

func (self *UserData) String() string

type UserDataType

type UserDataType string
const (
	UserDataString      UserDataType = "string"   // value is of type String.
	UserDataNumber      UserDataType = "number"   // value is of type Integer.
	UserDataDate        UserDataType = "date"     // value is of type Date.
	UserDataGender      UserDataType = "gender"   // value is of type Integer.
	UserDataEmail       UserDataType = "email"    // value is of type String.
	UserDataUrl         UserDataType = "url"      // value is of type String.
	UserDataBirthday    UserDataType = "birthday" // value is of type Date.
	UserDataAddress     UserDataType = "address"  // value is an object of type Address.
	UserDataPhone       UserDataType = "phone"    // value is of type String.
	UserDataZipCode     UserDataType = "zipCode"  // value is of type String.
	UserDataCountry     UserDataType = "country"  // value is of type Country. Country codes are defined by the ISO 3166-1-alpha-2 code standard
	UserDataBlog        UserDataType = "blog"     // value is of type String.
	UserDataCheckbox    UserDataType = "checkbox" // value is of type Bool
	UserDataRadiobutton UserDataType = "radio"    // value is of type String.
	UserDataDropdown    UserDataType = "dropdown" // value is of type String.
	UserDataTextArea    UserDataType = "textarea" // value is of type String.
	UserDataProduct     UserDataType = "product"  // value is of type String.
	UserDataPhoto       UserDataType = "photo"    // value is of type String (URL)
)

Jump to

Keyboard shortcuts

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