ikentoo

package module
v0.0.0-...-8e18e95 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BaseURL = url.URL{
		Scheme: "https",
		Host:   "api.ikentoo.com",
		Path:   "/f",
	}
)

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.

Types

type AccountingGroup

type AccountingGroup struct {
	AccountingGroupID int64  `json:"accountingGroupId"`
	Name              string `json:"name"`
	StatisticGroup    string `json:"statisticGroup"`
	Code              string `json:"code"`
}

type AccountingGroupList

type AccountingGroupList []AccountingGroup

type AccountingGroupsGetRequest

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

func (*AccountingGroupsGetRequest) Do

func (*AccountingGroupsGetRequest) Method

func (r *AccountingGroupsGetRequest) Method() string

func (AccountingGroupsGetRequest) NewPathParams

func (AccountingGroupsGetRequest) NewQueryParams

func (AccountingGroupsGetRequest) NewRequestBody

func (*AccountingGroupsGetRequest) NewResponseBody

func (*AccountingGroupsGetRequest) PathParams

func (*AccountingGroupsGetRequest) PathParamsInterface

func (r *AccountingGroupsGetRequest) PathParamsInterface() PathParams

func (*AccountingGroupsGetRequest) QueryParams

func (*AccountingGroupsGetRequest) RequestBody

func (*AccountingGroupsGetRequest) RequestBodyInterface

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

func (*AccountingGroupsGetRequest) SetMethod

func (r *AccountingGroupsGetRequest) SetMethod(method string)

func (*AccountingGroupsGetRequest) SetRequestBody

func (*AccountingGroupsGetRequest) URL

type AccountingGroupsGetRequestBody

type AccountingGroupsGetRequestBody struct {
}

type AccountingGroupsGetRequestPathParams

type AccountingGroupsGetRequestPathParams struct {
	BusinessID int
	From       time.Time
	To         time.Time
}

func (*AccountingGroupsGetRequestPathParams) Params

type AccountingGroupsGetRequestQueryParams

type AccountingGroupsGetRequestQueryParams struct {
	Include       Includes `schema:"include,omitempty"`
	PageSize      int      `schema:"pageSize,omitempty"`
	NextPageToken string   `schema:"nextPageToken,omitempty"`
}

func (AccountingGroupsGetRequestQueryParams) ToURLValues

type AccountingGroupsGetResponseBody

type AccountingGroupsGetResponseBody struct {
	Embedded struct {
		AccountingGroupList AccountingGroupList `json:"accountingGroupList"`
	} `json:"_embedded"`
	Links Links `json:"_links"`
}

type AutoGenerated

type AutoGenerated struct {
	Embedded struct {
		PaymentMethodList []struct {
		} `json:"paymentMethodList"`
	} `json:"_embedded"`
	Links struct {
		Self struct {
			Href string `json:"href"`
		} `json:"self"`
	} `json:"_links"`
}

type BeforeRequestDoCallback

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

type Business

type Business struct {
	BusinessName      string `json:"businessName"`
	BusinessID        int    `json:"businessId"`
	CurrencyCode      string `json:"currencyCode"`
	BusinessLocations []struct {
		BlName   string `json:"blName"`
		BlID     int64  `json:"blId"`
		Country  string `json:"country"`
		Timezone string `json:"timezone"`
	} `json:"businessLocations"`
}

type BusinessList

type BusinessList []Business

type BusinessesGetRequest

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

func (*BusinessesGetRequest) Do

func (*BusinessesGetRequest) Method

func (r *BusinessesGetRequest) Method() string

func (BusinessesGetRequest) NewPathParams

func (BusinessesGetRequest) NewQueryParams

func (BusinessesGetRequest) NewRequestBody

func (*BusinessesGetRequest) NewResponseBody

func (r *BusinessesGetRequest) NewResponseBody() *BusinessesGetResponseBody

func (*BusinessesGetRequest) PathParams

func (*BusinessesGetRequest) PathParamsInterface

func (r *BusinessesGetRequest) PathParamsInterface() PathParams

func (*BusinessesGetRequest) QueryParams

func (*BusinessesGetRequest) RequestBody

func (*BusinessesGetRequest) RequestBodyInterface

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

func (*BusinessesGetRequest) SetMethod

func (r *BusinessesGetRequest) SetMethod(method string)

func (*BusinessesGetRequest) SetRequestBody

func (r *BusinessesGetRequest) SetRequestBody(body BusinessesGetRequestBody)

func (*BusinessesGetRequest) URL

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

type BusinessesGetRequestBody

type BusinessesGetRequestBody struct {
}

