New swagger version

v0.1.3 v0.1.3
Vernon Keenan 2022-05-28 12:45:41 -07:00
parent e59e67381e
commit 97cb82375c
136 changed files with 9646 additions and 1484 deletions

3
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,3 @@
{
"cSpell.words": ["Gitea", "taxnexus"]
}

View File

@ -8,13 +8,13 @@ VERNONKEENAN_VERSION ?= 0.0.1
.PHONY: swagger .PHONY: swagger
swagger: swagger:
cp ../auth/swagger/auth-kvision.yaml ./swagger cp ../auth/swagger/auth-vernonkeenan.yaml ./swagger
cp ../crm/swagger/crm-kvision.yaml ./swagger cp ../crm/swagger/crm-vernonkeenan.yaml ./swagger
cp ../devops/swagger/devops-kvision.yaml ./swagger cp ../devops/swagger/devops-vernonkeenan.yaml ./swagger
cp ../stash/swagger/stash-kvision.yaml ./swagger cp ../stash/swagger/stash-vernonkeenan.yaml ./swagger
cp ../sf-gate/swagger/sf-gate-kvision.yaml ./swagger cp ../sf-gate/swagger/sf-gate-vernonkeenan.yaml ./swagger
cp ../research/swagger/research-kvision.yaml ./swagger cp ../research/swagger/research-vernonkeenan.yaml ./swagger
cp ../workflow/swagger/workflow-kvision.yaml ./swagger cp ../workflow/swagger/workflow-vernonkeenan.yaml ./swagger
# #
rm -rf api rm -rf api
# #
@ -37,7 +37,7 @@ swagger:
--log-output=./swagger/logs/generate-auth-client.log \ --log-output=./swagger/logs/generate-auth-client.log \
--copyright-file=./build/COPYRIGHT \ --copyright-file=./build/COPYRIGHT \
--name=auth \ --name=auth \
--spec=./swagger/auth-kvision.yaml \ --spec=./swagger/auth-vernonkeenan.yaml \
--target=./api/auth \ --target=./api/auth \
--client-package=auth-client \ --client-package=auth-client \
--model-package=auth-models \ --model-package=auth-models \
@ -50,7 +50,7 @@ swagger:
--log-output=./swagger/logs/generate-crm-client.log \ --log-output=./swagger/logs/generate-crm-client.log \
--copyright-file=./build/COPYRIGHT \ --copyright-file=./build/COPYRIGHT \
--name=crm \ --name=crm \
--spec=./swagger/crm-kvision.yaml \ --spec=./swagger/crm-vernonkeenan.yaml \
--target=./api/crm \ --target=./api/crm \
--client-package=crm-client \ --client-package=crm-client \
--model-package=crm-models \ --model-package=crm-models \
@ -63,7 +63,7 @@ swagger:
--log-output=./swagger/logs/generate-devops-client.log \ --log-output=./swagger/logs/generate-devops-client.log \
--copyright-file=./build/COPYRIGHT \ --copyright-file=./build/COPYRIGHT \
--name=devops \ --name=devops \
--spec=./swagger/devops-kvision.yaml \ --spec=./swagger/devops-vernonkeenan.yaml \
--target=./api/devops \ --target=./api/devops \
--client-package=devops-client \ --client-package=devops-client \
--model-package=devops-models \ --model-package=devops-models \
@ -76,7 +76,7 @@ swagger:
--log-output=./swagger/logs/generate-stash-client.log \ --log-output=./swagger/logs/generate-stash-client.log \
--copyright-file=./build/COPYRIGHT \ --copyright-file=./build/COPYRIGHT \
--name=stash \ --name=stash \
--spec=./swagger/stash-kvision.yaml \ --spec=./swagger/stash-vernonkeenan.yaml \
--target=./api/stash \ --target=./api/stash \
--client-package=stash-client \ --client-package=stash-client \
--model-package=stash-models \ --model-package=stash-models \
@ -89,7 +89,7 @@ swagger:
--log-output=./swagger/logs/generate-sfgate-client.log \ --log-output=./swagger/logs/generate-sfgate-client.log \
--copyright-file=./build/COPYRIGHT \ --copyright-file=./build/COPYRIGHT \
--name=sfgate \ --name=sfgate \
--spec=./swagger/sf-gate-kvision.yaml \ --spec=./swagger/sf-gate-vernonkeenan.yaml \
--target=./api/sfgate \ --target=./api/sfgate \
--client-package=sfgate-client \ --client-package=sfgate-client \
--model-package=sfgate-models \ --model-package=sfgate-models \
@ -102,7 +102,7 @@ swagger:
--log-output=./swagger/logs/generate-research-client.log \ --log-output=./swagger/logs/generate-research-client.log \
--copyright-file=./build/COPYRIGHT \ --copyright-file=./build/COPYRIGHT \
--name=research \ --name=research \
--spec=./swagger/sf-gate-kvision.yaml \ --spec=./swagger/sf-gate-vernonkeenan.yaml \
--target=./api/research \ --target=./api/research \
--client-package=research-client \ --client-package=research-client \
--model-package=research-models \ --model-package=research-models \
@ -115,7 +115,7 @@ swagger:
--log-output=./swagger/logs/generate-workflow-client.log \ --log-output=./swagger/logs/generate-workflow-client.log \
--copyright-file=./build/COPYRIGHT \ --copyright-file=./build/COPYRIGHT \
--name=workflow \ --name=workflow \
--spec=./swagger/workflow-kvision.yaml \ --spec=./swagger/workflow-vernonkeenan.yaml \
--target=./api/workflow \ --target=./api/workflow \
--client-package=workflow-client \ --client-package=workflow-client \
--model-package=workflow-models \ --model-package=workflow-models \

View File

@ -1,5 +1,26 @@
# lib # lib
VernonKeenan/KVision Shared Libraries (go) vernonkeenan Shared Libraries (go)
New Version! ## Dependent Systems
The Gitea server <https://code.tnxs.net> must be up and running with admin access.
## Update Procedure
Prerequisite: All the other repos are cloned locally in adjacent directories.
* Increment branch number in local repo
* Generate all OpenAPI libraries and then cleanup modules
```bash
make swagger
go get -u -f ./...
go mod tidy
```
* Commit and push new branch to GitHub
* On GitHub goto <https://github.com/vernonkeenan/lib/settings/branches> set the new branch to default.
* On Gitea goto <https://code.tnxs.net/vernonkeenan/lib/settings> and click Synchronize Now.

View File

