Documentation ¶
Index ¶
- Variables
- func CheckResponse(r *http.Response) error
- type Accounting
- type BeforeRequestDoCallback
- type Client
- func (c Client) BaseURL() url.URL
- func (c Client) Charset() string
- func (c Client) Debug() bool
- func (c *Client) Do(req *http.Request, body interface{}) (*http.Response, error)
- func (c *Client) GetEndpointURL(p string, pathParams PathParams) url.URL
- func (c Client) MediaType() string
- func (c *Client) NewOrdersArchivedGet() OrdersArchivedGet
- func (c *Client) NewRequest(ctx context.Context, req Request) (*http.Request, error)
- func (c *Client) SetBaseURL(baseURL url.URL)
- func (c *Client) SetBeforeRequestDo(fun BeforeRequestDoCallback)
- func (c *Client) SetCharset(charset string)
- func (c *Client) SetDebug(debug bool)
- func (c *Client) SetDisallowUnknownFields(disallowUnknownFields bool)
- func (c *Client) SetHTTPClient(client *http.Client)
- func (c *Client) SetMediaType(mediaType string)
- func (c *Client) SetUserAgent(userAgent string)
- func (c *Client) Unmarshal(r io.Reader, vv ...interface{}) error
- func (c Client) UserAgent() string
- type Customer
- type Date
- type DateTime
- type Discount
- type Discounts
- type ErrorResponse
- type Location
- type Meta
- type Oauth2Config
- type Order
- type Orders
- type OrdersArchivedGet
- func (r *OrdersArchivedGet) Do() (OrdersArchivedGetResponseBody, error)
- func (r *OrdersArchivedGet) Method() string
- func (r OrdersArchivedGet) NewPathParams() *OrdersArchivedGetPathParams
- func (r OrdersArchivedGet) NewQueryParams() *OrdersArchivedGetQueryParams
- func (r OrdersArchivedGet) NewRequestBody() OrdersArchivedGetBody
- func (r *OrdersArchivedGet) NewResponseBody() *OrdersArchivedGetResponseBody
- func (r *OrdersArchivedGet) PathParams() *OrdersArchivedGetPathParams
- func (r *OrdersArchivedGet) PathParamsInterface() PathParams
- func (r *OrdersArchivedGet) QueryParams() *OrdersArchivedGetQueryParams
- func (r *OrdersArchivedGet) RequestBody() *OrdersArchivedGetBody
- func (r *OrdersArchivedGet) RequestBodyInterface() interface{}
- func (r *OrdersArchivedGet) SetMethod(method string)
- func (r *OrdersArchivedGet) SetRequestBody(body OrdersArchivedGetBody)
- func (r *OrdersArchivedGet) URL() *url.URL
- type OrdersArchivedGetBody
- type OrdersArchivedGetPathParams
- type OrdersArchivedGetQueryParams
- type OrdersArchivedGetResponseBody
- type PathParams
- type Product
- type Products
- type QueryParams
- type Request
- type RequestCompletionCallback
Constants ¶
This section is empty.
Variables ¶
var (
BaseURL = url.URL{
Scheme: "https",
Host: "api.sitedish.nl",
Path: "/api/v1",
}
)
Functions ¶
func CheckResponse ¶
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.
Types ¶
type Accounting ¶
type Accounting struct { Revenue float64 `json:"revenue"` VAT struct { VatLowPercentage float64 `json:"vat_low_percentage"` VatLowAmount float64 `json:"vat_low_amount"` VatLow float64 `json:"vat_low"` VatHighPercentage float64 `json:"vat_high_percentage"` VatHighAmount float64 `json:"vat_high_amount"` VatHigh float64 `json:"vat_high"` VatNoneAmount float64 `json:"vat_none_amount"` } `json:"vat"` }
type BeforeRequestDoCallback ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client manages communication with Exact Globe Client
func (*Client) Do ¶
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) NewOrdersArchivedGet ¶
func (c *Client) NewOrdersArchivedGet() OrdersArchivedGet
func (*Client) NewRequest ¶
func (*Client) SetBaseURL ¶
func (*Client) SetBeforeRequestDo ¶
func (c *Client) SetBeforeRequestDo(fun BeforeRequestDoCallback)
func (*Client) SetCharset ¶
func (*Client) SetDisallowUnknownFields ¶
func (*Client) SetHTTPClient ¶
func (*Client) SetMediaType ¶
func (*Client) SetUserAgent ¶
type Customer ¶
type Customer struct { Name string `json:"name"` CompanyName string `json:"companyName"` PhoneNumber string `json:"phoneNumber"` Street string `json:"street"` StreetNumber string `json:"streetNumber"` PostalCode string `json:"postalCode"` City string `json:"city"` ExtraAddressInfo string `json:"extraAddressInfo"` NewCustomer bool `json:"newCustomer"` }
type DateTime ¶
func (DateTime) MarshalSchema ¶
type ErrorResponse ¶
type ErrorResponse struct { // HTTP response that caused this error Response *http.Response Success bool `json:"success"` Validation struct { ErrorLogReference string `json:"errorLogReference"` Summary string `json:"summary"` Exception string `json:"exception"` } `json:"validation"` }
func (*ErrorResponse) Error ¶
func (r *ErrorResponse) Error() string
type Meta ¶
type Meta struct { Version int `json:"version"` LastUpdated interface{} `json:"lastUpdated"` }
type Oauth2Config ¶
type Oauth2Config struct {
clientcredentials.Config
}
func NewOauth2Config ¶
func NewOauth2Config() *Oauth2Config
func (*Oauth2Config) SetBaseURL ¶
func (c *Oauth2Config) SetBaseURL(baseURL *url.URL)
type Order ¶
type Order struct { ID string `json:"id"` OrderNumber string `json:"orderNumber"` Platform string `json:"platform"` RestaurantID string `json:"restaurantId"` ReceiptNumber int `json:"receiptNumber"` OrderStatus int `json:"orderStatus"` OrderDate time.Time `json:"orderDate"` OrderType string `json:"orderType"` Courier string `json:"courier"` DeliveryCosts float64 `json:"deliveryCosts"` Tip float64 `json:"tip"` TotalPrice float64 `json:"totalPrice"` TotalSupFee float64 `json:"totalSupFee"` TotalFee float64 `json:"totalFee"` TotalDiscount float64 `json:"totalDiscount"` TotalDeposit float64 `json:"totalDeposit"` PaymentMethod string `json:"paymentMethod"` PaysExact bool `json:"paysExact"` PaysWith float64 `json:"paysWith"` Customer Customer `json:"customer"` Products Products `json:"products"` Discounts Discounts `json:"discounts"` Remark string `json:"remark"` Location Location `json:"location"` Canceled bool `json:"canceled"` Deleted bool `json:"deleted"` Refunded bool `json:"refunded"` IsPaid bool `json:"isPaid"` RequestedAsap bool `json:"requestedAsap"` ConfirmedTime DateTime `json:"confirmedTime"` Version string `json:"version"` Accounting Accounting `json:"accounting"` Meta Meta `json:"meta"` }
type OrdersArchivedGet ¶
type OrdersArchivedGet struct {
// contains filtered or unexported fields
}
func (*OrdersArchivedGet) Do ¶
func (r *OrdersArchivedGet) Do() (OrdersArchivedGetResponseBody, error)
func (*OrdersArchivedGet) Method ¶
func (r *OrdersArchivedGet) Method() string
func (OrdersArchivedGet) NewPathParams ¶
func (r OrdersArchivedGet) NewPathParams() *OrdersArchivedGetPathParams
func (OrdersArchivedGet) NewQueryParams ¶
func (r OrdersArchivedGet) NewQueryParams() *OrdersArchivedGetQueryParams
func (OrdersArchivedGet) NewRequestBody ¶
func (r OrdersArchivedGet) NewRequestBody() OrdersArchivedGetBody
func (*OrdersArchivedGet) NewResponseBody ¶
func (r *OrdersArchivedGet) NewResponseBody() *OrdersArchivedGetResponseBody
func (*OrdersArchivedGet) PathParams ¶
func (r *OrdersArchivedGet) PathParams() *OrdersArchivedGetPathParams
func (*OrdersArchivedGet) PathParamsInterface ¶
func (r *OrdersArchivedGet) PathParamsInterface() PathParams
func (*OrdersArchivedGet) QueryParams ¶
func (r *OrdersArchivedGet) QueryParams() *OrdersArchivedGetQueryParams
func (*OrdersArchivedGet) RequestBody ¶
func (r *OrdersArchivedGet) RequestBody() *OrdersArchivedGetBody
func (*OrdersArchivedGet) RequestBodyInterface ¶
func (r *OrdersArchivedGet) RequestBodyInterface() interface{}
func (*OrdersArchivedGet) SetMethod ¶
func (r *OrdersArchivedGet) SetMethod(method string)
func (*OrdersArchivedGet) SetRequestBody ¶
func (r *OrdersArchivedGet) SetRequestBody(body OrdersArchivedGetBody)
func (*OrdersArchivedGet) URL ¶
func (r *OrdersArchivedGet) URL() *url.URL
type OrdersArchivedGetBody ¶
type OrdersArchivedGetBody struct { }
type OrdersArchivedGetPathParams ¶
type OrdersArchivedGetPathParams struct {
Platform string
}
func (*OrdersArchivedGetPathParams) Params ¶
func (p *OrdersArchivedGetPathParams) Params() map[string]string
type OrdersArchivedGetQueryParams ¶
type OrdersArchivedGetQueryParams struct { Start DateTime `schema:"start,omitempty"` End DateTime `schema:"end,omitempty"` }
func (OrdersArchivedGetQueryParams) ToURLValues ¶
func (p OrdersArchivedGetQueryParams) ToURLValues() (url.Values, error)
type OrdersArchivedGetResponseBody ¶
type OrdersArchivedGetResponseBody Orders
type PathParams ¶
type Product ¶
type Product struct { ID string `json:"id"` Posid string `json:"posid"` Number string `json:"number"` Name string `json:"name"` Category string `json:"category"` Instructions string `json:"instructions"` Count int `json:"count"` UnitPrice float64 `json:"unitPrice"` Price float64 `json:"price"` SupFee float64 `json:"supFee"` UnitDiscount float64 `json:"unitDiscount"` Subtotal float64 `json:"subtotal"` VAT float64 `json:"vat"` Deposit float64 `json:"deposit"` SideDishes []struct { ID string `json:"id"` Posid string `json:"posid"` Number interface{} `json:"number"` Name string `json:"name"` Count int `json:"count"` Price float64 `json:"price"` VAT float64 `json:"vat"` Deposit float64 `json:"deposit"` } `json:"sideDishes"` }