type BusinessesGetRequestPathParams

type BusinessesGetRequestPathParams struct {
}

func (*BusinessesGetRequestPathParams) Params

type BusinessesGetRequestQueryParams

type BusinessesGetRequestQueryParams struct{}

func (BusinessesGetRequestQueryParams) ToURLValues

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

type BusinessesGetResponseBody

type BusinessesGetResponseBody struct {
	Embedded struct {
		BusinessList BusinessList `json:"businessList"`
	} `json:"_embedded"`
	Links Links `json:"_links"`
}

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() url.URL

func (Client) Charset

func (c Client) Charset() 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) MediaType

func (c Client) MediaType() string

func (*Client) NewAccountingGroupsGetRequest

func (c *Client) NewAccountingGroupsGetRequest() AccountingGroupsGetRequest

func (*Client) NewBusinessesGetRequest

func (c *Client) NewBusinessesGetRequest() BusinessesGetRequest

func (*Client) NewDailyFinancialsGetRequest

func (c *Client) NewDailyFinancialsGetRequest() DailyFinancialsGetRequest

func (*Client) NewFinancialsGetRequest

func (c *Client) NewFinancialsGetRequest() FinancialsGetRequest

func (*Client) NewPaymentMethodsGetRequest

func (c *Client) NewPaymentMethodsGetRequest() PaymentMethodsGetRequest

func (*Client) NewRequest

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

func (*Client) SetBaseURL

func (c *Client) SetBaseURL(baseURL url.URL)

func (*Client) SetBeforeRequestDo

func (c *Client) SetBeforeRequestDo(fun BeforeRequestDoCallback)

func (*Client) SetCharset

func (c *Client) SetCharset(charset 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) 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 DailyFinancialsGetRequest

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

func (*DailyFinancialsGetRequest) Do

func (*DailyFinancialsGetRequest) Method

func (r *DailyFinancialsGetRequest) Method() string

func (DailyFinancialsGetRequest) NewPathParams

func (DailyFinancialsGetRequest) NewQueryParams

func (DailyFinancialsGetRequest) NewRequestBody

func (*DailyFinancialsGetRequest) NewResponseBody

func (*DailyFinancialsGetRequest) PathParams

func (*DailyFinancialsGetRequest) PathParamsInterface

func (r *DailyFinancialsGetRequest) PathParamsInterface() PathParams

func (*DailyFinancialsGetRequest) QueryParams

func (*DailyFinancialsGetRequest) RequestBody

func (*DailyFinancialsGetRequest) RequestBodyInterface

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

func (*DailyFinancialsGetRequest) SetMethod

func (r *DailyFinancialsGetRequest) SetMethod(method string)

func (*DailyFinancialsGetRequest) SetRequestBody

func (*DailyFinancialsGetRequest) URL

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

type DailyFinancialsGetRequestBody

type DailyFinancialsGetRequestBody struct {
}

type DailyFinancialsGetRequestPathParams

type DailyFinancialsGetRequestPathParams struct {
	BusinessID int
}

func (*DailyFinancialsGetRequestPathParams) Params

type DailyFinancialsGetRequestQueryParams

type DailyFinancialsGetRequestQueryParams struct {
	Date             Date     `schema:"date,omitempty"`
	IncludeConsumers bool     `schema:"includeConsumers,omitempty"`
	Include          Includes `schema:"include,omitempty"`
}

func (DailyFinancialsGetRequestQueryParams) ToURLValues

type DailyFinancialsGetResponseBody

type DailyFinancialsGetResponseBody struct {
	BusinessName            string    `json:"businessName"`
	NextStartOfDayAsIso8601 time.Time `json:"nextStartOfDayAsIso8601"`
	BusinessLocationID      int64     `json:"businessLocationId"`
	Sales                   Sales     `json:"sales"`
	DataComplete            bool      `json:"dataComplete"`
	Links                   Links     `json:"_links"`
}

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 DateTime

type DateTime struct {
	time.Time
}

func (*DateTime) MarshalJSON

func (dt *DateTime) MarshalJSON() ([]byte, error)

func (DateTime) MarshalSchema

func (d DateTime) MarshalSchema() string

func (*DateTime) UnmarshalJSON

func (dt *DateTime) UnmarshalJSON(text []byte) (err error)

type ErrorResponse

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

	// Timestamp DateTime    `json:"timestamp"`
	Status    int    `json:"status"`
	Err       string `json:"error"`
	Exception string `json:"exception"`
	Message   string `json:"message"`
	Path      string `json:"path"`
}

func (*ErrorResponse) Error

func (r *ErrorResponse) Error() string

type ErrorsResponse

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

	// Timestamp DateTime    `json:"timestamp"`
	Errors []struct {
		Code  string `json:"code"`
		Title string `json:"title"`
	}
}

func (*ErrorsResponse) Error

func (r *ErrorsResponse) Error() string

type FinancialsGetRequest

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

func (*FinancialsGetRequest) All

func (*FinancialsGetRequest) Do

func (*FinancialsGetRequest) Method

func (r *FinancialsGetRequest) Method() string

func (FinancialsGetRequest) NewPathParams

func (FinancialsGetRequest) NewQueryParams

func (FinancialsGetRequest) NewRequestBody

func (*FinancialsGetRequest) NewResponseBody

func (r *FinancialsGetRequest) NewResponseBody() *FinancialsGetResponseBody

func (*FinancialsGetRequest) PathParams

func (*FinancialsGetRequest) PathParamsInterface

func (r *FinancialsGetRequest) PathParamsInterface() PathParams

func (*FinancialsGetRequest) QueryParams

func (*FinancialsGetRequest) RequestBody

func (*FinancialsGetRequest) RequestBodyInterface

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

func (*FinancialsGetRequest) SetMethod

func (r *FinancialsGetRequest) SetMethod(method string)

func (*FinancialsGetRequest) SetRequestBody

func (r *FinancialsGetRequest) SetRequestBody(body FinancialsGetRequestBody)

func (*FinancialsGetRequest) URL

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

type FinancialsGetRequestBody

type FinancialsGetRequestBody struct {
}

type FinancialsGetRequestPathParams

type FinancialsGetRequestPathParams struct {
	BusinessID int
	From       time.Time
	To         time.Time
}

func (*FinancialsGetRequestPathParams) Params

type FinancialsGetRequestQueryParams

type FinancialsGetRequestQueryParams struct {
	Include       Includes `schema:"include,omitempty"`
	PageSize      int      `schema:"pageSize,omitempty"`
	NextPageToken string   `schema:"nextPageToken,omitempty"`
}

func (FinancialsGetRequestQueryParams) ToURLValues

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

type FinancialsGetResponseBody

type FinancialsGetResponseBody struct {
	BusinessName       string `json:"businessName"`
	BusinessLocationID int64  `json:"businessLocationId"`
	Sales              Sales  `json:"sales"`
	DataComplete       bool   `json:"dataComplete"`
	NextPageToken      string `json:"nextPageToken"`
	Links              Links  `json:"_links"`
}

type Includes

type Includes []string

func (Includes) MarshalSchema

func (i Includes) MarshalSchema() string
type Links struct {
	Self struct {
		Href      string `json:"href"`
		Templated bool   `json:"templated"`
	} `json:"self"`
	NextPage struct {
		Href string `json:"href"`
	} `json:"nextPage"`
}

type Number

type Number float64

func (Number) MarshalJSON

func (i Number) MarshalJSON() ([]byte, error)

func (*Number) UnmarshalJSON

func (i *Number) UnmarshalJSON(data []byte) error

type Oauth2Config

type Oauth2Config struct {
	oauth2.Config
}

func NewOauth2Config

func NewOauth2Config() *Oauth2Config

type PathParams

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

type Payment

type Payment struct {
	Code             string `json:"code"`
	Description      string `json:"description"`
	PaymentMethodID  int    `json:"paymentMethodId"`
	NetAmountWithTax Number `json:"netAmountWithTax"`
	Currency         string `json:"currency"`
	Tip              Number `json:"tip"`
	Type             string `json:"type"`
	DeviceID         int    `json:"deviceId"`
	DeviceName       string `json:"deviceName"`
}

type PaymentMethod

type PaymentMethod struct {
	Name                string `json:"name"`
	Code                string `json:"code"`
	PmID                int64  `json:"pmId"`
	AccountingReference string `json:"accountingReference,omitempty"`
}

type PaymentMethodList

type PaymentMethodList []PaymentMethod

type PaymentMethodsGetRequest

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

func (*PaymentMethodsGetRequest) Do

func (*PaymentMethodsGetRequest) Method

func (r *PaymentMethodsGetRequest) Method() string

func (PaymentMethodsGetRequest) NewPathParams

func (PaymentMethodsGetRequest) NewQueryParams

func (PaymentMethodsGetRequest) NewRequestBody

func (*PaymentMethodsGetRequest) NewResponseBody

func (*PaymentMethodsGetRequest) PathParams

func (*PaymentMethodsGetRequest) PathParamsInterface