@ -229,6 +229,8 @@ func (m *User) validateAddress(formats strfmt.Registry) error {
if err := m.Address.Validate(formats); err != nil { if err := m.Address.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Address") return ve.ValidateName("Address")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Address")
} }
return err return err
} }
@ -251,6 +253,8 @@ func (m *User) validateTenantUsers(formats strfmt.Registry) error {
if err := m.TenantUsers[i].Validate(formats); err != nil { if err := m.TenantUsers[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("TenantUsers" + "." + strconv.Itoa(i)) return ve.ValidateName("TenantUsers" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("TenantUsers" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -275,6 +279,8 @@ func (m *User) validateUserRoles(formats strfmt.Registry) error {
if err := m.UserRoles[i].Validate(formats); err != nil { if err := m.UserRoles[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("UserRoles" + "." + strconv.Itoa(i)) return ve.ValidateName("UserRoles" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("UserRoles" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -313,6 +319,8 @@ func (m *User) contextValidateAddress(ctx context.Context, formats strfmt.Regist
if err := m.Address.ContextValidate(ctx, formats); err != nil { if err := m.Address.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Address") return ve.ValidateName("Address")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Address")
} }
return err return err
} }
@ -329,6 +337,8 @@ func (m *User) contextValidateTenantUsers(ctx context.Context, formats strfmt.Re
if err := m.TenantUsers[i].ContextValidate(ctx, formats); err != nil { if err := m.TenantUsers[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("TenantUsers" + "." + strconv.Itoa(i)) return ve.ValidateName("TenantUsers" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("TenantUsers" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -347,6 +357,8 @@ func (m *User) contextValidateUserRoles(ctx context.Context, formats strfmt.Regi
if err := m.UserRoles[i].ContextValidate(ctx, formats); err != nil { if err := m.UserRoles[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("UserRoles" + "." + strconv.Itoa(i)) return ve.ValidateName("UserRoles" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("UserRoles" + "." + strconv.Itoa(i))
} }
return err return err
} }

View File

@ -62,6 +62,8 @@ func (m *UserResponse) validateData(formats strfmt.Registry) error {
if err := m.Data[i].Validate(formats); err != nil { if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i)) return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -81,6 +83,8 @@ func (m *UserResponse) validateMeta(formats strfmt.Registry) error {
if err := m.Meta.Validate(formats); err != nil { if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta") return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Meta")
} }
return err return err
} }
@ -115,6 +119,8 @@ func (m *UserResponse) contextValidateData(ctx context.Context, formats strfmt.R
if err := m.Data[i].ContextValidate(ctx, formats); err != nil { if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i)) return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -131,6 +137,8 @@ func (m *UserResponse) contextValidateMeta(ctx context.Context, formats strfmt.R
if err := m.Meta.ContextValidate(ctx, formats); err != nil { if err := m.Meta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta") return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Meta")
} }
return err return err
} }

View File

@ -0,0 +1,258 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package contracts
// 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 contracts API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
return &Client{transport: transport, formats: formats}
}
/*
Client for contracts API
*/
type Client struct {
transport runtime.ClientTransport
formats strfmt.Registry
}
// ClientOption is the option for Client methods
type ClientOption func(*runtime.ClientOperation)
// ClientService is the interface for Client methods
type ClientService interface {
DeleteContract(params *DeleteContractParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteContractOK, error)
GetContracts(params *GetContractsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetContractsOK, error)
GetContractsObservable(params *GetContractsObservableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetContractsObservableOK, error)
PostContracts(params *PostContractsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostContractsOK, error)
PutContract(params *PutContractParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutContractOK, error)
SetTransport(transport runtime.ClientTransport)
}
/*
DeleteContract deletes an contract
Delete Taxnexus Contract record
*/
func (a *Client) DeleteContract(params *DeleteContractParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteContractOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewDeleteContractParams()
}
op := &runtime.ClientOperation{
ID: "deleteContract",
Method: "DELETE",
PathPattern: "/contracts",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &DeleteContractReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*DeleteContractOK)
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 deleteContract: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
GetContracts gets a list of contracts
Return a list of all available Contracts
*/
func (a *Client) GetContracts(params *GetContractsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetContractsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetContractsParams()
}
op := &runtime.ClientOperation{
ID: "getContracts",
Method: "GET",
PathPattern: "/contracts",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &GetContractsReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*GetContractsOK)
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 getContracts: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
GetContractsObservable gets taxnexus contracts in an observable array
A list of contracts in a simple JSON array
*/
func (a *Client) GetContractsObservable(params *GetContractsObservableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetContractsObservableOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetContractsObservableParams()
}
op := &runtime.ClientOperation{
ID: "getContractsObservable",
Method: "GET",
PathPattern: "/contracts/observable",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &GetContractsObservableReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*GetContractsObservableOK)
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 getContractsObservable: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
PostContracts adds a new contract to taxnexus
Contract record to be added
*/
func (a *Client) PostContracts(params *PostContractsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostContractsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPostContractsParams()
}
op := &runtime.ClientOperation{
ID: "postContracts",
Method: "POST",
PathPattern: "/contracts",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PostContractsReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*PostContractsOK)
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 postContracts: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
PutContract updates a single contract
Update a single contract specified by contractId
*/
func (a *Client) PutContract(params *PutContractParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutContractOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPutContractParams()
}
op := &runtime.ClientOperation{
ID: "putContract",
Method: "PUT",
PathPattern: "/contracts",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PutContractReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*PutContractOK)
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 putContract: 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
}

View File

@ -0,0 +1,165 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package contracts
// 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"
)
// NewDeleteContractParams creates a new DeleteContractParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewDeleteContractParams() *DeleteContractParams {
return &DeleteContractParams{
timeout: cr.DefaultTimeout,
}
}
// NewDeleteContractParamsWithTimeout creates a new DeleteContractParams object
// with the ability to set a timeout on a request.
func NewDeleteContractParamsWithTimeout(timeout time.Duration) *DeleteContractParams {
return &DeleteContractParams{
timeout: timeout,
}
}
// NewDeleteContractParamsWithContext creates a new DeleteContractParams object
// with the ability to set a context for a request.
func NewDeleteContractParamsWithContext(ctx context.Context) *DeleteContractParams {
return &DeleteContractParams{
Context: ctx,
}
}
// NewDeleteContractParamsWithHTTPClient creates a new DeleteContractParams object
// with the ability to set a custom HTTPClient for a request.
func NewDeleteContractParamsWithHTTPClient(client *http.Client) *DeleteContractParams {
return &DeleteContractParams{
HTTPClient: client,
}
}
/* DeleteContractParams contains all the parameters to send to the API endpoint
for the delete contract operation.
Typically these are written to a http.Request.
*/
type DeleteContractParams struct {
/* ContractID.
Taxnexus Contact record ID
*/
ContractID *string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the delete contract params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *DeleteContractParams) WithDefaults() *DeleteContractParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the delete contract params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *DeleteContractParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the delete contract params
func (o *DeleteContractParams) WithTimeout(timeout time.Duration) *DeleteContractParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the delete contract params
func (o *DeleteContractParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the delete contract params
func (o *DeleteContractParams) WithContext(ctx context.Context) *DeleteContractParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the delete contract params
func (o *DeleteContractParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the delete contract params
func (o *DeleteContractParams) WithHTTPClient(client *http.Client) *DeleteContractParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the delete contract params
func (o *DeleteContractParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithContractID adds the contractID to the delete contract params
func (o *DeleteContractParams) WithContractID(contractID *string) *DeleteContractParams {
o.SetContractID(contractID)
return o
}
// SetContractID adds the contractId to the delete contract params
func (o *DeleteContractParams) SetContractID(contractID *string) {
o.ContractID = contractID
}
// WriteToRequest writes these params to a swagger request
func (o *DeleteContractParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.ContractID != nil {
// query param contractId
var qrContractID string
if o.ContractID != nil {
qrContractID = *o.ContractID
}
qContractID := qrContractID
if qContractID != "" {
if err := r.SetQueryParam("contractId", qContractID); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,315 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package contracts
// 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"
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
)
// DeleteContractReader is a Reader for the DeleteContract structure.
type DeleteContractReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *DeleteContractReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewDeleteContractOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewDeleteContractUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewDeleteContractForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewDeleteContractNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewDeleteContractUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewDeleteContractInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
}
}
// NewDeleteContractOK creates a DeleteContractOK with default headers values
func NewDeleteContractOK() *DeleteContractOK {
return &DeleteContractOK{}
}
/* DeleteContractOK describes a response with status code 200, with default header values.
Taxnexus Response with Message Objects with Delete Status
*/
type DeleteContractOK struct {
AccessControlAllowOrigin string
Payload *crm_models.DeleteResponse
}
func (o *DeleteContractOK) Error() string {
return fmt.Sprintf("[DELETE /contracts][%d] deleteContractOK %+v", 200, o.Payload)
}
func (o *DeleteContractOK) GetPayload() *crm_models.DeleteResponse {
return o.Payload
}
func (o *DeleteContractOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
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
}
// NewDeleteContractUnauthorized creates a DeleteContractUnauthorized with default headers values
func NewDeleteContractUnauthorized() *DeleteContractUnauthorized {
return &DeleteContractUnauthorized{}
}
/* DeleteContractUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type DeleteContractUnauthorized struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *DeleteContractUnauthorized) Error() string {
return fmt.Sprintf("[DELETE /contracts][%d] deleteContractUnauthorized %+v", 401, o.Payload)
}
func (o *DeleteContractUnauthorized) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *DeleteContractUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
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
}
// NewDeleteContractForbidden creates a DeleteContractForbidden with default headers values
func NewDeleteContractForbidden() *DeleteContractForbidden {
return &DeleteContractForbidden{}
}
/* DeleteContractForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type DeleteContractForbidden struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *DeleteContractForbidden) Error() string {
return fmt.Sprintf("[DELETE /contracts][%d] deleteContractForbidden %+v", 403, o.Payload)
}
func (o *DeleteContractForbidden) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *DeleteContractForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
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
}
// NewDeleteContractNotFound creates a DeleteContractNotFound with default headers values
func NewDeleteContractNotFound() *DeleteContractNotFound {
return &DeleteContractNotFound{}
}
/* DeleteContractNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type DeleteContractNotFound struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *DeleteContractNotFound) Error() string {
return fmt.Sprintf("[DELETE /contracts][%d] deleteContractNotFound %+v", 404, o.Payload)
}
func (o *DeleteContractNotFound) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *DeleteContractNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
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
}
// NewDeleteContractUnprocessableEntity creates a DeleteContractUnprocessableEntity with default headers values
func NewDeleteContractUnprocessableEntity() *DeleteContractUnprocessableEntity {
return &DeleteContractUnprocessableEntity{}
}
/* DeleteContractUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type DeleteContractUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *DeleteContractUnprocessableEntity) Error() string {
return fmt.Sprintf("[DELETE /contracts][%d] deleteContractUnprocessableEntity %+v", 422, o.Payload)
}
func (o *DeleteContractUnprocessableEntity) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *DeleteContractUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
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
}
// NewDeleteContractInternalServerError creates a DeleteContractInternalServerError with default headers values
func NewDeleteContractInternalServerError() *DeleteContractInternalServerError {
return &DeleteContractInternalServerError{}
}
/* DeleteContractInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type DeleteContractInternalServerError struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *DeleteContractInternalServerError) Error() string {
return fmt.Sprintf("[DELETE /contracts][%d] deleteContractInternalServerError %+v", 500, o.Payload)
}
func (o *DeleteContractInternalServerError) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *DeleteContractInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
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
}

View File

@ -0,0 +1,200 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package contracts
// 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"
)
// NewGetContractsObservableParams creates a new GetContractsObservableParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewGetContractsObservableParams() *GetContractsObservableParams {
return &GetContractsObservableParams{
timeout: cr.DefaultTimeout,
}
}
// NewGetContractsObservableParamsWithTimeout creates a new GetContractsObservableParams object
// with the ability to set a timeout on a request.
func NewGetContractsObservableParamsWithTimeout(timeout time.Duration) *GetContractsObservableParams {
return &GetContractsObservableParams{
timeout: timeout,
}
}
// NewGetContractsObservableParamsWithContext creates a new GetContractsObservableParams object
// with the ability to set a context for a request.
func NewGetContractsObservableParamsWithContext(ctx context.Context) *GetContractsObservableParams {
return &GetContractsObservableParams{
Context: ctx,
}
}
// NewGetContractsObservableParamsWithHTTPClient creates a new GetContractsObservableParams object
// with the ability to set a custom HTTPClient for a request.
func NewGetContractsObservableParamsWithHTTPClient(client *http.Client) *GetContractsObservableParams {
return &GetContractsObservableParams{
HTTPClient: client,
}
}
/* GetContractsObservableParams contains all the parameters to send to the API endpoint
for the get contracts observable operation.
Typically these are written to a http.Request.
*/
type GetContractsObservableParams struct {
/* Active.
Only retrieve active records?
*/
Active *bool
/* ContractID.
Taxnexus Contact record ID
*/
ContractID *string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the get contracts observable params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetContractsObservableParams) WithDefaults() *GetContractsObservableParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the get contracts observable params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetContractsObservableParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the get contracts observable params
func (o *GetContractsObservableParams) WithTimeout(timeout time.Duration) *GetContractsObservableParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the get contracts observable params
func (o *GetContractsObservableParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the get contracts observable params
func (o *GetContractsObservableParams) WithContext(ctx context.Context) *GetContractsObservableParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get contracts observable params
func (o *GetContractsObservableParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the get contracts observable params
func (o *GetContractsObservableParams) WithHTTPClient(client *http.Client) *GetContractsObservableParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the get contracts observable params
func (o *GetContractsObservableParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithActive adds the active to the get contracts observable params
func (o *GetContractsObservableParams) WithActive(active *bool) *GetContractsObservableParams {
o.SetActive(active)
return o
}
// SetActive adds the active to the get contracts observable params
func (o *GetContractsObservableParams) SetActive(active *bool) {
o.Active = active
}
// WithContractID adds the contractID to the get contracts observable params
func (o *GetContractsObservableParams) WithContractID(contractID *string) *GetContractsObservableParams {
o.SetContractID(contractID)
return o
}
// SetContractID adds the contractId to the get contracts observable params
func (o *GetContractsObservableParams) SetContractID(contractID *string) {
o.ContractID = contractID
}
// WriteToRequest writes these params to a swagger request
func (o *GetContractsObservableParams) 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.ContractID != nil {
// query param contractId
var qrContractID string
if o.ContractID != nil {
qrContractID = *o.ContractID
}
qContractID := qrContractID
if qContractID != "" {
if err := r.SetQueryParam("contractId", qContractID); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,321 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package contracts
// 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"
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
)
// GetContractsObservableReader is a Reader for the GetContractsObservable structure.
type GetContractsObservableReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetContractsObservableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetContractsObservableOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewGetContractsObservableUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewGetContractsObservableForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewGetContractsObservableNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewGetContractsObservableUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewGetContractsObservableInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
}
}
// NewGetContractsObservableOK creates a GetContractsObservableOK with default headers values
func NewGetContractsObservableOK() *GetContractsObservableOK {
return &GetContractsObservableOK{}
}
/* GetContractsObservableOK describes a response with status code 200, with default header values.
Taxnexus Response with an array of Contract objects
*/
type GetContractsObservableOK struct {
AccessControlAllowOrigin string
CacheControl string
Payload []*crm_models.Contract
}
func (o *GetContractsObservableOK) Error() string {
return fmt.Sprintf("[GET /contracts/observable][%d] getContractsObservableOK %+v", 200, o.Payload)
}
func (o *GetContractsObservableOK) GetPayload() []*crm_models.Contract {
return o.Payload
}
func (o *GetContractsObservableOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
// hydrates response header Cache-Control
hdrCacheControl := response.GetHeader("Cache-Control")
if hdrCacheControl != "" {
o.CacheControl = hdrCacheControl
}
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetContractsObservableUnauthorized creates a GetContractsObservableUnauthorized with default headers values
func NewGetContractsObservableUnauthorized() *GetContractsObservableUnauthorized {
return &GetContractsObservableUnauthorized{}
}
/* GetContractsObservableUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type GetContractsObservableUnauthorized struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *GetContractsObservableUnauthorized) Error() string {
return fmt.Sprintf("[GET /contracts/observable][%d] getContractsObservableUnauthorized %+v", 401, o.Payload)
}
func (o *GetContractsObservableUnauthorized) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *GetContractsObservableUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
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
}
// NewGetContractsObservableForbidden creates a GetContractsObservableForbidden with default headers values
func NewGetContractsObservableForbidden() *GetContractsObservableForbidden {
return &GetContractsObservableForbidden{}
}
/* GetContractsObservableForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type GetContractsObservableForbidden struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *GetContractsObservableForbidden) Error() string {
return fmt.Sprintf("[GET /contracts/observable][%d] getContractsObservableForbidden %+v", 403, o.Payload)
}
func (o *GetContractsObservableForbidden) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *GetContractsObservableForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
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
}
// NewGetContractsObservableNotFound creates a GetContractsObservableNotFound with default headers values
func NewGetContractsObservableNotFound() *GetContractsObservableNotFound {
return &GetContractsObservableNotFound{}
}
/* GetContractsObservableNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type GetContractsObservableNotFound struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *GetContractsObservableNotFound) Error() string {
return fmt.Sprintf("[GET /contracts/observable][%d] getContractsObservableNotFound %+v", 404, o.Payload)
}
func (o *GetContractsObservableNotFound) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *GetContractsObservableNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
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
}
// NewGetContractsObservableUnprocessableEntity creates a GetContractsObservableUnprocessableEntity with default headers values
func NewGetContractsObservableUnprocessableEntity() *GetContractsObservableUnprocessableEntity {
return &GetContractsObservableUnprocessableEntity{}
}
/* GetContractsObservableUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type GetContractsObservableUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *GetContractsObservableUnprocessableEntity) Error() string {
return fmt.Sprintf("[GET /contracts/observable][%d] getContractsObservableUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetContractsObservableUnprocessableEntity) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *GetContractsObservableUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
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
}
// NewGetContractsObservableInternalServerError creates a GetContractsObservableInternalServerError with default headers values
func NewGetContractsObservableInternalServerError() *GetContractsObservableInternalServerError {
return &GetContractsObservableInternalServerError{}
}
/* GetContractsObservableInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type GetContractsObservableInternalServerError struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *GetContractsObservableInternalServerError) Error() string {
return fmt.Sprintf("[GET /contracts/observable][%d] getContractsObservableInternalServerError %+v", 500, o.Payload)
}
func (o *GetContractsObservableInternalServerError) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *GetContractsObservableInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
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
}

View File

@ -0,0 +1,272 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package contracts
// 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"
)
// NewGetContractsParams creates a new GetContractsParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewGetContractsParams() *GetContractsParams {
return &GetContractsParams{
timeout: cr.DefaultTimeout,
}
}
// NewGetContractsParamsWithTimeout creates a new GetContractsParams object
// with the ability to set a timeout on a request.
func NewGetContractsParamsWithTimeout(timeout time.Duration) *GetContractsParams {
return &GetContractsParams{
timeout: timeout,
}
}
// NewGetContractsParamsWithContext creates a new GetContractsParams object
// with the ability to set a context for a request.
func NewGetContractsParamsWithContext(ctx context.Context) *GetContractsParams {
return &GetContractsParams{
Context: ctx,
}
}
// NewGetContractsParamsWithHTTPClient creates a new GetContractsParams object
// with the ability to set a custom HTTPClient for a request.
func NewGetContractsParamsWithHTTPClient(client *http.Client) *GetContractsParams {
return &GetContractsParams{
HTTPClient: client,
}
}
/* GetContractsParams contains all the parameters to send to the API endpoint
for the get contracts operation.
Typically these are written to a http.Request.
*/
type GetContractsParams struct {
/* Active.
Only retrieve active records?
*/
Active *bool
/* ContractID.
Taxnexus Contact record ID
*/
ContractID *string
/* Limit.
How many objects to return at one time
Format: int64
*/
Limit *int64
/* Offset.
How many objects to skip?
Format: int64
*/
Offset *int64
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the get contracts params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetContractsParams) WithDefaults() *GetContractsParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the get contracts params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetContractsParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the get contracts params
func (o *GetContractsParams) WithTimeout(timeout time.Duration) *GetContractsParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the get contracts params
func (o *GetContractsParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the get contracts params
func (o *GetContractsParams) WithContext(ctx context.Context) *GetContractsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get contracts params
func (o *GetContractsParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the get contracts params
func (o *GetContractsParams) WithHTTPClient(client *http.Client) *GetContractsParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the get contracts params
func (o *GetContractsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithActive adds the active to the get contracts params
func (o *GetContractsParams) WithActive(active *bool) *GetContractsParams {
o.SetActive(active)
return o
}
// SetActive adds the active to the get contracts params
func (o *GetContractsParams) SetActive(active *bool) {
o.Active = active
}
// WithContractID adds the contractID to the get contracts params
func (o *GetContractsParams) WithContractID(contractID *string) *GetContractsParams {
o.SetContractID(contractID)
return o
}
// SetContractID adds the contractId to the get contracts params
func (o *GetContractsParams) SetContractID(contractID *string) {
o.ContractID = contractID
}
// WithLimit adds the limit to the get contracts params
func (o *GetContractsParams) WithLimit(limit *int64) *GetContractsParams {
o.SetLimit(limit)
return o
}
// SetLimit adds the limit to the get contracts params
func (o *GetContractsParams) SetLimit(limit *int64) {
o.Limit = limit
}
// WithOffset adds the offset to the get contracts params
func (o *GetContractsParams) WithOffset(offset *int64) *GetContractsParams {
o.SetOffset(offset)
return o
}
// SetOffset adds the offset to the get contracts params
func (o *GetContractsParams) SetOffset(offset *int64) {
o.Offset = offset
}
// WriteToRequest writes these params to a swagger request
func (o *GetContractsParams) 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.ContractID != nil {
// query param contractId
var qrContractID string
if o.ContractID != nil {
qrContractID = *o.ContractID
}
qContractID := qrContractID
if qContractID != "" {
if err := r.SetQueryParam("contractId", qContractID); 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
}

View File

@ -0,0 +1,323 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package contracts
// 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"
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
)
// GetContractsReader is a Reader for the GetContracts structure.
type GetContractsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetContractsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetContractsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewGetContractsUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewGetContractsForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewGetContractsNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewGetContractsUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewGetContractsInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
}
}
// NewGetContractsOK creates a GetContractsOK with default headers values
func NewGetContractsOK() *GetContractsOK {
return &GetContractsOK{}
}
/* GetContractsOK describes a response with status code 200, with default header values.
Taxnexus Response with an array of Contract objects
*/
type GetContractsOK struct {
AccessControlAllowOrigin string
CacheControl string
Payload *crm_models.ContractResponse
}
func (o *GetContractsOK) Error() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsOK %+v", 200, o.Payload)
}
func (o *GetContractsOK) GetPayload() *crm_models.ContractResponse {
return o.Payload
}
func (o *GetContractsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
// hydrates response header Cache-Control
hdrCacheControl := response.GetHeader("Cache-Control")
if hdrCacheControl != "" {
o.CacheControl = hdrCacheControl
}
o.Payload = new(crm_models.ContractResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetContractsUnauthorized creates a GetContractsUnauthorized with default headers values
func NewGetContractsUnauthorized() *GetContractsUnauthorized {
return &GetContractsUnauthorized{}
}
/* GetContractsUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type GetContractsUnauthorized struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *GetContractsUnauthorized) Error() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsUnauthorized %+v", 401, o.Payload)
}
func (o *GetContractsUnauthorized) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *GetContractsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
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
}
// NewGetContractsForbidden creates a GetContractsForbidden with default headers values
func NewGetContractsForbidden() *GetContractsForbidden {
return &GetContractsForbidden{}
}
/* GetContractsForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type GetContractsForbidden struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *GetContractsForbidden) Error() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsForbidden %+v", 403, o.Payload)
}
func (o *GetContractsForbidden) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *GetContractsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
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
}
// NewGetContractsNotFound creates a GetContractsNotFound with default headers values
func NewGetContractsNotFound() *GetContractsNotFound {
return &GetContractsNotFound{}
}
/* GetContractsNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type GetContractsNotFound struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *GetContractsNotFound) Error() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsNotFound %+v", 404, o.Payload)
}
func (o *GetContractsNotFound) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *GetContractsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
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
}
// NewGetContractsUnprocessableEntity creates a GetContractsUnprocessableEntity with default headers values
func NewGetContractsUnprocessableEntity() *GetContractsUnprocessableEntity {
return &GetContractsUnprocessableEntity{}
}
/* GetContractsUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type GetContractsUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *GetContractsUnprocessableEntity) Error() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetContractsUnprocessableEntity) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *GetContractsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
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
}
// NewGetContractsInternalServerError creates a GetContractsInternalServerError with default headers values
func NewGetContractsInternalServerError() *GetContractsInternalServerError {
return &GetContractsInternalServerError{}
}
/* GetContractsInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type GetContractsInternalServerError struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *GetContractsInternalServerError) Error() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsInternalServerError %+v", 500, o.Payload)
}
func (o *GetContractsInternalServerError) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *GetContractsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
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
}

View File

@ -0,0 +1,155 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package contracts
// 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"
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
)
// NewPostContractsParams creates a new PostContractsParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewPostContractsParams() *PostContractsParams {
return &PostContractsParams{
timeout: cr.DefaultTimeout,
}
}
// NewPostContractsParamsWithTimeout creates a new PostContractsParams object
// with the ability to set a timeout on a request.
func NewPostContractsParamsWithTimeout(timeout time.Duration) *PostContractsParams {
return &PostContractsParams{
timeout: timeout,
}
}
// NewPostContractsParamsWithContext creates a new PostContractsParams object
// with the ability to set a context for a request.
func NewPostContractsParamsWithContext(ctx context.Context) *PostContractsParams {
return &PostContractsParams{
Context: ctx,
}
}
// NewPostContractsParamsWithHTTPClient creates a new PostContractsParams object
// with the ability to set a custom HTTPClient for a request.
func NewPostContractsParamsWithHTTPClient(client *http.Client) *PostContractsParams {
return &PostContractsParams{
HTTPClient: client,
}
}
/* PostContractsParams contains all the parameters to send to the API endpoint
for the post contracts operation.
Typically these are written to a http.Request.
*/
type PostContractsParams struct {
/* ContractsRequest.
An array of new Contract records
*/
ContractsRequest *crm_models.ContractRequest
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the post contracts params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostContractsParams) WithDefaults() *PostContractsParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the post contracts params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostContractsParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the post contracts params
func (o *PostContractsParams) WithTimeout(timeout time.Duration) *PostContractsParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the post contracts params
func (o *PostContractsParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the post contracts params
func (o *PostContractsParams) WithContext(ctx context.Context) *PostContractsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the post contracts params
func (o *PostContractsParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the post contracts params
func (o *PostContractsParams) WithHTTPClient(client *http.Client) *PostContractsParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the post contracts params
func (o *PostContractsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithContractsRequest adds the contractsRequest to the post contracts params
func (o *PostContractsParams) WithContractsRequest(contractsRequest *crm_models.ContractRequest) *PostContractsParams {
o.SetContractsRequest(contractsRequest)
return o
}
// SetContractsRequest adds the contractsRequest to the post contracts params
func (o *PostContractsParams) SetContractsRequest(contractsRequest *crm_models.ContractRequest) {
o.ContractsRequest = contractsRequest
}
// WriteToRequest writes these params to a swagger request
func (o *PostContractsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.ContractsRequest != nil {
if err := r.SetBodyParam(o.ContractsRequest); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,323 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package contracts
// 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"
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
)
// PostContractsReader is a Reader for the PostContracts structure.
type PostContractsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PostContractsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewPostContractsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewPostContractsUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewPostContractsForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewPostContractsNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewPostContractsUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewPostContractsInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
}
}
// NewPostContractsOK creates a PostContractsOK with default headers values
func NewPostContractsOK() *PostContractsOK {
return &PostContractsOK{}
}
/* PostContractsOK describes a response with status code 200, with default header values.
Taxnexus Response with an array of Contract objects
*/
type PostContractsOK struct {
AccessControlAllowOrigin string
CacheControl string
Payload *crm_models.ContractResponse
}
func (o *PostContractsOK) Error() string {
return fmt.Sprintf("[POST /contracts][%d] postContractsOK %+v", 200, o.Payload)
}
func (o *PostContractsOK) GetPayload() *crm_models.ContractResponse {
return o.Payload
}
func (o *PostContractsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
// hydrates response header Cache-Control
hdrCacheControl := response.GetHeader("Cache-Control")
if hdrCacheControl != "" {
o.CacheControl = hdrCacheControl
}
o.Payload = new(crm_models.ContractResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostContractsUnauthorized creates a PostContractsUnauthorized with default headers values
func NewPostContractsUnauthorized() *PostContractsUnauthorized {
return &PostContractsUnauthorized{}
}
/* PostContractsUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type PostContractsUnauthorized struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *PostContractsUnauthorized) Error() string {
return fmt.Sprintf("[POST /contracts][%d] postContractsUnauthorized %+v", 401, o.Payload)
}
func (o *PostContractsUnauthorized) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *PostContractsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
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
}
// NewPostContractsForbidden creates a PostContractsForbidden with default headers values
func NewPostContractsForbidden() *PostContractsForbidden {
return &PostContractsForbidden{}
}
/* PostContractsForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type PostContractsForbidden struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *PostContractsForbidden) Error() string {
return fmt.Sprintf("[POST /contracts][%d] postContractsForbidden %+v", 403, o.Payload)
}
func (o *PostContractsForbidden) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *PostContractsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
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
}
// NewPostContractsNotFound creates a PostContractsNotFound with default headers values
func NewPostContractsNotFound() *PostContractsNotFound {
return &PostContractsNotFound{}
}
/* PostContractsNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type PostContractsNotFound struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *PostContractsNotFound) Error() string {
return fmt.Sprintf("[POST /contracts][%d] postContractsNotFound %+v", 404, o.Payload)
}
func (o *PostContractsNotFound) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *PostContractsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
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
}
// NewPostContractsUnprocessableEntity creates a PostContractsUnprocessableEntity with default headers values
func NewPostContractsUnprocessableEntity() *PostContractsUnprocessableEntity {
return &PostContractsUnprocessableEntity{}
}
/* PostContractsUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type PostContractsUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *PostContractsUnprocessableEntity) Error() string {
return fmt.Sprintf("[POST /contracts][%d] postContractsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PostContractsUnprocessableEntity) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *PostContractsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
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
}
// NewPostContractsInternalServerError creates a PostContractsInternalServerError with default headers values
func NewPostContractsInternalServerError() *PostContractsInternalServerError {
return &PostContractsInternalServerError{}
}
/* PostContractsInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type PostContractsInternalServerError struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *PostContractsInternalServerError) Error() string {
return fmt.Sprintf("[POST /contracts][%d] postContractsInternalServerError %+v", 500, o.Payload)
}
func (o *PostContractsInternalServerError) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *PostContractsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
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
}

View File

@ -0,0 +1,155 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package contracts
// 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"
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
)
// NewPutContractParams creates a new PutContractParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewPutContractParams() *PutContractParams {
return &PutContractParams{
timeout: cr.DefaultTimeout,
}
}
// NewPutContractParamsWithTimeout creates a new PutContractParams object
// with the ability to set a timeout on a request.
func NewPutContractParamsWithTimeout(timeout time.Duration) *PutContractParams {
return &PutContractParams{
timeout: timeout,
}
}
// NewPutContractParamsWithContext creates a new PutContractParams object
// with the ability to set a context for a request.
func NewPutContractParamsWithContext(ctx context.Context) *PutContractParams {
return &PutContractParams{
Context: ctx,
}
}
// NewPutContractParamsWithHTTPClient creates a new PutContractParams object
// with the ability to set a custom HTTPClient for a request.
func NewPutContractParamsWithHTTPClient(client *http.Client) *PutContractParams {
return &PutContractParams{
HTTPClient: client,
}
}
/* PutContractParams contains all the parameters to send to the API endpoint
for the put contract operation.
Typically these are written to a http.Request.
*/
type PutContractParams struct {
/* ContractsRequest.
An array of new Contract records
*/
ContractsRequest *crm_models.ContractRequest
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the put contract params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PutContractParams) WithDefaults() *PutContractParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the put contract params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PutContractParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the put contract params
func (o *PutContractParams) WithTimeout(timeout time.Duration) *PutContractParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the put contract params
func (o *PutContractParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the put contract params
func (o *PutContractParams) WithContext(ctx context.Context) *PutContractParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the put contract params
func (o *PutContractParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the put contract params
func (o *PutContractParams) WithHTTPClient(client *http.Client) *PutContractParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the put contract params
func (o *PutContractParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithContractsRequest adds the contractsRequest to the put contract params
func (o *PutContractParams) WithContractsRequest(contractsRequest *crm_models.ContractRequest) *PutContractParams {
o.SetContractsRequest(contractsRequest)
return o
}
// SetContractsRequest adds the contractsRequest to the put contract params
func (o *PutContractParams) SetContractsRequest(contractsRequest *crm_models.ContractRequest) {
o.ContractsRequest = contractsRequest
}
// WriteToRequest writes these params to a swagger request
func (o *PutContractParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.ContractsRequest != nil {
if err := r.SetBodyParam(o.ContractsRequest); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,323 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package contracts
// 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"
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
)
// PutContractReader is a Reader for the PutContract structure.
type PutContractReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PutContractReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewPutContractOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewPutContractUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewPutContractForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewPutContractNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewPutContractUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewPutContractInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
}
}
// NewPutContractOK creates a PutContractOK with default headers values
func NewPutContractOK() *PutContractOK {
return &PutContractOK{}
}
/* PutContractOK describes a response with status code 200, with default header values.
Taxnexus Response with an array of Contract objects
*/
type PutContractOK struct {
AccessControlAllowOrigin string
CacheControl string
Payload *crm_models.ContractResponse
}
func (o *PutContractOK) Error() string {
return fmt.Sprintf("[PUT /contracts][%d] putContractOK %+v", 200, o.Payload)
}
func (o *PutContractOK) GetPayload() *crm_models.ContractResponse {
return o.Payload
}
func (o *PutContractOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
// hydrates response header Cache-Control
hdrCacheControl := response.GetHeader("Cache-Control")
if hdrCacheControl != "" {
o.CacheControl = hdrCacheControl
}
o.Payload = new(crm_models.ContractResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPutContractUnauthorized creates a PutContractUnauthorized with default headers values
func NewPutContractUnauthorized() *PutContractUnauthorized {
return &PutContractUnauthorized{}
}
/* PutContractUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type PutContractUnauthorized struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *PutContractUnauthorized) Error() string {
return fmt.Sprintf("[PUT /contracts][%d] putContractUnauthorized %+v", 401, o.Payload)
}
func (o *PutContractUnauthorized) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *PutContractUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
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
}
// NewPutContractForbidden creates a PutContractForbidden with default headers values
func NewPutContractForbidden() *PutContractForbidden {
return &PutContractForbidden{}
}
/* PutContractForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type PutContractForbidden struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *PutContractForbidden) Error() string {
return fmt.Sprintf("[PUT /contracts][%d] putContractForbidden %+v", 403, o.Payload)
}
func (o *PutContractForbidden) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *PutContractForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
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
}
// NewPutContractNotFound creates a PutContractNotFound with default headers values
func NewPutContractNotFound() *PutContractNotFound {
return &PutContractNotFound{}
}
/* PutContractNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type PutContractNotFound struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *PutContractNotFound) Error() string {
return fmt.Sprintf("[PUT /contracts][%d] putContractNotFound %+v", 404, o.Payload)
}
func (o *PutContractNotFound) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *PutContractNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
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
}
// NewPutContractUnprocessableEntity creates a PutContractUnprocessableEntity with default headers values
func NewPutContractUnprocessableEntity() *PutContractUnprocessableEntity {
return &PutContractUnprocessableEntity{}
}
/* PutContractUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type PutContractUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *PutContractUnprocessableEntity) Error() string {
return fmt.Sprintf("[PUT /contracts][%d] putContractUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PutContractUnprocessableEntity) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *PutContractUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
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
}
// NewPutContractInternalServerError creates a PutContractInternalServerError with default headers values
func NewPutContractInternalServerError() *PutContractInternalServerError {
return &PutContractInternalServerError{}
}
/* PutContractInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type PutContractInternalServerError struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *PutContractInternalServerError) Error() string {
return fmt.Sprintf("[PUT /contracts][%d] putContractInternalServerError %+v", 500, o.Payload)
}
func (o *PutContractInternalServerError) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *PutContractInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
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
}

View File

@ -0,0 +1,130 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-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"
)
// NewContractOptionsObservableParams creates a new ContractOptionsObservableParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewContractOptionsObservableParams() *ContractOptionsObservableParams {
return &ContractOptionsObservableParams{
timeout: cr.DefaultTimeout,
}
}
// NewContractOptionsObservableParamsWithTimeout creates a new ContractOptionsObservableParams object
// with the ability to set a timeout on a request.
func NewContractOptionsObservableParamsWithTimeout(timeout time.Duration) *ContractOptionsObservableParams {
return &ContractOptionsObservableParams{
timeout: timeout,
}
}
// NewContractOptionsObservableParamsWithContext creates a new ContractOptionsObservableParams object
// with the ability to set a context for a request.
func NewContractOptionsObservableParamsWithContext(ctx context.Context) *ContractOptionsObservableParams {
return &ContractOptionsObservableParams{
Context: ctx,
}
}
// NewContractOptionsObservableParamsWithHTTPClient creates a new ContractOptionsObservableParams object
// with the ability to set a custom HTTPClient for a request.
func NewContractOptionsObservableParamsWithHTTPClient(client *http.Client) *ContractOptionsObservableParams {
return &ContractOptionsObservableParams{
HTTPClient: client,
}
}
/* ContractOptionsObservableParams contains all the parameters to send to the API endpoint
for the contract options observable operation.
Typically these are written to a http.Request.
*/
type ContractOptionsObservableParams struct {
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the contract options observable params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *ContractOptionsObservableParams) WithDefaults() *ContractOptionsObservableParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the contract options observable params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *ContractOptionsObservableParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the contract options observable params
func (o *ContractOptionsObservableParams) WithTimeout(timeout time.Duration) *ContractOptionsObservableParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the contract options observable params
func (o *ContractOptionsObservableParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the contract options observable params
func (o *ContractOptionsObservableParams) WithContext(ctx context.Context) *ContractOptionsObservableParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the contract options observable params
func (o *ContractOptionsObservableParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the contract options observable params
func (o *ContractOptionsObservableParams) WithHTTPClient(client *http.Client) *ContractOptionsObservableParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the contract options observable params
func (o *ContractOptionsObservableParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WriteToRequest writes these params to a swagger request
func (o *ContractOptionsObservableParams) 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
}

View File

@ -0,0 +1,113 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-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"
)
// ContractOptionsObservableReader is a Reader for the ContractOptionsObservable structure.
type ContractOptionsObservableReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *ContractOptionsObservableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewContractOptionsObservableOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
default:
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
}
}
// NewContractOptionsObservableOK creates a ContractOptionsObservableOK with default headers values
func NewContractOptionsObservableOK() *ContractOptionsObservableOK {
return &ContractOptionsObservableOK{}
}
/* ContractOptionsObservableOK describes a response with status code 200, with default header values.
CORS OPTIONS response
*/
type ContractOptionsObservableOK struct {
AccessControlAllowCredentials string
AccessControlAllowHeaders string
AccessControlAllowMethods string
AccessControlAllowOrigin string
AccessControlExposeHeaders string
AccessControlMaxAge string
CacheControl string
}
func (o *ContractOptionsObservableOK) Error() string {
return fmt.Sprintf("[OPTIONS /contracts/observable][%d] contractOptionsObservableOK ", 200)
}
func (o *ContractOptionsObservableOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Credentials
hdrAccessControlAllowCredentials := response.GetHeader("Access-Control-Allow-Credentials")
if hdrAccessControlAllowCredentials != "" {
o.AccessControlAllowCredentials = hdrAccessControlAllowCredentials
}
// hydrates response header Access-Control-Allow-Headers
hdrAccessControlAllowHeaders := response.GetHeader("Access-Control-Allow-Headers")
if hdrAccessControlAllowHeaders != "" {
o.AccessControlAllowHeaders = hdrAccessControlAllowHeaders
}
// hydrates response header Access-Control-Allow-Methods
hdrAccessControlAllowMethods := response.GetHeader("Access-Control-Allow-Methods")
if hdrAccessControlAllowMethods != "" {
o.AccessControlAllowMethods = hdrAccessControlAllowMethods
}
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
// hydrates response header Access-Control-Expose-Headers
hdrAccessControlExposeHeaders := response.GetHeader("Access-Control-Expose-Headers")
if hdrAccessControlExposeHeaders != "" {
o.AccessControlExposeHeaders = hdrAccessControlExposeHeaders
}
// hydrates response header Access-Control-Max-Age
hdrAccessControlMaxAge := response.GetHeader("Access-Control-Max-Age")
if hdrAccessControlMaxAge != "" {
o.AccessControlMaxAge = hdrAccessControlMaxAge
}
// hydrates response header Cache-Control
hdrCacheControl := response.GetHeader("Cache-Control")
if hdrCacheControl != "" {
o.CacheControl = hdrCacheControl
}
return nil
}

View File

@ -0,0 +1,130 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-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"
)
// NewContractOptionsParams creates a new ContractOptionsParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewContractOptionsParams() *ContractOptionsParams {
return &ContractOptionsParams{
timeout: cr.DefaultTimeout,
}
}
// NewContractOptionsParamsWithTimeout creates a new ContractOptionsParams object
// with the ability to set a timeout on a request.
func NewContractOptionsParamsWithTimeout(timeout time.Duration) *ContractOptionsParams {
return &ContractOptionsParams{
timeout: timeout,
}
}
// NewContractOptionsParamsWithContext creates a new ContractOptionsParams object
// with the ability to set a context for a request.
func NewContractOptionsParamsWithContext(ctx context.Context) *ContractOptionsParams {
return &ContractOptionsParams{
Context: ctx,
}
}
// NewContractOptionsParamsWithHTTPClient creates a new ContractOptionsParams object
// with the ability to set a custom HTTPClient for a request.
func NewContractOptionsParamsWithHTTPClient(client *http.Client) *ContractOptionsParams {
return &ContractOptionsParams{
HTTPClient: client,
}
}
/* ContractOptionsParams contains all the parameters to send to the API endpoint
for the contract options operation.
Typically these are written to a http.Request.
*/
type ContractOptionsParams struct {
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the contract options params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *ContractOptionsParams) WithDefaults() *ContractOptionsParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the contract options params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *ContractOptionsParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the contract options params
func (o *ContractOptionsParams) WithTimeout(timeout time.Duration) *ContractOptionsParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the contract options params
func (o *ContractOptionsParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the contract options params
func (o *ContractOptionsParams) WithContext(ctx context.Context) *ContractOptionsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the contract options params
func (o *ContractOptionsParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the contract options params
func (o *ContractOptionsParams) WithHTTPClient(client *http.Client) *ContractOptionsParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the contract options params
func (o *ContractOptionsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WriteToRequest writes these params to a swagger request
func (o *ContractOptionsParams) 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
}

View File

@ -0,0 +1,113 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-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"
)
// ContractOptionsReader is a Reader for the ContractOptions structure.
type ContractOptionsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *ContractOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewContractOptionsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
default:
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
}
}
// NewContractOptionsOK creates a ContractOptionsOK with default headers values
func NewContractOptionsOK() *ContractOptionsOK {
return &ContractOptionsOK{}
}
/* ContractOptionsOK describes a response with status code 200, with default header values.
CORS OPTIONS response
*/
type ContractOptionsOK struct {
AccessControlAllowCredentials string
AccessControlAllowHeaders string
AccessControlAllowMethods string
AccessControlAllowOrigin string
AccessControlExposeHeaders string
AccessControlMaxAge string
CacheControl string
}
func (o *ContractOptionsOK) Error() string {
return fmt.Sprintf("[OPTIONS /contracts][%d] contractOptionsOK ", 200)
}
func (o *ContractOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Credentials
hdrAccessControlAllowCredentials := response.GetHeader("Access-Control-Allow-Credentials")
if hdrAccessControlAllowCredentials != "" {
o.AccessControlAllowCredentials = hdrAccessControlAllowCredentials
}
// hydrates response header Access-Control-Allow-Headers
hdrAccessControlAllowHeaders := response.GetHeader("Access-Control-Allow-Headers")
if hdrAccessControlAllowHeaders != "" {
o.AccessControlAllowHeaders = hdrAccessControlAllowHeaders
}
// hydrates response header Access-Control-Allow-Methods
hdrAccessControlAllowMethods := response.GetHeader("Access-Control-Allow-Methods")
if hdrAccessControlAllowMethods != "" {
o.AccessControlAllowMethods = hdrAccessControlAllowMethods
}
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
// hydrates response header Access-Control-Expose-Headers
hdrAccessControlExposeHeaders := response.GetHeader("Access-Control-Expose-Headers")
if hdrAccessControlExposeHeaders != "" {
o.AccessControlExposeHeaders = hdrAccessControlExposeHeaders
}
// hydrates response header Access-Control-Max-Age
hdrAccessControlMaxAge := response.GetHeader("Access-Control-Max-Age")
if hdrAccessControlMaxAge != "" {
o.AccessControlMaxAge = hdrAccessControlMaxAge
}
// hydrates response header Cache-Control
hdrCacheControl := response.GetHeader("Cache-Control")
if hdrCacheControl != "" {
o.CacheControl = hdrCacheControl
}
return nil
}

View File

@ -42,6 +42,10 @@ type ClientService interface {
ContactOptionsObservable(params *ContactOptionsObservableParams, opts ...ClientOption) (*ContactOptionsObservableOK, error) ContactOptionsObservable(params *ContactOptionsObservableParams, opts ...ClientOption) (*ContactOptionsObservableOK, error)
ContractOptions(params *ContractOptionsParams, opts ...ClientOption) (*ContractOptionsOK, error)
ContractOptionsObservable(params *ContractOptionsObservableParams, opts ...ClientOption) (*ContractOptionsObservableOK, error)
LeadOptions(params *LeadOptionsParams, opts ...ClientOption) (*LeadOptionsOK, error) LeadOptions(params *LeadOptionsParams, opts ...ClientOption) (*LeadOptionsOK, error)
LeadOptionsObservable(params *LeadOptionsObservableParams, opts ...ClientOption) (*LeadOptionsObservableOK, error) LeadOptionsObservable(params *LeadOptionsObservableParams, opts ...ClientOption) (*LeadOptionsObservableOK, error)
@ -201,6 +205,82 @@ func (a *Client) ContactOptionsObservable(params *ContactOptionsObservableParams
panic(msg) panic(msg)
} }
/*
ContractOptions CORS support
*/
func (a *Client) ContractOptions(params *ContractOptionsParams, opts ...ClientOption) (*ContractOptionsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewContractOptionsParams()
}
op := &runtime.ClientOperation{
ID: "contractOptions",
Method: "OPTIONS",
PathPattern: "/contracts",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &ContractOptionsReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*ContractOptionsOK)
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 contractOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
ContractOptionsObservable CORS support
*/
func (a *Client) ContractOptionsObservable(params *ContractOptionsObservableParams, opts ...ClientOption) (*ContractOptionsObservableOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewContractOptionsObservableParams()
}
op := &runtime.ClientOperation{
ID: "contractOptionsObservable",
Method: "OPTIONS",
PathPattern: "/contracts/observable",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &ContractOptionsObservableReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*ContractOptionsObservableOK)
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 contractOptionsObservable: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/* /*
LeadOptions CORS support LeadOptions CORS support
*/ */

View File

@ -16,6 +16,7 @@ import (
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_client/accounts" "code.tnxs.net/vernonkeenan/lib/api/crm/crm_client/accounts"
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_client/contacts" "code.tnxs.net/vernonkeenan/lib/api/crm/crm_client/contacts"
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_client/contracts"
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_client/cors" "code.tnxs.net/vernonkeenan/lib/api/crm/crm_client/cors"
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_client/leads" "code.tnxs.net/vernonkeenan/lib/api/crm/crm_client/leads"
) )
@ -64,6 +65,7 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *Crm {
cli.Transport = transport cli.Transport = transport
cli.Accounts = accounts.New(transport, formats) cli.Accounts = accounts.New(transport, formats)
cli.Contacts = contacts.New(transport, formats) cli.Contacts = contacts.New(transport, formats)
cli.Contracts = contracts.New(transport, formats)
cli.Cors = cors.New(transport, formats) cli.Cors = cors.New(transport, formats)
cli.Leads = leads.New(transport, formats) cli.Leads = leads.New(transport, formats)
return cli return cli
@ -114,6 +116,8 @@ type Crm struct {
Contacts contacts.ClientService Contacts contacts.ClientService
Contracts contracts.ClientService
Cors cors.ClientService Cors cors.ClientService
Leads leads.ClientService Leads leads.ClientService
@ -126,6 +130,7 @@ func (c *Crm) SetTransport(transport runtime.ClientTransport) {
c.Transport = transport c.Transport = transport
c.Accounts.SetTransport(transport) c.Accounts.SetTransport(transport)
c.Contacts.SetTransport(transport) c.Contacts.SetTransport(transport)
c.Contracts.SetTransport(transport)
c.Cors.SetTransport(transport) c.Cors.SetTransport(transport)
c.Leads.SetTransport(transport) c.Leads.SetTransport(transport)
} }

View File

@ -322,6 +322,8 @@ func (m *Account) validateBillingAddress(formats strfmt.Registry) error {
if err := m.BillingAddress.Validate(formats); err != nil { if err := m.BillingAddress.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("BillingAddress") return ve.ValidateName("BillingAddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("BillingAddress")
} }
return err return err
} }
@ -339,6 +341,8 @@ func (m *Account) validateBusinessAddress(formats strfmt.Registry) error {
if err := m.BusinessAddress.Validate(formats); err != nil { if err := m.BusinessAddress.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("BusinessAddress") return ve.ValidateName("BusinessAddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("BusinessAddress")
} }
return err return err
} }
@ -356,6 +360,8 @@ func (m *Account) validateDefaultAddress(formats strfmt.Registry) error {
if err := m.DefaultAddress.Validate(formats); err != nil { if err := m.DefaultAddress.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("DefaultAddress") return ve.ValidateName("DefaultAddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("DefaultAddress")
} }
return err return err
} }
@ -373,6 +379,8 @@ func (m *Account) validateShippingAddress(formats strfmt.Registry) error {
if err := m.ShippingAddress.Validate(formats); err != nil { if err := m.ShippingAddress.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("ShippingAddress") return ve.ValidateName("ShippingAddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("ShippingAddress")
} }
return err return err
} }
@ -413,6 +421,8 @@ func (m *Account) contextValidateBillingAddress(ctx context.Context, formats str
if err := m.BillingAddress.ContextValidate(ctx, formats); err != nil { if err := m.BillingAddress.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("BillingAddress") return ve.ValidateName("BillingAddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("BillingAddress")
} }
return err return err
} }
@ -427,6 +437,8 @@ func (m *Account) contextValidateBusinessAddress(ctx context.Context, formats st
if err := m.BusinessAddress.ContextValidate(ctx, formats); err != nil { if err := m.BusinessAddress.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("BusinessAddress") return ve.ValidateName("BusinessAddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("BusinessAddress")
} }
return err return err
} }
@ -441,6 +453,8 @@ func (m *Account) contextValidateDefaultAddress(ctx context.Context, formats str
if err := m.DefaultAddress.ContextValidate(ctx, formats); err != nil { if err := m.DefaultAddress.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("DefaultAddress") return ve.ValidateName("DefaultAddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("DefaultAddress")
} }
return err return err
} }
@ -455,6 +469,8 @@ func (m *Account) contextValidateShippingAddress(ctx context.Context, formats st
if err := m.ShippingAddress.ContextValidate(ctx, formats); err != nil { if err := m.ShippingAddress.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("ShippingAddress") return ve.ValidateName("ShippingAddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("ShippingAddress")
} }
return err return err
} }

View File

@ -126,6 +126,8 @@ func (m *AccountBasic) validateBillingAddress(formats strfmt.Registry) error {
if err := m.BillingAddress.Validate(formats); err != nil { if err := m.BillingAddress.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("BillingAddress") return ve.ValidateName("BillingAddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("BillingAddress")
} }
return err return err
} }
@ -143,6 +145,8 @@ func (m *AccountBasic) validateDefaultAddress(formats strfmt.Registry) error {
if err := m.DefaultAddress.Validate(formats); err != nil { if err := m.DefaultAddress.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("DefaultAddress") return ve.ValidateName("DefaultAddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("DefaultAddress")
} }
return err return err
} }
@ -160,6 +164,8 @@ func (m *AccountBasic) validateShippingAddress(formats strfmt.Registry) error {
if err := m.ShippingAddress.Validate(formats); err != nil { if err := m.ShippingAddress.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("ShippingAddress") return ve.ValidateName("ShippingAddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("ShippingAddress")
} }
return err return err
} }
@ -196,6 +202,8 @@ func (m *AccountBasic) contextValidateBillingAddress(ctx context.Context, format
if err := m.BillingAddress.ContextValidate(ctx, formats); err != nil { if err := m.BillingAddress.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("BillingAddress") return ve.ValidateName("BillingAddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("BillingAddress")
} }
return err return err
} }
@ -210,6 +218,8 @@ func (m *AccountBasic) contextValidateDefaultAddress(ctx context.Context, format
if err := m.DefaultAddress.ContextValidate(ctx, formats); err != nil { if err := m.DefaultAddress.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("DefaultAddress") return ve.ValidateName("DefaultAddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("DefaultAddress")
} }
return err return err
} }
@ -224,6 +234,8 @@ func (m *AccountBasic) contextValidateShippingAddress(ctx context.Context, forma
if err := m.ShippingAddress.ContextValidate(ctx, formats); err != nil { if err := m.ShippingAddress.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("ShippingAddress") return ve.ValidateName("ShippingAddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("ShippingAddress")
} }
return err return err
} }

