Documentation
¶
Index ¶
- Constants
- Variables
- func IsUnauthorizedError(err error) bool
- type Authorized
- type Client
- func (c *Client) CancelInvoice(ctx context.Context, req *DocumentRequest) (*DocumentResponse, error)
- func (c *Client) CancelNotice(ctx context.Context, req *DocumentRequest) (*DocumentResponse, error)
- func (c *Client) CancelProforma(ctx context.Context, req *DocumentRequest) (*DocumentResponse, error)
- func (c *Client) Collect(ctx context.Context, req *CollectRequest) (*CollectResponse, error)
- func (c *Client) CreateInvoice(ctx context.Context, req *CreateInvoiceRequest) (*CreateInvoiceResponse, error)
- func (c *Client) CreateNotice(ctx context.Context, req *CreateNoticeRequest) (*CreateNoticeResponse, error)
- func (c *Client) CreateProforma(ctx context.Context, req *CreateProformaRequest) (*CreateProformaResponse, error)
- func (c *Client) DeleteInvoice(ctx context.Context, req *DocumentRequest) (*DocumentResponse, error)
- func (c *Client) DeleteNotice(ctx context.Context, req *DocumentRequest) (*DocumentResponse, error)
- func (c *Client) DeleteProforma(ctx context.Context, req *DocumentRequest) (*DocumentResponse, error)
- func (c *Client) GenerateToken(ctx context.Context) (*GenerateTokenResponse, error)
- func (c *Client) GetClients(ctx context.Context, req *GetClientsRequest) (*GetClientsResponse, error)
- func (c *Client) GetCompanies(ctx context.Context, req *GetCompaniesRequest) (*GetCompaniesResponse, error)
- func (c *Client) GetInvoice(ctx context.Context, req *DocumentRequest) (*DocumentResponse, error)
- func (c *Client) GetInvoices(ctx context.Context, req *GetInvoicesRequest) (*GetInvoicesResponse, error)
- func (c *Client) GetLanguages(ctx context.Context, req *GetLanguagesRequest) (*GetLanguagesResponse, error)
- func (c *Client) GetManagement(ctx context.Context, req *GetManagementRequest) (*GetManagementResponse, error)
- func (c *Client) GetNotice(ctx context.Context, req *DocumentRequest) (*DocumentResponse, error)
- func (c *Client) GetProducts(ctx context.Context, req *GetProductsRequest) (*GetProductsResponse, error)
- func (c *Client) GetProforma(ctx context.Context, req *DocumentRequest) (*DocumentResponse, error)
- func (c *Client) GetSeries(ctx context.Context, req *GetSeriesRequest) (*GetSeriesResponse, error)
- func (c *Client) GetVATRates(ctx context.Context, req *GetVATRatesRequest) (*GetVATRatesResponse, error)
- func (c *Client) RestoreInvoice(ctx context.Context, req *DocumentRequest) (*DocumentResponse, error)
- func (c *Client) RestoreNotice(ctx context.Context, req *DocumentRequest) (*DocumentResponse, error)
- func (c *Client) RestoreProforma(ctx context.Context, req *DocumentRequest) (*DocumentResponse, error)
- type ClientFilter
- type CollectRequest
- type CollectResponse
- type CreateInvoiceRequest
- type CreateInvoiceResponse
- type CreateNoticeRequest
- type CreateNoticeResponse
- type CreateProformaRequest
- type CreateProformaResponse
- type DocumentRequest
- type DocumentResponse
- type ErrorResponse
- type GenerateTokenResponse
- type GetClientsRequest
- type GetClientsResponse
- type GetCompaniesRequest
- type GetCompaniesResponse
- type GetInvoicesRequest
- type GetInvoicesResponse
- type GetLanguagesRequest
- type GetLanguagesResponse
- type GetManagementRequest
- type GetManagementResponse
- type GetProductsRequest
- type GetProductsResponse
- type GetSeriesRequest
- type GetSeriesResponse
- type GetVATRatesRequest
- type GetVATRatesResponse
- type Option
- type OrderBy
- type OrderDir
- type Status
- type TokenStorage
- type Validator
Constants ¶
View Source
const ( AscOrderDir = "ASC" DescOrderDir = "DESC" )
View Source
const ( IDOrderBy = "id" IssueDateOrderBy = "issueDate" NumberOrderBy = "number" )
View Source
const (
BaseURL = "https://www.oblio.eu/api"
)
Variables ¶
View Source
var (
ErrInvalidArgument = errors.New("invalid argument")
)
Functions ¶
func IsUnauthorizedError ¶
Types ¶
type Authorized ¶
type Authorized struct {
AccessToken string `json:"-" url:"-"`
}
func (Authorized) GetAccessToken ¶
func (a Authorized) GetAccessToken() string
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CancelInvoice ¶
func (c *Client) CancelInvoice(ctx context.Context, req *DocumentRequest) (*DocumentResponse, error)
func (*Client) CancelNotice ¶
func (c *Client) CancelNotice(ctx context.Context, req *DocumentRequest) (*DocumentResponse, error)
func (*Client) CancelProforma ¶
func (c *Client) CancelProforma(ctx context.Context, req *DocumentRequest) (*DocumentResponse, error)
func (*Client) Collect ¶
func (c *Client) Collect(ctx context.Context, req *CollectRequest) (*CollectResponse, error)
func (*Client) CreateInvoice ¶
func (c *Client) CreateInvoice(ctx context.Context, req *CreateInvoiceRequest) (*CreateInvoiceResponse, error)
func (*Client) CreateNotice ¶
func (c *Client) CreateNotice(ctx context.Context, req *CreateNoticeRequest) (*CreateNoticeResponse, error)
func (*Client) CreateProforma ¶
func (c *Client) CreateProforma(ctx context.Context, req *CreateProformaRequest) (*CreateProformaResponse, error)
func (*Client) DeleteInvoice ¶
func (c *Client) DeleteInvoice(ctx context.Context, req *DocumentRequest) (*DocumentResponse, error)
func (*Client) DeleteNotice ¶
func (c *Client) DeleteNotice(ctx context.Context, req *DocumentRequest) (*DocumentResponse, error)
func (*Client) DeleteProforma ¶
func (c *Client) DeleteProforma(ctx context.Context, req *DocumentRequest) (*DocumentResponse, error)
func (*Client) GenerateToken ¶
func (c *Client) GenerateToken(ctx context.Context) (*GenerateTokenResponse, error)
func (*Client) GetClients ¶
func (c *Client) GetClients(ctx context.Context, req *GetClientsRequest) (*GetClientsResponse, error)
func (*Client) GetCompanies ¶
func (c *Client) GetCompanies(ctx context.Context, req *GetCompaniesRequest) (*GetCompaniesResponse, error)
func (*Client) GetInvoice ¶
func (c *Client) GetInvoice(ctx context.Context, req *DocumentRequest) (*DocumentResponse, error)
func (*Client) GetInvoices ¶
func (c *Client) GetInvoices(ctx context.Context, req *GetInvoicesRequest) (*GetInvoicesResponse, error)
func (*Client) GetLanguages ¶
func (c *Client) GetLanguages(ctx context.Context, req *GetLanguagesRequest) (*GetLanguagesResponse, error)
func (*Client) GetManagement ¶
func (c *Client) GetManagement(ctx context.Context, req *GetManagementRequest) (*GetManagementResponse, error)
func (*Client) GetNotice ¶
func (c *Client) GetNotice(ctx context.Context, req *DocumentRequest) (*DocumentResponse, error)
func (*Client) GetProducts ¶
func (c *Client) GetProducts(ctx context.Context, req *GetProductsRequest) (*GetProductsResponse, error)
func (*Client) GetProforma ¶
func (c *Client) GetProforma(ctx context.Context, req *DocumentRequest) (*DocumentResponse, error)
func (*Client) GetSeries ¶
func (c *Client) GetSeries(ctx context.Context, req *GetSeriesRequest) (*GetSeriesResponse, error)
func (*Client) GetVATRates ¶
func (c *Client) GetVATRates(ctx context.Context, req *GetVATRatesRequest) (*GetVATRatesResponse, error)
func (*Client) RestoreInvoice ¶
func (c *Client) RestoreInvoice(ctx context.Context, req *DocumentRequest) (*DocumentResponse, error)
func (*Client) RestoreNotice ¶
func (c *Client) RestoreNotice(ctx context.Context, req *DocumentRequest) (*DocumentResponse, error)
func (*Client) RestoreProforma ¶
func (c *Client) RestoreProforma(ctx context.Context, req *DocumentRequest) (*DocumentResponse, error)
type ClientFilter ¶
type CollectRequest ¶
type CollectResponse ¶
type CreateInvoiceRequest ¶
type CreateInvoiceRequest struct {
CIF string `json:"cif,omitempty"`
Client types.Client `json:"client,omitempty"`
IssueDate types.Date `json:"issueDate,omitempty"`
DueDate types.Date `json:"dueDate,omitempty"`
DeliveryDate types.Date `json:"deliveryDate,omitempty"`
CollectDate types.Date `json:"collectDate,omitempty"`
SeriesName string `json:"seriesName,omitempty"`
Language string `json:"language,omitempty"`
Precision types.Int `json:"precision,omitempty"`
Currency string `json:"currency,omitempty"`
ExchangeRate string `json:"exchangeRate,omitempty"`
Products []types.DocumentRow `json:"products,omitempty"`
IssuerName string `json:"issuerName,omitempty"`
IssuerID string `json:"issuerId,omitempty"`
NoticeNumber string `json:"noticeNumber,omitempty"`
InternalNote string `json:"internalNote,omitempty"`
DeputyName string `json:"deputyName,omitempty"`
DeputyIdentityCard string `json:"deputyIdentityCard,omitempty"`
DeputyAuto string `json:"deputyAuto,omitempty"`
SalesAgent string `json:"selesAgent,omitempty"`
Mentions string `json:"mentions,omitempty"`
WorkStation string `json:"workStation,omitempty"`
Collect types.Collect `json:"collect,omitempty"`
ReferenceDocument types.ReferenceDocument `json:"referenceDocument,omitempty"`
SendEmail types.Bool `json:"sendEmail,omitempty"`
UseStock types.Bool `json:"useStock,omitempty"`
}
type CreateInvoiceResponse ¶
type CreateNoticeRequest ¶
type CreateNoticeRequest struct {
CIF string `json:"cif,omitempty"`
Client types.Client `json:"client,omitempty"`
IssueDate types.Date `json:"issueDate,omitempty"`
DueDate types.Date `json:"dueDate,omitempty"`
SeriesName string `json:"seriesName,omitempty"`
Language string `json:"language,omitempty"`
Precision types.Int `json:"precision,omitempty"`
Currency string `json:"currency,omitempty"`
ExchangeRate int `json:"exchangeRate,omitempty"`
Products []types.DocumentRow `json:"products,omitempty"`
IssuerName string `json:"issuerName,omitempty"`
IssuerID int64 `json:"issuerId,omitempty"`
InternalNote string `json:"internalNote,omitempty"`
DeputyName string `json:"deputyName,omitempty"`
DeputyIdentityCard string `json:"deputyIdentityCard,omitempty"`
DeputyAuto string `json:"deputyAuto,omitempty"`
SalesAgent string `json:"selesAgent,omitempty"`
Mentions string `json:"mentions,omitempty"`
WorkStation string `json:"workStation,omitempty"`
SendEmail types.Bool `json:"sendEmail,omitempty"`
UseStock types.Bool `json:"useStock"`
}
type CreateNoticeResponse ¶
type CreateProformaRequest ¶
type CreateProformaRequest struct {
CIF string `json:"cif,omitempty"`
Client types.Client `json:"client,omitempty"`
IssueDate types.Date `json:"issueDate,omitempty"`
DueDate types.Date `json:"dueDate,omitempty"`
SeriesName string `json:"seriesName,omitempty"`
Language string `json:"language,omitempty"`
Precision types.Int `json:"precision,omitempty"`
Currency string `json:"currency,omitempty"`
ExchangeRate int `json:"exchangeRate,omitempty"`
Products []types.DocumentRow `json:"products,omitempty"`
IssuerName string `json:"issuerName,omitempty"`
IssuerID int64 `json:"issuerId,omitempty"`
NoticeNumber string `json:"noticeNumber,omitempty"`
InternalNote string `json:"internalNote,omitempty"`
DeputyName string `json:"deputyName,omitempty"`
DeputyIdentityCard string `json:"deputyIdentityCard,omitempty"`
DeputyAuto string `json:"deputyAuto,omitempty"`
SalesAgent string `json:"selesAgent,omitempty"`
Mentions string `json:"mentions,omitempty"`
WorkStation string `json:"workStation,omitempty"`
SendEmail bool `json:"sendEmail,omitempty"`
}
type CreateProformaResponse ¶
type DocumentRequest ¶
type DocumentResponse ¶
type ErrorResponse ¶
type ErrorResponse struct {
Status int `json:"status,omitempty"`
Message string `json:"statusMessage,omitempty"`
}
func UnmarshalErrorResponse ¶
func UnmarshalErrorResponse(resp *http.Response) *ErrorResponse
func (*ErrorResponse) Error ¶
func (e *ErrorResponse) Error() string
type GenerateTokenResponse ¶
type GetClientsRequest ¶
type GetClientsRequest struct {
Authorized
CIF string `json:"cif,omitempty" url:"cif,omitempty"`
Name string `json:"name,omitempty" url:"name,omitempty"`
ClientCIF string `json:"clientCif,omitempty" url:"clientCif,omitempty"`
Offset int `json:"offset,omitempty" url:"offset,omitempty"`
}
type GetClientsResponse ¶
type GetCompaniesRequest ¶
type GetCompaniesRequest struct {
Authorized
}
type GetCompaniesResponse ¶
type GetInvoicesRequest ¶
type GetInvoicesRequest struct {
CIF string `json:"cif,omitempty" url:"cif,omitempty"`
SeriesName string `json:"seriesName,omitempty" url:"seriesName,omitempty"`
Number string `json:"number,omitempty" url:"number,omitempty"`
Draft types.Bool `json:"draft,omitempty" url:"draft,omitempty"`
Client ClientFilter `json:"client,omitempty" url:"client,omitempty"`
Canceled types.Bool `json:"canceled,omitempty" url:"canceled,omitempty"`
IssuedAfter types.Date `json:"issuedAfter" url:"issuedAfter,omitempty"`
IssuedBefore types.Date `json:"issuedBefore" url:"issuedBefore,omitempty"`
WithProducts types.Bool `json:"withProducts,omitempty" url:"withProducts,omitempty"`
WithEInvoiceStatus types.Bool `json:"withEInvoiceStatus,omitempty" url:"withEInvoiceStatus,omitempty"`
OrderBy OrderBy `json:"orderBy,omitempty" url:"orderBy,omitempty"`
OrderDir OrderDir `json:"orderDir,omitempty" url:"orderDir,omitempty"`
LimitPerPage int `json:"limitPerPage,omitempty" url:"limitPerPage,omitempty"`
Offset int `json:"offset,omitempty" url:"offset,omitempty"`
}
type GetInvoicesResponse ¶
type GetLanguagesRequest ¶
type GetLanguagesRequest struct {
Authorized
CIF string `json:"cif,omitempty" url:"cif,omitempty"`
}
type GetLanguagesResponse ¶
type GetManagementRequest ¶
type GetManagementRequest struct {
Authorized
CIF string `json:"cif,omitempty" url:"cif,omitempty"`
}
type GetManagementResponse ¶
type GetManagementResponse struct {
Status
Data []types.Management `json:"data"`
}
type GetProductsRequest ¶
type GetProductsRequest struct {
Authorized
CIF string `json:"cif,omitempty" url:"cif,omitempty"`
Name string `json:"name,omitempty" url:"name,omitempty"`
Code string `json:"code,omitempty" url:"code,omitempty"`
Management string `json:"management,omitempty" url:"management,omitempty"`
WorkStation string `json:"workStation,omitempty" url:"workStation,omitempty"`
Offset int `json:"offset,omitempty" url:"offset,omitempty"`
}
type GetProductsResponse ¶
type GetSeriesRequest ¶
type GetSeriesRequest struct {
Authorized
CIF string `json:"cif,omitempty" url:"cif,omitempty"`
}
type GetSeriesResponse ¶
type GetVATRatesRequest ¶
type GetVATRatesRequest struct {
Authorized
CIF string `json:"cif,omitempty" url:"cif,omitempty"`
}
type GetVATRatesResponse ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func WithBaseURL ¶
func WithClient ¶
func WithTokenStorage ¶
func WithTokenStorage(tokenStorage TokenStorage) Option
type TokenStorage ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.