Frist commit
commit
29d59991a8
|
@ -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 auth_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/lib/api/auth/auth_client/user"
|
||||
)
|
||||
|
||||
// Default auth HTTP client.
|
||||
var Default = NewHTTPClient(nil)
|
||||
|
||||
const (
|
||||
// DefaultHost is the default Host
|
||||
// found in Meta (info) section of spec file
|
||||
DefaultHost string = "auth.fabric.tnxs.net:8080"
|
||||
// DefaultBasePath is the default BasePath
|
||||
// found in Meta (info) section of spec file
|
||||
DefaultBasePath string = "/v1"
|
||||
)
|
||||
|
||||
// DefaultSchemes are the default schemes found in Meta (info) section of spec file
|
||||
var DefaultSchemes = []string{"http"}
|
||||
|
||||
// NewHTTPClient creates a new auth HTTP client.
|
||||
func NewHTTPClient(formats strfmt.Registry) *Auth {
|
||||
return NewHTTPClientWithConfig(formats, nil)
|
||||
}
|
||||
|
||||
// NewHTTPClientWithConfig creates a new auth HTTP client,
|
||||
// using a customizable transport config.
|
||||
func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Auth {
|
||||
// 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 auth client
|
||||
func New(transport runtime.ClientTransport, formats strfmt.Registry) *Auth {
|
||||
// ensure nullable parameters have default
|
||||
if formats == nil {
|
||||
formats = strfmt.Default
|
||||
}
|
||||
|
||||
cli := new(Auth)
|
||||
cli.Transport = transport
|
||||
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
|
||||
}
|
||||
|
||||
// Auth is a client for auth
|
||||
type Auth struct {
|
||||
User user.ClientService
|
||||
|
||||
Transport runtime.ClientTransport
|
||||
}
|
||||
|
||||
// SetTransport changes the transport on the client and all its subresources
|
||||
func (c *Auth) SetTransport(transport runtime.ClientTransport) {
|
||||
c.Transport = transport
|
||||
c.User.SetTransport(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 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 {
|
||||
|
||||
/*Apikey
|
||||
Service account or developer API key
|
||||
|
||||
*/
|
||||
Apikey *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
|
||||
}
|
||||
|
||||
// WithApikey adds the apikey to the get users params
|
||||
func (o *GetUsersParams) WithApikey(apikey *string) *GetUsersParams {
|
||||
o.SetApikey(apikey)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetApikey adds the apikey to the get users params
|
||||
func (o *GetUsersParams) SetApikey(apikey *string) {
|
||||
o.Apikey = apikey
|
||||
}
|
||||
|
||||
// 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
|
||||
|
||||
if o.Apikey != nil {
|
||||
|
||||
// query param apikey
|
||||
var qrApikey string
|
||||
if o.Apikey != nil {
|
||||
qrApikey = *o.Apikey
|
||||
}
|
||||
qApikey := qrApikey
|
||||
if qApikey != "" {
|
||||
if err := r.SetQueryParam("apikey", qApikey); 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 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/lib/api/auth/auth_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 422:
|
||||
result := NewGetUsersUnprocessableEntity()
|
||||
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 *auth_models.UserResponse
|
||||
}
|
||||
|
||||
func (o *GetUsersOK) Error() string {
|
||||
return fmt.Sprintf("[GET /users][%d] getUsersOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetUsersOK) GetPayload() *auth_models.UserResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetUsersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(auth_models.UserResponse)
|
||||
|
||||
// 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 *auth_models.Error
|
||||
}
|
||||
|
||||
func (o *GetUsersUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /users][%d] getUsersUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetUsersUnauthorized) GetPayload() *auth_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetUsersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(auth_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 *auth_models.Error
|
||||
}
|
||||
|
||||
func (o *GetUsersForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /users][%d] getUsersForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetUsersForbidden) GetPayload() *auth_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetUsersForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(auth_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 *auth_models.Error
|
||||
}
|
||||
|
||||
func (o *GetUsersNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /users][%d] getUsersNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetUsersNotFound) GetPayload() *auth_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetUsersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(auth_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetUsersUnprocessableEntity creates a GetUsersUnprocessableEntity with default headers values
|
||||
func NewGetUsersUnprocessableEntity() *GetUsersUnprocessableEntity {
|
||||
return &GetUsersUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*GetUsersUnprocessableEntity handles this case with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type GetUsersUnprocessableEntity struct {
|
||||
Payload *auth_models.Error
|
||||
}
|
||||
|
||||
func (o *GetUsersUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[GET /users][%d] getUsersUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetUsersUnprocessableEntity) GetPayload() *auth_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetUsersUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(auth_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 *auth_models.Error
|
||||
}
|
||||
|
||||
func (o *GetUsersInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /users][%d] getUsersInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetUsersInternalServerError) GetPayload() *auth_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetUsersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(auth_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,79 @@
|
|||
// 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 {
|
||||
GetUsers(params *GetUsersParams, authInfo runtime.ClientAuthInfoWriter) (*GetUsersOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
||||
/*
|
||||
GetUsers checks API key
|
||||
|
||||
Checks for a valid API key, and returns full user record
|
||||
*/
|
||||
func (a *Client) GetUsers(params *GetUsersParams, authInfo runtime.ClientAuthInfoWriter) (*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: "/users",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetUsersReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
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)
|
||||
}
|
||||
|
||||
// SetTransport changes the transport on the client
|
||||
func (a *Client) SetTransport(transport runtime.ClientTransport) {
|
||||
a.transport = transport
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
// 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_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"
|
||||
)
|
||||
|
||||
// Address address
|
||||
//
|
||||
// swagger:model Address
|
||||
type Address struct {
|
||||
|
||||
// City
|
||||
City string `json:"City,omitempty"`
|
||||
|
||||
// Country full name
|
||||
Country string `json:"Country,omitempty"`
|
||||
|
||||
// Country Code
|
||||
CountryCode string `json:"CountryCode,omitempty"`
|
||||
|
||||
// Postal Code
|
||||
PostalCode string `json:"PostalCode,omitempty"`
|
||||
|
||||
// State full name
|
||||
State string `json:"State,omitempty"`
|
||||
|
||||
// State Code
|
||||
StateCode string `json:"StateCode,omitempty"`
|
||||
|
||||
// Street number and name
|
||||
Street string `json:"Street,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this address
|
||||
func (m *Address) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *Address) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *Address) UnmarshalBinary(b []byte) error {
|
||||
var res Address
|
||||
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 auth_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,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 auth_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"
|
||||
)
|
||||
|
||||
// ResponseMeta response meta
|
||||
//
|
||||
// swagger:model ResponseMeta
|
||||
type ResponseMeta struct {
|
||||
|
||||
// Microservice Contact Info
|
||||
Contact string `json:"Contact,omitempty"`
|
||||
|
||||
// Copyright Info
|
||||
Copyright string `json:"Copyright,omitempty"`
|
||||
|
||||
// License Information and Restrictions
|
||||
License string `json:"License,omitempty"`
|
||||
|
||||
// Operation ID
|
||||
OperationID string `json:"OperationID,omitempty"`
|
||||
|
||||
// Request IP Address
|
||||
RequestIP string `json:"RequestIP,omitempty"`
|
||||
|
||||
// Request Type
|
||||
RequestType string `json:"RequestType,omitempty"`
|
||||
|
||||
// Request URL
|
||||
RequestURL string `json:"RequestURL,omitempty"`
|
||||
|
||||
// Data Server Info
|
||||
ServerInfo string `json:"ServerInfo,omitempty"`
|
||||
|
||||
// Data Server Response Time (ms)
|
||||
ServerResponseTime string `json:"ServerResponseTime,omitempty"`
|
||||
|
||||
// Backend Server Timestamp
|
||||
ServerTimestamp string `json:"ServerTimestamp,omitempty"`
|
||||
|
||||
// Taxnexus Account Number used for recording transactions
|
||||
TaxnexusAccount string `json:"TaxnexusAccount,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this response meta
|
||||
func (m *ResponseMeta) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *ResponseMeta) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *ResponseMeta) UnmarshalBinary(b []byte) error {
|
||||
var res ResponseMeta
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = 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 auth_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"
|
||||
)
|
||||
|
||||
// TenantUser Relationship object that connects users to a tenant
|
||||
//
|
||||
// swagger:model TenantUser
|
||||
type TenantUser struct {
|
||||
|
||||
// The makeTenantUser access level for this User
|
||||
AccessLevel string `json:"AccessLevel,omitempty"`
|
||||
|
||||
// Account ID
|
||||
AccountID string `json:"AccountID,omitempty"`
|
||||
|
||||
// Auth0 User ID
|
||||
Auth0UserID string `json:"Auth0UserID,omitempty"`
|
||||
|
||||
// Account Name
|
||||
CompanyName string `json:"CompanyName,omitempty"`
|
||||
|
||||
// Contact ID
|
||||
ContactID string `json:"ContactID,omitempty"`
|
||||
|
||||
// Taxnexus Account
|
||||
TaxnexusAccount string `json:"TaxnexusAccount,omitempty"`
|
||||
|
||||
// Tenant active?
|
||||
TenantActive bool `json:"TenantActive,omitempty"`
|
||||
|
||||
// The Tenant ID
|
||||
TenantID string `json:"TenantID,omitempty"`
|
||||
|
||||
// Tenant Name
|
||||
TenantName string `json:"TenantName,omitempty"`
|
||||
|
||||
// Tenant Status
|
||||
TenantStatus string `json:"TenantStatus,omitempty"`
|
||||
|
||||
// Tenant type
|
||||
TenantType string `json:"TenantType,omitempty"`
|
||||
|
||||
// Tenant Version
|
||||
TenantVersion string `json:"TenantVersion,omitempty"`
|
||||
|
||||
// User Email Address
|
||||
UserEmail string `json:"UserEmail,omitempty"`
|
||||
|
||||
// User Full Name
|
||||
UserFullName string `json:"UserFullName,omitempty"`
|
||||
|
||||
// The User ID
|
||||
UserID string `json:"UserID,omitempty"`
|
||||
|
||||
// Username
|
||||
Username string `json:"Username,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this tenant user
|
||||
func (m *TenantUser) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *TenantUser) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *TenantUser) UnmarshalBinary(b []byte) error {
|
||||
var res TenantUser
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,306 @@
|
|||
// 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_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 {
|
||||
|
||||
// API Key
|
||||
APIKey string `json:"APIKey,omitempty"`
|
||||
|
||||
// About Me
|
||||
AboutMe string `json:"AboutMe,omitempty"`
|
||||
|
||||
// Account ID
|
||||
AccountID string `json:"AccountID,omitempty"`
|
||||
|
||||
// address
|
||||
Address *Address `json:"Address,omitempty"`
|
||||
|
||||
// Alias
|
||||
Alias string `json:"Alias,omitempty"`
|
||||
|
||||
// Auth0 User Id
|
||||
Auth0UserID string `json:"Auth0UserID,omitempty"`
|
||||
|
||||
// Nickname
|
||||
CommunityNickname string `json:"CommunityNickname,omitempty"`
|
||||
|
||||
// Company Name
|
||||
CompanyName string `json:"CompanyName,omitempty"`
|
||||
|
||||
// Contact
|
||||
ContactID string `json:"ContactID,omitempty"`
|
||||
|
||||
// Created User ID
|
||||
CreatedByID string `json:"CreatedByID,omitempty"`
|
||||
|
||||
// Date Created
|
||||
CreatedDate string `json:"CreatedDate,omitempty"`
|
||||
|
||||
// Delegated Approver
|
||||
DelegatedApproverID string `json:"DelegatedApproverID,omitempty"`
|
||||
|
||||
// Department
|
||||
Department string `json:"Department,omitempty"`
|
||||
|
||||
// Division
|
||||
Division string `json:"Division,omitempty"`
|
||||
|
||||
// Email address
|
||||
Email string `json:"Email,omitempty"`
|
||||
|
||||
// Employee Number
|
||||
EmployeeNumber string `json:"EmployeeNumber,omitempty"`
|
||||
|
||||
// Time day ends
|
||||
EndOfDay string `json:"EndOfDay,omitempty"`
|
||||
|
||||
// Environment
|
||||
Environment string `json:"Environment,omitempty"`
|
||||
|
||||
// Extension
|
||||
Extension string `json:"Extension,omitempty"`
|
||||
|
||||
// Fabric API Key
|
||||
FabricAPIKey string `json:"FabricAPIKey,omitempty"`
|
||||
|
||||
// Fax
|
||||
Fax string `json:"Fax,omitempty"`
|
||||
|
||||
// The first name
|
||||
FirstName string `json:"FirstName,omitempty"`
|
||||
|
||||
// Allow Forecasting
|
||||
ForecastEnabled bool `json:"ForecastEnabled,omitempty"`
|
||||
|
||||
// Full Photo URL
|
||||
FullPhotoURL string `json:"FullPhotoURL,omitempty"`
|
||||
|
||||
// Taxnexus ID
|
||||
ID string `json:"ID,omitempty"`
|
||||
|
||||
// Active
|
||||
IsActive bool `json:"IsActive,omitempty"`
|
||||
|
||||
// Is the user enabled for Communities?
|
||||
IsPortalEnabled bool `json:"IsPortalEnabled,omitempty"`
|
||||
|
||||
// Has Profile Photo
|
||||
IsProphilePhotoActive bool `json:"IsProphilePhotoActive,omitempty"`
|
||||
|
||||
// is system controlled
|
||||
IsSystemControlled bool `json:"IsSystemControlled,omitempty"`
|
||||
|
||||
// IP address of last login
|
||||
LastIP string `json:"LastIP,omitempty"`
|
||||
|
||||
// Last login time
|
||||
LastLogin string `json:"LastLogin,omitempty"`
|
||||
|
||||
// Last Modified User ID
|
||||
LastModifiedByID string `json:"LastModifiedByID,omitempty"`
|
||||
|
||||
// Last Modified Date
|
||||
LastModifiedDate string `json:"LastModifiedDate,omitempty"`
|
||||
|
||||
// The Last Name
|
||||
LastName string `json:"LastName,omitempty"`
|
||||
|
||||
// Number of times user has logged in
|
||||
LoginCount int64 `json:"LoginCount,omitempty"`
|
||||
|
||||
// Manager
|
||||
ManagerID string `json:"ManagerID,omitempty"`
|
||||
|
||||
// Mobile
|
||||
MobilePhone string `json:"MobilePhone,omitempty"`
|
||||
|
||||
// Name
|
||||
Name string `json:"Name,omitempty"`
|
||||
|
||||
// Out of office message
|
||||
OutOfOfficeMessage string `json:"OutOfOfficeMessage,omitempty"`
|
||||
|
||||
// Phone
|
||||
Phone string `json:"Phone,omitempty"`
|
||||
|
||||
// Portal Role Level
|
||||
PortalRole string `json:"PortalRole,omitempty"`
|
||||
|
||||
// Profile
|
||||
ProfileID string `json:"ProfileID,omitempty"`
|
||||
|
||||
// Info Emails
|
||||
ReceivesAdminEmails bool `json:"ReceivesAdminEmails,omitempty"`
|
||||
|
||||
// Admin Info Emails
|
||||
ReceivesAdminInfoEmails bool `json:"ReceivesAdminInfoEmails,omitempty"`
|
||||
|
||||
// Email Sender Address
|
||||
SenderEmail string `json:"SenderEmail,omitempty"`
|
||||
|
||||
// Email Sender Name
|
||||
SenderName string `json:"SenderName,omitempty"`
|
||||
|
||||
// Email Signature
|
||||
Signature string `json:"Signature,omitempty"`
|
||||
|
||||
// Small Photo URL
|
||||
SmallPhotoURL string `json:"SmallPhotoURL,omitempty"`
|
||||
|
||||
// The time day starts
|
||||
StartOfDay string `json:"StartOfDay,omitempty"`
|
||||
|
||||
// Taxnexus Account
|
||||
TaxnexusAccount string `json:"TaxnexusAccount,omitempty"`
|
||||
|
||||
// Tenant ID associated with this user
|
||||
TenantID string `json:"TenantID,omitempty"`
|
||||
|
||||
// tenant users
|
||||
TenantUsers []*TenantUser `json:"TenantUsers"`
|
||||
|
||||
// Time Zone
|
||||
TimeZone string `json:"TimeZone,omitempty"`
|
||||
|
||||
// Title
|
||||
Title string `json:"Title,omitempty"`
|
||||
|
||||
// Role
|
||||
UserRoleID string `json:"UserRoleID,omitempty"`
|
||||
|
||||
// user roles
|
||||
UserRoles []*UserRole `json:"UserRoles"`
|
||||
|
||||
// User Type
|
||||
UserType string `json:"UserType,omitempty"`
|
||||
|
||||
// Username
|
||||
Username string `json:"Username,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this user
|
||||
func (m *User) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateAddress(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateTenantUsers(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateUserRoles(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *User) 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 *User) validateTenantUsers(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.TenantUsers) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.TenantUsers); i++ {
|
||||
if swag.IsZero(m.TenantUsers[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.TenantUsers[i] != nil {
|
||||
if err := m.TenantUsers[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("TenantUsers" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *User) validateUserRoles(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.UserRoles) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.UserRoles); i++ {
|
||||
if swag.IsZero(m.UserRoles[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.UserRoles[i] != nil {
|
||||
if err := m.UserRoles[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("UserRoles" + "." + strconv.Itoa(i))
|
||||
}
|
||||
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
|
||||
}
|
|
@ -0,0 +1,109 @@
|
|||
// 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_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"
|
||||
)
|
||||
|
||||
// UserResponse An array Taxnexus user objects
|
||||
//
|
||||
// swagger:model UserResponse
|
||||
type UserResponse struct {
|
||||
|
||||
// data
|
||||
Data []*User `json:"Data"`
|
||||
|
||||
// meta
|
||||
Meta *ResponseMeta `json:"Meta,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this user response
|
||||
func (m *UserResponse) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateData(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateMeta(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *UserResponse) validateData(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Data) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Data); i++ {
|
||||
if swag.IsZero(m.Data[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Data[i] != nil {
|
||||
if err := m.Data[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *UserResponse) validateMeta(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Meta) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.Meta != nil {
|
||||
if err := m.Meta.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("Meta")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *UserResponse) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *UserResponse) UnmarshalBinary(b []byte) error {
|
||||
var res UserResponse
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,83 @@
|
|||
// 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_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"
|
||||
)
|
||||
|
||||
// UserRole Relationship object that connects user to a role
|
||||
//
|
||||
// swagger:model UserRole
|
||||
type UserRole struct {
|
||||
|
||||
// Account Id
|
||||
AccountID string `json:"AccountID,omitempty"`
|
||||
|
||||
// Linked role ID
|
||||
Auth0RoleID string `json:"Auth0RoleID,omitempty"`
|
||||
|
||||
// Auth0 User ID
|
||||
Auth0UserID string `json:"Auth0UserID,omitempty"`
|
||||
|
||||
// Company Name
|
||||
CompanyName string `json:"CompanyName,omitempty"`
|
||||
|
||||
// Contact ID
|
||||
ContactID string `json:"ContactID,omitempty"`
|
||||
|
||||
// Role description
|
||||
RoleDescription string `json:"RoleDescription,omitempty"`
|
||||
|
||||
// The Role ID
|
||||
RoleID string `json:"RoleID,omitempty"`
|
||||
|
||||
// Role Name
|
||||
RoleName string `json:"RoleName,omitempty"`
|
||||
|
||||
// Taxnexus Account Number
|
||||
TaxnexusAccount string `json:"TaxnexusAccount,omitempty"`
|
||||
|
||||
// User Email Address
|
||||
UserEmail string `json:"UserEmail,omitempty"`
|
||||
|
||||
// User Full Name
|
||||
UserFullName string `json:"UserFullName,omitempty"`
|
||||
|
||||
// The User ID
|
||||
UserID string `json:"UserID,omitempty"`
|
||||
|
||||
// Username
|
||||
Username string `json:"Username,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this user role
|
||||
func (m *UserRole) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *UserRole) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *UserRole) UnmarshalBinary(b []byte) error {
|
||||
var res UserRole
|
||||
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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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
|
||||
}
|
|
@ -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"
|
||||
)
|
||||
|
||||
// NewCompanyOptionsParams creates a new CompanyOptionsParams object
|
||||
// with the default values initialized.
|
||||
func NewCompanyOptionsParams() *CompanyOptionsParams {
|
||||
|
||||
return &CompanyOptionsParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewCompanyOptionsParamsWithTimeout creates a new CompanyOptionsParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewCompanyOptionsParamsWithTimeout(timeout time.Duration) *CompanyOptionsParams {
|
||||
|
||||
return &CompanyOptionsParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewCompanyOptionsParamsWithContext creates a new CompanyOptionsParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewCompanyOptionsParamsWithContext(ctx context.Context) *CompanyOptionsParams {
|
||||
|
||||
return &CompanyOptionsParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewCompanyOptionsParamsWithHTTPClient creates a new CompanyOptionsParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewCompanyOptionsParamsWithHTTPClient(client *http.Client) *CompanyOptionsParams {
|
||||
|
||||
return &CompanyOptionsParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*CompanyOptionsParams contains all the parameters to send to the API endpoint
|
||||
for the company options operation typically these are written to a http.Request
|
||||
*/
|
||||
type CompanyOptionsParams struct {
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the company options params
|
||||
func (o *CompanyOptionsParams) WithTimeout(timeout time.Duration) *CompanyOptionsParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the company options params
|
||||
func (o *CompanyOptionsParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the company options params
|
||||
func (o *CompanyOptionsParams) WithContext(ctx context.Context) *CompanyOptionsParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the company options params
|
||||
func (o *CompanyOptionsParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the company options params
|
||||
func (o *CompanyOptionsParams) WithHTTPClient(client *http.Client) *CompanyOptionsParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the company options params
|
||||
func (o *CompanyOptionsParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *CompanyOptionsParams) 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"
|
||||
)
|
||||
|
||||
// CompanyOptionsReader is a Reader for the CompanyOptions structure.
|
||||
type CompanyOptionsReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *CompanyOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewCompanyOptionsOK()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewCompanyOptionsOK creates a CompanyOptionsOK with default headers values
|
||||
func NewCompanyOptionsOK() *CompanyOptionsOK {
|
||||
return &CompanyOptionsOK{}
|
||||
}
|
||||
|
||||
/*CompanyOptionsOK handles this case with default header values.
|
||||
|
||||
CORS OPTIONS response
|
||||
*/
|
||||
type CompanyOptionsOK struct {
|
||||
AccessControlAllowCredentials string
|
||||
|
||||
AccessControlAllowHeaders string
|
||||
|
||||
AccessControlAllowMethods string
|
||||
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
AccessControlExposeHeaders string
|
||||
|
||||
AccessControlMaxAge string
|
||||
|
||||
CacheControl string
|
||||
}
|
||||
|
||||
func (o *CompanyOptionsOK) Error() string {
|
||||
return fmt.Sprintf("[OPTIONS /companies][%d] companyOptionsOK ", 200)
|
||||
}
|
||||
|
||||
func (o *CompanyOptionsOK) 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"
|
||||
)
|
||||
|
||||
// NewContactOptionsObservableParams creates a new ContactOptionsObservableParams object
|
||||
// with the default values initialized.
|
||||
func NewContactOptionsObservableParams() *ContactOptionsObservableParams {
|
||||
|
||||
return &ContactOptionsObservableParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewContactOptionsObservableParamsWithTimeout creates a new ContactOptionsObservableParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewContactOptionsObservableParamsWithTimeout(timeout time.Duration) *ContactOptionsObservableParams {
|
||||
|
||||
return &ContactOptionsObservableParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewContactOptionsObservableParamsWithContext creates a new ContactOptionsObservableParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewContactOptionsObservableParamsWithContext(ctx context.Context) *ContactOptionsObservableParams {
|
||||
|
||||
return &ContactOptionsObservableParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewContactOptionsObservableParamsWithHTTPClient creates a new ContactOptionsObservableParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewContactOptionsObservableParamsWithHTTPClient(client *http.Client) *ContactOptionsObservableParams {
|
||||
|
||||
return &ContactOptionsObservableParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*ContactOptionsObservableParams contains all the parameters to send to the API endpoint
|
||||
for the contact options observable operation typically these are written to a http.Request
|
||||
*/
|
||||
type ContactOptionsObservableParams struct {
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the contact options observable params
|
||||
func (o *ContactOptionsObservableParams) WithTimeout(timeout time.Duration) *ContactOptionsObservableParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the contact options observable params
|
||||
func (o *ContactOptionsObservableParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the contact options observable params
|
||||
func (o *ContactOptionsObservableParams) WithContext(ctx context.Context) *ContactOptionsObservableParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the contact options observable params
|
||||
func (o *ContactOptionsObservableParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the contact options observable params
|
||||
func (o *ContactOptionsObservableParams) WithHTTPClient(client *http.Client) *ContactOptionsObservableParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the contact options observable params
|
||||
func (o *ContactOptionsObservableParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *ContactOptionsObservableParams) 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"
|
||||
)
|
||||
|
||||
// ContactOptionsObservableReader is a Reader for the ContactOptionsObservable structure.
|
||||
type ContactOptionsObservableReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *ContactOptionsObservableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewContactOptionsObservableOK()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewContactOptionsObservableOK creates a ContactOptionsObservableOK with default headers values
|
||||
func NewContactOptionsObservableOK() *ContactOptionsObservableOK {
|
||||
return &ContactOptionsObservableOK{}
|
||||
}
|
||||
|
||||
/*ContactOptionsObservableOK handles this case with default header values.
|
||||
|
||||
CORS OPTIONS response
|
||||
*/
|
||||
type ContactOptionsObservableOK struct {
|
||||
AccessControlAllowCredentials string
|
||||
|
||||
AccessControlAllowHeaders string
|
||||
|
||||
AccessControlAllowMethods string
|
||||
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
AccessControlExposeHeaders string
|
||||
|
||||
AccessControlMaxAge string
|
||||
|
||||
CacheControl string
|
||||
}
|
||||
|
||||
func (o *ContactOptionsObservableOK) Error() string {
|
||||
return fmt.Sprintf("[OPTIONS /contacts/observable][%d] contactOptionsObservableOK ", 200)
|
||||
}
|
||||
|
||||
func (o *ContactOptionsObservableOK) 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"
|
||||
)
|
||||
|
||||
// NewContactOptionsParams creates a new ContactOptionsParams object
|
||||
// with the default values initialized.
|
||||
func NewContactOptionsParams() *ContactOptionsParams {
|
||||
|
||||
return &ContactOptionsParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewContactOptionsParamsWithTimeout creates a new ContactOptionsParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewContactOptionsParamsWithTimeout(timeout time.Duration) *ContactOptionsParams {
|
||||
|
||||
return &ContactOptionsParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewContactOptionsParamsWithContext creates a new ContactOptionsParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewContactOptionsParamsWithContext(ctx context.Context) *ContactOptionsParams {
|
||||
|
||||
return &ContactOptionsParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewContactOptionsParamsWithHTTPClient creates a new ContactOptionsParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewContactOptionsParamsWithHTTPClient(client *http.Client) *ContactOptionsParams {
|
||||
|
||||
return &ContactOptionsParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*ContactOptionsParams contains all the parameters to send to the API endpoint
|
||||
for the contact options operation typically these are written to a http.Request
|
||||
*/
|
||||
type ContactOptionsParams struct {
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the contact options params
|
||||
func (o *ContactOptionsParams) WithTimeout(timeout time.Duration) *ContactOptionsParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the contact options params
|
||||
func (o *ContactOptionsParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the contact options params
|
||||
func (o *ContactOptionsParams) WithContext(ctx context.Context) *ContactOptionsParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the contact options params
|
||||
func (o *ContactOptionsParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the contact options params
|
||||
func (o *ContactOptionsParams) WithHTTPClient(client *http.Client) *ContactOptionsParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the contact options params
|
||||
func (o *ContactOptionsParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *ContactOptionsParams) 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"
|
||||
)
|
||||
|
||||
// ContactOptionsReader is a Reader for the ContactOptions structure.
|
||||
type ContactOptionsReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *ContactOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewContactOptionsOK()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewContactOptionsOK creates a ContactOptionsOK with default headers values
|
||||
func NewContactOptionsOK() *ContactOptionsOK {
|
||||
return &ContactOptionsOK{}
|
||||
}
|
||||
|
||||
/*ContactOptionsOK handles this case with default header values.
|
||||
|
||||
CORS OPTIONS response
|
||||
*/
|
||||
type ContactOptionsOK struct {
|
||||
AccessControlAllowCredentials string
|
||||
|
||||
AccessControlAllowHeaders string
|
||||
|
||||
AccessControlAllowMethods string
|
||||
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
AccessControlExposeHeaders string
|
||||
|
||||
AccessControlMaxAge string
|
||||
|
||||
CacheControl string
|
||||
}
|
||||
|
||||
func (o *ContactOptionsOK) Error() string {
|
||||
return fmt.Sprintf("[OPTIONS /contacts][%d] contactOptionsOK ", 200)
|
||||
}
|
||||
|
||||
func (o *ContactOptionsOK) 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,328 @@
|
|||
// 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"
|
||||
)
|
||||
|
||||
// New creates a new cors API client.
|
||||
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
|
||||
return &Client{transport: transport, formats: formats}
|
||||
}
|
||||
|
||||
/*
|
||||
Client for cors API
|
||||
*/
|
||||
type Client struct {
|
||||
transport runtime.ClientTransport
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ClientService is the interface for Client methods
|
||||
type ClientService interface {
|
||||
AccountOptions(params *AccountOptionsParams) (*AccountOptionsOK, error)
|
||||
|
||||
AccountOptionsObservable(params *AccountOptionsObservableParams) (*AccountOptionsObservableOK, error)
|
||||
|
||||
CompanyObservableOptions(params *CompanyObservableOptionsParams) (*CompanyObservableOptionsOK, error)
|
||||
|
||||
CompanyOptions(params *CompanyOptionsParams) (*CompanyOptionsOK, error)
|
||||
|
||||
ContactOptions(params *ContactOptionsParams) (*ContactOptionsOK, error)
|
||||
|
||||
ContactOptionsObservable(params *ContactOptionsObservableParams) (*ContactOptionsObservableOK, error)
|
||||
|
||||
LeadOptions(params *LeadOptionsParams) (*LeadOptionsOK, error)
|
||||
|
||||
LeadOptionsObservable(params *LeadOptionsObservableParams) (*LeadOptionsObservableOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
||||
/*
|
||||
AccountOptions CORS support
|
||||
*/
|
||||
func (a *Client) AccountOptions(params *AccountOptionsParams) (*AccountOptionsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewAccountOptionsParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "accountOptions",
|
||||
Method: "OPTIONS",
|
||||
PathPattern: "/accounts",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &AccountOptionsReader{formats: a.formats},
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*AccountOptionsOK)
|
||||
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 accountOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
AccountOptionsObservable CORS support
|
||||
*/
|
||||
func (a *Client) AccountOptionsObservable(params *AccountOptionsObservableParams) (*AccountOptionsObservableOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewAccountOptionsObservableParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "accountOptionsObservable",
|
||||
Method: "OPTIONS",
|
||||
PathPattern: "/accounts/observable",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &AccountOptionsObservableReader{formats: a.formats},
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*AccountOptionsObservableOK)
|
||||
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 accountOptionsObservable: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
CompanyObservableOptions CORS support
|
||||
*/
|
||||
func (a *Client) CompanyObservableOptions(params *CompanyObservableOptionsParams) (*CompanyObservableOptionsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewCompanyObservableOptionsParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "companyObservableOptions",
|
||||
Method: "OPTIONS",
|
||||
PathPattern: "/companies/observable",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &CompanyObservableOptionsReader{formats: a.formats},
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*CompanyObservableOptionsOK)
|
||||
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 companyObservableOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
CompanyOptions CORS support
|
||||
*/
|
||||
func (a *Client) CompanyOptions(params *CompanyOptionsParams) (*CompanyOptionsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewCompanyOptionsParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "companyOptions",
|
||||
Method: "OPTIONS",
|
||||
PathPattern: "/companies",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &CompanyOptionsReader{formats: a.formats},
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*CompanyOptionsOK)
|
||||
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 companyOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
ContactOptions CORS support
|
||||
*/
|
||||
func (a *Client) ContactOptions(params *ContactOptionsParams) (*ContactOptionsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewContactOptionsParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "contactOptions",
|
||||
Method: "OPTIONS",
|
||||
PathPattern: "/contacts",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &ContactOptionsReader{formats: a.formats},
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*ContactOptionsOK)
|
||||
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 contactOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
ContactOptionsObservable CORS support
|
||||
*/
|
||||
func (a *Client) ContactOptionsObservable(params *ContactOptionsObservableParams) (*ContactOptionsObservableOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewContactOptionsObservableParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "contactOptionsObservable",
|
||||
Method: "OPTIONS",
|
||||
PathPattern: "/contacts/observable",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &ContactOptionsObservableReader{formats: a.formats},
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*ContactOptionsObservableOK)
|
||||
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 contactOptionsObservable: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
LeadOptions CORS support
|
||||
*/
|
||||
func (a *Client) LeadOptions(params *LeadOptionsParams) (*LeadOptionsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewLeadOptionsParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "leadOptions",
|
||||
Method: "OPTIONS",
|
||||
PathPattern: "/leads",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &LeadOptionsReader{formats: a.formats},
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*LeadOptionsOK)
|
||||
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 leadOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
LeadOptionsObservable CORS support
|
||||
*/
|
||||
func (a *Client) LeadOptionsObservable(params *LeadOptionsObservableParams) (*LeadOptionsObservableOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewLeadOptionsObservableParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "leadOptionsObservable",
|
||||
Method: "OPTIONS",
|
||||
PathPattern: "/leads/observable",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &LeadOptionsObservableReader{formats: a.formats},
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*LeadOptionsObservableOK)
|
||||
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 leadOptionsObservable: 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 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"
|
||||
)
|
||||
|
||||
// NewLeadOptionsObservableParams creates a new LeadOptionsObservableParams object
|
||||
// with the default values initialized.
|
||||
func NewLeadOptionsObservableParams() *LeadOptionsObservableParams {
|
||||
|
||||
return &LeadOptionsObservableParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewLeadOptionsObservableParamsWithTimeout creates a new LeadOptionsObservableParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewLeadOptionsObservableParamsWithTimeout(timeout time.Duration) *LeadOptionsObservableParams {
|
||||
|
||||
return &LeadOptionsObservableParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewLeadOptionsObservableParamsWithContext creates a new LeadOptionsObservableParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewLeadOptionsObservableParamsWithContext(ctx context.Context) *LeadOptionsObservableParams {
|
||||
|
||||
return &LeadOptionsObservableParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewLeadOptionsObservableParamsWithHTTPClient creates a new LeadOptionsObservableParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewLeadOptionsObservableParamsWithHTTPClient(client *http.Client) *LeadOptionsObservableParams {
|
||||
|
||||
return &LeadOptionsObservableParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*LeadOptionsObservableParams contains all the parameters to send to the API endpoint
|
||||
for the lead options observable operation typically these are written to a http.Request
|
||||
*/
|
||||
type LeadOptionsObservableParams struct {
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the lead options observable params
|
||||
func (o *LeadOptionsObservableParams) WithTimeout(timeout time.Duration) *LeadOptionsObservableParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the lead options observable params
|
||||
func (o *LeadOptionsObservableParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the lead options observable params
|
||||
func (o *LeadOptionsObservableParams) WithContext(ctx context.Context) *LeadOptionsObservableParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the lead options observable params
|
||||
func (o *LeadOptionsObservableParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the lead options observable params
|
||||
func (o *LeadOptionsObservableParams) WithHTTPClient(client *http.Client) *LeadOptionsObservableParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the lead options observable params
|
||||
func (o *LeadOptionsObservableParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *LeadOptionsObservableParams) 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"
|
||||
)
|
||||
|
||||
// LeadOptionsObservableReader is a Reader for the LeadOptionsObservable structure.
|
||||
type LeadOptionsObservableReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *LeadOptionsObservableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewLeadOptionsObservableOK()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewLeadOptionsObservableOK creates a LeadOptionsObservableOK with default headers values
|
||||
func NewLeadOptionsObservableOK() *LeadOptionsObservableOK {
|
||||
return &LeadOptionsObservableOK{}
|
||||
}
|
||||
|
||||
/*LeadOptionsObservableOK handles this case with default header values.
|
||||
|
||||
CORS OPTIONS response
|
||||
*/
|
||||
type LeadOptionsObservableOK struct {
|
||||
AccessControlAllowCredentials string
|
||||
|
||||
AccessControlAllowHeaders string
|
||||
|
||||
AccessControlAllowMethods string
|
||||
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
AccessControlExposeHeaders string
|
||||
|
||||
AccessControlMaxAge string
|
||||
|
||||
CacheControl string
|
||||
}
|
||||
|
||||
func (o *LeadOptionsObservableOK) Error() string {
|
||||
return fmt.Sprintf("[OPTIONS /leads/observable][%d] leadOptionsObservableOK ", 200)
|
||||
}
|
||||
|
||||
func (o *LeadOptionsObservableOK) 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"
|
||||
)
|
||||
|
||||
// NewLeadOptionsParams creates a new LeadOptionsParams object
|
||||
// with the default values initialized.
|
||||
func NewLeadOptionsParams() *LeadOptionsParams {
|
||||
|
||||
return &LeadOptionsParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewLeadOptionsParamsWithTimeout creates a new LeadOptionsParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewLeadOptionsParamsWithTimeout(timeout time.Duration) *LeadOptionsParams {
|
||||
|
||||
return &LeadOptionsParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewLeadOptionsParamsWithContext creates a new LeadOptionsParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewLeadOptionsParamsWithContext(ctx context.Context) *LeadOptionsParams {
|
||||
|
||||
return &LeadOptionsParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewLeadOptionsParamsWithHTTPClient creates a new LeadOptionsParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewLeadOptionsParamsWithHTTPClient(client *http.Client) *LeadOptionsParams {
|
||||
|
||||
return &LeadOptionsParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*LeadOptionsParams contains all the parameters to send to the API endpoint
|
||||
for the lead options operation typically these are written to a http.Request
|
||||
*/
|
||||
type LeadOptionsParams struct {
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the lead options params
|
||||
func (o *LeadOptionsParams) WithTimeout(timeout time.Duration) *LeadOptionsParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the lead options params
|
||||
func (o *LeadOptionsParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the lead options params
|
||||
func (o *LeadOptionsParams) WithContext(ctx context.Context) *LeadOptionsParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the lead options params
|
||||
func (o *LeadOptionsParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the lead options params
|
||||
func (o *LeadOptionsParams) WithHTTPClient(client *http.Client) *LeadOptionsParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the lead options params
|
||||
func (o *LeadOptionsParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *LeadOptionsParams) 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"
|
||||
)
|
||||
|
||||
// LeadOptionsReader is a Reader for the LeadOptions structure.
|
||||
type LeadOptionsReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *LeadOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewLeadOptionsOK()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewLeadOptionsOK creates a LeadOptionsOK with default headers values
|
||||
func NewLeadOptionsOK() *LeadOptionsOK {
|
||||
return &LeadOptionsOK{}
|
||||
}
|
||||
|
||||
/*LeadOptionsOK handles this case with default header values.
|
||||
|
||||
CORS OPTIONS response
|
||||
*/
|
||||
type LeadOptionsOK struct {
|
||||
AccessControlAllowCredentials string
|
||||
|
||||
AccessControlAllowHeaders string
|
||||
|
||||
AccessControlAllowMethods string
|
||||
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
AccessControlExposeHeaders string
|
||||
|
||||
AccessControlMaxAge string
|
||||
|
||||
CacheControl string
|
||||
}
|
||||
|
||||
func (o *LeadOptionsOK) Error() string {
|
||||
return fmt.Sprintf("[OPTIONS /leads][%d] leadOptionsOK ", 200)
|
||||
}
|
||||
|
||||
func (o *LeadOptionsOK) 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,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 crm_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/lib/api/crm/crm_client/accounts"
|
||||
"github.com/taxnexus/lib/api/crm/crm_client/companies"
|
||||
"github.com/taxnexus/lib/api/crm/crm_client/contacts"
|
||||
"github.com/taxnexus/lib/api/crm/crm_client/cors"
|
||||
"github.com/taxnexus/lib/api/crm/crm_client/leads"
|
||||
)
|
||||
|
||||
// Default crm HTTP client.
|
||||
var Default = NewHTTPClient(nil)
|
||||
|
||||
const (
|
||||
// DefaultHost is the default Host
|
||||
// found in Meta (info) section of spec file
|
||||
DefaultHost string = "crm.fabric.tnxs.net:8080"
|
||||
// DefaultBasePath is the default BasePath
|
||||
// found in Meta (info) section of spec file
|
||||
DefaultBasePath string = "/v1"
|
||||
)
|
||||
|
||||
// DefaultSchemes are the default schemes found in Meta (info) section of spec file
|
||||
var DefaultSchemes = []string{"http"}
|
||||
|
||||
// NewHTTPClient creates a new crm HTTP client.
|
||||
func NewHTTPClient(formats strfmt.Registry) *Crm {
|
||||
return NewHTTPClientWithConfig(formats, nil)
|
||||
}
|
||||
|
||||
// NewHTTPClientWithConfig creates a new crm HTTP client,
|
||||
// using a customizable transport config.
|
||||
func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Crm {
|
||||
// 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 crm client
|
||||
func New(transport runtime.ClientTransport, formats strfmt.Registry) *Crm {
|
||||
// ensure nullable parameters have default
|
||||
if formats == nil {
|
||||
formats = strfmt.Default
|
||||
}
|
||||
|
||||
cli := new(Crm)
|
||||
cli.Transport = transport
|
||||
cli.Accounts = accounts.New(transport, formats)
|
||||
cli.Companies = companies.New(transport, formats)
|
||||
cli.Contacts = contacts.New(transport, formats)
|
||||
cli.Cors = cors.New(transport, formats)
|
||||
cli.Leads = leads.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
|
||||
}
|
||||
|
||||
// Crm is a client for crm
|
||||
type Crm struct {
|
||||
Accounts accounts.ClientService
|
||||
|
||||
Companies companies.ClientService
|
||||
|
||||
Contacts contacts.ClientService
|
||||
|
||||
Cors cors.ClientService
|
||||
|
||||
Leads leads.ClientService
|
||||
|
||||
Transport runtime.ClientTransport
|
||||
}
|
||||
|
||||
// SetTransport changes the transport on the client and all its subresources
|
||||
func (c *Crm) SetTransport(transport runtime.ClientTransport) {
|
||||
c.Transport = transport
|
||||
c.Accounts.SetTransport(transport)
|
||||
c.Companies.SetTransport(transport)
|
||||
c.Contacts.SetTransport(transport)
|
||||
c.Cors.SetTransport(transport)
|
||||
c.Leads.SetTransport(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 leads
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewDeleteLeadParams creates a new DeleteLeadParams object
|
||||
// with the default values initialized.
|
||||
func NewDeleteLeadParams() *DeleteLeadParams {
|
||||
var ()
|
||||
return &DeleteLeadParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteLeadParamsWithTimeout creates a new DeleteLeadParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewDeleteLeadParamsWithTimeout(timeout time.Duration) *DeleteLeadParams {
|
||||
var ()
|
||||
return &DeleteLeadParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteLeadParamsWithContext creates a new DeleteLeadParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewDeleteLeadParamsWithContext(ctx context.Context) *DeleteLeadParams {
|
||||
var ()
|
||||
return &DeleteLeadParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteLeadParamsWithHTTPClient creates a new DeleteLeadParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewDeleteLeadParamsWithHTTPClient(client *http.Client) *DeleteLeadParams {
|
||||
var ()
|
||||
return &DeleteLeadParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*DeleteLeadParams contains all the parameters to send to the API endpoint
|
||||
for the delete lead operation typically these are written to a http.Request
|
||||
*/
|
||||
type DeleteLeadParams struct {
|
||||
|
||||
/*LeadID
|
||||
Taxnexus Lead record ID
|
||||
|
||||
*/
|
||||
LeadID *string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the delete lead params
|
||||
func (o *DeleteLeadParams) WithTimeout(timeout time.Duration) *DeleteLeadParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the delete lead params
|
||||
func (o *DeleteLeadParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the delete lead params
|
||||
func (o *DeleteLeadParams) WithContext(ctx context.Context) *DeleteLeadParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the delete lead params
|
||||
func (o *DeleteLeadParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the delete lead params
|
||||
func (o *DeleteLeadParams) WithHTTPClient(client *http.Client) *DeleteLeadParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the delete lead params
|
||||
func (o *DeleteLeadParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithLeadID adds the leadID to the delete lead params
|
||||
func (o *DeleteLeadParams) WithLeadID(leadID *string) *DeleteLeadParams {
|
||||
o.SetLeadID(leadID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetLeadID adds the leadId to the delete lead params
|
||||
func (o *DeleteLeadParams) SetLeadID(leadID *string) {
|
||||
o.LeadID = leadID
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *DeleteLeadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if o.LeadID != nil {
|
||||
|
||||
// query param leadId
|
||||
var qrLeadID string
|
||||
if o.LeadID != nil {
|
||||
qrLeadID = *o.LeadID
|
||||
}
|
||||
qLeadID := qrLeadID
|
||||
if qLeadID != "" {
|
||||
if err := r.SetQueryParam("leadId", qLeadID); 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 leads
|
||||
|
||||
// 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/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// DeleteLeadReader is a Reader for the DeleteLead structure.
|
||||
type DeleteLeadReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *DeleteLeadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewDeleteLeadOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewDeleteLeadUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewDeleteLeadForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewDeleteLeadNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewDeleteLeadUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewDeleteLeadInternalServerError()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteLeadOK creates a DeleteLeadOK with default headers values
|
||||
func NewDeleteLeadOK() *DeleteLeadOK {
|
||||
return &DeleteLeadOK{}
|
||||
}
|
||||
|
||||
/*DeleteLeadOK handles this case with default header values.
|
||||
|
||||
Taxnexus Response with Message Objects with Delete Status
|
||||
*/
|
||||
type DeleteLeadOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.DeleteResponse
|
||||
}
|
||||
|
||||
func (o *DeleteLeadOK) Error() string {
|
||||
return fmt.Sprintf("[DELETE /leads][%d] deleteLeadOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteLeadOK) GetPayload() *crm_models.DeleteResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *DeleteLeadOK) 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
|
||||
}
|
||||
|
||||
// NewDeleteLeadUnauthorized creates a DeleteLeadUnauthorized with default headers values
|
||||
func NewDeleteLeadUnauthorized() *DeleteLeadUnauthorized {
|
||||
return &DeleteLeadUnauthorized{}
|
||||
}
|
||||
|
||||
/*DeleteLeadUnauthorized handles this case with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type DeleteLeadUnauthorized struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *DeleteLeadUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[DELETE /leads][%d] deleteLeadUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteLeadUnauthorized) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *DeleteLeadUnauthorized) 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
|
||||
}
|
||||
|
||||
// NewDeleteLeadForbidden creates a DeleteLeadForbidden with default headers values
|
||||
func NewDeleteLeadForbidden() *DeleteLeadForbidden {
|
||||
return &DeleteLeadForbidden{}
|
||||
}
|
||||
|
||||
/*DeleteLeadForbidden handles this case with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type DeleteLeadForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *DeleteLeadForbidden) Error() string {
|
||||
return fmt.Sprintf("[DELETE /leads][%d] deleteLeadForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteLeadForbidden) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *DeleteLeadForbidden) 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
|
||||
}
|
||||
|
||||
// NewDeleteLeadNotFound creates a DeleteLeadNotFound with default headers values
|
||||
func NewDeleteLeadNotFound() *DeleteLeadNotFound {
|
||||
return &DeleteLeadNotFound{}
|
||||
}
|
||||
|
||||
/*DeleteLeadNotFound handles this case with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type DeleteLeadNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *DeleteLeadNotFound) Error() string {
|
||||
return fmt.Sprintf("[DELETE /leads][%d] deleteLeadNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteLeadNotFound) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *DeleteLeadNotFound) 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
|
||||
}
|
||||
|
||||
// NewDeleteLeadUnprocessableEntity creates a DeleteLeadUnprocessableEntity with default headers values
|
||||
func NewDeleteLeadUnprocessableEntity() *DeleteLeadUnprocessableEntity {
|
||||
return &DeleteLeadUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*DeleteLeadUnprocessableEntity handles this case with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type DeleteLeadUnprocessableEntity struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *DeleteLeadUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[DELETE /leads][%d] deleteLeadUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteLeadUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *DeleteLeadUnprocessableEntity) 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
|
||||
}
|
||||
|
||||
// NewDeleteLeadInternalServerError creates a DeleteLeadInternalServerError with default headers values
|
||||
func NewDeleteLeadInternalServerError() *DeleteLeadInternalServerError {
|
||||
return &DeleteLeadInternalServerError{}
|
||||
}
|
||||
|
||||
/*DeleteLeadInternalServerError handles this case with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type DeleteLeadInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *DeleteLeadInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[DELETE /leads][%d] deleteLeadInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteLeadInternalServerError) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *DeleteLeadInternalServerError) 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,214 @@
|
|||
// 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 leads
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewGetLeadsObservableParams creates a new GetLeadsObservableParams object
|
||||
// with the default values initialized.
|
||||
func NewGetLeadsObservableParams() *GetLeadsObservableParams {
|
||||
var ()
|
||||
return &GetLeadsObservableParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetLeadsObservableParamsWithTimeout creates a new GetLeadsObservableParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewGetLeadsObservableParamsWithTimeout(timeout time.Duration) *GetLeadsObservableParams {
|
||||
var ()
|
||||
return &GetLeadsObservableParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetLeadsObservableParamsWithContext creates a new GetLeadsObservableParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewGetLeadsObservableParamsWithContext(ctx context.Context) *GetLeadsObservableParams {
|
||||
var ()
|
||||
return &GetLeadsObservableParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetLeadsObservableParamsWithHTTPClient creates a new GetLeadsObservableParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewGetLeadsObservableParamsWithHTTPClient(client *http.Client) *GetLeadsObservableParams {
|
||||
var ()
|
||||
return &GetLeadsObservableParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*GetLeadsObservableParams contains all the parameters to send to the API endpoint
|
||||
for the get leads observable operation typically these are written to a http.Request
|
||||
*/
|
||||
type GetLeadsObservableParams struct {
|
||||
|
||||
/*Email
|
||||
Email address used for identity lookup
|
||||
|
||||
*/
|
||||
Email *string
|
||||
/*LeadID
|
||||
Taxnexus Lead record ID
|
||||
|
||||
*/
|
||||
LeadID *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 leads observable params
|
||||
func (o *GetLeadsObservableParams) WithTimeout(timeout time.Duration) *GetLeadsObservableParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get leads observable params
|
||||
func (o *GetLeadsObservableParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get leads observable params
|
||||
func (o *GetLeadsObservableParams) WithContext(ctx context.Context) *GetLeadsObservableParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get leads observable params
|
||||
func (o *GetLeadsObservableParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get leads observable params
|
||||
func (o *GetLeadsObservableParams) WithHTTPClient(client *http.Client) *GetLeadsObservableParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get leads observable params
|
||||
func (o *GetLeadsObservableParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithEmail adds the email to the get leads observable params
|
||||
func (o *GetLeadsObservableParams) WithEmail(email *string) *GetLeadsObservableParams {
|
||||
o.SetEmail(email)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetEmail adds the email to the get leads observable params
|
||||
func (o *GetLeadsObservableParams) SetEmail(email *string) {
|
||||
o.Email = email
|
||||
}
|
||||
|
||||
// WithLeadID adds the leadID to the get leads observable params
|
||||
func (o *GetLeadsObservableParams) WithLeadID(leadID *string) *GetLeadsObservableParams {
|
||||
o.SetLeadID(leadID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetLeadID adds the leadId to the get leads observable params
|
||||
func (o *GetLeadsObservableParams) SetLeadID(leadID *string) {
|
||||
o.LeadID = leadID
|
||||
}
|
||||
|
||||
// WithName adds the name to the get leads observable params
|
||||
func (o *GetLeadsObservableParams) WithName(name *string) *GetLeadsObservableParams {
|
||||
o.SetName(name)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetName adds the name to the get leads observable params
|
||||
func (o *GetLeadsObservableParams) SetName(name *string) {
|
||||
o.Name = name
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetLeadsObservableParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
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.LeadID != nil {
|
||||
|
||||
// query param leadId
|
||||
var qrLeadID string
|
||||
if o.LeadID != nil {
|
||||
qrLeadID = *o.LeadID
|
||||
}
|
||||
qLeadID := qrLeadID
|
||||
if qLeadID != "" {
|
||||
if err := r.SetQueryParam("leadId", qLeadID); 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 leads
|
||||
|
||||
// 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/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// GetLeadsObservableReader is a Reader for the GetLeadsObservable structure.
|
||||
type GetLeadsObservableReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetLeadsObservableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetLeadsObservableOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewGetLeadsObservableUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewGetLeadsObservableForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewGetLeadsObservableNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewGetLeadsObservableUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewGetLeadsObservableInternalServerError()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetLeadsObservableOK creates a GetLeadsObservableOK with default headers values
|
||||
func NewGetLeadsObservableOK() *GetLeadsObservableOK {
|
||||
return &GetLeadsObservableOK{}
|
||||
}
|
||||
|
||||
/*GetLeadsObservableOK handles this case with default header values.
|
||||
|
||||
Taxnexus Response with an array of Lead objects
|
||||
*/
|
||||
type GetLeadsObservableOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
CacheControl string
|
||||
|
||||
Payload []*crm_models.Lead
|
||||
}
|
||||
|
||||
func (o *GetLeadsObservableOK) Error() string {
|
||||
return fmt.Sprintf("[GET /leads/observable][%d] getLeadsObservableOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetLeadsObservableOK) GetPayload() []*crm_models.Lead {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetLeadsObservableOK) 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
|
||||
}
|
||||
|
||||
// NewGetLeadsObservableUnauthorized creates a GetLeadsObservableUnauthorized with default headers values
|
||||
func NewGetLeadsObservableUnauthorized() *GetLeadsObservableUnauthorized {
|
||||
return &GetLeadsObservableUnauthorized{}
|
||||
}
|
||||
|
||||
/*GetLeadsObservableUnauthorized handles this case with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type GetLeadsObservableUnauthorized struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *GetLeadsObservableUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /leads/observable][%d] getLeadsObservableUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetLeadsObservableUnauthorized) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetLeadsObservableUnauthorized) 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
|
||||
}
|
||||
|
||||
// NewGetLeadsObservableForbidden creates a GetLeadsObservableForbidden with default headers values
|
||||
func NewGetLeadsObservableForbidden() *GetLeadsObservableForbidden {
|
||||
return &GetLeadsObservableForbidden{}
|
||||
}
|
||||
|
||||
/*GetLeadsObservableForbidden handles this case with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type GetLeadsObservableForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *GetLeadsObservableForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /leads/observable][%d] getLeadsObservableForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetLeadsObservableForbidden) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetLeadsObservableForbidden) 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
|
||||
}
|
||||
|
||||
// NewGetLeadsObservableNotFound creates a GetLeadsObservableNotFound with default headers values
|
||||
func NewGetLeadsObservableNotFound() *GetLeadsObservableNotFound {
|
||||
return &GetLeadsObservableNotFound{}
|
||||
}
|
||||
|
||||
/*GetLeadsObservableNotFound handles this case with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type GetLeadsObservableNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *GetLeadsObservableNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /leads/observable][%d] getLeadsObservableNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetLeadsObservableNotFound) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetLeadsObservableNotFound) 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
|
||||
}
|
||||
|
||||
// NewGetLeadsObservableUnprocessableEntity creates a GetLeadsObservableUnprocessableEntity with default headers values
|
||||
func NewGetLeadsObservableUnprocessableEntity() *GetLeadsObservableUnprocessableEntity {
|
||||
return &GetLeadsObservableUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*GetLeadsObservableUnprocessableEntity handles this case with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type GetLeadsObservableUnprocessableEntity struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *GetLeadsObservableUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[GET /leads/observable][%d] getLeadsObservableUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetLeadsObservableUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetLeadsObservableUnprocessableEntity) 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
|
||||
}
|
||||
|
||||
// NewGetLeadsObservableInternalServerError creates a GetLeadsObservableInternalServerError with default headers values
|
||||
func NewGetLeadsObservableInternalServerError() *GetLeadsObservableInternalServerError {
|
||||
return &GetLeadsObservableInternalServerError{}
|
||||
}
|
||||
|
||||
/*GetLeadsObservableInternalServerError handles this case with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type GetLeadsObservableInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *GetLeadsObservableInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /leads/observable][%d] getLeadsObservableInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetLeadsObservableInternalServerError) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetLeadsObservableInternalServerError) 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,279 @@
|
|||
// 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 leads
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewGetLeadsParams creates a new GetLeadsParams object
|
||||
// with the default values initialized.
|
||||
func NewGetLeadsParams() *GetLeadsParams {
|
||||
var ()
|
||||
return &GetLeadsParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetLeadsParamsWithTimeout creates a new GetLeadsParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewGetLeadsParamsWithTimeout(timeout time.Duration) *GetLeadsParams {
|
||||
var ()
|
||||
return &GetLeadsParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetLeadsParamsWithContext creates a new GetLeadsParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewGetLeadsParamsWithContext(ctx context.Context) *GetLeadsParams {
|
||||
var ()
|
||||
return &GetLeadsParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetLeadsParamsWithHTTPClient creates a new GetLeadsParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewGetLeadsParamsWithHTTPClient(client *http.Client) *GetLeadsParams {
|
||||
var ()
|
||||
return &GetLeadsParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*GetLeadsParams contains all the parameters to send to the API endpoint
|
||||
for the get leads operation typically these are written to a http.Request
|
||||
*/
|
||||
type GetLeadsParams struct {
|
||||
|
||||
/*Email
|
||||
Email address used for identity lookup
|
||||
|
||||
*/
|
||||
Email *string
|
||||
/*LeadID
|
||||
Taxnexus Lead record ID
|
||||
|
||||
*/
|
||||
LeadID *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 leads params
|
||||
func (o *GetLeadsParams) WithTimeout(timeout time.Duration) *GetLeadsParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get leads params
|
||||
func (o *GetLeadsParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get leads params
|
||||
func (o *GetLeadsParams) WithContext(ctx context.Context) *GetLeadsParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get leads params
|
||||
func (o *GetLeadsParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get leads params
|
||||
func (o *GetLeadsParams) WithHTTPClient(client *http.Client) *GetLeadsParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get leads params
|
||||
func (o *GetLeadsParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithEmail adds the email to the get leads params
|
||||
func (o *GetLeadsParams) WithEmail(email *string) *GetLeadsParams {
|
||||
o.SetEmail(email)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetEmail adds the email to the get leads params
|
||||
func (o *GetLeadsParams) SetEmail(email *string) {
|
||||
o.Email = email
|
||||
}
|
||||
|
||||
// WithLeadID adds the leadID to the get leads params
|
||||
func (o *GetLeadsParams) WithLeadID(leadID *string) *GetLeadsParams {
|
||||
o.SetLeadID(leadID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetLeadID adds the leadId to the get leads params
|
||||
func (o *GetLeadsParams) SetLeadID(leadID *string) {
|
||||
o.LeadID = leadID
|
||||
}
|
||||
|
||||
// WithLimit adds the limit to the get leads params
|
||||
func (o *GetLeadsParams) WithLimit(limit *int64) *GetLeadsParams {
|
||||
o.SetLimit(limit)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetLimit adds the limit to the get leads params
|
||||
func (o *GetLeadsParams) SetLimit(limit *int64) {
|
||||
o.Limit = limit
|
||||
}
|
||||
|
||||
// WithName adds the name to the get leads params
|
||||
func (o *GetLeadsParams) WithName(name *string) *GetLeadsParams {
|
||||
o.SetName(name)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetName adds the name to the get leads params
|
||||
func (o *GetLeadsParams) SetName(name *string) {
|
||||
o.Name = name
|
||||
}
|
||||
|
||||
// WithOffset adds the offset to the get leads params
|
||||
func (o *GetLeadsParams) WithOffset(offset *int64) *GetLeadsParams {
|
||||
o.SetOffset(offset)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetOffset adds the offset to the get leads params
|
||||
func (o *GetLeadsParams) SetOffset(offset *int64) {
|
||||
o.Offset = offset
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetLeadsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
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.LeadID != nil {
|
||||
|
||||
// query param leadId
|
||||
var qrLeadID string
|
||||
if o.LeadID != nil {
|
||||
qrLeadID = *o.LeadID
|
||||
}
|
||||
qLeadID := qrLeadID
|
||||
if qLeadID != "" {
|
||||
if err := r.SetQueryParam("leadId", qLeadID); 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 leads
|
||||
|
||||
// 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/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// GetLeadsReader is a Reader for the GetLeads structure.
|
||||
type GetLeadsReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetLeadsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetLeadsOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewGetLeadsUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewGetLeadsForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewGetLeadsNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewGetLeadsUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewGetLeadsInternalServerError()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetLeadsOK creates a GetLeadsOK with default headers values
|
||||
func NewGetLeadsOK() *GetLeadsOK {
|
||||
return &GetLeadsOK{}
|
||||
}
|
||||
|
||||
/*GetLeadsOK handles this case with default header values.
|
||||
|
||||
Taxnexus Response with an array of Lead objects
|
||||
*/
|
||||
type GetLeadsOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
CacheControl string
|
||||
|
||||
Payload *crm_models.LeadResponse
|
||||
}
|
||||
|
||||
func (o *GetLeadsOK) Error() string {
|
||||
return fmt.Sprintf("[GET /leads][%d] getLeadsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetLeadsOK) GetPayload() *crm_models.LeadResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetLeadsOK) 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.LeadResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetLeadsUnauthorized creates a GetLeadsUnauthorized with default headers values
|
||||
func NewGetLeadsUnauthorized() *GetLeadsUnauthorized {
|
||||
return &GetLeadsUnauthorized{}
|
||||
}
|
||||
|
||||
/*GetLeadsUnauthorized handles this case with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type GetLeadsUnauthorized struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *GetLeadsUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /leads][%d] getLeadsUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetLeadsUnauthorized) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetLeadsUnauthorized) 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
|
||||
}
|
||||
|
||||
// NewGetLeadsForbidden creates a GetLeadsForbidden with default headers values
|
||||
func NewGetLeadsForbidden() *GetLeadsForbidden {
|
||||
return &GetLeadsForbidden{}
|
||||
}
|
||||
|
||||
/*GetLeadsForbidden handles this case with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type GetLeadsForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *GetLeadsForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /leads][%d] getLeadsForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetLeadsForbidden) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetLeadsForbidden) 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
|
||||
}
|
||||
|
||||
// NewGetLeadsNotFound creates a GetLeadsNotFound with default headers values
|
||||
func NewGetLeadsNotFound() *GetLeadsNotFound {
|
||||
return &GetLeadsNotFound{}
|
||||
}
|
||||
|
||||
/*GetLeadsNotFound handles this case with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type GetLeadsNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *GetLeadsNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /leads][%d] getLeadsNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetLeadsNotFound) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetLeadsNotFound) 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
|
||||
}
|
||||
|
||||
// NewGetLeadsUnprocessableEntity creates a GetLeadsUnprocessableEntity with default headers values
|
||||
func NewGetLeadsUnprocessableEntity() *GetLeadsUnprocessableEntity {
|
||||
return &GetLeadsUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*GetLeadsUnprocessableEntity handles this case with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type GetLeadsUnprocessableEntity struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *GetLeadsUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[GET /leads][%d] getLeadsUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetLeadsUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetLeadsUnprocessableEntity) 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
|
||||
}
|
||||
|
||||
// NewGetLeadsInternalServerError creates a GetLeadsInternalServerError with default headers values
|
||||
func NewGetLeadsInternalServerError() *GetLeadsInternalServerError {
|
||||
return &GetLeadsInternalServerError{}
|
||||
}
|
||||
|
||||
/*GetLeadsInternalServerError handles this case with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type GetLeadsInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *GetLeadsInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /leads][%d] getLeadsInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetLeadsInternalServerError) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetLeadsInternalServerError) 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 leads
|
||||
|
||||
// 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 leads API client.
|
||||
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
|
||||
return &Client{transport: transport, formats: formats}
|
||||
}
|
||||
|
||||
/*
|
||||
Client for leads API
|
||||
*/
|
||||
type Client struct {
|
||||
transport runtime.ClientTransport
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ClientService is the interface for Client methods
|
||||
type ClientService interface {
|
||||
DeleteLead(params *DeleteLeadParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteLeadOK, error)
|
||||
|
||||
GetLeads(params *GetLeadsParams, authInfo runtime.ClientAuthInfoWriter) (*GetLeadsOK, error)
|
||||
|
||||
GetLeadsObservable(params *GetLeadsObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetLeadsObservableOK, error)
|
||||
|
||||
PostLeads(params *PostLeadsParams, authInfo runtime.ClientAuthInfoWriter) (*PostLeadsOK, error)
|
||||
|
||||
PutLeads(params *PutLeadsParams, authInfo runtime.ClientAuthInfoWriter) (*PutLeadsOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteLead deletes a contact
|
||||
|
||||
Delete Taxnexus Lead record
|
||||
*/
|
||||
func (a *Client) DeleteLead(params *DeleteLeadParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteLeadOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewDeleteLeadParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "deleteLead",
|
||||
Method: "DELETE",
|
||||
PathPattern: "/leads",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &DeleteLeadReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*DeleteLeadOK)
|
||||
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 deleteLead: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
GetLeads gets a list of contacts
|
||||
|
||||
Return a list of all available Leads
|
||||
*/
|
||||
func (a *Client) GetLeads(params *GetLeadsParams, authInfo runtime.ClientAuthInfoWriter) (*GetLeadsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetLeadsParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "getLeads",
|
||||
Method: "GET",
|
||||
PathPattern: "/leads",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetLeadsReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*GetLeadsOK)
|
||||
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 getLeads: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
GetLeadsObservable gets taxnexus leads in an observable array
|
||||
|
||||
A list of leads in a simple JSON array
|
||||
*/
|
||||
func (a *Client) GetLeadsObservable(params *GetLeadsObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetLeadsObservableOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetLeadsObservableParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "getLeadsObservable",
|
||||
Method: "GET",
|
||||
PathPattern: "/leads/observable",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetLeadsObservableReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*GetLeadsObservableOK)
|
||||
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 getLeadsObservable: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PostLeads adds new leads
|
||||
|
||||
Lead records to be added
|
||||
*/
|
||||
func (a *Client) PostLeads(params *PostLeadsParams, authInfo runtime.ClientAuthInfoWriter) (*PostLeadsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPostLeadsParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "postLeads",
|
||||
Method: "POST",
|
||||
PathPattern: "/leads",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PostLeadsReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*PostLeadsOK)
|
||||
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 postLeads: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PutLeads updates leads
|
||||
|
||||
Update Lead records
|
||||
*/
|
||||
func (a *Client) PutLeads(params *PutLeadsParams, authInfo runtime.ClientAuthInfoWriter) (*PutLeadsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPutLeadsParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "putLeads",
|
||||
Method: "PUT",
|
||||
PathPattern: "/leads",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PutLeadsReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*PutLeadsOK)
|
||||
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 putLeads: 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 leads
|
||||
|
||||
// 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/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// NewPostLeadsParams creates a new PostLeadsParams object
|
||||
// with the default values initialized.
|
||||
func NewPostLeadsParams() *PostLeadsParams {
|
||||
var ()
|
||||
return &PostLeadsParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostLeadsParamsWithTimeout creates a new PostLeadsParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewPostLeadsParamsWithTimeout(timeout time.Duration) *PostLeadsParams {
|
||||
var ()
|
||||
return &PostLeadsParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostLeadsParamsWithContext creates a new PostLeadsParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewPostLeadsParamsWithContext(ctx context.Context) *PostLeadsParams {
|
||||
var ()
|
||||
return &PostLeadsParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostLeadsParamsWithHTTPClient creates a new PostLeadsParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewPostLeadsParamsWithHTTPClient(client *http.Client) *PostLeadsParams {
|
||||
var ()
|
||||
return &PostLeadsParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*PostLeadsParams contains all the parameters to send to the API endpoint
|
||||
for the post leads operation typically these are written to a http.Request
|
||||
*/
|
||||
type PostLeadsParams struct {
|
||||
|
||||
/*LeadRequest
|
||||
An array of new Lead records
|
||||
|
||||
*/
|
||||
LeadRequest *crm_models.LeadRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the post leads params
|
||||
func (o *PostLeadsParams) WithTimeout(timeout time.Duration) *PostLeadsParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the post leads params
|
||||
func (o *PostLeadsParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the post leads params
|
||||
func (o *PostLeadsParams) WithContext(ctx context.Context) *PostLeadsParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the post leads params
|
||||
func (o *PostLeadsParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the post leads params
|
||||
func (o *PostLeadsParams) WithHTTPClient(client *http.Client) *PostLeadsParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the post leads params
|
||||
func (o *PostLeadsParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithLeadRequest adds the leadRequest to the post leads params
|
||||
func (o *PostLeadsParams) WithLeadRequest(leadRequest *crm_models.LeadRequest) *PostLeadsParams {
|
||||
o.SetLeadRequest(leadRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetLeadRequest adds the leadRequest to the post leads params
|
||||
func (o *PostLeadsParams) SetLeadRequest(leadRequest *crm_models.LeadRequest) {
|
||||
o.LeadRequest = leadRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PostLeadsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if o.LeadRequest != nil {
|
||||
if err := r.SetBodyParam(o.LeadRequest); 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 leads
|
||||
|
||||
// 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/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// PostLeadsReader is a Reader for the PostLeads structure.
|
||||
type PostLeadsReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PostLeadsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPostLeadsOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewPostLeadsUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewPostLeadsForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewPostLeadsNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewPostLeadsUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewPostLeadsInternalServerError()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostLeadsOK creates a PostLeadsOK with default headers values
|
||||
func NewPostLeadsOK() *PostLeadsOK {
|
||||
return &PostLeadsOK{}
|
||||
}
|
||||
|
||||
/*PostLeadsOK handles this case with default header values.
|
||||
|
||||
Taxnexus Response with an array of Lead objects
|
||||
*/
|
||||
type PostLeadsOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
CacheControl string
|
||||
|
||||
Payload *crm_models.LeadResponse
|
||||
}
|
||||
|
||||
func (o *PostLeadsOK) Error() string {
|
||||
return fmt.Sprintf("[POST /leads][%d] postLeadsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostLeadsOK) GetPayload() *crm_models.LeadResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostLeadsOK) 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.LeadResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostLeadsUnauthorized creates a PostLeadsUnauthorized with default headers values
|
||||
func NewPostLeadsUnauthorized() *PostLeadsUnauthorized {
|
||||
return &PostLeadsUnauthorized{}
|
||||
}
|
||||
|
||||
/*PostLeadsUnauthorized handles this case with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type PostLeadsUnauthorized struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *PostLeadsUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[POST /leads][%d] postLeadsUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostLeadsUnauthorized) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostLeadsUnauthorized) 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
|
||||
}
|
||||
|
||||
// NewPostLeadsForbidden creates a PostLeadsForbidden with default headers values
|
||||
func NewPostLeadsForbidden() *PostLeadsForbidden {
|
||||
return &PostLeadsForbidden{}
|
||||
}
|
||||
|
||||
/*PostLeadsForbidden handles this case with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type PostLeadsForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *PostLeadsForbidden) Error() string {
|
||||
return fmt.Sprintf("[POST /leads][%d] postLeadsForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostLeadsForbidden) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostLeadsForbidden) 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
|
||||
}
|
||||
|
||||
// NewPostLeadsNotFound creates a PostLeadsNotFound with default headers values
|
||||
func NewPostLeadsNotFound() *PostLeadsNotFound {
|
||||
return &PostLeadsNotFound{}
|
||||
}
|
||||
|
||||
/*PostLeadsNotFound handles this case with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type PostLeadsNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *PostLeadsNotFound) Error() string {
|
||||
return fmt.Sprintf("[POST /leads][%d] postLeadsNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostLeadsNotFound) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostLeadsNotFound) 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
|
||||
}
|
||||
|
||||
// NewPostLeadsUnprocessableEntity creates a PostLeadsUnprocessableEntity with default headers values
|
||||
func NewPostLeadsUnprocessableEntity() *PostLeadsUnprocessableEntity {
|
||||
return &PostLeadsUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*PostLeadsUnprocessableEntity handles this case with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type PostLeadsUnprocessableEntity struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *PostLeadsUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[POST /leads][%d] postLeadsUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostLeadsUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostLeadsUnprocessableEntity) 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
|
||||
}
|
||||
|
||||
// NewPostLeadsInternalServerError creates a PostLeadsInternalServerError with default headers values
|
||||
func NewPostLeadsInternalServerError() *PostLeadsInternalServerError {
|
||||
return &PostLeadsInternalServerError{}
|
||||
}
|
||||
|
||||
/*PostLeadsInternalServerError handles this case with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type PostLeadsInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *PostLeadsInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[POST /leads][%d] postLeadsInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostLeadsInternalServerError) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostLeadsInternalServerError) 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 leads
|
||||
|
||||
// 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/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// NewPutLeadsParams creates a new PutLeadsParams object
|
||||
// with the default values initialized.
|
||||
func NewPutLeadsParams() *PutLeadsParams {
|
||||
var ()
|
||||
return &PutLeadsParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPutLeadsParamsWithTimeout creates a new PutLeadsParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewPutLeadsParamsWithTimeout(timeout time.Duration) *PutLeadsParams {
|
||||
var ()
|
||||
return &PutLeadsParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPutLeadsParamsWithContext creates a new PutLeadsParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewPutLeadsParamsWithContext(ctx context.Context) *PutLeadsParams {
|
||||
var ()
|
||||
return &PutLeadsParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPutLeadsParamsWithHTTPClient creates a new PutLeadsParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewPutLeadsParamsWithHTTPClient(client *http.Client) *PutLeadsParams {
|
||||
var ()
|
||||
return &PutLeadsParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*PutLeadsParams contains all the parameters to send to the API endpoint
|
||||
for the put leads operation typically these are written to a http.Request
|
||||
*/
|
||||
type PutLeadsParams struct {
|
||||
|
||||
/*LeadRequest
|
||||
An array of new Lead records
|
||||
|
||||
*/
|
||||
LeadRequest *crm_models.LeadRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the put leads params
|
||||
func (o *PutLeadsParams) WithTimeout(timeout time.Duration) *PutLeadsParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the put leads params
|
||||
func (o *PutLeadsParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the put leads params
|
||||
func (o *PutLeadsParams) WithContext(ctx context.Context) *PutLeadsParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the put leads params
|
||||
func (o *PutLeadsParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the put leads params
|
||||
func (o *PutLeadsParams) WithHTTPClient(client *http.Client) *PutLeadsParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the put leads params
|
||||
func (o *PutLeadsParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithLeadRequest adds the leadRequest to the put leads params
|
||||
func (o *PutLeadsParams) WithLeadRequest(leadRequest *crm_models.LeadRequest) *PutLeadsParams {
|
||||
o.SetLeadRequest(leadRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetLeadRequest adds the leadRequest to the put leads params
|
||||
func (o *PutLeadsParams) SetLeadRequest(leadRequest *crm_models.LeadRequest) {
|
||||
o.LeadRequest = leadRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PutLeadsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if o.LeadRequest != nil {
|
||||
if err := r.SetBodyParam(o.LeadRequest); 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 leads
|
||||
|
||||
// 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/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// PutLeadsReader is a Reader for the PutLeads structure.
|
||||
type PutLeadsReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PutLeadsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPutLeadsOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewPutLeadsUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewPutLeadsForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewPutLeadsNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewPutLeadsUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewPutLeadsInternalServerError()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPutLeadsOK creates a PutLeadsOK with default headers values
|
||||
func NewPutLeadsOK() *PutLeadsOK {
|
||||
return &PutLeadsOK{}
|
||||
}
|
||||
|
||||
/*PutLeadsOK handles this case with default header values.
|
||||
|
||||
Taxnexus Response with an array of Lead objects
|
||||
*/
|
||||
type PutLeadsOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
CacheControl string
|
||||
|
||||
Payload *crm_models.LeadResponse
|
||||
}
|
||||
|
||||
func (o *PutLeadsOK) Error() string {
|
||||
return fmt.Sprintf("[PUT /leads][%d] putLeadsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutLeadsOK) GetPayload() *crm_models.LeadResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutLeadsOK) 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.LeadResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPutLeadsUnauthorized creates a PutLeadsUnauthorized with default headers values
|
||||
func NewPutLeadsUnauthorized() *PutLeadsUnauthorized {
|
||||
return &PutLeadsUnauthorized{}
|
||||
}
|
||||
|
||||
/*PutLeadsUnauthorized handles this case with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type PutLeadsUnauthorized struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *PutLeadsUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[PUT /leads][%d] putLeadsUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutLeadsUnauthorized) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutLeadsUnauthorized) 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
|
||||
}
|
||||
|
||||
// NewPutLeadsForbidden creates a PutLeadsForbidden with default headers values
|
||||
func NewPutLeadsForbidden() *PutLeadsForbidden {
|
||||
return &PutLeadsForbidden{}
|
||||
}
|
||||
|
||||
/*PutLeadsForbidden handles this case with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type PutLeadsForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *PutLeadsForbidden) Error() string {
|
||||
return fmt.Sprintf("[PUT /leads][%d] putLeadsForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutLeadsForbidden) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutLeadsForbidden) 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
|
||||
}
|
||||
|
||||
// NewPutLeadsNotFound creates a PutLeadsNotFound with default headers values
|
||||
func NewPutLeadsNotFound() *PutLeadsNotFound {
|
||||
return &PutLeadsNotFound{}
|
||||
}
|
||||
|
||||
/*PutLeadsNotFound handles this case with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type PutLeadsNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *PutLeadsNotFound) Error() string {
|
||||
return fmt.Sprintf("[PUT /leads][%d] putLeadsNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutLeadsNotFound) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutLeadsNotFound) 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
|
||||
}
|
||||
|
||||
// NewPutLeadsUnprocessableEntity creates a PutLeadsUnprocessableEntity with default headers values
|
||||
func NewPutLeadsUnprocessableEntity() *PutLeadsUnprocessableEntity {
|
||||
return &PutLeadsUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*PutLeadsUnprocessableEntity handles this case with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type PutLeadsUnprocessableEntity struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *PutLeadsUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[PUT /leads][%d] putLeadsUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutLeadsUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutLeadsUnprocessableEntity) 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
|
||||
}
|
||||
|
||||
// NewPutLeadsInternalServerError creates a PutLeadsInternalServerError with default headers values
|
||||
func NewPutLeadsInternalServerError() *PutLeadsInternalServerError {
|
||||
return &PutLeadsInternalServerError{}
|
||||
}
|
||||
|
||||
/*PutLeadsInternalServerError handles this case with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type PutLeadsInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
func (o *PutLeadsInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[PUT /leads][%d] putLeadsInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutLeadsInternalServerError) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutLeadsInternalServerError) 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,402 @@
|
|||
// 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 crm_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"
|
||||
)
|
||||
|
||||
// Account account
|
||||
//
|
||||
// swagger:model Account
|
||||
type Account struct {
|
||||
|
||||
// Account Number
|
||||
AccountNumber string `json:"AccountNumber,omitempty"`
|
||||
|
||||
// The marketing orgin of this account
|
||||
AccountSource string `json:"AccountSource,omitempty"`
|
||||
|
||||
// Active
|
||||
Active bool `json:"Active,omitempty"`
|
||||
|
||||
// For tax authorities, this account's administrative level, e.g. Local, County, State or Federal
|
||||
AdministrativeLevel string `json:"AdministrativeLevel,omitempty"`
|
||||
|
||||
// Rollup Tax Amount
|
||||
Amount float64 `json:"Amount,omitempty"`
|
||||
|
||||
// Amount Invoiced
|
||||
AmountInvoiced float64 `json:"AmountInvoiced,omitempty"`
|
||||
|
||||
// Amount Paid
|
||||
AmountPaid float64 `json:"AmountPaid,omitempty"`
|
||||
|
||||
// Annual Revenue Estimate
|
||||
AnnualRevenue float64 `json:"AnnualRevenue,omitempty"`
|
||||
|
||||
// Account Balance
|
||||
Balance float64 `json:"Balance,omitempty"`
|
||||
|
||||
// billing address
|
||||
BillingAddress *Address `json:"BillingAddress,omitempty"`
|
||||
|
||||
// Contact ID
|
||||
BillingContactID string `json:"BillingContactID,omitempty"`
|
||||
|
||||
// Billing Preference
|
||||
BillingPreference string `json:"BillingPreference,omitempty"`
|
||||
|
||||
// business address
|
||||
BusinessAddress *Address `json:"BusinessAddress,omitempty"`
|
||||
|
||||
// Is this a cannabis customer?
|
||||
CannabisCustomer bool `json:"CannabisCustomer,omitempty"`
|
||||
|
||||
// Channel Program Level Name
|
||||
ChannelProgramLevelName string `json:"ChannelProgramLevelName,omitempty"`
|
||||
|
||||
// Channel Program Name
|
||||
ChannelProgramName string `json:"ChannelProgramName,omitempty"`
|
||||
|
||||
// Client End Date
|
||||
ClientEndDate string `json:"ClientEndDate,omitempty"`
|
||||
|
||||
// Client Start Date
|
||||
ClientStartDate string `json:"ClientStartDate,omitempty"`
|
||||
|
||||
// The Company ID of this Account
|
||||
CompanyID string `json:"CompanyID,omitempty"`
|
||||
|
||||
// The Id of the geo coordinates of this account
|
||||
CoordinateID string `json:"CoordinateID,omitempty"`
|
||||
|
||||
// Created By User ID
|
||||
CreatedByID string `json:"CreatedByID,omitempty"`
|
||||
|
||||
// Created Date
|
||||
CreatedDate string `json:"CreatedDate,omitempty"`
|
||||
|
||||
// Customer ID from source system
|
||||
CustomerID string `json:"CustomerID,omitempty"`
|
||||
|
||||
// Customer Priority
|
||||
CustomerPriority string `json:"CustomerPriority,omitempty"`
|
||||
|
||||
// This Account's 'Doing Business As' name
|
||||
DBA string `json:"DBA,omitempty"`
|
||||
|
||||
// D-U-N-S Number
|
||||
DUNSNumber string `json:"DUNSNumber,omitempty"`
|
||||
|
||||
// D-n-B Company
|
||||
DandBCompanyID string `json:"DandBCompanyID,omitempty"`
|
||||
|
||||
// default address
|
||||
DefaultAddress *Address `json:"DefaultAddress,omitempty"`
|
||||
|
||||
// Default Backend ID
|
||||
DefaultBackendID string `json:"DefaultBackendID,omitempty"`
|
||||
|
||||
// Default Delivery Address Contact ID
|
||||
DefaultDeliveryContactID string `json:"DefaultDeliveryContactID,omitempty"`
|
||||
|
||||
// Default End User Contact ID
|
||||
DefaultEndUserID string `json:"DefaultEndUserID,omitempty"`
|
||||
|
||||
// Description
|
||||
Description string `json:"Description,omitempty"`
|
||||
|
||||
// EIN
|
||||
EIN string `json:"EIN,omitempty"`
|
||||
|
||||
// Main Account Email
|
||||
Email string `json:"Email,omitempty"`
|
||||
|
||||
// Enrollment Status
|
||||
EnrollmentStatus string `json:"EnrollmentStatus,omitempty"`
|
||||
|
||||
// Fax
|
||||
Fax string `json:"Fax,omitempty"`
|
||||
|
||||
// Taxnexus Account Id
|
||||
ID string `json:"ID,omitempty"`
|
||||
|
||||
// ISP Customer?
|
||||
ISPCustomer bool `json:"ISPCustomer,omitempty"`
|
||||
|
||||
// Industry
|
||||
Industry string `json:"Industry,omitempty"`
|
||||
|
||||
// Customer Portal Account
|
||||
IsCustomerPortal bool `json:"IsCustomerPortal,omitempty"`
|
||||
|
||||
// Partner Account
|
||||
IsPartner bool `json:"IsPartner,omitempty"`
|
||||
|
||||
// Data.com Key
|
||||
JigSaw string `json:"JigSaw,omitempty"`
|
||||
|
||||
// Last Modified By User ID
|
||||
LastModifiedByID string `json:"LastModifiedByID,omitempty"`
|
||||
|
||||
// Last Modified Date
|
||||
LastModifiedDate string `json:"LastModifiedDate,omitempty"`
|
||||
|
||||
// MSP Customer?
|
||||
MSPCustomer bool `json:"MSPCustomer,omitempty"`
|
||||
|
||||
// NAICS Code
|
||||
NAICSCode string `json:"NAICSCode,omitempty"`
|
||||
|
||||
// NAICS Description
|
||||
NAICSDesc string `json:"NAICSDesc,omitempty"`
|
||||
|
||||
// Account Name
|
||||
Name string `json:"Name,omitempty"`
|
||||
|
||||
// Employee Count Estimate
|
||||
NumberOfEmployees int64 `json:"NumberOfEmployees,omitempty"`
|
||||
|
||||
// Number of Locations Estimate
|
||||
NumberOfLocations int64 `json:"NumberOfLocations,omitempty"`
|
||||
|
||||
// Open Charges
|
||||
OpenCharges float64 `json:"OpenCharges,omitempty"`
|
||||
|
||||
// Vendor Order Contact ID
|
||||
OrderContactID string `json:"OrderContactID,omitempty"`
|
||||
|
||||
// Order Email
|
||||
OrderEmail string `json:"OrderEmail,omitempty"`
|
||||
|
||||
// Account Owner User ID
|
||||
OwnerID string `json:"OwnerID,omitempty"`
|
||||
|
||||
// Ownership
|
||||
Ownership string `json:"Ownership,omitempty"`
|
||||
|
||||
// Parent Foreign Key
|
||||
ParentFK string `json:"ParentFK,omitempty"`
|
||||
|
||||
// Parent Account
|
||||
ParentID string `json:"ParentID,omitempty"`
|
||||
|
||||
// Phone
|
||||
Phone string `json:"Phone,omitempty"`
|
||||
|
||||
// The ID of the Place situs record that applies to this Account
|
||||
PlaceID string `json:"PlaceID,omitempty"`
|
||||
|
||||
// Tax Preparer Contact ID
|
||||
PreparerID string `json:"PreparerID,omitempty"`
|
||||
|
||||
// Rating
|
||||
Rating string `json:"Rating,omitempty"`
|
||||
|
||||
// Rating Engine identifier
|
||||
RatingEngineID string `json:"RatingEngineID,omitempty"`
|
||||
|
||||
// External Reference ID
|
||||
Ref string `json:"Ref,omitempty"`
|
||||
|
||||
// Rollup Revenue Base
|
||||
RevenueBase float64 `json:"RevenueBase,omitempty"`
|
||||
|
||||
// Rollup Revenue Net
|
||||
RevenueNet float64 `json:"RevenueNet,omitempty"`
|
||||
|
||||
// Rollup Revenue Not Taxable
|
||||
RevenueNotTaxable float64 `json:"RevenueNotTaxable,omitempty"`
|
||||
|
||||
// SIC Code
|
||||
SIC string `json:"SIC,omitempty"`
|
||||
|
||||
// SIC Description
|
||||
SICDesc string `json:"SICDesc,omitempty"`
|
||||
|
||||
// shipping address
|
||||
ShippingAddress *Address `json:"ShippingAddress,omitempty"`
|
||||
|
||||
// Shipping Census Tract
|
||||
ShippingCensusTract string `json:"ShippingCensusTract,omitempty"`
|
||||
|
||||
// Shipping Contact ID
|
||||
ShippingConactID string `json:"ShippingConactID,omitempty"`
|
||||
|
||||
// Shipping County
|
||||
ShippingCounty string `json:"ShippingCounty,omitempty"`
|
||||
|
||||
// Account Site
|
||||
Site string `json:"Site,omitempty"`
|
||||
|
||||
// Account Status
|
||||
Status string `json:"Status,omitempty"`
|
||||
|
||||
// Tax Exemption
|
||||
TaxExemption string `json:"TaxExemption,omitempty"`
|
||||
|
||||
// Rollup Tax On Tax
|
||||
TaxOnTax float64 `json:"TaxOnTax,omitempty"`
|
||||
|
||||
// Telecom Customer?
|
||||
TelecomCustomer bool `json:"TelecomCustomer,omitempty"`
|
||||
|
||||
// Tenant Identifier
|
||||
TenantID string `json:"TenantID,omitempty"`
|
||||
|
||||
// Ticker Symbol
|
||||
TickerSymbol string `json:"TickerSymbol,omitempty"`
|
||||
|
||||
// Tradestyle
|
||||
TradeStyle string `json:"TradeStyle,omitempty"`
|
||||
|
||||
// Type
|
||||
Type string `json:"Type,omitempty"`
|
||||
|
||||
// Unapplied Payments
|
||||
UnappliedPayments float64 `json:"UnappliedPayments,omitempty"`
|
||||
|
||||
// Rollup Unit Base
|
||||
UnitBase float64 `json:"UnitBase,omitempty"`
|
||||
|
||||
// Upsell Opportunity
|
||||
UpsellOpportunity string `json:"UpsellOpportunity,omitempty"`
|
||||
|
||||
// WHMCS Client ID
|
||||
WHMCSClientID int64 `json:"WHMCSClientID,omitempty"`
|
||||
|
||||
// Website
|
||||
Website string `json:"Website,omitempty"`
|
||||
|
||||
// Xero Contact ID
|
||||
XeroContactID string `json:"XeroContactID,omitempty"`
|
||||
|
||||
// Year Started
|
||||
YearStarted string `json:"YearStarted,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this account
|
||||
func (m *Account) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateBillingAddress(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateBusinessAddress(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateDefaultAddress(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateShippingAddress(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Account) validateBillingAddress(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.BillingAddress) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.BillingAddress != nil {
|
||||
if err := m.BillingAddress.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("BillingAddress")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Account) validateBusinessAddress(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.BusinessAddress) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.BusinessAddress != nil {
|
||||
if err := m.BusinessAddress.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("BusinessAddress")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Account) validateDefaultAddress(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.DefaultAddress) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.DefaultAddress != nil {
|
||||
if err := m.DefaultAddress.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("DefaultAddress")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Account) validateShippingAddress(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.ShippingAddress) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.ShippingAddress != nil {
|
||||
if err := m.ShippingAddress.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("ShippingAddress")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *Account) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *Account) UnmarshalBinary(b []byte) error {
|
||||
var res Account
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,188 @@
|
|||
// 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 crm_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"
|
||||
)
|
||||
|
||||
// AccountBasic account basic
|
||||
//
|
||||
// swagger:model AccountBasic
|
||||
type AccountBasic struct {
|
||||
|
||||
// Taxnexus Account Number of the OEM/Reseller
|
||||
AccountNumber string `json:"AccountNumber,omitempty"`
|
||||
|
||||
// billing address
|
||||
BillingAddress *Address `json:"BillingAddress,omitempty"`
|
||||
|
||||
// Contact ID
|
||||
BillingContactID string `json:"BillingContactID,omitempty"`
|
||||
|
||||
// Taxnexus OEM/Reseller Record Id
|
||||
CompanyID string `json:"CompanyID,omitempty"`
|
||||
|
||||
// The id of the Coordinate of the business establishment
|
||||
CoordinateID string `json:"CoordinateID,omitempty"`
|
||||
|
||||
// Taxpayer Customer Id designated by OEM/Reseller
|
||||
CustomerID string `json:"CustomerID,omitempty"`
|
||||
|
||||
// default address
|
||||
DefaultAddress *Address `json:"DefaultAddress,omitempty"`
|
||||
|
||||
// Default Backend ID
|
||||
DefaultBackendID string `json:"DefaultBackendID,omitempty"`
|
||||
|
||||
// Default Delivery Address Contact ID
|
||||
DefaultDeliveryContactID string `json:"DefaultDeliveryContactID,omitempty"`
|
||||
|
||||
// Contact ID
|
||||
DefaultEndUserID string `json:"DefaultEndUserID,omitempty"`
|
||||
|
||||
// Taxpayer Public Email Address
|
||||
Email string `json:"Email,omitempty"`
|
||||
|
||||
// Taxpayer Fax Number
|
||||
Fax string `json:"Fax,omitempty"`
|
||||
|
||||
// Taxpayer Account Record Id
|
||||
ID string `json:"ID,omitempty"`
|
||||
|
||||
// Taxpayer Account Name (ignored for Tax Processing)
|
||||
Name string `json:"Name,omitempty"`
|
||||
|
||||
// UUID Reference the master record that owns this item
|
||||
ParentFK string `json:"ParentFK,omitempty"`
|
||||
|
||||
// Taxpayer Public Phone Number
|
||||
Phone string `json:"Phone,omitempty"`
|
||||
|
||||
// Contact ID
|
||||
PreparerID string `json:"PreparerID,omitempty"`
|
||||
|
||||
// Source System identifier for this record, if any
|
||||
Ref string `json:"Ref,omitempty"`
|
||||
|
||||
// Shipping Address
|
||||
ShippingAddress *Address `json:"ShippingAddress,omitempty"`
|
||||
|
||||
// Contact ID
|
||||
ShippingConactID string `json:"ShippingConactID,omitempty"`
|
||||
|
||||
// Taxpayer Location Designation
|
||||
Site string `json:"Site,omitempty"`
|
||||
|
||||
// Tenant Identifier
|
||||
TenantID string `json:"TenantID,omitempty"`
|
||||
|
||||
// Account Type
|
||||
Type string `json:"Type,omitempty"`
|
||||
|
||||
// Taxpayer Website
|
||||
Website string `json:"Website,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this account basic
|
||||
func (m *AccountBasic) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateBillingAddress(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateDefaultAddress(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateShippingAddress(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *AccountBasic) validateBillingAddress(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.BillingAddress) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.BillingAddress != nil {
|
||||
if err := m.BillingAddress.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("BillingAddress")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *AccountBasic) validateDefaultAddress(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.DefaultAddress) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.DefaultAddress != nil {
|
||||
if err := m.DefaultAddress.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("DefaultAddress")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *AccountBasic) validateShippingAddress(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.ShippingAddress) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.ShippingAddress != nil {
|
||||
if err := m.ShippingAddress.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("ShippingAddress")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *AccountBasic) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *AccountBasic) UnmarshalBinary(b []byte) error {
|
||||
var res AccountBasic
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,109 @@
|
|||
// 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 crm_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"
|
||||
)
|
||||
|
||||
// AccountBasicResponse account basic response
|
||||
//
|
||||
// swagger:model AccountBasicResponse
|
||||
type AccountBasicResponse struct {
|
||||
|
||||
// data
|
||||
Data []*AccountBasic `json:"Data"`
|
||||
|
||||
// meta
|
||||
Meta *ResponseMeta `json:"Meta,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this account basic response
|
||||
func (m *AccountBasicResponse) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateData(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateMeta(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *AccountBasicResponse) validateData(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Data) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Data); i++ {
|
||||
if swag.IsZero(m.Data[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Data[i] != nil {
|
||||
if err := m.Data[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *AccountBasicResponse) validateMeta(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Meta) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.Meta != nil {
|
||||
if err := m.Meta.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("Meta")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *AccountBasicResponse) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *AccountBasicResponse) UnmarshalBinary(b []byte) error {
|
||||
var res AccountBasicResponse
|
||||
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 crm_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"
|
||||
)
|
||||
|
||||
// AccountRequest An array of Account objects with Contacts
|
||||
//
|
||||
// swagger:model AccountRequest
|
||||
type AccountRequest struct {
|
||||
|
||||
// data
|
||||
Data []*Account `json:"Data"`
|
||||
}
|
||||
|
||||
// Validate validates this account request
|
||||
func (m *AccountRequest) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateData(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *AccountRequest) validateData(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Data) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Data); i++ {
|
||||
if swag.IsZero(m.Data[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Data[i] != nil {
|
||||
if err := m.Data[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *AccountRequest) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *AccountRequest) UnmarshalBinary(b []byte) error {
|
||||
var res AccountRequest
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,109 @@
|
|||
// 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 crm_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"
|
||||
)
|
||||
|
||||
// AccountResponse An array of Account objects with Contacts
|
||||
//
|
||||
// swagger:model AccountResponse
|
||||
type AccountResponse struct {
|
||||
|
||||
// data
|
||||
Data []*Account `json:"Data"`
|
||||
|
||||
// meta
|
||||
Meta *ResponseMeta `json:"Meta,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this account response
|
||||
func (m *AccountResponse) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateData(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateMeta(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *AccountResponse) validateData(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Data) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Data); i++ {
|
||||
if swag.IsZero(m.Data[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Data[i] != nil {
|
||||
if err := m.Data[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *AccountResponse) validateMeta(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Meta) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.Meta != nil {
|
||||
if err := m.Meta.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("Meta")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *AccountResponse) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *AccountResponse) UnmarshalBinary(b []byte) error {
|
||||
var res AccountResponse
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
// 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 crm_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"
|
||||
)
|
||||
|
||||
// Address address
|
||||
//
|
||||
// swagger:model Address
|
||||
type Address struct {
|
||||
|
||||
// City
|
||||
City string `json:"City,omitempty"`
|
||||
|
||||
// Country full name
|
||||
Country string `json:"Country,omitempty"`
|
||||
|
||||
// Country Code
|
||||
CountryCode string `json:"CountryCode,omitempty"`
|
||||
|
||||
// Postal Code
|
||||
PostalCode string `json:"PostalCode,omitempty"`
|
||||
|
||||
// State full name
|
||||
State string `json:"State,omitempty"`
|
||||
|
||||
// State Code
|
||||
StateCode string `json:"StateCode,omitempty"`
|
||||
|
||||
// Street number and name
|
||||
Street string `json:"Street,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this address
|
||||
func (m *Address) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *Address) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *Address) UnmarshalBinary(b []byte) error {
|
||||
var res Address
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,202 @@
|
|||
// 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 crm_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"
|
||||
)
|
||||
|
||||
// Company company
|
||||
//
|
||||
// swagger:model Company
|
||||
type Company struct {
|
||||
|
||||
// Taxnexus ID of the Account that owns this Company
|
||||
AccountID string `json:"AccountID,omitempty"`
|
||||
|
||||
// Account Number Prefix
|
||||
AccountNumberPrefix string `json:"AccountNumberPrefix,omitempty"`
|
||||
|
||||
// billing address
|
||||
BillingAddress *Address `json:"BillingAddress,omitempty"`
|
||||
|
||||
// Billing Advice
|
||||
BillingAdvice string `json:"BillingAdvice,omitempty"`
|
||||
|
||||
// Contact ID
|
||||
BillingContactID string `json:"BillingContactID,omitempty"`
|
||||
|
||||
// Billing Email
|
||||
BillingEmail string `json:"BillingEmail,omitempty"`
|
||||
|
||||
// Billing Phone
|
||||
BillingPhone string `json:"BillingPhone,omitempty"`
|
||||
|
||||
// Billing Website
|
||||
BillingWebsite string `json:"BillingWebsite,omitempty"`
|
||||
|
||||
// Chart of Accounts Template Account ID
|
||||
COATemplateID string `json:"COATemplateID,omitempty"`
|
||||
|
||||
// Color Accent1
|
||||
ColorAccent1 string `json:"ColorAccent1,omitempty"`
|
||||
|
||||
// Color Accent2
|
||||
ColorAccent2 string `json:"ColorAccent2,omitempty"`
|
||||
|
||||
// Color Primary
|
||||
ColorPrimary string `json:"ColorPrimary,omitempty"`
|
||||
|
||||
// Created By User ID
|
||||
CreatedByID string `json:"CreatedByID,omitempty"`
|
||||
|
||||
// Created Date
|
||||
CreatedDate string `json:"CreatedDate,omitempty"`
|
||||
|
||||
// User ID of default Customer Success user
|
||||
CustomerSuccessID string `json:"CustomerSuccessID,omitempty"`
|
||||
|
||||
// Date Closed
|
||||
DateClosed string `json:"DateClosed,omitempty"`
|
||||
|
||||
// default address
|
||||
DefaultAddress *Address `json:"DefaultAddress,omitempty"`
|
||||
|
||||
// Default Company?
|
||||
DefaultCompany bool `json:"DefaultCompany,omitempty"`
|
||||
|
||||
// Font Name for Body Text
|
||||
FontBody string `json:"FontBody,omitempty"`
|
||||
|
||||
// Font Name for Heading
|
||||
FontHeading string `json:"FontHeading,omitempty"`
|
||||
|
||||
// Font Name for Heading Narrow
|
||||
FontHeadingNarrow string `json:"FontHeadingNarrow,omitempty"`
|
||||
|
||||
// Font Names for CSS Link
|
||||
FontLink string `json:"FontLink,omitempty"`
|
||||
|
||||
// Font Name for Monospace
|
||||
FontMono string `json:"FontMono,omitempty"`
|
||||
|
||||
// Taxnexus Record Id
|
||||
ID string `json:"ID,omitempty"`
|
||||
|
||||
// International Customers?
|
||||
International bool `json:"International,omitempty"`
|
||||
|
||||
// Last Account Number
|
||||
LastAccountNumber int64 `json:"LastAccountNumber,omitempty"`
|
||||
|
||||
// Last Modified By User ID
|
||||
LastModifiedByID string `json:"LastModifiedByID,omitempty"`
|
||||
|
||||
// Last Modified Date
|
||||
LastModifiedDate string `json:"LastModifiedDate,omitempty"`
|
||||
|
||||
// Last TaxType Number
|
||||
LastTaxTypeNumber int64 `json:"LastTaxTypeNumber,omitempty"`
|
||||
|
||||
// Logo URL
|
||||
Logo string `json:"Logo,omitempty"`
|
||||
|
||||
// Company Name
|
||||
Name string `json:"Name,omitempty"`
|
||||
|
||||
// The ID of the contact who owns this Company
|
||||
OwnerID string `json:"OwnerID,omitempty"`
|
||||
|
||||
// User ID of the default tax preparer
|
||||
PreparerID string `json:"PreparerID,omitempty"`
|
||||
|
||||
// The ID of the default Pricebook for this company
|
||||
PricebookID string `json:"PricebookID,omitempty"`
|
||||
|
||||
// Tenant Identifier
|
||||
TenantID string `json:"TenantID,omitempty"`
|
||||
|
||||
// The ID of the contact who is the User Tech Lead for Company
|
||||
UserTechLeadID string `json:"UserTechLeadID,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this company
|
||||
func (m *Company) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateBillingAddress(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateDefaultAddress(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Company) validateBillingAddress(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.BillingAddress) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.BillingAddress != nil {
|
||||
if err := m.BillingAddress.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("BillingAddress")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Company) validateDefaultAddress(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.DefaultAddress) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.DefaultAddress != nil {
|
||||
if err := m.DefaultAddress.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("DefaultAddress")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *Company) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *Company) UnmarshalBinary(b []byte) error {
|
||||
var res Company
|
||||
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 crm_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"
|
||||
)
|
||||
|
||||
// CompanyRequest An array of Company objects
|
||||
//
|
||||
// swagger:model CompanyRequest
|
||||
type CompanyRequest struct {
|
||||
|
||||
// data
|
||||
Data []*Company `json:"Data"`
|
||||
}
|
||||
|
||||
// Validate validates this company request
|
||||
func (m *CompanyRequest) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateData(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *CompanyRequest) validateData(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Data) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Data); i++ {
|
||||
if swag.IsZero(m.Data[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Data[i] != nil {
|
||||
if err := m.Data[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *CompanyRequest) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *CompanyRequest) UnmarshalBinary(b []byte) error {
|
||||
var res CompanyRequest
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,109 @@
|
|||
// 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 crm_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"
|
||||
)
|
||||
|
||||
// CompanyResponse An array of Company objects
|
||||
//
|
||||
// swagger:model CompanyResponse
|
||||
type CompanyResponse struct {
|
||||
|
||||
// data
|
||||
Data []*Company `json:"Data"`
|
||||
|
||||
// meta
|
||||
Meta *ResponseMeta `json:"Meta,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this company response
|
||||
func (m *CompanyResponse) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateData(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateMeta(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *CompanyResponse) validateData(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Data) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Data); i++ {
|
||||
if swag.IsZero(m.Data[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Data[i] != nil {
|
||||
if err := m.Data[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *CompanyResponse) validateMeta(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Meta) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.Meta != nil {
|
||||
if err := m.Meta.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("Meta")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *CompanyResponse) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *CompanyResponse) UnmarshalBinary(b []byte) error {
|
||||
var res CompanyResponse
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = 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 crm_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"
|
||||
)
|
||||
|
||||
// Contact contact
|
||||
//
|
||||
// swagger:model Contact
|
||||
type Contact struct {
|
||||
|
||||
// The primary account ID of this contact
|
||||
AccountID string `json:"AccountID,omitempty"`
|
||||
|
||||
// Assistant Name
|
||||
AssistantName string `json:"AssistantName,omitempty"`
|
||||
|
||||
// Asst. Phone
|
||||
AssistantPhone string `json:"AssistantPhone,omitempty"`
|
||||
|
||||
// Birthdate
|
||||
BirthDate string `json:"BirthDate,omitempty"`
|
||||
|
||||
// Created By User ID
|
||||
CreatedByID string `json:"CreatedByID,omitempty"`
|
||||
|
||||
// Created Date
|
||||
CreatedDate string `json:"CreatedDate,omitempty"`
|
||||
|
||||
// Department
|
||||
Department string `json:"Department,omitempty"`
|
||||
|
||||
// Description
|
||||
Description string `json:"Description,omitempty"`
|
||||
|
||||
// Do Not Call?
|
||||
DoNotCall bool `json:"DoNotCall,omitempty"`
|
||||
|
||||
// Email address
|
||||
Email string `json:"Email,omitempty"`
|
||||
|
||||
// Email Bounce Date
|
||||
EmailBounceDate string `json:"EmailBounceDate,omitempty"`
|
||||
|
||||
// Email Bounce Reason
|
||||
EmailBouncedReason string `json:"EmailBouncedReason,omitempty"`
|
||||
|
||||
// Taxnexus Enrollment Status
|
||||
EnrollmentStatus string `json:"EnrollmentStatus,omitempty"`
|
||||
|
||||
// Fax Number
|
||||
Fax string `json:"Fax,omitempty"`
|
||||
|
||||
// First Name
|
||||
FirstName string `json:"FirstName,omitempty"`
|
||||
|
||||
// Email Opt Out
|
||||
HasOptedOutOfEmail bool `json:"HasOptedOutOfEmail,omitempty"`
|
||||
|
||||
// Fax Opt Out
|
||||
HasOptedOutOfFax bool `json:"HasOptedOutOfFax,omitempty"`
|
||||
|
||||
// Home Phone
|
||||
HomePhone string `json:"HomePhone,omitempty"`
|
||||
|
||||
// Taxnexus Record Id
|
||||
ID string `json:"ID,omitempty"`
|
||||
|
||||
// Does this contact have bounced emails?
|
||||
IsEmailBounced bool `json:"IsEmailBounced,omitempty"`
|
||||
|
||||
// Is Provisioned?
|
||||
IsProvisioned bool `json:"IsProvisioned,omitempty"`
|
||||
|
||||
// Last Modified By User ID
|
||||
LastModifiedByID string `json:"LastModifiedByID,omitempty"`
|
||||
|
||||
// Last Modified Date
|
||||
LastModifiedDate string `json:"LastModifiedDate,omitempty"`
|
||||
|
||||
// Last Name
|
||||
LastName string `json:"LastName,omitempty"`
|
||||
|
||||
// Lead Source
|
||||
LeadSource string `json:"LeadSource,omitempty"`
|
||||
|
||||
// Level
|
||||
Level string `json:"Level,omitempty"`
|
||||
|
||||
// LinkedIn Page
|
||||
LinkedIn string `json:"LinkedIn,omitempty"`
|
||||
|
||||
// mailing address
|
||||
MailingAddress *Address `json:"MailingAddress,omitempty"`
|
||||
|
||||
// Mailing Lists
|
||||
MailingLists string `json:"MailingLists,omitempty"`
|
||||
|
||||
// Mobile Phone
|
||||
MobilePhone string `json:"MobilePhone,omitempty"`
|
||||
|
||||
// Full Name
|
||||
Name string `json:"Name,omitempty"`
|
||||
|
||||
// other address
|
||||
OtherAddress *Address `json:"OtherAddress,omitempty"`
|
||||
|
||||
// Other Phone
|
||||
OtherPhone string `json:"OtherPhone,omitempty"`
|
||||
|
||||
// The User ID of the user who owns this Contact
|
||||
OwnerID string `json:"OwnerID,omitempty"`
|
||||
|
||||
// Personal Email Address for this Contact
|
||||
PersonalEmail string `json:"PersonalEmail,omitempty"`
|
||||
|
||||
// Phone Number
|
||||
Phone string `json:"Phone,omitempty"`
|
||||
|
||||
// URL of a photograph of this User
|
||||
PhotoURL string `json:"PhotoURL,omitempty"`
|
||||
|
||||
// Recruiting Status
|
||||
RecruitingStatus string `json:"RecruitingStatus,omitempty"`
|
||||
|
||||
// External reference to this contact, if any
|
||||
Ref string `json:"Ref,omitempty"`
|
||||
|
||||
// Reports To Contact ID
|
||||
ReportsToID string `json:"ReportsToID,omitempty"`
|
||||
|
||||
// Contact Salutation
|
||||
Salutation string `json:"Salutation,omitempty"`
|
||||
|
||||
// The Contact Status
|
||||
Status string `json:"Status,omitempty"`
|
||||
|
||||
// Tenant Identifier
|
||||
TenantID string `json:"TenantID,omitempty"`
|
||||
|
||||
// Contact Title
|
||||
Title string `json:"Title,omitempty"`
|
||||
|
||||
// Contact Type
|
||||
Type string `json:"Type,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this contact
|
||||
func (m *Contact) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateMailingAddress(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateOtherAddress(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Contact) validateMailingAddress(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.MailingAddress) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.MailingAddress != nil {
|
||||
if err := m.MailingAddress.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("MailingAddress")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Contact) validateOtherAddress(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.OtherAddress) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.OtherAddress != nil {
|
||||
if err := m.OtherAddress.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("OtherAddress")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *Contact) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *Contact) UnmarshalBinary(b []byte) error {
|
||||
var res Contact
|
||||
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 crm_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"
|
||||
)
|
||||
|
||||
// ContactRequest contact request
|
||||
//
|
||||
// swagger:model ContactRequest
|
||||
type ContactRequest struct {
|
||||
|
||||
// data
|
||||
Data []*Contact `json:"Data"`
|
||||
}
|
||||
|
||||
// Validate validates this contact request
|
||||
func (m *ContactRequest) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateData(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ContactRequest) validateData(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Data) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Data); i++ {
|
||||
if swag.IsZero(m.Data[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Data[i] != nil {
|
||||
if err := m.Data[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *ContactRequest) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *ContactRequest) UnmarshalBinary(b []byte) error {
|
||||
var res ContactRequest
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,109 @@
|
|||
// 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 crm_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"
|
||||
)
|
||||
|
||||
// ContactResponse contact response
|
||||
//
|
||||
// swagger:model ContactResponse
|
||||
type ContactResponse struct {
|
||||
|
||||
// data
|
||||
Data []*Contact `json:"Data"`
|
||||
|
||||
// meta
|
||||
Meta *ResponseMeta `json:"Meta,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this contact response
|
||||
func (m *ContactResponse) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateData(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateMeta(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ContactResponse) validateData(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Data) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Data); i++ {
|
||||
if swag.IsZero(m.Data[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Data[i] != nil {
|
||||
if err := m.Data[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ContactResponse) validateMeta(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Meta) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.Meta != nil {
|
||||
if err := m.Meta.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("Meta")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *ContactResponse) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *ContactResponse) UnmarshalBinary(b []byte) error {
|
||||
var res ContactResponse
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,109 @@
|
|||
// 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 crm_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"
|
||||
)
|
||||
|
||||
// DeleteResponse delete response
|
||||
//
|
||||
// swagger:model DeleteResponse
|
||||
type DeleteResponse struct {
|
||||
|
||||
// data
|
||||
Data []*Message `json:"Data"`
|
||||
|
||||
// meta
|
||||
Meta *ResponseMeta `json:"Meta,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this delete response
|
||||
func (m *DeleteResponse) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateData(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateMeta(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *DeleteResponse) validateData(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Data) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Data); i++ {
|
||||
if swag.IsZero(m.Data[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Data[i] != nil {
|
||||
if err := m.Data[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *DeleteResponse) validateMeta(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Meta) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.Meta != nil {
|
||||
if err := m.Meta.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("Meta")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *DeleteResponse) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *DeleteResponse) UnmarshalBinary(b []byte) error {
|
||||
var res DeleteResponse
|
||||
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 crm_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 int64 `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,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 crm_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,156 @@
|
|||
// 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 crm_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"
|
||||
)
|
||||
|
||||
// Lead lead
|
||||
//
|
||||
// swagger:model Lead
|
||||
type Lead struct {
|
||||
|
||||
// address
|
||||
Address *Address `json:"Address,omitempty"`
|
||||
|
||||
// Company
|
||||
Company string `json:"Company,omitempty"`
|
||||
|
||||
// Created By User ID
|
||||
CreatedByID string `json:"CreatedByID,omitempty"`
|
||||
|
||||
// Created Date
|
||||
CreatedDate string `json:"CreatedDate,omitempty"`
|
||||
|
||||
// Description
|
||||
Description string `json:"Description,omitempty"`
|
||||
|
||||
// Email
|
||||
Email string `json:"Email,omitempty"`
|
||||
|
||||
// First Name
|
||||
FirstName string `json:"FirstName,omitempty"`
|
||||
|
||||
// Taxnexus Record Id
|
||||
ID string `json:"ID,omitempty"`
|
||||
|
||||
// Last Modified By User ID
|
||||
LastModifiedByID string `json:"LastModifiedByID,omitempty"`
|
||||
|
||||
// Last Modified Date
|
||||
LastModifiedDate string `json:"LastModifiedDate,omitempty"`
|
||||
|
||||
// Last Name
|
||||
LastName string `json:"LastName,omitempty"`
|
||||
|
||||
// Mobile
|
||||
MobilePhone string `json:"MobilePhone,omitempty"`
|
||||
|
||||
// Name
|
||||
Name string `json:"Name,omitempty"`
|
||||
|
||||
// LeadBasic Owner
|
||||
OwnerID string `json:"OwnerId,omitempty"`
|
||||
|
||||
// Partner Account
|
||||
PartnerAccountID string `json:"PartnerAccountId,omitempty"`
|
||||
|
||||
// Phone
|
||||
Phone string `json:"Phone,omitempty"`
|
||||
|
||||
// Product
|
||||
ProductID string `json:"ProductID,omitempty"`
|
||||
|
||||
// referer_url
|
||||
RefererURL string `json:"RefererURL,omitempty"`
|
||||
|
||||
// LeadBasic Status
|
||||
Status string `json:"Status,omitempty"`
|
||||
|
||||
// Tenant Identifier
|
||||
TenantID string `json:"TenantID,omitempty"`
|
||||
|
||||
// Title
|
||||
Title string `json:"Title,omitempty"`
|
||||
|
||||
// Type
|
||||
Type string `json:"Type,omitempty"`
|
||||
|
||||
// utm_campaign
|
||||
UTMCampaign string `json:"UTMCampaign,omitempty"`
|
||||
|
||||
// utm_content
|
||||
UTMContent string `json:"UTMContent,omitempty"`
|
||||
|
||||
// utm_medium
|
||||
UTMMedium string `json:"UTMMedium,omitempty"`
|
||||
|
||||
// utm_source
|
||||
UTMSource string `json:"UTMSource,omitempty"`
|
||||
|
||||
// utm_term
|
||||
UTMTerm string `json:"UTMTerm,omitempty"`
|
||||
|
||||
// Website
|
||||
Website string `json:"Website,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this lead
|
||||
func (m *Lead) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateAddress(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Lead) 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
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *Lead) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *Lead) UnmarshalBinary(b []byte) error {
|
||||
var res Lead
|
||||
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 crm_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"
|
||||
)
|
||||
|
||||
// LeadRequest lead request
|
||||
//
|
||||
// swagger:model LeadRequest
|
||||
type LeadRequest struct {
|
||||
|
||||
// data
|
||||
Data []*Lead `json:"Data"`
|
||||
}
|
||||
|
||||
// Validate validates this lead request
|
||||
func (m *LeadRequest) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateData(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *LeadRequest) validateData(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Data) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Data); i++ {
|
||||
if swag.IsZero(m.Data[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Data[i] != nil {
|
||||
if err := m.Data[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *LeadRequest) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *LeadRequest) UnmarshalBinary(b []byte) error {
|
||||
var res LeadRequest
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,109 @@
|
|||
// 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 crm_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"
|
||||
)
|
||||
|
||||
// LeadResponse lead response
|
||||
//
|
||||
// swagger:model LeadResponse
|
||||
type LeadResponse struct {
|
||||
|
||||
// data
|
||||
Data []*Lead `json:"Data"`
|
||||
|
||||
// meta
|
||||
Meta *ResponseMeta `json:"Meta,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this lead response
|
||||
func (m *LeadResponse) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateData(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateMeta(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *LeadResponse) validateData(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Data) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Data); i++ {
|
||||
if swag.IsZero(m.Data[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Data[i] != nil {
|
||||
if err := m.Data[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *LeadResponse) validateMeta(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Meta) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.Meta != nil {
|
||||
if err := m.Meta.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("Meta")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *LeadResponse) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *LeadResponse) UnmarshalBinary(b []byte) error {
|
||||
var res LeadResponse
|
||||
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 crm_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 {
|
||||
|
||||
// message
|
||||
Message string `json:"message,omitempty"`
|
||||
|
||||
// ref
|
||||
Ref string `json:"ref,omitempty"`
|
||||
|
||||
// status
|
||||
Status int64 `json:"status,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
|
||||
}
|
|
@ -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 crm_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"
|
||||
)
|
||||
|
||||
// Pagination pagination
|
||||
//
|
||||
// swagger:model Pagination
|
||||
type Pagination struct {
|
||||
|
||||
// limit
|
||||
Limit int64 `json:"limit,omitempty"`
|
||||
|
||||
// pagesize
|
||||
Pagesize int64 `json:"pagesize,omitempty"`
|
||||
|
||||
// poffset
|
||||
Poffset int64 `json:"poffset,omitempty"`
|
||||
|
||||
// setsize
|
||||
Setsize int64 `json:"setsize,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this pagination
|
||||
func (m *Pagination) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *Pagination) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *Pagination) UnmarshalBinary(b []byte) error {
|
||||
var res Pagination
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
// 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 crm_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"
|
||||
)
|
||||
|
||||
// RequestMeta request meta
|
||||
//
|
||||
// swagger:model RequestMeta
|
||||
type RequestMeta struct {
|
||||
|
||||
// Taxnexus Account Number of the Reseller or OEM
|
||||
// Required: true
|
||||
TaxnexusAccount *string `json:"TaxnexusAccount"`
|
||||
}
|
||||
|
||||
// Validate validates this request meta
|
||||
func (m *RequestMeta) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateTaxnexusAccount(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *RequestMeta) validateTaxnexusAccount(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("TaxnexusAccount", "body", m.TaxnexusAccount); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *RequestMeta) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *RequestMeta) UnmarshalBinary(b []byte) error {
|
||||
var res RequestMeta
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,108 @@
|
|||
// 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 crm_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"
|
||||
)
|
||||
|
||||
// ResponseMeta response meta
|
||||
//
|
||||
// swagger:model ResponseMeta
|
||||
type ResponseMeta struct {
|
||||
|
||||
// Microservice Contact Info
|
||||
Contact string `json:"Contact,omitempty"`
|
||||
|
||||
// Copyright Info
|
||||
Copyright string `json:"Copyright,omitempty"`
|
||||
|
||||
// License Information and Restrictions
|
||||
License string `json:"License,omitempty"`
|
||||
|
||||
// Operation ID
|
||||
OperationID string `json:"OperationID,omitempty"`
|
||||
|
||||
// pagination
|
||||
Pagination *Pagination `json:"Pagination,omitempty"`
|
||||
|
||||
// Request IP Address
|
||||
RequestIP string `json:"RequestIP,omitempty"`
|
||||
|
||||
// Request Type
|
||||
RequestType string `json:"RequestType,omitempty"`
|
||||
|
||||
// Request URL
|
||||
RequestURL string `json:"RequestURL,omitempty"`
|
||||
|
||||
// Data Server Info
|
||||
ServerInfo string `json:"ServerInfo,omitempty"`
|
||||
|
||||
// Data Server Response Time (ms)
|
||||
ServerResponseTime string `json:"ServerResponseTime,omitempty"`
|
||||
|
||||
// Backend Server Timestamp
|
||||
ServerTimestamp string `json:"ServerTimestamp,omitempty"`
|
||||
|
||||
// Taxnexus Account Number used for recording transactions
|
||||
TaxnexusAccount string `json:"TaxnexusAccount,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this response meta
|
||||
func (m *ResponseMeta) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validatePagination(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ResponseMeta) validatePagination(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Pagination) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.Pagination != nil {
|
||||
if err := m.Pagination.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("Pagination")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *ResponseMeta) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *ResponseMeta) UnmarshalBinary(b []byte) error {
|
||||
var res ResponseMeta
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
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 authority
|
||||
|
||||
// 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 authority API client.
|
||||
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
|
||||
return &Client{transport: transport, formats: formats}
|
||||
}
|
||||
|
||||
/*
|
||||
Client for authority API
|
||||
*/
|
||||
type Client struct {
|
||||
transport runtime.ClientTransport
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ClientService is the interface for Client methods
|
||||
type ClientService interface {
|
||||
GetAuthorities(params *GetAuthoritiesParams, authInfo runtime.ClientAuthInfoWriter) (*GetAuthoritiesOK, error)
|
||||
|
||||
PostAuthorities(params *PostAuthoritiesParams, authInfo runtime.ClientAuthInfoWriter) (*PostAuthoritiesOK, error)
|
||||
|
||||
PutAuthorities(params *PutAuthoritiesParams, authInfo runtime.ClientAuthInfoWriter) (*PutAuthoritiesOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
||||
/*
|
||||
GetAuthorities gets a list of authorities
|
||||
|
||||
Return a list of available Authorities
|
||||
*/
|
||||
func (a *Client) GetAuthorities(params *GetAuthoritiesParams, authInfo runtime.ClientAuthInfoWriter) (*GetAuthoritiesOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetAuthoritiesParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "getAuthorities",
|
||||
Method: "GET",
|
||||
PathPattern: "/authorities",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetAuthoritiesReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*GetAuthoritiesOK)
|
||||
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 getAuthorities: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PostAuthorities adds new authorities
|
||||
|
||||
Create new Authorities
|
||||
*/
|
||||
func (a *Client) PostAuthorities(params *PostAuthoritiesParams, authInfo runtime.ClientAuthInfoWriter) (*PostAuthoritiesOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPostAuthoritiesParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "postAuthorities",
|
||||
Method: "POST",
|
||||
PathPattern: "/authorities",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PostAuthoritiesReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*PostAuthoritiesOK)
|
||||
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 postAuthorities: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PutAuthorities updates authorities
|
||||
|
||||
Update fields in an Authority record identified by Taxnexus Id
|
||||
*/
|
||||
func (a *Client) PutAuthorities(params *PutAuthoritiesParams, authInfo runtime.ClientAuthInfoWriter) (*PutAuthoritiesOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPutAuthoritiesParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "putAuthorities",
|
||||
Method: "PUT",
|
||||
PathPattern: "/authorities",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PutAuthoritiesReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*PutAuthoritiesOK)
|
||||
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 putAuthorities: 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,215 @@
|
|||
// 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 authority
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewGetAuthoritiesParams creates a new GetAuthoritiesParams object
|
||||
// with the default values initialized.
|
||||
func NewGetAuthoritiesParams() *GetAuthoritiesParams {
|
||||
var ()
|
||||
return &GetAuthoritiesParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAuthoritiesParamsWithTimeout creates a new GetAuthoritiesParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewGetAuthoritiesParamsWithTimeout(timeout time.Duration) *GetAuthoritiesParams {
|
||||
var ()
|
||||
return &GetAuthoritiesParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAuthoritiesParamsWithContext creates a new GetAuthoritiesParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewGetAuthoritiesParamsWithContext(ctx context.Context) *GetAuthoritiesParams {
|
||||
var ()
|
||||
return &GetAuthoritiesParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAuthoritiesParamsWithHTTPClient creates a new GetAuthoritiesParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewGetAuthoritiesParamsWithHTTPClient(client *http.Client) *GetAuthoritiesParams {
|
||||
var ()
|
||||
return &GetAuthoritiesParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*GetAuthoritiesParams contains all the parameters to send to the API endpoint
|
||||
for the get authorities operation typically these are written to a http.Request
|
||||
*/
|
||||
type GetAuthoritiesParams struct {
|
||||
|
||||
/*AuthorityID
|
||||
Taxnexus Id of the Authority to be retrieved
|
||||
|
||||
*/
|
||||
AuthorityID *string
|
||||
/*Limit
|
||||
How many objects to return at one time
|
||||
|
||||
*/
|
||||
Limit *int64
|
||||
/*Offset
|
||||
How many objects to skip? (default 0)
|
||||
|
||||
*/
|
||||
Offset *int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get authorities params
|
||||
func (o *GetAuthoritiesParams) WithTimeout(timeout time.Duration) *GetAuthoritiesParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get authorities params
|
||||
func (o *GetAuthoritiesParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get authorities params
|
||||
func (o *GetAuthoritiesParams) WithContext(ctx context.Context) *GetAuthoritiesParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get authorities params
|
||||
func (o *GetAuthoritiesParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get authorities params
|
||||
func (o *GetAuthoritiesParams) WithHTTPClient(client *http.Client) *GetAuthoritiesParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get authorities params
|
||||
func (o *GetAuthoritiesParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithAuthorityID adds the authorityID to the get authorities params
|
||||
func (o *GetAuthoritiesParams) WithAuthorityID(authorityID *string) *GetAuthoritiesParams {
|
||||
o.SetAuthorityID(authorityID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetAuthorityID adds the authorityId to the get authorities params
|
||||
func (o *GetAuthoritiesParams) SetAuthorityID(authorityID *string) {
|
||||
o.AuthorityID = authorityID
|
||||
}
|
||||
|
||||
// WithLimit adds the limit to the get authorities params
|
||||
func (o *GetAuthoritiesParams) WithLimit(limit *int64) *GetAuthoritiesParams {
|
||||
o.SetLimit(limit)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetLimit adds the limit to the get authorities params
|
||||
func (o *GetAuthoritiesParams) SetLimit(limit *int64) {
|
||||
o.Limit = limit
|
||||
}
|
||||
|
||||
// WithOffset adds the offset to the get authorities params
|
||||
func (o *GetAuthoritiesParams) WithOffset(offset *int64) *GetAuthoritiesParams {
|
||||
o.SetOffset(offset)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetOffset adds the offset to the get authorities params
|
||||
func (o *GetAuthoritiesParams) SetOffset(offset *int64) {
|
||||
o.Offset = offset
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetAuthoritiesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if o.AuthorityID != nil {
|
||||
|
||||
// query param authorityId
|
||||
var qrAuthorityID string
|
||||
if o.AuthorityID != nil {
|
||||
qrAuthorityID = *o.AuthorityID
|
||||
}
|
||||
qAuthorityID := qrAuthorityID
|
||||
if qAuthorityID != "" {
|
||||
if err := r.SetQueryParam("authorityId", qAuthorityID); 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.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 authority
|
||||
|
||||
// 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/lib/api/regs/regs_models"
|
||||
)
|
||||
|
||||
// GetAuthoritiesReader is a Reader for the GetAuthorities structure.
|
||||
type GetAuthoritiesReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetAuthoritiesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetAuthoritiesOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewGetAuthoritiesUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewGetAuthoritiesForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewGetAuthoritiesNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewGetAuthoritiesUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewGetAuthoritiesInternalServerError()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAuthoritiesOK creates a GetAuthoritiesOK with default headers values
|
||||
func NewGetAuthoritiesOK() *GetAuthoritiesOK {
|
||||
return &GetAuthoritiesOK{}
|
||||
}
|
||||
|
||||
/*GetAuthoritiesOK handles this case with default header values.
|
||||
|
||||
Taxnexus Response with an array of Authority objects
|
||||
*/
|
||||
type GetAuthoritiesOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
CacheControl string
|
||||
|
||||
Payload *regs_models.AuthorityResponse
|
||||
}
|
||||
|
||||
func (o *GetAuthoritiesOK) Error() string {
|
||||
return fmt.Sprintf("[GET /authorities][%d] getAuthoritiesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAuthoritiesOK) GetPayload() *regs_models.AuthorityResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAuthoritiesOK) 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(regs_models.AuthorityResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetAuthoritiesUnauthorized creates a GetAuthoritiesUnauthorized with default headers values
|
||||
func NewGetAuthoritiesUnauthorized() *GetAuthoritiesUnauthorized {
|
||||
return &GetAuthoritiesUnauthorized{}
|
||||
}
|
||||
|
||||
/*GetAuthoritiesUnauthorized handles this case with default header values.
|
||||
|
||||
Access Unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type GetAuthoritiesUnauthorized struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *regs_models.Error
|
||||
}
|
||||
|
||||
func (o *GetAuthoritiesUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /authorities][%d] getAuthoritiesUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAuthoritiesUnauthorized) GetPayload() *regs_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAuthoritiesUnauthorized) 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(regs_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetAuthoritiesForbidden creates a GetAuthoritiesForbidden with default headers values
|
||||
func NewGetAuthoritiesForbidden() *GetAuthoritiesForbidden {
|
||||
return &GetAuthoritiesForbidden{}
|
||||
}
|
||||
|
||||
/*GetAuthoritiesForbidden handles this case with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type GetAuthoritiesForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *regs_models.Error
|
||||
}
|
||||
|
||||
func (o *GetAuthoritiesForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /authorities][%d] getAuthoritiesForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAuthoritiesForbidden) GetPayload() *regs_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAuthoritiesForbidden) 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(regs_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetAuthoritiesNotFound creates a GetAuthoritiesNotFound with default headers values
|
||||
func NewGetAuthoritiesNotFound() *GetAuthoritiesNotFound {
|
||||
return &GetAuthoritiesNotFound{}
|
||||
}
|
||||
|
||||
/*GetAuthoritiesNotFound handles this case with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type GetAuthoritiesNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *regs_models.Error
|
||||
}
|
||||
|
||||
func (o *GetAuthoritiesNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /authorities][%d] getAuthoritiesNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAuthoritiesNotFound) GetPayload() *regs_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAuthoritiesNotFound) 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(regs_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetAuthoritiesUnprocessableEntity creates a GetAuthoritiesUnprocessableEntity with default headers values
|
||||
func NewGetAuthoritiesUnprocessableEntity() *GetAuthoritiesUnprocessableEntity {
|
||||
return &GetAuthoritiesUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*GetAuthoritiesUnprocessableEntity handles this case with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type GetAuthoritiesUnprocessableEntity struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *regs_models.Error
|
||||
}
|
||||
|
||||
func (o *GetAuthoritiesUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[GET /authorities][%d] getAuthoritiesUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAuthoritiesUnprocessableEntity) GetPayload() *regs_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAuthoritiesUnprocessableEntity) 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(regs_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetAuthoritiesInternalServerError creates a GetAuthoritiesInternalServerError with default headers values
|
||||
func NewGetAuthoritiesInternalServerError() *GetAuthoritiesInternalServerError {
|
||||
return &GetAuthoritiesInternalServerError{}
|
||||
}
|
||||
|
||||
/*GetAuthoritiesInternalServerError handles this case with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type GetAuthoritiesInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *regs_models.Error
|
||||
}
|
||||
|
||||
func (o *GetAuthoritiesInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /authorities][%d] getAuthoritiesInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAuthoritiesInternalServerError) GetPayload() *regs_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAuthoritiesInternalServerError) 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(regs_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 authority
|
||||
|
||||
// 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/lib/api/regs/regs_models"
|
||||
)
|
||||
|
||||
// NewPostAuthoritiesParams creates a new PostAuthoritiesParams object
|
||||
// with the default values initialized.
|
||||
func NewPostAuthoritiesParams() *PostAuthoritiesParams {
|
||||
var ()
|
||||
return &PostAuthoritiesParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAuthoritiesParamsWithTimeout creates a new PostAuthoritiesParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewPostAuthoritiesParamsWithTimeout(timeout time.Duration) *PostAuthoritiesParams {
|
||||
var ()
|
||||
return &PostAuthoritiesParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAuthoritiesParamsWithContext creates a new PostAuthoritiesParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewPostAuthoritiesParamsWithContext(ctx context.Context) *PostAuthoritiesParams {
|
||||
var ()
|
||||
return &PostAuthoritiesParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAuthoritiesParamsWithHTTPClient creates a new PostAuthoritiesParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewPostAuthoritiesParamsWithHTTPClient(client *http.Client) *PostAuthoritiesParams {
|
||||
var ()
|
||||
return &PostAuthoritiesParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*PostAuthoritiesParams contains all the parameters to send to the API endpoint
|
||||
for the post authorities operation typically these are written to a http.Request
|
||||
*/
|
||||
type PostAuthoritiesParams struct {
|
||||
|
||||
/*AuthorityRequest
|
||||
A request with an array of Authority Objects
|
||||
|
||||
*/
|
||||
AuthorityRequest *regs_models.AuthorityRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the post authorities params
|
||||
func (o *PostAuthoritiesParams) WithTimeout(timeout time.Duration) *PostAuthoritiesParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the post authorities params
|
||||
func (o *PostAuthoritiesParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the post authorities params
|
||||
func (o *PostAuthoritiesParams) WithContext(ctx context.Context) *PostAuthoritiesParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the post authorities params
|
||||
func (o *PostAuthoritiesParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the post authorities params
|
||||
func (o *PostAuthoritiesParams) WithHTTPClient(client *http.Client) *PostAuthoritiesParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the post authorities params
|
||||
func (o *PostAuthoritiesParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithAuthorityRequest adds the authorityRequest to the post authorities params
|
||||
func (o *PostAuthoritiesParams) WithAuthorityRequest(authorityRequest *regs_models.AuthorityRequest) *PostAuthoritiesParams {
|
||||
o.SetAuthorityRequest(authorityRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetAuthorityRequest adds the authorityRequest to the post authorities params
|
||||
func (o *PostAuthoritiesParams) SetAuthorityRequest(authorityRequest *regs_models.AuthorityRequest) {
|
||||
o.AuthorityRequest = authorityRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PostAuthoritiesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if o.AuthorityRequest != nil {
|
||||
if err := r.SetBodyParam(o.AuthorityRequest); 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 authority
|
||||
|
||||
// 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/lib/api/regs/regs_models"
|
||||
)
|
||||
|
||||
// PostAuthoritiesReader is a Reader for the PostAuthorities structure.
|
||||
type PostAuthoritiesReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PostAuthoritiesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPostAuthoritiesOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewPostAuthoritiesUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewPostAuthoritiesForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewPostAuthoritiesNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewPostAuthoritiesUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewPostAuthoritiesInternalServerError()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAuthoritiesOK creates a PostAuthoritiesOK with default headers values
|
||||
func NewPostAuthoritiesOK() *PostAuthoritiesOK {
|
||||
return &PostAuthoritiesOK{}
|
||||
}
|
||||
|
||||
/*PostAuthoritiesOK handles this case with default header values.
|
||||
|
||||
Taxnexus Response with an array of Authority objects
|
||||
*/
|
||||
type PostAuthoritiesOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
CacheControl string
|
||||
|
||||
Payload *regs_models.AuthorityResponse
|
||||
}
|
||||
|
||||
func (o *PostAuthoritiesOK) Error() string {
|
||||
return fmt.Sprintf("[POST /authorities][%d] postAuthoritiesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostAuthoritiesOK) GetPayload() *regs_models.AuthorityResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostAuthoritiesOK) 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(regs_models.AuthorityResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostAuthoritiesUnauthorized creates a PostAuthoritiesUnauthorized with default headers values
|
||||
func NewPostAuthoritiesUnauthorized() *PostAuthoritiesUnauthorized {
|
||||
return &PostAuthoritiesUnauthorized{}
|
||||
}
|
||||
|
||||
/*PostAuthoritiesUnauthorized handles this case with default header values.
|
||||
|
||||
Access Unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type PostAuthoritiesUnauthorized struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *regs_models.Error
|
||||
}
|
||||
|
||||
func (o *PostAuthoritiesUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[POST /authorities][%d] postAuthoritiesUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostAuthoritiesUnauthorized) GetPayload() *regs_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostAuthoritiesUnauthorized) 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(regs_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostAuthoritiesForbidden creates a PostAuthoritiesForbidden with default headers values
|
||||
func NewPostAuthoritiesForbidden() *PostAuthoritiesForbidden {
|
||||
return &PostAuthoritiesForbidden{}
|
||||
}
|
||||
|
||||
/*PostAuthoritiesForbidden handles this case with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type PostAuthoritiesForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *regs_models.Error
|
||||
}
|
||||
|
||||
func (o *PostAuthoritiesForbidden) Error() string {
|
||||
return fmt.Sprintf("[POST /authorities][%d] postAuthoritiesForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostAuthoritiesForbidden) GetPayload() *regs_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostAuthoritiesForbidden) 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(regs_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostAuthoritiesNotFound creates a PostAuthoritiesNotFound with default headers values
|
||||
func NewPostAuthoritiesNotFound() *PostAuthoritiesNotFound {
|
||||
return &PostAuthoritiesNotFound{}
|
||||
}
|
||||
|
||||
/*PostAuthoritiesNotFound handles this case with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type PostAuthoritiesNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *regs_models.Error
|
||||
}
|
||||
|
||||
func (o *PostAuthoritiesNotFound) Error() string {
|
||||
return fmt.Sprintf("[POST /authorities][%d] postAuthoritiesNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostAuthoritiesNotFound) GetPayload() *regs_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostAuthoritiesNotFound) 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(regs_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostAuthoritiesUnprocessableEntity creates a PostAuthoritiesUnprocessableEntity with default headers values
|
||||
func NewPostAuthoritiesUnprocessableEntity() *PostAuthoritiesUnprocessableEntity {
|
||||
return &PostAuthoritiesUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*PostAuthoritiesUnprocessableEntity handles this case with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type PostAuthoritiesUnprocessableEntity struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *regs_models.Error
|
||||
}
|
||||
|
||||
func (o *PostAuthoritiesUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[POST /authorities][%d] postAuthoritiesUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostAuthoritiesUnprocessableEntity) GetPayload() *regs_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostAuthoritiesUnprocessableEntity) 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(regs_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostAuthoritiesInternalServerError creates a PostAuthoritiesInternalServerError with default headers values
|
||||
func NewPostAuthoritiesInternalServerError() *PostAuthoritiesInternalServerError {
|
||||
return &PostAuthoritiesInternalServerError{}
|
||||
}
|
||||
|
||||
/*PostAuthoritiesInternalServerError handles this case with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type PostAuthoritiesInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *regs_models.Error
|
||||
}
|
||||
|
||||
func (o *PostAuthoritiesInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[POST /authorities][%d] postAuthoritiesInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostAuthoritiesInternalServerError) GetPayload() *regs_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostAuthoritiesInternalServerError) 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(regs_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 authority
|
||||
|
||||
// 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/lib/api/regs/regs_models"
|
||||
)
|
||||
|
||||
// NewPutAuthoritiesParams creates a new PutAuthoritiesParams object
|
||||
// with the default values initialized.
|
||||
func NewPutAuthoritiesParams() *PutAuthoritiesParams {
|
||||
var ()
|
||||
return &PutAuthoritiesParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPutAuthoritiesParamsWithTimeout creates a new PutAuthoritiesParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewPutAuthoritiesParamsWithTimeout(timeout time.Duration) *PutAuthoritiesParams {
|
||||
var ()
|
||||
return &PutAuthoritiesParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPutAuthoritiesParamsWithContext creates a new PutAuthoritiesParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewPutAuthoritiesParamsWithContext(ctx context.Context) *PutAuthoritiesParams {
|
||||
var ()
|
||||
return &PutAuthoritiesParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPutAuthoritiesParamsWithHTTPClient creates a new PutAuthoritiesParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewPutAuthoritiesParamsWithHTTPClient(client *http.Client) *PutAuthoritiesParams {
|
||||
var ()
|
||||
return &PutAuthoritiesParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*PutAuthoritiesParams contains all the parameters to send to the API endpoint
|
||||
for the put authorities operation typically these are written to a http.Request
|
||||
*/
|
||||
type PutAuthoritiesParams struct {
|
||||
|
||||
/*AuthorityRequest
|
||||
A request with an array of Authority Objects
|
||||
|
||||
*/
|
||||
AuthorityRequest *regs_models.AuthorityRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the put authorities params
|
||||
func (o *PutAuthoritiesParams) WithTimeout(timeout time.Duration) *PutAuthoritiesParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the put authorities params
|
||||
func (o *PutAuthoritiesParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the put authorities params
|
||||
func (o *PutAuthoritiesParams) WithContext(ctx context.Context) *PutAuthoritiesParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the put authorities params
|
||||
func (o *PutAuthoritiesParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the put authorities params
|
||||
func (o *PutAuthoritiesParams) WithHTTPClient(client *http.Client) *PutAuthoritiesParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the put authorities params
|
||||
func (o *PutAuthoritiesParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithAuthorityRequest adds the authorityRequest to the put authorities params
|
||||
func (o *PutAuthoritiesParams) WithAuthorityRequest(authorityRequest *regs_models.AuthorityRequest) *PutAuthoritiesParams {
|
||||
o.SetAuthorityRequest(authorityRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetAuthorityRequest adds the authorityRequest to the put authorities params
|
||||
func (o *PutAuthoritiesParams) SetAuthorityRequest(authorityRequest *regs_models.AuthorityRequest) {
|
||||
o.AuthorityRequest = authorityRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PutAuthoritiesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if o.AuthorityRequest != nil {
|
||||
if err := r.SetBodyParam(o.AuthorityRequest); 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 authority
|
||||
|
||||
// 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/lib/api/regs/regs_models"
|
||||
)
|
||||
|
||||
// PutAuthoritiesReader is a Reader for the PutAuthorities structure.
|
||||
type PutAuthoritiesReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PutAuthoritiesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPutAuthoritiesOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewPutAuthoritiesUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewPutAuthoritiesForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewPutAuthoritiesNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewPutAuthoritiesUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewPutAuthoritiesInternalServerError()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPutAuthoritiesOK creates a PutAuthoritiesOK with default headers values
|
||||
func NewPutAuthoritiesOK() *PutAuthoritiesOK {
|
||||
return &PutAuthoritiesOK{}
|
||||
}
|
||||
|
||||
/*PutAuthoritiesOK handles this case with default header values.
|
||||
|
||||
Taxnexus Response with an array of Authority objects
|
||||
*/
|
||||
type PutAuthoritiesOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
CacheControl string
|
||||
|
||||
Payload *regs_models.AuthorityResponse
|
||||
}
|
||||
|
||||
func (o *PutAuthoritiesOK) Error() string {
|
||||
return fmt.Sprintf("[PUT /authorities][%d] putAuthoritiesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutAuthoritiesOK) GetPayload() *regs_models.AuthorityResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutAuthoritiesOK) 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(regs_models.AuthorityResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPutAuthoritiesUnauthorized creates a PutAuthoritiesUnauthorized with default headers values
|
||||
func NewPutAuthoritiesUnauthorized() *PutAuthoritiesUnauthorized {
|
||||
return &PutAuthoritiesUnauthorized{}
|
||||
}
|
||||
|
||||
/*PutAuthoritiesUnauthorized handles this case with default header values.
|
||||
|
||||
Access Unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type PutAuthoritiesUnauthorized struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *regs_models.Error
|
||||
}
|
||||
|
||||
func (o *PutAuthoritiesUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[PUT /authorities][%d] putAuthoritiesUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutAuthoritiesUnauthorized) GetPayload() *regs_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutAuthoritiesUnauthorized) 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(regs_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPutAuthoritiesForbidden creates a PutAuthoritiesForbidden with default headers values
|
||||
func NewPutAuthoritiesForbidden() *PutAuthoritiesForbidden {
|
||||
return &PutAuthoritiesForbidden{}
|
||||
}
|
||||
|
||||
/*PutAuthoritiesForbidden handles this case with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type PutAuthoritiesForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *regs_models.Error
|
||||
}
|
||||
|
||||
func (o *PutAuthoritiesForbidden) Error() string {
|
||||
return fmt.Sprintf("[PUT /authorities][%d] putAuthoritiesForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutAuthoritiesForbidden) GetPayload() *regs_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutAuthoritiesForbidden) 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(regs_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPutAuthoritiesNotFound creates a PutAuthoritiesNotFound with default headers values
|
||||
func NewPutAuthoritiesNotFound() *PutAuthoritiesNotFound {
|
||||
return &PutAuthoritiesNotFound{}
|
||||
}
|
||||
|
||||
/*PutAuthoritiesNotFound handles this case with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type PutAuthoritiesNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *regs_models.Error
|
||||
}
|
||||
|
||||
func (o *PutAuthoritiesNotFound) Error() string {
|
||||
return fmt.Sprintf("[PUT /authorities][%d] putAuthoritiesNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutAuthoritiesNotFound) GetPayload() *regs_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutAuthoritiesNotFound) 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(regs_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPutAuthoritiesUnprocessableEntity creates a PutAuthoritiesUnprocessableEntity with default headers values
|
||||
func NewPutAuthoritiesUnprocessableEntity() *PutAuthoritiesUnprocessableEntity {
|
||||
return &PutAuthoritiesUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*PutAuthoritiesUnprocessableEntity handles this case with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type PutAuthoritiesUnprocessableEntity struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *regs_models.Error
|
||||
}
|
||||
|
||||
func (o *PutAuthoritiesUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[PUT /authorities][%d] putAuthoritiesUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutAuthoritiesUnprocessableEntity) GetPayload() *regs_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutAuthoritiesUnprocessableEntity) 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(regs_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPutAuthoritiesInternalServerError creates a PutAuthoritiesInternalServerError with default headers values
|
||||
func NewPutAuthoritiesInternalServerError() *PutAuthoritiesInternalServerError {
|
||||
return &PutAuthoritiesInternalServerError{}
|
||||
}
|
||||
|
||||
/*PutAuthoritiesInternalServerError handles this case with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type PutAuthoritiesInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *regs_models.Error
|
||||
}
|
||||
|
||||
func (o *PutAuthoritiesInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[PUT /authorities][%d] putAuthoritiesInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutAuthoritiesInternalServerError) GetPayload() *regs_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutAuthoritiesInternalServerError) 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(regs_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,196 @@
|
|||
// 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 backend
|
||||
|
||||
// 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 backend API client.
|
||||
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
|
||||
return &Client{transport: transport, formats: formats}
|
||||
}
|
||||
|
||||
/*
|
||||
Client for backend API
|
||||
*/
|
||||
type Client struct {
|
||||
transport runtime.ClientTransport
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ClientService is the interface for Client methods
|
||||
type ClientService interface {
|
||||
DeleteBackend(params *DeleteBackendParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteBackendOK, error)
|
||||
|
||||
GetBackends(params *GetBackendsParams, authInfo runtime.ClientAuthInfoWriter) (*GetBackendsOK, error)
|
||||
|
||||
PostBackends(params *PostBackendsParams, authInfo runtime.ClientAuthInfoWriter) (*PostBackendsOK, error)
|
||||
|
||||
PutBackends(params *PutBackendsParams, authInfo runtime.ClientAuthInfoWriter) (*PutBackendsOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteBackend deletes a backend
|
||||
|
||||
Delete Taxnexus Backend record
|
||||
*/
|
||||
func (a *Client) DeleteBackend(params *DeleteBackendParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteBackendOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewDeleteBackendParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "deleteBackend",
|
||||
Method: "DELETE",
|
||||
PathPattern: "/backends",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &DeleteBackendReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*DeleteBackendOK)
|
||||
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 deleteBackend: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
GetBackends gets a list of backends
|
||||
|
||||
Return a list of Backends
|
||||
*/
|
||||
func (a *Client) GetBackends(params *GetBackendsParams, authInfo runtime.ClientAuthInfoWriter) (*GetBackendsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetBackendsParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "getBackends",
|
||||
Method: "GET",
|
||||
PathPattern: "/backends",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetBackendsReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*GetBackendsOK)
|
||||
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 getBackends: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PostBackends adds new backends
|
||||
|
||||
Contact record to be added
|
||||
*/
|
||||
func (a *Client) PostBackends(params *PostBackendsParams, authInfo runtime.ClientAuthInfoWriter) (*PostBackendsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPostBackendsParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "postBackends",
|
||||
Method: "POST",
|
||||
PathPattern: "/backends",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PostBackendsReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*PostBackendsOK)
|
||||
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 postBackends: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PutBackends updates backends
|
||||
|
||||
Update Backend records
|
||||
*/
|
||||
func (a *Client) PutBackends(params *PutBackendsParams, authInfo runtime.ClientAuthInfoWriter) (*PutBackendsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPutBackendsParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "putBackends",
|
||||
Method: "PUT",
|
||||
PathPattern: "/backends",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PutBackendsReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*PutBackendsOK)
|
||||
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 putBackends: 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 backend
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewDeleteBackendParams creates a new DeleteBackendParams object
|
||||
// with the default values initialized.
|
||||
func NewDeleteBackendParams() *DeleteBackendParams {
|
||||
var ()
|
||||
return &DeleteBackendParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteBackendParamsWithTimeout creates a new DeleteBackendParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewDeleteBackendParamsWithTimeout(timeout time.Duration) *DeleteBackendParams {
|
||||
var ()
|
||||
return &DeleteBackendParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteBackendParamsWithContext creates a new DeleteBackendParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewDeleteBackendParamsWithContext(ctx context.Context) *DeleteBackendParams {
|
||||
var ()
|
||||
return &DeleteBackendParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteBackendParamsWithHTTPClient creates a new DeleteBackendParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewDeleteBackendParamsWithHTTPClient(client *http.Client) *DeleteBackendParams {
|
||||
var ()
|
||||
return &DeleteBackendParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*DeleteBackendParams contains all the parameters to send to the API endpoint
|
||||
for the delete backend operation typically these are written to a http.Request
|
||||
*/
|
||||
type DeleteBackendParams struct {
|
||||
|
||||
/*BackendID
|
||||
Taxnexus Id of the Backend to be retrieved
|
||||
|
||||
*/
|
||||
BackendID *string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the delete backend params
|
||||
func (o *DeleteBackendParams) WithTimeout(timeout time.Duration) *DeleteBackendParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the delete backend params
|
||||
func (o *DeleteBackendParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the delete backend params
|
||||
func (o *DeleteBackendParams) WithContext(ctx context.Context) *DeleteBackendParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the delete backend params
|
||||
func (o *DeleteBackendParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the delete backend params
|
||||
func (o *DeleteBackendParams) WithHTTPClient(client *http.Client) *DeleteBackendParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the delete backend params
|
||||
func (o *DeleteBackendParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithBackendID adds the backendID to the delete backend params
|
||||
func (o *DeleteBackendParams) WithBackendID(backendID *string) *DeleteBackendParams {
|
||||
o.SetBackendID(backendID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetBackendID adds the backendId to the delete backend params
|
||||
func (o *DeleteBackendParams) SetBackendID(backendID *string) {
|
||||
o.BackendID = backendID
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *DeleteBackendParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if o.BackendID != nil {
|
||||
|
||||
// query param backendId
|
||||
var qrBackendID string
|
||||
if o.BackendID != nil {
|
||||
qrBackendID = *o.BackendID
|
||||
}
|
||||
qBackendID := qrBackendID
|
||||
if qBackendID != "" {
|
||||
if err := r.SetQueryParam("backendId", qBackendID); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue