mydata

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2022 License: CC0-1.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthHeaderProvider

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

AuthHeaderProvider sends the required headers as part of the required authorization.

func (*AuthHeaderProvider) Intercept

func (s *AuthHeaderProvider) Intercept(_ context.Context, req *http.Request) error

Intercept will attach the required headers to the request and ensures that the user-id and the subscription-key are set correctly.

type BodyProvider

type BodyProvider struct {
	Body *models.InvoicesDoc
}

BodyProvider attaches the request body to the request call.

func (*BodyProvider) Intercept

func (s *BodyProvider) Intercept(_ context.Context, req *http.Request) error

Intercept will attach the required body to the given request.

type Client

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

Client describes the myDATA Client.

func NewClient

func NewClient(config *Config) (*Client, error)

NewClient returns a valid myDATA client or an error if the client cannot be constructed with the given configuration values.

func (Client) CancelDoc

func (c Client) CancelDoc(mark uint64) ([]*models.Response, error)

CancelDoc cancels an issued invoice without issuing a new one. If the operation is successful, the response returns the status and a unique identification number of the processed cancellation. If the api returns an error, or it is not accessible then the method returns an error with descriptive message.

func (Client) RequestDocs

func (c Client) RequestDocs() (*models.RequestedDoc, error)

RequestDocs returns the invoices,cancellations etc., issued by third-party entities and are related to the entity associated to the authenticated user. If the api returns an error, or it is not accessible then the method returns an error with descriptive message.

func (Client) RequestTransmittedDocs

func (c Client) RequestTransmittedDocs() (*models.RequestedDoc, error)

RequestTransmittedDocs returns the invoices,cancellations etc., issued by the entity associated to the authenticated user. If the api returns an error, or it is not accessible then the method returns an error with descriptive message.

func (Client) SendDocs

func (c Client) SendDocs(invoiceDoc *models.InvoicesDoc) ([]*models.Response, error)

SendDocs issues one or more invoices. If the operation is successful, the response returns for each processed invoice, the status, a unique identification number and the unique process number. If the api returns an error, or it is not accessible then the method returns an error with descriptive message.

type Config

type Config struct {
	Host            string
	UserID          string
	SubscriptionKey string
	Timeout         time.Duration
}

Config holds the required and optional configuration for the mydata client.

Jump to

Keyboard shortcuts

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