parent
7ba47f581e
commit
cf2197e043
163
Makefile
163
Makefile
|
@ -5,104 +5,235 @@ swagger:
|
|||
# generate auth
|
||||
#
|
||||
rm -rf ./api
|
||||
mkdir -p api/v0.0.1/auth
|
||||
mkdir -p api/auth
|
||||
swagger generate client \
|
||||
--log-output=./swagger/logs/generate-auth-client.log \
|
||||
--copyright-file=./build/COPYRIGHT \
|
||||
--name=auth \
|
||||
--spec=./swagger/auth-taxnexus.yaml \
|
||||
--target=./api/v0.0.1/auth \
|
||||
--target=./api/auth \
|
||||
--client-package=auth-client \
|
||||
--model-package=auth-models \
|
||||
--principal=app.User
|
||||
#
|
||||
# generate auth0
|
||||
#
|
||||
rm -rf ./api
|
||||
mkdir -p api/auth0
|
||||
swagger generate client \
|
||||
--log-output=./swagger/logs/generate-auth0-client.log \
|
||||
--copyright-file=./build/COPYRIGHT \
|
||||
--name=auth0 \
|
||||
--spec=./swagger/auth0.yaml \
|
||||
--target=./api/auth0 \
|
||||
--client-package=auth0-client \
|
||||
--model-package=auth0-models \
|
||||
--principal=app.User
|
||||
#
|
||||
# generate blaze
|
||||
#
|
||||
mkdir api/blaze
|
||||
swagger generate client \
|
||||
--log-output=./swagger/logs/generate-blaze-client.log \
|
||||
--copyright-file=./build/COPYRIGHT \
|
||||
--name=blaze \
|
||||
--spec=./swagger/blaze-taxnexus.yaml \
|
||||
--target=./api/blaze \
|
||||
--client-package=blaze-client \
|
||||
--model-package=blaze-models \
|
||||
--principal=app.User
|
||||
#
|
||||
# generate crm
|
||||
#
|
||||
mkdir api/v0.0.1/crm
|
||||
mkdir api/crm
|
||||
swagger generate client \
|
||||
--log-output=./swagger/logs/generate-crm-client.log \
|
||||
--copyright-file=./build/COPYRIGHT \
|
||||
--name=crm \
|
||||
--spec=./swagger/crm-taxnexus.yaml \
|
||||
--target=./api/v0.0.1/crm \
|
||||
--target=./api/crm \
|
||||
--client-package=crm-client \
|
||||
--model-package=crm-models \
|
||||
--principal=app.User
|
||||
#
|
||||
# generate devops
|
||||
#
|
||||
mkdir api/v0.0.1/devops
|
||||
mkdir api/devops
|
||||
swagger generate client \
|
||||
--log-output=./swagger/logs/generate-devops-client.log \
|
||||
--copyright-file=./build/COPYRIGHT \
|
||||
--name=devops \
|
||||
--spec=./swagger/devops-taxnexus.yaml \
|
||||
--target=./api/v0.0.1/devops \
|
||||
--target=./api/devops \
|
||||
--client-package=devops-client \
|
||||
--model-package=devops-models \
|
||||
--principal=app.User
|
||||
#
|
||||
# generate geo
|
||||
#
|
||||
mkdir api/v0.0.1/geo
|
||||
mkdir api/geo
|
||||
swagger generate client \
|
||||
--log-output=./swagger/logs/generate-geo-client.log \
|
||||
--copyright-file=./build/COPYRIGHT \
|
||||
--name=geo \
|
||||
--spec=./swagger/geo-taxnexus.yaml \
|
||||
--target=./api/v0.0.1/geo \
|
||||
--target=./api/geo \
|
||||
--client-package=geo-client \
|
||||
--model-package=geo-models \
|
||||
--principal=app.User
|
||||
#
|
||||
# generate gov-gw
|
||||
#
|
||||
mkdir api/gov-gw
|
||||
swagger generate client \
|
||||
--log-output=./swagger/logs/generate-gov-gw-client.log \
|
||||
--copyright-file=./build/COPYRIGHT \
|
||||
--name=gov-gw \
|
||||
--spec=./swagger/gov-gw-taxnexus.yaml \
|
||||
--target=./api/gov-gw \
|
||||
--client-package=gov-gw-client \
|
||||
--model-package=gov-gw-models \
|
||||
--principal=app.User
|
||||
#
|
||||
# generate ledger
|
||||
#
|
||||
mkdir api/v0.0.1/ledger
|
||||
mkdir api/ledger
|
||||
swagger generate client \
|
||||
--log-output=./swagger/logs/generate-ledger-client.log \
|
||||
--copyright-file=./build/COPYRIGHT \
|
||||
--name=ledger \
|
||||
--spec=./swagger/ledger-taxnexus.yaml \
|
||||
--target=./api/v0.0.1/ledger \
|
||||
--target=./api/ledger \
|
||||
--client-package=ledger-client \
|
||||
--model-package=ledger-models \
|
||||
--principal=app.User
|
||||
#
|
||||
# generate metrc-gw
|
||||
#
|
||||
mkdir api/metrc-gw
|
||||
swagger generate client \
|
||||
--log-output=./swagger/logs/generate-metrc-gw-client.log \
|
||||
--copyright-file=./build/COPYRIGHT \
|
||||
--name=metrc-gw \
|
||||
--spec=./swagger/metrc-gw-taxnexus.yaml \
|
||||
--target=./api/metrc-gw \
|
||||
--client-package=metrc-gw-client \
|
||||
--model-package=metrc-gw-models \
|
||||
--principal=app.User
|
||||
#
|
||||
# generate ops
|
||||
#
|
||||
mkdir api/v0.0.1/ops
|
||||
mkdir api/ops
|
||||
swagger generate client \
|
||||
--log-output=./swagger/logs/generate-ops-client.log \
|
||||
--copyright-file=./build/COPYRIGHT \
|
||||
--name=ops \
|
||||
--spec=./swagger/ops-taxnexus.yaml \
|
||||
--target=./api/v0.0.1/ops \
|
||||
--target=./api/ops \
|
||||
--client-package=ops-client \
|
||||
--model-package=ops-models \
|
||||
--principal=app.User
|
||||
#
|
||||
# generate pdf
|
||||
#
|
||||
mkdir api/pdf
|
||||
swagger generate client \
|
||||
--log-output=./swagger/logs/generate-pdf-client.log \
|
||||
--copyright-file=./build/COPYRIGHT \
|
||||
--name=pdf \
|
||||
--spec=./swagger/pdf-taxnexus.yaml \
|
||||
--target=./api/pdf \
|
||||
--client-package=pdf-client \
|
||||
--model-package=pdf-models \
|
||||
--principal=app.User
|
||||
#
|
||||
# generate plex
|
||||
#
|
||||
mkdir api/plex
|
||||
swagger generate client \
|
||||
--log-output=./swagger/logs/generate-plex-client.log \
|
||||
--copyright-file=./build/COPYRIGHT \
|
||||
--name=plex \
|
||||
--spec=./swagger/plex-taxnexus.yaml \
|
||||
--target=./api/plex \
|
||||
--client-package=plex-client \
|
||||
--model-package=plex-models \
|
||||
--principal=app.User
|
||||
#
|
||||
# generate regs
|
||||
#
|
||||
mkdir api/v0.0.1/regs
|
||||
mkdir api/regs
|
||||
swagger generate client \
|
||||
--log-output=./swagger/logs/generate-regs-client.log \
|
||||
--copyright-file=./build/COPYRIGHT \
|
||||
--name=regs \
|
||||
--spec=./swagger/regs-taxnexus.yaml \
|
||||
--target=./api/v0.0.1/regs \
|
||||
--target=./api/regs \
|
||||
--client-package=regs-client \
|
||||
--model-package=regs-models \
|
||||
--principal=app.User
|
||||
#
|
||||
# generate render
|
||||
#
|
||||
mkdir api/render
|
||||
swagger generate client \
|
||||
--log-output=./swagger/logs/generate-render-client.log \
|
||||
--copyright-file=./build/COPYRIGHT \
|
||||
--name=render \
|
||||
--spec=./swagger/render-taxnexus.yaml \
|
||||
--target=./api/render \
|
||||
--client-package=render-client \
|
||||
--model-package=render-models \
|
||||
--principal=app.User
|
||||
#
|
||||
# generate sf-gate
|
||||
#
|
||||
mkdir api/sf-gate
|
||||
swagger generate client \
|
||||
--log-output=./swagger/logs/generate-sf-gate-client.log \
|
||||
--copyright-file=./build/COPYRIGHT \
|
||||
--name=sf-gate \
|
||||
--spec=./swagger/sf-gate-taxnexus.yaml \
|
||||
--target=./api/sf-gate \
|
||||
--client-package=sf-gate-client \
|
||||
--model-package=sf-gate-models \
|
||||
--principal=app.User
|
||||
#
|
||||
# generate stash
|
||||
#
|
||||
mkdir api/stash
|
||||
swagger generate client \
|
||||
--log-output=./swagger/logs/generate-stash-client.log \
|
||||
--copyright-file=./build/COPYRIGHT \
|
||||
--name=stash \
|
||||
--spec=./swagger/stash-taxnexus.yaml \
|
||||
--target=./api/stash \
|
||||
--client-package=stash-client \
|
||||
--model-package=stash-models \
|
||||
--principal=app.User
|
||||
#
|
||||
# generate vendor-gw
|
||||
#
|
||||
mkdir api/vendor-gw
|
||||
swagger generate client \
|
||||
--log-output=./swagger/logs/generate-vendor-gw-client.log \
|
||||
--copyright-file=./build/COPYRIGHT \
|
||||
--name=vendor-gw \
|
||||
--spec=./swagger/vendor-gw-taxnexus.yaml \
|
||||
--target=./api/vendor-gw \
|
||||
--client-package=vendor-gw-client \
|
||||
--model-package=vendor-gw-models \
|
||||
--principal=app.User
|
||||
#
|
||||
# generate workflow
|
||||
#
|
||||
mkdir api/v0.0.1/workflow
|
||||
mkdir api/workflow
|
||||
swagger generate client \
|
||||
--log-output=./swagger/logs/generate-workflow-client.log \
|
||||
--copyright-file=./build/COPYRIGHT \
|
||||
--name=workflow \
|
||||
--spec=./swagger/workflow-taxnexus.yaml \
|
||||
--target=./api/v0.0.1/workflow \
|
||||
--target=./api/workflow \
|
||||
--client-package=workflow-client \
|
||||
--model-package=workflow-models \
|
||||
--principal=app.User
|
||||
|
|
|
@ -0,0 +1,78 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package auth
|
||||
|
||||
// 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 auth API client.
|
||||
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
|
||||
return &Client{transport: transport, formats: formats}
|
||||
}
|
||||
|
||||
/*
|
||||
Client for auth API
|
||||
*/
|
||||
type Client struct {
|
||||
transport runtime.ClientTransport
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ClientService is the interface for Client methods
|
||||
type ClientService interface {
|
||||
PostCredentials(params *PostCredentialsParams) (*PostCredentialsOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
||||
/*
|
||||
PostCredentials posts to oauth token
|
||||
|
||||
Get credential token
|
||||
*/
|
||||
func (a *Client) PostCredentials(params *PostCredentialsParams) (*PostCredentialsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPostCredentialsParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "postCredentials",
|
||||
Method: "POST",
|
||||
PathPattern: "/oauth/token",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"https"},
|
||||
Params: params,
|
||||
Reader: &PostCredentialsReader{formats: a.formats},
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*PostCredentialsOK)
|
||||
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 postCredentials: 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
|
||||
}
|
|
@ -0,0 +1,142 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package auth
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/taxnexus/go/lib/api/auth0/auth0_models"
|
||||
)
|
||||
|
||||
// NewPostCredentialsParams creates a new PostCredentialsParams object
|
||||
// with the default values initialized.
|
||||
func NewPostCredentialsParams() *PostCredentialsParams {
|
||||
var ()
|
||||
return &PostCredentialsParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostCredentialsParamsWithTimeout creates a new PostCredentialsParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewPostCredentialsParamsWithTimeout(timeout time.Duration) *PostCredentialsParams {
|
||||
var ()
|
||||
return &PostCredentialsParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostCredentialsParamsWithContext creates a new PostCredentialsParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewPostCredentialsParamsWithContext(ctx context.Context) *PostCredentialsParams {
|
||||
var ()
|
||||
return &PostCredentialsParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostCredentialsParamsWithHTTPClient creates a new PostCredentialsParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewPostCredentialsParamsWithHTTPClient(client *http.Client) *PostCredentialsParams {
|
||||
var ()
|
||||
return &PostCredentialsParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*PostCredentialsParams contains all the parameters to send to the API endpoint
|
||||
for the post credentials operation typically these are written to a http.Request
|
||||
*/
|
||||
type PostCredentialsParams struct {
|
||||
|
||||
/*CredentialsRequest
|
||||
Get Authentation Token
|
||||
|
||||
*/
|
||||
CredentialsRequest *auth0_models.CredentialsRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the post credentials params
|
||||
func (o *PostCredentialsParams) WithTimeout(timeout time.Duration) *PostCredentialsParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the post credentials params
|
||||
func (o *PostCredentialsParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the post credentials params
|
||||
func (o *PostCredentialsParams) WithContext(ctx context.Context) *PostCredentialsParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the post credentials params
|
||||
func (o *PostCredentialsParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the post credentials params
|
||||
func (o *PostCredentialsParams) WithHTTPClient(client *http.Client) *PostCredentialsParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the post credentials params
|
||||
func (o *PostCredentialsParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithCredentialsRequest adds the credentialsRequest to the post credentials params
|
||||
func (o *PostCredentialsParams) WithCredentialsRequest(credentialsRequest *auth0_models.CredentialsRequest) *PostCredentialsParams {
|
||||
o.SetCredentialsRequest(credentialsRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetCredentialsRequest adds the credentialsRequest to the post credentials params
|
||||
func (o *PostCredentialsParams) SetCredentialsRequest(credentialsRequest *auth0_models.CredentialsRequest) {
|
||||
o.CredentialsRequest = credentialsRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PostCredentialsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if o.CredentialsRequest != nil {
|
||||
if err := r.SetBodyParam(o.CredentialsRequest); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,268 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package auth
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/taxnexus/go/lib/api/auth0/auth0_models"
|
||||
)
|
||||
|
||||
// PostCredentialsReader is a Reader for the PostCredentials structure.
|
||||
type PostCredentialsReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PostCredentialsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPostCredentialsOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewPostCredentialsUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewPostCredentialsForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewPostCredentialsNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewPostCredentialsUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewPostCredentialsInternalServerError()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostCredentialsOK creates a PostCredentialsOK with default headers values
|
||||
func NewPostCredentialsOK() *PostCredentialsOK {
|
||||
return &PostCredentialsOK{}
|
||||
}
|
||||
|
||||
/*PostCredentialsOK handles this case with default header values.
|
||||
|
||||
Credentials response from Auth0
|
||||
*/
|
||||
type PostCredentialsOK struct {
|
||||
Payload *auth0_models.CredentialsResponse
|
||||
}
|
||||
|
||||
func (o *PostCredentialsOK) Error() string {
|
||||
return fmt.Sprintf("[POST /oauth/token][%d] postCredentialsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCredentialsOK) GetPayload() *auth0_models.CredentialsResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostCredentialsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(auth0_models.CredentialsResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostCredentialsUnauthorized creates a PostCredentialsUnauthorized with default headers values
|
||||
func NewPostCredentialsUnauthorized() *PostCredentialsUnauthorized {
|
||||
return &PostCredentialsUnauthorized{}
|
||||
}
|
||||
|
||||
/*PostCredentialsUnauthorized handles this case with default header values.
|
||||
|
||||
Access Unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type PostCredentialsUnauthorized struct {
|
||||
Payload *auth0_models.Error
|
||||
}
|
||||
|
||||
func (o *PostCredentialsUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[POST /oauth/token][%d] postCredentialsUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCredentialsUnauthorized) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostCredentialsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(auth0_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostCredentialsForbidden creates a PostCredentialsForbidden with default headers values
|
||||
func NewPostCredentialsForbidden() *PostCredentialsForbidden {
|
||||
return &PostCredentialsForbidden{}
|
||||
}
|
||||
|
||||
/*PostCredentialsForbidden handles this case with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type PostCredentialsForbidden struct {
|
||||
Payload *auth0_models.Error
|
||||
}
|
||||
|
||||
func (o *PostCredentialsForbidden) Error() string {
|
||||
return fmt.Sprintf("[POST /oauth/token][%d] postCredentialsForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCredentialsForbidden) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostCredentialsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(auth0_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostCredentialsNotFound creates a PostCredentialsNotFound with default headers values
|
||||
func NewPostCredentialsNotFound() *PostCredentialsNotFound {
|
||||
return &PostCredentialsNotFound{}
|
||||
}
|
||||
|
||||
/*PostCredentialsNotFound handles this case with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type PostCredentialsNotFound struct {
|
||||
Payload *auth0_models.Error
|
||||
}
|
||||
|
||||
func (o *PostCredentialsNotFound) Error() string {
|
||||
return fmt.Sprintf("[POST /oauth/token][%d] postCredentialsNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCredentialsNotFound) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostCredentialsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(auth0_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostCredentialsUnprocessableEntity creates a PostCredentialsUnprocessableEntity with default headers values
|
||||
func NewPostCredentialsUnprocessableEntity() *PostCredentialsUnprocessableEntity {
|
||||
return &PostCredentialsUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*PostCredentialsUnprocessableEntity handles this case with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type PostCredentialsUnprocessableEntity struct {
|
||||
Payload *auth0_models.Error
|
||||
}
|
||||
|
||||
func (o *PostCredentialsUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[POST /oauth/token][%d] postCredentialsUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCredentialsUnprocessableEntity) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostCredentialsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(auth0_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostCredentialsInternalServerError creates a PostCredentialsInternalServerError with default headers values
|
||||
func NewPostCredentialsInternalServerError() *PostCredentialsInternalServerError {
|
||||
return &PostCredentialsInternalServerError{}
|
||||
}
|
||||
|
||||
/*PostCredentialsInternalServerError handles this case with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type PostCredentialsInternalServerError struct {
|
||||
Payload *auth0_models.Error
|
||||
}
|
||||
|
||||
func (o *PostCredentialsInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[POST /oauth/token][%d] postCredentialsInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCredentialsInternalServerError) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostCredentialsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(auth0_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,126 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package auth0_client
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"github.com/go-openapi/runtime"
|
||||
httptransport "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/taxnexus/go/lib/api/auth0/auth0_client/auth"
|
||||
"github.com/taxnexus/go/lib/api/auth0/auth0_client/role"
|
||||
"github.com/taxnexus/go/lib/api/auth0/auth0_client/user"
|
||||
)
|
||||
|
||||
// Default auth0 HTTP client.
|
||||
var Default = NewHTTPClient(nil)
|
||||
|
||||
const (
|
||||
// DefaultHost is the default Host
|
||||
// found in Meta (info) section of spec file
|
||||
DefaultHost string = "taxnexus.auth0.com"
|
||||
// DefaultBasePath is the default BasePath
|
||||
// found in Meta (info) section of spec file
|
||||
DefaultBasePath string = "/"
|
||||
)
|
||||
|
||||
// DefaultSchemes are the default schemes found in Meta (info) section of spec file
|
||||
var DefaultSchemes = []string{"https"}
|
||||
|
||||
// NewHTTPClient creates a new auth0 HTTP client.
|
||||
func NewHTTPClient(formats strfmt.Registry) *Auth0 {
|
||||
return NewHTTPClientWithConfig(formats, nil)
|
||||
}
|
||||
|
||||
// NewHTTPClientWithConfig creates a new auth0 HTTP client,
|
||||
// using a customizable transport config.
|
||||
func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Auth0 {
|
||||
// ensure nullable parameters have default
|
||||
if cfg == nil {
|
||||
cfg = DefaultTransportConfig()
|
||||
}
|
||||
|
||||
// create transport and client
|
||||
transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes)
|
||||
return New(transport, formats)
|
||||
}
|
||||
|
||||
// New creates a new auth0 client
|
||||
func New(transport runtime.ClientTransport, formats strfmt.Registry) *Auth0 {
|
||||
// ensure nullable parameters have default
|
||||
if formats == nil {
|
||||
formats = strfmt.Default
|
||||
}
|
||||
|
||||
cli := new(Auth0)
|
||||
cli.Transport = transport
|
||||
cli.Auth = auth.New(transport, formats)
|
||||
cli.Role = role.New(transport, formats)
|
||||
cli.User = user.New(transport, formats)
|
||||
return cli
|
||||
}
|
||||
|
||||
// DefaultTransportConfig creates a TransportConfig with the
|
||||
// default settings taken from the meta section of the spec file.
|
||||
func DefaultTransportConfig() *TransportConfig {
|
||||
return &TransportConfig{
|
||||
Host: DefaultHost,
|
||||
BasePath: DefaultBasePath,
|
||||
Schemes: DefaultSchemes,
|
||||
}
|
||||
}
|
||||
|
||||
// TransportConfig contains the transport related info,
|
||||
// found in the meta section of the spec file.
|
||||
type TransportConfig struct {
|
||||
Host string
|
||||
BasePath string
|
||||
Schemes []string
|
||||
}
|
||||
|
||||
// WithHost overrides the default host,
|
||||
// provided by the meta section of the spec file.
|
||||
func (cfg *TransportConfig) WithHost(host string) *TransportConfig {
|
||||
cfg.Host = host
|
||||
return cfg
|
||||
}
|
||||
|
||||
// WithBasePath overrides the default basePath,
|
||||
// provided by the meta section of the spec file.
|
||||
func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig {
|
||||
cfg.BasePath = basePath
|
||||
return cfg
|
||||
}
|
||||
|
||||
// WithSchemes overrides the default schemes,
|
||||
// provided by the meta section of the spec file.
|
||||
func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig {
|
||||
cfg.Schemes = schemes
|
||||
return cfg
|
||||
}
|
||||
|
||||
// Auth0 is a client for auth0
|
||||
type Auth0 struct {
|
||||
Auth auth.ClientService
|
||||
|
||||
Role role.ClientService
|
||||
|
||||
User user.ClientService
|
||||
|
||||
Transport runtime.ClientTransport
|
||||
}
|
||||
|
||||
// SetTransport changes the transport on the client and all its subresources
|
||||
func (c *Auth0) SetTransport(transport runtime.ClientTransport) {
|
||||
c.Transport = transport
|
||||
c.Auth.SetTransport(transport)
|
||||
c.Role.SetTransport(transport)
|
||||
c.User.SetTransport(transport)
|
||||
}
|
|
@ -0,0 +1,136 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package role
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// NewGetRolesParams creates a new GetRolesParams object
|
||||
// with the default values initialized.
|
||||
func NewGetRolesParams() *GetRolesParams {
|
||||
var ()
|
||||
return &GetRolesParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetRolesParamsWithTimeout creates a new GetRolesParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewGetRolesParamsWithTimeout(timeout time.Duration) *GetRolesParams {
|
||||
var ()
|
||||
return &GetRolesParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetRolesParamsWithContext creates a new GetRolesParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewGetRolesParamsWithContext(ctx context.Context) *GetRolesParams {
|
||||
var ()
|
||||
return &GetRolesParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetRolesParamsWithHTTPClient creates a new GetRolesParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewGetRolesParamsWithHTTPClient(client *http.Client) *GetRolesParams {
|
||||
var ()
|
||||
return &GetRolesParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*GetRolesParams contains all the parameters to send to the API endpoint
|
||||
for the get roles operation typically these are written to a http.Request
|
||||
*/
|
||||
type GetRolesParams struct {
|
||||
|
||||
/*Authorization*/
|
||||
Authorization string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get roles params
|
||||
func (o *GetRolesParams) WithTimeout(timeout time.Duration) *GetRolesParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get roles params
|
||||
func (o *GetRolesParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get roles params
|
||||
func (o *GetRolesParams) WithContext(ctx context.Context) *GetRolesParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get roles params
|
||||
func (o *GetRolesParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get roles params
|
||||
func (o *GetRolesParams) WithHTTPClient(client *http.Client) *GetRolesParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get roles params
|
||||
func (o *GetRolesParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithAuthorization adds the authorization to the get roles params
|
||||
func (o *GetRolesParams) WithAuthorization(authorization string) *GetRolesParams {
|
||||
o.SetAuthorization(authorization)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetAuthorization adds the authorization to the get roles params
|
||||
func (o *GetRolesParams) SetAuthorization(authorization string) {
|
||||
o.Authorization = authorization
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetRolesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
// header param Authorization
|
||||
if err := r.SetHeaderParam("Authorization", o.Authorization); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,266 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package role
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/taxnexus/go/lib/api/auth0/auth0_models"
|
||||
)
|
||||
|
||||
// GetRolesReader is a Reader for the GetRoles structure.
|
||||
type GetRolesReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetRolesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetRolesOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewGetRolesUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewGetRolesForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewGetRolesNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewGetRolesUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewGetRolesInternalServerError()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetRolesOK creates a GetRolesOK with default headers values
|
||||
func NewGetRolesOK() *GetRolesOK {
|
||||
return &GetRolesOK{}
|
||||
}
|
||||
|
||||
/*GetRolesOK handles this case with default header values.
|
||||
|
||||
Taxnexus Response with User objects
|
||||
*/
|
||||
type GetRolesOK struct {
|
||||
Payload []*auth0_models.User
|
||||
}
|
||||
|
||||
func (o *GetRolesOK) Error() string {
|
||||
return fmt.Sprintf("[GET /api/v2/roles][%d] getRolesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetRolesOK) GetPayload() []*auth0_models.User {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetRolesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetRolesUnauthorized creates a GetRolesUnauthorized with default headers values
|
||||
func NewGetRolesUnauthorized() *GetRolesUnauthorized {
|
||||
return &GetRolesUnauthorized{}
|
||||
}
|
||||
|
||||
/*GetRolesUnauthorized handles this case with default header values.
|
||||
|
||||
Access Unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type GetRolesUnauthorized struct {
|
||||
Payload *auth0_models.Error
|
||||
}
|
||||
|
||||
func (o *GetRolesUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /api/v2/roles][%d] getRolesUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetRolesUnauthorized) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetRolesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(auth0_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetRolesForbidden creates a GetRolesForbidden with default headers values
|
||||
func NewGetRolesForbidden() *GetRolesForbidden {
|
||||
return &GetRolesForbidden{}
|
||||
}
|
||||
|
||||
/*GetRolesForbidden handles this case with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type GetRolesForbidden struct {
|
||||
Payload *auth0_models.Error
|
||||
}
|
||||
|
||||
func (o *GetRolesForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /api/v2/roles][%d] getRolesForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetRolesForbidden) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetRolesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(auth0_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetRolesNotFound creates a GetRolesNotFound with default headers values
|
||||
func NewGetRolesNotFound() *GetRolesNotFound {
|
||||
return &GetRolesNotFound{}
|
||||
}
|
||||
|
||||
/*GetRolesNotFound handles this case with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type GetRolesNotFound struct {
|
||||
Payload *auth0_models.Error
|
||||
}
|
||||
|
||||
func (o *GetRolesNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /api/v2/roles][%d] getRolesNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetRolesNotFound) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetRolesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(auth0_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetRolesUnprocessableEntity creates a GetRolesUnprocessableEntity with default headers values
|
||||
func NewGetRolesUnprocessableEntity() *GetRolesUnprocessableEntity {
|
||||
return &GetRolesUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*GetRolesUnprocessableEntity handles this case with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type GetRolesUnprocessableEntity struct {
|
||||
Payload *auth0_models.Error
|
||||
}
|
||||
|
||||
func (o *GetRolesUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[GET /api/v2/roles][%d] getRolesUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetRolesUnprocessableEntity) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetRolesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(auth0_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetRolesInternalServerError creates a GetRolesInternalServerError with default headers values
|
||||
func NewGetRolesInternalServerError() *GetRolesInternalServerError {
|
||||
return &GetRolesInternalServerError{}
|
||||
}
|
||||
|
||||
/*GetRolesInternalServerError handles this case with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type GetRolesInternalServerError struct {
|
||||
Payload *auth0_models.Error
|
||||
}
|
||||
|
||||
func (o *GetRolesInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /api/v2/roles][%d] getRolesInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetRolesInternalServerError) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetRolesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(auth0_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,181 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package role
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/taxnexus/go/lib/api/auth0/auth0_models"
|
||||
)
|
||||
|
||||
// NewPostRoleUsersParams creates a new PostRoleUsersParams object
|
||||
// with the default values initialized.
|
||||
func NewPostRoleUsersParams() *PostRoleUsersParams {
|
||||
var ()
|
||||
return &PostRoleUsersParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostRoleUsersParamsWithTimeout creates a new PostRoleUsersParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewPostRoleUsersParamsWithTimeout(timeout time.Duration) *PostRoleUsersParams {
|
||||
var ()
|
||||
return &PostRoleUsersParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostRoleUsersParamsWithContext creates a new PostRoleUsersParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewPostRoleUsersParamsWithContext(ctx context.Context) *PostRoleUsersParams {
|
||||
var ()
|
||||
return &PostRoleUsersParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostRoleUsersParamsWithHTTPClient creates a new PostRoleUsersParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewPostRoleUsersParamsWithHTTPClient(client *http.Client) *PostRoleUsersParams {
|
||||
var ()
|
||||
return &PostRoleUsersParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*PostRoleUsersParams contains all the parameters to send to the API endpoint
|
||||
for the post role users operation typically these are written to a http.Request
|
||||
*/
|
||||
type PostRoleUsersParams struct {
|
||||
|
||||
/*Authorization*/
|
||||
Authorization string
|
||||
/*RoleUsersRequest
|
||||
An array of User IDs to add to a Role
|
||||
|
||||
*/
|
||||
RoleUsersRequest *auth0_models.RoleUsersRequest
|
||||
/*RoleID
|
||||
An Auth0 Role ID
|
||||
|
||||
*/
|
||||
RoleID string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the post role users params
|
||||
func (o *PostRoleUsersParams) WithTimeout(timeout time.Duration) *PostRoleUsersParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the post role users params
|
||||
func (o *PostRoleUsersParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the post role users params
|
||||
func (o *PostRoleUsersParams) WithContext(ctx context.Context) *PostRoleUsersParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the post role users params
|
||||
func (o *PostRoleUsersParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the post role users params
|
||||
func (o *PostRoleUsersParams) WithHTTPClient(client *http.Client) *PostRoleUsersParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the post role users params
|
||||
func (o *PostRoleUsersParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithAuthorization adds the authorization to the post role users params
|
||||
func (o *PostRoleUsersParams) WithAuthorization(authorization string) *PostRoleUsersParams {
|
||||
o.SetAuthorization(authorization)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetAuthorization adds the authorization to the post role users params
|
||||
func (o *PostRoleUsersParams) SetAuthorization(authorization string) {
|
||||
o.Authorization = authorization
|
||||
}
|
||||
|
||||
// WithRoleUsersRequest adds the roleUsersRequest to the post role users params
|
||||
func (o *PostRoleUsersParams) WithRoleUsersRequest(roleUsersRequest *auth0_models.RoleUsersRequest) *PostRoleUsersParams {
|
||||
o.SetRoleUsersRequest(roleUsersRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetRoleUsersRequest adds the roleUsersRequest to the post role users params
|
||||
func (o *PostRoleUsersParams) SetRoleUsersRequest(roleUsersRequest *auth0_models.RoleUsersRequest) {
|
||||
o.RoleUsersRequest = roleUsersRequest
|
||||
}
|
||||
|
||||
// WithRoleID adds the roleID to the post role users params
|
||||
func (o *PostRoleUsersParams) WithRoleID(roleID string) *PostRoleUsersParams {
|
||||
o.SetRoleID(roleID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetRoleID adds the roleId to the post role users params
|
||||
func (o *PostRoleUsersParams) SetRoleID(roleID string) {
|
||||
o.RoleID = roleID
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PostRoleUsersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
// header param Authorization
|
||||
if err := r.SetHeaderParam("Authorization", o.Authorization); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if o.RoleUsersRequest != nil {
|
||||
if err := r.SetBodyParam(o.RoleUsersRequest); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// path param roleId
|
||||
if err := r.SetPathParam("roleId", o.RoleID); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,217 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package role
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/taxnexus/go/lib/api/auth0/auth0_models"
|
||||
)
|
||||
|
||||
// PostRoleUsersReader is a Reader for the PostRoleUsers structure.
|
||||
type PostRoleUsersReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PostRoleUsersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPostRoleUsersOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewPostRoleUsersUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewPostRoleUsersForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewPostRoleUsersNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewPostRoleUsersInternalServerError()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostRoleUsersOK creates a PostRoleUsersOK with default headers values
|
||||
func NewPostRoleUsersOK() *PostRoleUsersOK {
|
||||
return &PostRoleUsersOK{}
|
||||
}
|
||||
|
||||
/*PostRoleUsersOK handles this case with default header values.
|
||||
|
||||
Role users successfully updated
|
||||
*/
|
||||
type PostRoleUsersOK struct {
|
||||
}
|
||||
|
||||
func (o *PostRoleUsersOK) Error() string {
|
||||
return fmt.Sprintf("[POST /api/v2/roles/{roleId}/users][%d] postRoleUsersOK ", 200)
|
||||
}
|
||||
|
||||
func (o *PostRoleUsersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostRoleUsersUnauthorized creates a PostRoleUsersUnauthorized with default headers values
|
||||
func NewPostRoleUsersUnauthorized() *PostRoleUsersUnauthorized {
|
||||
return &PostRoleUsersUnauthorized{}
|
||||
}
|
||||
|
||||
/*PostRoleUsersUnauthorized handles this case with default header values.
|
||||
|
||||
Access Unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type PostRoleUsersUnauthorized struct {
|
||||
Payload *auth0_models.Error
|
||||
}
|
||||
|
||||
func (o *PostRoleUsersUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[POST /api/v2/roles/{roleId}/users][%d] postRoleUsersUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostRoleUsersUnauthorized) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostRoleUsersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(auth0_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostRoleUsersForbidden creates a PostRoleUsersForbidden with default headers values
|
||||
func NewPostRoleUsersForbidden() *PostRoleUsersForbidden {
|
||||
return &PostRoleUsersForbidden{}
|
||||
}
|
||||
|
||||
/*PostRoleUsersForbidden handles this case with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type PostRoleUsersForbidden struct {
|
||||
Payload *auth0_models.Error
|
||||
}
|
||||
|
||||
func (o *PostRoleUsersForbidden) Error() string {
|
||||
return fmt.Sprintf("[POST /api/v2/roles/{roleId}/users][%d] postRoleUsersForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostRoleUsersForbidden) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostRoleUsersForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(auth0_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostRoleUsersNotFound creates a PostRoleUsersNotFound with default headers values
|
||||
func NewPostRoleUsersNotFound() *PostRoleUsersNotFound {
|
||||
return &PostRoleUsersNotFound{}
|
||||
}
|
||||
|
||||
/*PostRoleUsersNotFound handles this case with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type PostRoleUsersNotFound struct {
|
||||
Payload *auth0_models.Error
|
||||
}
|
||||
|
||||
func (o *PostRoleUsersNotFound) Error() string {
|
||||
return fmt.Sprintf("[POST /api/v2/roles/{roleId}/users][%d] postRoleUsersNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostRoleUsersNotFound) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostRoleUsersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(auth0_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostRoleUsersInternalServerError creates a PostRoleUsersInternalServerError with default headers values
|
||||
func NewPostRoleUsersInternalServerError() *PostRoleUsersInternalServerError {
|
||||
return &PostRoleUsersInternalServerError{}
|
||||
}
|
||||
|
||||
/*PostRoleUsersInternalServerError handles this case with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type PostRoleUsersInternalServerError struct {
|
||||
Payload *auth0_models.Error
|
||||
}
|
||||
|
||||
func (o *PostRoleUsersInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[POST /api/v2/roles/{roleId}/users][%d] postRoleUsersInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostRoleUsersInternalServerError) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostRoleUsersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(auth0_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,116 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package role
|
||||
|
||||
// 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 role API client.
|
||||
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
|
||||
return &Client{transport: transport, formats: formats}
|
||||
}
|
||||
|
||||
/*
|
||||
Client for role API
|
||||
*/
|
||||
type Client struct {
|
||||
transport runtime.ClientTransport
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ClientService is the interface for Client methods
|
||||
type ClientService interface {
|
||||
GetRoles(params *GetRolesParams) (*GetRolesOK, error)
|
||||
|
||||
PostRoleUsers(params *PostRoleUsersParams) (*PostRoleUsersOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
||||
/*
|
||||
GetRoles gets roles from auth0
|
||||
|
||||
Get Roles from Auth0
|
||||
*/
|
||||
func (a *Client) GetRoles(params *GetRolesParams) (*GetRolesOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetRolesParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "getRoles",
|
||||
Method: "GET",
|
||||
PathPattern: "/api/v2/roles",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"https"},
|
||||
Params: params,
|
||||
Reader: &GetRolesReader{formats: a.formats},
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*GetRolesOK)
|
||||
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 getRoles: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PostRoleUsers adds users to role
|
||||
|
||||
Add users to role
|
||||
*/
|
||||
func (a *Client) PostRoleUsers(params *PostRoleUsersParams) (*PostRoleUsersOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPostRoleUsersParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "postRoleUsers",
|
||||
Method: "POST",
|
||||
PathPattern: "/api/v2/roles/{roleId}/users",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"https"},
|
||||
Params: params,
|
||||
Reader: &PostRoleUsersReader{formats: a.formats},
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*PostRoleUsersOK)
|
||||
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 postRoleUsers: 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
|
||||
}
|
|
@ -0,0 +1,181 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package user
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/taxnexus/go/lib/api/auth0/auth0_models"
|
||||
)
|
||||
|
||||
// NewDeleteAPIV2UsersUserIDRolesParams creates a new DeleteAPIV2UsersUserIDRolesParams object
|
||||
// with the default values initialized.
|
||||
func NewDeleteAPIV2UsersUserIDRolesParams() *DeleteAPIV2UsersUserIDRolesParams {
|
||||
var ()
|
||||
return &DeleteAPIV2UsersUserIDRolesParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAPIV2UsersUserIDRolesParamsWithTimeout creates a new DeleteAPIV2UsersUserIDRolesParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewDeleteAPIV2UsersUserIDRolesParamsWithTimeout(timeout time.Duration) *DeleteAPIV2UsersUserIDRolesParams {
|
||||
var ()
|
||||
return &DeleteAPIV2UsersUserIDRolesParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAPIV2UsersUserIDRolesParamsWithContext creates a new DeleteAPIV2UsersUserIDRolesParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewDeleteAPIV2UsersUserIDRolesParamsWithContext(ctx context.Context) *DeleteAPIV2UsersUserIDRolesParams {
|
||||
var ()
|
||||
return &DeleteAPIV2UsersUserIDRolesParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAPIV2UsersUserIDRolesParamsWithHTTPClient creates a new DeleteAPIV2UsersUserIDRolesParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewDeleteAPIV2UsersUserIDRolesParamsWithHTTPClient(client *http.Client) *DeleteAPIV2UsersUserIDRolesParams {
|
||||
var ()
|
||||
return &DeleteAPIV2UsersUserIDRolesParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*DeleteAPIV2UsersUserIDRolesParams contains all the parameters to send to the API endpoint
|
||||
for the delete API v2 users user ID roles operation typically these are written to a http.Request
|
||||
*/
|
||||
type DeleteAPIV2UsersUserIDRolesParams struct {
|
||||
|
||||
/*Authorization*/
|
||||
Authorization string
|
||||
/*UserRolesRequest
|
||||
An array of User IDs to add to a Role
|
||||
|
||||
*/
|
||||
UserRolesRequest *auth0_models.UserRolesRequest
|
||||
/*UserID
|
||||
An Auth0 User ID
|
||||
|
||||
*/
|
||||
UserID string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the delete API v2 users user ID roles params
|
||||
func (o *DeleteAPIV2UsersUserIDRolesParams) WithTimeout(timeout time.Duration) *DeleteAPIV2UsersUserIDRolesParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the delete API v2 users user ID roles params
|
||||
func (o *DeleteAPIV2UsersUserIDRolesParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the delete API v2 users user ID roles params
|
||||
func (o *DeleteAPIV2UsersUserIDRolesParams) WithContext(ctx context.Context) *DeleteAPIV2UsersUserIDRolesParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the delete API v2 users user ID roles params
|
||||
func (o *DeleteAPIV2UsersUserIDRolesParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the delete API v2 users user ID roles params
|
||||
func (o *DeleteAPIV2UsersUserIDRolesParams) WithHTTPClient(client *http.Client) *DeleteAPIV2UsersUserIDRolesParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the delete API v2 users user ID roles params
|
||||
func (o *DeleteAPIV2UsersUserIDRolesParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithAuthorization adds the authorization to the delete API v2 users user ID roles params
|
||||
func (o *DeleteAPIV2UsersUserIDRolesParams) WithAuthorization(authorization string) *DeleteAPIV2UsersUserIDRolesParams {
|
||||
o.SetAuthorization(authorization)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetAuthorization adds the authorization to the delete API v2 users user ID roles params
|
||||
func (o *DeleteAPIV2UsersUserIDRolesParams) SetAuthorization(authorization string) {
|
||||
o.Authorization = authorization
|
||||
}
|
||||
|
||||
// WithUserRolesRequest adds the userRolesRequest to the delete API v2 users user ID roles params
|
||||
func (o *DeleteAPIV2UsersUserIDRolesParams) WithUserRolesRequest(userRolesRequest *auth0_models.UserRolesRequest) *DeleteAPIV2UsersUserIDRolesParams {
|
||||
o.SetUserRolesRequest(userRolesRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetUserRolesRequest adds the userRolesRequest to the delete API v2 users user ID roles params
|
||||
func (o *DeleteAPIV2UsersUserIDRolesParams) SetUserRolesRequest(userRolesRequest *auth0_models.UserRolesRequest) {
|
||||
o.UserRolesRequest = userRolesRequest
|
||||
}
|
||||
|
||||
// WithUserID adds the userID to the delete API v2 users user ID roles params
|
||||
func (o *DeleteAPIV2UsersUserIDRolesParams) WithUserID(userID string) *DeleteAPIV2UsersUserIDRolesParams {
|
||||
o.SetUserID(userID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetUserID adds the userId to the delete API v2 users user ID roles params
|
||||
func (o *DeleteAPIV2UsersUserIDRolesParams) SetUserID(userID string) {
|
||||
o.UserID = userID
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *DeleteAPIV2UsersUserIDRolesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
// header param Authorization
|
||||
if err := r.SetHeaderParam("Authorization", o.Authorization); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if o.UserRolesRequest != nil {
|
||||
if err := r.SetBodyParam(o.UserRolesRequest); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// path param userId
|
||||
if err := r.SetPathParam("userId", o.UserID); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,217 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package user
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/taxnexus/go/lib/api/auth0/auth0_models"
|
||||
)
|
||||
|
||||
// DeleteAPIV2UsersUserIDRolesReader is a Reader for the DeleteAPIV2UsersUserIDRoles structure.
|
||||
type DeleteAPIV2UsersUserIDRolesReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *DeleteAPIV2UsersUserIDRolesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 204:
|
||||
result := NewDeleteAPIV2UsersUserIDRolesNoContent()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewDeleteAPIV2UsersUserIDRolesUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewDeleteAPIV2UsersUserIDRolesForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewDeleteAPIV2UsersUserIDRolesNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewDeleteAPIV2UsersUserIDRolesInternalServerError()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAPIV2UsersUserIDRolesNoContent creates a DeleteAPIV2UsersUserIDRolesNoContent with default headers values
|
||||
func NewDeleteAPIV2UsersUserIDRolesNoContent() *DeleteAPIV2UsersUserIDRolesNoContent {
|
||||
return &DeleteAPIV2UsersUserIDRolesNoContent{}
|
||||
}
|
||||
|
||||
/*DeleteAPIV2UsersUserIDRolesNoContent handles this case with default header values.
|
||||
|
||||
User roles successfully removed
|
||||
*/
|
||||
type DeleteAPIV2UsersUserIDRolesNoContent struct {
|
||||
}
|
||||
|
||||
func (o *DeleteAPIV2UsersUserIDRolesNoContent) Error() string {
|
||||
return fmt.Sprintf("[DELETE /api/v2/users/{userId}/roles][%d] deleteApiV2UsersUserIdRolesNoContent ", 204)
|
||||
}
|
||||
|
||||
func (o *DeleteAPIV2UsersUserIDRolesNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewDeleteAPIV2UsersUserIDRolesUnauthorized creates a DeleteAPIV2UsersUserIDRolesUnauthorized with default headers values
|
||||
func NewDeleteAPIV2UsersUserIDRolesUnauthorized() *DeleteAPIV2UsersUserIDRolesUnauthorized {
|
||||
return &DeleteAPIV2UsersUserIDRolesUnauthorized{}
|
||||
}
|
||||
|
||||
/*DeleteAPIV2UsersUserIDRolesUnauthorized handles this case with default header values.
|
||||
|
||||
Access Unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type DeleteAPIV2UsersUserIDRolesUnauthorized struct {
|
||||
Payload *auth0_models.Error
|
||||
}
|
||||
|
||||
func (o *DeleteAPIV2UsersUserIDRolesUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[DELETE /api/v2/users/{userId}/roles][%d] deleteApiV2UsersUserIdRolesUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAPIV2UsersUserIDRolesUnauthorized) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *DeleteAPIV2UsersUserIDRolesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(auth0_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewDeleteAPIV2UsersUserIDRolesForbidden creates a DeleteAPIV2UsersUserIDRolesForbidden with default headers values
|
||||
func NewDeleteAPIV2UsersUserIDRolesForbidden() *DeleteAPIV2UsersUserIDRolesForbidden {
|
||||
return &DeleteAPIV2UsersUserIDRolesForbidden{}
|
||||
}
|
||||
|
||||
/*DeleteAPIV2UsersUserIDRolesForbidden handles this case with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type DeleteAPIV2UsersUserIDRolesForbidden struct {
|
||||
Payload *auth0_models.Error
|
||||
}
|
||||
|
||||
func (o *DeleteAPIV2UsersUserIDRolesForbidden) Error() string {
|
||||
return fmt.Sprintf("[DELETE /api/v2/users/{userId}/roles][%d] deleteApiV2UsersUserIdRolesForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAPIV2UsersUserIDRolesForbidden) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *DeleteAPIV2UsersUserIDRolesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(auth0_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewDeleteAPIV2UsersUserIDRolesNotFound creates a DeleteAPIV2UsersUserIDRolesNotFound with default headers values
|
||||
func NewDeleteAPIV2UsersUserIDRolesNotFound() *DeleteAPIV2UsersUserIDRolesNotFound {
|
||||
return &DeleteAPIV2UsersUserIDRolesNotFound{}
|
||||
}
|
||||
|
||||
/*DeleteAPIV2UsersUserIDRolesNotFound handles this case with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type DeleteAPIV2UsersUserIDRolesNotFound struct {
|
||||
Payload *auth0_models.Error
|
||||
}
|
||||
|
||||
func (o *DeleteAPIV2UsersUserIDRolesNotFound) Error() string {
|
||||
return fmt.Sprintf("[DELETE /api/v2/users/{userId}/roles][%d] deleteApiV2UsersUserIdRolesNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAPIV2UsersUserIDRolesNotFound) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *DeleteAPIV2UsersUserIDRolesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(auth0_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewDeleteAPIV2UsersUserIDRolesInternalServerError creates a DeleteAPIV2UsersUserIDRolesInternalServerError with default headers values
|
||||
func NewDeleteAPIV2UsersUserIDRolesInternalServerError() *DeleteAPIV2UsersUserIDRolesInternalServerError {
|
||||
return &DeleteAPIV2UsersUserIDRolesInternalServerError{}
|
||||
}
|
||||
|
||||
/*DeleteAPIV2UsersUserIDRolesInternalServerError handles this case with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type DeleteAPIV2UsersUserIDRolesInternalServerError struct {
|
||||
Payload *auth0_models.Error
|
||||
}
|
||||
|
||||
func (o *DeleteAPIV2UsersUserIDRolesInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[DELETE /api/v2/users/{userId}/roles][%d] deleteApiV2UsersUserIdRolesInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAPIV2UsersUserIDRolesInternalServerError) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *DeleteAPIV2UsersUserIDRolesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(auth0_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,158 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package user
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// NewGetUserByEmailParams creates a new GetUserByEmailParams object
|
||||
// with the default values initialized.
|
||||
func NewGetUserByEmailParams() *GetUserByEmailParams {
|
||||
var ()
|
||||
return &GetUserByEmailParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetUserByEmailParamsWithTimeout creates a new GetUserByEmailParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewGetUserByEmailParamsWithTimeout(timeout time.Duration) *GetUserByEmailParams {
|
||||
var ()
|
||||
return &GetUserByEmailParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetUserByEmailParamsWithContext creates a new GetUserByEmailParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewGetUserByEmailParamsWithContext(ctx context.Context) *GetUserByEmailParams {
|
||||
var ()
|
||||
return &GetUserByEmailParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetUserByEmailParamsWithHTTPClient creates a new GetUserByEmailParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewGetUserByEmailParamsWithHTTPClient(client *http.Client) *GetUserByEmailParams {
|
||||
var ()
|
||||
return &GetUserByEmailParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*GetUserByEmailParams contains all the parameters to send to the API endpoint
|
||||
for the get user by email operation typically these are written to a http.Request
|
||||
*/
|
||||
type GetUserByEmailParams struct {
|
||||
|
||||
/*Authorization*/
|
||||
Authorization string
|
||||
/*Email*/
|
||||
Email string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get user by email params
|
||||
func (o *GetUserByEmailParams) WithTimeout(timeout time.Duration) *GetUserByEmailParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get user by email params
|
||||
func (o *GetUserByEmailParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get user by email params
|
||||
func (o *GetUserByEmailParams) WithContext(ctx context.Context) *GetUserByEmailParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get user by email params
|
||||
func (o *GetUserByEmailParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get user by email params
|
||||
func (o *GetUserByEmailParams) WithHTTPClient(client *http.Client) *GetUserByEmailParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get user by email params
|
||||
func (o *GetUserByEmailParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithAuthorization adds the authorization to the get user by email params
|
||||
func (o *GetUserByEmailParams) WithAuthorization(authorization string) *GetUserByEmailParams {
|
||||
o.SetAuthorization(authorization)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetAuthorization adds the authorization to the get user by email params
|
||||
func (o *GetUserByEmailParams) SetAuthorization(authorization string) {
|
||||
o.Authorization = authorization
|
||||
}
|
||||
|
||||
// WithEmail adds the email to the get user by email params
|
||||
func (o *GetUserByEmailParams) WithEmail(email string) *GetUserByEmailParams {
|
||||
o.SetEmail(email)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetEmail adds the email to the get user by email params
|
||||
func (o *GetUserByEmailParams) SetEmail(email string) {
|
||||
o.Email = email
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetUserByEmailParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
// header param Authorization
|
||||
if err := r.SetHeaderParam("Authorization", o.Authorization); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// query param email
|
||||
qrEmail := o.Email
|
||||
qEmail := qrEmail
|
||||
if qEmail != "" {
|
||||
if err := r.SetQueryParam("email", qEmail); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,227 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package user
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/taxnexus/go/lib/api/auth0/auth0_models"
|
||||
)
|
||||
|
||||
// GetUserByEmailReader is a Reader for the GetUserByEmail structure.
|
||||
type GetUserByEmailReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetUserByEmailReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetUserByEmailOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewGetUserByEmailUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewGetUserByEmailForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewGetUserByEmailNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewGetUserByEmailInternalServerError()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetUserByEmailOK creates a GetUserByEmailOK with default headers values
|
||||
func NewGetUserByEmailOK() *GetUserByEmailOK {
|
||||
return &GetUserByEmailOK{}
|
||||
}
|
||||
|
||||
/*GetUserByEmailOK handles this case with default header values.
|
||||
|
||||
Taxnexus Response with User objects
|
||||
*/
|
||||
type GetUserByEmailOK struct {
|
||||
Payload []*auth0_models.User
|
||||
}
|
||||
|
||||
func (o *GetUserByEmailOK) Error() string {
|
||||
return fmt.Sprintf("[GET /api/v2/users-by-email][%d] getUserByEmailOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetUserByEmailOK) GetPayload() []*auth0_models.User {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetUserByEmailOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetUserByEmailUnauthorized creates a GetUserByEmailUnauthorized with default headers values
|
||||
func NewGetUserByEmailUnauthorized() *GetUserByEmailUnauthorized {
|
||||
return &GetUserByEmailUnauthorized{}
|
||||
}
|
||||
|
||||
/*GetUserByEmailUnauthorized handles this case with default header values.
|
||||
|
||||
Access Unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type GetUserByEmailUnauthorized struct {
|
||||
Payload *auth0_models.Error
|
||||
}
|
||||
|
||||
func (o *GetUserByEmailUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /api/v2/users-by-email][%d] getUserByEmailUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetUserByEmailUnauthorized) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetUserByEmailUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(auth0_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetUserByEmailForbidden creates a GetUserByEmailForbidden with default headers values
|
||||
func NewGetUserByEmailForbidden() *GetUserByEmailForbidden {
|
||||
return &GetUserByEmailForbidden{}
|
||||
}
|
||||
|
||||
/*GetUserByEmailForbidden handles this case with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type GetUserByEmailForbidden struct {
|
||||
Payload *auth0_models.Error
|
||||
}
|
||||
|
||||
func (o *GetUserByEmailForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /api/v2/users-by-email][%d] getUserByEmailForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetUserByEmailForbidden) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetUserByEmailForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(auth0_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetUserByEmailNotFound creates a GetUserByEmailNotFound with default headers values
|
||||
func NewGetUserByEmailNotFound() *GetUserByEmailNotFound {
|
||||
return &GetUserByEmailNotFound{}
|
||||
}
|
||||
|
||||
/*GetUserByEmailNotFound handles this case with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type GetUserByEmailNotFound struct {
|
||||
Payload *auth0_models.Error
|
||||
}
|
||||
|
||||
func (o *GetUserByEmailNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /api/v2/users-by-email][%d] getUserByEmailNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetUserByEmailNotFound) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetUserByEmailNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(auth0_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetUserByEmailInternalServerError creates a GetUserByEmailInternalServerError with default headers values
|
||||
func NewGetUserByEmailInternalServerError() *GetUserByEmailInternalServerError {
|
||||
return &GetUserByEmailInternalServerError{}
|
||||
}
|
||||
|
||||
/*GetUserByEmailInternalServerError handles this case with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type GetUserByEmailInternalServerError struct {
|
||||
Payload *auth0_models.Error
|
||||
}
|
||||
|
||||
func (o *GetUserByEmailInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /api/v2/users-by-email][%d] getUserByEmailInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetUserByEmailInternalServerError) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetUserByEmailInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(auth0_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,157 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package user
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// NewGetUserRolesParams creates a new GetUserRolesParams object
|
||||
// with the default values initialized.
|
||||
func NewGetUserRolesParams() *GetUserRolesParams {
|
||||
var ()
|
||||
return &GetUserRolesParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetUserRolesParamsWithTimeout creates a new GetUserRolesParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewGetUserRolesParamsWithTimeout(timeout time.Duration) *GetUserRolesParams {
|
||||
var ()
|
||||
return &GetUserRolesParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetUserRolesParamsWithContext creates a new GetUserRolesParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewGetUserRolesParamsWithContext(ctx context.Context) *GetUserRolesParams {
|
||||
var ()
|
||||
return &GetUserRolesParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetUserRolesParamsWithHTTPClient creates a new GetUserRolesParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewGetUserRolesParamsWithHTTPClient(client *http.Client) *GetUserRolesParams {
|
||||
var ()
|
||||
return &GetUserRolesParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*GetUserRolesParams contains all the parameters to send to the API endpoint
|
||||
for the get user roles operation typically these are written to a http.Request
|
||||
*/
|
||||
type GetUserRolesParams struct {
|
||||
|
||||
/*Authorization*/
|
||||
Authorization string
|
||||
/*UserID
|
||||
An Auth0 User ID
|
||||
|
||||
*/
|
||||
UserID string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get user roles params
|
||||
func (o *GetUserRolesParams) WithTimeout(timeout time.Duration) *GetUserRolesParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get user roles params
|
||||
func (o *GetUserRolesParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get user roles params
|
||||
func (o *GetUserRolesParams) WithContext(ctx context.Context) *GetUserRolesParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get user roles params
|
||||
func (o *GetUserRolesParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get user roles params
|
||||
func (o *GetUserRolesParams) WithHTTPClient(client *http.Client) *GetUserRolesParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get user roles params
|
||||
func (o *GetUserRolesParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithAuthorization adds the authorization to the get user roles params
|
||||
func (o *GetUserRolesParams) WithAuthorization(authorization string) *GetUserRolesParams {
|
||||
o.SetAuthorization(authorization)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetAuthorization adds the authorization to the get user roles params
|
||||
func (o *GetUserRolesParams) SetAuthorization(authorization string) {
|
||||
o.Authorization = authorization
|
||||
}
|
||||
|
||||
// WithUserID adds the userID to the get user roles params
|
||||
func (o *GetUserRolesParams) WithUserID(userID string) *GetUserRolesParams {
|
||||
o.SetUserID(userID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetUserID adds the userId to the get user roles params
|
||||
func (o *GetUserRolesParams) SetUserID(userID string) {
|
||||
o.UserID = userID
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetUserRolesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
// header param Authorization
|
||||
if err := r.SetHeaderParam("Authorization", o.Authorization); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// path param userId
|
||||
if err := r.SetPathParam("userId", o.UserID); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,229 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package user
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/taxnexus/go/lib/api/auth0/auth0_models"
|
||||
)
|
||||
|
||||
// GetUserRolesReader is a Reader for the GetUserRoles structure.
|
||||
type GetUserRolesReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetUserRolesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetUserRolesOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewGetUserRolesUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewGetUserRolesForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewGetUserRolesNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewGetUserRolesInternalServerError()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetUserRolesOK creates a GetUserRolesOK with default headers values
|
||||
func NewGetUserRolesOK() *GetUserRolesOK {
|
||||
return &GetUserRolesOK{}
|
||||
}
|
||||
|
||||
/*GetUserRolesOK handles this case with default header values.
|
||||
|
||||
Taxnexus Response with User objects
|
||||
*/
|
||||
type GetUserRolesOK struct {
|
||||
Payload *auth0_models.RoleResponse
|
||||
}
|
||||
|
||||
func (o *GetUserRolesOK) Error() string {
|
||||
return fmt.Sprintf("[GET /api/v2/users/{userId}/roles][%d] getUserRolesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetUserRolesOK) GetPayload() *auth0_models.RoleResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetUserRolesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(auth0_models.RoleResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetUserRolesUnauthorized creates a GetUserRolesUnauthorized with default headers values
|
||||
func NewGetUserRolesUnauthorized() *GetUserRolesUnauthorized {
|
||||
return &GetUserRolesUnauthorized{}
|
||||
}
|
||||
|
||||
/*GetUserRolesUnauthorized handles this case with default header values.
|
||||
|
||||
Access Unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type GetUserRolesUnauthorized struct {
|
||||
Payload *auth0_models.Error
|
||||
}
|
||||
|
||||
func (o *GetUserRolesUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /api/v2/users/{userId}/roles][%d] getUserRolesUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetUserRolesUnauthorized) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetUserRolesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(auth0_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetUserRolesForbidden creates a GetUserRolesForbidden with default headers values
|
||||
func NewGetUserRolesForbidden() *GetUserRolesForbidden {
|
||||
return &GetUserRolesForbidden{}
|
||||
}
|
||||
|
||||
/*GetUserRolesForbidden handles this case with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type GetUserRolesForbidden struct {
|
||||
Payload *auth0_models.Error
|
||||
}
|
||||
|
||||
func (o *GetUserRolesForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /api/v2/users/{userId}/roles][%d] getUserRolesForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetUserRolesForbidden) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetUserRolesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(auth0_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetUserRolesNotFound creates a GetUserRolesNotFound with default headers values
|
||||
func NewGetUserRolesNotFound() *GetUserRolesNotFound {
|
||||
return &GetUserRolesNotFound{}
|
||||
}
|
||||
|
||||
/*GetUserRolesNotFound handles this case with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type GetUserRolesNotFound struct {
|
||||
Payload *auth0_models.Error
|
||||
}
|
||||
|
||||
func (o *GetUserRolesNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /api/v2/users/{userId}/roles][%d] getUserRolesNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetUserRolesNotFound) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetUserRolesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(auth0_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetUserRolesInternalServerError creates a GetUserRolesInternalServerError with default headers values
|
||||
func NewGetUserRolesInternalServerError() *GetUserRolesInternalServerError {
|
||||
return &GetUserRolesInternalServerError{}
|
||||
}
|
||||
|
||||
/*GetUserRolesInternalServerError handles this case with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type GetUserRolesInternalServerError struct {
|
||||
Payload *auth0_models.Error
|
||||
}
|
||||
|
||||
func (o *GetUserRolesInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /api/v2/users/{userId}/roles][%d] getUserRolesInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetUserRolesInternalServerError) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetUserRolesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(auth0_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,136 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package user
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// NewGetUsersParams creates a new GetUsersParams object
|
||||
// with the default values initialized.
|
||||
func NewGetUsersParams() *GetUsersParams {
|
||||
var ()
|
||||
return &GetUsersParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetUsersParamsWithTimeout creates a new GetUsersParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewGetUsersParamsWithTimeout(timeout time.Duration) *GetUsersParams {
|
||||
var ()
|
||||
return &GetUsersParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetUsersParamsWithContext creates a new GetUsersParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewGetUsersParamsWithContext(ctx context.Context) *GetUsersParams {
|
||||
var ()
|
||||
return &GetUsersParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetUsersParamsWithHTTPClient creates a new GetUsersParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewGetUsersParamsWithHTTPClient(client *http.Client) *GetUsersParams {
|
||||
var ()
|
||||
return &GetUsersParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*GetUsersParams contains all the parameters to send to the API endpoint
|
||||
for the get users operation typically these are written to a http.Request
|
||||
*/
|
||||
type GetUsersParams struct {
|
||||
|
||||
/*Authorization*/
|
||||
Authorization string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get users params
|
||||
func (o *GetUsersParams) WithTimeout(timeout time.Duration) *GetUsersParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get users params
|
||||
func (o *GetUsersParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get users params
|
||||
func (o *GetUsersParams) WithContext(ctx context.Context) *GetUsersParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get users params
|
||||
func (o *GetUsersParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get users params
|
||||
func (o *GetUsersParams) WithHTTPClient(client *http.Client) *GetUsersParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get users params
|
||||
func (o *GetUsersParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithAuthorization adds the authorization to the get users params
|
||||
func (o *GetUsersParams) WithAuthorization(authorization string) *GetUsersParams {
|
||||
o.SetAuthorization(authorization)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetAuthorization adds the authorization to the get users params
|
||||
func (o *GetUsersParams) SetAuthorization(authorization string) {
|
||||
o.Authorization = authorization
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetUsersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
// header param Authorization
|
||||
if err := r.SetHeaderParam("Authorization", o.Authorization); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,227 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package user
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/taxnexus/go/lib/api/auth0/auth0_models"
|
||||
)
|
||||
|
||||
// GetUsersReader is a Reader for the GetUsers structure.
|
||||
type GetUsersReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetUsersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetUsersOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewGetUsersUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewGetUsersForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewGetUsersNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewGetUsersInternalServerError()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetUsersOK creates a GetUsersOK with default headers values
|
||||
func NewGetUsersOK() *GetUsersOK {
|
||||
return &GetUsersOK{}
|
||||
}
|
||||
|
||||
/*GetUsersOK handles this case with default header values.
|
||||
|
||||
Taxnexus Response with User objects
|
||||
*/
|
||||
type GetUsersOK struct {
|
||||
Payload []*auth0_models.User
|
||||
}
|
||||
|
||||
func (o *GetUsersOK) Error() string {
|
||||
return fmt.Sprintf("[GET /api/v2/users][%d] getUsersOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetUsersOK) GetPayload() []*auth0_models.User {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetUsersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetUsersUnauthorized creates a GetUsersUnauthorized with default headers values
|
||||
func NewGetUsersUnauthorized() *GetUsersUnauthorized {
|
||||
return &GetUsersUnauthorized{}
|
||||
}
|
||||
|
||||
/*GetUsersUnauthorized handles this case with default header values.
|
||||
|
||||
Access Unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type GetUsersUnauthorized struct {
|
||||
Payload *auth0_models.Error
|
||||
}
|
||||
|
||||
func (o *GetUsersUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /api/v2/users][%d] getUsersUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetUsersUnauthorized) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetUsersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(auth0_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetUsersForbidden creates a GetUsersForbidden with default headers values
|
||||
func NewGetUsersForbidden() *GetUsersForbidden {
|
||||
return &GetUsersForbidden{}
|
||||
}
|
||||
|
||||
/*GetUsersForbidden handles this case with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type GetUsersForbidden struct {
|
||||
Payload *auth0_models.Error
|
||||
}
|
||||
|
||||
func (o *GetUsersForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /api/v2/users][%d] getUsersForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetUsersForbidden) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetUsersForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(auth0_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetUsersNotFound creates a GetUsersNotFound with default headers values
|
||||
func NewGetUsersNotFound() *GetUsersNotFound {
|
||||
return &GetUsersNotFound{}
|
||||
}
|
||||
|
||||
/*GetUsersNotFound handles this case with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type GetUsersNotFound struct {
|
||||
Payload *auth0_models.Error
|
||||
}
|
||||
|
||||
func (o *GetUsersNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /api/v2/users][%d] getUsersNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetUsersNotFound) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetUsersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(auth0_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetUsersInternalServerError creates a GetUsersInternalServerError with default headers values
|
||||
func NewGetUsersInternalServerError() *GetUsersInternalServerError {
|
||||
return &GetUsersInternalServerError{}
|
||||
}
|
||||
|
||||
/*GetUsersInternalServerError handles this case with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type GetUsersInternalServerError struct {
|
||||
Payload *auth0_models.Error
|
||||
}
|
||||
|
||||
func (o *GetUsersInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /api/v2/users][%d] getUsersInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetUsersInternalServerError) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetUsersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(auth0_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,160 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package user
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/taxnexus/go/lib/api/auth0/auth0_models"
|
||||
)
|
||||
|
||||
// NewPostUsersParams creates a new PostUsersParams object
|
||||
// with the default values initialized.
|
||||
func NewPostUsersParams() *PostUsersParams {
|
||||
var ()
|
||||
return &PostUsersParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostUsersParamsWithTimeout creates a new PostUsersParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewPostUsersParamsWithTimeout(timeout time.Duration) *PostUsersParams {
|
||||
var ()
|
||||
return &PostUsersParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostUsersParamsWithContext creates a new PostUsersParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewPostUsersParamsWithContext(ctx context.Context) *PostUsersParams {
|
||||
var ()
|
||||
return &PostUsersParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostUsersParamsWithHTTPClient creates a new PostUsersParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewPostUsersParamsWithHTTPClient(client *http.Client) *PostUsersParams {
|
||||
var ()
|
||||
return &PostUsersParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*PostUsersParams contains all the parameters to send to the API endpoint
|
||||
for the post users operation typically these are written to a http.Request
|
||||
*/
|
||||
type PostUsersParams struct {
|
||||
|
||||
/*Authorization*/
|
||||
Authorization string
|
||||
/*UserRequest
|
||||
An array of User records
|
||||
|
||||
*/
|
||||
UserRequest *auth0_models.UserRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the post users params
|
||||
func (o *PostUsersParams) WithTimeout(timeout time.Duration) *PostUsersParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the post users params
|
||||
func (o *PostUsersParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the post users params
|
||||
func (o *PostUsersParams) WithContext(ctx context.Context) *PostUsersParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the post users params
|
||||
func (o *PostUsersParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the post users params
|
||||
func (o *PostUsersParams) WithHTTPClient(client *http.Client) *PostUsersParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the post users params
|
||||
func (o *PostUsersParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithAuthorization adds the authorization to the post users params
|
||||
func (o *PostUsersParams) WithAuthorization(authorization string) *PostUsersParams {
|
||||
o.SetAuthorization(authorization)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetAuthorization adds the authorization to the post users params
|
||||
func (o *PostUsersParams) SetAuthorization(authorization string) {
|
||||
o.Authorization = authorization
|
||||
}
|
||||
|
||||
// WithUserRequest adds the userRequest to the post users params
|
||||
func (o *PostUsersParams) WithUserRequest(userRequest *auth0_models.UserRequest) *PostUsersParams {
|
||||
o.SetUserRequest(userRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetUserRequest adds the userRequest to the post users params
|
||||
func (o *PostUsersParams) SetUserRequest(userRequest *auth0_models.UserRequest) {
|
||||
o.UserRequest = userRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PostUsersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
// header param Authorization
|
||||
if err := r.SetHeaderParam("Authorization", o.Authorization); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if o.UserRequest != nil {
|
||||
if err := r.SetBodyParam(o.UserRequest); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,244 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package user
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/taxnexus/go/lib/api/auth0/auth0_models"
|
||||
)
|
||||
|
||||
// PostUsersReader is a Reader for the PostUsers structure.
|
||||
type PostUsersReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PostUsersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 201:
|
||||
result := NewPostUsersCreated()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewPostUsersUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewPostUsersForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewPostUsersNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 409:
|
||||
result := NewPostUsersConflict()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewPostUsersInternalServerError()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostUsersCreated creates a PostUsersCreated with default headers values
|
||||
func NewPostUsersCreated() *PostUsersCreated {
|
||||
return &PostUsersCreated{}
|
||||
}
|
||||
|
||||
/*PostUsersCreated handles this case with default header values.
|
||||
|
||||
New user created
|
||||
*/
|
||||
type PostUsersCreated struct {
|
||||
}
|
||||
|
||||
func (o *PostUsersCreated) Error() string {
|
||||
return fmt.Sprintf("[POST /api/v2/users-by-email][%d] postUsersCreated ", 201)
|
||||
}
|
||||
|
||||
func (o *PostUsersCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostUsersUnauthorized creates a PostUsersUnauthorized with default headers values
|
||||
func NewPostUsersUnauthorized() *PostUsersUnauthorized {
|
||||
return &PostUsersUnauthorized{}
|
||||
}
|
||||
|
||||
/*PostUsersUnauthorized handles this case with default header values.
|
||||
|
||||
Access Unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type PostUsersUnauthorized struct {
|
||||
Payload *auth0_models.Error
|
||||
}
|
||||
|
||||
func (o *PostUsersUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[POST /api/v2/users-by-email][%d] postUsersUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostUsersUnauthorized) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostUsersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(auth0_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostUsersForbidden creates a PostUsersForbidden with default headers values
|
||||
func NewPostUsersForbidden() *PostUsersForbidden {
|
||||
return &PostUsersForbidden{}
|
||||
}
|
||||
|
||||
/*PostUsersForbidden handles this case with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type PostUsersForbidden struct {
|
||||
Payload *auth0_models.Error
|
||||
}
|
||||
|
||||
func (o *PostUsersForbidden) Error() string {
|
||||
return fmt.Sprintf("[POST /api/v2/users-by-email][%d] postUsersForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostUsersForbidden) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostUsersForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(auth0_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostUsersNotFound creates a PostUsersNotFound with default headers values
|
||||
func NewPostUsersNotFound() *PostUsersNotFound {
|
||||
return &PostUsersNotFound{}
|
||||
}
|
||||
|
||||
/*PostUsersNotFound handles this case with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type PostUsersNotFound struct {
|
||||
Payload *auth0_models.Error
|
||||
}
|
||||
|
||||
func (o *PostUsersNotFound) Error() string {
|
||||
return fmt.Sprintf("[POST /api/v2/users-by-email][%d] postUsersNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostUsersNotFound) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostUsersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(auth0_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostUsersConflict creates a PostUsersConflict with default headers values
|
||||
func NewPostUsersConflict() *PostUsersConflict {
|
||||
return &PostUsersConflict{}
|
||||
}
|
||||
|
||||
/*PostUsersConflict handles this case with default header values.
|
||||
|
||||
User already exists
|
||||
*/
|
||||
type PostUsersConflict struct {
|
||||
}
|
||||
|
||||
func (o *PostUsersConflict) Error() string {
|
||||
return fmt.Sprintf("[POST /api/v2/users-by-email][%d] postUsersConflict ", 409)
|
||||
}
|
||||
|
||||
func (o *PostUsersConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostUsersInternalServerError creates a PostUsersInternalServerError with default headers values
|
||||
func NewPostUsersInternalServerError() *PostUsersInternalServerError {
|
||||
return &PostUsersInternalServerError{}
|
||||
}
|
||||
|
||||
/*PostUsersInternalServerError handles this case with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type PostUsersInternalServerError struct {
|
||||
Payload *auth0_models.Error
|
||||
}
|
||||
|
||||
func (o *PostUsersInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[POST /api/v2/users-by-email][%d] postUsersInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostUsersInternalServerError) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostUsersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(auth0_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,228 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package user
|
||||
|
||||
// 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 user API client.
|
||||
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
|
||||
return &Client{transport: transport, formats: formats}
|
||||
}
|
||||
|
||||
/*
|
||||
Client for user API
|
||||
*/
|
||||
type Client struct {
|
||||
transport runtime.ClientTransport
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ClientService is the interface for Client methods
|
||||
type ClientService interface {
|
||||
DeleteAPIV2UsersUserIDRoles(params *DeleteAPIV2UsersUserIDRolesParams) (*DeleteAPIV2UsersUserIDRolesNoContent, error)
|
||||
|
||||
GetUserByEmail(params *GetUserByEmailParams) (*GetUserByEmailOK, error)
|
||||
|
||||
GetUserRoles(params *GetUserRolesParams) (*GetUserRolesOK, error)
|
||||
|
||||
GetUsers(params *GetUsersParams) (*GetUsersOK, error)
|
||||
|
||||
PostUsers(params *PostUsersParams) (*PostUsersCreated, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteAPIV2UsersUserIDRoles delete API v2 users user ID roles API
|
||||
*/
|
||||
func (a *Client) DeleteAPIV2UsersUserIDRoles(params *DeleteAPIV2UsersUserIDRolesParams) (*DeleteAPIV2UsersUserIDRolesNoContent, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewDeleteAPIV2UsersUserIDRolesParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "DeleteAPIV2UsersUserIDRoles",
|
||||
Method: "DELETE",
|
||||
PathPattern: "/api/v2/users/{userId}/roles",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"https"},
|
||||
Params: params,
|
||||
Reader: &DeleteAPIV2UsersUserIDRolesReader{formats: a.formats},
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*DeleteAPIV2UsersUserIDRolesNoContent)
|
||||
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 DeleteAPIV2UsersUserIDRoles: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
GetUserByEmail gets a single user from auth0 by email address
|
||||
|
||||
Get a single user from Auth0 by Email Address
|
||||
*/
|
||||
func (a *Client) GetUserByEmail(params *GetUserByEmailParams) (*GetUserByEmailOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetUserByEmailParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "getUserByEmail",
|
||||
Method: "GET",
|
||||
PathPattern: "/api/v2/users-by-email",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"https"},
|
||||
Params: params,
|
||||
Reader: &GetUserByEmailReader{formats: a.formats},
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*GetUserByEmailOK)
|
||||
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 getUserByEmail: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
GetUserRoles gets a user s roles
|
||||
|
||||
Get a User's Roles
|
||||
*/
|
||||
func (a *Client) GetUserRoles(params *GetUserRolesParams) (*GetUserRolesOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetUserRolesParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "getUserRoles",
|
||||
Method: "GET",
|
||||
PathPattern: "/api/v2/users/{userId}/roles",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"https"},
|
||||
Params: params,
|
||||
Reader: &GetUserRolesReader{formats: a.formats},
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*GetUserRolesOK)
|
||||
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 getUserRoles: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
GetUsers gets all users from auth0
|
||||
|
||||
Get all users from Auth0
|
||||
*/
|
||||
func (a *Client) GetUsers(params *GetUsersParams) (*GetUsersOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetUsersParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "getUsers",
|
||||
Method: "GET",
|
||||
PathPattern: "/api/v2/users",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"https"},
|
||||
Params: params,
|
||||
Reader: &GetUsersReader{formats: a.formats},
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*GetUsersOK)
|
||||
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 getUsers: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PostUsers creates new auth0 user
|
||||
|
||||
create new Auth0 user
|
||||
*/
|
||||
func (a *Client) PostUsers(params *PostUsersParams) (*PostUsersCreated, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPostUsersParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "postUsers",
|
||||
Method: "POST",
|
||||
PathPattern: "/api/v2/users-by-email",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"https"},
|
||||
Params: params,
|
||||
Reader: &PostUsersReader{formats: a.formats},
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*PostUsersCreated)
|
||||
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 postUsers: 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
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package auth0_models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// CredentialsRequest credentials request
|
||||
//
|
||||
// swagger:model CredentialsRequest
|
||||
type CredentialsRequest struct {
|
||||
|
||||
// audience
|
||||
Audience string `json:"audience,omitempty"`
|
||||
|
||||
// client id
|
||||
ClientID string `json:"client_id,omitempty"`
|
||||
|
||||
// client secret
|
||||
ClientSecret string `json:"client_secret,omitempty"`
|
||||
|
||||
// grant type
|
||||
GrantType string `json:"grant_type,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this credentials request
|
||||
func (m *CredentialsRequest) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *CredentialsRequest) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *CredentialsRequest) UnmarshalBinary(b []byte) error {
|
||||
var res CredentialsRequest
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package auth0_models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// CredentialsResponse credentials response
|
||||
//
|
||||
// swagger:model CredentialsResponse
|
||||
type CredentialsResponse struct {
|
||||
|
||||
// access token
|
||||
AccessToken string `json:"access_token,omitempty"`
|
||||
|
||||
// expires in
|
||||
ExpiresIn int64 `json:"expires_in,omitempty"`
|
||||
|
||||
// scope
|
||||
Scope string `json:"scope,omitempty"`
|
||||
|
||||
// token type
|
||||
TokenType string `json:"token_type,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this credentials response
|
||||
func (m *CredentialsResponse) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *CredentialsResponse) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *CredentialsResponse) UnmarshalBinary(b []byte) error {
|
||||
var res CredentialsResponse
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package auth0_models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// Error error
|
||||
//
|
||||
// swagger:model Error
|
||||
type Error struct {
|
||||
|
||||
// code
|
||||
Code int32 `json:"code,omitempty"`
|
||||
|
||||
// fields
|
||||
Fields string `json:"fields,omitempty"`
|
||||
|
||||
// message
|
||||
Message string `json:"message,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this error
|
||||
func (m *Error) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *Error) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *Error) UnmarshalBinary(b []byte) error {
|
||||
var res Error
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,89 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package auth0_models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// NewUser new user
|
||||
//
|
||||
// swagger:model NewUser
|
||||
type NewUser struct {
|
||||
|
||||
// blocked
|
||||
Blocked bool `json:"blocked,omitempty"`
|
||||
|
||||
// connection
|
||||
Connection string `json:"connection,omitempty"`
|
||||
|
||||
// email
|
||||
Email string `json:"email,omitempty"`
|
||||
|
||||
// email verified
|
||||
EmailVerified bool `json:"email_verified,omitempty"`
|
||||
|
||||
// family name
|
||||
FamilyName string `json:"family_name,omitempty"`
|
||||
|
||||
// given name
|
||||
GivenName string `json:"given_name,omitempty"`
|
||||
|
||||
// name
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// nickname
|
||||
Nickname string `json:"nickname,omitempty"`
|
||||
|
||||
// password
|
||||
Password string `json:"password,omitempty"`
|
||||
|
||||
// phone number
|
||||
PhoneNumber string `json:"phone_number,omitempty"`
|
||||
|
||||
// phone verified
|
||||
PhoneVerified bool `json:"phone_verified,omitempty"`
|
||||
|
||||
// picture
|
||||
Picture string `json:"picture,omitempty"`
|
||||
|
||||
// user id
|
||||
UserID string `json:"user_id,omitempty"`
|
||||
|
||||
// username
|
||||
Username string `json:"username,omitempty"`
|
||||
|
||||
// verify email
|
||||
VerifyEmail bool `json:"verify_email,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this new user
|
||||
func (m *NewUser) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *NewUser) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *NewUser) UnmarshalBinary(b []byte) error {
|
||||
var res NewUser
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package auth0_models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// Role role
|
||||
//
|
||||
// swagger:model Role
|
||||
type Role struct {
|
||||
|
||||
// description
|
||||
Description string `json:"description,omitempty"`
|
||||
|
||||
// id
|
||||
ID string `json:"id,omitempty"`
|
||||
|
||||
// name
|
||||
Name string `json:"name,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this role
|
||||
func (m *Role) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *Role) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *Role) UnmarshalBinary(b []byte) error {
|
||||
var res Role
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,84 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package auth0_models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// RoleResponse role response
|
||||
//
|
||||
// swagger:model RoleResponse
|
||||
type RoleResponse struct {
|
||||
|
||||
// roles
|
||||
Roles []*Role `json:"roles"`
|
||||
}
|
||||
|
||||
// Validate validates this role response
|
||||
func (m *RoleResponse) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateRoles(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *RoleResponse) validateRoles(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Roles) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Roles); i++ {
|
||||
if swag.IsZero(m.Roles[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Roles[i] != nil {
|
||||
if err := m.Roles[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("roles" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *RoleResponse) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *RoleResponse) UnmarshalBinary(b []byte) error {
|
||||
var res RoleResponse
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package auth0_models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// RoleUsersRequest role users request
|
||||
//
|
||||
// swagger:model RoleUsersRequest
|
||||
type RoleUsersRequest struct {
|
||||
|
||||
// users
|
||||
Users []string `json:"users"`
|
||||
}
|
||||
|
||||
// Validate validates this role users request
|
||||
func (m *RoleUsersRequest) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *RoleUsersRequest) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *RoleUsersRequest) UnmarshalBinary(b []byte) error {
|
||||
var res RoleUsersRequest
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,305 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package auth0_models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// User user
|
||||
//
|
||||
// swagger:model User
|
||||
type User struct {
|
||||
|
||||
// app metadata
|
||||
AppMetadata *UserAppMetadata `json:"app_metadata,omitempty"`
|
||||
|
||||
// created at
|
||||
CreatedAt string `json:"created_at,omitempty"`
|
||||
|
||||
// email
|
||||
Email string `json:"email,omitempty"`
|
||||
|
||||
// email verified
|
||||
EmailVerified bool `json:"email_verified,omitempty"`
|
||||
|
||||
// family name
|
||||
FamilyName string `json:"family_name,omitempty"`
|
||||
|
||||
// given name
|
||||
GivenName string `json:"given_name,omitempty"`
|
||||
|
||||
// identities
|
||||
Identities []*UserIdentitiesItems0 `json:"identities"`
|
||||
|
||||
// last ip
|
||||
LastIP string `json:"last_ip,omitempty"`
|
||||
|
||||
// last login
|
||||
LastLogin string `json:"last_login,omitempty"`
|
||||
|
||||
// last password reset
|
||||
LastPasswordReset string `json:"last_password_reset,omitempty"`
|
||||
|
||||
// logins count
|
||||
LoginsCount int64 `json:"logins_count,omitempty"`
|
||||
|
||||
// multifactor last modified
|
||||
MultifactorLastModified string `json:"multifactor_last_modified,omitempty"`
|
||||
|
||||
// name
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// nickname
|
||||
Nickname string `json:"nickname,omitempty"`
|
||||
|
||||
// picture
|
||||
Picture string `json:"picture,omitempty"`
|
||||
|
||||
// updated at
|
||||
UpdatedAt string `json:"updated_at,omitempty"`
|
||||
|
||||
// user id
|
||||
UserID string `json:"user_id,omitempty"`
|
||||
|
||||
// user metadata
|
||||
UserMetadata *UserUserMetadata `json:"user_metadata,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this user
|
||||
func (m *User) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateAppMetadata(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateIdentities(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateUserMetadata(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *User) validateAppMetadata(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.AppMetadata) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.AppMetadata != nil {
|
||||
if err := m.AppMetadata.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("app_metadata")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *User) validateIdentities(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Identities) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Identities); i++ {
|
||||
if swag.IsZero(m.Identities[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Identities[i] != nil {
|
||||
if err := m.Identities[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("identities" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *User) validateUserMetadata(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.UserMetadata) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.UserMetadata != nil {
|
||||
if err := m.UserMetadata.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("user_metadata")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *User) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *User) UnmarshalBinary(b []byte) error {
|
||||
var res User
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
|
||||
// UserAppMetadata user app metadata
|
||||
//
|
||||
// swagger:model UserAppMetadata
|
||||
type UserAppMetadata struct {
|
||||
|
||||
// roles
|
||||
Roles []string `json:"roles"`
|
||||
|
||||
// taxnexus account id
|
||||
TaxnexusAccountID string `json:"taxnexus_account_id,omitempty"`
|
||||
|
||||
// taxnexus contact id
|
||||
TaxnexusContactID string `json:"taxnexus_contact_id,omitempty"`
|
||||
|
||||
// taxnexus user id
|
||||
TaxnexusUserID string `json:"taxnexus_user_id,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this user app metadata
|
||||
func (m *UserAppMetadata) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *UserAppMetadata) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *UserAppMetadata) UnmarshalBinary(b []byte) error {
|
||||
var res UserAppMetadata
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
|
||||
// UserIdentitiesItems0 user identities items0
|
||||
//
|
||||
// swagger:model UserIdentitiesItems0
|
||||
type UserIdentitiesItems0 struct {
|
||||
|
||||
// connection
|
||||
Connection string `json:"connection,omitempty"`
|
||||
|
||||
// is social
|
||||
IsSocial bool `json:"isSocial,omitempty"`
|
||||
|
||||
// provider
|
||||
Provider string `json:"provider,omitempty"`
|
||||
|
||||
// user id
|
||||
UserID string `json:"user_id,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this user identities items0
|
||||
func (m *UserIdentitiesItems0) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *UserIdentitiesItems0) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *UserIdentitiesItems0) UnmarshalBinary(b []byte) error {
|
||||
var res UserIdentitiesItems0
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
|
||||
// UserUserMetadata user user metadata
|
||||
//
|
||||
// swagger:model UserUserMetadata
|
||||
type UserUserMetadata struct {
|
||||
|
||||
// taxnexus email
|
||||
TaxnexusEmail string `json:"taxnexus_email,omitempty"`
|
||||
|
||||
// taxnexus firstname
|
||||
TaxnexusFirstname string `json:"taxnexus_firstname,omitempty"`
|
||||
|
||||
// taxnexus fullname
|
||||
TaxnexusFullname string `json:"taxnexus_fullname,omitempty"`
|
||||
|
||||
// taxnexus lastname
|
||||
TaxnexusLastname string `json:"taxnexus_lastname,omitempty"`
|
||||
|
||||
// taxnexus phone
|
||||
TaxnexusPhone string `json:"taxnexus_phone,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this user user metadata
|
||||
func (m *UserUserMetadata) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *UserUserMetadata) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *UserUserMetadata) UnmarshalBinary(b []byte) error {
|
||||
var res UserUserMetadata
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,84 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package auth0_models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// UserRequest An array Auth0 new user objects
|
||||
//
|
||||
// swagger:model UserRequest
|
||||
type UserRequest struct {
|
||||
|
||||
// users
|
||||
Users []*NewUser `json:"users"`
|
||||
}
|
||||
|
||||
// Validate validates this user request
|
||||
func (m *UserRequest) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateUsers(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *UserRequest) validateUsers(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Users) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Users); i++ {
|
||||
if swag.IsZero(m.Users[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Users[i] != nil {
|
||||
if err := m.Users[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("users" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *UserRequest) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *UserRequest) UnmarshalBinary(b []byte) error {
|
||||
var res UserRequest
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package auth0_models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// UserRolesRequest user roles request
|
||||
//
|
||||
// swagger:model UserRolesRequest
|
||||
type UserRolesRequest struct {
|
||||
|
||||
// roles
|
||||
Roles []string `json:"roles"`
|
||||
}
|
||||
|
||||
// Validate validates this user roles request
|
||||
func (m *UserRolesRequest) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *UserRolesRequest) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *UserRolesRequest) UnmarshalBinary(b []byte) error {
|
||||
var res UserRolesRequest
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,141 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package blaze_client
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"github.com/go-openapi/runtime"
|
||||
httptransport "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/taxnexus/go/lib/api/blaze/blaze_client/members"
|
||||
"github.com/taxnexus/go/lib/api/blaze/blaze_client/products"
|
||||
"github.com/taxnexus/go/lib/api/blaze/blaze_client/purchase_orders"
|
||||
"github.com/taxnexus/go/lib/api/blaze/blaze_client/shop"
|
||||
"github.com/taxnexus/go/lib/api/blaze/blaze_client/transactions"
|
||||
"github.com/taxnexus/go/lib/api/blaze/blaze_client/vendors"
|
||||
)
|
||||
|
||||
// Default blaze HTTP client.
|
||||
var Default = NewHTTPClient(nil)
|
||||
|
||||
const (
|
||||
// DefaultHost is the default Host
|
||||
// found in Meta (info) section of spec file
|
||||
DefaultHost string = "api.blaze.me"
|
||||
// DefaultBasePath is the default BasePath
|
||||
// found in Meta (info) section of spec file
|
||||
DefaultBasePath string = "/api/v1"
|
||||
)
|
||||
|
||||
// DefaultSchemes are the default schemes found in Meta (info) section of spec file
|
||||
var DefaultSchemes = []string{"https"}
|
||||
|
||||
// NewHTTPClient creates a new blaze HTTP client.
|
||||
func NewHTTPClient(formats strfmt.Registry) *Blaze {
|
||||
return NewHTTPClientWithConfig(formats, nil)
|
||||
}
|
||||
|
||||
// NewHTTPClientWithConfig creates a new blaze HTTP client,
|
||||
// using a customizable transport config.
|
||||
func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Blaze {
|
||||
// ensure nullable parameters have default
|
||||
if cfg == nil {
|
||||
cfg = DefaultTransportConfig()
|
||||
}
|
||||
|
||||
// create transport and client
|
||||
transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes)
|
||||
return New(transport, formats)
|
||||
}
|
||||
|
||||
// New creates a new blaze client
|
||||
func New(transport runtime.ClientTransport, formats strfmt.Registry) *Blaze {
|
||||
// ensure nullable parameters have default
|
||||
if formats == nil {
|
||||
formats = strfmt.Default
|
||||
}
|
||||
|
||||
cli := new(Blaze)
|
||||
cli.Transport = transport
|
||||
cli.Members = members.New(transport, formats)
|
||||
cli.Products = products.New(transport, formats)
|
||||
cli.PurchaseOrders = purchase_orders.New(transport, formats)
|
||||
cli.Shop = shop.New(transport, formats)
|
||||
cli.Transactions = transactions.New(transport, formats)
|
||||
cli.Vendors = vendors.New(transport, formats)
|
||||
return cli
|
||||
}
|
||||
|
||||
// DefaultTransportConfig creates a TransportConfig with the
|
||||
// default settings taken from the meta section of the spec file.
|
||||
func DefaultTransportConfig() *TransportConfig {
|
||||
return &TransportConfig{
|
||||
Host: DefaultHost,
|
||||
BasePath: DefaultBasePath,
|
||||
Schemes: DefaultSchemes,
|
||||
}
|
||||
}
|
||||
|
||||
// TransportConfig contains the transport related info,
|
||||
// found in the meta section of the spec file.
|
||||
type TransportConfig struct {
|
||||
Host string
|
||||
BasePath string
|
||||
Schemes []string
|
||||
}
|
||||
|
||||
// WithHost overrides the default host,
|
||||
// provided by the meta section of the spec file.
|
||||
func (cfg *TransportConfig) WithHost(host string) *TransportConfig {
|
||||
cfg.Host = host
|
||||
return cfg
|
||||
}
|
||||
|
||||
// WithBasePath overrides the default basePath,
|
||||
// provided by the meta section of the spec file.
|
||||
func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig {
|
||||
cfg.BasePath = basePath
|
||||
return cfg
|
||||
}
|
||||
|
||||
// WithSchemes overrides the default schemes,
|
||||
// provided by the meta section of the spec file.
|
||||
func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig {
|
||||
cfg.Schemes = schemes
|
||||
return cfg
|
||||
}
|
||||
|
||||
// Blaze is a client for blaze
|
||||
type Blaze struct {
|
||||
Members members.ClientService
|
||||
|
||||
Products products.ClientService
|
||||
|
||||
PurchaseOrders purchase_orders.ClientService
|
||||
|
||||
Shop shop.ClientService
|
||||
|
||||
Transactions transactions.ClientService
|
||||
|
||||
Vendors vendors.ClientService
|
||||
|
||||
Transport runtime.ClientTransport
|
||||
}
|
||||
|
||||
// SetTransport changes the transport on the client and all its subresources
|
||||
func (c *Blaze) SetTransport(transport runtime.ClientTransport) {
|
||||
c.Transport = transport
|
||||
c.Members.SetTransport(transport)
|
||||
c.Products.SetTransport(transport)
|
||||
c.PurchaseOrders.SetTransport(transport)
|
||||
c.Shop.SetTransport(transport)
|
||||
c.Transactions.SetTransport(transport)
|
||||
c.Vendors.SetTransport(transport)
|
||||
}
|
|
@ -0,0 +1,139 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package members
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// NewGetMemberParams creates a new GetMemberParams object
|
||||
// with the default values initialized.
|
||||
func NewGetMemberParams() *GetMemberParams {
|
||||
var ()
|
||||
return &GetMemberParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetMemberParamsWithTimeout creates a new GetMemberParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewGetMemberParamsWithTimeout(timeout time.Duration) *GetMemberParams {
|
||||
var ()
|
||||
return &GetMemberParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetMemberParamsWithContext creates a new GetMemberParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewGetMemberParamsWithContext(ctx context.Context) *GetMemberParams {
|
||||
var ()
|
||||
return &GetMemberParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetMemberParamsWithHTTPClient creates a new GetMemberParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewGetMemberParamsWithHTTPClient(client *http.Client) *GetMemberParams {
|
||||
var ()
|
||||
return &GetMemberParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*GetMemberParams contains all the parameters to send to the API endpoint
|
||||
for the get member operation typically these are written to a http.Request
|
||||
*/
|
||||
type GetMemberParams struct {
|
||||
|
||||
/*MemberID
|
||||
The Blaze Member Object Id
|
||||
|
||||
*/
|
||||
MemberID string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get member params
|
||||
func (o *GetMemberParams) WithTimeout(timeout time.Duration) *GetMemberParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get member params
|
||||
func (o *GetMemberParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get member params
|
||||
func (o *GetMemberParams) WithContext(ctx context.Context) *GetMemberParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get member params
|
||||
func (o *GetMemberParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get member params
|
||||
func (o *GetMemberParams) WithHTTPClient(client *http.Client) *GetMemberParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get member params
|
||||
func (o *GetMemberParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithMemberID adds the memberID to the get member params
|
||||
func (o *GetMemberParams) WithMemberID(memberID string) *GetMemberParams {
|
||||
o.SetMemberID(memberID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetMemberID adds the memberId to the get member params
|
||||
func (o *GetMemberParams) SetMemberID(memberID string) {
|
||||
o.MemberID = memberID
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetMemberParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
// path param memberId
|
||||
if err := r.SetPathParam("memberId", o.MemberID); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,229 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package members
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/taxnexus/go/lib/api/blaze/blaze_models"
|
||||
)
|
||||
|
||||
// GetMemberReader is a Reader for the GetMember structure.
|
||||
type GetMemberReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetMemberReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetMemberOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewGetMemberUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewGetMemberForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewGetMemberNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewGetMemberInternalServerError()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetMemberOK creates a GetMemberOK with default headers values
|
||||
func NewGetMemberOK() *GetMemberOK {
|
||||
return &GetMemberOK{}
|
||||
}
|
||||
|
||||
/*GetMemberOK handles this case with default header values.
|
||||
|
||||
Product was successfully retrieved
|
||||
*/
|
||||
type GetMemberOK struct {
|
||||
Payload *blaze_models.MemberResponse
|
||||
}
|
||||
|
||||
func (o *GetMemberOK) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/members/{memberId}][%d] getMemberOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetMemberOK) GetPayload() *blaze_models.MemberResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetMemberOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(blaze_models.MemberResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetMemberUnauthorized creates a GetMemberUnauthorized with default headers values
|
||||
func NewGetMemberUnauthorized() *GetMemberUnauthorized {
|
||||
return &GetMemberUnauthorized{}
|
||||
}
|
||||
|
||||
/*GetMemberUnauthorized handles this case with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type GetMemberUnauthorized struct {
|
||||
Payload *blaze_models.Error
|
||||
}
|
||||
|
||||
func (o *GetMemberUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/members/{memberId}][%d] getMemberUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetMemberUnauthorized) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetMemberUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(blaze_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetMemberForbidden creates a GetMemberForbidden with default headers values
|
||||
func NewGetMemberForbidden() *GetMemberForbidden {
|
||||
return &GetMemberForbidden{}
|
||||
}
|
||||
|
||||
/*GetMemberForbidden handles this case with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type GetMemberForbidden struct {
|
||||
Payload *blaze_models.Error
|
||||
}
|
||||
|
||||
func (o *GetMemberForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/members/{memberId}][%d] getMemberForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetMemberForbidden) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetMemberForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(blaze_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetMemberNotFound creates a GetMemberNotFound with default headers values
|
||||
func NewGetMemberNotFound() *GetMemberNotFound {
|
||||
return &GetMemberNotFound{}
|
||||
}
|
||||
|
||||
/*GetMemberNotFound handles this case with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type GetMemberNotFound struct {
|
||||
Payload *blaze_models.Error
|
||||
}
|
||||
|
||||
func (o *GetMemberNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/members/{memberId}][%d] getMemberNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetMemberNotFound) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetMemberNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(blaze_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetMemberInternalServerError creates a GetMemberInternalServerError with default headers values
|
||||
func NewGetMemberInternalServerError() *GetMemberInternalServerError {
|
||||
return &GetMemberInternalServerError{}
|
||||
}
|
||||
|
||||
/*GetMemberInternalServerError handles this case with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type GetMemberInternalServerError struct {
|
||||
Payload *blaze_models.Error
|
||||
}
|
||||
|
||||
func (o *GetMemberInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/members/{memberId}][%d] getMemberInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetMemberInternalServerError) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetMemberInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(blaze_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,77 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package members
|
||||
|
||||
// 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 members API client.
|
||||
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
|
||||
return &Client{transport: transport, formats: formats}
|
||||
}
|
||||
|
||||
/*
|
||||
Client for members API
|
||||
*/
|
||||
type Client struct {
|
||||
transport runtime.ClientTransport
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ClientService is the interface for Client methods
|
||||
type ClientService interface {
|
||||
GetMember(params *GetMemberParams, authInfo runtime.ClientAuthInfoWriter) (*GetMemberOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
||||
/*
|
||||
GetMember Get A Member (contact)
|
||||
*/
|
||||
func (a *Client) GetMember(params *GetMemberParams, authInfo runtime.ClientAuthInfoWriter) (*GetMemberOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetMemberParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "getMember",
|
||||
Method: "GET",
|
||||
PathPattern: "/partner/members/{memberId}",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"https"},
|
||||
Params: params,
|
||||
Reader: &GetMemberReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*GetMemberOK)
|
||||
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 getMember: 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
|
||||
}
|
|
@ -0,0 +1,139 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package products
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// NewGetProductParams creates a new GetProductParams object
|
||||
// with the default values initialized.
|
||||
func NewGetProductParams() *GetProductParams {
|
||||
var ()
|
||||
return &GetProductParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetProductParamsWithTimeout creates a new GetProductParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewGetProductParamsWithTimeout(timeout time.Duration) *GetProductParams {
|
||||
var ()
|
||||
return &GetProductParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetProductParamsWithContext creates a new GetProductParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewGetProductParamsWithContext(ctx context.Context) *GetProductParams {
|
||||
var ()
|
||||
return &GetProductParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetProductParamsWithHTTPClient creates a new GetProductParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewGetProductParamsWithHTTPClient(client *http.Client) *GetProductParams {
|
||||
var ()
|
||||
return &GetProductParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*GetProductParams contains all the parameters to send to the API endpoint
|
||||
for the get product operation typically these are written to a http.Request
|
||||
*/
|
||||
type GetProductParams struct {
|
||||
|
||||
/*ProductID
|
||||
The Blaze Product Object Id
|
||||
|
||||
*/
|
||||
ProductID string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get product params
|
||||
func (o *GetProductParams) WithTimeout(timeout time.Duration) *GetProductParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get product params
|
||||
func (o *GetProductParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get product params
|
||||
func (o *GetProductParams) WithContext(ctx context.Context) *GetProductParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get product params
|
||||
func (o *GetProductParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get product params
|
||||
func (o *GetProductParams) WithHTTPClient(client *http.Client) *GetProductParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get product params
|
||||
func (o *GetProductParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithProductID adds the productID to the get product params
|
||||
func (o *GetProductParams) WithProductID(productID string) *GetProductParams {
|
||||
o.SetProductID(productID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetProductID adds the productId to the get product params
|
||||
func (o *GetProductParams) SetProductID(productID string) {
|
||||
o.ProductID = productID
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetProductParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
// path param productId
|
||||
if err := r.SetPathParam("productId", o.ProductID); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,229 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package products
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/taxnexus/go/lib/api/blaze/blaze_models"
|
||||
)
|
||||
|
||||
// GetProductReader is a Reader for the GetProduct structure.
|
||||
type GetProductReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetProductReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetProductOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewGetProductUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewGetProductForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewGetProductNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewGetProductInternalServerError()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetProductOK creates a GetProductOK with default headers values
|
||||
func NewGetProductOK() *GetProductOK {
|
||||
return &GetProductOK{}
|
||||
}
|
||||
|
||||
/*GetProductOK handles this case with default header values.
|
||||
|
||||
Product was successfully retrieved
|
||||
*/
|
||||
type GetProductOK struct {
|
||||
Payload *blaze_models.ProductResponse
|
||||
}
|
||||
|
||||
func (o *GetProductOK) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/products/{productId}][%d] getProductOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetProductOK) GetPayload() *blaze_models.ProductResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetProductOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(blaze_models.ProductResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetProductUnauthorized creates a GetProductUnauthorized with default headers values
|
||||
func NewGetProductUnauthorized() *GetProductUnauthorized {
|
||||
return &GetProductUnauthorized{}
|
||||
}
|
||||
|
||||
/*GetProductUnauthorized handles this case with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type GetProductUnauthorized struct {
|
||||
Payload *blaze_models.Error
|
||||
}
|
||||
|
||||
func (o *GetProductUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/products/{productId}][%d] getProductUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetProductUnauthorized) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetProductUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(blaze_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetProductForbidden creates a GetProductForbidden with default headers values
|
||||
func NewGetProductForbidden() *GetProductForbidden {
|
||||
return &GetProductForbidden{}
|
||||
}
|
||||
|
||||
/*GetProductForbidden handles this case with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type GetProductForbidden struct {
|
||||
Payload *blaze_models.Error
|
||||
}
|
||||
|
||||
func (o *GetProductForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/products/{productId}][%d] getProductForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetProductForbidden) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetProductForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(blaze_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetProductNotFound creates a GetProductNotFound with default headers values
|
||||
func NewGetProductNotFound() *GetProductNotFound {
|
||||
return &GetProductNotFound{}
|
||||
}
|
||||
|
||||
/*GetProductNotFound handles this case with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type GetProductNotFound struct {
|
||||
Payload *blaze_models.Error
|
||||
}
|
||||
|
||||
func (o *GetProductNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/products/{productId}][%d] getProductNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetProductNotFound) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetProductNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(blaze_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetProductInternalServerError creates a GetProductInternalServerError with default headers values
|
||||
func NewGetProductInternalServerError() *GetProductInternalServerError {
|
||||
return &GetProductInternalServerError{}
|
||||
}
|
||||
|
||||
/*GetProductInternalServerError handles this case with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type GetProductInternalServerError struct {
|
||||
Payload *blaze_models.Error
|
||||
}
|
||||
|
||||
func (o *GetProductInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/products/{productId}][%d] getProductInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetProductInternalServerError) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetProductInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(blaze_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,116 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package products
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// NewGetProductsParams creates a new GetProductsParams object
|
||||
// with the default values initialized.
|
||||
func NewGetProductsParams() *GetProductsParams {
|
||||
|
||||
return &GetProductsParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetProductsParamsWithTimeout creates a new GetProductsParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewGetProductsParamsWithTimeout(timeout time.Duration) *GetProductsParams {
|
||||
|
||||
return &GetProductsParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetProductsParamsWithContext creates a new GetProductsParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewGetProductsParamsWithContext(ctx context.Context) *GetProductsParams {
|
||||
|
||||
return &GetProductsParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetProductsParamsWithHTTPClient creates a new GetProductsParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewGetProductsParamsWithHTTPClient(client *http.Client) *GetProductsParams {
|
||||
|
||||
return &GetProductsParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*GetProductsParams contains all the parameters to send to the API endpoint
|
||||
for the get products operation typically these are written to a http.Request
|
||||
*/
|
||||
type GetProductsParams struct {
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get products params
|
||||
func (o *GetProductsParams) WithTimeout(timeout time.Duration) *GetProductsParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get products params
|
||||
func (o *GetProductsParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get products params
|
||||
func (o *GetProductsParams) WithContext(ctx context.Context) *GetProductsParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get products params
|
||||
func (o *GetProductsParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get products params
|
||||
func (o *GetProductsParams) WithHTTPClient(client *http.Client) *GetProductsParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get products params
|
||||
func (o *GetProductsParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetProductsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,229 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package products
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/taxnexus/go/lib/api/blaze/blaze_models"
|
||||
)
|
||||
|
||||
// GetProductsReader is a Reader for the GetProducts structure.
|
||||
type GetProductsReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetProductsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetProductsOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewGetProductsUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewGetProductsForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewGetProductsNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewGetProductsInternalServerError()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetProductsOK creates a GetProductsOK with default headers values
|
||||
func NewGetProductsOK() *GetProductsOK {
|
||||
return &GetProductsOK{}
|
||||
}
|
||||
|
||||
/*GetProductsOK handles this case with default header values.
|
||||
|
||||
Products were successfully retrieved
|
||||
*/
|
||||
type GetProductsOK struct {
|
||||
Payload *blaze_models.ProductsResponse
|
||||
}
|
||||
|
||||
func (o *GetProductsOK) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/products][%d] getProductsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetProductsOK) GetPayload() *blaze_models.ProductsResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetProductsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(blaze_models.ProductsResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetProductsUnauthorized creates a GetProductsUnauthorized with default headers values
|
||||
func NewGetProductsUnauthorized() *GetProductsUnauthorized {
|
||||
return &GetProductsUnauthorized{}
|
||||
}
|
||||
|
||||
/*GetProductsUnauthorized handles this case with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type GetProductsUnauthorized struct {
|
||||
Payload *blaze_models.Error
|
||||
}
|
||||
|
||||
func (o *GetProductsUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/products][%d] getProductsUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetProductsUnauthorized) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetProductsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(blaze_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetProductsForbidden creates a GetProductsForbidden with default headers values
|
||||
func NewGetProductsForbidden() *GetProductsForbidden {
|
||||
return &GetProductsForbidden{}
|
||||
}
|
||||
|
||||
/*GetProductsForbidden handles this case with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type GetProductsForbidden struct {
|
||||
Payload *blaze_models.Error
|
||||
}
|
||||
|
||||
func (o *GetProductsForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/products][%d] getProductsForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetProductsForbidden) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetProductsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(blaze_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetProductsNotFound creates a GetProductsNotFound with default headers values
|
||||
func NewGetProductsNotFound() *GetProductsNotFound {
|
||||
return &GetProductsNotFound{}
|
||||
}
|
||||
|
||||
/*GetProductsNotFound handles this case with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type GetProductsNotFound struct {
|
||||
Payload *blaze_models.Error
|
||||
}
|
||||
|
||||
func (o *GetProductsNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/products][%d] getProductsNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetProductsNotFound) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetProductsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(blaze_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetProductsInternalServerError creates a GetProductsInternalServerError with default headers values
|
||||
func NewGetProductsInternalServerError() *GetProductsInternalServerError {
|
||||
return &GetProductsInternalServerError{}
|
||||
}
|
||||
|
||||
/*GetProductsInternalServerError handles this case with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type GetProductsInternalServerError struct {
|
||||
Payload *blaze_models.Error
|
||||
}
|
||||
|
||||
func (o *GetProductsInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/products][%d] getProductsInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetProductsInternalServerError) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetProductsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(blaze_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,114 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package products
|
||||
|
||||
// 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 products API client.
|
||||
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
|
||||
return &Client{transport: transport, formats: formats}
|
||||
}
|
||||
|
||||
/*
|
||||
Client for products API
|
||||
*/
|
||||
type Client struct {
|
||||
transport runtime.ClientTransport
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ClientService is the interface for Client methods
|
||||
type ClientService interface {
|
||||
GetProduct(params *GetProductParams, authInfo runtime.ClientAuthInfoWriter) (*GetProductOK, error)
|
||||
|
||||
GetProducts(params *GetProductsParams, authInfo runtime.ClientAuthInfoWriter) (*GetProductsOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
||||
/*
|
||||
GetProduct Get A Product
|
||||
*/
|
||||
func (a *Client) GetProduct(params *GetProductParams, authInfo runtime.ClientAuthInfoWriter) (*GetProductOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetProductParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "getProduct",
|
||||
Method: "GET",
|
||||
PathPattern: "/partner/products/{productId}",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"https"},
|
||||
Params: params,
|
||||
Reader: &GetProductReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*GetProductOK)
|
||||
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 getProduct: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
GetProducts Get All Products
|
||||
*/
|
||||
func (a *Client) GetProducts(params *GetProductsParams, authInfo runtime.ClientAuthInfoWriter) (*GetProductsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetProductsParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "getProducts",
|
||||
Method: "GET",
|
||||
PathPattern: "/partner/products",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"https"},
|
||||
Params: params,
|
||||
Reader: &GetProductsReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*GetProductsOK)
|
||||
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 getProducts: 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
|
||||
}
|
|
@ -0,0 +1,233 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package purchase_orders
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// NewGetPurchaseOrderListParams creates a new GetPurchaseOrderListParams object
|
||||
// with the default values initialized.
|
||||
func NewGetPurchaseOrderListParams() *GetPurchaseOrderListParams {
|
||||
var ()
|
||||
return &GetPurchaseOrderListParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetPurchaseOrderListParamsWithTimeout creates a new GetPurchaseOrderListParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewGetPurchaseOrderListParamsWithTimeout(timeout time.Duration) *GetPurchaseOrderListParams {
|
||||
var ()
|
||||
return &GetPurchaseOrderListParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetPurchaseOrderListParamsWithContext creates a new GetPurchaseOrderListParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewGetPurchaseOrderListParamsWithContext(ctx context.Context) *GetPurchaseOrderListParams {
|
||||
var ()
|
||||
return &GetPurchaseOrderListParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetPurchaseOrderListParamsWithHTTPClient creates a new GetPurchaseOrderListParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewGetPurchaseOrderListParamsWithHTTPClient(client *http.Client) *GetPurchaseOrderListParams {
|
||||
var ()
|
||||
return &GetPurchaseOrderListParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*GetPurchaseOrderListParams contains all the parameters to send to the API endpoint
|
||||
for the get purchase order list operation typically these are written to a http.Request
|
||||
*/
|
||||
type GetPurchaseOrderListParams struct {
|
||||
|
||||
/*EndDate
|
||||
The end date of transaction query
|
||||
|
||||
*/
|
||||
EndDate string
|
||||
/*Limit
|
||||
The number of records to retrieve
|
||||
|
||||
*/
|
||||
Limit *float64
|
||||
/*Start
|
||||
The starting record in multi-record retrievals
|
||||
|
||||
*/
|
||||
Start *float64
|
||||
/*StartDate
|
||||
The start date of transaction query
|
||||
|
||||
*/
|
||||
StartDate string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get purchase order list params
|
||||
func (o *GetPurchaseOrderListParams) WithTimeout(timeout time.Duration) *GetPurchaseOrderListParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get purchase order list params
|
||||
func (o *GetPurchaseOrderListParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get purchase order list params
|
||||
func (o *GetPurchaseOrderListParams) WithContext(ctx context.Context) *GetPurchaseOrderListParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get purchase order list params
|
||||
func (o *GetPurchaseOrderListParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get purchase order list params
|
||||
func (o *GetPurchaseOrderListParams) WithHTTPClient(client *http.Client) *GetPurchaseOrderListParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get purchase order list params
|
||||
func (o *GetPurchaseOrderListParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithEndDate adds the endDate to the get purchase order list params
|
||||
func (o *GetPurchaseOrderListParams) WithEndDate(endDate string) *GetPurchaseOrderListParams {
|
||||
o.SetEndDate(endDate)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetEndDate adds the endDate to the get purchase order list params
|
||||
func (o *GetPurchaseOrderListParams) SetEndDate(endDate string) {
|
||||
o.EndDate = endDate
|
||||
}
|
||||
|
||||
// WithLimit adds the limit to the get purchase order list params
|
||||
func (o *GetPurchaseOrderListParams) WithLimit(limit *float64) *GetPurchaseOrderListParams {
|
||||
o.SetLimit(limit)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetLimit adds the limit to the get purchase order list params
|
||||
func (o *GetPurchaseOrderListParams) SetLimit(limit *float64) {
|
||||
o.Limit = limit
|
||||
}
|
||||
|
||||
// WithStart adds the start to the get purchase order list params
|
||||
func (o *GetPurchaseOrderListParams) WithStart(start *float64) *GetPurchaseOrderListParams {
|
||||
o.SetStart(start)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetStart adds the start to the get purchase order list params
|
||||
func (o *GetPurchaseOrderListParams) SetStart(start *float64) {
|
||||
o.Start = start
|
||||
}
|
||||
|
||||
// WithStartDate adds the startDate to the get purchase order list params
|
||||
func (o *GetPurchaseOrderListParams) WithStartDate(startDate string) *GetPurchaseOrderListParams {
|
||||
o.SetStartDate(startDate)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetStartDate adds the startDate to the get purchase order list params
|
||||
func (o *GetPurchaseOrderListParams) SetStartDate(startDate string) {
|
||||
o.StartDate = startDate
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetPurchaseOrderListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
// query param endDate
|
||||
qrEndDate := o.EndDate
|
||||
qEndDate := qrEndDate
|
||||
if qEndDate != "" {
|
||||
if err := r.SetQueryParam("endDate", qEndDate); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if o.Limit != nil {
|
||||
|
||||
// query param limit
|
||||
var qrLimit float64
|
||||
if o.Limit != nil {
|
||||
qrLimit = *o.Limit
|
||||
}
|
||||
qLimit := swag.FormatFloat64(qrLimit)
|
||||
if qLimit != "" {
|
||||
if err := r.SetQueryParam("limit", qLimit); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if o.Start != nil {
|
||||
|
||||
// query param start
|
||||
var qrStart float64
|
||||
if o.Start != nil {
|
||||
qrStart = *o.Start
|
||||
}
|
||||
qStart := swag.FormatFloat64(qrStart)
|
||||
if qStart != "" {
|
||||
if err := r.SetQueryParam("start", qStart); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// query param startDate
|
||||
qrStartDate := o.StartDate
|
||||
qStartDate := qrStartDate
|
||||
if qStartDate != "" {
|
||||
if err := r.SetQueryParam("startDate", qStartDate); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,229 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package purchase_orders
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/taxnexus/go/lib/api/blaze/blaze_models"
|
||||
)
|
||||
|
||||
// GetPurchaseOrderListReader is a Reader for the GetPurchaseOrderList structure.
|
||||
type GetPurchaseOrderListReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetPurchaseOrderListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetPurchaseOrderListOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewGetPurchaseOrderListUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewGetPurchaseOrderListForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewGetPurchaseOrderListNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewGetPurchaseOrderListInternalServerError()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetPurchaseOrderListOK creates a GetPurchaseOrderListOK with default headers values
|
||||
func NewGetPurchaseOrderListOK() *GetPurchaseOrderListOK {
|
||||
return &GetPurchaseOrderListOK{}
|
||||
}
|
||||
|
||||
/*GetPurchaseOrderListOK handles this case with default header values.
|
||||
|
||||
Shop was successfully retrieved
|
||||
*/
|
||||
type GetPurchaseOrderListOK struct {
|
||||
Payload *blaze_models.PurchaseOrderListResponse
|
||||
}
|
||||
|
||||
func (o *GetPurchaseOrderListOK) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/store/purchaseOrder/list][%d] getPurchaseOrderListOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetPurchaseOrderListOK) GetPayload() *blaze_models.PurchaseOrderListResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetPurchaseOrderListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(blaze_models.PurchaseOrderListResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetPurchaseOrderListUnauthorized creates a GetPurchaseOrderListUnauthorized with default headers values
|
||||
func NewGetPurchaseOrderListUnauthorized() *GetPurchaseOrderListUnauthorized {
|
||||
return &GetPurchaseOrderListUnauthorized{}
|
||||
}
|
||||
|
||||
/*GetPurchaseOrderListUnauthorized handles this case with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type GetPurchaseOrderListUnauthorized struct {
|
||||
Payload *blaze_models.Error
|
||||
}
|
||||
|
||||
func (o *GetPurchaseOrderListUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/store/purchaseOrder/list][%d] getPurchaseOrderListUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetPurchaseOrderListUnauthorized) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetPurchaseOrderListUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(blaze_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetPurchaseOrderListForbidden creates a GetPurchaseOrderListForbidden with default headers values
|
||||
func NewGetPurchaseOrderListForbidden() *GetPurchaseOrderListForbidden {
|
||||
return &GetPurchaseOrderListForbidden{}
|
||||
}
|
||||
|
||||
/*GetPurchaseOrderListForbidden handles this case with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type GetPurchaseOrderListForbidden struct {
|
||||
Payload *blaze_models.Error
|
||||
}
|
||||
|
||||
func (o *GetPurchaseOrderListForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/store/purchaseOrder/list][%d] getPurchaseOrderListForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetPurchaseOrderListForbidden) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetPurchaseOrderListForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(blaze_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetPurchaseOrderListNotFound creates a GetPurchaseOrderListNotFound with default headers values
|
||||
func NewGetPurchaseOrderListNotFound() *GetPurchaseOrderListNotFound {
|
||||
return &GetPurchaseOrderListNotFound{}
|
||||
}
|
||||
|
||||
/*GetPurchaseOrderListNotFound handles this case with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type GetPurchaseOrderListNotFound struct {
|
||||
Payload *blaze_models.Error
|
||||
}
|
||||
|
||||
func (o *GetPurchaseOrderListNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/store/purchaseOrder/list][%d] getPurchaseOrderListNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetPurchaseOrderListNotFound) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetPurchaseOrderListNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(blaze_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetPurchaseOrderListInternalServerError creates a GetPurchaseOrderListInternalServerError with default headers values
|
||||
func NewGetPurchaseOrderListInternalServerError() *GetPurchaseOrderListInternalServerError {
|
||||
return &GetPurchaseOrderListInternalServerError{}
|
||||
}
|
||||
|
||||
/*GetPurchaseOrderListInternalServerError handles this case with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type GetPurchaseOrderListInternalServerError struct {
|
||||
Payload *blaze_models.Error
|
||||
}
|
||||
|
||||
func (o *GetPurchaseOrderListInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/store/purchaseOrder/list][%d] getPurchaseOrderListInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetPurchaseOrderListInternalServerError) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetPurchaseOrderListInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(blaze_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,77 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package purchase_orders
|
||||
|
||||
// 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 purchase orders API client.
|
||||
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
|
||||
return &Client{transport: transport, formats: formats}
|
||||
}
|
||||
|
||||
/*
|
||||
Client for purchase orders API
|
||||
*/
|
||||
type Client struct {
|
||||
transport runtime.ClientTransport
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ClientService is the interface for Client methods
|
||||
type ClientService interface {
|
||||
GetPurchaseOrderList(params *GetPurchaseOrderListParams, authInfo runtime.ClientAuthInfoWriter) (*GetPurchaseOrderListOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
||||
/*
|
||||
GetPurchaseOrderList Get a list of purchase orders
|
||||
*/
|
||||
func (a *Client) GetPurchaseOrderList(params *GetPurchaseOrderListParams, authInfo runtime.ClientAuthInfoWriter) (*GetPurchaseOrderListOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetPurchaseOrderListParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "getPurchaseOrderList",
|
||||
Method: "GET",
|
||||
PathPattern: "/partner/store/purchaseOrder/list",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"https"},
|
||||
Params: params,
|
||||
Reader: &GetPurchaseOrderListReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*GetPurchaseOrderListOK)
|
||||
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 getPurchaseOrderList: 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
|
||||
}
|
|
@ -0,0 +1,116 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package shop
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// NewGetShopParams creates a new GetShopParams object
|
||||
// with the default values initialized.
|
||||
func NewGetShopParams() *GetShopParams {
|
||||
|
||||
return &GetShopParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetShopParamsWithTimeout creates a new GetShopParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewGetShopParamsWithTimeout(timeout time.Duration) *GetShopParams {
|
||||
|
||||
return &GetShopParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetShopParamsWithContext creates a new GetShopParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewGetShopParamsWithContext(ctx context.Context) *GetShopParams {
|
||||
|
||||
return &GetShopParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetShopParamsWithHTTPClient creates a new GetShopParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewGetShopParamsWithHTTPClient(client *http.Client) *GetShopParams {
|
||||
|
||||
return &GetShopParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*GetShopParams contains all the parameters to send to the API endpoint
|
||||
for the get shop operation typically these are written to a http.Request
|
||||
*/
|
||||
type GetShopParams struct {
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get shop params
|
||||
func (o *GetShopParams) WithTimeout(timeout time.Duration) *GetShopParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get shop params
|
||||
func (o *GetShopParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get shop params
|
||||
func (o *GetShopParams) WithContext(ctx context.Context) *GetShopParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get shop params
|
||||
func (o *GetShopParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get shop params
|
||||
func (o *GetShopParams) WithHTTPClient(client *http.Client) *GetShopParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get shop params
|
||||
func (o *GetShopParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetShopParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,229 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package shop
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/taxnexus/go/lib/api/blaze/blaze_models"
|
||||
)
|
||||
|
||||
// GetShopReader is a Reader for the GetShop structure.
|
||||
type GetShopReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetShopReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetShopOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewGetShopUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewGetShopForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewGetShopNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewGetShopInternalServerError()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetShopOK creates a GetShopOK with default headers values
|
||||
func NewGetShopOK() *GetShopOK {
|
||||
return &GetShopOK{}
|
||||
}
|
||||
|
||||
/*GetShopOK handles this case with default header values.
|
||||
|
||||
Shop was successfully retrieved
|
||||
*/
|
||||
type GetShopOK struct {
|
||||
Payload *blaze_models.ShopResponse
|
||||
}
|
||||
|
||||
func (o *GetShopOK) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/store][%d] getShopOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetShopOK) GetPayload() *blaze_models.ShopResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetShopOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(blaze_models.ShopResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetShopUnauthorized creates a GetShopUnauthorized with default headers values
|
||||
func NewGetShopUnauthorized() *GetShopUnauthorized {
|
||||
return &GetShopUnauthorized{}
|
||||
}
|
||||
|
||||
/*GetShopUnauthorized handles this case with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type GetShopUnauthorized struct {
|
||||
Payload *blaze_models.Error
|
||||
}
|
||||
|
||||
func (o *GetShopUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/store][%d] getShopUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetShopUnauthorized) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetShopUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(blaze_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetShopForbidden creates a GetShopForbidden with default headers values
|
||||
func NewGetShopForbidden() *GetShopForbidden {
|
||||
return &GetShopForbidden{}
|
||||
}
|
||||
|
||||
/*GetShopForbidden handles this case with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type GetShopForbidden struct {
|
||||
Payload *blaze_models.Error
|
||||
}
|
||||
|
||||
func (o *GetShopForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/store][%d] getShopForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetShopForbidden) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetShopForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(blaze_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetShopNotFound creates a GetShopNotFound with default headers values
|
||||
func NewGetShopNotFound() *GetShopNotFound {
|
||||
return &GetShopNotFound{}
|
||||
}
|
||||
|
||||
/*GetShopNotFound handles this case with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type GetShopNotFound struct {
|
||||
Payload *blaze_models.Error
|
||||
}
|
||||
|
||||
func (o *GetShopNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/store][%d] getShopNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetShopNotFound) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetShopNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(blaze_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetShopInternalServerError creates a GetShopInternalServerError with default headers values
|
||||
func NewGetShopInternalServerError() *GetShopInternalServerError {
|
||||
return &GetShopInternalServerError{}
|
||||
}
|
||||
|
||||
/*GetShopInternalServerError handles this case with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type GetShopInternalServerError struct {
|
||||
Payload *blaze_models.Error
|
||||
}
|
||||
|
||||
func (o *GetShopInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/store][%d] getShopInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetShopInternalServerError) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetShopInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(blaze_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,77 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package shop
|
||||
|
||||
// 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 shop API client.
|
||||
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
|
||||
return &Client{transport: transport, formats: formats}
|
||||
}
|
||||
|
||||
/*
|
||||
Client for shop API
|
||||
*/
|
||||
type Client struct {
|
||||
transport runtime.ClientTransport
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ClientService is the interface for Client methods
|
||||
type ClientService interface {
|
||||
GetShop(params *GetShopParams, authInfo runtime.ClientAuthInfoWriter) (*GetShopOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
||||
/*
|
||||
GetShop Get basic Shop parameters
|
||||
*/
|
||||
func (a *Client) GetShop(params *GetShopParams, authInfo runtime.ClientAuthInfoWriter) (*GetShopOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetShopParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "getShop",
|
||||
Method: "GET",
|
||||
PathPattern: "/partner/store",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"https"},
|
||||
Params: params,
|
||||
Reader: &GetShopReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*GetShopOK)
|
||||
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 getShop: 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
|
||||
}
|
|
@ -0,0 +1,139 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package transactions
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// NewGetTransactionByIDParams creates a new GetTransactionByIDParams object
|
||||
// with the default values initialized.
|
||||
func NewGetTransactionByIDParams() *GetTransactionByIDParams {
|
||||
var ()
|
||||
return &GetTransactionByIDParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetTransactionByIDParamsWithTimeout creates a new GetTransactionByIDParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewGetTransactionByIDParamsWithTimeout(timeout time.Duration) *GetTransactionByIDParams {
|
||||
var ()
|
||||
return &GetTransactionByIDParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetTransactionByIDParamsWithContext creates a new GetTransactionByIDParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewGetTransactionByIDParamsWithContext(ctx context.Context) *GetTransactionByIDParams {
|
||||
var ()
|
||||
return &GetTransactionByIDParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetTransactionByIDParamsWithHTTPClient creates a new GetTransactionByIDParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewGetTransactionByIDParamsWithHTTPClient(client *http.Client) *GetTransactionByIDParams {
|
||||
var ()
|
||||
return &GetTransactionByIDParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*GetTransactionByIDParams contains all the parameters to send to the API endpoint
|
||||
for the get transaction by Id operation typically these are written to a http.Request
|
||||
*/
|
||||
type GetTransactionByIDParams struct {
|
||||
|
||||
/*ItemNumber
|
||||
The Blaze Transaction Number
|
||||
|
||||
*/
|
||||
ItemNumber string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get transaction by Id params
|
||||
func (o *GetTransactionByIDParams) WithTimeout(timeout time.Duration) *GetTransactionByIDParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get transaction by Id params
|
||||
func (o *GetTransactionByIDParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get transaction by Id params
|
||||
func (o *GetTransactionByIDParams) WithContext(ctx context.Context) *GetTransactionByIDParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get transaction by Id params
|
||||
func (o *GetTransactionByIDParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get transaction by Id params
|
||||
func (o *GetTransactionByIDParams) WithHTTPClient(client *http.Client) *GetTransactionByIDParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get transaction by Id params
|
||||
func (o *GetTransactionByIDParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithItemNumber adds the itemNumber to the get transaction by Id params
|
||||
func (o *GetTransactionByIDParams) WithItemNumber(itemNumber string) *GetTransactionByIDParams {
|
||||
o.SetItemNumber(itemNumber)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetItemNumber adds the itemNumber to the get transaction by Id params
|
||||
func (o *GetTransactionByIDParams) SetItemNumber(itemNumber string) {
|
||||
o.ItemNumber = itemNumber
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetTransactionByIDParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
// path param itemNumber
|
||||
if err := r.SetPathParam("itemNumber", o.ItemNumber); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,229 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package transactions
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/taxnexus/go/lib/api/blaze/blaze_models"
|
||||
)
|
||||
|
||||
// GetTransactionByIDReader is a Reader for the GetTransactionByID structure.
|
||||
type GetTransactionByIDReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetTransactionByIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetTransactionByIDOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewGetTransactionByIDUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewGetTransactionByIDForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewGetTransactionByIDNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewGetTransactionByIDInternalServerError()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetTransactionByIDOK creates a GetTransactionByIDOK with default headers values
|
||||
func NewGetTransactionByIDOK() *GetTransactionByIDOK {
|
||||
return &GetTransactionByIDOK{}
|
||||
}
|
||||
|
||||
/*GetTransactionByIDOK handles this case with default header values.
|
||||
|
||||
A Transaction was successfully retrieved
|
||||
*/
|
||||
type GetTransactionByIDOK struct {
|
||||
Payload *blaze_models.TransactionByIDResponse
|
||||
}
|
||||
|
||||
func (o *GetTransactionByIDOK) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/transactions/{itemNumber}][%d] getTransactionByIdOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetTransactionByIDOK) GetPayload() *blaze_models.TransactionByIDResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetTransactionByIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(blaze_models.TransactionByIDResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetTransactionByIDUnauthorized creates a GetTransactionByIDUnauthorized with default headers values
|
||||
func NewGetTransactionByIDUnauthorized() *GetTransactionByIDUnauthorized {
|
||||
return &GetTransactionByIDUnauthorized{}
|
||||
}
|
||||
|
||||
/*GetTransactionByIDUnauthorized handles this case with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type GetTransactionByIDUnauthorized struct {
|
||||
Payload *blaze_models.Error
|
||||
}
|
||||
|
||||
func (o *GetTransactionByIDUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/transactions/{itemNumber}][%d] getTransactionByIdUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetTransactionByIDUnauthorized) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetTransactionByIDUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(blaze_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetTransactionByIDForbidden creates a GetTransactionByIDForbidden with default headers values
|
||||
func NewGetTransactionByIDForbidden() *GetTransactionByIDForbidden {
|
||||
return &GetTransactionByIDForbidden{}
|
||||
}
|
||||
|
||||
/*GetTransactionByIDForbidden handles this case with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type GetTransactionByIDForbidden struct {
|
||||
Payload *blaze_models.Error
|
||||
}
|
||||
|
||||
func (o *GetTransactionByIDForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/transactions/{itemNumber}][%d] getTransactionByIdForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetTransactionByIDForbidden) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetTransactionByIDForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(blaze_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetTransactionByIDNotFound creates a GetTransactionByIDNotFound with default headers values
|
||||
func NewGetTransactionByIDNotFound() *GetTransactionByIDNotFound {
|
||||
return &GetTransactionByIDNotFound{}
|
||||
}
|
||||
|
||||
/*GetTransactionByIDNotFound handles this case with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type GetTransactionByIDNotFound struct {
|
||||
Payload *blaze_models.Error
|
||||
}
|
||||
|
||||
func (o *GetTransactionByIDNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/transactions/{itemNumber}][%d] getTransactionByIdNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetTransactionByIDNotFound) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetTransactionByIDNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(blaze_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetTransactionByIDInternalServerError creates a GetTransactionByIDInternalServerError with default headers values
|
||||
func NewGetTransactionByIDInternalServerError() *GetTransactionByIDInternalServerError {
|
||||
return &GetTransactionByIDInternalServerError{}
|
||||
}
|
||||
|
||||
/*GetTransactionByIDInternalServerError handles this case with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type GetTransactionByIDInternalServerError struct {
|
||||
Payload *blaze_models.Error
|
||||
}
|
||||
|
||||
func (o *GetTransactionByIDInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/transactions/{itemNumber}][%d] getTransactionByIdInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetTransactionByIDInternalServerError) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetTransactionByIDInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(blaze_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,233 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package transactions
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// NewGetTransactionsParams creates a new GetTransactionsParams object
|
||||
// with the default values initialized.
|
||||
func NewGetTransactionsParams() *GetTransactionsParams {
|
||||
var ()
|
||||
return &GetTransactionsParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetTransactionsParamsWithTimeout creates a new GetTransactionsParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewGetTransactionsParamsWithTimeout(timeout time.Duration) *GetTransactionsParams {
|
||||
var ()
|
||||
return &GetTransactionsParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetTransactionsParamsWithContext creates a new GetTransactionsParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewGetTransactionsParamsWithContext(ctx context.Context) *GetTransactionsParams {
|
||||
var ()
|
||||
return &GetTransactionsParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetTransactionsParamsWithHTTPClient creates a new GetTransactionsParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewGetTransactionsParamsWithHTTPClient(client *http.Client) *GetTransactionsParams {
|
||||
var ()
|
||||
return &GetTransactionsParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*GetTransactionsParams contains all the parameters to send to the API endpoint
|
||||
for the get transactions operation typically these are written to a http.Request
|
||||
*/
|
||||
type GetTransactionsParams struct {
|
||||
|
||||
/*EndDate
|
||||
The end date of transaction query
|
||||
|
||||
*/
|
||||
EndDate string
|
||||
/*Limit
|
||||
The number of records to retrieve
|
||||
|
||||
*/
|
||||
Limit *float64
|
||||
/*Start
|
||||
The starting record in multi-record retrievals
|
||||
|
||||
*/
|
||||
Start *float64
|
||||
/*StartDate
|
||||
The start date of transaction query
|
||||
|
||||
*/
|
||||
StartDate string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get transactions params
|
||||
func (o *GetTransactionsParams) WithTimeout(timeout time.Duration) *GetTransactionsParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get transactions params
|
||||
func (o *GetTransactionsParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get transactions params
|
||||
func (o *GetTransactionsParams) WithContext(ctx context.Context) *GetTransactionsParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get transactions params
|
||||
func (o *GetTransactionsParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get transactions params
|
||||
func (o *GetTransactionsParams) WithHTTPClient(client *http.Client) *GetTransactionsParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get transactions params
|
||||
func (o *GetTransactionsParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithEndDate adds the endDate to the get transactions params
|
||||
func (o *GetTransactionsParams) WithEndDate(endDate string) *GetTransactionsParams {
|
||||
o.SetEndDate(endDate)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetEndDate adds the endDate to the get transactions params
|
||||
func (o *GetTransactionsParams) SetEndDate(endDate string) {
|
||||
o.EndDate = endDate
|
||||
}
|
||||
|
||||
// WithLimit adds the limit to the get transactions params
|
||||
func (o *GetTransactionsParams) WithLimit(limit *float64) *GetTransactionsParams {
|
||||
o.SetLimit(limit)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetLimit adds the limit to the get transactions params
|
||||
func (o *GetTransactionsParams) SetLimit(limit *float64) {
|
||||
o.Limit = limit
|
||||
}
|
||||
|
||||
// WithStart adds the start to the get transactions params
|
||||
func (o *GetTransactionsParams) WithStart(start *float64) *GetTransactionsParams {
|
||||
o.SetStart(start)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetStart adds the start to the get transactions params
|
||||
func (o *GetTransactionsParams) SetStart(start *float64) {
|
||||
o.Start = start
|
||||
}
|
||||
|
||||
// WithStartDate adds the startDate to the get transactions params
|
||||
func (o *GetTransactionsParams) WithStartDate(startDate string) *GetTransactionsParams {
|
||||
o.SetStartDate(startDate)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetStartDate adds the startDate to the get transactions params
|
||||
func (o *GetTransactionsParams) SetStartDate(startDate string) {
|
||||
o.StartDate = startDate
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetTransactionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
// query param endDate
|
||||
qrEndDate := o.EndDate
|
||||
qEndDate := qrEndDate
|
||||
if qEndDate != "" {
|
||||
if err := r.SetQueryParam("endDate", qEndDate); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if o.Limit != nil {
|
||||
|
||||
// query param limit
|
||||
var qrLimit float64
|
||||
if o.Limit != nil {
|
||||
qrLimit = *o.Limit
|
||||
}
|
||||
qLimit := swag.FormatFloat64(qrLimit)
|
||||
if qLimit != "" {
|
||||
if err := r.SetQueryParam("limit", qLimit); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if o.Start != nil {
|
||||
|
||||
// query param start
|
||||
var qrStart float64
|
||||
if o.Start != nil {
|
||||
qrStart = *o.Start
|
||||
}
|
||||
qStart := swag.FormatFloat64(qrStart)
|
||||
if qStart != "" {
|
||||
if err := r.SetQueryParam("start", qStart); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// query param startDate
|
||||
qrStartDate := o.StartDate
|
||||
qStartDate := qrStartDate
|
||||
if qStartDate != "" {
|
||||
if err := r.SetQueryParam("startDate", qStartDate); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,229 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package transactions
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/taxnexus/go/lib/api/blaze/blaze_models"
|
||||
)
|
||||
|
||||
// GetTransactionsReader is a Reader for the GetTransactions structure.
|
||||
type GetTransactionsReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetTransactionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetTransactionsOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewGetTransactionsUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewGetTransactionsForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewGetTransactionsNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewGetTransactionsInternalServerError()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetTransactionsOK creates a GetTransactionsOK with default headers values
|
||||
func NewGetTransactionsOK() *GetTransactionsOK {
|
||||
return &GetTransactionsOK{}
|
||||
}
|
||||
|
||||
/*GetTransactionsOK handles this case with default header values.
|
||||
|
||||
Transactions were successfully retrieved
|
||||
*/
|
||||
type GetTransactionsOK struct {
|
||||
Payload *blaze_models.TransactionsResponse
|
||||
}
|
||||
|
||||
func (o *GetTransactionsOK) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/transactions][%d] getTransactionsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetTransactionsOK) GetPayload() *blaze_models.TransactionsResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetTransactionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(blaze_models.TransactionsResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetTransactionsUnauthorized creates a GetTransactionsUnauthorized with default headers values
|
||||
func NewGetTransactionsUnauthorized() *GetTransactionsUnauthorized {
|
||||
return &GetTransactionsUnauthorized{}
|
||||
}
|
||||
|
||||
/*GetTransactionsUnauthorized handles this case with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type GetTransactionsUnauthorized struct {
|
||||
Payload *blaze_models.Error
|
||||
}
|
||||
|
||||
func (o *GetTransactionsUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/transactions][%d] getTransactionsUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetTransactionsUnauthorized) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetTransactionsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(blaze_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetTransactionsForbidden creates a GetTransactionsForbidden with default headers values
|
||||
func NewGetTransactionsForbidden() *GetTransactionsForbidden {
|
||||
return &GetTransactionsForbidden{}
|
||||
}
|
||||
|
||||
/*GetTransactionsForbidden handles this case with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type GetTransactionsForbidden struct {
|
||||
Payload *blaze_models.Error
|
||||
}
|
||||
|
||||
func (o *GetTransactionsForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/transactions][%d] getTransactionsForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetTransactionsForbidden) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetTransactionsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(blaze_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetTransactionsNotFound creates a GetTransactionsNotFound with default headers values
|
||||
func NewGetTransactionsNotFound() *GetTransactionsNotFound {
|
||||
return &GetTransactionsNotFound{}
|
||||
}
|
||||
|
||||
/*GetTransactionsNotFound handles this case with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type GetTransactionsNotFound struct {
|
||||
Payload *blaze_models.Error
|
||||
}
|
||||
|
||||
func (o *GetTransactionsNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/transactions][%d] getTransactionsNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetTransactionsNotFound) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetTransactionsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(blaze_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetTransactionsInternalServerError creates a GetTransactionsInternalServerError with default headers values
|
||||
func NewGetTransactionsInternalServerError() *GetTransactionsInternalServerError {
|
||||
return &GetTransactionsInternalServerError{}
|
||||
}
|
||||
|
||||
/*GetTransactionsInternalServerError handles this case with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type GetTransactionsInternalServerError struct {
|
||||
Payload *blaze_models.Error
|
||||
}
|
||||
|
||||
func (o *GetTransactionsInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/transactions][%d] getTransactionsInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetTransactionsInternalServerError) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetTransactionsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(blaze_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,114 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package transactions
|
||||
|
||||
// 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 transactions API client.
|
||||
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
|
||||
return &Client{transport: transport, formats: formats}
|
||||
}
|
||||
|
||||
/*
|
||||
Client for transactions API
|
||||
*/
|
||||
type Client struct {
|
||||
transport runtime.ClientTransport
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ClientService is the interface for Client methods
|
||||
type ClientService interface {
|
||||
GetTransactionByID(params *GetTransactionByIDParams, authInfo runtime.ClientAuthInfoWriter) (*GetTransactionByIDOK, error)
|
||||
|
||||
GetTransactions(params *GetTransactionsParams, authInfo runtime.ClientAuthInfoWriter) (*GetTransactionsOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
||||
/*
|
||||
GetTransactionByID Get a single transaction by ID
|
||||
*/
|
||||
func (a *Client) GetTransactionByID(params *GetTransactionByIDParams, authInfo runtime.ClientAuthInfoWriter) (*GetTransactionByIDOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetTransactionByIDParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "getTransactionById",
|
||||
Method: "GET",
|
||||
PathPattern: "/partner/transactions/{itemNumber}",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"https"},
|
||||
Params: params,
|
||||
Reader: &GetTransactionByIDReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*GetTransactionByIDOK)
|
||||
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 getTransactionById: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
GetTransactions Get a Range of Transactions
|
||||
*/
|
||||
func (a *Client) GetTransactions(params *GetTransactionsParams, authInfo runtime.ClientAuthInfoWriter) (*GetTransactionsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetTransactionsParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "getTransactions",
|
||||
Method: "GET",
|
||||
PathPattern: "/partner/transactions",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"https"},
|
||||
Params: params,
|
||||
Reader: &GetTransactionsReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*GetTransactionsOK)
|
||||
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 getTransactions: 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
|
||||
}
|
|
@ -0,0 +1,139 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package vendors
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// NewGetVendorParams creates a new GetVendorParams object
|
||||
// with the default values initialized.
|
||||
func NewGetVendorParams() *GetVendorParams {
|
||||
var ()
|
||||
return &GetVendorParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetVendorParamsWithTimeout creates a new GetVendorParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewGetVendorParamsWithTimeout(timeout time.Duration) *GetVendorParams {
|
||||
var ()
|
||||
return &GetVendorParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetVendorParamsWithContext creates a new GetVendorParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewGetVendorParamsWithContext(ctx context.Context) *GetVendorParams {
|
||||
var ()
|
||||
return &GetVendorParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetVendorParamsWithHTTPClient creates a new GetVendorParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewGetVendorParamsWithHTTPClient(client *http.Client) *GetVendorParams {
|
||||
var ()
|
||||
return &GetVendorParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*GetVendorParams contains all the parameters to send to the API endpoint
|
||||
for the get vendor operation typically these are written to a http.Request
|
||||
*/
|
||||
type GetVendorParams struct {
|
||||
|
||||
/*VendorID
|
||||
The Blaze Vendor Object Id
|
||||
|
||||
*/
|
||||
VendorID string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get vendor params
|
||||
func (o *GetVendorParams) WithTimeout(timeout time.Duration) *GetVendorParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get vendor params
|
||||
func (o *GetVendorParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get vendor params
|
||||
func (o *GetVendorParams) WithContext(ctx context.Context) *GetVendorParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get vendor params
|
||||
func (o *GetVendorParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get vendor params
|
||||
func (o *GetVendorParams) WithHTTPClient(client *http.Client) *GetVendorParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get vendor params
|
||||
func (o *GetVendorParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithVendorID adds the vendorID to the get vendor params
|
||||
func (o *GetVendorParams) WithVendorID(vendorID string) *GetVendorParams {
|
||||
o.SetVendorID(vendorID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetVendorID adds the vendorId to the get vendor params
|
||||
func (o *GetVendorParams) SetVendorID(vendorID string) {
|
||||
o.VendorID = vendorID
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetVendorParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
// path param vendorId
|
||||
if err := r.SetPathParam("vendorId", o.VendorID); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,229 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package vendors
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/taxnexus/go/lib/api/blaze/blaze_models"
|
||||
)
|
||||
|
||||
// GetVendorReader is a Reader for the GetVendor structure.
|
||||
type GetVendorReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetVendorReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetVendorOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewGetVendorUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewGetVendorForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewGetVendorNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewGetVendorInternalServerError()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetVendorOK creates a GetVendorOK with default headers values
|
||||
func NewGetVendorOK() *GetVendorOK {
|
||||
return &GetVendorOK{}
|
||||
}
|
||||
|
||||
/*GetVendorOK handles this case with default header values.
|
||||
|
||||
Product was successfully retrieved
|
||||
*/
|
||||
type GetVendorOK struct {
|
||||
Payload *blaze_models.VendorResponse
|
||||
}
|
||||
|
||||
func (o *GetVendorOK) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/vendors/{vendorId}][%d] getVendorOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetVendorOK) GetPayload() *blaze_models.VendorResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetVendorOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(blaze_models.VendorResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetVendorUnauthorized creates a GetVendorUnauthorized with default headers values
|
||||
func NewGetVendorUnauthorized() *GetVendorUnauthorized {
|
||||
return &GetVendorUnauthorized{}
|
||||
}
|
||||
|
||||
/*GetVendorUnauthorized handles this case with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type GetVendorUnauthorized struct {
|
||||
Payload *blaze_models.Error
|
||||
}
|
||||
|
||||
func (o *GetVendorUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/vendors/{vendorId}][%d] getVendorUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetVendorUnauthorized) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetVendorUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(blaze_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetVendorForbidden creates a GetVendorForbidden with default headers values
|
||||
func NewGetVendorForbidden() *GetVendorForbidden {
|
||||
return &GetVendorForbidden{}
|
||||
}
|
||||
|
||||
/*GetVendorForbidden handles this case with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type GetVendorForbidden struct {
|
||||
Payload *blaze_models.Error
|
||||
}
|
||||
|
||||
func (o *GetVendorForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/vendors/{vendorId}][%d] getVendorForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetVendorForbidden) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetVendorForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(blaze_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetVendorNotFound creates a GetVendorNotFound with default headers values
|
||||
func NewGetVendorNotFound() *GetVendorNotFound {
|
||||
return &GetVendorNotFound{}
|
||||
}
|
||||
|
||||
/*GetVendorNotFound handles this case with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type GetVendorNotFound struct {
|
||||
Payload *blaze_models.Error
|
||||
}
|
||||
|
||||
func (o *GetVendorNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/vendors/{vendorId}][%d] getVendorNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetVendorNotFound) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetVendorNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(blaze_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetVendorInternalServerError creates a GetVendorInternalServerError with default headers values
|
||||
func NewGetVendorInternalServerError() *GetVendorInternalServerError {
|
||||
return &GetVendorInternalServerError{}
|
||||
}
|
||||
|
||||
/*GetVendorInternalServerError handles this case with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type GetVendorInternalServerError struct {
|
||||
Payload *blaze_models.Error
|
||||
}
|
||||
|
||||
func (o *GetVendorInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/vendors/{vendorId}][%d] getVendorInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetVendorInternalServerError) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetVendorInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(blaze_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,77 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package vendors
|
||||
|
||||
// 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 vendors API client.
|
||||
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
|
||||
return &Client{transport: transport, formats: formats}
|
||||
}
|
||||
|
||||
/*
|
||||
Client for vendors API
|
||||
*/
|
||||
type Client struct {
|
||||
transport runtime.ClientTransport
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ClientService is the interface for Client methods
|
||||
type ClientService interface {
|
||||
GetVendor(params *GetVendorParams, authInfo runtime.ClientAuthInfoWriter) (*GetVendorOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
||||
/*
|
||||
GetVendor Get A Vendor
|
||||
*/
|
||||
func (a *Client) GetVendor(params *GetVendorParams, authInfo runtime.ClientAuthInfoWriter) (*GetVendorOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetVendorParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "getVendor",
|
||||
Method: "GET",
|
||||
PathPattern: "/partner/vendors/{vendorId}",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"https"},
|
||||
Params: params,
|
||||
Reader: &GetVendorReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*GetVendorOK)
|
||||
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 getVendor: 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
|
||||
}
|
|
@ -0,0 +1,80 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package blaze_models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/validate"
|
||||
)
|
||||
|
||||
// Error error
|
||||
//
|
||||
// swagger:model Error
|
||||
type Error struct {
|
||||
|
||||
// error
|
||||
Error string `json:"error,omitempty"`
|
||||
|
||||
// status
|
||||
// Maximum: 600
|
||||
// Minimum: 100
|
||||
Status int64 `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this error
|
||||
func (m *Error) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateStatus(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Error) validateStatus(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Status) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := validate.MinimumInt("status", "body", int64(m.Status), 100, false); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validate.MaximumInt("status", "body", int64(m.Status), 600, false); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *Error) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *Error) UnmarshalBinary(b []byte) error {
|
||||
var res Error
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,104 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package blaze_models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// InvalidError invalid error
|
||||
//
|
||||
// swagger:model InvalidError
|
||||
type InvalidError struct {
|
||||
Error
|
||||
|
||||
// details
|
||||
Details []string `json:"details"`
|
||||
}
|
||||
|
||||
// UnmarshalJSON unmarshals this object from a JSON structure
|
||||
func (m *InvalidError) UnmarshalJSON(raw []byte) error {
|
||||
// AO0
|
||||
var aO0 Error
|
||||
if err := swag.ReadJSON(raw, &aO0); err != nil {
|
||||
return err
|
||||
}
|
||||
m.Error = aO0
|
||||
|
||||
// AO1
|
||||
var dataAO1 struct {
|
||||
Details []string `json:"details"`
|
||||
}
|
||||
if err := swag.ReadJSON(raw, &dataAO1); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
m.Details = dataAO1.Details
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalJSON marshals this object to a JSON structure
|
||||
func (m InvalidError) MarshalJSON() ([]byte, error) {
|
||||
_parts := make([][]byte, 0, 2)
|
||||
|
||||
aO0, err := swag.WriteJSON(m.Error)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
_parts = append(_parts, aO0)
|
||||
var dataAO1 struct {
|
||||
Details []string `json:"details"`
|
||||
}
|
||||
|
||||
dataAO1.Details = m.Details
|
||||
|
||||
jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1)
|
||||
if errAO1 != nil {
|
||||
return nil, errAO1
|
||||
}
|
||||
_parts = append(_parts, jsonDataAO1)
|
||||
return swag.ConcatJSON(_parts...), nil
|
||||
}
|
||||
|
||||
// Validate validates this invalid error
|
||||
func (m *InvalidError) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
// validation for a type composition with Error
|
||||
if err := m.Error.Validate(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *InvalidError) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *InvalidError) UnmarshalBinary(b []byte) error {
|
||||
var res InvalidError
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,855 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package blaze_models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// MemberResponse member response
|
||||
//
|
||||
// swagger:model MemberResponse
|
||||
type MemberResponse struct {
|
||||
|
||||
// active transaction
|
||||
ActiveTransaction float64 `json:"activeTransaction,omitempty"`
|
||||
|
||||
// address
|
||||
Address *MemberResponseAddress `json:"address,omitempty"`
|
||||
|
||||
// addresses
|
||||
Addresses []string `json:"addresses"`
|
||||
|
||||
// agreement expired
|
||||
AgreementExpired bool `json:"agreementExpired,omitempty"`
|
||||
|
||||
// anonymous
|
||||
Anonymous bool `json:"anonymous,omitempty"`
|
||||
|
||||
// ban patient
|
||||
BanPatient bool `json:"banPatient,omitempty"`
|
||||
|
||||
// cannabis result
|
||||
CannabisResult string `json:"cannabisResult,omitempty"`
|
||||
|
||||
// care giver list
|
||||
CareGiverList []string `json:"careGiverList"`
|
||||
|
||||
// care givers
|
||||
CareGivers []string `json:"careGivers"`
|
||||
|
||||
// company Id
|
||||
CompanyID string `json:"companyId,omitempty"`
|
||||
|
||||
// consumer type
|
||||
ConsumerType string `json:"consumerType,omitempty"`
|
||||
|
||||
// consumer user Id
|
||||
ConsumerUserID string `json:"consumerUserId,omitempty"`
|
||||
|
||||
// contracts
|
||||
Contracts []string `json:"contracts"`
|
||||
|
||||
// created
|
||||
Created int64 `json:"created,omitempty"`
|
||||
|
||||
// current cannabis limit
|
||||
CurrentCannabisLimit string `json:"currentCannabisLimit,omitempty"`
|
||||
|
||||
// deleted
|
||||
Deleted bool `json:"deleted,omitempty"`
|
||||
|
||||
// dirty
|
||||
Dirty bool `json:"dirty,omitempty"`
|
||||
|
||||
// dl expired
|
||||
DlExpired bool `json:"dlExpired,omitempty"`
|
||||
|
||||
// dob
|
||||
Dob float64 `json:"dob,omitempty"`
|
||||
|
||||
// email
|
||||
Email string `json:"email,omitempty"`
|
||||
|
||||
// email opt in
|
||||
EmailOptIn bool `json:"emailOptIn,omitempty"`
|
||||
|
||||
// email verified
|
||||
EmailVerified bool `json:"emailVerified,omitempty"`
|
||||
|
||||
// enable loyalty
|
||||
EnableLoyalty bool `json:"enableLoyalty,omitempty"`
|
||||
|
||||
// enabled care giver
|
||||
EnabledCareGiver bool `json:"enabledCareGiver,omitempty"`
|
||||
|
||||
// exp statuses
|
||||
ExpStatuses []string `json:"expStatuses"`
|
||||
|
||||
// first name
|
||||
FirstName string `json:"firstName,omitempty"`
|
||||
|
||||
// id
|
||||
ID string `json:"id,omitempty"`
|
||||
|
||||
// identifications
|
||||
Identifications []*MemberResponseIdentificationsItems0 `json:"identifications"`
|
||||
|
||||
// import Id
|
||||
ImportID string `json:"importId,omitempty"`
|
||||
|
||||
// in queue
|
||||
InQueue bool `json:"inQueue,omitempty"`
|
||||
|
||||
// last name
|
||||
LastName string `json:"lastName,omitempty"`
|
||||
|
||||
// last visit date
|
||||
LastVisitDate int64 `json:"lastVisitDate,omitempty"`
|
||||
|
||||
// lifetime points
|
||||
LifetimePoints float64 `json:"lifetimePoints,omitempty"`
|
||||
|
||||
// loyalty points
|
||||
LoyaltyPoints float64 `json:"loyaltyPoints,omitempty"`
|
||||
|
||||
// marketing source
|
||||
MarketingSource string `json:"marketingSource,omitempty"`
|
||||
|
||||
// medical
|
||||
Medical bool `json:"medical,omitempty"`
|
||||
|
||||
// member activities
|
||||
MemberActivities []string `json:"memberActivities"`
|
||||
|
||||
// member group
|
||||
MemberGroup *MemberResponseMemberGroup `json:"memberGroup,omitempty"`
|
||||
|
||||
// member group Id
|
||||
MemberGroupID string `json:"memberGroupId,omitempty"`
|
||||
|
||||
// middle name
|
||||
MiddleName string `json:"middleName,omitempty"`
|
||||
|
||||
// modified
|
||||
Modified int64 `json:"modified,omitempty"`
|
||||
|
||||
// notes
|
||||
Notes []string `json:"notes"`
|
||||
|
||||
// preferences
|
||||
Preferences []string `json:"preferences"`
|
||||
|
||||
// primary phone
|
||||
PrimaryPhone string `json:"primaryPhone,omitempty"`
|
||||
|
||||
// qb customer ref
|
||||
QbCustomerRef []string `json:"qbCustomerRef"`
|
||||
|
||||
// qb desktop customer ref
|
||||
QbDesktopCustomerRef string `json:"qbDesktopCustomerRef,omitempty"`
|
||||
|
||||
// recent products
|
||||
RecentProducts []string `json:"recentProducts"`
|
||||
|
||||
// recommendation expired
|
||||
RecommendationExpired bool `json:"recommendationExpired,omitempty"`
|
||||
|
||||
// recommendation expiry left
|
||||
RecommendationExpiryLeft float64 `json:"recommendationExpiryLeft,omitempty"`
|
||||
|
||||
// recommendations
|
||||
Recommendations []*MemberResponseRecommendationsItems0 `json:"recommendations"`
|
||||
|
||||
// region Id
|
||||
RegionID string `json:"regionId,omitempty"`
|
||||
|
||||
// search text
|
||||
SearchText string `json:"searchText,omitempty"`
|
||||
|
||||
// sex
|
||||
Sex float64 `json:"sex,omitempty"`
|
||||
|
||||
// shop Id
|
||||
ShopID string `json:"shopId,omitempty"`
|
||||
|
||||
// start date
|
||||
StartDate int64 `json:"startDate,omitempty"`
|
||||
|
||||
// state cannabis limit
|
||||
StateCannabisLimit string `json:"stateCannabisLimit,omitempty"`
|
||||
|
||||
// status
|
||||
Status string `json:"status,omitempty"`
|
||||
|
||||
// tags
|
||||
Tags []string `json:"tags"`
|
||||
|
||||
// text opt in
|
||||
TextOptIn bool `json:"textOptIn,omitempty"`
|
||||
|
||||
// updated
|
||||
Updated bool `json:"updated,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this member response
|
||||
func (m *MemberResponse) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateAddress(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateIdentifications(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateMemberGroup(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateRecommendations(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *MemberResponse) validateAddress(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Address) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.Address != nil {
|
||||
if err := m.Address.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("address")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *MemberResponse) validateIdentifications(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Identifications) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Identifications); i++ {
|
||||
if swag.IsZero(m.Identifications[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Identifications[i] != nil {
|
||||
if err := m.Identifications[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("identifications" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *MemberResponse) validateMemberGroup(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.MemberGroup) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.MemberGroup != nil {
|
||||
if err := m.MemberGroup.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("memberGroup")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *MemberResponse) validateRecommendations(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Recommendations) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Recommendations); i++ {
|
||||
if swag.IsZero(m.Recommendations[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Recommendations[i] != nil {
|
||||
if err := m.Recommendations[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("recommendations" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *MemberResponse) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *MemberResponse) UnmarshalBinary(b []byte) error {
|
||||
var res MemberResponse
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
|
||||
// MemberResponseAddress member response address
|
||||
//
|
||||
// swagger:model MemberResponseAddress
|
||||
type MemberResponseAddress struct {
|
||||
|
||||
// address
|
||||
Address string `json:"address,omitempty"`
|
||||
|
||||
// city
|
||||
City string `json:"city,omitempty"`
|
||||
|
||||
// company Id
|
||||
CompanyID string `json:"companyId,omitempty"`
|
||||
|
||||
// country
|
||||
Country string `json:"country,omitempty"`
|
||||
|
||||
// created
|
||||
Created int64 `json:"created,omitempty"`
|
||||
|
||||
// deleted
|
||||
Deleted bool `json:"deleted,omitempty"`
|
||||
|
||||
// id
|
||||
ID string `json:"id,omitempty"`
|
||||
|
||||
// modified
|
||||
Modified int64 `json:"modified,omitempty"`
|
||||
|
||||
// state
|
||||
State string `json:"state,omitempty"`
|
||||
|
||||
// updated
|
||||
Updated bool `json:"updated,omitempty"`
|
||||
|
||||
// zip code
|
||||
ZipCode string `json:"zipCode,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this member response address
|
||||
func (m *MemberResponseAddress) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *MemberResponseAddress) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *MemberResponseAddress) UnmarshalBinary(b []byte) error {
|
||||
var res MemberResponseAddress
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
|
||||
// MemberResponseIdentificationsItems0 member response identifications items0
|
||||
//
|
||||
// swagger:model MemberResponseIdentificationsItems0
|
||||
type MemberResponseIdentificationsItems0 struct {
|
||||
|
||||
// assets
|
||||
Assets []*MemberResponseIdentificationsItems0AssetsItems0 `json:"assets"`
|
||||
|
||||
// company Id
|
||||
CompanyID string `json:"companyId,omitempty"`
|
||||
|
||||
// created
|
||||
Created int64 `json:"created,omitempty"`
|
||||
|
||||
// deleted
|
||||
Deleted bool `json:"deleted,omitempty"`
|
||||
|
||||
// expiration date
|
||||
ExpirationDate int64 `json:"expirationDate,omitempty"`
|
||||
|
||||
// front photo
|
||||
FrontPhoto string `json:"frontPhoto,omitempty"`
|
||||
|
||||
// id
|
||||
ID string `json:"id,omitempty"`
|
||||
|
||||
// license number
|
||||
LicenseNumber string `json:"licenseNumber,omitempty"`
|
||||
|
||||
// modified
|
||||
Modified int64 `json:"modified,omitempty"`
|
||||
|
||||
// state
|
||||
State string `json:"state,omitempty"`
|
||||
|
||||
// type
|
||||
Type string `json:"type,omitempty"`
|
||||
|
||||
// updated
|
||||
Updated bool `json:"updated,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this member response identifications items0
|
||||
func (m *MemberResponseIdentificationsItems0) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateAssets(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *MemberResponseIdentificationsItems0) validateAssets(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Assets) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Assets); i++ {
|
||||
if swag.IsZero(m.Assets[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Assets[i] != nil {
|
||||
if err := m.Assets[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("assets" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *MemberResponseIdentificationsItems0) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *MemberResponseIdentificationsItems0) UnmarshalBinary(b []byte) error {
|
||||
var res MemberResponseIdentificationsItems0
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
|
||||
// MemberResponseIdentificationsItems0AssetsItems0 member response identifications items0 assets items0
|
||||
//
|
||||
// swagger:model MemberResponseIdentificationsItems0AssetsItems0
|
||||
type MemberResponseIdentificationsItems0AssetsItems0 struct {
|
||||
|
||||
// active
|
||||
Active bool `json:"active,omitempty"`
|
||||
|
||||
// asset type
|
||||
AssetType string `json:"assetType,omitempty"`
|
||||
|
||||
// company Id
|
||||
CompanyID string `json:"companyId,omitempty"`
|
||||
|
||||
// created
|
||||
Created int64 `json:"created,omitempty"`
|
||||
|
||||
// deleted
|
||||
Deleted bool `json:"deleted,omitempty"`
|
||||
|
||||
// id
|
||||
ID string `json:"id,omitempty"`
|
||||
|
||||
// key
|
||||
Key string `json:"key,omitempty"`
|
||||
|
||||
// large URL
|
||||
LargeURL string `json:"largeURL,omitempty"`
|
||||
|
||||
// large x2 URL
|
||||
LargeX2URL string `json:"largeX2URL,omitempty"`
|
||||
|
||||
// medium URL
|
||||
MediumURL string `json:"mediumURL,omitempty"`
|
||||
|
||||
// modified
|
||||
Modified int64 `json:"modified,omitempty"`
|
||||
|
||||
// name
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// priority
|
||||
Priority float64 `json:"priority,omitempty"`
|
||||
|
||||
// secured
|
||||
Secured bool `json:"secured,omitempty"`
|
||||
|
||||
// thumb URL
|
||||
ThumbURL string `json:"thumbURL,omitempty"`
|
||||
|
||||
// type
|
||||
Type string `json:"type,omitempty"`
|
||||
|
||||
// updated
|
||||
Updated bool `json:"updated,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this member response identifications items0 assets items0
|
||||
func (m *MemberResponseIdentificationsItems0AssetsItems0) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *MemberResponseIdentificationsItems0AssetsItems0) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *MemberResponseIdentificationsItems0AssetsItems0) UnmarshalBinary(b []byte) error {
|
||||
var res MemberResponseIdentificationsItems0AssetsItems0
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
|
||||
// MemberResponseMemberGroup member response member group
|
||||
//
|
||||
// swagger:model MemberResponseMemberGroup
|
||||
type MemberResponseMemberGroup struct {
|
||||
|
||||
// active
|
||||
Active bool `json:"active,omitempty"`
|
||||
|
||||
// company Id
|
||||
CompanyID string `json:"companyId,omitempty"`
|
||||
|
||||
// created
|
||||
Created int64 `json:"created,omitempty"`
|
||||
|
||||
// default group
|
||||
DefaultGroup bool `json:"defaultGroup,omitempty"`
|
||||
|
||||
// deleted
|
||||
Deleted bool `json:"deleted,omitempty"`
|
||||
|
||||
// dirty
|
||||
Dirty bool `json:"dirty,omitempty"`
|
||||
|
||||
// discount
|
||||
Discount float64 `json:"discount,omitempty"`
|
||||
|
||||
// discount type
|
||||
DiscountType string `json:"discountType,omitempty"`
|
||||
|
||||
// enable promotion
|
||||
EnablePromotion bool `json:"enablePromotion,omitempty"`
|
||||
|
||||
// id
|
||||
ID string `json:"id,omitempty"`
|
||||
|
||||
// member count
|
||||
MemberCount float64 `json:"memberCount,omitempty"`
|
||||
|
||||
// member count email opt in
|
||||
MemberCountEmailOptIn float64 `json:"memberCountEmailOptIn,omitempty"`
|
||||
|
||||
// member count text opt in
|
||||
MemberCountTextOptIn float64 `json:"memberCountTextOptIn,omitempty"`
|
||||
|
||||
// modified
|
||||
Modified int64 `json:"modified,omitempty"`
|
||||
|
||||
// name
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// promotion Id
|
||||
PromotionID string `json:"promotionId,omitempty"`
|
||||
|
||||
// shop Id
|
||||
ShopID string `json:"shopId,omitempty"`
|
||||
|
||||
// updated
|
||||
Updated bool `json:"updated,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this member response member group
|
||||
func (m *MemberResponseMemberGroup) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *MemberResponseMemberGroup) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *MemberResponseMemberGroup) UnmarshalBinary(b []byte) error {
|
||||
var res MemberResponseMemberGroup
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
|
||||
// MemberResponseRecommendationsItems0 member response recommendations items0
|
||||
//
|
||||
// swagger:model MemberResponseRecommendationsItems0
|
||||
type MemberResponseRecommendationsItems0 struct {
|
||||
|
||||
// assets
|
||||
Assets []*MemberResponseRecommendationsItems0AssetsItems0 `json:"assets"`
|
||||
|
||||
// company Id
|
||||
CompanyID string `json:"companyId,omitempty"`
|
||||
|
||||
// created
|
||||
Created int64 `json:"created,omitempty"`
|
||||
|
||||
// deleted
|
||||
Deleted bool `json:"deleted,omitempty"`
|
||||
|
||||
// doctor
|
||||
Doctor string `json:"doctor,omitempty"`
|
||||
|
||||
// doctor Id
|
||||
DoctorID string `json:"doctorId,omitempty"`
|
||||
|
||||
// expiration date
|
||||
ExpirationDate string `json:"expirationDate,omitempty"`
|
||||
|
||||
// front photo
|
||||
FrontPhoto string `json:"frontPhoto,omitempty"`
|
||||
|
||||
// id
|
||||
ID string `json:"id,omitempty"`
|
||||
|
||||
// issue date
|
||||
IssueDate string `json:"issueDate,omitempty"`
|
||||
|
||||
// modified
|
||||
Modified int64 `json:"modified,omitempty"`
|
||||
|
||||
// recommendation number
|
||||
RecommendationNumber string `json:"recommendationNumber,omitempty"`
|
||||
|
||||
// state
|
||||
State string `json:"state,omitempty"`
|
||||
|
||||
// updated
|
||||
Updated bool `json:"updated,omitempty"`
|
||||
|
||||
// verified
|
||||
Verified bool `json:"verified,omitempty"`
|
||||
|
||||
// verify method
|
||||
VerifyMethod string `json:"verifyMethod,omitempty"`
|
||||
|
||||
// verify phone number
|
||||
VerifyPhoneNumber string `json:"verifyPhoneNumber,omitempty"`
|
||||
|
||||
// verify website
|
||||
VerifyWebsite string `json:"verifyWebsite,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this member response recommendations items0
|
||||
func (m *MemberResponseRecommendationsItems0) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateAssets(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *MemberResponseRecommendationsItems0) validateAssets(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Assets) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Assets); i++ {
|
||||
if swag.IsZero(m.Assets[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Assets[i] != nil {
|
||||
if err := m.Assets[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("assets" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *MemberResponseRecommendationsItems0) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *MemberResponseRecommendationsItems0) UnmarshalBinary(b []byte) error {
|
||||
var res MemberResponseRecommendationsItems0
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
|
||||
// MemberResponseRecommendationsItems0AssetsItems0 member response recommendations items0 assets items0
|
||||
//
|
||||
// swagger:model MemberResponseRecommendationsItems0AssetsItems0
|
||||
type MemberResponseRecommendationsItems0AssetsItems0 struct {
|
||||
|
||||
// active
|
||||
Active bool `json:"active,omitempty"`
|
||||
|
||||
// asset type
|
||||
AssetType string `json:"assetType,omitempty"`
|
||||
|
||||
// company Id
|
||||
CompanyID string `json:"companyId,omitempty"`
|
||||
|
||||
// created
|
||||
Created int64 `json:"created,omitempty"`
|
||||
|
||||
// deleted
|
||||
Deleted bool `json:"deleted,omitempty"`
|
||||
|
||||
// id
|
||||
ID string `json:"id,omitempty"`
|
||||
|
||||
// key
|
||||
Key string `json:"key,omitempty"`
|
||||
|
||||
// large URL
|
||||
LargeURL string `json:"largeURL,omitempty"`
|
||||
|
||||
// large x2 URL
|
||||
LargeX2URL string `json:"largeX2URL,omitempty"`
|
||||
|
||||
// medium URL
|
||||
MediumURL string `json:"mediumURL,omitempty"`
|
||||
|
||||
// modified
|
||||
Modified int64 `json:"modified,omitempty"`
|
||||
|
||||
// name
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// priority
|
||||
Priority float64 `json:"priority,omitempty"`
|
||||
|
||||
// secured
|
||||
Secured bool `json:"secured,omitempty"`
|
||||
|
||||
// thumb URL
|
||||
ThumbURL string `json:"thumbURL,omitempty"`
|
||||
|
||||
// type
|
||||
Type string `json:"type,omitempty"`
|
||||
|
||||
// updated
|
||||
Updated bool `json:"updated,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this member response recommendations items0 assets items0
|
||||
func (m *MemberResponseRecommendationsItems0AssetsItems0) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *MemberResponseRecommendationsItems0AssetsItems0) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *MemberResponseRecommendationsItems0AssetsItems0) UnmarshalBinary(b []byte) error {
|
||||
var res MemberResponseRecommendationsItems0AssetsItems0
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package blaze_models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// Message message
|
||||
//
|
||||
// swagger:model Message
|
||||
type Message struct {
|
||||
|
||||
// code
|
||||
Code float64 `json:"code,omitempty"`
|
||||
|
||||
// message
|
||||
Message string `json:"message,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this message
|
||||
func (m *Message) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *Message) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *Message) UnmarshalBinary(b []byte) error {
|
||||
var res Message
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,908 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package blaze_models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// ProductsResponse products response
|
||||
//
|
||||
// swagger:model ProductsResponse
|
||||
type ProductsResponse struct {
|
||||
|
||||
// limit
|
||||
Limit float64 `json:"limit,omitempty"`
|
||||
|
||||
// skip
|
||||
Skip float64 `json:"skip,omitempty"`
|
||||
|
||||
// total
|
||||
Total float64 `json:"total,omitempty"`
|
||||
|
||||
// values
|
||||
Values []*ProductsResponseValuesItems0 `json:"values"`
|
||||
}
|
||||
|
||||
// Validate validates this products response
|
||||
func (m *ProductsResponse) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateValues(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ProductsResponse) validateValues(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Values) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Values); i++ {
|
||||
if swag.IsZero(m.Values[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Values[i] != nil {
|
||||
if err := m.Values[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("values" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *ProductsResponse) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *ProductsResponse) UnmarshalBinary(b []byte) error {
|
||||
var res ProductsResponse
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
|
||||
// ProductsResponseValuesItems0 products response values items0
|
||||
//
|
||||
// swagger:model ProductsResponseValuesItems0
|
||||
type ProductsResponseValuesItems0 struct {
|
||||
|
||||
// active
|
||||
Active bool `json:"active,omitempty"`
|
||||
|
||||
// assets
|
||||
Assets []*ProductsResponseValuesItems0AssetsItems0 `json:"assets"`
|
||||
|
||||
// automatic re order
|
||||
AutomaticReOrder bool `json:"automaticReOrder,omitempty"`
|
||||
|
||||
// brand
|
||||
Brand string `json:"brand,omitempty"`
|
||||
|
||||
// brand Id
|
||||
BrandID string `json:"brandId,omitempty"`
|
||||
|
||||
// bundle items
|
||||
BundleItems []string `json:"bundleItems"`
|
||||
|
||||
// by gram
|
||||
ByGram bool `json:"byGram,omitempty"`
|
||||
|
||||
// by prepackage
|
||||
ByPrepackage bool `json:"byPrepackage,omitempty"`
|
||||
|
||||
// cannabis type
|
||||
CannabisType string `json:"cannabisType,omitempty"`
|
||||
|
||||
// category
|
||||
Category *ProductsResponseValuesItems0Category `json:"category,omitempty"`
|
||||
|
||||
// category Id
|
||||
CategoryID string `json:"categoryId,omitempty"`
|
||||
|
||||
// cbd
|
||||
Cbd float64 `json:"cbd,omitempty"`
|
||||
|
||||
// cbda
|
||||
Cbda float64 `json:"cbda,omitempty"`
|
||||
|
||||
// cbn
|
||||
Cbn float64 `json:"cbn,omitempty"`
|
||||
|
||||
// company Id
|
||||
CompanyID string `json:"companyId,omitempty"`
|
||||
|
||||
// company link Id
|
||||
CompanyLinkID string `json:"companyLinkId,omitempty"`
|
||||
|
||||
// created
|
||||
Created int64 `json:"created,omitempty"`
|
||||
|
||||
// custom gram type
|
||||
CustomGramType string `json:"customGramType,omitempty"`
|
||||
|
||||
// custom tax info
|
||||
CustomTaxInfo string `json:"customTaxInfo,omitempty"`
|
||||
|
||||
// custom weight
|
||||
CustomWeight float64 `json:"customWeight,omitempty"`
|
||||
|
||||
// deleted
|
||||
Deleted bool `json:"deleted,omitempty"`
|
||||
|
||||
// description
|
||||
Description string `json:"description,omitempty"`
|
||||
|
||||
// dirty
|
||||
Dirty bool `json:"dirty,omitempty"`
|
||||
|
||||
// discountable
|
||||
Discountable bool `json:"discountable,omitempty"`
|
||||
|
||||
// enable excise tax
|
||||
EnableExciseTax bool `json:"enableExciseTax,omitempty"`
|
||||
|
||||
// enable mix match
|
||||
EnableMixMatch bool `json:"enableMixMatch,omitempty"`
|
||||
|
||||
// enable weedmap
|
||||
EnableWeedmap bool `json:"enableWeedmap,omitempty"`
|
||||
|
||||
// flower type
|
||||
FlowerType string `json:"flowerType,omitempty"`
|
||||
|
||||
// genetics
|
||||
Genetics string `json:"genetics,omitempty"`
|
||||
|
||||
// id
|
||||
ID string `json:"id,omitempty"`
|
||||
|
||||
// import Id
|
||||
ImportID string `json:"importId,omitempty"`
|
||||
|
||||
// import src
|
||||
ImportSrc string `json:"importSrc,omitempty"`
|
||||
|
||||
// low inventory notification
|
||||
LowInventoryNotification bool `json:"lowInventoryNotification,omitempty"`
|
||||
|
||||
// low threshold
|
||||
LowThreshold float64 `json:"lowThreshold,omitempty"`
|
||||
|
||||
// medical conditions
|
||||
MedicalConditions []string `json:"medicalConditions"`
|
||||
|
||||
// medicinal
|
||||
Medicinal bool `json:"medicinal,omitempty"`
|
||||
|
||||
// modified
|
||||
Modified int64 `json:"modified,omitempty"`
|
||||
|
||||
// name
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// notes
|
||||
Notes []string `json:"notes"`
|
||||
|
||||
// potency
|
||||
Potency bool `json:"potency,omitempty"`
|
||||
|
||||
// potency amount
|
||||
PotencyAmount string `json:"potencyAmount,omitempty"`
|
||||
|
||||
// price breaks
|
||||
PriceBreaks []string `json:"priceBreaks"`
|
||||
|
||||
// price includes a l excise
|
||||
PriceIncludesALExcise bool `json:"priceIncludesALExcise,omitempty"`
|
||||
|
||||
// price includes excise
|
||||
PriceIncludesExcise bool `json:"priceIncludesExcise,omitempty"`
|
||||
|
||||
// price ranges
|
||||
PriceRanges []*ProductsResponseValuesItems0PriceRangesItems0 `json:"priceRanges"`
|
||||
|
||||
// pricing template Id
|
||||
PricingTemplateID string `json:"pricingTemplateId,omitempty"`
|
||||
|
||||
// product sale type
|
||||
ProductSaleType string `json:"productSaleType,omitempty"`
|
||||
|
||||
// product type
|
||||
ProductType string `json:"productType,omitempty"`
|
||||
|
||||
// qb desktop item ref
|
||||
QbDesktopItemRef string `json:"qbDesktopItemRef,omitempty"`
|
||||
|
||||
// qb item ref
|
||||
QbItemRef string `json:"qbItemRef,omitempty"`
|
||||
|
||||
// quantities
|
||||
Quantities []*ProductsResponseValuesItems0QuantitiesItems0 `json:"quantities"`
|
||||
|
||||
// re order level
|
||||
ReOrderLevel float64 `json:"reOrderLevel,omitempty"`
|
||||
|
||||
// shop Id
|
||||
ShopID string `json:"shopId,omitempty"`
|
||||
|
||||
// show in widget
|
||||
ShowInWidget bool `json:"showInWidget,omitempty"`
|
||||
|
||||
// sku
|
||||
Sku string `json:"sku,omitempty"`
|
||||
|
||||
// tags
|
||||
Tags []string `json:"tags"`
|
||||
|
||||
// tax order
|
||||
TaxOrder string `json:"taxOrder,omitempty"`
|
||||
|
||||
// tax tables
|
||||
TaxTables []string `json:"taxTables"`
|
||||
|
||||
// tax type
|
||||
TaxType string `json:"taxType,omitempty"`
|
||||
|
||||
// thc
|
||||
Thc float64 `json:"thc,omitempty"`
|
||||
|
||||
// thca
|
||||
Thca float64 `json:"thca,omitempty"`
|
||||
|
||||
// unit price
|
||||
UnitPrice float64 `json:"unitPrice,omitempty"`
|
||||
|
||||
// unit value
|
||||
UnitValue float64 `json:"unitValue,omitempty"`
|
||||
|
||||
// updated
|
||||
Updated bool `json:"updated,omitempty"`
|
||||
|
||||
// vendor
|
||||
Vendor string `json:"vendor,omitempty"`
|
||||
|
||||
// vendor Id
|
||||
VendorID string `json:"vendorId,omitempty"`
|
||||
|
||||
// weight per unit
|
||||
WeightPerUnit string `json:"weightPerUnit,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this products response values items0
|
||||
func (m *ProductsResponseValuesItems0) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateAssets(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateCategory(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validatePriceRanges(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateQuantities(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ProductsResponseValuesItems0) validateAssets(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Assets) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Assets); i++ {
|
||||
if swag.IsZero(m.Assets[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Assets[i] != nil {
|
||||
if err := m.Assets[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("assets" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ProductsResponseValuesItems0) validateCategory(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Category) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.Category != nil {
|
||||
if err := m.Category.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("category")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ProductsResponseValuesItems0) validatePriceRanges(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.PriceRanges) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.PriceRanges); i++ {
|
||||
if swag.IsZero(m.PriceRanges[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.PriceRanges[i] != nil {
|
||||
if err := m.PriceRanges[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("priceRanges" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ProductsResponseValuesItems0) validateQuantities(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Quantities) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Quantities); i++ {
|
||||
if swag.IsZero(m.Quantities[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Quantities[i] != nil {
|
||||
if err := m.Quantities[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("quantities" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *ProductsResponseValuesItems0) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *ProductsResponseValuesItems0) UnmarshalBinary(b []byte) error {
|
||||
var res ProductsResponseValuesItems0
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
|
||||
// ProductsResponseValuesItems0AssetsItems0 products response values items0 assets items0
|
||||
//
|
||||
// swagger:model ProductsResponseValuesItems0AssetsItems0
|
||||
type ProductsResponseValuesItems0AssetsItems0 struct {
|
||||
|
||||
// active
|
||||
Active bool `json:"active,omitempty"`
|
||||
|
||||
// asset type
|
||||
AssetType string `json:"assetType,omitempty"`
|
||||
|
||||
// company Id
|
||||
CompanyID string `json:"companyId,omitempty"`
|
||||
|
||||
// created
|
||||
Created int64 `json:"created,omitempty"`
|
||||
|
||||
// deleted
|
||||
Deleted bool `json:"deleted,omitempty"`
|
||||
|
||||
// id
|
||||
ID string `json:"id,omitempty"`
|
||||
|
||||
// key
|
||||
Key string `json:"key,omitempty"`
|
||||
|
||||
// large URL
|
||||
LargeURL string `json:"largeURL,omitempty"`
|
||||
|
||||
// large x2 URL
|
||||
LargeX2URL string `json:"largeX2URL,omitempty"`
|
||||
|
||||
// medium URL
|
||||
MediumURL string `json:"mediumURL,omitempty"`
|
||||
|
||||
// modified
|
||||
Modified int64 `json:"modified,omitempty"`
|
||||
|
||||
// name
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// priority
|
||||
Priority float64 `json:"priority,omitempty"`
|
||||
|
||||
// secured
|
||||
Secured bool `json:"secured,omitempty"`
|
||||
|
||||
// thumb URL
|
||||
ThumbURL string `json:"thumbURL,omitempty"`
|
||||
|
||||
// type
|
||||
Type string `json:"type,omitempty"`
|
||||
|
||||
// updated
|
||||
Updated bool `json:"updated,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this products response values items0 assets items0
|
||||
func (m *ProductsResponseValuesItems0AssetsItems0) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *ProductsResponseValuesItems0AssetsItems0) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *ProductsResponseValuesItems0AssetsItems0) UnmarshalBinary(b []byte) error {
|
||||
var res ProductsResponseValuesItems0AssetsItems0
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
|
||||
// ProductsResponseValuesItems0Category products response values items0 category
|
||||
//
|
||||
// swagger:model ProductsResponseValuesItems0Category
|
||||
type ProductsResponseValuesItems0Category struct {
|
||||
|
||||
// active
|
||||
Active bool `json:"active,omitempty"`
|
||||
|
||||
// cannabis
|
||||
Cannabis bool `json:"cannabis,omitempty"`
|
||||
|
||||
// cannabis type
|
||||
CannabisType string `json:"cannabisType,omitempty"`
|
||||
|
||||
// company Id
|
||||
CompanyID string `json:"companyId,omitempty"`
|
||||
|
||||
// created
|
||||
Created int64 `json:"created,omitempty"`
|
||||
|
||||
// deleted
|
||||
Deleted bool `json:"deleted,omitempty"`
|
||||
|
||||
// dirty
|
||||
Dirty bool `json:"dirty,omitempty"`
|
||||
|
||||
// id
|
||||
ID string `json:"id,omitempty"`
|
||||
|
||||
// low threshold
|
||||
LowThreshold string `json:"lowThreshold,omitempty"`
|
||||
|
||||
// modified
|
||||
Modified int64 `json:"modified,omitempty"`
|
||||
|
||||
// name
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// photo
|
||||
Photo *ProductsResponseValuesItems0CategoryPhoto `json:"photo,omitempty"`
|
||||
|
||||
// priority
|
||||
Priority float64 `json:"priority,omitempty"`
|
||||
|
||||
// shop Id
|
||||
ShopID string `json:"shopId,omitempty"`
|
||||
|
||||
// unit type
|
||||
UnitType string `json:"unitType,omitempty"`
|
||||
|
||||
// updated
|
||||
Updated bool `json:"updated,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this products response values items0 category
|
||||
func (m *ProductsResponseValuesItems0Category) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validatePhoto(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ProductsResponseValuesItems0Category) validatePhoto(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Photo) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.Photo != nil {
|
||||
if err := m.Photo.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("category" + "." + "photo")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *ProductsResponseValuesItems0Category) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *ProductsResponseValuesItems0Category) UnmarshalBinary(b []byte) error {
|
||||
var res ProductsResponseValuesItems0Category
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
|
||||
// ProductsResponseValuesItems0CategoryPhoto products response values items0 category photo
|
||||
//
|
||||
// swagger:model ProductsResponseValuesItems0CategoryPhoto
|
||||
type ProductsResponseValuesItems0CategoryPhoto struct {
|
||||
|
||||
// active
|
||||
Active bool `json:"active,omitempty"`
|
||||
|
||||
// asset type
|
||||
AssetType string `json:"assetType,omitempty"`
|
||||
|
||||
// company Id
|
||||
CompanyID string `json:"companyId,omitempty"`
|
||||
|
||||
// created
|
||||
Created int64 `json:"created,omitempty"`
|
||||
|
||||
// deleted
|
||||
Deleted bool `json:"deleted,omitempty"`
|
||||
|
||||
// id
|
||||
ID string `json:"id,omitempty"`
|
||||
|
||||
// key
|
||||
Key string `json:"key,omitempty"`
|
||||
|
||||
// large URL
|
||||
LargeURL string `json:"largeURL,omitempty"`
|
||||
|
||||
// large x2 URL
|
||||
LargeX2URL string `json:"largeX2URL,omitempty"`
|
||||
|
||||
// medium URL
|
||||
MediumURL string `json:"mediumURL,omitempty"`
|
||||
|
||||
// modified
|
||||
Modified int64 `json:"modified,omitempty"`
|
||||
|
||||
// name
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// orig URL
|
||||
OrigURL string `json:"origURL,omitempty"`
|
||||
|
||||
// priority
|
||||
Priority float64 `json:"priority,omitempty"`
|
||||
|
||||
// public URL
|
||||
PublicURL string `json:"publicURL,omitempty"`
|
||||
|
||||
// secured
|
||||
Secured bool `json:"secured,omitempty"`
|
||||
|
||||
// thumb URL
|
||||
ThumbURL string `json:"thumbURL,omitempty"`
|
||||
|
||||
// type
|
||||
Type string `json:"type,omitempty"`
|
||||
|
||||
// updated
|
||||
Updated bool `json:"updated,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this products response values items0 category photo
|
||||
func (m *ProductsResponseValuesItems0CategoryPhoto) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *ProductsResponseValuesItems0CategoryPhoto) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *ProductsResponseValuesItems0CategoryPhoto) UnmarshalBinary(b []byte) error {
|
||||
var res ProductsResponseValuesItems0CategoryPhoto
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
|
||||
// ProductsResponseValuesItems0PriceRangesItems0 products response values items0 price ranges items0
|
||||
//
|
||||
// swagger:model ProductsResponseValuesItems0PriceRangesItems0
|
||||
type ProductsResponseValuesItems0PriceRangesItems0 struct {
|
||||
|
||||
// id
|
||||
ID string `json:"id,omitempty"`
|
||||
|
||||
// price
|
||||
Price float64 `json:"price,omitempty"`
|
||||
|
||||
// priority
|
||||
Priority float64 `json:"priority,omitempty"`
|
||||
|
||||
// weight tolerance
|
||||
WeightTolerance *ProductsResponseValuesItems0PriceRangesItems0WeightTolerance `json:"weightTolerance,omitempty"`
|
||||
|
||||
// weight tolerance Id
|
||||
WeightToleranceID string `json:"weightToleranceId,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this products response values items0 price ranges items0
|
||||
func (m *ProductsResponseValuesItems0PriceRangesItems0) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateWeightTolerance(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ProductsResponseValuesItems0PriceRangesItems0) validateWeightTolerance(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.WeightTolerance) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.WeightTolerance != nil {
|
||||
if err := m.WeightTolerance.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("weightTolerance")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *ProductsResponseValuesItems0PriceRangesItems0) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *ProductsResponseValuesItems0PriceRangesItems0) UnmarshalBinary(b []byte) error {
|
||||
var res ProductsResponseValuesItems0PriceRangesItems0
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
|
||||
// ProductsResponseValuesItems0PriceRangesItems0WeightTolerance products response values items0 price ranges items0 weight tolerance
|
||||
//
|
||||
// swagger:model ProductsResponseValuesItems0PriceRangesItems0WeightTolerance
|
||||
type ProductsResponseValuesItems0PriceRangesItems0WeightTolerance struct {
|
||||
|
||||
// company Id
|
||||
CompanyID string `json:"companyId,omitempty"`
|
||||
|
||||
// created
|
||||
Created int64 `json:"created,omitempty"`
|
||||
|
||||
// deleted
|
||||
Deleted bool `json:"deleted,omitempty"`
|
||||
|
||||
// enabled
|
||||
Enabled bool `json:"enabled,omitempty"`
|
||||
|
||||
// end weight
|
||||
EndWeight float64 `json:"endWeight,omitempty"`
|
||||
|
||||
// id
|
||||
ID string `json:"id,omitempty"`
|
||||
|
||||
// modified
|
||||
Modified int64 `json:"modified,omitempty"`
|
||||
|
||||
// name
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// priority
|
||||
Priority float64 `json:"priority,omitempty"`
|
||||
|
||||
// start weight
|
||||
StartWeight float64 `json:"startWeight,omitempty"`
|
||||
|
||||
// unit value
|
||||
UnitValue float64 `json:"unitValue,omitempty"`
|
||||
|
||||
// updated
|
||||
Updated bool `json:"updated,omitempty"`
|
||||
|
||||
// weight key
|
||||
WeightKey string `json:"weightKey,omitempty"`
|
||||
|
||||
// weight value
|
||||
WeightValue float64 `json:"weightValue,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this products response values items0 price ranges items0 weight tolerance
|
||||
func (m *ProductsResponseValuesItems0PriceRangesItems0WeightTolerance) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *ProductsResponseValuesItems0PriceRangesItems0WeightTolerance) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *ProductsResponseValuesItems0PriceRangesItems0WeightTolerance) UnmarshalBinary(b []byte) error {
|
||||
var res ProductsResponseValuesItems0PriceRangesItems0WeightTolerance
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
|
||||
// ProductsResponseValuesItems0QuantitiesItems0 products response values items0 quantities items0
|
||||
//
|
||||
// swagger:model ProductsResponseValuesItems0QuantitiesItems0
|
||||
type ProductsResponseValuesItems0QuantitiesItems0 struct {
|
||||
|
||||
// company Id
|
||||
CompanyID string `json:"companyId,omitempty"`
|
||||
|
||||
// created
|
||||
Created int64 `json:"created,omitempty"`
|
||||
|
||||
// deleted
|
||||
Deleted bool `json:"deleted,omitempty"`
|
||||
|
||||
// dirty
|
||||
Dirty bool `json:"dirty,omitempty"`
|
||||
|
||||
// id
|
||||
ID string `json:"id,omitempty"`
|
||||
|
||||
// inventory Id
|
||||
InventoryID string `json:"inventoryId,omitempty"`
|
||||
|
||||
// modified
|
||||
Modified int64 `json:"modified,omitempty"`
|
||||
|
||||
// quantity
|
||||
Quantity float64 `json:"quantity,omitempty"`
|
||||
|
||||
// shop Id
|
||||
ShopID string `json:"shopId,omitempty"`
|
||||
|
||||
// updated
|
||||
Updated bool `json:"updated,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this products response values items0 quantities items0
|
||||
func (m *ProductsResponseValuesItems0QuantitiesItems0) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *ProductsResponseValuesItems0QuantitiesItems0) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *ProductsResponseValuesItems0QuantitiesItems0) UnmarshalBinary(b []byte) error {
|
||||
var res ProductsResponseValuesItems0QuantitiesItems0
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,356 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package blaze_models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// VendorResponse vendor response
|
||||
//
|
||||
// swagger:model VendorResponse
|
||||
type VendorResponse struct {
|
||||
|
||||
// active
|
||||
Active bool `json:"active,omitempty"`
|
||||
|
||||
// additional address list
|
||||
AdditionalAddressList []string `json:"additionalAddressList"`
|
||||
|
||||
// address
|
||||
Address *VendorResponseAddress `json:"address,omitempty"`
|
||||
|
||||
// arms length type
|
||||
ArmsLengthType string `json:"armsLengthType,omitempty"`
|
||||
|
||||
// assets
|
||||
Assets []*VendorResponseAssetsItems0 `json:"assets"`
|
||||
|
||||
// back order enabled
|
||||
BackOrderEnabled bool `json:"backOrderEnabled,omitempty"`
|
||||
|
||||
// brand list
|
||||
BrandList []string `json:"brandList"`
|
||||
|
||||
// brands
|
||||
Brands []string `json:"brands"`
|
||||
|
||||
// company Id
|
||||
CompanyID string `json:"companyId,omitempty"`
|
||||
|
||||
// company licenses
|
||||
CompanyLicenses []string `json:"companyLicenses"`
|
||||
|
||||
// company type
|
||||
CompanyType string `json:"companyType,omitempty"`
|
||||
|
||||
// created
|
||||
Created int64 `json:"created,omitempty"`
|
||||
|
||||
// credits
|
||||
Credits float64 `json:"credits,omitempty"`
|
||||
|
||||
// dba name
|
||||
DbaName string `json:"dbaName,omitempty"`
|
||||
|
||||
// deleted
|
||||
Deleted bool `json:"deleted,omitempty"`
|
||||
|
||||
// description
|
||||
Description string `json:"description,omitempty"`
|
||||
|
||||
// email
|
||||
Email string `json:"email,omitempty"`
|
||||
|
||||
// fax
|
||||
Fax string `json:"fax,omitempty"`
|
||||
|
||||
// first name
|
||||
FirstName string `json:"firstName,omitempty"`
|
||||
|
||||
// id
|
||||
ID string `json:"id,omitempty"`
|
||||
|
||||
// import Id
|
||||
ImportID string `json:"importId,omitempty"`
|
||||
|
||||
// last name
|
||||
LastName string `json:"lastName,omitempty"`
|
||||
|
||||
// licence type
|
||||
LicenceType string `json:"licenceType,omitempty"`
|
||||
|
||||
// license expiration date
|
||||
LicenseExpirationDate float64 `json:"licenseExpirationDate,omitempty"`
|
||||
|
||||
// license number
|
||||
LicenseNumber string `json:"licenseNumber,omitempty"`
|
||||
|
||||
// mobile number
|
||||
MobileNumber string `json:"mobileNumber,omitempty"`
|
||||
|
||||
// modified
|
||||
Modified int64 `json:"modified,omitempty"`
|
||||
|
||||
// name
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// notes
|
||||
Notes []string `json:"notes"`
|
||||
|
||||
// phone
|
||||
Phone string `json:"phone,omitempty"`
|
||||
|
||||
// qb desktop ref
|
||||
QbDesktopRef string `json:"qbDesktopRef,omitempty"`
|
||||
|
||||
// qb vendor ref
|
||||
QbVendorRef []string `json:"qbVendorRef"`
|
||||
|
||||
// related entity
|
||||
RelatedEntity bool `json:"relatedEntity,omitempty"`
|
||||
|
||||
// updated
|
||||
Updated bool `json:"updated,omitempty"`
|
||||
|
||||
// vendor key
|
||||
VendorKey string `json:"vendorKey,omitempty"`
|
||||
|
||||
// vendor type
|
||||
VendorType string `json:"vendorType,omitempty"`
|
||||
|
||||
// website
|
||||
Website string `json:"website,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this vendor response
|
||||
func (m *VendorResponse) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateAddress(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateAssets(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *VendorResponse) validateAddress(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Address) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.Address != nil {
|
||||
if err := m.Address.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("address")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *VendorResponse) validateAssets(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Assets) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Assets); i++ {
|
||||
if swag.IsZero(m.Assets[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Assets[i] != nil {
|
||||
if err := m.Assets[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("assets" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *VendorResponse) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *VendorResponse) UnmarshalBinary(b []byte) error {
|
||||
var res VendorResponse
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
|
||||
// VendorResponseAddress vendor response address
|
||||
//
|
||||
// swagger:model VendorResponseAddress
|
||||
type VendorResponseAddress struct {
|
||||
|
||||
// address
|
||||
Address string `json:"address,omitempty"`
|
||||
|
||||
// city
|
||||
City string `json:"city,omitempty"`
|
||||
|
||||
// company Id
|
||||
CompanyID string `json:"companyId,omitempty"`
|
||||
|
||||
// country
|
||||
Country string `json:"country,omitempty"`
|
||||
|
||||
// created
|
||||
Created int64 `json:"created,omitempty"`
|
||||
|
||||
// deleted
|
||||
Deleted bool `json:"deleted,omitempty"`
|
||||
|
||||
// id
|
||||
ID string `json:"id,omitempty"`
|
||||
|
||||
// modified
|
||||
Modified int64 `json:"modified,omitempty"`
|
||||
|
||||
// state
|
||||
State string `json:"state,omitempty"`
|
||||
|
||||
// updated
|
||||
Updated bool `json:"updated,omitempty"`
|
||||
|
||||
// zip code
|
||||
ZipCode string `json:"zipCode,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this vendor response address
|
||||
func (m *VendorResponseAddress) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *VendorResponseAddress) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *VendorResponseAddress) UnmarshalBinary(b []byte) error {
|
||||
var res VendorResponseAddress
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
|
||||
// VendorResponseAssetsItems0 vendor response assets items0
|
||||
//
|
||||
// swagger:model VendorResponseAssetsItems0
|
||||
type VendorResponseAssetsItems0 struct {
|
||||
|
||||
// active
|
||||
Active bool `json:"active,omitempty"`
|
||||
|
||||
// asset type
|
||||
AssetType string `json:"assetType,omitempty"`
|
||||
|
||||
// company Id
|
||||
CompanyID string `json:"companyId,omitempty"`
|
||||
|
||||
// created
|
||||
Created int64 `json:"created,omitempty"`
|
||||
|
||||
// deleted
|
||||
Deleted bool `json:"deleted,omitempty"`
|
||||
|
||||
// id
|
||||
ID string `json:"id,omitempty"`
|
||||
|
||||
// key
|
||||
Key string `json:"key,omitempty"`
|
||||
|
||||
// large URL
|
||||
LargeURL string `json:"largeURL,omitempty"`
|
||||
|
||||
// large x2 URL
|
||||
LargeX2URL string `json:"largeX2URL,omitempty"`
|
||||
|
||||
// medium URL
|
||||
MediumURL string `json:"mediumURL,omitempty"`
|
||||
|
||||
// modified
|
||||
Modified int64 `json:"modified,omitempty"`
|
||||
|
||||
// name
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// priority
|
||||
Priority float64 `json:"priority,omitempty"`
|
||||
|
||||
// secured
|
||||
Secured bool `json:"secured,omitempty"`
|
||||
|
||||
// thumb URL
|
||||
ThumbURL string `json:"thumbURL,omitempty"`
|
||||
|
||||
// type
|
||||
Type string `json:"type,omitempty"`
|
||||
|
||||
// updated
|
||||
Updated bool `json:"updated,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this vendor response assets items0
|
||||
func (m *VendorResponseAssetsItems0) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *VendorResponseAssetsItems0) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *VendorResponseAssetsItems0) UnmarshalBinary(b []byte) error {
|
||||
var res VendorResponseAssetsItems0
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,235 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package accounts
|
||||
|
||||
// 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 accounts API client.
|
||||
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
|
||||
return &Client{transport: transport, formats: formats}
|
||||
}
|
||||
|
||||
/*
|
||||
Client for accounts API
|
||||
*/
|
||||
type Client struct {
|
||||
transport runtime.ClientTransport
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ClientService is the interface for Client methods
|
||||
type ClientService interface {
|
||||
DeleteAccount(params *DeleteAccountParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteAccountOK, error)
|
||||
|
||||
GetAccounts(params *GetAccountsParams, authInfo runtime.ClientAuthInfoWriter) (*GetAccountsOK, error)
|
||||
|
||||
GetAccountsObservable(params *GetAccountsObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetAccountsObservableOK, error)
|
||||
|
||||
PostAccounts(params *PostAccountsParams, authInfo runtime.ClientAuthInfoWriter) (*PostAccountsOK, error)
|
||||
|
||||
PutAccount(params *PutAccountParams, authInfo runtime.ClientAuthInfoWriter) (*PutAccountOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteAccount deletes an account
|
||||
|
||||
Delete Taxnexus Account record
|
||||
*/
|
||||
func (a *Client) DeleteAccount(params *DeleteAccountParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteAccountOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewDeleteAccountParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "deleteAccount",
|
||||
Method: "DELETE",
|
||||
PathPattern: "/accounts",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &DeleteAccountReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*DeleteAccountOK)
|
||||
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 deleteAccount: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
GetAccounts gets a list of accounts
|
||||
|
||||
Return a list of all available Accounts
|
||||
*/
|
||||
func (a *Client) GetAccounts(params *GetAccountsParams, authInfo runtime.ClientAuthInfoWriter) (*GetAccountsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetAccountsParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "getAccounts",
|
||||
Method: "GET",
|
||||
PathPattern: "/accounts",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetAccountsReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*GetAccountsOK)
|
||||
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 getAccounts: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
GetAccountsObservable gets taxnexus accounts in an observable array
|
||||
|
||||
A list of accounts in a simple JSON array
|
||||
*/
|
||||
func (a *Client) GetAccountsObservable(params *GetAccountsObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetAccountsObservableOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetAccountsObservableParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "getAccountsObservable",
|
||||
Method: "GET",
|
||||
PathPattern: "/accounts/observable",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetAccountsObservableReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*GetAccountsObservableOK)
|
||||
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 getAccountsObservable: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PostAccounts adds a new account to taxnexus
|
||||
|
||||
Account record to be added
|
||||
*/
|
||||
func (a *Client) PostAccounts(params *PostAccountsParams, authInfo runtime.ClientAuthInfoWriter) (*PostAccountsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPostAccountsParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "postAccounts",
|
||||
Method: "POST",
|
||||
PathPattern: "/accounts",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PostAccountsReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*PostAccountsOK)
|
||||
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 postAccounts: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PutAccount updates a single account
|
||||
|
||||
Update a single account specified by accountId
|
||||
*/
|
||||
func (a *Client) PutAccount(params *PutAccountParams, authInfo runtime.ClientAuthInfoWriter) (*PutAccountOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPutAccountParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "putAccount",
|
||||
Method: "PUT",
|
||||
PathPattern: "/accounts",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PutAccountReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*PutAccountOK)
|
||||
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 putAccount: 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
|
||||
}
|
|
@ -0,0 +1,150 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package accounts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// NewDeleteAccountParams creates a new DeleteAccountParams object
|
||||
// with the default values initialized.
|
||||
func NewDeleteAccountParams() *DeleteAccountParams {
|
||||
var ()
|
||||
return &DeleteAccountParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAccountParamsWithTimeout creates a new DeleteAccountParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewDeleteAccountParamsWithTimeout(timeout time.Duration) *DeleteAccountParams {
|
||||
var ()
|
||||
return &DeleteAccountParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAccountParamsWithContext creates a new DeleteAccountParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewDeleteAccountParamsWithContext(ctx context.Context) *DeleteAccountParams {
|
||||
var ()
|
||||
return &DeleteAccountParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAccountParamsWithHTTPClient creates a new DeleteAccountParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewDeleteAccountParamsWithHTTPClient(client *http.Client) *DeleteAccountParams {
|
||||
var ()
|
||||
return &DeleteAccountParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*DeleteAccountParams contains all the parameters to send to the API endpoint
|
||||
for the delete account operation typically these are written to a http.Request
|
||||
*/
|
||||
type DeleteAccountParams struct {
|
||||
|
||||
/*AccountID
|
||||
Taxnexus Record Id of an Account
|
||||
|
||||
*/
|
||||
AccountID *string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the delete account params
|
||||
func (o *DeleteAccountParams) WithTimeout(timeout time.Duration) *DeleteAccountParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the delete account params
|
||||
func (o *DeleteAccountParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the delete account params
|
||||
func (o *DeleteAccountParams) WithContext(ctx context.Context) *DeleteAccountParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the delete account params
|
||||
func (o *DeleteAccountParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the delete account params
|
||||
func (o *DeleteAccountParams) WithHTTPClient(client *http.Client) *DeleteAccountParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the delete account params
|
||||
func (o *DeleteAccountParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithAccountID adds the accountID to the delete account params
|
||||
func (o *DeleteAccountParams) WithAccountID(accountID *string) *DeleteAccountParams {
|
||||
o.SetAccountID(accountID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetAccountID adds the accountId to the delete account params
|
||||
func (o *DeleteAccountParams) SetAccountID(accountID *string) {
|
||||
o.AccountID = accountID
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *DeleteAccountParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if o.AccountID != nil {
|
||||
|
||||
// query param accountId
|
||||
var qrAccountID string
|
||||
if o.AccountID != nil {
|
||||
qrAccountID = *o.AccountID
|
||||
}
|
||||
qAccountID := qrAccountID
|
||||
if qAccountID != "" {
|
||||
if err := r.SetQueryParam("accountId", qAccountID); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,298 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package accounts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/taxnexus/go/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// DeleteAccountReader is a Reader for the DeleteAccount structure.
|
||||
type DeleteAccountReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *DeleteAccountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewDeleteAccountOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewDeleteAccountUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewDeleteAccountForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewDeleteAccountNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewDeleteAccountUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewDeleteAccountInternalServerError()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAccountOK creates a DeleteAccountOK with default headers values
|
||||
func NewDeleteAccountOK() *DeleteAccountOK {
|
||||
return &DeleteAccountOK{}
|
||||
}
|
||||
|
||||
/*DeleteAccountOK handles this case with default header values.
|
||||
|
||||
Taxnexus Response with Message Objects with Delete Status
|
||||
*/
|
||||
type DeleteAccountOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.DeleteResponse
|
||||
}
|
||||
|
||||
func (o *DeleteAccountOK) Error() string {
|
||||
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAccountOK) GetPayload() *crm_models.DeleteResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *DeleteAccountOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.DeleteResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewDeleteAccountUnauthorized creates a DeleteAccountUnauthorized with default headers values
|
||||
func NewDeleteAccountUnauthorized() *DeleteAccountUnauthorized {
|
||||
return &DeleteAccountUnauthorized{}
|
||||
}
|
||||
|
||||
/*DeleteAccountUnauthorized handles this case with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type DeleteAccountUnauthorized struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *DeleteAccountUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAccountUnauthorized) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *DeleteAccountUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewDeleteAccountForbidden creates a DeleteAccountForbidden with default headers values
|
||||
func NewDeleteAccountForbidden() *DeleteAccountForbidden {
|
||||
return &DeleteAccountForbidden{}
|
||||
}
|
||||
|
||||
/*DeleteAccountForbidden handles this case with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type DeleteAccountForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *DeleteAccountForbidden) Error() string {
|
||||
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAccountForbidden) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *DeleteAccountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewDeleteAccountNotFound creates a DeleteAccountNotFound with default headers values
|
||||
func NewDeleteAccountNotFound() *DeleteAccountNotFound {
|
||||
return &DeleteAccountNotFound{}
|
||||
}
|
||||
|
||||
/*DeleteAccountNotFound handles this case with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type DeleteAccountNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *DeleteAccountNotFound) Error() string {
|
||||
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAccountNotFound) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *DeleteAccountNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewDeleteAccountUnprocessableEntity creates a DeleteAccountUnprocessableEntity with default headers values
|
||||
func NewDeleteAccountUnprocessableEntity() *DeleteAccountUnprocessableEntity {
|
||||
return &DeleteAccountUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*DeleteAccountUnprocessableEntity handles this case with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type DeleteAccountUnprocessableEntity struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *DeleteAccountUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAccountUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *DeleteAccountUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewDeleteAccountInternalServerError creates a DeleteAccountInternalServerError with default headers values
|
||||
func NewDeleteAccountInternalServerError() *DeleteAccountInternalServerError {
|
||||
return &DeleteAccountInternalServerError{}
|
||||
}
|
||||
|
||||
/*DeleteAccountInternalServerError handles this case with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type DeleteAccountInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *DeleteAccountInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAccountInternalServerError) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *DeleteAccountInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,247 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package accounts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// NewGetAccountsObservableParams creates a new GetAccountsObservableParams object
|
||||
// with the default values initialized.
|
||||
func NewGetAccountsObservableParams() *GetAccountsObservableParams {
|
||||
var ()
|
||||
return &GetAccountsObservableParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAccountsObservableParamsWithTimeout creates a new GetAccountsObservableParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewGetAccountsObservableParamsWithTimeout(timeout time.Duration) *GetAccountsObservableParams {
|
||||
var ()
|
||||
return &GetAccountsObservableParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAccountsObservableParamsWithContext creates a new GetAccountsObservableParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewGetAccountsObservableParamsWithContext(ctx context.Context) *GetAccountsObservableParams {
|
||||
var ()
|
||||
return &GetAccountsObservableParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAccountsObservableParamsWithHTTPClient creates a new GetAccountsObservableParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewGetAccountsObservableParamsWithHTTPClient(client *http.Client) *GetAccountsObservableParams {
|
||||
var ()
|
||||
return &GetAccountsObservableParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*GetAccountsObservableParams contains all the parameters to send to the API endpoint
|
||||
for the get accounts observable operation typically these are written to a http.Request
|
||||
*/
|
||||
type GetAccountsObservableParams struct {
|
||||
|
||||
/*AccountID
|
||||
Taxnexus Record Id of an Account
|
||||
|
||||
*/
|
||||
AccountID *string
|
||||
/*Active
|
||||
Only retrieve active records?
|
||||
|
||||
*/
|
||||
Active *bool
|
||||
/*Email
|
||||
Email address used for identity lookup
|
||||
|
||||
*/
|
||||
Email *string
|
||||
/*Name
|
||||
The Name of this Object
|
||||
|
||||
*/
|
||||
Name *string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get accounts observable params
|
||||
func (o *GetAccountsObservableParams) WithTimeout(timeout time.Duration) *GetAccountsObservableParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get accounts observable params
|
||||
func (o *GetAccountsObservableParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get accounts observable params
|
||||
func (o *GetAccountsObservableParams) WithContext(ctx context.Context) *GetAccountsObservableParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get accounts observable params
|
||||
func (o *GetAccountsObservableParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get accounts observable params
|
||||
func (o *GetAccountsObservableParams) WithHTTPClient(client *http.Client) *GetAccountsObservableParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get accounts observable params
|
||||
func (o *GetAccountsObservableParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithAccountID adds the accountID to the get accounts observable params
|
||||
func (o *GetAccountsObservableParams) WithAccountID(accountID *string) *GetAccountsObservableParams {
|
||||
o.SetAccountID(accountID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetAccountID adds the accountId to the get accounts observable params
|
||||
func (o *GetAccountsObservableParams) SetAccountID(accountID *string) {
|
||||
o.AccountID = accountID
|
||||
}
|
||||
|
||||
// WithActive adds the active to the get accounts observable params
|
||||
func (o *GetAccountsObservableParams) WithActive(active *bool) *GetAccountsObservableParams {
|
||||
o.SetActive(active)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetActive adds the active to the get accounts observable params
|
||||
func (o *GetAccountsObservableParams) SetActive(active *bool) {
|
||||
o.Active = active
|
||||
}
|
||||
|
||||
// WithEmail adds the email to the get accounts observable params
|
||||
func (o *GetAccountsObservableParams) WithEmail(email *string) *GetAccountsObservableParams {
|
||||
o.SetEmail(email)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetEmail adds the email to the get accounts observable params
|
||||
func (o *GetAccountsObservableParams) SetEmail(email *string) {
|
||||
o.Email = email
|
||||
}
|
||||
|
||||
// WithName adds the name to the get accounts observable params
|
||||
func (o *GetAccountsObservableParams) WithName(name *string) *GetAccountsObservableParams {
|
||||
o.SetName(name)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetName adds the name to the get accounts observable params
|
||||
func (o *GetAccountsObservableParams) SetName(name *string) {
|
||||
o.Name = name
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetAccountsObservableParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if o.AccountID != nil {
|
||||
|
||||
// query param accountId
|
||||
var qrAccountID string
|
||||
if o.AccountID != nil {
|
||||
qrAccountID = *o.AccountID
|
||||
}
|
||||
qAccountID := qrAccountID
|
||||
if qAccountID != "" {
|
||||
if err := r.SetQueryParam("accountId", qAccountID); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if o.Active != nil {
|
||||
|
||||
// query param active
|
||||
var qrActive bool
|
||||
if o.Active != nil {
|
||||
qrActive = *o.Active
|
||||
}
|
||||
qActive := swag.FormatBool(qrActive)
|
||||
if qActive != "" {
|
||||
if err := r.SetQueryParam("active", qActive); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if o.Email != nil {
|
||||
|
||||
// query param email
|
||||
var qrEmail string
|
||||
if o.Email != nil {
|
||||
qrEmail = *o.Email
|
||||
}
|
||||
qEmail := qrEmail
|
||||
if qEmail != "" {
|
||||
if err := r.SetQueryParam("email", qEmail); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if o.Name != nil {
|
||||
|
||||
// query param name
|
||||
var qrName string
|
||||
if o.Name != nil {
|
||||
qrName = *o.Name
|
||||
}
|
||||
qName := qrName
|
||||
if qName != "" {
|
||||
if err := r.SetQueryParam("name", qName); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,301 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package accounts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/taxnexus/go/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// GetAccountsObservableReader is a Reader for the GetAccountsObservable structure.
|
||||
type GetAccountsObservableReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetAccountsObservableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetAccountsObservableOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewGetAccountsObservableUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewGetAccountsObservableForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewGetAccountsObservableNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewGetAccountsObservableUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewGetAccountsObservableInternalServerError()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAccountsObservableOK creates a GetAccountsObservableOK with default headers values
|
||||
func NewGetAccountsObservableOK() *GetAccountsObservableOK {
|
||||
return &GetAccountsObservableOK{}
|
||||
}
|
||||
|
||||
/*GetAccountsObservableOK handles this case with default header values.
|
||||
|
||||
Taxnexus Response with an array of Account objects
|
||||
*/
|
||||
type GetAccountsObservableOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
CacheControl string
|
||||
|
||||
Payload []*crm_models.Account
|
||||
}
|
||||
|
||||
func (o *GetAccountsObservableOK) Error() string {
|
||||
return fmt.Sprintf("[GET /accounts/observable][%d] getAccountsObservableOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAccountsObservableOK) GetPayload() []*crm_models.Account {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAccountsObservableOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
// response header Cache-Control
|
||||
o.CacheControl = response.GetHeader("Cache-Control")
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetAccountsObservableUnauthorized creates a GetAccountsObservableUnauthorized with default headers values
|
||||
func NewGetAccountsObservableUnauthorized() *GetAccountsObservableUnauthorized {
|
||||
return &GetAccountsObservableUnauthorized{}
|
||||
}
|
||||
|
||||
/*GetAccountsObservableUnauthorized handles this case with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type GetAccountsObservableUnauthorized struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *GetAccountsObservableUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /accounts/observable][%d] getAccountsObservableUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAccountsObservableUnauthorized) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAccountsObservableUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetAccountsObservableForbidden creates a GetAccountsObservableForbidden with default headers values
|
||||
func NewGetAccountsObservableForbidden() *GetAccountsObservableForbidden {
|
||||
return &GetAccountsObservableForbidden{}
|
||||
}
|
||||
|
||||
/*GetAccountsObservableForbidden handles this case with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type GetAccountsObservableForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *GetAccountsObservableForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /accounts/observable][%d] getAccountsObservableForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAccountsObservableForbidden) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAccountsObservableForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetAccountsObservableNotFound creates a GetAccountsObservableNotFound with default headers values
|
||||
func NewGetAccountsObservableNotFound() *GetAccountsObservableNotFound {
|
||||
return &GetAccountsObservableNotFound{}
|
||||
}
|
||||
|
||||
/*GetAccountsObservableNotFound handles this case with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type GetAccountsObservableNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *GetAccountsObservableNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /accounts/observable][%d] getAccountsObservableNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAccountsObservableNotFound) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAccountsObservableNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetAccountsObservableUnprocessableEntity creates a GetAccountsObservableUnprocessableEntity with default headers values
|
||||
func NewGetAccountsObservableUnprocessableEntity() *GetAccountsObservableUnprocessableEntity {
|
||||
return &GetAccountsObservableUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*GetAccountsObservableUnprocessableEntity handles this case with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type GetAccountsObservableUnprocessableEntity struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *GetAccountsObservableUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[GET /accounts/observable][%d] getAccountsObservableUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAccountsObservableUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAccountsObservableUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetAccountsObservableInternalServerError creates a GetAccountsObservableInternalServerError with default headers values
|
||||
func NewGetAccountsObservableInternalServerError() *GetAccountsObservableInternalServerError {
|
||||
return &GetAccountsObservableInternalServerError{}
|
||||
}
|
||||
|
||||
/*GetAccountsObservableInternalServerError handles this case with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type GetAccountsObservableInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *GetAccountsObservableInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /accounts/observable][%d] getAccountsObservableInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAccountsObservableInternalServerError) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAccountsObservableInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,311 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package accounts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// NewGetAccountsParams creates a new GetAccountsParams object
|
||||
// with the default values initialized.
|
||||
func NewGetAccountsParams() *GetAccountsParams {
|
||||
var ()
|
||||
return &GetAccountsParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAccountsParamsWithTimeout creates a new GetAccountsParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewGetAccountsParamsWithTimeout(timeout time.Duration) *GetAccountsParams {
|
||||
var ()
|
||||
return &GetAccountsParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAccountsParamsWithContext creates a new GetAccountsParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewGetAccountsParamsWithContext(ctx context.Context) *GetAccountsParams {
|
||||
var ()
|
||||
return &GetAccountsParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAccountsParamsWithHTTPClient creates a new GetAccountsParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewGetAccountsParamsWithHTTPClient(client *http.Client) *GetAccountsParams {
|
||||
var ()
|
||||
return &GetAccountsParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*GetAccountsParams contains all the parameters to send to the API endpoint
|
||||
for the get accounts operation typically these are written to a http.Request
|
||||
*/
|
||||
type GetAccountsParams struct {
|
||||
|
||||
/*AccountID
|
||||
Taxnexus Record Id of an Account
|
||||
|
||||
*/
|
||||
AccountID *string
|
||||
/*Active
|
||||
Only retrieve active records?
|
||||
|
||||
*/
|
||||
Active *bool
|
||||
/*Email
|
||||
Email address used for identity lookup
|
||||
|
||||
*/
|
||||
Email *string
|
||||
/*Limit
|
||||
How many objects to return at one time
|
||||
|
||||
*/
|
||||
Limit *int64
|
||||
/*Name
|
||||
The Name of this Object
|
||||
|
||||
*/
|
||||
Name *string
|
||||
/*Offset
|
||||
How many objects to skip?
|
||||
|
||||
*/
|
||||
Offset *int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get accounts params
|
||||
func (o *GetAccountsParams) WithTimeout(timeout time.Duration) *GetAccountsParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get accounts params
|
||||
func (o *GetAccountsParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get accounts params
|
||||
func (o *GetAccountsParams) WithContext(ctx context.Context) *GetAccountsParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get accounts params
|
||||
func (o *GetAccountsParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get accounts params
|
||||
func (o *GetAccountsParams) WithHTTPClient(client *http.Client) *GetAccountsParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get accounts params
|
||||
func (o *GetAccountsParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithAccountID adds the accountID to the get accounts params
|
||||
func (o *GetAccountsParams) WithAccountID(accountID *string) *GetAccountsParams {
|
||||
o.SetAccountID(accountID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetAccountID adds the accountId to the get accounts params
|
||||
func (o *GetAccountsParams) SetAccountID(accountID *string) {
|
||||
o.AccountID = accountID
|
||||
}
|
||||
|
||||
// WithActive adds the active to the get accounts params
|
||||
func (o *GetAccountsParams) WithActive(active *bool) *GetAccountsParams {
|
||||
o.SetActive(active)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetActive adds the active to the get accounts params
|
||||
func (o *GetAccountsParams) SetActive(active *bool) {
|
||||
o.Active = active
|
||||
}
|
||||
|
||||
// WithEmail adds the email to the get accounts params
|
||||
func (o *GetAccountsParams) WithEmail(email *string) *GetAccountsParams {
|
||||
o.SetEmail(email)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetEmail adds the email to the get accounts params
|
||||
func (o *GetAccountsParams) SetEmail(email *string) {
|
||||
o.Email = email
|
||||
}
|
||||
|
||||
// WithLimit adds the limit to the get accounts params
|
||||
func (o *GetAccountsParams) WithLimit(limit *int64) *GetAccountsParams {
|
||||
o.SetLimit(limit)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetLimit adds the limit to the get accounts params
|
||||
func (o *GetAccountsParams) SetLimit(limit *int64) {
|
||||
o.Limit = limit
|
||||
}
|
||||
|
||||
// WithName adds the name to the get accounts params
|
||||
func (o *GetAccountsParams) WithName(name *string) *GetAccountsParams {
|
||||
o.SetName(name)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetName adds the name to the get accounts params
|
||||
func (o *GetAccountsParams) SetName(name *string) {
|
||||
o.Name = name
|
||||
}
|
||||
|
||||
// WithOffset adds the offset to the get accounts params
|
||||
func (o *GetAccountsParams) WithOffset(offset *int64) *GetAccountsParams {
|
||||
o.SetOffset(offset)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetOffset adds the offset to the get accounts params
|
||||
func (o *GetAccountsParams) SetOffset(offset *int64) {
|
||||
o.Offset = offset
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetAccountsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if o.AccountID != nil {
|
||||
|
||||
// query param accountId
|
||||
var qrAccountID string
|
||||
if o.AccountID != nil {
|
||||
qrAccountID = *o.AccountID
|
||||
}
|
||||
qAccountID := qrAccountID
|
||||
if qAccountID != "" {
|
||||
if err := r.SetQueryParam("accountId", qAccountID); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if o.Active != nil {
|
||||
|
||||
// query param active
|
||||
var qrActive bool
|
||||
if o.Active != nil {
|
||||
qrActive = *o.Active
|
||||
}
|
||||
qActive := swag.FormatBool(qrActive)
|
||||
if qActive != "" {
|
||||
if err := r.SetQueryParam("active", qActive); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if o.Email != nil {
|
||||
|
||||
// query param email
|
||||
var qrEmail string
|
||||
if o.Email != nil {
|
||||
qrEmail = *o.Email
|
||||
}
|
||||
qEmail := qrEmail
|
||||
if qEmail != "" {
|
||||
if err := r.SetQueryParam("email", qEmail); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if o.Limit != nil {
|
||||
|
||||
// query param limit
|
||||
var qrLimit int64
|
||||
if o.Limit != nil {
|
||||
qrLimit = *o.Limit
|
||||
}
|
||||
qLimit := swag.FormatInt64(qrLimit)
|
||||
if qLimit != "" {
|
||||
if err := r.SetQueryParam("limit", qLimit); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if o.Name != nil {
|
||||
|
||||
// query param name
|
||||
var qrName string
|
||||
if o.Name != nil {
|
||||
qrName = *o.Name
|
||||
}
|
||||
qName := qrName
|
||||
if qName != "" {
|
||||
if err := r.SetQueryParam("name", qName); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if o.Offset != nil {
|
||||
|
||||
// query param offset
|
||||
var qrOffset int64
|
||||
if o.Offset != nil {
|
||||
qrOffset = *o.Offset
|
||||
}
|
||||
qOffset := swag.FormatInt64(qrOffset)
|
||||
if qOffset != "" {
|
||||
if err := r.SetQueryParam("offset", qOffset); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,303 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package accounts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/taxnexus/go/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// GetAccountsReader is a Reader for the GetAccounts structure.
|
||||
type GetAccountsReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetAccountsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetAccountsOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewGetAccountsUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewGetAccountsForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewGetAccountsNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewGetAccountsUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewGetAccountsInternalServerError()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAccountsOK creates a GetAccountsOK with default headers values
|
||||
func NewGetAccountsOK() *GetAccountsOK {
|
||||
return &GetAccountsOK{}
|
||||
}
|
||||
|
||||
/*GetAccountsOK handles this case with default header values.
|
||||
|
||||
Taxnexus Response with Account objects with Contacts
|
||||
*/
|
||||
type GetAccountsOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
CacheControl string
|
||||
|
||||
Payload *crm_models.AccountResponse
|
||||
}
|
||||
|
||||
func (o *GetAccountsOK) Error() string {
|
||||
return fmt.Sprintf("[GET /accounts][%d] getAccountsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAccountsOK) GetPayload() *crm_models.AccountResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAccountsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
// response header Cache-Control
|
||||
o.CacheControl = response.GetHeader("Cache-Control")
|
||||
|
||||
o.Payload = new(crm_models.AccountResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetAccountsUnauthorized creates a GetAccountsUnauthorized with default headers values
|
||||
func NewGetAccountsUnauthorized() *GetAccountsUnauthorized {
|
||||
return &GetAccountsUnauthorized{}
|
||||
}
|
||||
|
||||
/*GetAccountsUnauthorized handles this case with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type GetAccountsUnauthorized struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *GetAccountsUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /accounts][%d] getAccountsUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAccountsUnauthorized) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAccountsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetAccountsForbidden creates a GetAccountsForbidden with default headers values
|
||||
func NewGetAccountsForbidden() *GetAccountsForbidden {
|
||||
return &GetAccountsForbidden{}
|
||||
}
|
||||
|
||||
/*GetAccountsForbidden handles this case with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type GetAccountsForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *GetAccountsForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /accounts][%d] getAccountsForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAccountsForbidden) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAccountsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetAccountsNotFound creates a GetAccountsNotFound with default headers values
|
||||
func NewGetAccountsNotFound() *GetAccountsNotFound {
|
||||
return &GetAccountsNotFound{}
|
||||
}
|
||||
|
||||
/*GetAccountsNotFound handles this case with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type GetAccountsNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *GetAccountsNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /accounts][%d] getAccountsNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAccountsNotFound) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAccountsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetAccountsUnprocessableEntity creates a GetAccountsUnprocessableEntity with default headers values
|
||||
func NewGetAccountsUnprocessableEntity() *GetAccountsUnprocessableEntity {
|
||||
return &GetAccountsUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*GetAccountsUnprocessableEntity handles this case with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type GetAccountsUnprocessableEntity struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *GetAccountsUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[GET /accounts][%d] getAccountsUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAccountsUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAccountsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetAccountsInternalServerError creates a GetAccountsInternalServerError with default headers values
|
||||
func NewGetAccountsInternalServerError() *GetAccountsInternalServerError {
|
||||
return &GetAccountsInternalServerError{}
|
||||
}
|
||||
|
||||
/*GetAccountsInternalServerError handles this case with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type GetAccountsInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *GetAccountsInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /accounts][%d] getAccountsInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAccountsInternalServerError) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAccountsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,142 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package accounts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/taxnexus/go/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// NewPostAccountsParams creates a new PostAccountsParams object
|
||||
// with the default values initialized.
|
||||
func NewPostAccountsParams() *PostAccountsParams {
|
||||
var ()
|
||||
return &PostAccountsParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAccountsParamsWithTimeout creates a new PostAccountsParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewPostAccountsParamsWithTimeout(timeout time.Duration) *PostAccountsParams {
|
||||
var ()
|
||||
return &PostAccountsParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAccountsParamsWithContext creates a new PostAccountsParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewPostAccountsParamsWithContext(ctx context.Context) *PostAccountsParams {
|
||||
var ()
|
||||
return &PostAccountsParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAccountsParamsWithHTTPClient creates a new PostAccountsParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewPostAccountsParamsWithHTTPClient(client *http.Client) *PostAccountsParams {
|
||||
var ()
|
||||
return &PostAccountsParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*PostAccountsParams contains all the parameters to send to the API endpoint
|
||||
for the post accounts operation typically these are written to a http.Request
|
||||
*/
|
||||
type PostAccountsParams struct {
|
||||
|
||||
/*AccountRequest
|
||||
An array of new Account records
|
||||
|
||||
*/
|
||||
AccountRequest *crm_models.AccountRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the post accounts params
|
||||
func (o *PostAccountsParams) WithTimeout(timeout time.Duration) *PostAccountsParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the post accounts params
|
||||
func (o *PostAccountsParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the post accounts params
|
||||
func (o *PostAccountsParams) WithContext(ctx context.Context) *PostAccountsParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the post accounts params
|
||||
func (o *PostAccountsParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the post accounts params
|
||||
func (o *PostAccountsParams) WithHTTPClient(client *http.Client) *PostAccountsParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the post accounts params
|
||||
func (o *PostAccountsParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithAccountRequest adds the accountRequest to the post accounts params
|
||||
func (o *PostAccountsParams) WithAccountRequest(accountRequest *crm_models.AccountRequest) *PostAccountsParams {
|
||||
o.SetAccountRequest(accountRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetAccountRequest adds the accountRequest to the post accounts params
|
||||
func (o *PostAccountsParams) SetAccountRequest(accountRequest *crm_models.AccountRequest) {
|
||||
o.AccountRequest = accountRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PostAccountsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if o.AccountRequest != nil {
|
||||
if err := r.SetBodyParam(o.AccountRequest); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,303 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package accounts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/taxnexus/go/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// PostAccountsReader is a Reader for the PostAccounts structure.
|
||||
type PostAccountsReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PostAccountsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPostAccountsOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewPostAccountsUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewPostAccountsForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewPostAccountsNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewPostAccountsUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewPostAccountsInternalServerError()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAccountsOK creates a PostAccountsOK with default headers values
|
||||
func NewPostAccountsOK() *PostAccountsOK {
|
||||
return &PostAccountsOK{}
|
||||
}
|
||||
|
||||
/*PostAccountsOK handles this case with default header values.
|
||||
|
||||
Taxnexus Response with Account objects with Contacts
|
||||
*/
|
||||
type PostAccountsOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
CacheControl string
|
||||
|
||||
Payload *crm_models.AccountResponse
|
||||
}
|
||||
|
||||
func (o *PostAccountsOK) Error() string {
|
||||
return fmt.Sprintf("[POST /accounts][%d] postAccountsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostAccountsOK) GetPayload() *crm_models.AccountResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostAccountsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
// response header Cache-Control
|
||||
o.CacheControl = response.GetHeader("Cache-Control")
|
||||
|
||||
o.Payload = new(crm_models.AccountResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostAccountsUnauthorized creates a PostAccountsUnauthorized with default headers values
|
||||
func NewPostAccountsUnauthorized() *PostAccountsUnauthorized {
|
||||
return &PostAccountsUnauthorized{}
|
||||
}
|
||||
|
||||
/*PostAccountsUnauthorized handles this case with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type PostAccountsUnauthorized struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *PostAccountsUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[POST /accounts][%d] postAccountsUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostAccountsUnauthorized) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostAccountsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostAccountsForbidden creates a PostAccountsForbidden with default headers values
|
||||
func NewPostAccountsForbidden() *PostAccountsForbidden {
|
||||
return &PostAccountsForbidden{}
|
||||
}
|
||||
|
||||
/*PostAccountsForbidden handles this case with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type PostAccountsForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *PostAccountsForbidden) Error() string {
|
||||
return fmt.Sprintf("[POST /accounts][%d] postAccountsForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostAccountsForbidden) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostAccountsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostAccountsNotFound creates a PostAccountsNotFound with default headers values
|
||||
func NewPostAccountsNotFound() *PostAccountsNotFound {
|
||||
return &PostAccountsNotFound{}
|
||||
}
|
||||
|
||||
/*PostAccountsNotFound handles this case with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type PostAccountsNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *PostAccountsNotFound) Error() string {
|
||||
return fmt.Sprintf("[POST /accounts][%d] postAccountsNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostAccountsNotFound) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostAccountsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostAccountsUnprocessableEntity creates a PostAccountsUnprocessableEntity with default headers values
|
||||
func NewPostAccountsUnprocessableEntity() *PostAccountsUnprocessableEntity {
|
||||
return &PostAccountsUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*PostAccountsUnprocessableEntity handles this case with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type PostAccountsUnprocessableEntity struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *PostAccountsUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[POST /accounts][%d] postAccountsUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostAccountsUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostAccountsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostAccountsInternalServerError creates a PostAccountsInternalServerError with default headers values
|
||||
func NewPostAccountsInternalServerError() *PostAccountsInternalServerError {
|
||||
return &PostAccountsInternalServerError{}
|
||||
}
|
||||
|
||||
/*PostAccountsInternalServerError handles this case with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type PostAccountsInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *PostAccountsInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[POST /accounts][%d] postAccountsInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostAccountsInternalServerError) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostAccountsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,142 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package accounts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/taxnexus/go/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// NewPutAccountParams creates a new PutAccountParams object
|
||||
// with the default values initialized.
|
||||
func NewPutAccountParams() *PutAccountParams {
|
||||
var ()
|
||||
return &PutAccountParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPutAccountParamsWithTimeout creates a new PutAccountParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewPutAccountParamsWithTimeout(timeout time.Duration) *PutAccountParams {
|
||||
var ()
|
||||
return &PutAccountParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPutAccountParamsWithContext creates a new PutAccountParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewPutAccountParamsWithContext(ctx context.Context) *PutAccountParams {
|
||||
var ()
|
||||
return &PutAccountParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPutAccountParamsWithHTTPClient creates a new PutAccountParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewPutAccountParamsWithHTTPClient(client *http.Client) *PutAccountParams {
|
||||
var ()
|
||||
return &PutAccountParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*PutAccountParams contains all the parameters to send to the API endpoint
|
||||
for the put account operation typically these are written to a http.Request
|
||||
*/
|
||||
type PutAccountParams struct {
|
||||
|
||||
/*AccountRequest
|
||||
An array of new Account records
|
||||
|
||||
*/
|
||||
AccountRequest *crm_models.AccountRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the put account params
|
||||
func (o *PutAccountParams) WithTimeout(timeout time.Duration) *PutAccountParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the put account params
|
||||
func (o *PutAccountParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the put account params
|
||||
func (o *PutAccountParams) WithContext(ctx context.Context) *PutAccountParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the put account params
|
||||
func (o *PutAccountParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the put account params
|
||||
func (o *PutAccountParams) WithHTTPClient(client *http.Client) *PutAccountParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the put account params
|
||||
func (o *PutAccountParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithAccountRequest adds the accountRequest to the put account params
|
||||
func (o *PutAccountParams) WithAccountRequest(accountRequest *crm_models.AccountRequest) *PutAccountParams {
|
||||
o.SetAccountRequest(accountRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetAccountRequest adds the accountRequest to the put account params
|
||||
func (o *PutAccountParams) SetAccountRequest(accountRequest *crm_models.AccountRequest) {
|
||||
o.AccountRequest = accountRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PutAccountParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if o.AccountRequest != nil {
|
||||
if err := r.SetBodyParam(o.AccountRequest); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,303 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package accounts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/taxnexus/go/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// PutAccountReader is a Reader for the PutAccount structure.
|
||||
type PutAccountReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PutAccountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPutAccountOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewPutAccountUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewPutAccountForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewPutAccountNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewPutAccountUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewPutAccountInternalServerError()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPutAccountOK creates a PutAccountOK with default headers values
|
||||
func NewPutAccountOK() *PutAccountOK {
|
||||
return &PutAccountOK{}
|
||||
}
|
||||
|
||||
/*PutAccountOK handles this case with default header values.
|
||||
|
||||
Taxnexus Response with Account objects with Contacts
|
||||
*/
|
||||
type PutAccountOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
CacheControl string
|
||||
|
||||
Payload *crm_models.AccountResponse
|
||||
}
|
||||
|
||||
func (o *PutAccountOK) Error() string {
|
||||
return fmt.Sprintf("[PUT /accounts][%d] putAccountOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutAccountOK) GetPayload() *crm_models.AccountResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutAccountOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
// response header Cache-Control
|
||||
o.CacheControl = response.GetHeader("Cache-Control")
|
||||
|
||||
o.Payload = new(crm_models.AccountResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPutAccountUnauthorized creates a PutAccountUnauthorized with default headers values
|
||||
func NewPutAccountUnauthorized() *PutAccountUnauthorized {
|
||||
return &PutAccountUnauthorized{}
|
||||
}
|
||||
|
||||
/*PutAccountUnauthorized handles this case with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type PutAccountUnauthorized struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *PutAccountUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[PUT /accounts][%d] putAccountUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutAccountUnauthorized) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutAccountUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPutAccountForbidden creates a PutAccountForbidden with default headers values
|
||||
func NewPutAccountForbidden() *PutAccountForbidden {
|
||||
return &PutAccountForbidden{}
|
||||
}
|
||||
|
||||
/*PutAccountForbidden handles this case with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type PutAccountForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *PutAccountForbidden) Error() string {
|
||||
return fmt.Sprintf("[PUT /accounts][%d] putAccountForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutAccountForbidden) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutAccountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPutAccountNotFound creates a PutAccountNotFound with default headers values
|
||||
func NewPutAccountNotFound() *PutAccountNotFound {
|
||||
return &PutAccountNotFound{}
|
||||
}
|
||||
|
||||
/*PutAccountNotFound handles this case with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type PutAccountNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *PutAccountNotFound) Error() string {
|
||||
return fmt.Sprintf("[PUT /accounts][%d] putAccountNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutAccountNotFound) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutAccountNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPutAccountUnprocessableEntity creates a PutAccountUnprocessableEntity with default headers values
|
||||
func NewPutAccountUnprocessableEntity() *PutAccountUnprocessableEntity {
|
||||
return &PutAccountUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*PutAccountUnprocessableEntity handles this case with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type PutAccountUnprocessableEntity struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *PutAccountUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[PUT /accounts][%d] putAccountUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutAccountUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutAccountUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPutAccountInternalServerError creates a PutAccountInternalServerError with default headers values
|
||||
func NewPutAccountInternalServerError() *PutAccountInternalServerError {
|
||||
return &PutAccountInternalServerError{}
|
||||
}
|
||||
|
||||
/*PutAccountInternalServerError handles this case with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type PutAccountInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *PutAccountInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[PUT /accounts][%d] putAccountInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutAccountInternalServerError) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutAccountInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,157 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package companies
|
||||
|
||||
// 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 companies API client.
|
||||
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
|
||||
return &Client{transport: transport, formats: formats}
|
||||
}
|
||||
|
||||
/*
|
||||
Client for companies API
|
||||
*/
|
||||
type Client struct {
|
||||
transport runtime.ClientTransport
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ClientService is the interface for Client methods
|
||||
type ClientService interface {
|
||||
GetCompanies(params *GetCompaniesParams, authInfo runtime.ClientAuthInfoWriter) (*GetCompaniesOK, error)
|
||||
|
||||
GetCompaniesObservable(params *GetCompaniesObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetCompaniesObservableOK, error)
|
||||
|
||||
PostCompanies(params *PostCompaniesParams, authInfo runtime.ClientAuthInfoWriter) (*PostCompaniesOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
||||
/*
|
||||
GetCompanies gets company records
|
||||
|
||||
Retrieve Company records from the datastore
|
||||
*/
|
||||
func (a *Client) GetCompanies(params *GetCompaniesParams, authInfo runtime.ClientAuthInfoWriter) (*GetCompaniesOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetCompaniesParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "getCompanies",
|
||||
Method: "GET",
|
||||
PathPattern: "/companies",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetCompaniesReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*GetCompaniesOK)
|
||||
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 getCompanies: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
GetCompaniesObservable gets taxnexus companies in an observable array
|
||||
|
||||
A list of companies in a simple JSON array
|
||||
*/
|
||||
func (a *Client) GetCompaniesObservable(params *GetCompaniesObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetCompaniesObservableOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetCompaniesObservableParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "getCompaniesObservable",
|
||||
Method: "GET",
|
||||
PathPattern: "/companies/observable",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetCompaniesObservableReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*GetCompaniesObservableOK)
|
||||
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 getCompaniesObservable: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PostCompanies adds new companies
|
||||
|
||||
Add new companies
|
||||
*/
|
||||
func (a *Client) PostCompanies(params *PostCompaniesParams, authInfo runtime.ClientAuthInfoWriter) (*PostCompaniesOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPostCompaniesParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "postCompanies",
|
||||
Method: "POST",
|
||||
PathPattern: "/companies",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PostCompaniesReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*PostCompaniesOK)
|
||||
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 postCompanies: 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
|
||||
}
|
|
@ -0,0 +1,150 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package companies
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// NewGetCompaniesObservableParams creates a new GetCompaniesObservableParams object
|
||||
// with the default values initialized.
|
||||
func NewGetCompaniesObservableParams() *GetCompaniesObservableParams {
|
||||
var ()
|
||||
return &GetCompaniesObservableParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetCompaniesObservableParamsWithTimeout creates a new GetCompaniesObservableParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewGetCompaniesObservableParamsWithTimeout(timeout time.Duration) *GetCompaniesObservableParams {
|
||||
var ()
|
||||
return &GetCompaniesObservableParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetCompaniesObservableParamsWithContext creates a new GetCompaniesObservableParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewGetCompaniesObservableParamsWithContext(ctx context.Context) *GetCompaniesObservableParams {
|
||||
var ()
|
||||
return &GetCompaniesObservableParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetCompaniesObservableParamsWithHTTPClient creates a new GetCompaniesObservableParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewGetCompaniesObservableParamsWithHTTPClient(client *http.Client) *GetCompaniesObservableParams {
|
||||
var ()
|
||||
return &GetCompaniesObservableParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*GetCompaniesObservableParams contains all the parameters to send to the API endpoint
|
||||
for the get companies observable operation typically these are written to a http.Request
|
||||
*/
|
||||
type GetCompaniesObservableParams struct {
|
||||
|
||||
/*CompanyID
|
||||
Taxnexus Company record ID
|
||||
|
||||
*/
|
||||
CompanyID *string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get companies observable params
|
||||
func (o *GetCompaniesObservableParams) WithTimeout(timeout time.Duration) *GetCompaniesObservableParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get companies observable params
|
||||
func (o *GetCompaniesObservableParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get companies observable params
|
||||
func (o *GetCompaniesObservableParams) WithContext(ctx context.Context) *GetCompaniesObservableParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get companies observable params
|
||||
func (o *GetCompaniesObservableParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get companies observable params
|
||||
func (o *GetCompaniesObservableParams) WithHTTPClient(client *http.Client) *GetCompaniesObservableParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get companies observable params
|
||||
func (o *GetCompaniesObservableParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithCompanyID adds the companyID to the get companies observable params
|
||||
func (o *GetCompaniesObservableParams) WithCompanyID(companyID *string) *GetCompaniesObservableParams {
|
||||
o.SetCompanyID(companyID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetCompanyID adds the companyId to the get companies observable params
|
||||
func (o *GetCompaniesObservableParams) SetCompanyID(companyID *string) {
|
||||
o.CompanyID = companyID
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetCompaniesObservableParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if o.CompanyID != nil {
|
||||
|
||||
// query param companyId
|
||||
var qrCompanyID string
|
||||
if o.CompanyID != nil {
|
||||
qrCompanyID = *o.CompanyID
|
||||
}
|
||||
qCompanyID := qrCompanyID
|
||||
if qCompanyID != "" {
|
||||
if err := r.SetQueryParam("companyId", qCompanyID); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,301 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package companies
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/taxnexus/go/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// GetCompaniesObservableReader is a Reader for the GetCompaniesObservable structure.
|
||||
type GetCompaniesObservableReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetCompaniesObservableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetCompaniesObservableOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewGetCompaniesObservableUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewGetCompaniesObservableForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewGetCompaniesObservableNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewGetCompaniesObservableUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewGetCompaniesObservableInternalServerError()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetCompaniesObservableOK creates a GetCompaniesObservableOK with default headers values
|
||||
func NewGetCompaniesObservableOK() *GetCompaniesObservableOK {
|
||||
return &GetCompaniesObservableOK{}
|
||||
}
|
||||
|
||||
/*GetCompaniesObservableOK handles this case with default header values.
|
||||
|
||||
Taxnexus Response with an array of Company objects
|
||||
*/
|
||||
type GetCompaniesObservableOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
CacheControl string
|
||||
|
||||
Payload []*crm_models.Company
|
||||
}
|
||||
|
||||
func (o *GetCompaniesObservableOK) Error() string {
|
||||
return fmt.Sprintf("[GET /companies/observable][%d] getCompaniesObservableOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCompaniesObservableOK) GetPayload() []*crm_models.Company {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCompaniesObservableOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
// response header Cache-Control
|
||||
o.CacheControl = response.GetHeader("Cache-Control")
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetCompaniesObservableUnauthorized creates a GetCompaniesObservableUnauthorized with default headers values
|
||||
func NewGetCompaniesObservableUnauthorized() *GetCompaniesObservableUnauthorized {
|
||||
return &GetCompaniesObservableUnauthorized{}
|
||||
}
|
||||
|
||||
/*GetCompaniesObservableUnauthorized handles this case with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type GetCompaniesObservableUnauthorized struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *GetCompaniesObservableUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /companies/observable][%d] getCompaniesObservableUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCompaniesObservableUnauthorized) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCompaniesObservableUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetCompaniesObservableForbidden creates a GetCompaniesObservableForbidden with default headers values
|
||||
func NewGetCompaniesObservableForbidden() *GetCompaniesObservableForbidden {
|
||||
return &GetCompaniesObservableForbidden{}
|
||||
}
|
||||
|
||||
/*GetCompaniesObservableForbidden handles this case with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type GetCompaniesObservableForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *GetCompaniesObservableForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /companies/observable][%d] getCompaniesObservableForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCompaniesObservableForbidden) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCompaniesObservableForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetCompaniesObservableNotFound creates a GetCompaniesObservableNotFound with default headers values
|
||||
func NewGetCompaniesObservableNotFound() *GetCompaniesObservableNotFound {
|
||||
return &GetCompaniesObservableNotFound{}
|
||||
}
|
||||
|
||||
/*GetCompaniesObservableNotFound handles this case with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type GetCompaniesObservableNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *GetCompaniesObservableNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /companies/observable][%d] getCompaniesObservableNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCompaniesObservableNotFound) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCompaniesObservableNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetCompaniesObservableUnprocessableEntity creates a GetCompaniesObservableUnprocessableEntity with default headers values
|
||||
func NewGetCompaniesObservableUnprocessableEntity() *GetCompaniesObservableUnprocessableEntity {
|
||||
return &GetCompaniesObservableUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*GetCompaniesObservableUnprocessableEntity handles this case with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type GetCompaniesObservableUnprocessableEntity struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *GetCompaniesObservableUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[GET /companies/observable][%d] getCompaniesObservableUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCompaniesObservableUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCompaniesObservableUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetCompaniesObservableInternalServerError creates a GetCompaniesObservableInternalServerError with default headers values
|
||||
func NewGetCompaniesObservableInternalServerError() *GetCompaniesObservableInternalServerError {
|
||||
return &GetCompaniesObservableInternalServerError{}
|
||||
}
|
||||
|
||||
/*GetCompaniesObservableInternalServerError handles this case with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type GetCompaniesObservableInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *GetCompaniesObservableInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /companies/observable][%d] getCompaniesObservableInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCompaniesObservableInternalServerError) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCompaniesObservableInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,150 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package companies
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// NewGetCompaniesParams creates a new GetCompaniesParams object
|
||||
// with the default values initialized.
|
||||
func NewGetCompaniesParams() *GetCompaniesParams {
|
||||
var ()
|
||||
return &GetCompaniesParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetCompaniesParamsWithTimeout creates a new GetCompaniesParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewGetCompaniesParamsWithTimeout(timeout time.Duration) *GetCompaniesParams {
|
||||
var ()
|
||||
return &GetCompaniesParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetCompaniesParamsWithContext creates a new GetCompaniesParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewGetCompaniesParamsWithContext(ctx context.Context) *GetCompaniesParams {
|
||||
var ()
|
||||
return &GetCompaniesParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetCompaniesParamsWithHTTPClient creates a new GetCompaniesParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewGetCompaniesParamsWithHTTPClient(client *http.Client) *GetCompaniesParams {
|
||||
var ()
|
||||
return &GetCompaniesParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*GetCompaniesParams contains all the parameters to send to the API endpoint
|
||||
for the get companies operation typically these are written to a http.Request
|
||||
*/
|
||||
type GetCompaniesParams struct {
|
||||
|
||||
/*CompanyID
|
||||
Taxnexus Company record ID
|
||||
|
||||
*/
|
||||
CompanyID *string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get companies params
|
||||
func (o *GetCompaniesParams) WithTimeout(timeout time.Duration) *GetCompaniesParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get companies params
|
||||
func (o *GetCompaniesParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get companies params
|
||||
func (o *GetCompaniesParams) WithContext(ctx context.Context) *GetCompaniesParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get companies params
|
||||
func (o *GetCompaniesParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get companies params
|
||||
func (o *GetCompaniesParams) WithHTTPClient(client *http.Client) *GetCompaniesParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get companies params
|
||||
func (o *GetCompaniesParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithCompanyID adds the companyID to the get companies params
|
||||
func (o *GetCompaniesParams) WithCompanyID(companyID *string) *GetCompaniesParams {
|
||||
o.SetCompanyID(companyID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetCompanyID adds the companyId to the get companies params
|
||||
func (o *GetCompaniesParams) SetCompanyID(companyID *string) {
|
||||
o.CompanyID = companyID
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetCompaniesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if o.CompanyID != nil {
|
||||
|
||||
// query param companyId
|
||||
var qrCompanyID string
|
||||
if o.CompanyID != nil {
|
||||
qrCompanyID = *o.CompanyID
|
||||
}
|
||||
qCompanyID := qrCompanyID
|
||||
if qCompanyID != "" {
|
||||
if err := r.SetQueryParam("companyId", qCompanyID); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,303 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package companies
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/taxnexus/go/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// GetCompaniesReader is a Reader for the GetCompanies structure.
|
||||
type GetCompaniesReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetCompaniesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetCompaniesOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewGetCompaniesUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewGetCompaniesForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewGetCompaniesNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewGetCompaniesUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewGetCompaniesInternalServerError()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetCompaniesOK creates a GetCompaniesOK with default headers values
|
||||
func NewGetCompaniesOK() *GetCompaniesOK {
|
||||
return &GetCompaniesOK{}
|
||||
}
|
||||
|
||||
/*GetCompaniesOK handles this case with default header values.
|
||||
|
||||
Taxnexus Response with Company objects
|
||||
*/
|
||||
type GetCompaniesOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
CacheControl string
|
||||
|
||||
Payload *crm_models.CompanyResponse
|
||||
}
|
||||
|
||||
func (o *GetCompaniesOK) Error() string {
|
||||
return fmt.Sprintf("[GET /companies][%d] getCompaniesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCompaniesOK) GetPayload() *crm_models.CompanyResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCompaniesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
// response header Cache-Control
|
||||
o.CacheControl = response.GetHeader("Cache-Control")
|
||||
|
||||
o.Payload = new(crm_models.CompanyResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetCompaniesUnauthorized creates a GetCompaniesUnauthorized with default headers values
|
||||
func NewGetCompaniesUnauthorized() *GetCompaniesUnauthorized {
|
||||
return &GetCompaniesUnauthorized{}
|
||||
}
|
||||
|
||||
/*GetCompaniesUnauthorized handles this case with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type GetCompaniesUnauthorized struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *GetCompaniesUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /companies][%d] getCompaniesUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCompaniesUnauthorized) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCompaniesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetCompaniesForbidden creates a GetCompaniesForbidden with default headers values
|
||||
func NewGetCompaniesForbidden() *GetCompaniesForbidden {
|
||||
return &GetCompaniesForbidden{}
|
||||
}
|
||||
|
||||
/*GetCompaniesForbidden handles this case with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type GetCompaniesForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *GetCompaniesForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /companies][%d] getCompaniesForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCompaniesForbidden) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCompaniesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetCompaniesNotFound creates a GetCompaniesNotFound with default headers values
|
||||
func NewGetCompaniesNotFound() *GetCompaniesNotFound {
|
||||
return &GetCompaniesNotFound{}
|
||||
}
|
||||
|
||||
/*GetCompaniesNotFound handles this case with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type GetCompaniesNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *GetCompaniesNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /companies][%d] getCompaniesNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCompaniesNotFound) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCompaniesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetCompaniesUnprocessableEntity creates a GetCompaniesUnprocessableEntity with default headers values
|
||||
func NewGetCompaniesUnprocessableEntity() *GetCompaniesUnprocessableEntity {
|
||||
return &GetCompaniesUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*GetCompaniesUnprocessableEntity handles this case with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type GetCompaniesUnprocessableEntity struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *GetCompaniesUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[GET /companies][%d] getCompaniesUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCompaniesUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCompaniesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetCompaniesInternalServerError creates a GetCompaniesInternalServerError with default headers values
|
||||
func NewGetCompaniesInternalServerError() *GetCompaniesInternalServerError {
|
||||
return &GetCompaniesInternalServerError{}
|
||||
}
|
||||
|
||||
/*GetCompaniesInternalServerError handles this case with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type GetCompaniesInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *GetCompaniesInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /companies][%d] getCompaniesInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCompaniesInternalServerError) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCompaniesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,142 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package companies
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/taxnexus/go/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// NewPostCompaniesParams creates a new PostCompaniesParams object
|
||||
// with the default values initialized.
|
||||
func NewPostCompaniesParams() *PostCompaniesParams {
|
||||
var ()
|
||||
return &PostCompaniesParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostCompaniesParamsWithTimeout creates a new PostCompaniesParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewPostCompaniesParamsWithTimeout(timeout time.Duration) *PostCompaniesParams {
|
||||
var ()
|
||||
return &PostCompaniesParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostCompaniesParamsWithContext creates a new PostCompaniesParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewPostCompaniesParamsWithContext(ctx context.Context) *PostCompaniesParams {
|
||||
var ()
|
||||
return &PostCompaniesParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostCompaniesParamsWithHTTPClient creates a new PostCompaniesParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewPostCompaniesParamsWithHTTPClient(client *http.Client) *PostCompaniesParams {
|
||||
var ()
|
||||
return &PostCompaniesParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*PostCompaniesParams contains all the parameters to send to the API endpoint
|
||||
for the post companies operation typically these are written to a http.Request
|
||||
*/
|
||||
type PostCompaniesParams struct {
|
||||
|
||||
/*CompaniesRequest
|
||||
An array of new Contact records
|
||||
|
||||
*/
|
||||
CompaniesRequest *crm_models.CompanyRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the post companies params
|
||||
func (o *PostCompaniesParams) WithTimeout(timeout time.Duration) *PostCompaniesParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the post companies params
|
||||
func (o *PostCompaniesParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the post companies params
|
||||
func (o *PostCompaniesParams) WithContext(ctx context.Context) *PostCompaniesParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the post companies params
|
||||
func (o *PostCompaniesParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the post companies params
|
||||
func (o *PostCompaniesParams) WithHTTPClient(client *http.Client) *PostCompaniesParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the post companies params
|
||||
func (o *PostCompaniesParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithCompaniesRequest adds the companiesRequest to the post companies params
|
||||
func (o *PostCompaniesParams) WithCompaniesRequest(companiesRequest *crm_models.CompanyRequest) *PostCompaniesParams {
|
||||
o.SetCompaniesRequest(companiesRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetCompaniesRequest adds the companiesRequest to the post companies params
|
||||
func (o *PostCompaniesParams) SetCompaniesRequest(companiesRequest *crm_models.CompanyRequest) {
|
||||
o.CompaniesRequest = companiesRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PostCompaniesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if o.CompaniesRequest != nil {
|
||||
if err := r.SetBodyParam(o.CompaniesRequest); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,303 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package companies
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/taxnexus/go/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// PostCompaniesReader is a Reader for the PostCompanies structure.
|
||||
type PostCompaniesReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PostCompaniesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPostCompaniesOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewPostCompaniesUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewPostCompaniesForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewPostCompaniesNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewPostCompaniesUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewPostCompaniesInternalServerError()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostCompaniesOK creates a PostCompaniesOK with default headers values
|
||||
func NewPostCompaniesOK() *PostCompaniesOK {
|
||||
return &PostCompaniesOK{}
|
||||
}
|
||||
|
||||
/*PostCompaniesOK handles this case with default header values.
|
||||
|
||||
Taxnexus Response with Company objects
|
||||
*/
|
||||
type PostCompaniesOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
CacheControl string
|
||||
|
||||
Payload *crm_models.CompanyResponse
|
||||
}
|
||||
|
||||
func (o *PostCompaniesOK) Error() string {
|
||||
return fmt.Sprintf("[POST /companies][%d] postCompaniesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCompaniesOK) GetPayload() *crm_models.CompanyResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostCompaniesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
// response header Cache-Control
|
||||
o.CacheControl = response.GetHeader("Cache-Control")
|
||||
|
||||
o.Payload = new(crm_models.CompanyResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostCompaniesUnauthorized creates a PostCompaniesUnauthorized with default headers values
|
||||
func NewPostCompaniesUnauthorized() *PostCompaniesUnauthorized {
|
||||
return &PostCompaniesUnauthorized{}
|
||||
}
|
||||
|
||||
/*PostCompaniesUnauthorized handles this case with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type PostCompaniesUnauthorized struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *PostCompaniesUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[POST /companies][%d] postCompaniesUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCompaniesUnauthorized) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostCompaniesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostCompaniesForbidden creates a PostCompaniesForbidden with default headers values
|
||||
func NewPostCompaniesForbidden() *PostCompaniesForbidden {
|
||||
return &PostCompaniesForbidden{}
|
||||
}
|
||||
|
||||
/*PostCompaniesForbidden handles this case with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type PostCompaniesForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *PostCompaniesForbidden) Error() string {
|
||||
return fmt.Sprintf("[POST /companies][%d] postCompaniesForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCompaniesForbidden) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostCompaniesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostCompaniesNotFound creates a PostCompaniesNotFound with default headers values
|
||||
func NewPostCompaniesNotFound() *PostCompaniesNotFound {
|
||||
return &PostCompaniesNotFound{}
|
||||
}
|
||||
|
||||
/*PostCompaniesNotFound handles this case with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type PostCompaniesNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *PostCompaniesNotFound) Error() string {
|
||||
return fmt.Sprintf("[POST /companies][%d] postCompaniesNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCompaniesNotFound) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostCompaniesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostCompaniesUnprocessableEntity creates a PostCompaniesUnprocessableEntity with default headers values
|
||||
func NewPostCompaniesUnprocessableEntity() *PostCompaniesUnprocessableEntity {
|
||||
return &PostCompaniesUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*PostCompaniesUnprocessableEntity handles this case with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type PostCompaniesUnprocessableEntity struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *PostCompaniesUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[POST /companies][%d] postCompaniesUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCompaniesUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostCompaniesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostCompaniesInternalServerError creates a PostCompaniesInternalServerError with default headers values
|
||||
func NewPostCompaniesInternalServerError() *PostCompaniesInternalServerError {
|
||||
return &PostCompaniesInternalServerError{}
|
||||
}
|
||||
|
||||
/*PostCompaniesInternalServerError handles this case with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type PostCompaniesInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *PostCompaniesInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[POST /companies][%d] postCompaniesInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCompaniesInternalServerError) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostCompaniesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,235 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package contacts
|
||||
|
||||
// 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 contacts API client.
|
||||
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
|
||||
return &Client{transport: transport, formats: formats}
|
||||
}
|
||||
|
||||
/*
|
||||
Client for contacts API
|
||||
*/
|
||||
type Client struct {
|
||||
transport runtime.ClientTransport
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ClientService is the interface for Client methods
|
||||
type ClientService interface {
|
||||
DeleteContact(params *DeleteContactParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteContactOK, error)
|
||||
|
||||
GetContacts(params *GetContactsParams, authInfo runtime.ClientAuthInfoWriter) (*GetContactsOK, error)
|
||||
|
||||
GetContactsObservable(params *GetContactsObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetContactsObservableOK, error)
|
||||
|
||||
PostContacts(params *PostContactsParams, authInfo runtime.ClientAuthInfoWriter) (*PostContactsOK, error)
|
||||
|
||||
PutContacts(params *PutContactsParams, authInfo runtime.ClientAuthInfoWriter) (*PutContactsOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteContact deletes a contact
|
||||
|
||||
Delete Taxnexus Contact record
|
||||
*/
|
||||
func (a *Client) DeleteContact(params *DeleteContactParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteContactOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewDeleteContactParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "deleteContact",
|
||||
Method: "DELETE",
|
||||
PathPattern: "/contacts",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &DeleteContactReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*DeleteContactOK)
|
||||
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 deleteContact: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
GetContacts gets a list of contacts
|
||||
|
||||
Return a list of all available Contacts
|
||||
*/
|
||||
func (a *Client) GetContacts(params *GetContactsParams, authInfo runtime.ClientAuthInfoWriter) (*GetContactsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetContactsParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "getContacts",
|
||||
Method: "GET",
|
||||
PathPattern: "/contacts",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetContactsReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*GetContactsOK)
|
||||
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 getContacts: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
GetContactsObservable gets taxnexus contacts in an observable array
|
||||
|
||||
A list of contacts in a simple JSON array
|
||||
*/
|
||||
func (a *Client) GetContactsObservable(params *GetContactsObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetContactsObservableOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetContactsObservableParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "getContactsObservable",
|
||||
Method: "GET",
|
||||
PathPattern: "/contacts/observable",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetContactsObservableReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*GetContactsObservableOK)
|
||||
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 getContactsObservable: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PostContacts adds new contacts
|
||||
|
||||
Contact record to be added
|
||||
*/
|
||||
func (a *Client) PostContacts(params *PostContactsParams, authInfo runtime.ClientAuthInfoWriter) (*PostContactsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPostContactsParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "postContacts",
|
||||
Method: "POST",
|
||||
PathPattern: "/contacts",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PostContactsReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*PostContactsOK)
|
||||
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 postContacts: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PutContacts updates contact
|
||||
|
||||
Update Contact records
|
||||
*/
|
||||
func (a *Client) PutContacts(params *PutContactsParams, authInfo runtime.ClientAuthInfoWriter) (*PutContactsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPutContactsParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "putContacts",
|
||||
Method: "PUT",
|
||||
PathPattern: "/contacts",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PutContactsReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*PutContactsOK)
|
||||
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 putContacts: 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
|
||||
}
|
|
@ -0,0 +1,150 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package contacts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// NewDeleteContactParams creates a new DeleteContactParams object
|
||||
// with the default values initialized.
|
||||
func NewDeleteContactParams() *DeleteContactParams {
|
||||
var ()
|
||||
return &DeleteContactParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteContactParamsWithTimeout creates a new DeleteContactParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewDeleteContactParamsWithTimeout(timeout time.Duration) *DeleteContactParams {
|
||||
var ()
|
||||
return &DeleteContactParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteContactParamsWithContext creates a new DeleteContactParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewDeleteContactParamsWithContext(ctx context.Context) *DeleteContactParams {
|
||||
var ()
|
||||
return &DeleteContactParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteContactParamsWithHTTPClient creates a new DeleteContactParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewDeleteContactParamsWithHTTPClient(client *http.Client) *DeleteContactParams {
|
||||
var ()
|
||||
return &DeleteContactParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*DeleteContactParams contains all the parameters to send to the API endpoint
|
||||
for the delete contact operation typically these are written to a http.Request
|
||||
*/
|
||||
type DeleteContactParams struct {
|
||||
|
||||
/*ContactID
|
||||
Taxnexus Contact record ID
|
||||
|
||||
*/
|
||||
ContactID *string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the delete contact params
|
||||
func (o *DeleteContactParams) WithTimeout(timeout time.Duration) *DeleteContactParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the delete contact params
|
||||
func (o *DeleteContactParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the delete contact params
|
||||
func (o *DeleteContactParams) WithContext(ctx context.Context) *DeleteContactParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the delete contact params
|
||||
func (o *DeleteContactParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the delete contact params
|
||||
func (o *DeleteContactParams) WithHTTPClient(client *http.Client) *DeleteContactParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the delete contact params
|
||||
func (o *DeleteContactParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithContactID adds the contactID to the delete contact params
|
||||
func (o *DeleteContactParams) WithContactID(contactID *string) *DeleteContactParams {
|
||||
o.SetContactID(contactID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContactID adds the contactId to the delete contact params
|
||||
func (o *DeleteContactParams) SetContactID(contactID *string) {
|
||||
o.ContactID = contactID
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *DeleteContactParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if o.ContactID != nil {
|
||||
|
||||
// query param contactId
|
||||
var qrContactID string
|
||||
if o.ContactID != nil {
|
||||
qrContactID = *o.ContactID
|
||||
}
|
||||
qContactID := qrContactID
|
||||
if qContactID != "" {
|
||||
if err := r.SetQueryParam("contactId", qContactID); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,298 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package contacts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/taxnexus/go/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// DeleteContactReader is a Reader for the DeleteContact structure.
|
||||
type DeleteContactReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *DeleteContactReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewDeleteContactOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewDeleteContactUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewDeleteContactForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewDeleteContactNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewDeleteContactUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewDeleteContactInternalServerError()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteContactOK creates a DeleteContactOK with default headers values
|
||||
func NewDeleteContactOK() *DeleteContactOK {
|
||||
return &DeleteContactOK{}
|
||||
}
|
||||
|
||||
/*DeleteContactOK handles this case with default header values.
|
||||
|
||||
Taxnexus Response with Message Objects with Delete Status
|
||||
*/
|
||||
type DeleteContactOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.DeleteResponse
|
||||
}
|
||||
|
||||
func (o *DeleteContactOK) Error() string {
|
||||
return fmt.Sprintf("[DELETE /contacts][%d] deleteContactOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteContactOK) GetPayload() *crm_models.DeleteResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *DeleteContactOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.DeleteResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewDeleteContactUnauthorized creates a DeleteContactUnauthorized with default headers values
|
||||
func NewDeleteContactUnauthorized() *DeleteContactUnauthorized {
|
||||
return &DeleteContactUnauthorized{}
|
||||
}
|
||||
|
||||
/*DeleteContactUnauthorized handles this case with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type DeleteContactUnauthorized struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *DeleteContactUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[DELETE /contacts][%d] deleteContactUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteContactUnauthorized) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *DeleteContactUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewDeleteContactForbidden creates a DeleteContactForbidden with default headers values
|
||||
func NewDeleteContactForbidden() *DeleteContactForbidden {
|
||||
return &DeleteContactForbidden{}
|
||||
}
|
||||
|
||||
/*DeleteContactForbidden handles this case with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type DeleteContactForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *DeleteContactForbidden) Error() string {
|
||||
return fmt.Sprintf("[DELETE /contacts][%d] deleteContactForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteContactForbidden) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *DeleteContactForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewDeleteContactNotFound creates a DeleteContactNotFound with default headers values
|
||||
func NewDeleteContactNotFound() *DeleteContactNotFound {
|
||||
return &DeleteContactNotFound{}
|
||||
}
|
||||
|
||||
/*DeleteContactNotFound handles this case with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type DeleteContactNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *DeleteContactNotFound) Error() string {
|
||||
return fmt.Sprintf("[DELETE /contacts][%d] deleteContactNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteContactNotFound) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *DeleteContactNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewDeleteContactUnprocessableEntity creates a DeleteContactUnprocessableEntity with default headers values
|
||||
func NewDeleteContactUnprocessableEntity() *DeleteContactUnprocessableEntity {
|
||||
return &DeleteContactUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*DeleteContactUnprocessableEntity handles this case with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type DeleteContactUnprocessableEntity struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *DeleteContactUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[DELETE /contacts][%d] deleteContactUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteContactUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *DeleteContactUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewDeleteContactInternalServerError creates a DeleteContactInternalServerError with default headers values
|
||||
func NewDeleteContactInternalServerError() *DeleteContactInternalServerError {
|
||||
return &DeleteContactInternalServerError{}
|
||||
}
|
||||
|
||||
/*DeleteContactInternalServerError handles this case with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type DeleteContactInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *DeleteContactInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[DELETE /contacts][%d] deleteContactInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteContactInternalServerError) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *DeleteContactInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,247 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package contacts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// NewGetContactsObservableParams creates a new GetContactsObservableParams object
|
||||
// with the default values initialized.
|
||||
func NewGetContactsObservableParams() *GetContactsObservableParams {
|
||||
var ()
|
||||
return &GetContactsObservableParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetContactsObservableParamsWithTimeout creates a new GetContactsObservableParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewGetContactsObservableParamsWithTimeout(timeout time.Duration) *GetContactsObservableParams {
|
||||
var ()
|
||||
return &GetContactsObservableParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetContactsObservableParamsWithContext creates a new GetContactsObservableParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewGetContactsObservableParamsWithContext(ctx context.Context) *GetContactsObservableParams {
|
||||
var ()
|
||||
return &GetContactsObservableParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetContactsObservableParamsWithHTTPClient creates a new GetContactsObservableParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewGetContactsObservableParamsWithHTTPClient(client *http.Client) *GetContactsObservableParams {
|
||||
var ()
|
||||
return &GetContactsObservableParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*GetContactsObservableParams contains all the parameters to send to the API endpoint
|
||||
for the get contacts observable operation typically these are written to a http.Request
|
||||
*/
|
||||
type GetContactsObservableParams struct {
|
||||
|
||||
/*Active
|
||||
Only retrieve active records?
|
||||
|
||||
*/
|
||||
Active *bool
|
||||
/*ContactID
|
||||
Taxnexus Contact record ID
|
||||
|
||||
*/
|
||||
ContactID *string
|
||||
/*Email
|
||||
Email address used for identity lookup
|
||||
|
||||
*/
|
||||
Email *string
|
||||
/*Name
|
||||
The Name of this Object
|
||||
|
||||
*/
|
||||
Name *string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get contacts observable params
|
||||
func (o *GetContactsObservableParams) WithTimeout(timeout time.Duration) *GetContactsObservableParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get contacts observable params
|
||||
func (o *GetContactsObservableParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get contacts observable params
|
||||
func (o *GetContactsObservableParams) WithContext(ctx context.Context) *GetContactsObservableParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get contacts observable params
|
||||
func (o *GetContactsObservableParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get contacts observable params
|
||||
func (o *GetContactsObservableParams) WithHTTPClient(client *http.Client) *GetContactsObservableParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get contacts observable params
|
||||
func (o *GetContactsObservableParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithActive adds the active to the get contacts observable params
|
||||
func (o *GetContactsObservableParams) WithActive(active *bool) *GetContactsObservableParams {
|
||||
o.SetActive(active)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetActive adds the active to the get contacts observable params
|
||||
func (o *GetContactsObservableParams) SetActive(active *bool) {
|
||||
o.Active = active
|
||||
}
|
||||
|
||||
// WithContactID adds the contactID to the get contacts observable params
|
||||
func (o *GetContactsObservableParams) WithContactID(contactID *string) *GetContactsObservableParams {
|
||||
o.SetContactID(contactID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContactID adds the contactId to the get contacts observable params
|
||||
func (o *GetContactsObservableParams) SetContactID(contactID *string) {
|
||||
o.ContactID = contactID
|
||||
}
|
||||
|
||||
// WithEmail adds the email to the get contacts observable params
|
||||
func (o *GetContactsObservableParams) WithEmail(email *string) *GetContactsObservableParams {
|
||||
o.SetEmail(email)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetEmail adds the email to the get contacts observable params
|
||||
func (o *GetContactsObservableParams) SetEmail(email *string) {
|
||||
o.Email = email
|
||||
}
|
||||
|
||||
// WithName adds the name to the get contacts observable params
|
||||
func (o *GetContactsObservableParams) WithName(name *string) *GetContactsObservableParams {
|
||||
o.SetName(name)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetName adds the name to the get contacts observable params
|
||||
func (o *GetContactsObservableParams) SetName(name *string) {
|
||||
o.Name = name
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetContactsObservableParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if o.Active != nil {
|
||||
|
||||
// query param active
|
||||
var qrActive bool
|
||||
if o.Active != nil {
|
||||
qrActive = *o.Active
|
||||
}
|
||||
qActive := swag.FormatBool(qrActive)
|
||||
if qActive != "" {
|
||||
if err := r.SetQueryParam("active", qActive); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if o.ContactID != nil {
|
||||
|
||||
// query param contactId
|
||||
var qrContactID string
|
||||
if o.ContactID != nil {
|
||||
qrContactID = *o.ContactID
|
||||
}
|
||||
qContactID := qrContactID
|
||||
if qContactID != "" {
|
||||
if err := r.SetQueryParam("contactId", qContactID); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if o.Email != nil {
|
||||
|
||||
// query param email
|
||||
var qrEmail string
|
||||
if o.Email != nil {
|
||||
qrEmail = *o.Email
|
||||
}
|
||||
qEmail := qrEmail
|
||||
if qEmail != "" {
|
||||
if err := r.SetQueryParam("email", qEmail); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if o.Name != nil {
|
||||
|
||||
// query param name
|
||||
var qrName string
|
||||
if o.Name != nil {
|
||||
qrName = *o.Name
|
||||
}
|
||||
qName := qrName
|
||||
if qName != "" {
|
||||
if err := r.SetQueryParam("name", qName); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,301 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package contacts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/taxnexus/go/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// GetContactsObservableReader is a Reader for the GetContactsObservable structure.
|
||||
type GetContactsObservableReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetContactsObservableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetContactsObservableOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewGetContactsObservableUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewGetContactsObservableForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewGetContactsObservableNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewGetContactsObservableUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewGetContactsObservableInternalServerError()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetContactsObservableOK creates a GetContactsObservableOK with default headers values
|
||||
func NewGetContactsObservableOK() *GetContactsObservableOK {
|
||||
return &GetContactsObservableOK{}
|
||||
}
|
||||
|
||||
/*GetContactsObservableOK handles this case with default header values.
|
||||
|
||||
Taxnexus Response with an array of Contact objects
|
||||
*/
|
||||
type GetContactsObservableOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
CacheControl string
|
||||
|
||||
Payload []*crm_models.Contact
|
||||
}
|
||||
|
||||
func (o *GetContactsObservableOK) Error() string {
|
||||
return fmt.Sprintf("[GET /contacts/observable][%d] getContactsObservableOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetContactsObservableOK) GetPayload() []*crm_models.Contact {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetContactsObservableOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
// response header Cache-Control
|
||||
o.CacheControl = response.GetHeader("Cache-Control")
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetContactsObservableUnauthorized creates a GetContactsObservableUnauthorized with default headers values
|
||||
func NewGetContactsObservableUnauthorized() *GetContactsObservableUnauthorized {
|
||||
return &GetContactsObservableUnauthorized{}
|
||||
}
|
||||
|
||||
/*GetContactsObservableUnauthorized handles this case with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type GetContactsObservableUnauthorized struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *GetContactsObservableUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /contacts/observable][%d] getContactsObservableUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetContactsObservableUnauthorized) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetContactsObservableUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetContactsObservableForbidden creates a GetContactsObservableForbidden with default headers values
|
||||
func NewGetContactsObservableForbidden() *GetContactsObservableForbidden {
|
||||
return &GetContactsObservableForbidden{}
|
||||
}
|
||||
|
||||
/*GetContactsObservableForbidden handles this case with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type GetContactsObservableForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *GetContactsObservableForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /contacts/observable][%d] getContactsObservableForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetContactsObservableForbidden) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetContactsObservableForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetContactsObservableNotFound creates a GetContactsObservableNotFound with default headers values
|
||||
func NewGetContactsObservableNotFound() *GetContactsObservableNotFound {
|
||||
return &GetContactsObservableNotFound{}
|
||||
}
|
||||
|
||||
/*GetContactsObservableNotFound handles this case with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type GetContactsObservableNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *GetContactsObservableNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /contacts/observable][%d] getContactsObservableNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetContactsObservableNotFound) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetContactsObservableNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetContactsObservableUnprocessableEntity creates a GetContactsObservableUnprocessableEntity with default headers values
|
||||
func NewGetContactsObservableUnprocessableEntity() *GetContactsObservableUnprocessableEntity {
|
||||
return &GetContactsObservableUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*GetContactsObservableUnprocessableEntity handles this case with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type GetContactsObservableUnprocessableEntity struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *GetContactsObservableUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[GET /contacts/observable][%d] getContactsObservableUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetContactsObservableUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetContactsObservableUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetContactsObservableInternalServerError creates a GetContactsObservableInternalServerError with default headers values
|
||||
func NewGetContactsObservableInternalServerError() *GetContactsObservableInternalServerError {
|
||||
return &GetContactsObservableInternalServerError{}
|
||||
}
|
||||
|
||||
/*GetContactsObservableInternalServerError handles this case with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type GetContactsObservableInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *GetContactsObservableInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /contacts/observable][%d] getContactsObservableInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetContactsObservableInternalServerError) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetContactsObservableInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,311 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package contacts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// NewGetContactsParams creates a new GetContactsParams object
|
||||
// with the default values initialized.
|
||||
func NewGetContactsParams() *GetContactsParams {
|
||||
var ()
|
||||
return &GetContactsParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetContactsParamsWithTimeout creates a new GetContactsParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewGetContactsParamsWithTimeout(timeout time.Duration) *GetContactsParams {
|
||||
var ()
|
||||
return &GetContactsParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetContactsParamsWithContext creates a new GetContactsParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewGetContactsParamsWithContext(ctx context.Context) *GetContactsParams {
|
||||
var ()
|
||||
return &GetContactsParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetContactsParamsWithHTTPClient creates a new GetContactsParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewGetContactsParamsWithHTTPClient(client *http.Client) *GetContactsParams {
|
||||
var ()
|
||||
return &GetContactsParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*GetContactsParams contains all the parameters to send to the API endpoint
|
||||
for the get contacts operation typically these are written to a http.Request
|
||||
*/
|
||||
type GetContactsParams struct {
|
||||
|
||||
/*Active
|
||||
Only retrieve active records?
|
||||
|
||||
*/
|
||||
Active *bool
|
||||
/*ContactID
|
||||
Taxnexus Contact record ID
|
||||
|
||||
*/
|
||||
ContactID *string
|
||||
/*Email
|
||||
Email address used for identity lookup
|
||||
|
||||
*/
|
||||
Email *string
|
||||
/*Limit
|
||||
How many objects to return at one time
|
||||
|
||||
*/
|
||||
Limit *int64
|
||||
/*Name
|
||||
The Name of this Object
|
||||
|
||||
*/
|
||||
Name *string
|
||||
/*Offset
|
||||
How many objects to skip?
|
||||
|
||||
*/
|
||||
Offset *int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get contacts params
|
||||
func (o *GetContactsParams) WithTimeout(timeout time.Duration) *GetContactsParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get contacts params
|
||||
func (o *GetContactsParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get contacts params
|
||||
func (o *GetContactsParams) WithContext(ctx context.Context) *GetContactsParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get contacts params
|
||||
func (o *GetContactsParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get contacts params
|
||||
func (o *GetContactsParams) WithHTTPClient(client *http.Client) *GetContactsParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get contacts params
|
||||
func (o *GetContactsParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithActive adds the active to the get contacts params
|
||||
func (o *GetContactsParams) WithActive(active *bool) *GetContactsParams {
|
||||
o.SetActive(active)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetActive adds the active to the get contacts params
|
||||
func (o *GetContactsParams) SetActive(active *bool) {
|
||||
o.Active = active
|
||||
}
|
||||
|
||||
// WithContactID adds the contactID to the get contacts params
|
||||
func (o *GetContactsParams) WithContactID(contactID *string) *GetContactsParams {
|
||||
o.SetContactID(contactID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContactID adds the contactId to the get contacts params
|
||||
func (o *GetContactsParams) SetContactID(contactID *string) {
|
||||
o.ContactID = contactID
|
||||
}
|
||||
|
||||
// WithEmail adds the email to the get contacts params
|
||||
func (o *GetContactsParams) WithEmail(email *string) *GetContactsParams {
|
||||
o.SetEmail(email)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetEmail adds the email to the get contacts params
|
||||
func (o *GetContactsParams) SetEmail(email *string) {
|
||||
o.Email = email
|
||||
}
|
||||
|
||||
// WithLimit adds the limit to the get contacts params
|
||||
func (o *GetContactsParams) WithLimit(limit *int64) *GetContactsParams {
|
||||
o.SetLimit(limit)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetLimit adds the limit to the get contacts params
|
||||
func (o *GetContactsParams) SetLimit(limit *int64) {
|
||||
o.Limit = limit
|
||||
}
|
||||
|
||||
// WithName adds the name to the get contacts params
|
||||
func (o *GetContactsParams) WithName(name *string) *GetContactsParams {
|
||||
o.SetName(name)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetName adds the name to the get contacts params
|
||||
func (o *GetContactsParams) SetName(name *string) {
|
||||
o.Name = name
|
||||
}
|
||||
|
||||
// WithOffset adds the offset to the get contacts params
|
||||
func (o *GetContactsParams) WithOffset(offset *int64) *GetContactsParams {
|
||||
o.SetOffset(offset)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetOffset adds the offset to the get contacts params
|
||||
func (o *GetContactsParams) SetOffset(offset *int64) {
|
||||
o.Offset = offset
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetContactsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if o.Active != nil {
|
||||
|
||||
// query param active
|
||||
var qrActive bool
|
||||
if o.Active != nil {
|
||||
qrActive = *o.Active
|
||||
}
|
||||
qActive := swag.FormatBool(qrActive)
|
||||
if qActive != "" {
|
||||
if err := r.SetQueryParam("active", qActive); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if o.ContactID != nil {
|
||||
|
||||
// query param contactId
|
||||
var qrContactID string
|
||||
if o.ContactID != nil {
|
||||
qrContactID = *o.ContactID
|
||||
}
|
||||
qContactID := qrContactID
|
||||
if qContactID != "" {
|
||||
if err := r.SetQueryParam("contactId", qContactID); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if o.Email != nil {
|
||||
|
||||
// query param email
|
||||
var qrEmail string
|
||||
if o.Email != nil {
|
||||
qrEmail = *o.Email
|
||||
}
|
||||
qEmail := qrEmail
|
||||
if qEmail != "" {
|
||||
if err := r.SetQueryParam("email", qEmail); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if o.Limit != nil {
|
||||
|
||||
// query param limit
|
||||
var qrLimit int64
|
||||
if o.Limit != nil {
|
||||
qrLimit = *o.Limit
|
||||
}
|
||||
qLimit := swag.FormatInt64(qrLimit)
|
||||
if qLimit != "" {
|
||||
if err := r.SetQueryParam("limit", qLimit); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if o.Name != nil {
|
||||
|
||||
// query param name
|
||||
var qrName string
|
||||
if o.Name != nil {
|
||||
qrName = *o.Name
|
||||
}
|
||||
qName := qrName
|
||||
if qName != "" {
|
||||
if err := r.SetQueryParam("name", qName); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if o.Offset != nil {
|
||||
|
||||
// query param offset
|
||||
var qrOffset int64
|
||||
if o.Offset != nil {
|
||||
qrOffset = *o.Offset
|
||||
}
|
||||
qOffset := swag.FormatInt64(qrOffset)
|
||||
if qOffset != "" {
|
||||
if err := r.SetQueryParam("offset", qOffset); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,303 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package contacts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/taxnexus/go/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// GetContactsReader is a Reader for the GetContacts structure.
|
||||
type GetContactsReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetContactsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetContactsOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewGetContactsUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewGetContactsForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewGetContactsNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewGetContactsUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewGetContactsInternalServerError()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetContactsOK creates a GetContactsOK with default headers values
|
||||
func NewGetContactsOK() *GetContactsOK {
|
||||
return &GetContactsOK{}
|
||||
}
|
||||
|
||||
/*GetContactsOK handles this case with default header values.
|
||||
|
||||
Taxnexus Response with an array of Contact objects
|
||||
*/
|
||||
type GetContactsOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
CacheControl string
|
||||
|
||||
Payload *crm_models.ContactResponse
|
||||
}
|
||||
|
||||
func (o *GetContactsOK) Error() string {
|
||||
return fmt.Sprintf("[GET /contacts][%d] getContactsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetContactsOK) GetPayload() *crm_models.ContactResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetContactsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
// response header Cache-Control
|
||||
o.CacheControl = response.GetHeader("Cache-Control")
|
||||
|
||||
o.Payload = new(crm_models.ContactResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetContactsUnauthorized creates a GetContactsUnauthorized with default headers values
|
||||
func NewGetContactsUnauthorized() *GetContactsUnauthorized {
|
||||
return &GetContactsUnauthorized{}
|
||||
}
|
||||
|
||||
/*GetContactsUnauthorized handles this case with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type GetContactsUnauthorized struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *GetContactsUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /contacts][%d] getContactsUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetContactsUnauthorized) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetContactsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetContactsForbidden creates a GetContactsForbidden with default headers values
|
||||
func NewGetContactsForbidden() *GetContactsForbidden {
|
||||
return &GetContactsForbidden{}
|
||||
}
|
||||
|
||||
/*GetContactsForbidden handles this case with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type GetContactsForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *GetContactsForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /contacts][%d] getContactsForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetContactsForbidden) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetContactsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetContactsNotFound creates a GetContactsNotFound with default headers values
|
||||
func NewGetContactsNotFound() *GetContactsNotFound {
|
||||
return &GetContactsNotFound{}
|
||||
}
|
||||
|
||||
/*GetContactsNotFound handles this case with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type GetContactsNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *GetContactsNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /contacts][%d] getContactsNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetContactsNotFound) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetContactsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetContactsUnprocessableEntity creates a GetContactsUnprocessableEntity with default headers values
|
||||
func NewGetContactsUnprocessableEntity() *GetContactsUnprocessableEntity {
|
||||
return &GetContactsUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*GetContactsUnprocessableEntity handles this case with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type GetContactsUnprocessableEntity struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *GetContactsUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[GET /contacts][%d] getContactsUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetContactsUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetContactsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetContactsInternalServerError creates a GetContactsInternalServerError with default headers values
|
||||
func NewGetContactsInternalServerError() *GetContactsInternalServerError {
|
||||
return &GetContactsInternalServerError{}
|
||||
}
|
||||
|
||||
/*GetContactsInternalServerError handles this case with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type GetContactsInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *GetContactsInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /contacts][%d] getContactsInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetContactsInternalServerError) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetContactsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,142 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package contacts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/taxnexus/go/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// NewPostContactsParams creates a new PostContactsParams object
|
||||
// with the default values initialized.
|
||||
func NewPostContactsParams() *PostContactsParams {
|
||||
var ()
|
||||
return &PostContactsParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostContactsParamsWithTimeout creates a new PostContactsParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewPostContactsParamsWithTimeout(timeout time.Duration) *PostContactsParams {
|
||||
var ()
|
||||
return &PostContactsParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostContactsParamsWithContext creates a new PostContactsParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewPostContactsParamsWithContext(ctx context.Context) *PostContactsParams {
|
||||
var ()
|
||||
return &PostContactsParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostContactsParamsWithHTTPClient creates a new PostContactsParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewPostContactsParamsWithHTTPClient(client *http.Client) *PostContactsParams {
|
||||
var ()
|
||||
return &PostContactsParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*PostContactsParams contains all the parameters to send to the API endpoint
|
||||
for the post contacts operation typically these are written to a http.Request
|
||||
*/
|
||||
type PostContactsParams struct {
|
||||
|
||||
/*ContactsRequest
|
||||
An array of new Contact records
|
||||
|
||||
*/
|
||||
ContactsRequest *crm_models.ContactRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the post contacts params
|
||||
func (o *PostContactsParams) WithTimeout(timeout time.Duration) *PostContactsParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the post contacts params
|
||||
func (o *PostContactsParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the post contacts params
|
||||
func (o *PostContactsParams) WithContext(ctx context.Context) *PostContactsParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the post contacts params
|
||||
func (o *PostContactsParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the post contacts params
|
||||
func (o *PostContactsParams) WithHTTPClient(client *http.Client) *PostContactsParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the post contacts params
|
||||
func (o *PostContactsParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithContactsRequest adds the contactsRequest to the post contacts params
|
||||
func (o *PostContactsParams) WithContactsRequest(contactsRequest *crm_models.ContactRequest) *PostContactsParams {
|
||||
o.SetContactsRequest(contactsRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContactsRequest adds the contactsRequest to the post contacts params
|
||||
func (o *PostContactsParams) SetContactsRequest(contactsRequest *crm_models.ContactRequest) {
|
||||
o.ContactsRequest = contactsRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PostContactsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if o.ContactsRequest != nil {
|
||||
if err := r.SetBodyParam(o.ContactsRequest); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,303 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package contacts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/taxnexus/go/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// PostContactsReader is a Reader for the PostContacts structure.
|
||||
type PostContactsReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PostContactsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPostContactsOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewPostContactsUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewPostContactsForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewPostContactsNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewPostContactsUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewPostContactsInternalServerError()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostContactsOK creates a PostContactsOK with default headers values
|
||||
func NewPostContactsOK() *PostContactsOK {
|
||||
return &PostContactsOK{}
|
||||
}
|
||||
|
||||
/*PostContactsOK handles this case with default header values.
|
||||
|
||||
Taxnexus Response with an array of Contact objects
|
||||
*/
|
||||
type PostContactsOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
CacheControl string
|
||||
|
||||
Payload *crm_models.ContactResponse
|
||||
}
|
||||
|
||||
func (o *PostContactsOK) Error() string {
|
||||
return fmt.Sprintf("[POST /contacts][%d] postContactsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostContactsOK) GetPayload() *crm_models.ContactResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostContactsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
// response header Cache-Control
|
||||
o.CacheControl = response.GetHeader("Cache-Control")
|
||||
|
||||
o.Payload = new(crm_models.ContactResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostContactsUnauthorized creates a PostContactsUnauthorized with default headers values
|
||||
func NewPostContactsUnauthorized() *PostContactsUnauthorized {
|
||||
return &PostContactsUnauthorized{}
|
||||
}
|
||||
|
||||
/*PostContactsUnauthorized handles this case with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type PostContactsUnauthorized struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *PostContactsUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[POST /contacts][%d] postContactsUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostContactsUnauthorized) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostContactsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostContactsForbidden creates a PostContactsForbidden with default headers values
|
||||
func NewPostContactsForbidden() *PostContactsForbidden {
|
||||
return &PostContactsForbidden{}
|
||||
}
|
||||
|
||||
/*PostContactsForbidden handles this case with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type PostContactsForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *PostContactsForbidden) Error() string {
|
||||
return fmt.Sprintf("[POST /contacts][%d] postContactsForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostContactsForbidden) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostContactsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostContactsNotFound creates a PostContactsNotFound with default headers values
|
||||
func NewPostContactsNotFound() *PostContactsNotFound {
|
||||
return &PostContactsNotFound{}
|
||||
}
|
||||
|
||||
/*PostContactsNotFound handles this case with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type PostContactsNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *PostContactsNotFound) Error() string {
|
||||
return fmt.Sprintf("[POST /contacts][%d] postContactsNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostContactsNotFound) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostContactsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostContactsUnprocessableEntity creates a PostContactsUnprocessableEntity with default headers values
|
||||
func NewPostContactsUnprocessableEntity() *PostContactsUnprocessableEntity {
|
||||
return &PostContactsUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*PostContactsUnprocessableEntity handles this case with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type PostContactsUnprocessableEntity struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *PostContactsUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[POST /contacts][%d] postContactsUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostContactsUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostContactsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostContactsInternalServerError creates a PostContactsInternalServerError with default headers values
|
||||
func NewPostContactsInternalServerError() *PostContactsInternalServerError {
|
||||
return &PostContactsInternalServerError{}
|
||||
}
|
||||
|
||||
/*PostContactsInternalServerError handles this case with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type PostContactsInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *PostContactsInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[POST /contacts][%d] postContactsInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostContactsInternalServerError) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostContactsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,142 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package contacts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/taxnexus/go/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// NewPutContactsParams creates a new PutContactsParams object
|
||||
// with the default values initialized.
|
||||
func NewPutContactsParams() *PutContactsParams {
|
||||
var ()
|
||||
return &PutContactsParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPutContactsParamsWithTimeout creates a new PutContactsParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewPutContactsParamsWithTimeout(timeout time.Duration) *PutContactsParams {
|
||||
var ()
|
||||
return &PutContactsParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPutContactsParamsWithContext creates a new PutContactsParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewPutContactsParamsWithContext(ctx context.Context) *PutContactsParams {
|
||||
var ()
|
||||
return &PutContactsParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPutContactsParamsWithHTTPClient creates a new PutContactsParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewPutContactsParamsWithHTTPClient(client *http.Client) *PutContactsParams {
|
||||
var ()
|
||||
return &PutContactsParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*PutContactsParams contains all the parameters to send to the API endpoint
|
||||
for the put contacts operation typically these are written to a http.Request
|
||||
*/
|
||||
type PutContactsParams struct {
|
||||
|
||||
/*ContactsRequest
|
||||
An array of new Contact records
|
||||
|
||||
*/
|
||||
ContactsRequest *crm_models.ContactRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the put contacts params
|
||||
func (o *PutContactsParams) WithTimeout(timeout time.Duration) *PutContactsParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the put contacts params
|
||||
func (o *PutContactsParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the put contacts params
|
||||
func (o *PutContactsParams) WithContext(ctx context.Context) *PutContactsParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the put contacts params
|
||||
func (o *PutContactsParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the put contacts params
|
||||
func (o *PutContactsParams) WithHTTPClient(client *http.Client) *PutContactsParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the put contacts params
|
||||
func (o *PutContactsParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithContactsRequest adds the contactsRequest to the put contacts params
|
||||
func (o *PutContactsParams) WithContactsRequest(contactsRequest *crm_models.ContactRequest) *PutContactsParams {
|
||||
o.SetContactsRequest(contactsRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContactsRequest adds the contactsRequest to the put contacts params
|
||||
func (o *PutContactsParams) SetContactsRequest(contactsRequest *crm_models.ContactRequest) {
|
||||
o.ContactsRequest = contactsRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PutContactsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if o.ContactsRequest != nil {
|
||||
if err := r.SetBodyParam(o.ContactsRequest); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,303 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package contacts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/taxnexus/go/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// PutContactsReader is a Reader for the PutContacts structure.
|
||||
type PutContactsReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PutContactsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPutContactsOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewPutContactsUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewPutContactsForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewPutContactsNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewPutContactsUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewPutContactsInternalServerError()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPutContactsOK creates a PutContactsOK with default headers values
|
||||
func NewPutContactsOK() *PutContactsOK {
|
||||
return &PutContactsOK{}
|
||||
}
|
||||
|
||||
/*PutContactsOK handles this case with default header values.
|
||||
|
||||
Taxnexus Response with an array of Contact objects
|
||||
*/
|
||||
type PutContactsOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
CacheControl string
|
||||
|
||||
Payload *crm_models.ContactResponse
|
||||
}
|
||||
|
||||
func (o *PutContactsOK) Error() string {
|
||||
return fmt.Sprintf("[PUT /contacts][%d] putContactsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutContactsOK) GetPayload() *crm_models.ContactResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutContactsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
// response header Cache-Control
|
||||
o.CacheControl = response.GetHeader("Cache-Control")
|
||||
|
||||
o.Payload = new(crm_models.ContactResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPutContactsUnauthorized creates a PutContactsUnauthorized with default headers values
|
||||
func NewPutContactsUnauthorized() *PutContactsUnauthorized {
|
||||
return &PutContactsUnauthorized{}
|
||||
}
|
||||
|
||||
/*PutContactsUnauthorized handles this case with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type PutContactsUnauthorized struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *PutContactsUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[PUT /contacts][%d] putContactsUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutContactsUnauthorized) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutContactsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPutContactsForbidden creates a PutContactsForbidden with default headers values
|
||||
func NewPutContactsForbidden() *PutContactsForbidden {
|
||||
return &PutContactsForbidden{}
|
||||
}
|
||||
|
||||
/*PutContactsForbidden handles this case with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type PutContactsForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *PutContactsForbidden) Error() string {
|
||||
return fmt.Sprintf("[PUT /contacts][%d] putContactsForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutContactsForbidden) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutContactsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPutContactsNotFound creates a PutContactsNotFound with default headers values
|
||||
func NewPutContactsNotFound() *PutContactsNotFound {
|
||||
return &PutContactsNotFound{}
|
||||
}
|
||||
|
||||
/*PutContactsNotFound handles this case with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type PutContactsNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *PutContactsNotFound) Error() string {
|
||||
return fmt.Sprintf("[PUT /contacts][%d] putContactsNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutContactsNotFound) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutContactsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPutContactsUnprocessableEntity creates a PutContactsUnprocessableEntity with default headers values
|
||||
func NewPutContactsUnprocessableEntity() *PutContactsUnprocessableEntity {
|
||||
return &PutContactsUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*PutContactsUnprocessableEntity handles this case with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type PutContactsUnprocessableEntity struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *PutContactsUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[PUT /contacts][%d] putContactsUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutContactsUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutContactsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPutContactsInternalServerError creates a PutContactsInternalServerError with default headers values
|
||||
func NewPutContactsInternalServerError() *PutContactsInternalServerError {
|
||||
return &PutContactsInternalServerError{}
|
||||
}
|
||||
|
||||
/*PutContactsInternalServerError handles this case with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type PutContactsInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *PutContactsInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[PUT /contacts][%d] putContactsInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutContactsInternalServerError) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutContactsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,116 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package cors
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// NewAccountOptionsObservableParams creates a new AccountOptionsObservableParams object
|
||||
// with the default values initialized.
|
||||
func NewAccountOptionsObservableParams() *AccountOptionsObservableParams {
|
||||
|
||||
return &AccountOptionsObservableParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewAccountOptionsObservableParamsWithTimeout creates a new AccountOptionsObservableParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewAccountOptionsObservableParamsWithTimeout(timeout time.Duration) *AccountOptionsObservableParams {
|
||||
|
||||
return &AccountOptionsObservableParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewAccountOptionsObservableParamsWithContext creates a new AccountOptionsObservableParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewAccountOptionsObservableParamsWithContext(ctx context.Context) *AccountOptionsObservableParams {
|
||||
|
||||
return &AccountOptionsObservableParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewAccountOptionsObservableParamsWithHTTPClient creates a new AccountOptionsObservableParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewAccountOptionsObservableParamsWithHTTPClient(client *http.Client) *AccountOptionsObservableParams {
|
||||
|
||||
return &AccountOptionsObservableParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*AccountOptionsObservableParams contains all the parameters to send to the API endpoint
|
||||
for the account options observable operation typically these are written to a http.Request
|
||||
*/
|
||||
type AccountOptionsObservableParams struct {
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the account options observable params
|
||||
func (o *AccountOptionsObservableParams) WithTimeout(timeout time.Duration) *AccountOptionsObservableParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the account options observable params
|
||||
func (o *AccountOptionsObservableParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the account options observable params
|
||||
func (o *AccountOptionsObservableParams) WithContext(ctx context.Context) *AccountOptionsObservableParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the account options observable params
|
||||
func (o *AccountOptionsObservableParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the account options observable params
|
||||
func (o *AccountOptionsObservableParams) WithHTTPClient(client *http.Client) *AccountOptionsObservableParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the account options observable params
|
||||
func (o *AccountOptionsObservableParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *AccountOptionsObservableParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,92 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package cors
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// AccountOptionsObservableReader is a Reader for the AccountOptionsObservable structure.
|
||||
type AccountOptionsObservableReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *AccountOptionsObservableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewAccountOptionsObservableOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewAccountOptionsObservableOK creates a AccountOptionsObservableOK with default headers values
|
||||
func NewAccountOptionsObservableOK() *AccountOptionsObservableOK {
|
||||
return &AccountOptionsObservableOK{}
|
||||
}
|
||||
|
||||
/*AccountOptionsObservableOK handles this case with default header values.
|
||||
|
||||
CORS OPTIONS response
|
||||
*/
|
||||
type AccountOptionsObservableOK struct {
|
||||
AccessControlAllowCredentials string
|
||||
|
||||
AccessControlAllowHeaders string
|
||||
|
||||
AccessControlAllowMethods string
|
||||
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
AccessControlExposeHeaders string
|
||||
|
||||
AccessControlMaxAge string
|
||||
|
||||
CacheControl string
|
||||
}
|
||||
|
||||
func (o *AccountOptionsObservableOK) Error() string {
|
||||
return fmt.Sprintf("[OPTIONS /accounts/observable][%d] accountOptionsObservableOK ", 200)
|
||||
}
|
||||
|
||||
func (o *AccountOptionsObservableOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Credentials
|
||||
o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials")
|
||||
|
||||
// response header Access-Control-Allow-Headers
|
||||
o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers")
|
||||
|
||||
// response header Access-Control-Allow-Methods
|
||||
o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods")
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
// response header Access-Control-Expose-Headers
|
||||
o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers")
|
||||
|
||||
// response header Access-Control-Max-Age
|
||||
o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age")
|
||||
|
||||
// response header Cache-Control
|
||||
o.CacheControl = response.GetHeader("Cache-Control")
|
||||
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,116 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package cors
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// NewAccountOptionsParams creates a new AccountOptionsParams object
|
||||
// with the default values initialized.
|
||||
func NewAccountOptionsParams() *AccountOptionsParams {
|
||||
|
||||
return &AccountOptionsParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewAccountOptionsParamsWithTimeout creates a new AccountOptionsParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewAccountOptionsParamsWithTimeout(timeout time.Duration) *AccountOptionsParams {
|
||||
|
||||
return &AccountOptionsParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewAccountOptionsParamsWithContext creates a new AccountOptionsParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewAccountOptionsParamsWithContext(ctx context.Context) *AccountOptionsParams {
|
||||
|
||||
return &AccountOptionsParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewAccountOptionsParamsWithHTTPClient creates a new AccountOptionsParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewAccountOptionsParamsWithHTTPClient(client *http.Client) *AccountOptionsParams {
|
||||
|
||||
return &AccountOptionsParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*AccountOptionsParams contains all the parameters to send to the API endpoint
|
||||
for the account options operation typically these are written to a http.Request
|
||||
*/
|
||||
type AccountOptionsParams struct {
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the account options params
|
||||
func (o *AccountOptionsParams) WithTimeout(timeout time.Duration) *AccountOptionsParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the account options params
|
||||
func (o *AccountOptionsParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the account options params
|
||||
func (o *AccountOptionsParams) WithContext(ctx context.Context) *AccountOptionsParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the account options params
|
||||
func (o *AccountOptionsParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the account options params
|
||||
func (o *AccountOptionsParams) WithHTTPClient(client *http.Client) *AccountOptionsParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the account options params
|
||||
func (o *AccountOptionsParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *AccountOptionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,92 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package cors
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// AccountOptionsReader is a Reader for the AccountOptions structure.
|
||||
type AccountOptionsReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *AccountOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewAccountOptionsOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewAccountOptionsOK creates a AccountOptionsOK with default headers values
|
||||
func NewAccountOptionsOK() *AccountOptionsOK {
|
||||
return &AccountOptionsOK{}
|
||||
}
|
||||
|
||||
/*AccountOptionsOK handles this case with default header values.
|
||||
|
||||
CORS OPTIONS response
|
||||
*/
|
||||
type AccountOptionsOK struct {
|
||||
AccessControlAllowCredentials string
|
||||
|
||||
AccessControlAllowHeaders string
|
||||
|
||||
AccessControlAllowMethods string
|
||||
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
AccessControlExposeHeaders string
|
||||
|
||||
AccessControlMaxAge string
|
||||
|
||||
CacheControl string
|
||||
}
|
||||
|
||||
func (o *AccountOptionsOK) Error() string {
|
||||
return fmt.Sprintf("[OPTIONS /accounts][%d] accountOptionsOK ", 200)
|
||||
}
|
||||
|
||||
func (o *AccountOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Credentials
|
||||
o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials")
|
||||
|
||||
// response header Access-Control-Allow-Headers
|
||||
o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers")
|
||||
|
||||
// response header Access-Control-Allow-Methods
|
||||
o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods")
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
// response header Access-Control-Expose-Headers
|
||||
o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers")
|
||||
|
||||
// response header Access-Control-Max-Age
|
||||
o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age")
|
||||
|
||||
// response header Cache-Control
|
||||
o.CacheControl = response.GetHeader("Cache-Control")
|
||||
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,116 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package cors
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// NewCompanyObservableOptionsParams creates a new CompanyObservableOptionsParams object
|
||||
// with the default values initialized.
|
||||
func NewCompanyObservableOptionsParams() *CompanyObservableOptionsParams {
|
||||
|
||||
return &CompanyObservableOptionsParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewCompanyObservableOptionsParamsWithTimeout creates a new CompanyObservableOptionsParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewCompanyObservableOptionsParamsWithTimeout(timeout time.Duration) *CompanyObservableOptionsParams {
|
||||
|
||||
return &CompanyObservableOptionsParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewCompanyObservableOptionsParamsWithContext creates a new CompanyObservableOptionsParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewCompanyObservableOptionsParamsWithContext(ctx context.Context) *CompanyObservableOptionsParams {
|
||||
|
||||
return &CompanyObservableOptionsParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewCompanyObservableOptionsParamsWithHTTPClient creates a new CompanyObservableOptionsParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewCompanyObservableOptionsParamsWithHTTPClient(client *http.Client) *CompanyObservableOptionsParams {
|
||||
|
||||
return &CompanyObservableOptionsParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*CompanyObservableOptionsParams contains all the parameters to send to the API endpoint
|
||||
for the company observable options operation typically these are written to a http.Request
|
||||
*/
|
||||
type CompanyObservableOptionsParams struct {
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the company observable options params
|
||||
func (o *CompanyObservableOptionsParams) WithTimeout(timeout time.Duration) *CompanyObservableOptionsParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the company observable options params
|
||||
func (o *CompanyObservableOptionsParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the company observable options params
|
||||
func (o *CompanyObservableOptionsParams) WithContext(ctx context.Context) *CompanyObservableOptionsParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the company observable options params
|
||||
func (o *CompanyObservableOptionsParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the company observable options params
|
||||
func (o *CompanyObservableOptionsParams) WithHTTPClient(client *http.Client) *CompanyObservableOptionsParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the company observable options params
|
||||
func (o *CompanyObservableOptionsParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *CompanyObservableOptionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,92 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package cors
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// CompanyObservableOptionsReader is a Reader for the CompanyObservableOptions structure.
|
||||
type CompanyObservableOptionsReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *CompanyObservableOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewCompanyObservableOptionsOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewCompanyObservableOptionsOK creates a CompanyObservableOptionsOK with default headers values
|
||||
func NewCompanyObservableOptionsOK() *CompanyObservableOptionsOK {
|
||||
return &CompanyObservableOptionsOK{}
|
||||
}
|
||||
|
||||
/*CompanyObservableOptionsOK handles this case with default header values.
|
||||
|
||||
CORS OPTIONS response
|
||||
*/
|
||||
type CompanyObservableOptionsOK struct {
|
||||
AccessControlAllowCredentials string
|
||||
|
||||
AccessControlAllowHeaders string
|
||||
|
||||
AccessControlAllowMethods string
|
||||
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
AccessControlExposeHeaders string
|
||||
|
||||
AccessControlMaxAge string
|
||||
|
||||
CacheControl string
|
||||
}
|
||||
|
||||
func (o *CompanyObservableOptionsOK) Error() string {
|
||||
return fmt.Sprintf("[OPTIONS /companies/observable][%d] companyObservableOptionsOK ", 200)
|
||||
}
|
||||
|
||||
func (o *CompanyObservableOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Credentials
|
||||
o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials")
|
||||
|
||||
// response header Access-Control-Allow-Headers
|
||||
o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers")
|
||||
|
||||
// response header Access-Control-Allow-Methods
|
||||
o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods")
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
// response header Access-Control-Expose-Headers
|
||||
o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers")
|
||||
|
||||
// response header Access-Control-Max-Age
|
||||
o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age")
|
||||
|
||||
// response header Cache-Control
|
||||
o.CacheControl = response.GetHeader("Cache-Control")
|
||||
|
||||
return nil
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue