lib/api/metrc-gw/metrc_gw_client/sales/sales_client.go

654 lines
23 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
// All Code Copyright(c) 2018-2021 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package sales
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
)
// New creates a new sales API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
return &Client{transport: transport, formats: formats}
}
/*
Client for sales API
*/
type Client struct {
transport runtime.ClientTransport
formats strfmt.Registry
}
// ClientOption is the option for Client methods
type ClientOption func(*runtime.ClientOperation)
// ClientService is the interface for Client methods
type ClientService interface {
DeleteSalesDelivery(params *DeleteSalesDeliveryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteSalesDeliveryOK, error)
DeleteSalesReceipts(params *DeleteSalesReceiptsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteSalesReceiptsOK, error)
GetCustomerTypes(params *GetCustomerTypesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCustomerTypesOK, error)
GetSalesDeliveries(params *GetSalesDeliveriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSalesDeliveriesOK, error)
GetSalesDeliveryReturnReasons(params *GetSalesDeliveryReturnReasonsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSalesDeliveryReturnReasonsOK, error)
GetSalesReceipts(params *GetSalesReceiptsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSalesReceiptsOK, error)
GetSalesTransactionDates(params *GetSalesTransactionDatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSalesTransactionDatesOK, error)
GetSalesTransactions(params *GetSalesTransactionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSalesTransactionsOK, error)
PostSalesDeliveries(params *PostSalesDeliveriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostSalesDeliveriesOK, error)
PostSalesReceipts(params *PostSalesReceiptsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostSalesReceiptsOK, error)
PostSalesTransactions(params *PostSalesTransactionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostSalesTransactionsOK, error)
PutSalesDeliveries(params *PutSalesDeliveriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutSalesDeliveriesOK, error)
PutSalesReceipts(params *PutSalesReceiptsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutSalesReceiptsOK, error)
PutSalesTransactions(params *PutSalesTransactionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutSalesTransactionsOK, error)
SetTransport(transport runtime.ClientTransport)
}
/*
DeleteSalesDelivery sales delivery deleted for this user license
Delete a Sales Delivery for this User-License
*/
func (a *Client) DeleteSalesDelivery(params *DeleteSalesDeliveryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteSalesDeliveryOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewDeleteSalesDeliveryParams()
}
op := &runtime.ClientOperation{
ID: "deleteSalesDelivery",
Method: "DELETE",
PathPattern: "/sales/deliveries",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &DeleteSalesDeliveryReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*DeleteSalesDeliveryOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for deleteSalesDelivery: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
DeleteSalesReceipts sales receipts for this user license
Delete a Sales Receipt for this User-License
*/
func (a *Client) DeleteSalesReceipts(params *DeleteSalesReceiptsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteSalesReceiptsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewDeleteSalesReceiptsParams()
}
op := &runtime.ClientOperation{
ID: "deleteSalesReceipts",
Method: "DELETE",
PathPattern: "/sales/receipts",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &DeleteSalesReceiptsReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*DeleteSalesReceiptsOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for deleteSalesReceipts: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
GetCustomerTypes customers types for user
Get Customer Types for this User
*/
func (a *Client) GetCustomerTypes(params *GetCustomerTypesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCustomerTypesOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetCustomerTypesParams()
}
op := &runtime.ClientOperation{
ID: "getCustomerTypes",
Method: "GET",
PathPattern: "/sales/customertypes",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &GetCustomerTypesReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*GetCustomerTypesOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for getCustomerTypes: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
GetSalesDeliveries deliveries for user license
Deliveries for this User-License
*/
func (a *Client) GetSalesDeliveries(params *GetSalesDeliveriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSalesDeliveriesOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetSalesDeliveriesParams()
}
op := &runtime.ClientOperation{
ID: "getSalesDeliveries",
Method: "GET",
PathPattern: "/sales/deliveries",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &GetSalesDeliveriesReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*GetSalesDeliveriesOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for getSalesDeliveries: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
GetSalesDeliveryReturnReasons deliveries return reasons for user license
Delivery Return Reasons for this User-License
*/
func (a *Client) GetSalesDeliveryReturnReasons(params *GetSalesDeliveryReturnReasonsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSalesDeliveryReturnReasonsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetSalesDeliveryReturnReasonsParams()
}
op := &runtime.ClientOperation{
ID: "getSalesDeliveryReturnReasons",
Method: "GET",
PathPattern: "/sales/deliveries/returnreasons",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &GetSalesDeliveryReturnReasonsReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*GetSalesDeliveryReturnReasonsOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for getSalesDeliveryReturnReasons: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
GetSalesReceipts sales receipts for user license
Sales Receipts for this User-License
*/
func (a *Client) GetSalesReceipts(params *GetSalesReceiptsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSalesReceiptsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetSalesReceiptsParams()
}
op := &runtime.ClientOperation{
ID: "getSalesReceipts",
Method: "GET",
PathPattern: "/sales/receipts",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &GetSalesReceiptsReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*GetSalesReceiptsOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for getSalesReceipts: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
GetSalesTransactionDates as list of sales transaction dates for this user license
Get A list of Sales Transaction Dates for this User-License
*/
func (a *Client) GetSalesTransactionDates(params *GetSalesTransactionDatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSalesTransactionDatesOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetSalesTransactionDatesParams()
}
op := &runtime.ClientOperation{
ID: "getSalesTransactionDates",
Method: "GET",
PathPattern: "/sales/transactiondates",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &GetSalesTransactionDatesReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*GetSalesTransactionDatesOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for getSalesTransactionDates: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
GetSalesTransactions sales receipts for user license
Sales Transactions for this User-License
*/
func (a *Client) GetSalesTransactions(params *GetSalesTransactionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSalesTransactionsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetSalesTransactionsParams()
}
op := &runtime.ClientOperation{
ID: "getSalesTransactions",
Method: "GET",
PathPattern: "/sales/transactions",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &GetSalesTransactionsReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*GetSalesTransactionsOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for getSalesTransactions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
PostSalesDeliveries creates new sales deliveries
Create new Sales Deliveries
*/
func (a *Client) PostSalesDeliveries(params *PostSalesDeliveriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostSalesDeliveriesOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPostSalesDeliveriesParams()
}
op := &runtime.ClientOperation{
ID: "postSalesDeliveries",
Method: "POST",
PathPattern: "/sales/deliveries",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PostSalesDeliveriesReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*PostSalesDeliveriesOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for postSalesDeliveries: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
PostSalesReceipts creates new sales receipts
Create new Sales Receipts
*/
func (a *Client) PostSalesReceipts(params *PostSalesReceiptsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostSalesReceiptsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPostSalesReceiptsParams()
}
op := &runtime.ClientOperation{
ID: "postSalesReceipts",
Method: "POST",
PathPattern: "/sales/receipts",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PostSalesReceiptsReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*PostSalesReceiptsOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for postSalesReceipts: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
PostSalesTransactions creates new sales transactions
Create new Sales Transactions
*/
func (a *Client) PostSalesTransactions(params *PostSalesTransactionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostSalesTransactionsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPostSalesTransactionsParams()
}
op := &runtime.ClientOperation{
ID: "postSalesTransactions",
Method: "POST",
PathPattern: "/sales/transactions",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PostSalesTransactionsReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*PostSalesTransactionsOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for postSalesTransactions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
PutSalesDeliveries creates new sales deliveries
Create new Sales Deliveries
*/
func (a *Client) PutSalesDeliveries(params *PutSalesDeliveriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutSalesDeliveriesOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPutSalesDeliveriesParams()
}
op := &runtime.ClientOperation{
ID: "putSalesDeliveries",
Method: "PUT",
PathPattern: "/sales/deliveries",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PutSalesDeliveriesReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*PutSalesDeliveriesOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for putSalesDeliveries: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
PutSalesReceipts creates new sales receipts
Create new Sales Receipts
*/
func (a *Client) PutSalesReceipts(params *PutSalesReceiptsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutSalesReceiptsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPutSalesReceiptsParams()
}
op := &runtime.ClientOperation{
ID: "putSalesReceipts",
Method: "PUT",
PathPattern: "/sales/receipts",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PutSalesReceiptsReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*PutSalesReceiptsOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for putSalesReceipts: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
PutSalesTransactions creates new sales transactions
Create new Sales Transactions
*/
func (a *Client) PutSalesTransactions(params *PutSalesTransactionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutSalesTransactionsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPutSalesTransactionsParams()
}
op := &runtime.ClientOperation{
ID: "putSalesTransactions",
Method: "PUT",
PathPattern: "/sales/transactions",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PutSalesTransactionsReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*PutSalesTransactionsOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for putSalesTransactions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
// SetTransport changes the transport on the client
func (a *Client) SetTransport(transport runtime.ClientTransport) {
a.transport = transport
}