datev_api

package module
v0.0.0-...-173be24 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BaseURL   = "https://{{.service}}.api.datev.de/platform/"
	RevokeURL = "https://api.datev.de/revoke"
)

Functions

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.

func CreateFormFile

func CreateFormFile(w *multipart.Writer, data io.Reader, fieldname, filename string) (io.Writer, error)

func GetFileContentType

func GetFileContentType(file io.Reader) (string, error)

Types

type AccountingDocumentTypesGetRequest

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

func (*AccountingDocumentTypesGetRequest) Do

func (*AccountingDocumentTypesGetRequest) Method

func (AccountingDocumentTypesGetRequest) NewPathParams

func (AccountingDocumentTypesGetRequest) NewQueryParams

func (AccountingDocumentTypesGetRequest) NewRequestBody

func (*AccountingDocumentTypesGetRequest) NewResponseBody

func (*AccountingDocumentTypesGetRequest) PathParams

func (*AccountingDocumentTypesGetRequest) PathParamsInterface

func (r *AccountingDocumentTypesGetRequest) PathParamsInterface() PathParams

func (*AccountingDocumentTypesGetRequest) QueryParams

func (*AccountingDocumentTypesGetRequest) RequestBody

func (*AccountingDocumentTypesGetRequest) RequestBodyInterface

func (r *AccountingDocumentTypesGetRequest) RequestBodyInterface() interface{}

func (*AccountingDocumentTypesGetRequest) SetMethod

func (r *AccountingDocumentTypesGetRequest) SetMethod(method string)

func (*AccountingDocumentTypesGetRequest) SetRequestBody

func (*AccountingDocumentTypesGetRequest) URL

type AccountingDocumentTypesGetRequestBody

type AccountingDocumentTypesGetRequestBody struct {
}

type AccountingDocumentTypesGetRequestPathParams

type AccountingDocumentTypesGetRequestPathParams struct{}

func (*AccountingDocumentTypesGetRequestPathParams) Params

type AccountingDocumentTypesGetRequestQueryParams

type AccountingDocumentTypesGetRequestQueryParams struct{}

func (AccountingDocumentTypesGetRequestQueryParams) ToURLValues

type AccountingDocumentTypesGetResponseBody

type AccountingDocumentTypesGetResponseBody DocumentTypes

type AccountingDocumentsPutRequest

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

func (*AccountingDocumentsPutRequest) Do

func (*AccountingDocumentsPutRequest) FormParams

func (*AccountingDocumentsPutRequest) FormParamsInterface

func (r *AccountingDocumentsPutRequest) FormParamsInterface() Form

func (*AccountingDocumentsPutRequest) Method

func (AccountingDocumentsPutRequest) NewFormParams

func (AccountingDocumentsPutRequest) NewPathParams

func (AccountingDocumentsPutRequest) NewQueryParams

func (AccountingDocumentsPutRequest) NewRequestBody

func (*AccountingDocumentsPutRequest) NewResponseBody

func (*AccountingDocumentsPutRequest) PathParams

func (*AccountingDocumentsPutRequest) PathParamsInterface

func (r *AccountingDocumentsPutRequest) PathParamsInterface() PathParams

func (*AccountingDocumentsPutRequest) QueryParams

func (*AccountingDocumentsPutRequest) RequestBody

func (*AccountingDocumentsPutRequest) RequestBodyInterface

func (r *AccountingDocumentsPutRequest) RequestBodyInterface() interface{}

func (*AccountingDocumentsPutRequest) SetMethod

func (r *AccountingDocumentsPutRequest) SetMethod(method string)

func (*AccountingDocumentsPutRequest) SetRequestBody

func (*AccountingDocumentsPutRequest) URL

type AccountingDocumentsPutRequestBody

type AccountingDocumentsPutRequestBody struct {
}

type AccountingDocumentsPutRequestFormParams

type AccountingDocumentsPutRequestFormParams struct {
	Metadata FileMetaData
	File     FormFile
}

func (AccountingDocumentsPutRequestFormParams) Files

func (AccountingDocumentsPutRequestFormParams) IsMultiPart

func (AccountingDocumentsPutRequestFormParams) Values

type AccountingDocumentsPutRequestPathParams

type AccountingDocumentsPutRequestPathParams struct {
	GUID string
}