View File

@ -62,6 +62,8 @@ func (m *AccountBasicResponse) validateData(formats strfmt.Registry) error {
if err := m.Data[i].Validate(formats); err != nil { if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i)) return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -81,6 +83,8 @@ func (m *AccountBasicResponse) validateMeta(formats strfmt.Registry) error {
if err := m.Meta.Validate(formats); err != nil { if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta") return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Meta")
} }
return err return err
} }
@ -115,6 +119,8 @@ func (m *AccountBasicResponse) contextValidateData(ctx context.Context, formats
if err := m.Data[i].ContextValidate(ctx, formats); err != nil { if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i)) return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -131,6 +137,8 @@ func (m *AccountBasicResponse) contextValidateMeta(ctx context.Context, formats
if err := m.Meta.ContextValidate(ctx, formats); err != nil { if err := m.Meta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta") return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Meta")
} }
return err return err
} }

View File

@ -55,6 +55,8 @@ func (m *AccountRequest) validateData(formats strfmt.Registry) error {
if err := m.Data[i].Validate(formats); err != nil { if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i)) return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -87,6 +89,8 @@ func (m *AccountRequest) contextValidateData(ctx context.Context, formats strfmt
if err := m.Data[i].ContextValidate(ctx, formats); err != nil { if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i)) return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
} }
return err return err
} }

