exactonline_xml

package module
v0.0.0-...-f393089 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2019 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultBaseURL = url.URL{
		Scheme:   "https",
		Host:     "start.exactonline.nl",
		Path:     "docs/",
		RawQuery: "_Division_={{.divisionID}}",
	}
)

Functions

func AddQueryParamsToRequest

func AddQueryParamsToRequest(requestParams interface{}, req *http.Request, skipEmpty bool) error

func CheckResponse

func CheckResponse(r *http.Response) error

CheckResponse checks the Client response for errors, and returns them if present. A response is considered an error if it has a status code outside the 200 range. Client error responses are expected to have either no response body, or a json response body that maps to ErrorResponse. Any other response body will be silently ignored.

Types

type Client

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

Client manages communication with Exact Globe Client

func NewClient

func NewClient(httpClient *http.Client, divisionID int) *Client

NewClient returns a new Exact Globe Client client

func (*Client) BaseURL

func (c *Client) BaseURL() url.URL

func (*Client) Charset

func (c *Client) Charset() string

func (*Client) Debug

func (c *Client) Debug() bool

func (*Client) DivisionID

func (c *Client) DivisionID() int

func (*Client) Do

func (c *Client) Do(req *http.Request, responseBody interface{}) (*http.Response, error)

Do sends an Client request and returns the Client response. The Client response is json decoded and stored in the value pointed to by v, or returned as an error if an Client error has occurred. If v implements the io.Writer interface, the raw response will be written to v, without attempting to decode it.

func (*Client) GetEndpointURL

func (c *Client) GetEndpointURL(relative string, pathParams PathParams) url.URL

func (*Client) MediaType

func (c *Client) MediaType() string

func (*Client) NewMatchSetsDownloadPathParams

func (c *Client) NewMatchSetsDownloadPathParams() *MatchSetsDownloadPathParams

func (*Client) NewMatchSetsDownloadQueryParams

func (c *Client) NewMatchSetsDownloadQueryParams() *MatchSetsDownloadQueryParams

func (*Client) NewMatchSetsDownloadRequest

func (c *Client) NewMatchSetsDownloadRequest() MatchSetsDownloadRequest

func (*Client) NewMatchSetsDownloadRequestBody

func (s *Client) NewMatchSetsDownloadRequestBody() MatchSetsDownloadRequestBody

func (*Client) NewRequest

func (c *Client) NewRequest(ctx context.Context, method string, URL url.URL, body interface{}) (*http.Request, error)

func (*Client) SetBaseURL

func (c *Client) SetBaseURL(baseURL url.URL)

func (*Client) SetCharset

func (c *Client) SetCharset(charset string)

func (*Client) SetDebug

func (c *Client) SetDebug(debug bool)

func (*Client) SetDivisionID

func (c *Client) SetDivisionID(divisionID int)

func (*Client) SetHTTPClient

func (c *Client) SetHTTPClient(client *http.Client)

func (*Client) SetMediaType

func (c *Client) SetMediaType(mediaType string)

func (*Client) SetUserAgent

func (c *Client) SetUserAgent(userAgent string)

func (*Client) Unmarshal

func (c *Client) Unmarshal(r io.Reader, vv ...interface{}) error

func (*Client) UserAgent

func (c *Client) UserAgent() string

type DefaultQueryParams

type DefaultQueryParams struct {
	TSPaging string `schema:"TSPaging,omitempty"`

	// 0 = Exact Online (default)
	// 1 = Exact Globe/Synergy<Paste>
	Transform int `schema:"Transform"`
}

type ErrorResponse

type ErrorResponse struct {
	// HTTP response that caused this error
	Response *http.Response `json:"-"`

	Errors []error
}

func (ErrorResponse) Error

func (r ErrorResponse) Error() string

func (*ErrorResponse) UnmarshalJSON

func (r *ErrorResponse) UnmarshalJSON(data []byte) error

type MatchLine