func (*AccountingDocumentsPutRequestPathParams) Params

type AccountingDocumentsPutRequestQueryParams

type AccountingDocumentsPutRequestQueryParams struct{}

func (AccountingDocumentsPutRequestQueryParams) ToURLValues

type AccountingDocumentsPutResponseBody

type AccountingDocumentsPutResponseBody struct {
	ID    string `json:"id"`
	Files []struct {
		ID         string    `json:"id"`
		Name       string    `json:"name"`
		Size       string    `json:"size"`
		MediaType  string    `json:"media_type"`
		UploadDate time.Time `json:"upload_date"`
	} `json:"files"`
}

type AccountingExtfFilesUploadRequest

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

func (*AccountingExtfFilesUploadRequest) Do

func (*AccountingExtfFilesUploadRequest) FormParams

func (*AccountingExtfFilesUploadRequest) Method

func (AccountingExtfFilesUploadRequest) NewFormParams

func (AccountingExtfFilesUploadRequest) NewPathParams

func (AccountingExtfFilesUploadRequest) NewQueryParams

func (AccountingExtfFilesUploadRequest) NewRequestBody

func (*AccountingExtfFilesUploadRequest) NewResponseBody

func (*AccountingExtfFilesUploadRequest) PathParams

func (*AccountingExtfFilesUploadRequest) PathParamsInterface

func (r *AccountingExtfFilesUploadRequest) PathParamsInterface() PathParams

func (*AccountingExtfFilesUploadRequest) QueryParams

func (*AccountingExtfFilesUploadRequest) RequestBody

func (*AccountingExtfFilesUploadRequest) RequestBodyInterface

func (r *AccountingExtfFilesUploadRequest) RequestBodyInterface() interface{}

func (*AccountingExtfFilesUploadRequest) SetMethod

func (r *AccountingExtfFilesUploadRequest) SetMethod(method string)

func (*AccountingExtfFilesUploadRequest) SetRequestBody

func (*AccountingExtfFilesUploadRequest) URL

type AccountingExtfFilesUploadRequestBody

type AccountingExtfFilesUploadRequestBody struct {
}

type AccountingExtfFilesUploadRequestFormParams

type AccountingExtfFilesUploadRequestFormParams struct {
	ExtfFile FormFile
}

func (AccountingExtfFilesUploadRequestFormParams) Files

func (AccountingExtfFilesUploadRequestFormParams) Values

type AccountingExtfFilesUploadRequestPathParams

type AccountingExtfFilesUploadRequestPathParams struct {
	Service string
}

func (*AccountingExtfFilesUploadRequestPathParams) Params

type AccountingExtfFilesUploadRequestQueryParams

type AccountingExtfFilesUploadRequestQueryParams struct{}

func (AccountingExtfFilesUploadRequestQueryParams) ToURLValues

type AccountingExtfFilesUploadResponseBody

type AccountingExtfFilesUploadResponseBody struct {
	Location   string
	GUID       string
	RetryAfter int
}

type AccountingExtfJobStatusRequest

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

func (*AccountingExtfJobStatusRequest) Do

func (*AccountingExtfJobStatusRequest) Method

func (AccountingExtfJobStatusRequest) NewPathParams

func (AccountingExtfJobStatusRequest) NewQueryParams

func (AccountingExtfJobStatusRequest) NewRequestBody

func (*AccountingExtfJobStatusRequest) NewResponseBody

func (*AccountingExtfJobStatusRequest) PathParams

func (*AccountingExtfJobStatusRequest) PathParamsInterface

func (r *AccountingExtfJobStatusRequest) PathParamsInterface() PathParams

func (*AccountingExtfJobStatusRequest) QueryParams

func (*AccountingExtfJobStatusRequest) RequestBody

func (*AccountingExtfJobStatusRequest) RequestBodyInterface

func (r *AccountingExtfJobStatusRequest) RequestBodyInterface() interface{}

func (*AccountingExtfJobStatusRequest) SetMethod

func (r *AccountingExtfJobStatusRequest) SetMethod(method string)

func (*AccountingExtfJobStatusRequest) SetRequestBody

func (*AccountingExtfJobStatusRequest) URL

type AccountingExtfJobStatusRequestBody

