Documentation ¶
Index ¶
- Variables
- func AddQueryParamsToRequest(requestParams interface{}, req *http.Request, skipEmpty bool) error
- func CheckResponse(r *http.Response) error
- type API
- func (api *API) AccountNumber() string
- func (api *API) BaseURL() url.URL
- func (api *API) Charset() string
- func (api *API) Debug() bool
- func (api *API) Do(req *http.Request, responseBody interface{}) (*http.Response, error)
- func (api *API) GetEndpointURL(p string) url.URL
- func (api *API) MediaType() string
- func (api *API) NewRequest(ctx context.Context, method string, URL url.URL, body interface{}) (*http.Request, error)
- func (api *API) SetAccountNumber(accountNumber string)
- func (api *API) SetBaseURL(baseURL url.URL)
- func (api *API) SetCharset(charset string)
- func (api *API) SetDebug(debug bool)
- func (api *API) SetMediaType(mediaType string)
- func (api *API) SetToken(token string)
- func (api *API) SetUserAgent(userAgent string)
- func (api *API) Token() string
- func (api *API) UserAgent() string
- type ConnectorInsertQueryParams
- type ConnectorInsertRequest
- func (r *ConnectorInsertRequest) Do() (*ConnectorInsertResponseBody, error)
- func (r *ConnectorInsertRequest) Method() string
- func (r *ConnectorInsertRequest) QueryParams() *ConnectorInsertQueryParams
- func (r *ConnectorInsertRequest) RequestBody() ConnectorInsertRequestBody
- func (r *ConnectorInsertRequest) ResponseBody() *ConnectorInsertResponseBody
- func (r *ConnectorInsertRequest) SetMethod(method string)
- func (r *ConnectorInsertRequest) SetRequestBody(body ConnectorInsertRequestBody)
- func (r *ConnectorInsertRequest) URL() url.URL
- func (r *ConnectorInsertRequest) URLParams() *ConnectorInsertURLParams
- type ConnectorInsertRequestBody
- type ConnectorInsertResponseBody
- type ConnectorInsertURLParams
- type ConnectorListQueryParams
- type ConnectorListRequest
- func (r *ConnectorListRequest) Do() (*http.Response, error)
- func (r *ConnectorListRequest) Method() string
- func (r *ConnectorListRequest) QueryParams() *ConnectorListQueryParams
- func (r *ConnectorListRequest) RequestBody() *EmptyRequestBody
- func (r *ConnectorListRequest) ResponseBody() *ConnectorListResponseBody
- func (r *ConnectorListRequest) SetMethod(method string)
- func (r *ConnectorListRequest) SetRequestBody(body EmptyRequestBody)
- func (r *ConnectorListRequest) SetResponseBody(body *ConnectorListResponseBody)
- func (r *ConnectorListRequest) URL() url.URL
- func (r *ConnectorListRequest) URLParams() *ConnectorListURLParams
- type ConnectorListResponseBody
- type ConnectorListURLParams
- type ConnectorService
- func (s *ConnectorService) NewInsertRequest() ConnectorInsertRequest
- func (s *ConnectorService) NewInsertRequestBody() ConnectorInsertRequestBody
- func (s *ConnectorService) NewInsertResponseBody() *ConnectorInsertResponseBody
- func (s *ConnectorService) NewListRequest() ConnectorListRequest
- func (s *ConnectorService) NewListRequestBody() EmptyRequestBody
- func (s *ConnectorService) NewListResponseBody() *ConnectorListResponseBody
- func (s *ConnectorService) NewUpdateRequest() ConnectorUpdateRequest
- func (s *ConnectorService) NewUpdateRequestBody() ConnectorUpdateRequestBody
- func (s *ConnectorService) NewUpdateResponseBody() *ConnectorUpdateResponseBody
- type ConnectorUpdateQueryParams
- type ConnectorUpdateRequest
- func (r *ConnectorUpdateRequest) Do() (*ConnectorUpdateResponseBody, error)
- func (r *ConnectorUpdateRequest) Method() string
- func (r *ConnectorUpdateRequest) QueryParams() *ConnectorUpdateQueryParams
- func (r *ConnectorUpdateRequest) RequestBody() ConnectorUpdateRequestBody
- func (r *ConnectorUpdateRequest) ResponseBody() *ConnectorUpdateResponseBody
- func (r *ConnectorUpdateRequest) SetMethod(method string)
- func (r *ConnectorUpdateRequest) SetRequestBody(body ConnectorUpdateRequestBody)
- func (r *ConnectorUpdateRequest) URL() url.URL
- func (r *ConnectorUpdateRequest) URLParams() *ConnectorUpdateURLParams
- type ConnectorUpdateRequestBody
- type ConnectorUpdateResponseBody
- type ConnectorUpdateURLParams
- type Element
- type Elements
- type EmptyRequestBody
- type ErrorResponse1
- type ErrorResponse2
- type GetConnector
- type GetConnectorField
- type GetConnectors
- type MetaDescribeGetConnectorQueryParams
- type MetaDescribeGetConnectorRequest
- func (r *MetaDescribeGetConnectorRequest) Do() (MetaDescribeGetConnectorResponseBody, error)
- func (r *MetaDescribeGetConnectorRequest) Method() string
- func (r *MetaDescribeGetConnectorRequest) NewResponseBody() *MetaDescribeGetConnectorResponseBody
- func (r *MetaDescribeGetConnectorRequest) QueryParams() *MetaDescribeGetConnectorQueryParams
- func (r *MetaDescribeGetConnectorRequest) RequestBody() *EmptyRequestBody
- func (r *MetaDescribeGetConnectorRequest) SetMethod(method string)
- func (r *MetaDescribeGetConnectorRequest) SetRequestBody(body EmptyRequestBody)
- func (r *MetaDescribeGetConnectorRequest) URL() url.URL
- func (r *MetaDescribeGetConnectorRequest) URLParams() *MetaDescribeGetConnectorURLParams
- type MetaDescribeGetConnectorResponseBody
- type MetaDescribeGetConnectorURLParams
- type MetaDescribeUpdateConnectorQueryParams
- type MetaDescribeUpdateConnectorRequest
- func (r *MetaDescribeUpdateConnectorRequest) Do() (MetaDescribeUpdateConnectorResponseBody, error)
- func (r *MetaDescribeUpdateConnectorRequest) Method() string
- func (r *MetaDescribeUpdateConnectorRequest) NewResponseBody() *MetaDescribeUpdateConnectorResponseBody
- func (r *MetaDescribeUpdateConnectorRequest) QueryParams() *MetaDescribeUpdateConnectorQueryParams
- func (r *MetaDescribeUpdateConnectorRequest) SetMethod(method string)
- func (r *MetaDescribeUpdateConnectorRequest) URL() url.URL
- func (r *MetaDescribeUpdateConnectorRequest) URLParams() *MetaDescribeUpdateConnectorURLParams
- type MetaDescribeUpdateConnectorResponseBody
- type MetaDescribeUpdateConnectorURLParams
- type MetaListConnectorsQueryParams
- type MetaListConnectorsRequest
- func (r *MetaListConnectorsRequest) Do() (MetaListConnectorsResponseBody, error)
- func (r *MetaListConnectorsRequest) Method() string
- func (r *MetaListConnectorsRequest) NewResponseBody() *MetaListConnectorsResponseBody
- func (r *MetaListConnectorsRequest) SetMethod(method string)
- func (r *MetaListConnectorsRequest) URL() url.URL
- type MetaListConnectorsResponseBody
- type MetaListConnectorsURLParams
- type MetaService
- type RequestCompletionCallback
- type SchemaMarshaler
- type ToURLValues
- type UpdateConnector
- type UpdateConnectorField
- type UpdateConnectorObject
- type UpdateConnectors
Constants ¶
This section is empty.
Variables ¶
var (
BaseURL = url.URL{
Scheme: "https",
Host: "{account_number}.rest.afas.online",
Path: "/profitrestservices/",
}
)
Functions ¶
func AddQueryParamsToRequest ¶
func CheckResponse ¶
CheckResponse checks the API response for errors, and returns them if present. A response is considered an error if it has a status code outside the 200 range. API 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.
Types ¶
type API ¶
type API struct { // Services used for communicating with the API Meta *MetaService Connector *ConnectorService // contains filtered or unexported fields }
API manages communication with AFAS API
func (*API) AccountNumber ¶
func (*API) Do ¶
Do sends an API request and returns the API response. The API response is json decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred. If v implements the io.Writer interface, the raw response will be written to v, without attempting to decode it.
func (*API) NewRequest ¶
func (*API) SetAccountNumber ¶
func (*API) SetBaseURL ¶
func (*API) SetCharset ¶
func (*API) SetMediaType ¶
func (*API) SetUserAgent ¶
type ConnectorInsertQueryParams ¶
type ConnectorInsertQueryParams struct { }
type ConnectorInsertRequest ¶
type ConnectorInsertRequest struct {
// contains filtered or unexported fields
}
func (*ConnectorInsertRequest) Do ¶
func (r *ConnectorInsertRequest) Do() (*ConnectorInsertResponseBody, error)
func (*ConnectorInsertRequest) Method ¶
func (r *ConnectorInsertRequest) Method() string
func (*ConnectorInsertRequest) QueryParams ¶
func (r *ConnectorInsertRequest) QueryParams() *ConnectorInsertQueryParams
func (*ConnectorInsertRequest) RequestBody ¶
func (r *ConnectorInsertRequest) RequestBody() ConnectorInsertRequestBody
func (*ConnectorInsertRequest) ResponseBody ¶
func (r *ConnectorInsertRequest) ResponseBody() *ConnectorInsertResponseBody
func (*ConnectorInsertRequest) SetMethod ¶
func (r *ConnectorInsertRequest) SetMethod(method string)
func (*ConnectorInsertRequest) SetRequestBody ¶
func (r *ConnectorInsertRequest) SetRequestBody(body ConnectorInsertRequestBody)
func (*ConnectorInsertRequest) URL ¶
func (r *ConnectorInsertRequest) URL() url.URL
func (*ConnectorInsertRequest) URLParams ¶
func (r *ConnectorInsertRequest) URLParams() *ConnectorInsertURLParams
type ConnectorInsertRequestBody ¶
type ConnectorInsertRequestBody interface{}
type ConnectorInsertResponseBody ¶
type ConnectorInsertResponseBody struct {
Results json.RawMessage `json:"results"`
}
{"results":{"FiEntryPar":{"UnId":"4","EnNo":"54605"}}}
type ConnectorListQueryParams ¶
type ConnectorListQueryParams struct { Skip int `schema:"skip,omitempty"` Take int `schema:"take,omitempty"` OrderByFieldIDs string `schema:"orderbyfieldids,omitempty"` FilterFieldIDs string `schema:"filterfieldids,omitempty"` FilterValues string `schema:"filtervalues,omitempty"` OperatorTypes string `schema:"operatortypes,omitempty"` }
type ConnectorListRequest ¶
type ConnectorListRequest struct {
// contains filtered or unexported fields
}
func (*ConnectorListRequest) Method ¶
func (r *ConnectorListRequest) Method() string
func (*ConnectorListRequest) QueryParams ¶
func (r *ConnectorListRequest) QueryParams() *ConnectorListQueryParams
func (*ConnectorListRequest) RequestBody ¶
func (r *ConnectorListRequest) RequestBody() *EmptyRequestBody
func (*ConnectorListRequest) ResponseBody ¶
func (r *ConnectorListRequest) ResponseBody() *ConnectorListResponseBody
func (*ConnectorListRequest) SetMethod ¶
func (r *ConnectorListRequest) SetMethod(method string)
func (*ConnectorListRequest) SetRequestBody ¶
func (r *ConnectorListRequest) SetRequestBody(body EmptyRequestBody)
func (*ConnectorListRequest) SetResponseBody ¶
func (r *ConnectorListRequest) SetResponseBody(body *ConnectorListResponseBody)
func (*ConnectorListRequest) URL ¶
func (r *ConnectorListRequest) URL() url.URL
func (*ConnectorListRequest) URLParams ¶
func (r *ConnectorListRequest) URLParams() *ConnectorListURLParams
type ConnectorListURLParams ¶
type ConnectorService ¶
type ConnectorService struct {
// contains filtered or unexported fields
}
func NewConnectorService ¶
func NewConnectorService(api *API) *ConnectorService
func (*ConnectorService) NewInsertRequest ¶
func (s *ConnectorService) NewInsertRequest() ConnectorInsertRequest
func (*ConnectorService) NewInsertRequestBody ¶
func (s *ConnectorService) NewInsertRequestBody() ConnectorInsertRequestBody
func (*ConnectorService) NewInsertResponseBody ¶
func (s *ConnectorService) NewInsertResponseBody() *ConnectorInsertResponseBody
func (*ConnectorService) NewListRequest ¶
func (s *ConnectorService) NewListRequest() ConnectorListRequest
func (*ConnectorService) NewListRequestBody ¶
func (s *ConnectorService) NewListRequestBody() EmptyRequestBody
func (*ConnectorService) NewListResponseBody ¶
func (s *ConnectorService) NewListResponseBody() *ConnectorListResponseBody
func (*ConnectorService) NewUpdateRequest ¶
func (s *ConnectorService) NewUpdateRequest() ConnectorUpdateRequest
func (*ConnectorService) NewUpdateRequestBody ¶
func (s *ConnectorService) NewUpdateRequestBody() ConnectorUpdateRequestBody
func (*ConnectorService) NewUpdateResponseBody ¶
func (s *ConnectorService) NewUpdateResponseBody() *ConnectorUpdateResponseBody
type ConnectorUpdateQueryParams ¶
type ConnectorUpdateQueryParams struct { }
type ConnectorUpdateRequest ¶
type ConnectorUpdateRequest struct {
// contains filtered or unexported fields
}
func (*ConnectorUpdateRequest) Do ¶
func (r *ConnectorUpdateRequest) Do() (*ConnectorUpdateResponseBody, error)
func (*ConnectorUpdateRequest) Method ¶
func (r *ConnectorUpdateRequest) Method() string
func (*ConnectorUpdateRequest) QueryParams ¶
func (r *ConnectorUpdateRequest) QueryParams() *ConnectorUpdateQueryParams
func (*ConnectorUpdateRequest) RequestBody ¶
func (r *ConnectorUpdateRequest) RequestBody() ConnectorUpdateRequestBody
func (*ConnectorUpdateRequest) ResponseBody ¶
func (r *ConnectorUpdateRequest) ResponseBody() *ConnectorUpdateResponseBody
func (*ConnectorUpdateRequest) SetMethod ¶
func (r *ConnectorUpdateRequest) SetMethod(method string)
func (*ConnectorUpdateRequest) SetRequestBody ¶
func (r *ConnectorUpdateRequest) SetRequestBody(body ConnectorUpdateRequestBody)
func (*ConnectorUpdateRequest) URL ¶
func (r *ConnectorUpdateRequest) URL() url.URL
func (*ConnectorUpdateRequest) URLParams ¶
func (r *ConnectorUpdateRequest) URLParams() *ConnectorUpdateURLParams
type ConnectorUpdateRequestBody ¶
type ConnectorUpdateRequestBody interface{}
type ConnectorUpdateResponseBody ¶
type ConnectorUpdateResponseBody struct {
Results json.RawMessage `json:"results"`
}
{"results":{"FiEntryPar":{"UnId":"4","EnNo":"54605"}}}
type Element ¶
type Element struct { DBID string `json:"@DbId,omitempty"` Fields map[string]interface{} `json:"Fields,omitempty"` Objects map[string]interface{} `json:"Objects,omitempty"` }
func (Element) MarshalJSON ¶
type EmptyRequestBody ¶
type EmptyRequestBody struct{}
func (EmptyRequestBody) MarshalJSON ¶
func (r EmptyRequestBody) MarshalJSON() ([]byte, error)
type ErrorResponse1 ¶
type ErrorResponse1 struct { // HTTP response that caused this error Response *http.Response `json:"-"` Message string `json:"message"` }
{ "message":"Invalid json" }
func (ErrorResponse1) Error ¶
func (r ErrorResponse1) Error() string
type ErrorResponse2 ¶
type ErrorResponse2 struct { // HTTP response that caused this error Response *http.Response `json:"-"` ErrorNumber int `json:"errorNumber"` ExternalMessage string `json:"externalMessage"` ProfitLogReference string `json:"profitLogReference"` }
{ "errorNumber": -2147180996, "externalMessage": "General message: Deze UpdateConnector wordt niet ondersteund of de gebruiker is niet geautoriseerd.", "profitLogReference": "923A9F6F4D5875E0D7B96982F6E4E0D2" }
func (ErrorResponse2) Error ¶
func (r ErrorResponse2) Error() string
type GetConnector ¶
type GetConnectorField ¶
type GetConnectors ¶
type GetConnectors []GetConnector
type MetaDescribeGetConnectorQueryParams ¶
type MetaDescribeGetConnectorQueryParams struct { }
type MetaDescribeGetConnectorRequest ¶
type MetaDescribeGetConnectorRequest struct {
// contains filtered or unexported fields
}
func (*MetaDescribeGetConnectorRequest) Do ¶
func (r *MetaDescribeGetConnectorRequest) Do() (MetaDescribeGetConnectorResponseBody, error)
func (*MetaDescribeGetConnectorRequest) Method ¶
func (r *MetaDescribeGetConnectorRequest) Method() string
func (*MetaDescribeGetConnectorRequest) NewResponseBody ¶
func (r *MetaDescribeGetConnectorRequest) NewResponseBody() *MetaDescribeGetConnectorResponseBody
func (*MetaDescribeGetConnectorRequest) QueryParams ¶
func (r *MetaDescribeGetConnectorRequest) QueryParams() *MetaDescribeGetConnectorQueryParams
func (*MetaDescribeGetConnectorRequest) RequestBody ¶
func (r *MetaDescribeGetConnectorRequest) RequestBody() *EmptyRequestBody
func (*MetaDescribeGetConnectorRequest) SetMethod ¶
func (r *MetaDescribeGetConnectorRequest) SetMethod(method string)
func (*MetaDescribeGetConnectorRequest) SetRequestBody ¶
func (r *MetaDescribeGetConnectorRequest) SetRequestBody(body EmptyRequestBody)
func (*MetaDescribeGetConnectorRequest) URL ¶
func (r *MetaDescribeGetConnectorRequest) URL() url.URL
func (*MetaDescribeGetConnectorRequest) URLParams ¶
func (r *MetaDescribeGetConnectorRequest) URLParams() *MetaDescribeGetConnectorURLParams
type MetaDescribeGetConnectorResponseBody ¶
type MetaDescribeGetConnectorResponseBody struct { Name string `json:"name"` Description string `json:"description"` Fields []GetConnectorField `json:"fields"` }
type MetaDescribeGetConnectorURLParams ¶
type MetaDescribeGetConnectorURLParams struct {
ConnectorID string
}
type MetaDescribeUpdateConnectorQueryParams ¶
type MetaDescribeUpdateConnectorQueryParams struct { }
type MetaDescribeUpdateConnectorRequest ¶
type MetaDescribeUpdateConnectorRequest struct {
// contains filtered or unexported fields
}
func (*MetaDescribeUpdateConnectorRequest) Do ¶
func (r *MetaDescribeUpdateConnectorRequest) Do() (MetaDescribeUpdateConnectorResponseBody, error)
func (*MetaDescribeUpdateConnectorRequest) Method ¶
func (r *MetaDescribeUpdateConnectorRequest) Method() string
func (*MetaDescribeUpdateConnectorRequest) NewResponseBody ¶
func (r *MetaDescribeUpdateConnectorRequest) NewResponseBody() *MetaDescribeUpdateConnectorResponseBody
func (*MetaDescribeUpdateConnectorRequest) QueryParams ¶
func (r *MetaDescribeUpdateConnectorRequest) QueryParams() *MetaDescribeUpdateConnectorQueryParams
func (*MetaDescribeUpdateConnectorRequest) SetMethod ¶
func (r *MetaDescribeUpdateConnectorRequest) SetMethod(method string)
func (*MetaDescribeUpdateConnectorRequest) URL ¶
func (r *MetaDescribeUpdateConnectorRequest) URL() url.URL
func (*MetaDescribeUpdateConnectorRequest) URLParams ¶
func (r *MetaDescribeUpdateConnectorRequest) URLParams() *MetaDescribeUpdateConnectorURLParams
type MetaDescribeUpdateConnectorResponseBody ¶
type MetaDescribeUpdateConnectorResponseBody struct { ID string `json:"id"` Description string `json:"description"` UpdateConnectorObject }
type MetaDescribeUpdateConnectorURLParams ¶
type MetaDescribeUpdateConnectorURLParams struct {
ConnectorID string
}
type MetaListConnectorsQueryParams ¶
type MetaListConnectorsQueryParams struct { }
type MetaListConnectorsRequest ¶
type MetaListConnectorsRequest struct {
// contains filtered or unexported fields
}
func (*MetaListConnectorsRequest) Do ¶
func (r *MetaListConnectorsRequest) Do() (MetaListConnectorsResponseBody, error)
func (*MetaListConnectorsRequest) Method ¶
func (r *MetaListConnectorsRequest) Method() string
func (*MetaListConnectorsRequest) NewResponseBody ¶
func (r *MetaListConnectorsRequest) NewResponseBody() *MetaListConnectorsResponseBody
func (*MetaListConnectorsRequest) SetMethod ¶
func (r *MetaListConnectorsRequest) SetMethod(method string)
func (*MetaListConnectorsRequest) URL ¶
func (r *MetaListConnectorsRequest) URL() url.URL
type MetaListConnectorsResponseBody ¶
type MetaListConnectorsResponseBody struct { UpdateConnectors UpdateConnectors `json:"updateConnectors"` GetConnectors GetConnectors `json:"getConnectors"` }
type MetaListConnectorsURLParams ¶
type MetaListConnectorsURLParams struct { }
type MetaService ¶
type MetaService struct {
// contains filtered or unexported fields
}
func NewMetaService ¶
func NewMetaService(api *API) *MetaService
func (*MetaService) NewDescribeGetConnectorRequest ¶
func (s *MetaService) NewDescribeGetConnectorRequest() MetaDescribeGetConnectorRequest
func (*MetaService) NewDescribeUpdateConnectorRequest ¶
func (s *MetaService) NewDescribeUpdateConnectorRequest() MetaDescribeUpdateConnectorRequest
func (*MetaService) NewListConnectorsRequest ¶
func (s *MetaService) NewListConnectorsRequest() MetaListConnectorsRequest
type RequestCompletionCallback ¶
RequestCompletionCallback defines the type of the request callback function
type SchemaMarshaler ¶
type SchemaMarshaler interface {
MarshalSchema() string
}
type ToURLValues ¶
type UpdateConnector ¶
type UpdateConnectorField ¶
type UpdateConnectorField struct { FieldID string `json:"fieldId"` PrimaryKey bool `json:"primaryKey"` DataType string `json:"dataType"` Label string `json:"label"` Mandatory bool `json:"mandatory"` Length int `json:"length"` Decimals int `json:"decimals"` DecimalFieldID string `json:"decimalFieldId"` NotZero bool `json:"notzero"` ControlType int `json:"controlType"` Values []struct { ID string `json:"id"` Description string `json:"description"` } `json:"values"` }
type UpdateConnectorObject ¶
type UpdateConnectorObject struct { Name string `json:"name"` Fields []UpdateConnectorField `json:"fields"` Objects []UpdateConnectorObject `json:"objects"` }
type UpdateConnectors ¶
type UpdateConnectors []UpdateConnector