func (r *PaymentMethodsGetRequest) PathParamsInterface() PathParams

func (*PaymentMethodsGetRequest) QueryParams

func (*PaymentMethodsGetRequest) RequestBody

func (*PaymentMethodsGetRequest) RequestBodyInterface

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

func (*PaymentMethodsGetRequest) SetMethod

func (r *PaymentMethodsGetRequest) SetMethod(method string)

func (*PaymentMethodsGetRequest) SetRequestBody

func (*PaymentMethodsGetRequest) URL

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

type PaymentMethodsGetRequestBody

type PaymentMethodsGetRequestBody struct {
}

type PaymentMethodsGetRequestPathParams

type PaymentMethodsGetRequestPathParams struct {
	BusinessID int
}

func (*PaymentMethodsGetRequestPathParams) Params

type PaymentMethodsGetRequestQueryParams

type PaymentMethodsGetRequestQueryParams struct {
	Date             Date     `schema:"date,omitempty"`
	IncludeConsumers bool     `schema:"includeConsumers,omitempty"`
	Include          Includes `schema:"include,omitempty"`
}

func (PaymentMethodsGetRequestQueryParams) ToURLValues

type PaymentMethodsGetResponseBody

type PaymentMethodsGetResponseBody struct {
	Embedded struct {
		PaymentMethodList PaymentMethodList `json:"paymentMethodList"`
	} `json:"_embedded"`
	Links Links `json:"_links"`
}

type Payments

type Payments []Payment

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 Sale

type Sale struct {
	AccountReference string `json:"accountReference"`
	AccountFiscID    string `json:"accountFiscId"`
	Source           struct {
		InitialAccountID  string `json:"initialAccountId"`
		PreviousAccountID string `json:"previousAccountId"`
	} `json:"source,omitempty"`
	SalesLines []struct {
		ID                       string `json:"id"`
		TotalNetAmountWithTax    Number `json:"totalNetAmountWithTax"`
		TotalNetAmountWithoutTax Number `json:"totalNetAmountWithoutTax"`
		MenuListPrice            Number `json:"menuListPrice"`
		UnitCostPrice            Number `json:"unitCostPrice"`
		ServiceCharge            Number `json:"serviceCharge"`
		ServiceChargeRate        Number `json:"serviceChargeRate"`
		DiscountAmount           Number `json:"discountAmount"`
		TaxAmount                Number `json:"taxAmount"`
		DiscountType             string `json:"discountType"`
		DiscountCode             string `json:"discountCode"`
		DiscountName             string `json:"discountName"`
		AccountDiscountAmount    Number `json:"accountDiscountAmount"`
		TotalDiscountAmount      Number `json:"totalDiscountAmount"`
		AccountDiscountType      string `json:"accountDiscountType"`
		AccountDiscountCode      string `json:"accountDiscountCode"`
		AccountDiscountName      string `json:"accountDiscountName"`
		Sku                      string `json:"sku"`
		Name                     string `json:"name"`
		StatisticGroup           string `json:"statisticGroup"`
		Quantity                 Number `json:"quantity"`
		TaxRatePercentage        Number `json:"taxRatePercentage"`
		AccountingGroup          struct {
			AccountingGroupID int64  `json:"accountingGroupId"`
			Name              string `json:"name"`
			Code              string `json:"code"`
		} `json:"accountingGroup"`
		Currency   string        `json:"currency"`
		Tags       []interface{} `json:"tags"`
		Categories []struct {
			Category string `json:"category"`
			Value    string `json:"value"`
		} `json:"categories"`
		TimeOfSale   time.Time `json:"timeOfSale"`
		DeviceID     int       `json:"deviceId"`
		DeviceName   string    `json:"deviceName"`
		VoidReason   string    `json:"voidReason"`
		ParentLineID string    `json:"parentLineId,omitempty"`
	} `json:"salesLines"`
	Payments           Payments  `json:"payments"`
	TimeOfOpening      time.Time `json:"timeOfOpening"`
	TimeOfCloseAndPaid time.Time `json:"timeOfCloseAndPaid"`
	TableName          string    `json:"tableName"`
	Type               string    `json:"type"`
	ExternalReferences []string  `json:"externalReferences,omitempty"`
	NbCovers           float64   `json:"nbCovers"`
	DineIn             bool      `json:"dineIn"`
	DeviceID           int       `json:"deviceId"`
	DeviceName         string    `json:"deviceName"`
	VoidReason         string    `json:"voidReason"`
	ReceiptID          string    `json:"receiptId,omitempty"`
}

type Sales

type Sales []Sale

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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