View File

@ -62,6 +62,8 @@ func (m *AccountResponse) validateData(formats strfmt.Registry) error {
if err := m.Data[i].Validate(formats); err != nil { if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i)) return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -81,6 +83,8 @@ func (m *AccountResponse) validateMeta(formats strfmt.Registry) error {
if err := m.Meta.Validate(formats); err != nil { if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta") return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Meta")
} }
return err return err
} }
@ -115,6 +119,8 @@ func (m *AccountResponse) contextValidateData(ctx context.Context, formats strfm
if err := m.Data[i].ContextValidate(ctx, formats); err != nil { if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i)) return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -131,6 +137,8 @@ func (m *AccountResponse) contextValidateMeta(ctx context.Context, formats strfm
if err := m.Meta.ContextValidate(ctx, formats); err != nil { if err := m.Meta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta") return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Meta")
} }
return err return err
} }

View File

@ -185,6 +185,8 @@ func (m *Contact) validateMailingAddress(formats strfmt.Registry) error {
if err := m.MailingAddress.Validate(formats); err != nil { if err := m.MailingAddress.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("MailingAddress") return ve.ValidateName("MailingAddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("MailingAddress")
} }
return err return err
} }
@ -202,6 +204,8 @@ func (m *Contact) validateOtherAddress(formats strfmt.Registry) error {
if err := m.OtherAddress.Validate(formats); err != nil { if err := m.OtherAddress.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("OtherAddress") return ve.ValidateName("OtherAddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("OtherAddress")
} }
return err return err
} }
@ -234,6 +238,8 @@ func (m *Contact) contextValidateMailingAddress(ctx context.Context, formats str
if err := m.MailingAddress.ContextValidate(ctx, formats); err != nil { if err := m.MailingAddress.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("MailingAddress") return ve.ValidateName("MailingAddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("MailingAddress")
} }
return err return err
} }
@ -248,6 +254,8 @@ func (m *Contact) contextValidateOtherAddress(ctx context.Context, formats strfm
if err := m.OtherAddress.ContextValidate(ctx, formats); err != nil { if err := m.OtherAddress.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("OtherAddress") return ve.ValidateName("OtherAddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("OtherAddress")
} }
return err return err
} }

View File

@ -55,6 +55,8 @@ func (m *ContactRequest) validateData(formats strfmt.Registry) error {
if err := m.Data[i].Validate(formats); err != nil { if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i)) return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -87,6 +89,8 @@ func (m *ContactRequest) contextValidateData(ctx context.Context, formats strfmt
if err := m.Data[i].ContextValidate(ctx, formats); err != nil { if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i)) return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
} }
return err return err
} }

View File

@ -62,6 +62,8 @@ func (m *ContactResponse) validateData(formats strfmt.Registry) error {
if err := m.Data[i].Validate(formats); err != nil { if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i)) return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -81,6 +83,8 @@ func (m *ContactResponse) validateMeta(formats strfmt.Registry) error {
if err := m.Meta.Validate(formats); err != nil { if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta") return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Meta")
} }
return err return err
} }
@ -115,6 +119,8 @@ func (m *ContactResponse) contextValidateData(ctx context.Context, formats strfm
if err := m.Data[i].ContextValidate(ctx, formats); err != nil { if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i)) return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -131,6 +137,8 @@ func (m *ContactResponse) contextValidateMeta(ctx context.Context, formats strfm
if err := m.Meta.ContextValidate(ctx, formats); err != nil { if err := m.Meta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta") return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Meta")
} }
return err return err
} }

View File

@ -0,0 +1,238 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-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 (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// Contract contract
//
// swagger:model Contract
type Contract struct {
// Account
AccountID string `json:"AccountID,omitempty"`
// Activated By
ActivatedByID string `json:"ActivatedByID,omitempty"`
// Activated Date
ActivatedDate string `json:"ActivatedDate,omitempty"`
// Billing Address
BillingAddress *Address `json:"BillingAddress,omitempty"`
// Billing Contact
BillingContactID string `json:"BillingContactID,omitempty"`
// Company Signed Date
CompanySignedDate string `json:"CompanySignedDate,omitempty"`
// Company Signed By
CompanySignedID string `json:"CompanySignedID,omitempty"`
// Contract Number
ContractNumber string `json:"ContractNumber,omitempty"`
// Contract Term (months)
ContractTerm float64 `json:"ContractTerm,omitempty"`
// Created By User ID
CreatedByID string `json:"CreatedByID,omitempty"`
// Created Date
CreatedDate string `json:"CreatedDate,omitempty"`
// Customer Signed Date
CustomerSignedDate string `json:"CustomerSignedDate,omitempty"`
// Customer Signed By
CustomerSignedID string `json:"CustomerSignedID,omitempty"`
// Customer Signed Title
CustomerSignedTitle string `json:"CustomerSignedTitle,omitempty"`
// End User
DefaultEndUserID string `json:"DefaultEndUserID,omitempty"`
// Description
Description string `json:"Description,omitempty"`
// Contract End Date
EndDate string `json:"EndDate,omitempty"`
// Hourly Rate
HourlyRate float64 `json:"HourlyRate,omitempty"`
// Telnexus 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"`
// Contract Name
Name string `json:"Name,omitempty"`
// Payment Method
PaymentMethodID string `json:"PaymentMethodID,omitempty"`
// Payment Terms
PaymentTerms string `json:"PaymentTerms,omitempty"`
// Perpetual Agreement?
Perpetual bool `json:"Perpetual,omitempty"`
// Shipping Address
ShippingAddress *Address `json:"ShippingAddress,omitempty"`
// Shipping Contact
ShippingContactID string `json:"ShippingContactID,omitempty"`
// Contract Start Date
StartDate string `json:"StartDate,omitempty"`
// Status
Status string `json:"Status,omitempty"`
// Tenant Identifier
TenantID string `json:"TenantID,omitempty"`
}
// Validate validates this contract
func (m *Contract) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateBillingAddress(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 *Contract) 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")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("BillingAddress")
}
return err
}
}
return nil
}
func (m *Contract) 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")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("ShippingAddress")
}
return err
}
}
return nil
}
// ContextValidate validate this contract based on the context it is used
func (m *Contract) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateBillingAddress(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateShippingAddress(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *Contract) contextValidateBillingAddress(ctx context.Context, formats strfmt.Registry) error {
if m.BillingAddress != nil {
if err := m.BillingAddress.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("BillingAddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("BillingAddress")
}
return err
}
}
return nil
}
func (m *Contract) contextValidateShippingAddress(ctx context.Context, formats strfmt.Registry) error {
if m.ShippingAddress != nil {
if err := m.ShippingAddress.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("ShippingAddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("ShippingAddress")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *Contract) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Contract) UnmarshalBinary(b []byte) error {
var res Contract
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,120 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-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 (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// ContractRequest contract request
//
// swagger:model ContractRequest
type ContractRequest struct {
// data
Data []*Contract `json:"Data"`
}
// Validate validates this contract request
func (m *ContractRequest) 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 *ContractRequest) 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))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this contract request based on the context it is used
func (m *ContractRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateData(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *ContractRequest) contextValidateData(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Data); i++ {
if m.Data[i] != nil {
if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *ContractRequest) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *ContractRequest) UnmarshalBinary(b []byte) error {
var res ContractRequest
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,166 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-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 (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// ContractResponse contract response
//
// swagger:model ContractResponse
type ContractResponse struct {
// data
Data []*Contract `json:"Data"`
// meta
Meta *ResponseMeta `json:"Meta,omitempty"`
}
// Validate validates this contract response
func (m *ContractResponse) 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 *ContractResponse) 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))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *ContractResponse) 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")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Meta")
}
return err
}
}
return nil
}
// ContextValidate validate this contract response based on the context it is used
func (m *ContractResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateData(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateMeta(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *ContractResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Data); i++ {
if m.Data[i] != nil {
if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *ContractResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error {
if m.Meta != nil {
if err := m.Meta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Meta")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *ContractResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *ContractResponse) UnmarshalBinary(b []byte) error {
var res ContractResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -62,6 +62,8 @@ func (m *DeleteResponse) validateData(formats strfmt.Registry) error {
if err := m.Data[i].Validate(formats); err != nil { if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i)) return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -81,6 +83,8 @@ func (m *DeleteResponse) validateMeta(formats strfmt.Registry) error {
if err := m.Meta.Validate(formats); err != nil { if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta") return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Meta")
} }
return err return err
} }
@ -115,6 +119,8 @@ func (m *DeleteResponse) contextValidateData(ctx context.Context, formats strfmt
if err := m.Data[i].ContextValidate(ctx, formats); err != nil { if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i)) return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -131,6 +137,8 @@ func (m *DeleteResponse) contextValidateMeta(ctx context.Context, formats strfmt
if err := m.Meta.ContextValidate(ctx, formats); err != nil { if err := m.Meta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta") return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Meta")
} }
return err return err
} }

View File

@ -130,6 +130,8 @@ func (m *Lead) validateAddress(formats strfmt.Registry) error {
if err := m.Address.Validate(formats); err != nil { if err := m.Address.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Address") return ve.ValidateName("Address")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Address")
} }
return err return err
} }
@ -158,6 +160,8 @@ func (m *Lead) contextValidateAddress(ctx context.Context, formats strfmt.Regist
if err := m.Address.ContextValidate(ctx, formats); err != nil { if err := m.Address.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Address") return ve.ValidateName("Address")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Address")
} }
return err return err
} }

View File

@ -55,6 +55,8 @@ func (m *LeadRequest) validateData(formats strfmt.Registry) error {
if err := m.Data[i].Validate(formats); err != nil { if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i)) return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -87,6 +89,8 @@ func (m *LeadRequest) contextValidateData(ctx context.Context, formats strfmt.Re
if err := m.Data[i].ContextValidate(ctx, formats); err != nil { if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i)) return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
} }
return err return err
} }

View File

@ -62,6 +62,8 @@ func (m *LeadResponse) validateData(formats strfmt.Registry) error {
if err := m.Data[i].Validate(formats); err != nil { if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i)) return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -81,6 +83,8 @@ func (m *LeadResponse) validateMeta(formats strfmt.Registry) error {
if err := m.Meta.Validate(formats); err != nil { if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta") return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Meta")
} }
return err return err
} }
@ -115,6 +119,8 @@ func (m *LeadResponse) contextValidateData(ctx context.Context, formats strfmt.R
if err := m.Data[i].ContextValidate(ctx, formats); err != nil { if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i)) return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -131,6 +137,8 @@ func (m *LeadResponse) contextValidateMeta(ctx context.Context, formats strfmt.R
if err := m.Meta.ContextValidate(ctx, formats); err != nil { if err := m.Meta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta") return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Meta")
} }
return err return err
} }

View File

@ -82,6 +82,8 @@ func (m *ResponseMeta) validatePagination(formats strfmt.Registry) error {
if err := m.Pagination.Validate(formats); err != nil { if err := m.Pagination.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Pagination") return ve.ValidateName("Pagination")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Pagination")
} }
return err return err
} }
@ -110,6 +112,8 @@ func (m *ResponseMeta) contextValidatePagination(ctx context.Context, formats st
if err := m.Pagination.ContextValidate(ctx, formats); err != nil { if err := m.Pagination.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Pagination") return ve.ValidateName("Pagination")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Pagination")
} }
return err return err
} }

View File

@ -55,6 +55,8 @@ func (m *ClusterRequest) validateData(formats strfmt.Registry) error {
if err := m.Data[i].Validate(formats); err != nil { if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i)) return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -87,6 +89,8 @@ func (m *ClusterRequest) contextValidateData(ctx context.Context, formats strfmt
if err := m.Data[i].ContextValidate(ctx, formats); err != nil { if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i)) return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
} }
return err return err
} }

View File

@ -62,6 +62,8 @@ func (m *ClusterResponse) validateData(formats strfmt.Registry) error {
if err := m.Data[i].Validate(formats); err != nil { if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i)) return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -81,6 +83,8 @@ func (m *ClusterResponse) validateMeta(formats strfmt.Registry) error {
if err := m.Meta.Validate(formats); err != nil { if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta") return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Meta")
} }
return err return err
} }
@ -115,6 +119,8 @@ func (m *ClusterResponse) contextValidateData(ctx context.Context, formats strfm
if err := m.Data[i].ContextValidate(ctx, formats); err != nil { if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i)) return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -131,6 +137,8 @@ func (m *ClusterResponse) contextValidateMeta(ctx context.Context, formats strfm
if err := m.Meta.ContextValidate(ctx, formats); err != nil { if err := m.Meta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta") return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Meta")
} }
return err return err
} }

View File

@ -48,9 +48,6 @@ type Database struct {
// Last Modifed Date // Last Modifed Date
LastModifiedDate string `json:"LastModifiedDate,omitempty"` LastModifiedDate string `json:"LastModifiedDate,omitempty"`
// List of Taxnexus microservices implemented by this Database
Microservices string `json:"Microservices,omitempty"`
// The current status of this Tenant // The current status of this Tenant
Status string `json:"Status,omitempty"` Status string `json:"Status,omitempty"`

View File

@ -55,6 +55,8 @@ func (m *DatabaseRequest) validateData(formats strfmt.Registry) error {
if err := m.Data[i].Validate(formats); err != nil { if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i)) return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -87,6 +89,8 @@ func (m *DatabaseRequest) contextValidateData(ctx context.Context, formats strfm
if err := m.Data[i].ContextValidate(ctx, formats); err != nil { if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i)) return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
} }
return err return err
} }

View File

@ -62,6 +62,8 @@ func (m *DatabaseResponse) validateData(formats strfmt.Registry) error {
if err := m.Data[i].Validate(formats); err != nil { if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i)) return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -81,6 +83,8 @@ func (m *DatabaseResponse) validateMeta(formats strfmt.Registry) error {
if err := m.Meta.Validate(formats); err != nil { if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta") return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Meta")
} }
return err return err
} }
@ -115,6 +119,8 @@ func (m *DatabaseResponse) contextValidateData(ctx context.Context, formats strf
if err := m.Data[i].ContextValidate(ctx, formats); err != nil { if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i)) return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -131,6 +137,8 @@ func (m *DatabaseResponse) contextValidateMeta(ctx context.Context, formats strf
if err := m.Meta.ContextValidate(ctx, formats); err != nil { if err := m.Meta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta") return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Meta")
} }
return err return err
} }

View File

@ -62,6 +62,8 @@ func (m *DeleteResponse) validateData(formats strfmt.Registry) error {
if err := m.Data[i].Validate(formats); err != nil { if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i)) return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -81,6 +83,8 @@ func (m *DeleteResponse) validateMeta(formats strfmt.Registry) error {
if err := m.Meta.Validate(formats); err != nil { if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta") return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Meta")
} }
return err return err
} }
@ -115,6 +119,8 @@ func (m *DeleteResponse) contextValidateData(ctx context.Context, formats strfmt
if err := m.Data[i].ContextValidate(ctx, formats); err != nil { if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i)) return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -131,6 +137,8 @@ func (m *DeleteResponse) contextValidateMeta(ctx context.Context, formats strfmt
if err := m.Meta.ContextValidate(ctx, formats); err != nil { if err := m.Meta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta") return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Meta")
} }
return err return err
} }

View File

@ -82,6 +82,8 @@ func (m *ResponseMeta) validatePagination(formats strfmt.Registry) error {
if err := m.Pagination.Validate(formats); err != nil { if err := m.Pagination.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Pagination") return ve.ValidateName("Pagination")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Pagination")
} }
return err return err
} }
@ -110,6 +112,8 @@ func (m *ResponseMeta) contextValidatePagination(ctx context.Context, formats st
if err := m.Pagination.ContextValidate(ctx, formats); err != nil { if err := m.Pagination.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Pagination") return ve.ValidateName("Pagination")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Pagination")
} }
return err return err
} }

View File

@ -55,6 +55,8 @@ func (m *RoleRequest) validateDate(formats strfmt.Registry) error {
if err := m.Date[i].Validate(formats); err != nil { if err := m.Date[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Date" + "." + strconv.Itoa(i)) return ve.ValidateName("Date" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Date" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -87,6 +89,8 @@ func (m *RoleRequest) contextValidateDate(ctx context.Context, formats strfmt.Re
if err := m.Date[i].ContextValidate(ctx, formats); err != nil { if err := m.Date[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Date" + "." + strconv.Itoa(i)) return ve.ValidateName("Date" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Date" + "." + strconv.Itoa(i))
} }
return err return err
} }

View File

@ -62,6 +62,8 @@ func (m *RoleResponse) validateData(formats strfmt.Registry) error {
if err := m.Data[i].Validate(formats); err != nil { if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i)) return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -81,6 +83,8 @@ func (m *RoleResponse) validateMeta(formats strfmt.Registry) error {
if err := m.Meta.Validate(formats); err != nil { if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta") return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Meta")
} }
return err return err
} }
@ -115,6 +119,8 @@ func (m *RoleResponse) contextValidateData(ctx context.Context, formats strfmt.R
if err := m.Data[i].ContextValidate(ctx, formats); err != nil { if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i)) return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -131,6 +137,8 @@ func (m *RoleResponse) contextValidateMeta(ctx context.Context, formats strfmt.R
if err := m.Meta.ContextValidate(ctx, formats); err != nil { if err := m.Meta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta") return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Meta")
} }
return err return err
} }

View File

@ -55,6 +55,8 @@ func (m *TemplateRequest) validateData(formats strfmt.Registry) error {
if err := m.Data[i].Validate(formats); err != nil { if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i)) return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -87,6 +89,8 @@ func (m *TemplateRequest) contextValidateData(ctx context.Context, formats strfm
if err := m.Data[i].ContextValidate(ctx, formats); err != nil { if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i)) return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
} }
return err return err
} }

View File

@ -62,6 +62,8 @@ func (m *TemplateResponse) validateData(formats strfmt.Registry) error {
if err := m.Data[i].Validate(formats); err != nil { if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i)) return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -81,6 +83,8 @@ func (m *TemplateResponse) validateMeta(formats strfmt.Registry) error {
if err := m.Meta.Validate(formats); err != nil { if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta") return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Meta")
} }
return err return err
} }
@ -115,6 +119,8 @@ func (m *TemplateResponse) contextValidateData(ctx context.Context, formats strf
if err := m.Data[i].ContextValidate(ctx, formats); err != nil { if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i)) return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -131,6 +137,8 @@ func (m *TemplateResponse) contextValidateMeta(ctx context.Context, formats strf
if err := m.Meta.ContextValidate(ctx, formats); err != nil { if err := m.Meta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta") return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Meta")
} }
return err return err
} }