type MatchLine struct {
	FinYear   int     `xml:"finyear,attr"`
	FinPeriod int     `xml:"finperiod,attr"`
	Journal   string  `xml:"journal,attr"`
	Entry     int     `xml:"entry,attr"`
	AmountDC  float64 `xml:"amountdc,attr"`
}

type MatchLines

type MatchLines []MatchLine

func (*MatchLines) UnmarshalXML

func (ll *MatchLines) UnmarshalXML(e *xml.Decoder, start xml.StartElement) error

type MatchSet

type MatchSet struct {
	GLAccountCode string
	AccountCode   string
	MatchLines    MatchLines
}

func (*MatchSet) UnmarshalXML

func (ms *MatchSet) UnmarshalXML(e *xml.Decoder, start xml.StartElement) error

type MatchSets

type MatchSets []MatchSet

func (*MatchSets) UnmarshalXML

func (ss *MatchSets) UnmarshalXML(e *xml.Decoder, start xml.StartElement) error

type MatchSetsDownloadPathParams

type MatchSetsDownloadPathParams struct {
}

func (*MatchSetsDownloadPathParams) Params

func (p *MatchSetsDownloadPathParams) Params() map[string]string

type MatchSetsDownloadQueryParams

type MatchSetsDownloadQueryParams struct {
	DefaultQueryParams

	// Grootboekrekening
	GLAccount string `schema:"Params_GLAccount,omitempty"`
	// Relatiecode
	AccountCode string `schema:"Params_AccountCode,omitempty"`
	// Data subscription token
	DownloadID string `schema:"Params_DownloadID,omitempty"`
}

func (MatchSetsDownloadQueryParams) ToURLValues

func (p MatchSetsDownloadQueryParams) ToURLValues() (url.Values, error)

type MatchSetsDownloadRequest

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

func (*MatchSetsDownloadRequest) All

func (*MatchSetsDownloadRequest) Do

func (*MatchSetsDownloadRequest) Method

func (r *MatchSetsDownloadRequest) Method() string

func (*MatchSetsDownloadRequest) NewResponseBody

func (*MatchSetsDownloadRequest) PathParams

func (*MatchSetsDownloadRequest) QueryParams

func (*MatchSetsDownloadRequest) RequestBody

func (*MatchSetsDownloadRequest) SetMethod

func (r *MatchSetsDownloadRequest) SetMethod(method string)

func (*MatchSetsDownloadRequest) SetRequestBody

func (*MatchSetsDownloadRequest) URL

func (r *MatchSetsDownloadRequest) URL() url.URL

type MatchSetsDownloadRequestBody

type MatchSetsDownloadRequestBody struct {
}

type MatchSetsDownloadResponseBody

type MatchSetsDownloadResponseBody struct {
	MatchSets MatchSets
	Topics    Topics
	Messages  Messages
}

type Message

type Message struct {
}

type Messages

type Messages []Message

func (*Messages) UnmarshalXML

func (mm *Messages) UnmarshalXML(e *xml.Decoder, start xml.StartElement) error

type Oauth2Config

type Oauth2Config struct {
	oauth2.Config
}

func NewOauth2Config

func NewOauth2Config() *Oauth2Config

func (*Oauth2Config) SetBaseURL

func (c *Oauth2Config) SetBaseURL(baseURL *url.URL)

type PathParams

type PathParams interface {
	Params() map[string]string
}

type RequestCompletionCallback

type RequestCompletionCallback func(*http.Request, *http.Response)

RequestCompletionCallback defines the type of the request callback function

type SchemaMarshaler

type SchemaMarshaler interface {
	MarshalSchema() string
}

type ToURLValues

type ToURLValues interface {
	ToURLValues() (url.Values, error)
}

type Topic

type Topic struct {
	Code     string `xml:"code,attr"`
	TSD      string `xml:"ts_d,attr"`
	Count    int    `xml:"count,attr"`
	PageSize int    `xml:"pagesize,attr"`
}

type Topics

type Topics []Topic

func (*Topics) UnmarshalXML

func (tt *Topics) UnmarshalXML(e *xml.Decoder, start xml.StartElement) error

Jump to

Keyboard shortcuts

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