Documentation ¶
Index ¶
- Constants
- Variables
- func ParseXMLResponse[T any](r *http.Response) (*T, error)
- func Requester[P ToMap, T any](c *Client, params P, urlPath string) (int, *T, error)
- type Client
- func (c *Client) CancelInvoice(params mydataInvoices.CancelInvoiceParams) (int, *mydataInvoices.ResponseDoc, error)
- func (c *Client) RequestDocWithMark(mark uint) (int, *mydataInvoices.RequestedDoc, error)
- func (c *Client) RequestDocs(params mydataInvoices.RequestDocsParams) (int, *mydataInvoices.RequestedDoc, error)
- func (c *Client) RequestDocsPastDays(days int) (int, *mydataInvoices.RequestedDoc, error)
- func (c *Client) RequestMyExpenses(params mydataInvoices.RequestMyExpensesParams) (int, *mydataInvoices.RequestedBookInfo, error)
- func (c *Client) RequestMyExpensesLastDays(days int) (int, *mydataInvoices.RequestedBookInfo, error)
- func (c *Client) RequestMyIncome(params mydataInvoices.RequestMyIncomeParams) (int, *mydataInvoices.RequestedBookInfo, error)
- func (c *Client) RequestMyIncomeLastDays(days int) (int, *mydataInvoices.RequestedBookInfo, error)
- func (c *Client) RequestTransmittedDocBetweenMarks(lowMark, highMark uint) (int, *mydataInvoices.RequestedDoc, error)
- func (c *Client) RequestTransmittedDocWithMark(mark uint) (int, *mydataInvoices.RequestedDoc, error)
- func (c *Client) RequestTransmittedDocs(params mydataInvoices.RequestDocsParams) (int, *mydataInvoices.RequestedDoc, error)
- func (c *Client) RequestTransmittedDocsPastDays(days int) (int, *mydataInvoices.RequestedDoc, error)
- func (c *Client) RequestVatInfo(params mydataInvoices.RequestVatInfoParams) (int, *mydataInvoices.RequestedVatInfoType, error)
- func (c *Client) SendExpensesClassification(changes *mydataInvoices.ExpensesClassificationsDoc, postMethodPerInvoice bool) (int, *mydataInvoices.ResponseDoc, error)
- func (c *Client) SendIncomeClassification(changes *mydataInvoices.IncomeClassificationsDoc) (int, *mydataInvoices.ResponseDoc, error)
- func (c *Client) SendInvoices(invoices *mydataInvoices.InvoicesDoc) (int, *mydataInvoices.ResponseDoc, error)
- func (c *Client) SendPaymentsMethod(paymentMethods *mydataInvoices.PaymentMethodsDoc) (int, *mydataInvoices.ResponseDoc, error)
- func (c *Client) SetOnInvalidAction(action OnInvalidAction)
- type ConnectionClient
- type Error
- type IteratorParams
- type OnInvalidAction
- type RequestIterator
- func NewDocsIterator(c *Client, params mydataInvoices.RequestDocsParams) ...
- func NewExpensesIterator(c *Client, params mydataInvoices.RequestMyExpensesParams) ...
- func NewIncomeIterator(c *Client, params mydataInvoices.RequestMyIncomeParams) ...
- func NewRequestIterator[P IteratorParams, R WithNextDataGetter](c *Client, params P, arg R, urlPath string) RequestIterator[P, R]
- func NewTransmittedDocsIterator(c *Client, params mydataInvoices.RequestDocsParams) ...
- func NewVatInfoIterator(c *Client, params mydataInvoices.RequestVatInfoParams) ...
- type RequestIteratorFunc
- type SendInvoiceParams
- type ToMap
- type WithNextDataGetter
- type WithNextDataSetter
Constants ¶
const ( URLSendInvoices = "/SendInvoices" URLRequestMyIncome = "/RequestMyIncome" URLRequestMyExpenses = "/RequestMyExpenses" URLRequestDocs = "/RequestDocs" URLRequestTransmittedDocs = "/RequestTransmittedDocs" URLRequestVatInfo = "/RequestVatInfo" URLSendIncomeClassification = "/SendIncomeClassification" URLSendExpensesClassification = "/SendExpensesClassification" URLCancelInvoice = "/CancelInvoice" URLSendPaymentsMethod = "/SendPaymentsMethod" InternalErrorCode = -500 )
Variables ¶
var ( ErrorRequestCreation = Error("error creating request") ErrorGettingResponse = Error("error getting response") ErrorXMLMarshal = Error("error marshaling xml") ErrorXMLParsingResponse = Error("error parsing xml response") ErrorQueryURLCreation = Error("error creating query url") ErrorInvalidInvoices = Error("invalid invoices") ErrorRequestSendIncomeClassification = Error("error sending income classification") )
Functions ¶
func ParseXMLResponse ¶
ParseXMLResponse parses the response body as xml and returns the result
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CancelInvoice ¶
func (c *Client) CancelInvoice(params mydataInvoices.CancelInvoiceParams) (int, *mydataInvoices.ResponseDoc, error)
func (*Client) RequestDocWithMark ¶
func (c *Client) RequestDocWithMark(mark uint) (int, *mydataInvoices.RequestedDoc, error)
RequestDocWithMark gets the invoices from myDATA with a specific mark
func (*Client) RequestDocs ¶
func (c *Client) RequestDocs(params mydataInvoices.RequestDocsParams) (int, *mydataInvoices.RequestedDoc, error)
RequestDocs gets the requested documents, that others have submitted from myDATA we get back the response status code and the requested documents
func (*Client) RequestDocsPastDays ¶
func (c *Client) RequestDocsPastDays(days int) (int, *mydataInvoices.RequestedDoc, error)
RequestDocsPastDays gets the invoices from myDATA for the past days
func (*Client) RequestMyExpenses ¶
func (c *Client) RequestMyExpenses(params mydataInvoices.RequestMyExpensesParams) (int, *mydataInvoices.RequestedBookInfo, error)
RequestMyExpenses requests the invoices that have expense characterization for the user for the given period
func (*Client) RequestMyExpensesLastDays ¶
func (c *Client) RequestMyExpensesLastDays(days int) (int, *mydataInvoices.RequestedBookInfo, error)
RequestMyExpensesLastDays requests the invoices that have expense characterization for the user for the last days
func (*Client) RequestMyIncome ¶
func (c *Client) RequestMyIncome(params mydataInvoices.RequestMyIncomeParams) (int, *mydataInvoices.RequestedBookInfo, error)
RequestMyIncome requests the invoices that have income characterization for the user for the given period
func (*Client) RequestMyIncomeLastDays ¶
func (c *Client) RequestMyIncomeLastDays(days int) (int, *mydataInvoices.RequestedBookInfo, error)
RequestMyIncomeLastDays requests the invoices that have income characterization for the user for the last days
func (*Client) RequestTransmittedDocBetweenMarks ¶
func (c *Client) RequestTransmittedDocBetweenMarks(lowMark, highMark uint) (int, *mydataInvoices.RequestedDoc, error)
RequestTransmittedDocBetweenMarks gets the invoices from myDATA between marks
func (*Client) RequestTransmittedDocWithMark ¶
func (c *Client) RequestTransmittedDocWithMark(mark uint) (int, *mydataInvoices.RequestedDoc, error)
RequestTransmittedDocWithMark gets the invoices from myDATA with a specific mark
func (*Client) RequestTransmittedDocs ¶
func (c *Client) RequestTransmittedDocs(params mydataInvoices.RequestDocsParams) (int, *mydataInvoices.RequestedDoc, error)
RequestTransmittedDocs gets the invoices from myDATA that the user has submitted.
func (*Client) RequestTransmittedDocsPastDays ¶
func (c *Client) RequestTransmittedDocsPastDays(days int) (int, *mydataInvoices.RequestedDoc, error)
RequestTransmittedDocsPastDays gets the invoices from myDATA for the past days
func (*Client) RequestVatInfo ¶
func (c *Client) RequestVatInfo(params mydataInvoices.RequestVatInfoParams) (int, *mydataInvoices.RequestedVatInfoType, error)
func (*Client) SendExpensesClassification ¶
func (c *Client) SendExpensesClassification(changes *mydataInvoices.ExpensesClassificationsDoc, postMethodPerInvoice bool) (int, *mydataInvoices.ResponseDoc, error)
SendExpensesClassification sends the expense classification of invoices submitted to AADE. If postMethod is false, then we change invoice classification per line number. If postMethod is true, then we change invoice classification per invoice mark. One for E3 and one for VAT.
func (*Client) SendIncomeClassification ¶
func (c *Client) SendIncomeClassification(changes *mydataInvoices.IncomeClassificationsDoc) (int, *mydataInvoices.ResponseDoc, error)
SendIncomeClassification sends the income classification of invoices already submitted to AADE
func (*Client) SendInvoices ¶
func (c *Client) SendInvoices(invoices *mydataInvoices.InvoicesDoc) (int, *mydataInvoices.ResponseDoc, error)
SendInvoices sends the given invoices to the myDATA API
func (*Client) SendPaymentsMethod ¶
func (c *Client) SendPaymentsMethod(paymentMethods *mydataInvoices.PaymentMethodsDoc) (int, *mydataInvoices.ResponseDoc, error)
func (*Client) SetOnInvalidAction ¶
func (c *Client) SetOnInvalidAction(action OnInvalidAction)
SetOnInvalidAction sets the action to take when an invalid invoice is encountered
type ConnectionClient ¶
type ConnectionClient interface { SetOnInvalidAction(action OnInvalidAction) SendInvoices(invoices *mydataInvoices.InvoicesDoc) (int, *mydataInvoices.ResponseDoc, error) SendPaymentsMethod(paymentMethods *mydataInvoices.PaymentMethodsDoc) (int, *mydataInvoices.ResponseDoc, error) RequestDocs(params mydataInvoices.RequestDocsParams) (int, *mydataInvoices.RequestedDoc, error) RequestDocsPastDays(days int) (int, *mydataInvoices.RequestedDoc, error) RequestDocWithMark(mark uint) (int, *mydataInvoices.RequestedDoc, error) RequestMyIncome(params mydataInvoices.RequestMyIncomeParams) (int, *mydataInvoices.RequestedBookInfo, error) RequestMyExpenses(params mydataInvoices.RequestMyExpensesParams) (int, *mydataInvoices.RequestedBookInfo, error) RequestMyIncomeLastDays(days int) (int, *mydataInvoices.RequestedBookInfo, error) RequestMyExpensesLastDays(days int) (int, *mydataInvoices.RequestedBookInfo, error) RequestTransmittedDocs(params mydataInvoices.RequestDocsParams) (int, *mydataInvoices.RequestedDoc, error) RequestTransmittedDocsPastDays(days int) (int, *mydataInvoices.RequestedDoc, error) RequestTransmittedDocWithMark(mark uint) (int, *mydataInvoices.RequestedDoc, error) RequestTransmittedDocBetweenMarks(lowMark, higMark uint) (int, *mydataInvoices.RequestedDoc, error) SendIncomeClassification(changes *mydataInvoices.IncomeClassificationsDoc) (int, *mydataInvoices.ResponseDoc, error) SendExpensesClassification(changes *mydataInvoices.ExpensesClassificationsDoc, postMethodPerInvoice bool) (int, *mydataInvoices.ResponseDoc, error) CancelInvoice(params mydataInvoices.CancelInvoiceParams) (int, *mydataInvoices.ResponseDoc, error) }
type IteratorParams ¶
type IteratorParams interface { WithNextDataSetter ToMap }
type OnInvalidAction ¶
type OnInvalidAction int
const ( ErrorOnInvalid OnInvalidAction = iota PassThroughOnInvalid FilterOnInvalid )
type RequestIterator ¶
type RequestIterator[P IteratorParams, R WithNextDataGetter] struct { // contains filtered or unexported fields }
func NewDocsIterator ¶
func NewDocsIterator(c *Client, params mydataInvoices.RequestDocsParams) RequestIterator[*mydataInvoices.RequestDocsParams, *mydataInvoices.RequestedDoc]
func NewExpensesIterator ¶
func NewExpensesIterator(c *Client, params mydataInvoices.RequestMyExpensesParams) RequestIterator[*mydataInvoices.RequestMyExpensesParams, *mydataInvoices.RequestedBookInfo]
func NewIncomeIterator ¶
func NewIncomeIterator(c *Client, params mydataInvoices.RequestMyIncomeParams) RequestIterator[*mydataInvoices.RequestMyIncomeParams, *mydataInvoices.RequestedBookInfo]
func NewRequestIterator ¶
func NewRequestIterator[P IteratorParams, R WithNextDataGetter](c *Client, params P, arg R, urlPath string) RequestIterator[P, R]
func NewTransmittedDocsIterator ¶
func NewTransmittedDocsIterator(c *Client, params mydataInvoices.RequestDocsParams) RequestIterator[*mydataInvoices.RequestDocsParams, *mydataInvoices.RequestedDoc]
func NewVatInfoIterator ¶
func NewVatInfoIterator(c *Client, params mydataInvoices.RequestVatInfoParams) RequestIterator[*mydataInvoices.RequestVatInfoParams, *mydataInvoices.RequestedVatInfoType]
func (RequestIterator[P, R]) Iterate ¶
func (ri RequestIterator[P, R]) Iterate() func(func(int, R) bool)
func (RequestIterator[P, R]) Pull ¶
func (ri RequestIterator[P, R]) Pull() (func() (int, R, bool), func())
type RequestIteratorFunc ¶
type RequestIteratorFunc func(WithNextDataSetter) (int, WithNextDataGetter, error)
type for a function that takes a WithNextDataSetter and returns a WithNextDataGetter
type SendInvoiceParams ¶
type SendInvoiceParams struct {
AadeUserID string `json:"aade-user-id"`
}
type WithNextDataGetter ¶
type WithNextDataSetter ¶
type WithNextDataSetter interface {
SetNextPartitionData(partitionKey, rowKey string)
}