View File

@ -102,6 +102,8 @@ func (m *Tenant) validateDatabases(formats strfmt.Registry) error {
if err := m.Databases[i].Validate(formats); err != nil { if err := m.Databases[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Databases" + "." + strconv.Itoa(i)) return ve.ValidateName("Databases" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Databases" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -126,6 +128,8 @@ func (m *Tenant) validateRoles(formats strfmt.Registry) error {
if err := m.Roles[i].Validate(formats); err != nil { if err := m.Roles[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Roles" + "." + strconv.Itoa(i)) return ve.ValidateName("Roles" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Roles" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -150,6 +154,8 @@ func (m *Tenant) validateTenantUsers(formats strfmt.Registry) error {
if err := m.TenantUsers[i].Validate(formats); err != nil { if err := m.TenantUsers[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("TenantUsers" + "." + strconv.Itoa(i)) return ve.ValidateName("TenantUsers" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("TenantUsers" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -190,6 +196,8 @@ func (m *Tenant) contextValidateDatabases(ctx context.Context, formats strfmt.Re
if err := m.Databases[i].ContextValidate(ctx, formats); err != nil { if err := m.Databases[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Databases" + "." + strconv.Itoa(i)) return ve.ValidateName("Databases" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Databases" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -208,6 +216,8 @@ func (m *Tenant) contextValidateRoles(ctx context.Context, formats strfmt.Regist
if err := m.Roles[i].ContextValidate(ctx, formats); err != nil { if err := m.Roles[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Roles" + "." + strconv.Itoa(i)) return ve.ValidateName("Roles" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Roles" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -226,6 +236,8 @@ func (m *Tenant) contextValidateTenantUsers(ctx context.Context, formats strfmt.
if err := m.TenantUsers[i].ContextValidate(ctx, formats); err != nil { if err := m.TenantUsers[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("TenantUsers" + "." + strconv.Itoa(i)) return ve.ValidateName("TenantUsers" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("TenantUsers" + "." + strconv.Itoa(i))
} }
return err return err
} }

View File

@ -55,6 +55,8 @@ func (m *TenantRequest) validateData(formats strfmt.Registry) error {
if err := m.Data[i].Validate(formats); err != nil { if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i)) return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -87,6 +89,8 @@ func (m *TenantRequest) contextValidateData(ctx context.Context, formats strfmt.
if err := m.Data[i].ContextValidate(ctx, formats); err != nil { if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i)) return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
} }
return err return err
} }

View File

@ -62,6 +62,8 @@ func (m *TenantResponse) validateData(formats strfmt.Registry) error {
if err := m.Data[i].Validate(formats); err != nil { if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i)) return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -81,6 +83,8 @@ func (m *TenantResponse) validateMeta(formats strfmt.Registry) error {
if err := m.Meta.Validate(formats); err != nil { if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta") return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Meta")
} }
return err return err
} }
@ -115,6 +119,8 @@ func (m *TenantResponse) contextValidateData(ctx context.Context, formats strfmt
if err := m.Data[i].ContextValidate(ctx, formats); err != nil { if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i)) return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -131,6 +137,8 @@ func (m *TenantResponse) contextValidateMeta(ctx context.Context, formats strfmt
if err := m.Meta.ContextValidate(ctx, formats); err != nil { if err := m.Meta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta") return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Meta")
} }
return err return err
} }

View File

@ -229,6 +229,8 @@ func (m *User) validateAddress(formats strfmt.Registry) error {
if err := m.Address.Validate(formats); err != nil { if err := m.Address.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Address") return ve.ValidateName("Address")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Address")
} }
return err return err
} }
@ -251,6 +253,8 @@ func (m *User) validateTenantUsers(formats strfmt.Registry) error {
if err := m.TenantUsers[i].Validate(formats); err != nil { if err := m.TenantUsers[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("TenantUsers" + "." + strconv.Itoa(i)) return ve.ValidateName("TenantUsers" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("TenantUsers" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -275,6 +279,8 @@ func (m *User) validateUserRoles(formats strfmt.Registry) error {
if err := m.UserRoles[i].Validate(formats); err != nil { if err := m.UserRoles[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("UserRoles" + "." + strconv.Itoa(i)) return ve.ValidateName("UserRoles" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("UserRoles" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -313,6 +319,8 @@ func (m *User) contextValidateAddress(ctx context.Context, formats strfmt.Regist
if err := m.Address.ContextValidate(ctx, formats); err != nil { if err := m.Address.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Address") return ve.ValidateName("Address")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Address")
} }
return err return err
} }
@ -329,6 +337,8 @@ func (m *User) contextValidateTenantUsers(ctx context.Context, formats strfmt.Re
if err := m.TenantUsers[i].ContextValidate(ctx, formats); err != nil { if err := m.TenantUsers[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("TenantUsers" + "." + strconv.Itoa(i)) return ve.ValidateName("TenantUsers" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("TenantUsers" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -347,6 +357,8 @@ func (m *User) contextValidateUserRoles(ctx context.Context, formats strfmt.Regi
if err := m.UserRoles[i].ContextValidate(ctx, formats); err != nil { if err := m.UserRoles[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("UserRoles" + "." + strconv.Itoa(i)) return ve.ValidateName("UserRoles" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("UserRoles" + "." + strconv.Itoa(i))
} }
return err return err
} }

View File

@ -55,6 +55,8 @@ func (m *UserRequest) validateData(formats strfmt.Registry) error {
if err := m.Data[i].Validate(formats); err != nil { if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i)) return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -87,6 +89,8 @@ func (m *UserRequest) contextValidateData(ctx context.Context, formats strfmt.Re
if err := m.Data[i].ContextValidate(ctx, formats); err != nil { if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i)) return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
} }
return err return err
} }

View File

@ -62,6 +62,8 @@ func (m *UserResponse) validateData(formats strfmt.Registry) error {
if err := m.Data[i].Validate(formats); err != nil { if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i)) return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -81,6 +83,8 @@ func (m *UserResponse) validateMeta(formats strfmt.Registry) error {
if err := m.Meta.Validate(formats); err != nil { if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta") return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Meta")
} }
return err return err
} }
@ -115,6 +119,8 @@ func (m *UserResponse) contextValidateData(ctx context.Context, formats strfmt.R
if err := m.Data[i].ContextValidate(ctx, formats); err != nil { if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i)) return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -131,6 +137,8 @@ func (m *UserResponse) contextValidateMeta(ctx context.Context, formats strfmt.R
if err := m.Meta.ContextValidate(ctx, formats); err != nil { if err := m.Meta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta") return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Meta")
} }
return err return err
} }

View File

@ -0,0 +1,129 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package contracts
// 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 contracts API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
return &Client{transport: transport, formats: formats}
}
/*
Client for contracts API
*/
type Client struct {
transport runtime.ClientTransport
formats strfmt.Registry
}
// ClientOption is the option for Client methods
type ClientOption func(*runtime.ClientOperation)
// ClientService is the interface for Client methods
type ClientService interface {
GetContracts(params *GetContractsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetContractsOK, error)
PostContracts(params *PostContractsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostContractsOK, error)
SetTransport(transport runtime.ClientTransport)
}
/*
GetContracts gets a list of contracts
Return a list of all available Contracts
*/
func (a *Client) GetContracts(params *GetContractsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetContractsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetContractsParams()
}
op := &runtime.ClientOperation{
ID: "getContracts",
Method: "GET",
PathPattern: "/contracts",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &GetContractsReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*GetContractsOK)
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 getContracts: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
PostContracts adds a new contract to taxnexus
Contract record to be added
*/
func (a *Client) PostContracts(params *PostContractsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostContractsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPostContractsParams()
}
op := &runtime.ClientOperation{
ID: "postContracts",
Method: "POST",
PathPattern: "/contracts",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PostContractsReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*PostContractsOK)
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 postContracts: 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
}

View File

@ -0,0 +1,272 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package contracts
// 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"
)
// NewGetContractsParams creates a new GetContractsParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewGetContractsParams() *GetContractsParams {
return &GetContractsParams{
timeout: cr.DefaultTimeout,
}
}
// NewGetContractsParamsWithTimeout creates a new GetContractsParams object
// with the ability to set a timeout on a request.
func NewGetContractsParamsWithTimeout(timeout time.Duration) *GetContractsParams {
return &GetContractsParams{
timeout: timeout,
}
}
// NewGetContractsParamsWithContext creates a new GetContractsParams object
// with the ability to set a context for a request.
func NewGetContractsParamsWithContext(ctx context.Context) *GetContractsParams {
return &GetContractsParams{
Context: ctx,
}
}
// NewGetContractsParamsWithHTTPClient creates a new GetContractsParams object
// with the ability to set a custom HTTPClient for a request.
func NewGetContractsParamsWithHTTPClient(client *http.Client) *GetContractsParams {
return &GetContractsParams{
HTTPClient: client,
}
}
/* GetContractsParams contains all the parameters to send to the API endpoint
for the get contracts operation.
Typically these are written to a http.Request.
*/
type GetContractsParams struct {
/* Active.
Only retrieve active records?
*/
Active *bool
/* ContractID.
Taxnexus Contact record ID
*/
ContractID *string
/* Limit.
How many objects to return at one time
Format: int64
*/
Limit *int64
/* Offset.
How many objects to skip?
Format: int64
*/
Offset *int64
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the get contracts params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetContractsParams) WithDefaults() *GetContractsParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the get contracts params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetContractsParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the get contracts params
func (o *GetContractsParams) WithTimeout(timeout time.Duration) *GetContractsParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the get contracts params
func (o *GetContractsParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the get contracts params
func (o *GetContractsParams) WithContext(ctx context.Context) *GetContractsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get contracts params
func (o *GetContractsParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the get contracts params
func (o *GetContractsParams) WithHTTPClient(client *http.Client) *GetContractsParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the get contracts params
func (o *GetContractsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithActive adds the active to the get contracts params
func (o *GetContractsParams) WithActive(active *bool) *GetContractsParams {
o.SetActive(active)
return o
}
// SetActive adds the active to the get contracts params
func (o *GetContractsParams) SetActive(active *bool) {
o.Active = active
}
// WithContractID adds the contractID to the get contracts params
func (o *GetContractsParams) WithContractID(contractID *string) *GetContractsParams {
o.SetContractID(contractID)
return o
}
// SetContractID adds the contractId to the get contracts params
func (o *GetContractsParams) SetContractID(contractID *string) {
o.ContractID = contractID
}
// WithLimit adds the limit to the get contracts params
func (o *GetContractsParams) WithLimit(limit *int64) *GetContractsParams {
o.SetLimit(limit)
return o
}
// SetLimit adds the limit to the get contracts params
func (o *GetContractsParams) SetLimit(limit *int64) {
o.Limit = limit
}
// WithOffset adds the offset to the get contracts params
func (o *GetContractsParams) WithOffset(offset *int64) *GetContractsParams {
o.SetOffset(offset)
return o
}
// SetOffset adds the offset to the get contracts params
func (o *GetContractsParams) SetOffset(offset *int64) {
o.Offset = offset
}
// WriteToRequest writes these params to a swagger request
func (o *GetContractsParams) 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.ContractID != nil {
// query param contractId
var qrContractID string
if o.ContractID != nil {
qrContractID = *o.ContractID
}
qContractID := qrContractID
if qContractID != "" {
if err := r.SetQueryParam("contractId", qContractID); 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
}

View File

@ -0,0 +1,323 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package contracts
// 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"
"code.tnxs.net/vernonkeenan/lib/api/research/research_models"
)
// GetContractsReader is a Reader for the GetContracts structure.
type GetContractsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetContractsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetContractsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewGetContractsUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewGetContractsForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewGetContractsNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewGetContractsUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewGetContractsInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
}
}
// NewGetContractsOK creates a GetContractsOK with default headers values
func NewGetContractsOK() *GetContractsOK {
return &GetContractsOK{}
}
/* GetContractsOK describes a response with status code 200, with default header values.
Taxnexus Response with an array of Contract objects
*/
type GetContractsOK struct {
AccessControlAllowOrigin string
CacheControl string
Payload *research_models.ContractResponse
}
func (o *GetContractsOK) Error() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsOK %+v", 200, o.Payload)
}
func (o *GetContractsOK) GetPayload() *research_models.ContractResponse {
return o.Payload
}
func (o *GetContractsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
// hydrates response header Cache-Control
hdrCacheControl := response.GetHeader("Cache-Control")
if hdrCacheControl != "" {
o.CacheControl = hdrCacheControl
}
o.Payload = new(research_models.ContractResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetContractsUnauthorized creates a GetContractsUnauthorized with default headers values
func NewGetContractsUnauthorized() *GetContractsUnauthorized {
return &GetContractsUnauthorized{}
}
/* GetContractsUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type GetContractsUnauthorized struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *GetContractsUnauthorized) Error() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsUnauthorized %+v", 401, o.Payload)
}
func (o *GetContractsUnauthorized) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetContractsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(research_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetContractsForbidden creates a GetContractsForbidden with default headers values
func NewGetContractsForbidden() *GetContractsForbidden {
return &GetContractsForbidden{}
}
/* GetContractsForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type GetContractsForbidden struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *GetContractsForbidden) Error() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsForbidden %+v", 403, o.Payload)
}
func (o *GetContractsForbidden) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetContractsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(research_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetContractsNotFound creates a GetContractsNotFound with default headers values
func NewGetContractsNotFound() *GetContractsNotFound {
return &GetContractsNotFound{}
}
/* GetContractsNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type GetContractsNotFound struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *GetContractsNotFound) Error() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsNotFound %+v", 404, o.Payload)
}
func (o *GetContractsNotFound) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetContractsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(research_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetContractsUnprocessableEntity creates a GetContractsUnprocessableEntity with default headers values
func NewGetContractsUnprocessableEntity() *GetContractsUnprocessableEntity {
return &GetContractsUnprocessableEntity{}
}
/* GetContractsUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type GetContractsUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *GetContractsUnprocessableEntity) Error() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetContractsUnprocessableEntity) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetContractsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(research_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetContractsInternalServerError creates a GetContractsInternalServerError with default headers values
func NewGetContractsInternalServerError() *GetContractsInternalServerError {
return &GetContractsInternalServerError{}
}
/* GetContractsInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type GetContractsInternalServerError struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *GetContractsInternalServerError) Error() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsInternalServerError %+v", 500, o.Payload)
}
func (o *GetContractsInternalServerError) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetContractsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(research_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}

View File

@ -0,0 +1,155 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package contracts
// 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"
"code.tnxs.net/vernonkeenan/lib/api/research/research_models"
)
// NewPostContractsParams creates a new PostContractsParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewPostContractsParams() *PostContractsParams {
return &PostContractsParams{
timeout: cr.DefaultTimeout,
}
}
// NewPostContractsParamsWithTimeout creates a new PostContractsParams object
// with the ability to set a timeout on a request.
func NewPostContractsParamsWithTimeout(timeout time.Duration) *PostContractsParams {
return &PostContractsParams{
timeout: timeout,
}
}
// NewPostContractsParamsWithContext creates a new PostContractsParams object
// with the ability to set a context for a request.
func NewPostContractsParamsWithContext(ctx context.Context) *PostContractsParams {
return &PostContractsParams{
Context: ctx,
}
}
// NewPostContractsParamsWithHTTPClient creates a new PostContractsParams object
// with the ability to set a custom HTTPClient for a request.
func NewPostContractsParamsWithHTTPClient(client *http.Client) *PostContractsParams {
return &PostContractsParams{
HTTPClient: client,
}
}
/* PostContractsParams contains all the parameters to send to the API endpoint
for the post contracts operation.
Typically these are written to a http.Request.
*/
type PostContractsParams struct {
/* ContractsRequest.
An array of new Contract records
*/
ContractsRequest *research_models.ContractRequest
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the post contracts params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostContractsParams) WithDefaults() *PostContractsParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the post contracts params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostContractsParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the post contracts params
func (o *PostContractsParams) WithTimeout(timeout time.Duration) *PostContractsParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the post contracts params
func (o *PostContractsParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the post contracts params
func (o *PostContractsParams) WithContext(ctx context.Context) *PostContractsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the post contracts params
func (o *PostContractsParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the post contracts params
func (o *PostContractsParams) WithHTTPClient(client *http.Client) *PostContractsParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the post contracts params
func (o *PostContractsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithContractsRequest adds the contractsRequest to the post contracts params
func (o *PostContractsParams) WithContractsRequest(contractsRequest *research_models.ContractRequest) *PostContractsParams {
o.SetContractsRequest(contractsRequest)
return o
}
// SetContractsRequest adds the contractsRequest to the post contracts params
func (o *PostContractsParams) SetContractsRequest(contractsRequest *research_models.ContractRequest) {
o.ContractsRequest = contractsRequest
}
// WriteToRequest writes these params to a swagger request
func (o *PostContractsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.ContractsRequest != nil {
if err := r.SetBodyParam(o.ContractsRequest); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,323 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package contracts
// 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"
"code.tnxs.net/vernonkeenan/lib/api/research/research_models"
)
// PostContractsReader is a Reader for the PostContracts structure.
type PostContractsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PostContractsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewPostContractsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewPostContractsUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewPostContractsForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewPostContractsNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewPostContractsUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewPostContractsInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
}
}
// NewPostContractsOK creates a PostContractsOK with default headers values
func NewPostContractsOK() *PostContractsOK {
return &PostContractsOK{}
}
/* PostContractsOK describes a response with status code 200, with default header values.
Taxnexus Response with an array of Contract objects
*/
type PostContractsOK struct {
AccessControlAllowOrigin string
CacheControl string
Payload *research_models.ContractResponse
}
func (o *PostContractsOK) Error() string {
return fmt.Sprintf("[POST /contracts][%d] postContractsOK %+v", 200, o.Payload)
}
func (o *PostContractsOK) GetPayload() *research_models.ContractResponse {
return o.Payload
}
func (o *PostContractsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
// hydrates response header Cache-Control
hdrCacheControl := response.GetHeader("Cache-Control")
if hdrCacheControl != "" {
o.CacheControl = hdrCacheControl
}
o.Payload = new(research_models.ContractResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostContractsUnauthorized creates a PostContractsUnauthorized with default headers values
func NewPostContractsUnauthorized() *PostContractsUnauthorized {
return &PostContractsUnauthorized{}
}
/* PostContractsUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type PostContractsUnauthorized struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *PostContractsUnauthorized) Error() string {
return fmt.Sprintf("[POST /contracts][%d] postContractsUnauthorized %+v", 401, o.Payload)
}
func (o *PostContractsUnauthorized) GetPayload() *research_models.Error {
return o.Payload
}
func (o *PostContractsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(research_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostContractsForbidden creates a PostContractsForbidden with default headers values
func NewPostContractsForbidden() *PostContractsForbidden {
return &PostContractsForbidden{}
}
/* PostContractsForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type PostContractsForbidden struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *PostContractsForbidden) Error() string {
return fmt.Sprintf("[POST /contracts][%d] postContractsForbidden %+v", 403, o.Payload)
}
func (o *PostContractsForbidden) GetPayload() *research_models.Error {
return o.Payload
}
func (o *PostContractsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(research_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostContractsNotFound creates a PostContractsNotFound with default headers values
func NewPostContractsNotFound() *PostContractsNotFound {
return &PostContractsNotFound{}
}
/* PostContractsNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type PostContractsNotFound struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *PostContractsNotFound) Error() string {
return fmt.Sprintf("[POST /contracts][%d] postContractsNotFound %+v", 404, o.Payload)
}
func (o *PostContractsNotFound) GetPayload() *research_models.Error {
return o.Payload
}
func (o *PostContractsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(research_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostContractsUnprocessableEntity creates a PostContractsUnprocessableEntity with default headers values
func NewPostContractsUnprocessableEntity() *PostContractsUnprocessableEntity {
return &PostContractsUnprocessableEntity{}
}
/* PostContractsUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type PostContractsUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *PostContractsUnprocessableEntity) Error() string {
return fmt.Sprintf("[POST /contracts][%d] postContractsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PostContractsUnprocessableEntity) GetPayload() *research_models.Error {
return o.Payload
}
func (o *PostContractsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(research_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostContractsInternalServerError creates a PostContractsInternalServerError with default headers values
func NewPostContractsInternalServerError() *PostContractsInternalServerError {
return &PostContractsInternalServerError{}
}
/* PostContractsInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type PostContractsInternalServerError struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *PostContractsInternalServerError) Error() string {
return fmt.Sprintf("[POST /contracts][%d] postContractsInternalServerError %+v", 500, o.Payload)
}
func (o *PostContractsInternalServerError) GetPayload() *research_models.Error {
return o.Payload
}
func (o *PostContractsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(research_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}

View File

@ -17,6 +17,7 @@ import (
"code.tnxs.net/vernonkeenan/lib/api/research/research_client/accounts" "code.tnxs.net/vernonkeenan/lib/api/research/research_client/accounts"
"code.tnxs.net/vernonkeenan/lib/api/research/research_client/clusters" "code.tnxs.net/vernonkeenan/lib/api/research/research_client/clusters"
"code.tnxs.net/vernonkeenan/lib/api/research/research_client/contacts" "code.tnxs.net/vernonkeenan/lib/api/research/research_client/contacts"
"code.tnxs.net/vernonkeenan/lib/api/research/research_client/contracts"
"code.tnxs.net/vernonkeenan/lib/api/research/research_client/databases" "code.tnxs.net/vernonkeenan/lib/api/research/research_client/databases"
"code.tnxs.net/vernonkeenan/lib/api/research/research_client/roles" "code.tnxs.net/vernonkeenan/lib/api/research/research_client/roles"
"code.tnxs.net/vernonkeenan/lib/api/research/research_client/templates" "code.tnxs.net/vernonkeenan/lib/api/research/research_client/templates"
@ -69,6 +70,7 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *Research {
cli.Accounts = accounts.New(transport, formats) cli.Accounts = accounts.New(transport, formats)
cli.Clusters = clusters.New(transport, formats) cli.Clusters = clusters.New(transport, formats)
cli.Contacts = contacts.New(transport, formats) cli.Contacts = contacts.New(transport, formats)
cli.Contracts = contracts.New(transport, formats)
cli.Databases = databases.New(transport, formats) cli.Databases = databases.New(transport, formats)
cli.Roles = roles.New(transport, formats) cli.Roles = roles.New(transport, formats)
cli.Templates = templates.New(transport, formats) cli.Templates = templates.New(transport, formats)
@ -124,6 +126,8 @@ type Research struct {
Contacts contacts.ClientService Contacts contacts.ClientService
Contracts contracts.ClientService
Databases databases.ClientService Databases databases.ClientService
Roles roles.ClientService Roles roles.ClientService
@ -143,6 +147,7 @@ func (c *Research) SetTransport(transport runtime.ClientTransport) {
c.Accounts.SetTransport(transport) c.Accounts.SetTransport(transport)
c.Clusters.SetTransport(transport) c.Clusters.SetTransport(transport)
c.Contacts.SetTransport(transport) c.Contacts.SetTransport(transport)
c.Contracts.SetTransport(transport)
c.Databases.SetTransport(transport) c.Databases.SetTransport(transport)
c.Roles.SetTransport(transport) c.Roles.SetTransport(transport)
c.Templates.SetTransport(transport) c.Templates.SetTransport(transport)

View File

@ -322,6 +322,8 @@ func (m *Account) validateBillingaddress(formats strfmt.Registry) error {
if err := m.Billingaddress.Validate(formats); err != nil { if err := m.Billingaddress.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("billingaddress") return ve.ValidateName("billingaddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("billingaddress")
} }
return err return err
} }
@ -339,6 +341,8 @@ func (m *Account) validateBusinessaddress(formats strfmt.Registry) error {
if err := m.Businessaddress.Validate(formats); err != nil { if err := m.Businessaddress.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("businessaddress") return ve.ValidateName("businessaddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("businessaddress")
} }
return err return err
} }
@ -356,6 +360,8 @@ func (m *Account) validateDefaultaddress(formats strfmt.Registry) error {
if err := m.Defaultaddress.Validate(formats); err != nil { if err := m.Defaultaddress.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("defaultaddress") return ve.ValidateName("defaultaddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("defaultaddress")
} }
return err return err
} }
@ -373,6 +379,8 @@ func (m *Account) validateShippingaddress(formats strfmt.Registry) error {
if err := m.Shippingaddress.Validate(formats); err != nil { if err := m.Shippingaddress.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("shippingaddress") return ve.ValidateName("shippingaddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("shippingaddress")
} }
return err return err
} }
@ -413,6 +421,8 @@ func (m *Account) contextValidateBillingaddress(ctx context.Context, formats str
if err := m.Billingaddress.ContextValidate(ctx, formats); err != nil { if err := m.Billingaddress.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("billingaddress") return ve.ValidateName("billingaddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("billingaddress")
} }
return err return err
} }
@ -427,6 +437,8 @@ func (m *Account) contextValidateBusinessaddress(ctx context.Context, formats st
if err := m.Businessaddress.ContextValidate(ctx, formats); err != nil { if err := m.Businessaddress.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("businessaddress") return ve.ValidateName("businessaddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("businessaddress")
} }
return err return err
} }
@ -441,6 +453,8 @@ func (m *Account) contextValidateDefaultaddress(ctx context.Context, formats str
if err := m.Defaultaddress.ContextValidate(ctx, formats); err != nil { if err := m.Defaultaddress.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("defaultaddress") return ve.ValidateName("defaultaddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("defaultaddress")
} }
return err return err
} }
@ -455,6 +469,8 @@ func (m *Account) contextValidateShippingaddress(ctx context.Context, formats st
if err := m.Shippingaddress.ContextValidate(ctx, formats); err != nil { if err := m.Shippingaddress.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("shippingaddress") return ve.ValidateName("shippingaddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("shippingaddress")
} }
return err return err
} }

View File

@ -62,6 +62,8 @@ func (m *AccountRequest) validateData(formats strfmt.Registry) error {
if err := m.Data[i].Validate(formats); err != nil { if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i)) return ve.ValidateName("data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -81,6 +83,8 @@ func (m *AccountRequest) validateMeta(formats strfmt.Registry) error {
if err := m.Meta.Validate(formats); err != nil { if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta") return ve.ValidateName("meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("meta")
} }
return err return err
} }
@ -115,6 +119,8 @@ func (m *AccountRequest) contextValidateData(ctx context.Context, formats strfmt
if err := m.Data[i].ContextValidate(ctx, formats); err != nil { if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i)) return ve.ValidateName("data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -131,6 +137,8 @@ func (m *AccountRequest) contextValidateMeta(ctx context.Context, formats strfmt
if err := m.Meta.ContextValidate(ctx, formats); err != nil { if err := m.Meta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta") return ve.ValidateName("meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("meta")
} }
return err return err
} }

View File

@ -62,6 +62,8 @@ func (m *AccountResponse) validateData(formats strfmt.Registry) error {
if err := m.Data[i].Validate(formats); err != nil { if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i)) return ve.ValidateName("data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -81,6 +83,8 @@ func (m *AccountResponse) validateMeta(formats strfmt.Registry) error {
if err := m.Meta.Validate(formats); err != nil { if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta") return ve.ValidateName("meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("meta")
} }
return err return err
} }
@ -115,6 +119,8 @@ func (m *AccountResponse) contextValidateData(ctx context.Context, formats strfm
if err := m.Data[i].ContextValidate(ctx, formats); err != nil { if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i)) return ve.ValidateName("data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -131,6 +137,8 @@ func (m *AccountResponse) contextValidateMeta(ctx context.Context, formats strfm
if err := m.Meta.ContextValidate(ctx, formats); err != nil { if err := m.Meta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta") return ve.ValidateName("meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("meta")
} }
return err return err
} }

View File

@ -66,6 +66,8 @@ func (m *ClusterRequest) validateData(formats strfmt.Registry) error {
if err := m.Data[i].Validate(formats); err != nil { if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i)) return ve.ValidateName("data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -86,6 +88,8 @@ func (m *ClusterRequest) validateMeta(formats strfmt.Registry) error {
if err := m.Meta.Validate(formats); err != nil { if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta") return ve.ValidateName("meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("meta")
} }
return err return err
} }
@ -120,6 +124,8 @@ func (m *ClusterRequest) contextValidateData(ctx context.Context, formats strfmt
if err := m.Data[i].ContextValidate(ctx, formats); err != nil { if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i)) return ve.ValidateName("data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -136,6 +142,8 @@ func (m *ClusterRequest) contextValidateMeta(ctx context.Context, formats strfmt
if err := m.Meta.ContextValidate(ctx, formats); err != nil { if err := m.Meta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta") return ve.ValidateName("meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("meta")
} }
return err return err
} }

View File

@ -62,6 +62,8 @@ func (m *ClusterResponse) validateData(formats strfmt.Registry) error {
if err := m.Data[i].Validate(formats); err != nil { if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i)) return ve.ValidateName("data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -81,6 +83,8 @@ func (m *ClusterResponse) validateMeta(formats strfmt.Registry) error {
if err := m.Meta.Validate(formats); err != nil { if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta") return ve.ValidateName("meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("meta")
} }
return err return err
} }
@ -115,6 +119,8 @@ func (m *ClusterResponse) contextValidateData(ctx context.Context, formats strfm
if err := m.Data[i].ContextValidate(ctx, formats); err != nil { if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i)) return ve.ValidateName("data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -131,6 +137,8 @@ func (m *ClusterResponse) contextValidateMeta(ctx context.Context, formats strfm
if err := m.Meta.ContextValidate(ctx, formats); err != nil { if err := m.Meta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta") return ve.ValidateName("meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("meta")
} }
return err return err
} }

View File

@ -185,6 +185,8 @@ func (m *Contact) validateMailingaddress(formats strfmt.Registry) error {
if err := m.Mailingaddress.Validate(formats); err != nil { if err := m.Mailingaddress.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("mailingaddress") return ve.ValidateName("mailingaddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("mailingaddress")
} }
return err return err
} }
@ -202,6 +204,8 @@ func (m *Contact) validateOtheraddress(formats strfmt.Registry) error {
if err := m.Otheraddress.Validate(formats); err != nil { if err := m.Otheraddress.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("otheraddress") return ve.ValidateName("otheraddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("otheraddress")
} }
return err return err
} }
@ -234,6 +238,8 @@ func (m *Contact) contextValidateMailingaddress(ctx context.Context, formats str
if err := m.Mailingaddress.ContextValidate(ctx, formats); err != nil { if err := m.Mailingaddress.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("mailingaddress") return ve.ValidateName("mailingaddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("mailingaddress")
} }
return err return err
} }
@ -248,6 +254,8 @@ func (m *Contact) contextValidateOtheraddress(ctx context.Context, formats strfm
if err := m.Otheraddress.ContextValidate(ctx, formats); err != nil { if err := m.Otheraddress.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("otheraddress") return ve.ValidateName("otheraddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("otheraddress")
} }
return err return err
} }

View File

@ -66,6 +66,8 @@ func (m *ContactRequest) validateData(formats strfmt.Registry) error {
if err := m.Data[i].Validate(formats); err != nil { if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i)) return ve.ValidateName("data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -86,6 +88,8 @@ func (m *ContactRequest) validateMeta(formats strfmt.Registry) error {
if err := m.Meta.Validate(formats); err != nil { if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta") return ve.ValidateName("meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("meta")
} }
return err return err
} }
@ -120,6 +124,8 @@ func (m *ContactRequest) contextValidateData(ctx context.Context, formats strfmt
if err := m.Data[i].ContextValidate(ctx, formats); err != nil { if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i)) return ve.ValidateName("data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -136,6 +142,8 @@ func (m *ContactRequest) contextValidateMeta(ctx context.Context, formats strfmt
if err := m.Meta.ContextValidate(ctx, formats); err != nil { if err := m.Meta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta") return ve.ValidateName("meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("meta")
} }
return err return err
} }

View File

@ -62,6 +62,8 @@ func (m *ContactResponse) validateData(formats strfmt.Registry) error {
if err := m.Data[i].Validate(formats); err != nil { if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i)) return ve.ValidateName("data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -81,6 +83,8 @@ func (m *ContactResponse) validateMeta(formats strfmt.Registry) error {
if err := m.Meta.Validate(formats); err != nil { if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta") return ve.ValidateName("meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("meta")
} }
return err return err
} }
@ -115,6 +119,8 @@ func (m *ContactResponse) contextValidateData(ctx context.Context, formats strfm
if err := m.Data[i].ContextValidate(ctx, formats); err != nil { if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i)) return ve.ValidateName("data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -131,6 +137,8 @@ func (m *ContactResponse) contextValidateMeta(ctx context.Context, formats strfm
if err := m.Meta.ContextValidate(ctx, formats); err != nil { if err := m.Meta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta") return ve.ValidateName("meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("meta")
} }
return err return err
} }

View File

@ -0,0 +1,238 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package research_models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// Contract contract
//
// swagger:model Contract
type Contract struct {
// Account
AccountID string `json:"AccountID,omitempty"`
// Activated By
ActivatedByID string `json:"ActivatedByID,omitempty"`
// Activated Date
ActivatedDate string `json:"ActivatedDate,omitempty"`
// Billing Address
BillingAddress *Address `json:"BillingAddress,omitempty"`
// Billing Contact
BillingContactID string `json:"BillingContactID,omitempty"`
// Company Signed Date
CompanySignedDate string `json:"CompanySignedDate,omitempty"`
// Company Signed By
CompanySignedID string `json:"CompanySignedID,omitempty"`
// Contract Number
ContractNumber string `json:"ContractNumber,omitempty"`
// Contract Term (months)
ContractTerm float64 `json:"ContractTerm,omitempty"`
// Created By User ID
CreatedByID string `json:"CreatedByID,omitempty"`
// Created Date
CreatedDate string `json:"CreatedDate,omitempty"`
// Customer Signed Date
CustomerSignedDate string `json:"CustomerSignedDate,omitempty"`
// Customer Signed By
CustomerSignedID string `json:"CustomerSignedID,omitempty"`
// Customer Signed Title
CustomerSignedTitle string `json:"CustomerSignedTitle,omitempty"`
// End User
DefaultEndUserID string `json:"DefaultEndUserID,omitempty"`
// Description
Description string `json:"Description,omitempty"`
// Contract End Date
EndDate string `json:"EndDate,omitempty"`
// Hourly Rate
HourlyRate float64 `json:"HourlyRate,omitempty"`
// Telnexus 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"`
// Contract Name
Name string `json:"Name,omitempty"`
// Payment Method
PaymentMethodID string `json:"PaymentMethodID,omitempty"`
// Payment Terms
PaymentTerms string `json:"PaymentTerms,omitempty"`
// Perpetual Agreement?
Perpetual bool `json:"Perpetual,omitempty"`
// Shipping Address
ShippingAddress *Address `json:"ShippingAddress,omitempty"`
// Shipping Contact
ShippingContactID string `json:"ShippingContactID,omitempty"`
// Contract Start Date
StartDate string `json:"StartDate,omitempty"`
// Status
Status string `json:"Status,omitempty"`
// Tenant Identifier
TenantID string `json:"TenantID,omitempty"`
}
// Validate validates this contract
func (m *Contract) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateBillingAddress(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 *Contract) 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")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("BillingAddress")
}
return err
}
}
return nil
}
func (m *Contract) 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")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("ShippingAddress")
}
return err
}
}
return nil
}
// ContextValidate validate this contract based on the context it is used
func (m *Contract) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateBillingAddress(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateShippingAddress(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *Contract) contextValidateBillingAddress(ctx context.Context, formats strfmt.Registry) error {
if m.BillingAddress != nil {
if err := m.BillingAddress.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("BillingAddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("BillingAddress")
}
return err
}
}
return nil
}
func (m *Contract) contextValidateShippingAddress(ctx context.Context, formats strfmt.Registry) error {
if m.ShippingAddress != nil {
if err := m.ShippingAddress.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("ShippingAddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("ShippingAddress")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *Contract) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Contract) UnmarshalBinary(b []byte) error {
var res Contract
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,120 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package research_models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// ContractRequest contract request
//
// swagger:model ContractRequest
type ContractRequest struct {
// data
Data []*Contract `json:"Data"`
}
// Validate validates this contract request
func (m *ContractRequest) 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 *ContractRequest) 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))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this contract request based on the context it is used
func (m *ContractRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateData(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *ContractRequest) contextValidateData(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Data); i++ {
if m.Data[i] != nil {
if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *ContractRequest) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *ContractRequest) UnmarshalBinary(b []byte) error {
var res ContractRequest
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,166 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package research_models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// ContractResponse contract response
//
// swagger:model ContractResponse
type ContractResponse struct {
// data
Data []*Contract `json:"Data"`
// meta
Meta *ResponseMeta `json:"Meta,omitempty"`
}
// Validate validates this contract response
func (m *ContractResponse) 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 *ContractResponse) 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))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *ContractResponse) 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")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Meta")
}
return err
}
}
return nil
}
// ContextValidate validate this contract response based on the context it is used
func (m *ContractResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateData(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateMeta(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *ContractResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Data); i++ {
if m.Data[i] != nil {
if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *ContractResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error {
if m.Meta != nil {
if err := m.Meta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Meta")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *ContractResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *ContractResponse) UnmarshalBinary(b []byte) error {
var res ContractResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -62,6 +62,8 @@ func (m *DatabaseRequest) validateData(formats strfmt.Registry) error {
if err := m.Data[i].Validate(formats); err != nil { if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i)) return ve.ValidateName("data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -81,6 +83,8 @@ func (m *DatabaseRequest) validateMeta(formats strfmt.Registry) error {
if err := m.Meta.Validate(formats); err != nil { if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta") return ve.ValidateName("meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("meta")
} }
return err return err
} }
@ -115,6 +119,8 @@ func (m *DatabaseRequest) contextValidateData(ctx context.Context, formats strfm
if err := m.Data[i].ContextValidate(ctx, formats); err != nil { if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i)) return ve.ValidateName("data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -131,6 +137,8 @@ func (m *DatabaseRequest) contextValidateMeta(ctx context.Context, formats strfm
if err := m.Meta.ContextValidate(ctx, formats); err != nil { if err := m.Meta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta") return ve.ValidateName("meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("meta")
} }
return err return err
} }

View File

@ -62,6 +62,8 @@ func (m *DatabaseResponse) validateData(formats strfmt.Registry) error {
if err := m.Data[i].Validate(formats); err != nil { if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i)) return ve.ValidateName("data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -81,6 +83,8 @@ func (m *DatabaseResponse) validateMeta(formats strfmt.Registry) error {
if err := m.Meta.Validate(formats); err != nil { if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta") return ve.ValidateName("meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("meta")
} }
return err return err
} }
@ -115,6 +119,8 @@ func (m *DatabaseResponse) contextValidateData(ctx context.Context, formats strf
if err := m.Data[i].ContextValidate(ctx, formats); err != nil { if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i)) return ve.ValidateName("data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -131,6 +137,8 @@ func (m *DatabaseResponse) contextValidateMeta(ctx context.Context, formats strf
if err := m.Meta.ContextValidate(ctx, formats); err != nil { if err := m.Meta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta") return ve.ValidateName("meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("meta")
} }
return err return err
} }

View File

@ -62,6 +62,8 @@ func (m *DeleteResponse) validateData(formats strfmt.Registry) error {
if err := m.Data[i].Validate(formats); err != nil { if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i)) return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -81,6 +83,8 @@ func (m *DeleteResponse) validateMeta(formats strfmt.Registry) error {
if err := m.Meta.Validate(formats); err != nil { if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta") return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Meta")
} }
return err return err
} }
@ -115,6 +119,8 @@ func (m *DeleteResponse) contextValidateData(ctx context.Context, formats strfmt
if err := m.Data[i].ContextValidate(ctx, formats); err != nil { if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i)) return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -131,6 +137,8 @@ func (m *DeleteResponse) contextValidateMeta(ctx context.Context, formats strfmt
if err := m.Meta.ContextValidate(ctx, formats); err != nil { if err := m.Meta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta") return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Meta")
} }
return err return err
} }

View File

@ -82,6 +82,8 @@ func (m *ResponseMeta) validatePagination(formats strfmt.Registry) error {
if err := m.Pagination.Validate(formats); err != nil { if err := m.Pagination.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Pagination") return ve.ValidateName("Pagination")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Pagination")
} }
return err return err
} }
@ -110,6 +112,8 @@ func (m *ResponseMeta) contextValidatePagination(ctx context.Context, formats st
if err := m.Pagination.ContextValidate(ctx, formats); err != nil { if err := m.Pagination.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Pagination") return ve.ValidateName("Pagination")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Pagination")
} }
return err return err
} }

View File

@ -62,6 +62,8 @@ func (m *RoleRequest) validateData(formats strfmt.Registry) error {
if err := m.Data[i].Validate(formats); err != nil { if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i)) return ve.ValidateName("data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -81,6 +83,8 @@ func (m *RoleRequest) validateMeta(formats strfmt.Registry) error {
if err := m.Meta.Validate(formats); err != nil { if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta") return ve.ValidateName("meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("meta")
} }
return err return err
} }
@ -115,6 +119,8 @@ func (m *RoleRequest) contextValidateData(ctx context.Context, formats strfmt.Re
if err := m.Data[i].ContextValidate(ctx, formats); err != nil { if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i)) return ve.ValidateName("data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -131,6 +137,8 @@ func (m *RoleRequest) contextValidateMeta(ctx context.Context, formats strfmt.Re
if err := m.Meta.ContextValidate(ctx, formats); err != nil { if err := m.Meta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta") return ve.ValidateName("meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("meta")
} }
return err return err
} }

View File

@ -62,6 +62,8 @@ func (m *RoleResponse) validateData(formats strfmt.Registry) error {
if err := m.Data[i].Validate(formats); err != nil { if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i)) return ve.ValidateName("data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -81,6 +83,8 @@ func (m *RoleResponse) validateMeta(formats strfmt.Registry) error {
if err := m.Meta.Validate(formats); err != nil { if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta") return ve.ValidateName("meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("meta")
} }
return err return err
} }
@ -115,6 +119,8 @@ func (m *RoleResponse) contextValidateData(ctx context.Context, formats strfmt.R
if err := m.Data[i].ContextValidate(ctx, formats); err != nil { if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i)) return ve.ValidateName("data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -131,6 +137,8 @@ func (m *RoleResponse) contextValidateMeta(ctx context.Context, formats strfmt.R
if err := m.Meta.ContextValidate(ctx, formats); err != nil { if err := m.Meta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta") return ve.ValidateName("meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("meta")
} }
return err return err
} }

View File

@ -62,6 +62,8 @@ func (m *TemplateResponse) validateData(formats strfmt.Registry) error {
if err := m.Data[i].Validate(formats); err != nil { if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i)) return ve.ValidateName("data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -81,6 +83,8 @@ func (m *TemplateResponse) validateMeta(formats strfmt.Registry) error {
if err := m.Meta.Validate(formats); err != nil { if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta") return ve.ValidateName("meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("meta")
} }
return err return err
} }
@ -115,6 +119,8 @@ func (m *TemplateResponse) contextValidateData(ctx context.Context, formats strf
if err := m.Data[i].ContextValidate(ctx, formats); err != nil { if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i)) return ve.ValidateName("data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -131,6 +137,8 @@ func (m *TemplateResponse) contextValidateMeta(ctx context.Context, formats strf
if err := m.Meta.ContextValidate(ctx, formats); err != nil { if err := m.Meta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta") return ve.ValidateName("meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("meta")
} }
return err return err
} }

View File

@ -102,6 +102,8 @@ func (m *Tenant) validateDatabases(formats strfmt.Registry) error {
if err := m.Databases[i].Validate(formats); err != nil { if err := m.Databases[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("databases" + "." + strconv.Itoa(i)) return ve.ValidateName("databases" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("databases" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -126,6 +128,8 @@ func (m *Tenant) validateRoles(formats strfmt.Registry) error {
if err := m.Roles[i].Validate(formats); err != nil { if err := m.Roles[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("roles" + "." + strconv.Itoa(i)) return ve.ValidateName("roles" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("roles" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -150,6 +154,8 @@ func (m *Tenant) validateTenantusers(formats strfmt.Registry) error {
if err := m.Tenantusers[i].Validate(formats); err != nil { if err := m.Tenantusers[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("tenantusers" + "." + strconv.Itoa(i)) return ve.ValidateName("tenantusers" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("tenantusers" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -190,6 +196,8 @@ func (m *Tenant) contextValidateDatabases(ctx context.Context, formats strfmt.Re
if err := m.Databases[i].ContextValidate(ctx, formats); err != nil { if err := m.Databases[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("databases" + "." + strconv.Itoa(i)) return ve.ValidateName("databases" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("databases" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -208,6 +216,8 @@ func (m *Tenant) contextValidateRoles(ctx context.Context, formats strfmt.Regist
if err := m.Roles[i].ContextValidate(ctx, formats); err != nil { if err := m.Roles[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("roles" + "." + strconv.Itoa(i)) return ve.ValidateName("roles" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("roles" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -226,6 +236,8 @@ func (m *Tenant) contextValidateTenantusers(ctx context.Context, formats strfmt.
if err := m.Tenantusers[i].ContextValidate(ctx, formats); err != nil { if err := m.Tenantusers[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("tenantusers" + "." + strconv.Itoa(i)) return ve.ValidateName("tenantusers" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("tenantusers" + "." + strconv.Itoa(i))
} }
return err return err
} }

View File

@ -62,6 +62,8 @@ func (m *TenantRequest) validateData(formats strfmt.Registry) error {
if err := m.Data[i].Validate(formats); err != nil { if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i)) return ve.ValidateName("data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -81,6 +83,8 @@ func (m *TenantRequest) validateMeta(formats strfmt.Registry) error {
if err := m.Meta.Validate(formats); err != nil { if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta") return ve.ValidateName("meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("meta")
} }
return err return err
} }
@ -115,6 +119,8 @@ func (m *TenantRequest) contextValidateData(ctx context.Context, formats strfmt.
if err := m.Data[i].ContextValidate(ctx, formats); err != nil { if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i)) return ve.ValidateName("data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -131,6 +137,8 @@ func (m *TenantRequest) contextValidateMeta(ctx context.Context, formats strfmt.
if err := m.Meta.ContextValidate(ctx, formats); err != nil { if err := m.Meta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta") return ve.ValidateName("meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("meta")
} }
return err return err
} }

View File

@ -62,6 +62,8 @@ func (m *TenantResponse) validateData(formats strfmt.Registry) error {
if err := m.Data[i].Validate(formats); err != nil { if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i)) return ve.ValidateName("data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -81,6 +83,8 @@ func (m *TenantResponse) validateMeta(formats strfmt.Registry) error {
if err := m.Meta.Validate(formats); err != nil { if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta") return ve.ValidateName("meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("meta")
} }
return err return err
} }
@ -115,6 +119,8 @@ func (m *TenantResponse) contextValidateData(ctx context.Context, formats strfmt
if err := m.Data[i].ContextValidate(ctx, formats); err != nil { if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i)) return ve.ValidateName("data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -131,6 +137,8 @@ func (m *TenantResponse) contextValidateMeta(ctx context.Context, formats strfmt
if err := m.Meta.ContextValidate(ctx, formats); err != nil { if err := m.Meta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta") return ve.ValidateName("meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("meta")
} }
return err return err
} }

View File

@ -229,6 +229,8 @@ func (m *User) validateAddress(formats strfmt.Registry) error {
if err := m.Address.Validate(formats); err != nil { if err := m.Address.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("address") return ve.ValidateName("address")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("address")
} }
return err return err
} }
@ -251,6 +253,8 @@ func (m *User) validateTenantusers(formats strfmt.Registry) error {
if err := m.Tenantusers[i].Validate(formats); err != nil { if err := m.Tenantusers[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("tenantusers" + "." + strconv.Itoa(i)) return ve.ValidateName("tenantusers" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("tenantusers" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -275,6 +279,8 @@ func (m *User) validateUserroles(formats strfmt.Registry) error {
if err := m.Userroles[i].Validate(formats); err != nil { if err := m.Userroles[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("userroles" + "." + strconv.Itoa(i)) return ve.ValidateName("userroles" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("userroles" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -313,6 +319,8 @@ func (m *User) contextValidateAddress(ctx context.Context, formats strfmt.Regist
if err := m.Address.ContextValidate(ctx, formats); err != nil { if err := m.Address.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("address") return ve.ValidateName("address")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("address")
} }
return err return err
} }
@ -329,6 +337,8 @@ func (m *User) contextValidateTenantusers(ctx context.Context, formats strfmt.Re
if err := m.Tenantusers[i].ContextValidate(ctx, formats); err != nil { if err := m.Tenantusers[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("tenantusers" + "." + strconv.Itoa(i)) return ve.ValidateName("tenantusers" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("tenantusers" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -347,6 +357,8 @@ func (m *User) contextValidateUserroles(ctx context.Context, formats strfmt.Regi
if err := m.Userroles[i].ContextValidate(ctx, formats); err != nil { if err := m.Userroles[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("userroles" + "." + strconv.Itoa(i)) return ve.ValidateName("userroles" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("userroles" + "." + strconv.Itoa(i))
} }
return err return err
} }

View File

@ -62,6 +62,8 @@ func (m *UserResponse) validateData(formats strfmt.Registry) error {
if err := m.Data[i].Validate(formats); err != nil { if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i)) return ve.ValidateName("data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -81,6 +83,8 @@ func (m *UserResponse) validateMeta(formats strfmt.Registry) error {
if err := m.Meta.Validate(formats); err != nil { if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta") return ve.ValidateName("meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("meta")
} }
return err return err
} }
@ -115,6 +119,8 @@ func (m *UserResponse) contextValidateData(ctx context.Context, formats strfmt.R
if err := m.Data[i].ContextValidate(ctx, formats); err != nil { if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i)) return ve.ValidateName("data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -131,6 +137,8 @@ func (m *UserResponse) contextValidateMeta(ctx context.Context, formats strfmt.R
if err := m.Meta.ContextValidate(ctx, formats); err != nil { if err := m.Meta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta") return ve.ValidateName("meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("meta")
} }
return err return err
} }

View File

@ -0,0 +1,129 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package contracts
// 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 contracts API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
return &Client{transport: transport, formats: formats}
}
/*
Client for contracts API
*/
type Client struct {
transport runtime.ClientTransport
formats strfmt.Registry
}
// ClientOption is the option for Client methods
type ClientOption func(*runtime.ClientOperation)
// ClientService is the interface for Client methods
type ClientService interface {
GetContracts(params *GetContractsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetContractsOK, error)
PostContracts(params *PostContractsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostContractsOK, error)
SetTransport(transport runtime.ClientTransport)
}
/*
GetContracts gets a list of contracts
Return a list of all available Contracts
*/
func (a *Client) GetContracts(params *GetContractsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetContractsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetContractsParams()
}
op := &runtime.ClientOperation{
ID: "getContracts",
Method: "GET",
PathPattern: "/contracts",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &GetContractsReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*GetContractsOK)
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 getContracts: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
PostContracts adds a new contract to taxnexus
Contract record to be added
*/
func (a *Client) PostContracts(params *PostContractsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostContractsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPostContractsParams()
}
op := &runtime.ClientOperation{
ID: "postContracts",
Method: "POST",
PathPattern: "/contracts",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PostContractsReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*PostContractsOK)
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 postContracts: 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
}

View File

@ -0,0 +1,272 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package contracts
// 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"
)
// NewGetContractsParams creates a new GetContractsParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewGetContractsParams() *GetContractsParams {
return &GetContractsParams{
timeout: cr.DefaultTimeout,
}
}
// NewGetContractsParamsWithTimeout creates a new GetContractsParams object
// with the ability to set a timeout on a request.
func NewGetContractsParamsWithTimeout(timeout time.Duration) *GetContractsParams {
return &GetContractsParams{
timeout: timeout,
}
}
// NewGetContractsParamsWithContext creates a new GetContractsParams object
// with the ability to set a context for a request.
func NewGetContractsParamsWithContext(ctx context.Context) *GetContractsParams {
return &GetContractsParams{
Context: ctx,
}
}
// NewGetContractsParamsWithHTTPClient creates a new GetContractsParams object
// with the ability to set a custom HTTPClient for a request.
func NewGetContractsParamsWithHTTPClient(client *http.Client) *GetContractsParams {
return &GetContractsParams{
HTTPClient: client,
}
}
/* GetContractsParams contains all the parameters to send to the API endpoint
for the get contracts operation.
Typically these are written to a http.Request.
*/
type GetContractsParams struct {
/* Active.
Only retrieve active records?
*/
Active *bool
/* ContractID.
Taxnexus Contact record ID
*/
ContractID *string
/* Limit.
How many objects to return at one time
Format: int64
*/
Limit *int64
/* Offset.
How many objects to skip?
Format: int64
*/
Offset *int64
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the get contracts params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetContractsParams) WithDefaults() *GetContractsParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the get contracts params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetContractsParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the get contracts params
func (o *GetContractsParams) WithTimeout(timeout time.Duration) *GetContractsParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the get contracts params
func (o *GetContractsParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the get contracts params
func (o *GetContractsParams) WithContext(ctx context.Context) *GetContractsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get contracts params
func (o *GetContractsParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the get contracts params
func (o *GetContractsParams) WithHTTPClient(client *http.Client) *GetContractsParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the get contracts params
func (o *GetContractsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithActive adds the active to the get contracts params
func (o *GetContractsParams) WithActive(active *bool) *GetContractsParams {
o.SetActive(active)
return o
}
// SetActive adds the active to the get contracts params
func (o *GetContractsParams) SetActive(active *bool) {
o.Active = active
}
// WithContractID adds the contractID to the get contracts params
func (o *GetContractsParams) WithContractID(contractID *string) *GetContractsParams {
o.SetContractID(contractID)
return o
}
// SetContractID adds the contractId to the get contracts params
func (o *GetContractsParams) SetContractID(contractID *string) {
o.ContractID = contractID
}
// WithLimit adds the limit to the get contracts params
func (o *GetContractsParams) WithLimit(limit *int64) *GetContractsParams {
o.SetLimit(limit)
return o
}
// SetLimit adds the limit to the get contracts params
func (o *GetContractsParams) SetLimit(limit *int64) {
o.Limit = limit
}
// WithOffset adds the offset to the get contracts params
func (o *GetContractsParams) WithOffset(offset *int64) *GetContractsParams {
o.SetOffset(offset)
return o
}
// SetOffset adds the offset to the get contracts params
func (o *GetContractsParams) SetOffset(offset *int64) {
o.Offset = offset
}
// WriteToRequest writes these params to a swagger request
func (o *GetContractsParams) 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.ContractID != nil {
// query param contractId
var qrContractID string
if o.ContractID != nil {
qrContractID = *o.ContractID
}
qContractID := qrContractID
if qContractID != "" {
if err := r.SetQueryParam("contractId", qContractID); 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
}

View File

@ -0,0 +1,323 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package contracts
// 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"
"code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_models"
)
// GetContractsReader is a Reader for the GetContracts structure.
type GetContractsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetContractsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetContractsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewGetContractsUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewGetContractsForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewGetContractsNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewGetContractsUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewGetContractsInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
}
}
// NewGetContractsOK creates a GetContractsOK with default headers values
func NewGetContractsOK() *GetContractsOK {
return &GetContractsOK{}
}
/* GetContractsOK describes a response with status code 200, with default header values.
Taxnexus Response with an array of Contract objects
*/
type GetContractsOK struct {
AccessControlAllowOrigin string
CacheControl string
Payload *sfgate_models.ContractResponse
}
func (o *GetContractsOK) Error() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsOK %+v", 200, o.Payload)
}
func (o *GetContractsOK) GetPayload() *sfgate_models.ContractResponse {
return o.Payload
}
func (o *GetContractsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
// hydrates response header Cache-Control
hdrCacheControl := response.GetHeader("Cache-Control")
if hdrCacheControl != "" {
o.CacheControl = hdrCacheControl
}
o.Payload = new(sfgate_models.ContractResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetContractsUnauthorized creates a GetContractsUnauthorized with default headers values
func NewGetContractsUnauthorized() *GetContractsUnauthorized {
return &GetContractsUnauthorized{}
}
/* GetContractsUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type GetContractsUnauthorized struct {
AccessControlAllowOrigin string
Payload *sfgate_models.Error
}
func (o *GetContractsUnauthorized) Error() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsUnauthorized %+v", 401, o.Payload)
}
func (o *GetContractsUnauthorized) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetContractsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetContractsForbidden creates a GetContractsForbidden with default headers values
func NewGetContractsForbidden() *GetContractsForbidden {
return &GetContractsForbidden{}
}
/* GetContractsForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type GetContractsForbidden struct {
AccessControlAllowOrigin string
Payload *sfgate_models.Error
}
func (o *GetContractsForbidden) Error() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsForbidden %+v", 403, o.Payload)
}
func (o *GetContractsForbidden) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetContractsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetContractsNotFound creates a GetContractsNotFound with default headers values
func NewGetContractsNotFound() *GetContractsNotFound {
return &GetContractsNotFound{}
}
/* GetContractsNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type GetContractsNotFound struct {
AccessControlAllowOrigin string
Payload *sfgate_models.Error
}
func (o *GetContractsNotFound) Error() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsNotFound %+v", 404, o.Payload)
}
func (o *GetContractsNotFound) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetContractsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetContractsUnprocessableEntity creates a GetContractsUnprocessableEntity with default headers values
func NewGetContractsUnprocessableEntity() *GetContractsUnprocessableEntity {
return &GetContractsUnprocessableEntity{}
}
/* GetContractsUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type GetContractsUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *sfgate_models.Error
}
func (o *GetContractsUnprocessableEntity) Error() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetContractsUnprocessableEntity) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetContractsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetContractsInternalServerError creates a GetContractsInternalServerError with default headers values
func NewGetContractsInternalServerError() *GetContractsInternalServerError {
return &GetContractsInternalServerError{}
}
/* GetContractsInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type GetContractsInternalServerError struct {
AccessControlAllowOrigin string
Payload *sfgate_models.Error
}
func (o *GetContractsInternalServerError) Error() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsInternalServerError %+v", 500, o.Payload)
}
func (o *GetContractsInternalServerError) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetContractsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}

View File

@ -0,0 +1,155 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package contracts
// 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"
"code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_models"
)
// NewPostContractsParams creates a new PostContractsParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewPostContractsParams() *PostContractsParams {
return &PostContractsParams{
timeout: cr.DefaultTimeout,
}
}
// NewPostContractsParamsWithTimeout creates a new PostContractsParams object
// with the ability to set a timeout on a request.
func NewPostContractsParamsWithTimeout(timeout time.Duration) *PostContractsParams {
return &PostContractsParams{
timeout: timeout,
}
}
// NewPostContractsParamsWithContext creates a new PostContractsParams object
// with the ability to set a context for a request.
func NewPostContractsParamsWithContext(ctx context.Context) *PostContractsParams {
return &PostContractsParams{
Context: ctx,
}
}
// NewPostContractsParamsWithHTTPClient creates a new PostContractsParams object
// with the ability to set a custom HTTPClient for a request.
func NewPostContractsParamsWithHTTPClient(client *http.Client) *PostContractsParams {
return &PostContractsParams{
HTTPClient: client,
}
}
/* PostContractsParams contains all the parameters to send to the API endpoint
for the post contracts operation.
Typically these are written to a http.Request.
*/
type PostContractsParams struct {
/* ContractsRequest.
An array of new Contract records
*/
ContractsRequest *sfgate_models.ContractRequest
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the post contracts params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostContractsParams) WithDefaults() *PostContractsParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the post contracts params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostContractsParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the post contracts params
func (o *PostContractsParams) WithTimeout(timeout time.Duration) *PostContractsParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the post contracts params
func (o *PostContractsParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the post contracts params
func (o *PostContractsParams) WithContext(ctx context.Context) *PostContractsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the post contracts params
func (o *PostContractsParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the post contracts params
func (o *PostContractsParams) WithHTTPClient(client *http.Client) *PostContractsParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the post contracts params
func (o *PostContractsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithContractsRequest adds the contractsRequest to the post contracts params
func (o *PostContractsParams) WithContractsRequest(contractsRequest *sfgate_models.ContractRequest) *PostContractsParams {
o.SetContractsRequest(contractsRequest)
return o
}
// SetContractsRequest adds the contractsRequest to the post contracts params
func (o *PostContractsParams) SetContractsRequest(contractsRequest *sfgate_models.ContractRequest) {
o.ContractsRequest = contractsRequest
}
// WriteToRequest writes these params to a swagger request
func (o *PostContractsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.ContractsRequest != nil {
if err := r.SetBodyParam(o.ContractsRequest); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,323 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package contracts
// 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"
"code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_models"
)
// PostContractsReader is a Reader for the PostContracts structure.
type PostContractsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PostContractsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewPostContractsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewPostContractsUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewPostContractsForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewPostContractsNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewPostContractsUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewPostContractsInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
}
}
// NewPostContractsOK creates a PostContractsOK with default headers values
func NewPostContractsOK() *PostContractsOK {
return &PostContractsOK{}
}
/* PostContractsOK describes a response with status code 200, with default header values.
Taxnexus Response with an array of Contract objects
*/
type PostContractsOK struct {
AccessControlAllowOrigin string
CacheControl string
Payload *sfgate_models.ContractResponse
}
func (o *PostContractsOK) Error() string {
return fmt.Sprintf("[POST /contracts][%d] postContractsOK %+v", 200, o.Payload)
}
func (o *PostContractsOK) GetPayload() *sfgate_models.ContractResponse {
return o.Payload
}
func (o *PostContractsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
// hydrates response header Cache-Control
hdrCacheControl := response.GetHeader("Cache-Control")
if hdrCacheControl != "" {
o.CacheControl = hdrCacheControl
}
o.Payload = new(sfgate_models.ContractResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostContractsUnauthorized creates a PostContractsUnauthorized with default headers values
func NewPostContractsUnauthorized() *PostContractsUnauthorized {
return &PostContractsUnauthorized{}
}
/* PostContractsUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type PostContractsUnauthorized struct {
AccessControlAllowOrigin string
Payload *sfgate_models.Error
}
func (o *PostContractsUnauthorized) Error() string {
return fmt.Sprintf("[POST /contracts][%d] postContractsUnauthorized %+v", 401, o.Payload)
}
func (o *PostContractsUnauthorized) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostContractsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostContractsForbidden creates a PostContractsForbidden with default headers values
func NewPostContractsForbidden() *PostContractsForbidden {
return &PostContractsForbidden{}
}
/* PostContractsForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type PostContractsForbidden struct {
AccessControlAllowOrigin string
Payload *sfgate_models.Error
}
func (o *PostContractsForbidden) Error() string {
return fmt.Sprintf("[POST /contracts][%d] postContractsForbidden %+v", 403, o.Payload)
}
func (o *PostContractsForbidden) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostContractsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostContractsNotFound creates a PostContractsNotFound with default headers values
func NewPostContractsNotFound() *PostContractsNotFound {
return &PostContractsNotFound{}
}
/* PostContractsNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type PostContractsNotFound struct {
AccessControlAllowOrigin string
Payload *sfgate_models.Error
}
func (o *PostContractsNotFound) Error() string {
return fmt.Sprintf("[POST /contracts][%d] postContractsNotFound %+v", 404, o.Payload)
}
func (o *PostContractsNotFound) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostContractsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostContractsUnprocessableEntity creates a PostContractsUnprocessableEntity with default headers values
func NewPostContractsUnprocessableEntity() *PostContractsUnprocessableEntity {
return &PostContractsUnprocessableEntity{}
}
/* PostContractsUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type PostContractsUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *sfgate_models.Error
}
func (o *PostContractsUnprocessableEntity) Error() string {
return fmt.Sprintf("[POST /contracts][%d] postContractsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PostContractsUnprocessableEntity) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostContractsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostContractsInternalServerError creates a PostContractsInternalServerError with default headers values
func NewPostContractsInternalServerError() *PostContractsInternalServerError {
return &PostContractsInternalServerError{}
}
/* PostContractsInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type PostContractsInternalServerError struct {
AccessControlAllowOrigin string
Payload *sfgate_models.Error
}
func (o *PostContractsInternalServerError) Error() string {
return fmt.Sprintf("[POST /contracts][%d] postContractsInternalServerError %+v", 500, o.Payload)
}
func (o *PostContractsInternalServerError) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostContractsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}

View File

@ -17,6 +17,7 @@ import (
"code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_client/accounts" "code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_client/accounts"
"code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_client/clusters" "code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_client/clusters"
"code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_client/contacts" "code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_client/contacts"
"code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_client/contracts"
"code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_client/databases" "code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_client/databases"
"code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_client/roles" "code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_client/roles"
"code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_client/templates" "code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_client/templates"
@ -69,6 +70,7 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *Sfgate {
cli.Accounts = accounts.New(transport, formats) cli.Accounts = accounts.New(transport, formats)
cli.Clusters = clusters.New(transport, formats) cli.Clusters = clusters.New(transport, formats)
cli.Contacts = contacts.New(transport, formats) cli.Contacts = contacts.New(transport, formats)
cli.Contracts = contracts.New(transport, formats)
cli.Databases = databases.New(transport, formats) cli.Databases = databases.New(transport, formats)
cli.Roles = roles.New(transport, formats) cli.Roles = roles.New(transport, formats)
cli.Templates = templates.New(transport, formats) cli.Templates = templates.New(transport, formats)
@ -124,6 +126,8 @@ type Sfgate struct {
Contacts contacts.ClientService Contacts contacts.ClientService
Contracts contracts.ClientService
Databases databases.ClientService Databases databases.ClientService
Roles roles.ClientService Roles roles.ClientService
@ -143,6 +147,7 @@ func (c *Sfgate) SetTransport(transport runtime.ClientTransport) {
c.Accounts.SetTransport(transport) c.Accounts.SetTransport(transport)
c.Clusters.SetTransport(transport) c.Clusters.SetTransport(transport)
c.Contacts.SetTransport(transport) c.Contacts.SetTransport(transport)
c.Contracts.SetTransport(transport)
c.Databases.SetTransport(transport) c.Databases.SetTransport(transport)
c.Roles.SetTransport(transport) c.Roles.SetTransport(transport)
c.Templates.SetTransport(transport) c.Templates.SetTransport(transport)

View File

@ -322,6 +322,8 @@ func (m *Account) validateBillingaddress(formats strfmt.Registry) error {
if err := m.Billingaddress.Validate(formats); err != nil { if err := m.Billingaddress.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("billingaddress") return ve.ValidateName("billingaddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("billingaddress")
} }
return err return err
} }
@ -339,6 +341,8 @@ func (m *Account) validateBusinessaddress(formats strfmt.Registry) error {
if err := m.Businessaddress.Validate(formats); err != nil { if err := m.Businessaddress.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("businessaddress") return ve.ValidateName("businessaddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("businessaddress")
} }
return err return err
} }
@ -356,6 +360,8 @@ func (m *Account) validateDefaultaddress(formats strfmt.Registry) error {
if err := m.Defaultaddress.Validate(formats); err != nil { if err := m.Defaultaddress.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("defaultaddress") return ve.ValidateName("defaultaddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("defaultaddress")
} }
return err return err
} }
@ -373,6 +379,8 @@ func (m *Account) validateShippingaddress(formats strfmt.Registry) error {
if err := m.Shippingaddress.Validate(formats); err != nil { if err := m.Shippingaddress.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("shippingaddress") return ve.ValidateName("shippingaddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("shippingaddress")
} }
return err return err
} }
@ -413,6 +421,8 @@ func (m *Account) contextValidateBillingaddress(ctx context.Context, formats str
if err := m.Billingaddress.ContextValidate(ctx, formats); err != nil { if err := m.Billingaddress.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("billingaddress") return ve.ValidateName("billingaddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("billingaddress")
} }
return err return err
} }
@ -427,6 +437,8 @@ func (m *Account) contextValidateBusinessaddress(ctx context.Context, formats st
if err := m.Businessaddress.ContextValidate(ctx, formats); err != nil { if err := m.Businessaddress.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("businessaddress") return ve.ValidateName("businessaddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("businessaddress")
} }
return err return err
} }
@ -441,6 +453,8 @@ func (m *Account) contextValidateDefaultaddress(ctx context.Context, formats str
if err := m.Defaultaddress.ContextValidate(ctx, formats); err != nil { if err := m.Defaultaddress.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("defaultaddress") return ve.ValidateName("defaultaddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("defaultaddress")
} }
return err return err
} }
@ -455,6 +469,8 @@ func (m *Account) contextValidateShippingaddress(ctx context.Context, formats st
if err := m.Shippingaddress.ContextValidate(ctx, formats); err != nil { if err := m.Shippingaddress.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("shippingaddress") return ve.ValidateName("shippingaddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("shippingaddress")
} }
return err return err
} }

View File

@ -62,6 +62,8 @@ func (m *AccountRequest) validateData(formats strfmt.Registry) error {
if err := m.Data[i].Validate(formats); err != nil { if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i)) return ve.ValidateName("data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -81,6 +83,8 @@ func (m *AccountRequest) validateMeta(formats strfmt.Registry) error {
if err := m.Meta.Validate(formats); err != nil { if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta") return ve.ValidateName("meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("meta")
} }
return err return err
} }
@ -115,6 +119,8 @@ func (m *AccountRequest) contextValidateData(ctx context.Context, formats strfmt
if err := m.Data[i].ContextValidate(ctx, formats); err != nil { if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i)) return ve.ValidateName("data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -131,6 +137,8 @@ func (m *AccountRequest) contextValidateMeta(ctx context.Context, formats strfmt
if err := m.Meta.ContextValidate(ctx, formats); err != nil { if err := m.Meta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta") return ve.ValidateName("meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("meta")
} }
return err return err
} }

View File

@ -62,6 +62,8 @@ func (m *AccountResponse) validateData(formats strfmt.Registry) error {
if err := m.Data[i].Validate(formats); err != nil { if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i)) return ve.ValidateName("data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -81,6 +83,8 @@ func (m *AccountResponse) validateMeta(formats strfmt.Registry) error {
if err := m.Meta.Validate(formats); err != nil { if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta") return ve.ValidateName("meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("meta")
} }
return err return err
} }
@ -115,6 +119,8 @@ func (m *AccountResponse) contextValidateData(ctx context.Context, formats strfm
if err := m.Data[i].ContextValidate(ctx, formats); err != nil { if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i)) return ve.ValidateName("data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -131,6 +137,8 @@ func (m *AccountResponse) contextValidateMeta(ctx context.Context, formats strfm
if err := m.Meta.ContextValidate(ctx, formats); err != nil { if err := m.Meta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta") return ve.ValidateName("meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("meta")
} }
return err return err
} }

View File

@ -66,6 +66,8 @@ func (m *ClusterRequest) validateData(formats strfmt.Registry) error {
if err := m.Data[i].Validate(formats); err != nil { if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i)) return ve.ValidateName("data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -86,6 +88,8 @@ func (m *ClusterRequest) validateMeta(formats strfmt.Registry) error {
if err := m.Meta.Validate(formats); err != nil { if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta") return ve.ValidateName("meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("meta")
} }
return err return err
} }
@ -120,6 +124,8 @@ func (m *ClusterRequest) contextValidateData(ctx context.Context, formats strfmt
if err := m.Data[i].ContextValidate(ctx, formats); err != nil { if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i)) return ve.ValidateName("data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -136,6 +142,8 @@ func (m *ClusterRequest) contextValidateMeta(ctx context.Context, formats strfmt
if err := m.Meta.ContextValidate(ctx, formats); err != nil { if err := m.Meta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta") return ve.ValidateName("meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("meta")
} }
return err return err
} }

View File

@ -62,6 +62,8 @@ func (m *ClusterResponse) validateData(formats strfmt.Registry) error {
if err := m.Data[i].Validate(formats); err != nil { if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i)) return ve.ValidateName("data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -81,6 +83,8 @@ func (m *ClusterResponse) validateMeta(formats strfmt.Registry) error {
if err := m.Meta.Validate(formats); err != nil { if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta") return ve.ValidateName("meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("meta")
} }
return err return err
} }
@ -115,6 +119,8 @@ func (m *ClusterResponse) contextValidateData(ctx context.Context, formats strfm
if err := m.Data[i].ContextValidate(ctx, formats); err != nil { if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i)) return ve.ValidateName("data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -131,6 +137,8 @@ func (m *ClusterResponse) contextValidateMeta(ctx context.Context, formats strfm
if err := m.Meta.ContextValidate(ctx, formats); err != nil { if err := m.Meta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta") return ve.ValidateName("meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("meta")
} }
return err return err
} }

View File

@ -185,6 +185,8 @@ func (m *Contact) validateMailingaddress(formats strfmt.Registry) error {
if err := m.Mailingaddress.Validate(formats); err != nil { if err := m.Mailingaddress.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("mailingaddress") return ve.ValidateName("mailingaddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("mailingaddress")
} }
return err return err
} }
@ -202,6 +204,8 @@ func (m *Contact) validateOtheraddress(formats strfmt.Registry) error {
if err := m.Otheraddress.Validate(formats); err != nil { if err := m.Otheraddress.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("otheraddress") return ve.ValidateName("otheraddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("otheraddress")
} }
return err return err
} }
@ -234,6 +238,8 @@ func (m *Contact) contextValidateMailingaddress(ctx context.Context, formats str
if err := m.Mailingaddress.ContextValidate(ctx, formats); err != nil { if err := m.Mailingaddress.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("mailingaddress") return ve.ValidateName("mailingaddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("mailingaddress")
} }
return err return err
} }
@ -248,6 +254,8 @@ func (m *Contact) contextValidateOtheraddress(ctx context.Context, formats strfm
if err := m.Otheraddress.ContextValidate(ctx, formats); err != nil { if err := m.Otheraddress.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("otheraddress") return ve.ValidateName("otheraddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("otheraddress")
} }
return err return err
} }

View File

@ -66,6 +66,8 @@ func (m *ContactRequest) validateData(formats strfmt.Registry) error {
if err := m.Data[i].Validate(formats); err != nil { if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i)) return ve.ValidateName("data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -86,6 +88,8 @@ func (m *ContactRequest) validateMeta(formats strfmt.Registry) error {
if err := m.Meta.Validate(formats); err != nil { if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta") return ve.ValidateName("meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("meta")
} }
return err return err
} }
@ -120,6 +124,8 @@ func (m *ContactRequest) contextValidateData(ctx context.Context, formats strfmt
if err := m.Data[i].ContextValidate(ctx, formats); err != nil { if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i)) return ve.ValidateName("data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -136,6 +142,8 @@ func (m *ContactRequest) contextValidateMeta(ctx context.Context, formats strfmt
if err := m.Meta.ContextValidate(ctx, formats); err != nil { if err := m.Meta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta") return ve.ValidateName("meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("meta")
} }
return err return err
} }

View File

@ -62,6 +62,8 @@ func (m *ContactResponse) validateData(formats strfmt.Registry) error {
if err := m.Data[i].Validate(formats); err != nil { if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i)) return ve.ValidateName("data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -81,6 +83,8 @@ func (m *ContactResponse) validateMeta(formats strfmt.Registry) error {
if err := m.Meta.Validate(formats); err != nil { if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta") return ve.ValidateName("meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("meta")
} }
return err return err
} }
@ -115,6 +119,8 @@ func (m *ContactResponse) contextValidateData(ctx context.Context, formats strfm
if err := m.Data[i].ContextValidate(ctx, formats); err != nil { if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i)) return ve.ValidateName("data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("data" + "." + strconv.Itoa(i))
} }
return err return err
} }
@ -131,6 +137,8 @@ func (m *ContactResponse) contextValidateMeta(ctx context.Context, formats strfm
if err := m.Meta.ContextValidate(ctx, formats); err != nil { if err := m.Meta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok { if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta") return ve.ValidateName("meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("meta")
} }
return err return err
} }

View File

@ -0,0 +1,238 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package sfgate_models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// Contract contract
//
// swagger:model Contract
type Contract struct {
// Account
AccountID string `json:"AccountID,omitempty"`
// Activated By
ActivatedByID string `json:"ActivatedByID,omitempty"`
// Activated Date
ActivatedDate string `json:"ActivatedDate,omitempty"`
// Billing Address
BillingAddress *Address `json:"BillingAddress,omitempty"`
// Billing Contact
BillingContactID string `json:"BillingContactID,omitempty"`
// Company Signed Date
CompanySignedDate string `json:"CompanySignedDate,omitempty"`
// Company Signed By
CompanySignedID string `json:"CompanySignedID,omitempty"`
// Contract Number
ContractNumber string `json:"ContractNumber,omitempty"`
// Contract Term (months)
ContractTerm float64 `json:"ContractTerm,omitempty"`
// Created By User ID
CreatedByID string `json:"CreatedByID,omitempty"`
// Created Date
CreatedDate string `json:"CreatedDate,omitempty"`
// Customer Signed Date
CustomerSignedDate string `json:"CustomerSignedDate,omitempty"`
// Customer Signed By
CustomerSignedID string `json:"CustomerSignedID,omitempty"`
// Customer Signed Title
CustomerSignedTitle string `json:"CustomerSignedTitle,omitempty"`
// End User
DefaultEndUserID string `json:"DefaultEndUserID,omitempty"`
// Description
Description string `json:"Description,omitempty"`
// Contract End Date
EndDate string `json:"EndDate,omitempty"`
// Hourly Rate
HourlyRate float64 `json:"HourlyRate,omitempty"`
// Telnexus 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"`
// Contract Name
Name string `json:"Name,omitempty"`
// Payment Method
PaymentMethodID string `json:"PaymentMethodID,omitempty"`
// Payment Terms
PaymentTerms string `json:"PaymentTerms,omitempty"`
// Perpetual Agreement?
Perpetual bool `json:"Perpetual,omitempty"`
// Shipping Address
ShippingAddress *Address `json:"ShippingAddress,omitempty"`
// Shipping Contact
ShippingContactID string `json:"ShippingContactID,omitempty"`
// Contract Start Date
StartDate string `json:"StartDate,omitempty"`
// Status
Status string `json:"Status,omitempty"`
// Tenant Identifier
TenantID string `json:"TenantID,omitempty"`
}
// Validate validates this contract
func (m *Contract) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateBillingAddress(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 *Contract) 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")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("BillingAddress")
}
return err
}
}
return nil
}
func (m *Contract) 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")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("ShippingAddress")
}
return err
}
}
return nil
}
// ContextValidate validate this contract based on the context it is used
func (m *Contract) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateBillingAddress(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateShippingAddress(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *Contract) contextValidateBillingAddress(ctx context.Context, formats strfmt.Registry) error {
if m.BillingAddress != nil {
if err := m.BillingAddress.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("BillingAddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("BillingAddress")
}
return err
}
}
return nil
}
func (m *Contract) contextValidateShippingAddress(ctx context.Context, formats strfmt.Registry) error {
if m.ShippingAddress != nil {
if err := m.ShippingAddress.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("ShippingAddress")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("ShippingAddress")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *Contract) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Contract) UnmarshalBinary(b []byte) error {
var res Contract
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,120 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package sfgate_models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// ContractRequest contract request
//
// swagger:model ContractRequest
type ContractRequest struct {
// data
Data []*Contract `json:"Data"`
}
// Validate validates this contract request
func (m *ContractRequest) 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 *ContractRequest) 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))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this contract request based on the context it is used
func (m *ContractRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateData(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *ContractRequest) contextValidateData(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Data); i++ {
if m.Data[i] != nil {
if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *ContractRequest) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *ContractRequest) UnmarshalBinary(b []byte) error {
var res ContractRequest
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

Some files were not shown because too many files have changed in this diff Show More