type AccountingExtfJobStatusRequestBody struct {
}

type AccountingExtfJobStatusRequestPathParams

type AccountingExtfJobStatusRequestPathParams struct {
	GUID string
}

func (*AccountingExtfJobStatusRequestPathParams) Params

type AccountingExtfJobStatusRequestQueryParams

type AccountingExtfJobStatusRequestQueryParams struct{}

func (AccountingExtfJobStatusRequestQueryParams) ToURLValues

type AccountingExtfJobStatusResponseBody

type AccountingExtfJobStatusResponseBody Job

type AccountingExtfJobsRequest

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

func (*AccountingExtfJobsRequest) Do

func (*AccountingExtfJobsRequest) Method

func (r *AccountingExtfJobsRequest) Method() string

func (AccountingExtfJobsRequest) NewPathParams

func (AccountingExtfJobsRequest) NewQueryParams

func (AccountingExtfJobsRequest) NewRequestBody

func (*AccountingExtfJobsRequest) NewResponseBody

func (*AccountingExtfJobsRequest) PathParams

func (*AccountingExtfJobsRequest) PathParamsInterface

func (r *AccountingExtfJobsRequest) PathParamsInterface() PathParams

func (*AccountingExtfJobsRequest) QueryParams

func (*AccountingExtfJobsRequest) RequestBody

func (*AccountingExtfJobsRequest) RequestBodyInterface

func (r *AccountingExtfJobsRequest) RequestBodyInterface() interface{}

func (*AccountingExtfJobsRequest) SetMethod

func (r *AccountingExtfJobsRequest) SetMethod(method string)

func (*AccountingExtfJobsRequest) SetRequestBody

func (*AccountingExtfJobsRequest) URL

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

type AccountingExtfJobsRequestBody

type AccountingExtfJobsRequestBody struct {
}

type AccountingExtfJobsRequestPathParams

type AccountingExtfJobsRequestPathParams struct {
}

func (*AccountingExtfJobsRequestPathParams) Params

type AccountingExtfJobsRequestQueryParams

type AccountingExtfJobsRequestQueryParams struct{}

func (AccountingExtfJobsRequestQueryParams) ToURLValues

type AccountingExtfJobsResponseBody

type AccountingExtfJobsResponseBody Jobs

type BeforeRequestDoCallback

type BeforeRequestDoCallback func(*http.Client, *http.Request, interface{})

type Client

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

Client manages communication with Exact Globe Client

func NewClient

func NewClient(httpClient *http.Client) *Client

NewClient returns a new Exact Globe Client client

func (Client) BaseURL

func (c Client) BaseURL() string

func (Client) Charset

func (c Client) Charset() string

func (Client) ClientID

func (c Client) ClientID() string

func (Client) ClientSecret

func (c Client) ClientSecret() string

func (Client) DatevClientID

func (c Client) DatevClientID() string

func (Client) Debug

func (c Client) Debug() bool

func (*Client) Do

func (c *Client) Do(req *http.Request, body 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(p string, pathParams PathParams) url.URL

func (*Client) HTTPClient

func (c *Client) HTTPClient() *http.Client

func (Client) MediaType

func (c Client) MediaType() string

func (*Client) NewAccountingDocumentTypesGetRequest

func (c *Client) NewAccountingDocumentTypesGetRequest() AccountingDocumentTypesGetRequest

func (*Client) NewAccountingDocumentsPutRequest

func (c *Client) NewAccountingDocumentsPutRequest() AccountingDocumentsPutRequest

func (*Client) NewAccountingExtfFilesUploadRequest

func (c *Client) NewAccountingExtfFilesUploadRequest() AccountingExtfFilesUploadRequest

func (*Client) NewAccountingExtfJobStatusRequest

func (c *Client) NewAccountingExtfJobStatusRequest() AccountingExtfJobStatusRequest

func (*Client) NewAccountingExtfJobsRequest

func (c *Client) NewAccountingExtfJobsRequest() AccountingExtfJobsRequest

func (*Client) NewClientsGetRequest

func (c *Client) NewClientsGetRequest() ClientsGetRequest

func (*Client) NewRequest

func (c *Client) NewRequest(ctx context.Context, req Request) (*http.Request, error)

func (*Client) NewTokenRevocationRequest

func (c *Client) NewTokenRevocationRequest() TokenRevocationRequest

func (Client) Oauth

func (c Client) Oauth() *Oauth2Config

func (Client) RevokeURL

func (c Client) RevokeURL() string

func (*Client) SetBaseURL

func (c *Client) SetBaseURL(baseURL string)

func (*Client) SetBeforeRequestDo

func (c *Client) SetBeforeRequestDo(fun BeforeRequestDoCallback)

func (*Client) SetCharset

func (c *Client) SetCharset(charset string)

func (*Client) SetClientID

func (c *Client) SetClientID(clientID string)

func (*Client) SetClientSecret

func (c *Client) SetClientSecret(clientSecret string)

func (*Client) SetDatevClientID

func (c *Client) SetDatevClientID(datevClientID string)

func (*Client) SetDebug

func (c *Client) SetDebug(debug bool)

func (*Client) SetDisallowUnknownFields

func (c *Client) SetDisallowUnknownFields(disallowUnknownFields bool)

func (*Client) SetHTTPClient

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

func (*Client) SetMediaType

func (c *Client) SetMediaType(mediaType string)

func (*Client) SetOauth

func (c *Client) SetOauth(oauth *Oauth2Config)

func (*Client) SetRevokeURL

func (c *Client) SetRevokeURL(revokeURL 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 ClientsGetRequest

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

func (*ClientsGetRequest) Do

func (*ClientsGetRequest) Method

func (r *ClientsGetRequest) Method() string

func (ClientsGetRequest) NewPathParams

func (ClientsGetRequest) NewQueryParams

func (r ClientsGetRequest) NewQueryParams() *ClientsGetRequestQueryParams

func (ClientsGetRequest) NewRequestBody

func (r ClientsGetRequest) NewRequestBody() ClientsGetRequestBody

func (*ClientsGetRequest) NewResponseBody

func (r *ClientsGetRequest) NewResponseBody() *ClientsGetResponseBody

func (*ClientsGetRequest) PathParams

func (*ClientsGetRequest) PathParamsInterface

func (r *ClientsGetRequest) PathParamsInterface() PathParams

func (*ClientsGetRequest) QueryParams

func (*ClientsGetRequest) RequestBody

func (r *ClientsGetRequest) RequestBody() *ClientsGetRequestBody

func (*ClientsGetRequest) RequestBodyInterface

func (r *ClientsGetRequest) RequestBodyInterface() interface{}

func (*ClientsGetRequest) SetMethod

func (r *ClientsGetRequest) SetMethod(method string)

func (*ClientsGetRequest) SetRequestBody

func (r *ClientsGetRequest) SetRequestBody(body ClientsGetRequestBody)

func (*ClientsGetRequest) URL

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

type ClientsGetRequestBody

type ClientsGetRequestBody struct {
}

type ClientsGetRequestPathParams

type ClientsGetRequestPathParams struct{}

func (*ClientsGetRequestPathParams) Params

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

type ClientsGetRequestQueryParams

type ClientsGetRequestQueryParams struct{}

func (ClientsGetRequestQueryParams) ToURLValues

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

type ClientsGetResponseBody

type ClientsGetResponseBody DocumentTypes

type Date

type Date struct {
	time.Time
}

func (Date) IsEmpty

func (d Date) IsEmpty() bool

func (*Date) MarshalJSON

func (d *Date) MarshalJSON() ([]byte, error)

func (Date) MarshalSchema

func (d Date) MarshalSchema() string

func (*Date) UnmarshalJSON

func (d *Date) UnmarshalJSON(text []byte) (err error)

type DocumentType

type DocumentType struct {
	Name                  string `json:"name"`
	Category              string `json:"category"`
	DebitCreditIdentifier string `json:"debitCreditIdentifier,omitempty"`
}

type DocumentTypes

type DocumentTypes []DocumentType

type ErrorResponse

type ErrorResponse struct {
	// HTTP response that caused this error
	Response *http.Response

	Title           string `json:"title"`
	RequestID       string `json:"request_id"`
	HTTPCode        string `json:"httpCode"`
	HTTPMessage     string `json:"httpMessage"`
	MoreInformation string `json:"moreInformation"`
	Status          string `json:"status"`
	Detail          string `json:"detail"`
}

func (*ErrorResponse) Error

func (r *ErrorResponse) Error() string

type FileMetaData

type FileMetaData struct {
	Category string `json:"category"`
	Folder   string `json:"folder"`
	Register string `json:"register"`
}

type Form

type Form interface {
	IsMultiPart() bool
	Values() url.Values
	Files() map[string]FormFile
}

type FormFile

type FormFile struct {
	Filename string
	Content  io.Reader
}

type Job

type Job struct {
	ID                           string    `json:"id"`
	Filename                     string    `json:"filename"`
	FiscalYearBegin              Date      `json:"fiscal_year_begin"`
	ClientApplicationDisplayName string    `json:"client_application_display_name"`
	ClientApplicationVendor      string    `json:"client_application_vendor"`
	DataCategoryID               int       `json:"data_category_id"`
	DateFrom                     Date      `json:"date_from"`
	DateTo                       Date      `json:"date_to"`
	Label                        string    `json:"label"`
	NumberOfAccountingRecords    int       `json:"number_of_accounting_records"`
	Result                       string    `json:"result"`
	Timestamp                    time.Time `json:"timestamp"`
	ValidationDetails            struct {
		Type             string `json:"type"`
		Title            string `json:"title"`
		Detail           string `json:"detail"`
		AffectedElements []struct {
			Name   string `json:"name"`
			Reason string `json:"reason"`
		} `json:"affected_elements"`
	} `json:"validation_details"`
}

type Jobs

type Jobs []Job

type Oauth2Config

type Oauth2Config struct {
	oauth2.Config
}

func NewOauth2Config

func NewOauth2Config() *Oauth2Config

type PathParams

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

type QueryParams

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

type Request

type Request interface {
	Method() string
	// QueryParams() QueryParams
	PathParamsInterface() PathParams
	RequestBodyInterface() interface{}
	URL() *url.URL
}

type RequestCompletionCallback

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

RequestCompletionCallback defines the type of the request callback function

type TokenRevocationRequest

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

func (*TokenRevocationRequest) Do

func (*TokenRevocationRequest) FormParams

func (*TokenRevocationRequest) FormParamsInterface

func (r *TokenRevocationRequest) FormParamsInterface() Form

func (*TokenRevocationRequest) Method

func (r *TokenRevocationRequest) Method() string

func (TokenRevocationRequest) NewFormParams

func (TokenRevocationRequest) NewPathParams

func (TokenRevocationRequest) NewQueryParams

func (TokenRevocationRequest) NewRequestBody

func (*TokenRevocationRequest) NewResponseBody

func (*TokenRevocationRequest) PathParams

func (*TokenRevocationRequest) PathParamsInterface

func (r *TokenRevocationRequest) PathParamsInterface() PathParams

func (*TokenRevocationRequest) QueryParams

func (*TokenRevocationRequest) RequestBody

func (*TokenRevocationRequest) RequestBodyInterface

func (r *TokenRevocationRequest) RequestBodyInterface() interface{}

func (*TokenRevocationRequest) SetMethod

func (r *TokenRevocationRequest) SetMethod(method string)

func (*TokenRevocationRequest) SetRequestBody

func (r *TokenRevocationRequest) SetRequestBody(body TokenRevocationRequestBody)

func (*TokenRevocationRequest) URL

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

type TokenRevocationRequestBody

type TokenRevocationRequestBody struct {
	Token         string `json:"token"`
	TokenTypeHint string `json:"token_type_hint,omitempty"`
}

type TokenRevocationRequestFormparams

type TokenRevocationRequestFormparams struct {
	Token         string
	TokenTypeHint string
}

func (TokenRevocationRequestFormparams) Files

func (TokenRevocationRequestFormparams) IsMultiPart

func (p TokenRevocationRequestFormparams) IsMultiPart() bool

func (TokenRevocationRequestFormparams) Values

type TokenRevocationRequestPathParams

type TokenRevocationRequestPathParams struct{}

func (*TokenRevocationRequestPathParams) Params

type TokenRevocationRequestQueryParams

type TokenRevocationRequestQueryParams struct{}

func (TokenRevocationRequestQueryParams) ToURLValues

type TokenRevocationResponseBody

type TokenRevocationResponseBody struct{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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