Documentation ¶
Index ¶
- func AddQueryParams(params1, params2 url.Values) url.Values
- func AddQueryParamsToRequest(requestParams interface{}, req *http.Request, skipEmpty bool) error
- func AddQueryParamsToURL(url url.URL, params url.Values) url.URL
- func CheckResponse(r *http.Response) error
- func NewSchemaEncoder() *schema.Encoder
- type AccountingPathParams
- type AccountingQueryParams
- type AccountingRequest
- func (r *AccountingRequest) Do() (AccountingResponseBody, error)
- func (r *AccountingRequest) Method() string
- func (r *AccountingRequest) NewResponseBody() *AccountingResponseBody
- func (r *AccountingRequest) PathParams() *AccountingPathParams
- func (r *AccountingRequest) QueryParams() *AccountingQueryParams
- func (r *AccountingRequest) RequestBody() *AccountingRequestBody
- func (r *AccountingRequest) SetMethod(method string)
- func (r *AccountingRequest) SetRequestBody(body AccountingRequestBody)
- func (r *AccountingRequest) URL() url.URL
- type AccountingRequestBody
- type AccountingResponseBody
- type AccountingledgerPathParams
- type AccountingledgerQueryParams
- type AccountingledgerRequest
- func (r *AccountingledgerRequest) Do() (AccountingledgerResponseBody, error)
- func (r *AccountingledgerRequest) Method() string
- func (r *AccountingledgerRequest) NewResponseBody() *AccountingledgerResponseBody
- func (r *AccountingledgerRequest) PathParams() *AccountingledgerPathParams
- func (r *AccountingledgerRequest) QueryParams() *AccountingledgerQueryParams
- func (r *AccountingledgerRequest) RequestBody() *AccountingledgerRequestBody
- func (r *AccountingledgerRequest) SetMethod(method string)
- func (r *AccountingledgerRequest) SetRequestBody(body AccountingledgerRequestBody)
- func (r *AccountingledgerRequest) URL() url.URL
- type AccountingledgerRequestBody
- type AccountingledgerResponseBody
- type BeforeRequestDoCallback
- type Client
- func (c *Client) BaseURL() url.URL
- func (c *Client) Charset() string
- func (c *Client) CustomerID() string
- func (c *Client) Debug() bool
- func (c *Client) Do(req *http.Request, responseBody interface{}) (*http.Response, error)
- func (c *Client) GetEndpointURL(path string, pathParams PathParams) url.URL
- func (c *Client) InterfaceLanguage() string
- func (c *Client) MediaType() string
- func (c *Client) NewAccountingPathParams() *AccountingPathParams
- func (c *Client) NewAccountingQueryParams() *AccountingQueryParams
- func (c *Client) NewAccountingRequest() AccountingRequest
- func (s *Client) NewAccountingRequestBody() AccountingRequestBody
- func (c *Client) NewAccountingledgerPathParams() *AccountingledgerPathParams
- func (c *Client) NewAccountingledgerQueryParams() *AccountingledgerQueryParams
- func (c *Client) NewAccountingledgerRequest() AccountingledgerRequest
- func (s *Client) NewAccountingledgerRequestBody() AccountingledgerRequestBody
- func (c *Client) NewCustomerlistPathParams() *CustomerlistPathParams
- func (c *Client) NewCustomerlistQueryParams() *CustomerlistQueryParams
- func (c *Client) NewCustomerlistRequest() CustomerlistRequest
- func (s *Client) NewCustomerlistRequestBody() CustomerlistRequestBody
- func (c *Client) NewDimensionlistPathParams() *DimensionlistPathParams
- func (c *Client) NewDimensionlistQueryParams() *DimensionlistQueryParams
- func (c *Client) NewDimensionlistRequest() DimensionlistRequest
- func (s *Client) NewDimensionlistRequestBody() DimensionlistRequestBody
- func (c *Client) NewMAC(req *http.Request) string
- func (c *Client) NewRequest(ctx context.Context, method string, URL url.URL, body interface{}) (*http.Request, error)
- func (c *Client) NewTimestamp() string
- func (c *Client) NewTransactionID() string
- func (c *Client) OrganisationID() string
- func (c *Client) PartnerID() string
- func (c *Client) PartnerKey() string
- func (c *Client) PrivateKey() string
- func (c *Client) Sender() string
- func (c *Client) SetBaseURL(baseURL url.URL)
- func (c *Client) SetBeforeRequestDo(fun BeforeRequestDoCallback)
- func (c *Client) SetCharset(charset string)
- func (c *Client) SetCustomerID(customerID string)
- func (c *Client) SetDebug(debug bool)
- func (c *Client) SetHTTPClient(client *http.Client)
- func (c *Client) SetInterfaceLanguage(interfaceLanguage string)
- func (c *Client) SetMediaType(mediaType string)
- func (c *Client) SetOrganisationID(organisationID string)
- func (c *Client) SetPartnerID(partnerID string)
- func (c *Client) SetPartnerKey(partnerKey string)
- func (c *Client) SetPrivateKey(privateKey string)
- func (c *Client) SetSender(sender string)
- func (c *Client) SetUserAgent(userAgent string)
- func (c *Client) UserAgent() string
- type Customer
- type CustomerlistPathParams
- type CustomerlistQueryParams
- type CustomerlistRequest
- func (r *CustomerlistRequest) Do() (CustomerlistResponseBody, error)
- func (r *CustomerlistRequest) Method() string
- func (r *CustomerlistRequest) NewResponseBody() *CustomerlistResponseBody
- func (r *CustomerlistRequest) PathParams() *CustomerlistPathParams
- func (r *CustomerlistRequest) QueryParams() *CustomerlistQueryParams
- func (r *CustomerlistRequest) RequestBody() *CustomerlistRequestBody
- func (r *CustomerlistRequest) SetMethod(method string)
- func (r *CustomerlistRequest) SetRequestBody(body CustomerlistRequestBody)
- func (r *CustomerlistRequest) URL() url.URL
- type CustomerlistRequestBody
- type CustomerlistResponseBody
- type Customers
- type DateTime
- type DimensionlistPathParams
- type DimensionlistQueryParams
- type DimensionlistRequest
- func (r *DimensionlistRequest) Do() (DimensionlistResponseBody, error)
- func (r *DimensionlistRequest) Method() string
- func (r *DimensionlistRequest) NewResponseBody() *DimensionlistResponseBody
- func (r *DimensionlistRequest) PathParams() *DimensionlistPathParams
- func (r *DimensionlistRequest) QueryParams() *DimensionlistQueryParams
- func (r *DimensionlistRequest) RequestBody() *DimensionlistRequestBody
- func (r *DimensionlistRequest) SetMethod(method string)
- func (r *DimensionlistRequest) SetRequestBody(body DimensionlistRequestBody)
- func (r *DimensionlistRequest) URL() url.URL
- type DimensionlistRequestBody
- type DimensionlistResponseBody
- type ErrorResponse
- type NewVoucher
- type NewVoucherAttachment
- type NewVoucherAttachments
- type NewVoucherLine
- type NewVoucherLines
- type PathParams
- type RequestCompletionCallback
- type ResponseStatus
- type SchemaMarshaler
- type ToURLValues
- type Voucher
- type VoucherLine
- type VoucherLines
- type Vouchers
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddQueryParamsToRequest ¶
func CheckResponse ¶
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 xml response body that maps to ErrorResponse. Any other response body will be silently ignored.
func NewSchemaEncoder ¶
Types ¶
type AccountingPathParams ¶
type AccountingPathParams struct { }
func (*AccountingPathParams) Params ¶
func (p *AccountingPathParams) Params() map[string]string
type AccountingQueryParams ¶
type AccountingQueryParams struct { // Finds vouchers that are added after given date (inclusive) StartDate DateTime `schema:"startdate"` // Finds vouchers that are added before given date(inclusive) EndDate DateTime `schema:"enddate"` // Finds vouchers which account number is equal or greater than given value AccountNumberStart int `schema:"accountnumberstart,omitemptyt"` // Finds vouchers which account number is equal or less than given value AccountNumberEnd int `schema:"accountnumberend,omitempty"` // Finds vouchers that are modified or added after given date ChangedSince DateTime `schema:"changedsince,omitempty"` // Finds vouchers that are modified after given date LastModifiedStart DateTime `schema:"lastmodifiedstart,omitempty"` // Finds vouchers that are modified before given date LastModifiedEnd DateTime `schema:"lastmodifiedend,omitempty"` // Returns the creator of the voucher (eg. user or system) 1 ShowGenerator bool `schema:"showgenerator,omitempty"` // Finds all, only valid or invalidated and deleted vouchers. Status -attribute shows which status voucher is: "valid", "invalidated" or "deleted" 1 = All // 2 = Valid // 3 = Invalidated and deleted} VoucherStatus int `schema:"voucherstatus,omitempty"` }
func (AccountingQueryParams) ToURLValues ¶
func (p AccountingQueryParams) ToURLValues() (url.Values, error)
type AccountingRequest ¶
type AccountingRequest struct {
// contains filtered or unexported fields
}
func (*AccountingRequest) Do ¶
func (r *AccountingRequest) Do() (AccountingResponseBody, error)
func (*AccountingRequest) Method ¶
func (r *AccountingRequest) Method() string
func (*AccountingRequest) NewResponseBody ¶
func (r *AccountingRequest) NewResponseBody() *AccountingResponseBody
func (*AccountingRequest) PathParams ¶
func (r *AccountingRequest) PathParams() *AccountingPathParams
func (*AccountingRequest) QueryParams ¶
func (r *AccountingRequest) QueryParams() *AccountingQueryParams
func (*AccountingRequest) RequestBody ¶
func (r *AccountingRequest) RequestBody() *AccountingRequestBody
func (*AccountingRequest) SetMethod ¶
func (r *AccountingRequest) SetMethod(method string)
func (*AccountingRequest) SetRequestBody ¶
func (r *AccountingRequest) SetRequestBody(body AccountingRequestBody)
func (*AccountingRequest) URL ¶
func (r *AccountingRequest) URL() url.URL
type AccountingRequestBody ¶
type AccountingRequestBody struct { XMLName xml.Name `xml:"Root"` Voucher NewVoucher `xml:"Voucher"` }
type AccountingResponseBody ¶
type AccountingResponseBody struct { ResponseStatus ResponseStatus Vouchers Vouchers `xml:"Vouchers>Voucher"` }
type AccountingledgerPathParams ¶
type AccountingledgerPathParams struct { }
func (*AccountingledgerPathParams) Params ¶
func (p *AccountingledgerPathParams) Params() map[string]string
type AccountingledgerQueryParams ¶
type AccountingledgerQueryParams struct { // Finds vouchers that are added after given date (inclusive) StartDate DateTime `schema:"startdate"` // Finds vouchers that are added before given date(inclusive) EndDate DateTime `schema:"enddate"` // Finds vouchers which account number is equal or greater than given value AccountNumberStart int `schema:"accountnumberstart,omitemptyt"` // Finds vouchers which account number is equal or less than given value AccountNumberEnd int `schema:"accountnumberend,omitempty"` // Finds vouchers that are modified or added after given date ChangedSince DateTime `schema:"changedsince,omitempty"` // Finds vouchers that are modified after given date LastModifiedStart DateTime `schema:"lastmodifiedstart,omitempty"` // Finds vouchers that are modified before given date LastModifiedEnd DateTime `schema:"lastmodifiedend,omitempty"` // Returns the creator of the voucher (eg. user or system) 1 ShowGenerator bool `schema:"showgenerator,omitempty"` // Finds all, only valid or invalidated and deleted vouchers. Status -attribute shows which status voucher is: "valid", "invalidated" or "deleted" 1 = All // 2 = Valid // 3 = Invalidated and deleted} VoucherStatus int `schema:"voucherstatus,omitempty"` }
func (AccountingledgerQueryParams) ToURLValues ¶
func (p AccountingledgerQueryParams) ToURLValues() (url.Values, error)
type AccountingledgerRequest ¶
type AccountingledgerRequest struct {
// contains filtered or unexported fields
}
func (*AccountingledgerRequest) Do ¶
func (r *AccountingledgerRequest) Do() (AccountingledgerResponseBody, error)
func (*AccountingledgerRequest) Method ¶
func (r *AccountingledgerRequest) Method() string
func (*AccountingledgerRequest) NewResponseBody ¶
func (r *AccountingledgerRequest) NewResponseBody() *AccountingledgerResponseBody
func (*AccountingledgerRequest) PathParams ¶
func (r *AccountingledgerRequest) PathParams() *AccountingledgerPathParams
func (*AccountingledgerRequest) QueryParams ¶
func (r *AccountingledgerRequest) QueryParams() *AccountingledgerQueryParams
func (*AccountingledgerRequest) RequestBody ¶
func (r *AccountingledgerRequest) RequestBody() *AccountingledgerRequestBody
func (*AccountingledgerRequest) SetMethod ¶
func (r *AccountingledgerRequest) SetMethod(method string)
func (*AccountingledgerRequest) SetRequestBody ¶
func (r *AccountingledgerRequest) SetRequestBody(body AccountingledgerRequestBody)
func (*AccountingledgerRequest) URL ¶
func (r *AccountingledgerRequest) URL() url.URL
type AccountingledgerRequestBody ¶
type AccountingledgerRequestBody struct{}
type AccountingledgerResponseBody ¶
type AccountingledgerResponseBody struct { ResponseStatus ResponseStatus Vouchers Vouchers `xml:"Vouchers>Voucher"` }
type BeforeRequestDoCallback ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client manages communication with Visma Netvisor
func NewClient ¶
func NewClient(httpClient *http.Client, customerID, partnerID, organisationID, partnerKey, privateKey string) *Client
NewClient returns a new Visma Netvisor client
func (*Client) CustomerID ¶
func (*Client) Do ¶
Do sends an Client request and returns the Client response. The Client response is xml 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(path string, pathParams PathParams) url.URL
func (*Client) InterfaceLanguage ¶
func (*Client) NewAccountingPathParams ¶
func (c *Client) NewAccountingPathParams() *AccountingPathParams
func (*Client) NewAccountingQueryParams ¶
func (c *Client) NewAccountingQueryParams() *AccountingQueryParams
func (*Client) NewAccountingRequest ¶
func (c *Client) NewAccountingRequest() AccountingRequest
func (*Client) NewAccountingRequestBody ¶
func (s *Client) NewAccountingRequestBody() AccountingRequestBody
func (*Client) NewAccountingledgerPathParams ¶
func (c *Client) NewAccountingledgerPathParams() *AccountingledgerPathParams
func (*Client) NewAccountingledgerQueryParams ¶
func (c *Client) NewAccountingledgerQueryParams() *AccountingledgerQueryParams
func (*Client) NewAccountingledgerRequest ¶
func (c *Client) NewAccountingledgerRequest() AccountingledgerRequest
func (*Client) NewAccountingledgerRequestBody ¶
func (s *Client) NewAccountingledgerRequestBody() AccountingledgerRequestBody
func (*Client) NewCustomerlistPathParams ¶
func (c *Client) NewCustomerlistPathParams() *CustomerlistPathParams
func (*Client) NewCustomerlistQueryParams ¶
func (c *Client) NewCustomerlistQueryParams() *CustomerlistQueryParams
func (*Client) NewCustomerlistRequest ¶
func (c *Client) NewCustomerlistRequest() CustomerlistRequest
func (*Client) NewCustomerlistRequestBody ¶
func (s *Client) NewCustomerlistRequestBody() CustomerlistRequestBody
func (*Client) NewDimensionlistPathParams ¶
func (c *Client) NewDimensionlistPathParams() *DimensionlistPathParams
func (*Client) NewDimensionlistQueryParams ¶
func (c *Client) NewDimensionlistQueryParams() *DimensionlistQueryParams
func (*Client) NewDimensionlistRequest ¶
func (c *Client) NewDimensionlistRequest() DimensionlistRequest
func (*Client) NewDimensionlistRequestBody ¶
func (s *Client) NewDimensionlistRequestBody() DimensionlistRequestBody
func (*Client) NewRequest ¶
func (*Client) NewTimestamp ¶
func (*Client) NewTransactionID ¶
func (*Client) OrganisationID ¶
func (*Client) PartnerKey ¶
func (*Client) PrivateKey ¶
func (*Client) SetBaseURL ¶
func (*Client) SetBeforeRequestDo ¶
func (c *Client) SetBeforeRequestDo(fun BeforeRequestDoCallback)
func (*Client) SetCharset ¶
func (*Client) SetCustomerID ¶
func (*Client) SetHTTPClient ¶
func (*Client) SetInterfaceLanguage ¶
func (*Client) SetMediaType ¶
func (*Client) SetOrganisationID ¶
func (*Client) SetPartnerID ¶
func (*Client) SetPartnerKey ¶
func (*Client) SetPrivateKey ¶
func (*Client) SetUserAgent ¶
type CustomerlistPathParams ¶
type CustomerlistPathParams struct { }
func (*CustomerlistPathParams) Params ¶
func (p *CustomerlistPathParams) Params() map[string]string
type CustomerlistQueryParams ¶
type CustomerlistQueryParams struct { // Filters result list with given keyword. Match is searched from following // fields: Name, Customer Code, Organization identifier, CoName Keyword string `schema:"keyword,omitempty"` // Filters result to contain only customers having change after given date, date in format YYYY-MM-DD ChangedSince DateTime `schema:"changedsince,omitempty"` }
func (CustomerlistQueryParams) ToURLValues ¶
func (p CustomerlistQueryParams) ToURLValues() (url.Values, error)
type CustomerlistRequest ¶
type CustomerlistRequest struct {
// contains filtered or unexported fields
}
func (*CustomerlistRequest) Do ¶
func (r *CustomerlistRequest) Do() (CustomerlistResponseBody, error)
func (*CustomerlistRequest) Method ¶
func (r *CustomerlistRequest) Method() string
func (*CustomerlistRequest) NewResponseBody ¶
func (r *CustomerlistRequest) NewResponseBody() *CustomerlistResponseBody
func (*CustomerlistRequest) PathParams ¶
func (r *CustomerlistRequest) PathParams() *CustomerlistPathParams
func (*CustomerlistRequest) QueryParams ¶
func (r *CustomerlistRequest) QueryParams() *CustomerlistQueryParams
func (*CustomerlistRequest) RequestBody ¶
func (r *CustomerlistRequest) RequestBody() *CustomerlistRequestBody
func (*CustomerlistRequest) SetMethod ¶
func (r *CustomerlistRequest) SetMethod(method string)
func (*CustomerlistRequest) SetRequestBody ¶
func (r *CustomerlistRequest) SetRequestBody(body CustomerlistRequestBody)
func (*CustomerlistRequest) URL ¶
func (r *CustomerlistRequest) URL() url.URL
type CustomerlistRequestBody ¶
type CustomerlistRequestBody struct{}
type CustomerlistResponseBody ¶
type CustomerlistResponseBody struct { ResponseStatus ResponseStatus Customers Customers `xml:"Customerlist>Customer"` }
type DateTime ¶
func (DateTime) MarshalJSON ¶
func (DateTime) MarshalSchema ¶
func (DateTime) MarshalXML ¶
func (*DateTime) UnmarshalXML ¶
type DimensionlistPathParams ¶
type DimensionlistPathParams struct { }
func (*DimensionlistPathParams) Params ¶
func (p *DimensionlistPathParams) Params() map[string]string
type DimensionlistQueryParams ¶
type DimensionlistQueryParams struct{}
func (DimensionlistQueryParams) ToURLValues ¶
func (p DimensionlistQueryParams) ToURLValues() (url.Values, error)
type DimensionlistRequest ¶
type DimensionlistRequest struct {
// contains filtered or unexported fields
}
func (*DimensionlistRequest) Do ¶
func (r *DimensionlistRequest) Do() (DimensionlistResponseBody, error)
func (*DimensionlistRequest) Method ¶
func (r *DimensionlistRequest) Method() string
func (*DimensionlistRequest) NewResponseBody ¶
func (r *DimensionlistRequest) NewResponseBody() *DimensionlistResponseBody
func (*DimensionlistRequest) PathParams ¶
func (r *DimensionlistRequest) PathParams() *DimensionlistPathParams
func (*DimensionlistRequest) QueryParams ¶
func (r *DimensionlistRequest) QueryParams() *DimensionlistQueryParams
func (*DimensionlistRequest) RequestBody ¶
func (r *DimensionlistRequest) RequestBody() *DimensionlistRequestBody
func (*DimensionlistRequest) SetMethod ¶
func (r *DimensionlistRequest) SetMethod(method string)
func (*DimensionlistRequest) SetRequestBody ¶
func (r *DimensionlistRequest) SetRequestBody(body DimensionlistRequestBody)
func (*DimensionlistRequest) URL ¶
func (r *DimensionlistRequest) URL() url.URL
type DimensionlistRequestBody ¶
type DimensionlistRequestBody struct{}
type DimensionlistResponseBody ¶
type DimensionlistResponseBody struct { }
type ErrorResponse ¶
type ErrorResponse struct { // HTTP response that caused this error Response *http.Response `xml:"-"` Errors []error }
func (ErrorResponse) Error ¶
func (e ErrorResponse) Error() string
type NewVoucher ¶
type NewVoucher struct { CalculationMode string `xml:"CalculationMode"` // net VoucherDate struct { Text string `xml:",chardata"` // 2017-09-11 Format string `xml:"format,attr"` // ansi } `xml:"VoucherDate"` Description string `xml:"Description"` // Testiyritys Oy lasku 1 VoucherClass string `xml:"VoucherClass"` // Myyntilasku VoucherLine NewVoucherLines `xml:"VoucherLine"` VoucherAttachments NewVoucherAttachments `xml:"VoucherAttachments"` }
type NewVoucherAttachment ¶
type NewVoucherAttachments ¶
type NewVoucherAttachments []NewVoucherAttachment
type NewVoucherLine ¶
type NewVoucherLine struct { LineSum struct { Text float64 `xml:",chardata"` // -10000.00, -5000, 20000 Type string `xml:"type,attr"` } `xml:"LineSum"` Description string `xml:"Description"` // Testiyritys Oy, lasku 1, ... AccountNumber string `xml:"AccountNumber"` // 3000, 2939, 1701 VatPercent struct { Text string `xml:",chardata"` // 24, 0, 0 Vatcode string `xml:"vatcode,attr"` } `xml:"VatPercent"` Dimension struct { DimensionName string `xml:"DimensionName"` // Project DimensionItem string `xml:"DimensionItem"` // IIHF } `xml:"Dimension"` }
type NewVoucherLines ¶
type NewVoucherLines []NewVoucherLine
type PathParams ¶
type RequestCompletionCallback ¶
RequestCompletionCallback defines the type of the request callback function
type ResponseStatus ¶
type SchemaMarshaler ¶
type SchemaMarshaler interface {
MarshalSchema() string
}
type ToURLValues ¶
type Voucher ¶
type Voucher struct { Status string `xml:"Status,attr"` NetvisorKey string `xml:"NetvisorKey"` VoucherDate DateTime `xml:"VoucherDate"` VoucherNumber string `xml:"VoucherNumber"` VoucherDescription string `xml:"VoucherDescription"` VoucherClass string `xml:"VoucherClass"` LinkedSourceNetvisorKey struct { Text string `xml:",chardata"` Type string `xml:"type,attr"` } `xml:"LinkedSourceNetvisorKey"` VoucherNetvisorURI string `xml:"VoucherNetvisorURI"` VoucherLine VoucherLines `xml:"VoucherLine"` }
type VoucherLine ¶
type VoucherLines ¶
type VoucherLines []VoucherLine