v0.0.9 v0.0.9
Vernon Keenan 2021-08-14 15:34:08 -07:00
parent b3ea30b2bf
commit 1fc267b3da
177 changed files with 24117 additions and 9304 deletions

View File

@ -8,6 +8,14 @@ VERNONKEENAN_VERSION ?= 0.0.1
.PHONY: swagger
swagger:
cp ../auth/swagger/auth-kvision.yaml ./swagger
cp ../crm/swagger/crm-kvision.yaml ./swagger
cp ../devops/swagger/devops-kvision.yaml ./swagger
cp ../stash/swagger/stash-kvision.yaml ./swagger
cp ../sf-gate/swagger/sf-gate-kvision.yaml ./swagger
cp ../research/swagger/research-kvision.yaml ./swagger
cp ../workflow/swagger/workflow-kvision.yaml ./swagger
#
rm -rf api
#
# generate auth0 client
@ -87,6 +95,19 @@ swagger:
--model-package=sfgate-models \
--principal=app.User
#
# generate research client
#
mkdir api/research
swagger-new generate client \
--log-output=./swagger/logs/generate-research-client.log \
--copyright-file=./build/COPYRIGHT \
--name=research \
--spec=./swagger/sf-gate-kvision.yaml \
--target=./api/research \
--client-package=research-client \
--model-package=research-models \
--principal=app.User
#
# generate workflow client
#
mkdir api/workflow

View File

@ -1,165 +0,0 @@
// 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 companies
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
)
// NewGetCompaniesObservableParams creates a new GetCompaniesObservableParams object,
// with the default 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 NewGetCompaniesObservableParams() *GetCompaniesObservableParams {
return &GetCompaniesObservableParams{
timeout: cr.DefaultTimeout,
}
}
// NewGetCompaniesObservableParamsWithTimeout creates a new GetCompaniesObservableParams object
// with the ability to set a timeout on a request.
func NewGetCompaniesObservableParamsWithTimeout(timeout time.Duration) *GetCompaniesObservableParams {
return &GetCompaniesObservableParams{
timeout: timeout,
}
}
// NewGetCompaniesObservableParamsWithContext creates a new GetCompaniesObservableParams object
// with the ability to set a context for a request.
func NewGetCompaniesObservableParamsWithContext(ctx context.Context) *GetCompaniesObservableParams {
return &GetCompaniesObservableParams{
Context: ctx,
}
}
// NewGetCompaniesObservableParamsWithHTTPClient creates a new GetCompaniesObservableParams object
// with the ability to set a custom HTTPClient for a request.
func NewGetCompaniesObservableParamsWithHTTPClient(client *http.Client) *GetCompaniesObservableParams {
return &GetCompaniesObservableParams{
HTTPClient: client,
}
}
/* GetCompaniesObservableParams contains all the parameters to send to the API endpoint
for the get companies observable operation.
Typically these are written to a http.Request.
*/
type GetCompaniesObservableParams struct {
/* CompanyID.
Taxnexus Company record ID
*/
CompanyID *string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the get companies observable params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetCompaniesObservableParams) WithDefaults() *GetCompaniesObservableParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the get companies observable params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetCompaniesObservableParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the get companies observable params
func (o *GetCompaniesObservableParams) WithTimeout(timeout time.Duration) *GetCompaniesObservableParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the get companies observable params
func (o *GetCompaniesObservableParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the get companies observable params
func (o *GetCompaniesObservableParams) WithContext(ctx context.Context) *GetCompaniesObservableParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get companies observable params
func (o *GetCompaniesObservableParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the get companies observable params
func (o *GetCompaniesObservableParams) WithHTTPClient(client *http.Client) *GetCompaniesObservableParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the get companies observable params
func (o *GetCompaniesObservableParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithCompanyID adds the companyID to the get companies observable params
func (o *GetCompaniesObservableParams) WithCompanyID(companyID *string) *GetCompaniesObservableParams {
o.SetCompanyID(companyID)
return o
}
// SetCompanyID adds the companyId to the get companies observable params
func (o *GetCompaniesObservableParams) SetCompanyID(companyID *string) {
o.CompanyID = companyID
}
// WriteToRequest writes these params to a swagger request
func (o *GetCompaniesObservableParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.CompanyID != nil {
// query param companyId
var qrCompanyID string
if o.CompanyID != nil {
qrCompanyID = *o.CompanyID
}
qCompanyID := qrCompanyID
if qCompanyID != "" {
if err := r.SetQueryParam("companyId", qCompanyID); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -1,321 +0,0 @@
// 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 companies
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
)
// GetCompaniesObservableReader is a Reader for the GetCompaniesObservable structure.
type GetCompaniesObservableReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetCompaniesObservableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetCompaniesObservableOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewGetCompaniesObservableUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewGetCompaniesObservableForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewGetCompaniesObservableNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewGetCompaniesObservableUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewGetCompaniesObservableInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
}
}
// NewGetCompaniesObservableOK creates a GetCompaniesObservableOK with default headers values
func NewGetCompaniesObservableOK() *GetCompaniesObservableOK {
return &GetCompaniesObservableOK{}
}
/* GetCompaniesObservableOK describes a response with status code 200, with default header values.
Taxnexus Response with an array of Company objects
*/
type GetCompaniesObservableOK struct {
AccessControlAllowOrigin string
CacheControl string
Payload []*crm_models.Company
}
func (o *GetCompaniesObservableOK) Error() string {
return fmt.Sprintf("[GET /companies/observable][%d] getCompaniesObservableOK %+v", 200, o.Payload)
}
func (o *GetCompaniesObservableOK) GetPayload() []*crm_models.Company {
return o.Payload
}
func (o *GetCompaniesObservableOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// 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
}
// NewGetCompaniesObservableUnauthorized creates a GetCompaniesObservableUnauthorized with default headers values
func NewGetCompaniesObservableUnauthorized() *GetCompaniesObservableUnauthorized {
return &GetCompaniesObservableUnauthorized{}
}
/* GetCompaniesObservableUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type GetCompaniesObservableUnauthorized struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *GetCompaniesObservableUnauthorized) Error() string {
return fmt.Sprintf("[GET /companies/observable][%d] getCompaniesObservableUnauthorized %+v", 401, o.Payload)
}
func (o *GetCompaniesObservableUnauthorized) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *GetCompaniesObservableUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// 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
}
// NewGetCompaniesObservableForbidden creates a GetCompaniesObservableForbidden with default headers values
func NewGetCompaniesObservableForbidden() *GetCompaniesObservableForbidden {
return &GetCompaniesObservableForbidden{}
}
/* GetCompaniesObservableForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type GetCompaniesObservableForbidden struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *GetCompaniesObservableForbidden) Error() string {
return fmt.Sprintf("[GET /companies/observable][%d] getCompaniesObservableForbidden %+v", 403, o.Payload)
}
func (o *GetCompaniesObservableForbidden) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *GetCompaniesObservableForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// 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
}
// NewGetCompaniesObservableNotFound creates a GetCompaniesObservableNotFound with default headers values
func NewGetCompaniesObservableNotFound() *GetCompaniesObservableNotFound {
return &GetCompaniesObservableNotFound{}
}
/* GetCompaniesObservableNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type GetCompaniesObservableNotFound struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *GetCompaniesObservableNotFound) Error() string {
return fmt.Sprintf("[GET /companies/observable][%d] getCompaniesObservableNotFound %+v", 404, o.Payload)
}
func (o *GetCompaniesObservableNotFound) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *GetCompaniesObservableNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// 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
}
// NewGetCompaniesObservableUnprocessableEntity creates a GetCompaniesObservableUnprocessableEntity with default headers values
func NewGetCompaniesObservableUnprocessableEntity() *GetCompaniesObservableUnprocessableEntity {
return &GetCompaniesObservableUnprocessableEntity{}
}
/* GetCompaniesObservableUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type GetCompaniesObservableUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *GetCompaniesObservableUnprocessableEntity) Error() string {
return fmt.Sprintf("[GET /companies/observable][%d] getCompaniesObservableUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetCompaniesObservableUnprocessableEntity) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *GetCompaniesObservableUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// 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
}
// NewGetCompaniesObservableInternalServerError creates a GetCompaniesObservableInternalServerError with default headers values
func NewGetCompaniesObservableInternalServerError() *GetCompaniesObservableInternalServerError {
return &GetCompaniesObservableInternalServerError{}
}
/* GetCompaniesObservableInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type GetCompaniesObservableInternalServerError struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *GetCompaniesObservableInternalServerError) Error() string {
return fmt.Sprintf("[GET /companies/observable][%d] getCompaniesObservableInternalServerError %+v", 500, o.Payload)
}
func (o *GetCompaniesObservableInternalServerError) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *GetCompaniesObservableInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// 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

@ -1,165 +0,0 @@
// 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 companies
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
)
// NewGetCompaniesParams creates a new GetCompaniesParams object,
// with the default 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 NewGetCompaniesParams() *GetCompaniesParams {
return &GetCompaniesParams{
timeout: cr.DefaultTimeout,
}
}
// NewGetCompaniesParamsWithTimeout creates a new GetCompaniesParams object
// with the ability to set a timeout on a request.
func NewGetCompaniesParamsWithTimeout(timeout time.Duration) *GetCompaniesParams {
return &GetCompaniesParams{
timeout: timeout,
}
}
// NewGetCompaniesParamsWithContext creates a new GetCompaniesParams object
// with the ability to set a context for a request.
func NewGetCompaniesParamsWithContext(ctx context.Context) *GetCompaniesParams {
return &GetCompaniesParams{
Context: ctx,
}
}
// NewGetCompaniesParamsWithHTTPClient creates a new GetCompaniesParams object
// with the ability to set a custom HTTPClient for a request.
func NewGetCompaniesParamsWithHTTPClient(client *http.Client) *GetCompaniesParams {
return &GetCompaniesParams{
HTTPClient: client,
}
}
/* GetCompaniesParams contains all the parameters to send to the API endpoint
for the get companies operation.
Typically these are written to a http.Request.
*/
type GetCompaniesParams struct {
/* CompanyID.
Taxnexus Company record ID
*/
CompanyID *string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the get companies params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetCompaniesParams) WithDefaults() *GetCompaniesParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the get companies params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetCompaniesParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the get companies params
func (o *GetCompaniesParams) WithTimeout(timeout time.Duration) *GetCompaniesParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the get companies params
func (o *GetCompaniesParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the get companies params
func (o *GetCompaniesParams) WithContext(ctx context.Context) *GetCompaniesParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get companies params
func (o *GetCompaniesParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the get companies params
func (o *GetCompaniesParams) WithHTTPClient(client *http.Client) *GetCompaniesParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the get companies params
func (o *GetCompaniesParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithCompanyID adds the companyID to the get companies params
func (o *GetCompaniesParams) WithCompanyID(companyID *string) *GetCompaniesParams {
o.SetCompanyID(companyID)
return o
}
// SetCompanyID adds the companyId to the get companies params
func (o *GetCompaniesParams) SetCompanyID(companyID *string) {
o.CompanyID = companyID
}
// WriteToRequest writes these params to a swagger request
func (o *GetCompaniesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.CompanyID != nil {
// query param companyId
var qrCompanyID string
if o.CompanyID != nil {
qrCompanyID = *o.CompanyID
}
qCompanyID := qrCompanyID
if qCompanyID != "" {
if err := r.SetQueryParam("companyId", qCompanyID); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -1,155 +0,0 @@
// 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 companies
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
)
// NewPostCompaniesParams creates a new PostCompaniesParams 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 NewPostCompaniesParams() *PostCompaniesParams {
return &PostCompaniesParams{
timeout: cr.DefaultTimeout,
}
}
// NewPostCompaniesParamsWithTimeout creates a new PostCompaniesParams object
// with the ability to set a timeout on a request.
func NewPostCompaniesParamsWithTimeout(timeout time.Duration) *PostCompaniesParams {
return &PostCompaniesParams{
timeout: timeout,
}
}
// NewPostCompaniesParamsWithContext creates a new PostCompaniesParams object
// with the ability to set a context for a request.
func NewPostCompaniesParamsWithContext(ctx context.Context) *PostCompaniesParams {
return &PostCompaniesParams{
Context: ctx,
}
}
// NewPostCompaniesParamsWithHTTPClient creates a new PostCompaniesParams object
// with the ability to set a custom HTTPClient for a request.
func NewPostCompaniesParamsWithHTTPClient(client *http.Client) *PostCompaniesParams {
return &PostCompaniesParams{
HTTPClient: client,
}
}
/* PostCompaniesParams contains all the parameters to send to the API endpoint
for the post companies operation.
Typically these are written to a http.Request.
*/
type PostCompaniesParams struct {
/* CompaniesRequest.
An array of new Contact records
*/
CompaniesRequest *crm_models.CompanyRequest
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the post companies params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostCompaniesParams) WithDefaults() *PostCompaniesParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the post companies params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostCompaniesParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the post companies params
func (o *PostCompaniesParams) WithTimeout(timeout time.Duration) *PostCompaniesParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the post companies params
func (o *PostCompaniesParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the post companies params
func (o *PostCompaniesParams) WithContext(ctx context.Context) *PostCompaniesParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the post companies params
func (o *PostCompaniesParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the post companies params
func (o *PostCompaniesParams) WithHTTPClient(client *http.Client) *PostCompaniesParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the post companies params
func (o *PostCompaniesParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithCompaniesRequest adds the companiesRequest to the post companies params
func (o *PostCompaniesParams) WithCompaniesRequest(companiesRequest *crm_models.CompanyRequest) *PostCompaniesParams {
o.SetCompaniesRequest(companiesRequest)
return o
}
// SetCompaniesRequest adds the companiesRequest to the post companies params
func (o *PostCompaniesParams) SetCompaniesRequest(companiesRequest *crm_models.CompanyRequest) {
o.CompaniesRequest = companiesRequest
}
// WriteToRequest writes these params to a swagger request
func (o *PostCompaniesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.CompaniesRequest != nil {
if err := r.SetBodyParam(o.CompaniesRequest); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -1,130 +0,0 @@
// 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"
)
// NewCompanyObservableOptionsParams creates a new CompanyObservableOptionsParams 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 NewCompanyObservableOptionsParams() *CompanyObservableOptionsParams {
return &CompanyObservableOptionsParams{
timeout: cr.DefaultTimeout,
}
}
// NewCompanyObservableOptionsParamsWithTimeout creates a new CompanyObservableOptionsParams object
// with the ability to set a timeout on a request.
func NewCompanyObservableOptionsParamsWithTimeout(timeout time.Duration) *CompanyObservableOptionsParams {
return &CompanyObservableOptionsParams{
timeout: timeout,
}
}
// NewCompanyObservableOptionsParamsWithContext creates a new CompanyObservableOptionsParams object
// with the ability to set a context for a request.
func NewCompanyObservableOptionsParamsWithContext(ctx context.Context) *CompanyObservableOptionsParams {
return &CompanyObservableOptionsParams{
Context: ctx,
}
}
// NewCompanyObservableOptionsParamsWithHTTPClient creates a new CompanyObservableOptionsParams object
// with the ability to set a custom HTTPClient for a request.
func NewCompanyObservableOptionsParamsWithHTTPClient(client *http.Client) *CompanyObservableOptionsParams {
return &CompanyObservableOptionsParams{
HTTPClient: client,
}
}
/* CompanyObservableOptionsParams contains all the parameters to send to the API endpoint
for the company observable options operation.
Typically these are written to a http.Request.
*/
type CompanyObservableOptionsParams struct {
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the company observable options params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *CompanyObservableOptionsParams) WithDefaults() *CompanyObservableOptionsParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the company observable options params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *CompanyObservableOptionsParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the company observable options params
func (o *CompanyObservableOptionsParams) WithTimeout(timeout time.Duration) *CompanyObservableOptionsParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the company observable options params
func (o *CompanyObservableOptionsParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the company observable options params
func (o *CompanyObservableOptionsParams) WithContext(ctx context.Context) *CompanyObservableOptionsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the company observable options params
func (o *CompanyObservableOptionsParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the company observable options params
func (o *CompanyObservableOptionsParams) WithHTTPClient(client *http.Client) *CompanyObservableOptionsParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the company observable options params
func (o *CompanyObservableOptionsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WriteToRequest writes these params to a swagger request
func (o *CompanyObservableOptionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -1,113 +0,0 @@
// 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"
)
// CompanyObservableOptionsReader is a Reader for the CompanyObservableOptions structure.
type CompanyObservableOptionsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *CompanyObservableOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewCompanyObservableOptionsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
default:
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
}
}
// NewCompanyObservableOptionsOK creates a CompanyObservableOptionsOK with default headers values
func NewCompanyObservableOptionsOK() *CompanyObservableOptionsOK {
return &CompanyObservableOptionsOK{}
}
/* CompanyObservableOptionsOK describes a response with status code 200, with default header values.
CORS OPTIONS response
*/
type CompanyObservableOptionsOK struct {
AccessControlAllowCredentials string
AccessControlAllowHeaders string
AccessControlAllowMethods string
AccessControlAllowOrigin string
AccessControlExposeHeaders string
AccessControlMaxAge string
CacheControl string
}
func (o *CompanyObservableOptionsOK) Error() string {
return fmt.Sprintf("[OPTIONS /companies/observable][%d] companyObservableOptionsOK ", 200)
}
func (o *CompanyObservableOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// 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

@ -1,130 +0,0 @@
// 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"
)
// NewCompanyOptionsParams creates a new CompanyOptionsParams 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 NewCompanyOptionsParams() *CompanyOptionsParams {
return &CompanyOptionsParams{
timeout: cr.DefaultTimeout,
}
}
// NewCompanyOptionsParamsWithTimeout creates a new CompanyOptionsParams object
// with the ability to set a timeout on a request.
func NewCompanyOptionsParamsWithTimeout(timeout time.Duration) *CompanyOptionsParams {
return &CompanyOptionsParams{
timeout: timeout,
}
}
// NewCompanyOptionsParamsWithContext creates a new CompanyOptionsParams object
// with the ability to set a context for a request.
func NewCompanyOptionsParamsWithContext(ctx context.Context) *CompanyOptionsParams {
return &CompanyOptionsParams{
Context: ctx,
}
}
// NewCompanyOptionsParamsWithHTTPClient creates a new CompanyOptionsParams object
// with the ability to set a custom HTTPClient for a request.
func NewCompanyOptionsParamsWithHTTPClient(client *http.Client) *CompanyOptionsParams {
return &CompanyOptionsParams{
HTTPClient: client,
}
}
/* CompanyOptionsParams contains all the parameters to send to the API endpoint
for the company options operation.
Typically these are written to a http.Request.
*/
type CompanyOptionsParams struct {
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the company options params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *CompanyOptionsParams) WithDefaults() *CompanyOptionsParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the company options params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *CompanyOptionsParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the company options params
func (o *CompanyOptionsParams) WithTimeout(timeout time.Duration) *CompanyOptionsParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the company options params
func (o *CompanyOptionsParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the company options params
func (o *CompanyOptionsParams) WithContext(ctx context.Context) *CompanyOptionsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the company options params
func (o *CompanyOptionsParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the company options params
func (o *CompanyOptionsParams) WithHTTPClient(client *http.Client) *CompanyOptionsParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the company options params
func (o *CompanyOptionsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WriteToRequest writes these params to a swagger request
func (o *CompanyOptionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -38,10 +38,6 @@ type ClientService interface {
AccountOptionsObservable(params *AccountOptionsObservableParams, opts ...ClientOption) (*AccountOptionsObservableOK, error)
CompanyObservableOptions(params *CompanyObservableOptionsParams, opts ...ClientOption) (*CompanyObservableOptionsOK, error)
CompanyOptions(params *CompanyOptionsParams, opts ...ClientOption) (*CompanyOptionsOK, error)
ContactOptions(params *ContactOptionsParams, opts ...ClientOption) (*ContactOptionsOK, error)
ContactOptionsObservable(params *ContactOptionsObservableParams, opts ...ClientOption) (*ContactOptionsObservableOK, error)
@ -129,82 +125,6 @@ func (a *Client) AccountOptionsObservable(params *AccountOptionsObservableParams
panic(msg)
}
/*
CompanyObservableOptions CORS support
*/
func (a *Client) CompanyObservableOptions(params *CompanyObservableOptionsParams, opts ...ClientOption) (*CompanyObservableOptionsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewCompanyObservableOptionsParams()
}
op := &runtime.ClientOperation{
ID: "companyObservableOptions",
Method: "OPTIONS",
PathPattern: "/companies/observable",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &CompanyObservableOptionsReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*CompanyObservableOptionsOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for companyObservableOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
CompanyOptions CORS support
*/
func (a *Client) CompanyOptions(params *CompanyOptionsParams, opts ...ClientOption) (*CompanyOptionsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewCompanyOptionsParams()
}
op := &runtime.ClientOperation{
ID: "companyOptions",
Method: "OPTIONS",
PathPattern: "/companies",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &CompanyOptionsReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*CompanyOptionsOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for companyOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
ContactOptions CORS support
*/

View File

@ -15,7 +15,6 @@ import (
"github.com/go-openapi/strfmt"
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_client/accounts"
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_client/companies"
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_client/contacts"
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_client/cors"
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_client/leads"
@ -64,7 +63,6 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *Crm {
cli := new(Crm)
cli.Transport = transport
cli.Accounts = accounts.New(transport, formats)
cli.Companies = companies.New(transport, formats)
cli.Contacts = contacts.New(transport, formats)
cli.Cors = cors.New(transport, formats)
cli.Leads = leads.New(transport, formats)
@ -114,8 +112,6 @@ func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig {
type Crm struct {
Accounts accounts.ClientService
Companies companies.ClientService
Contacts contacts.ClientService
Cors cors.ClientService
@ -129,7 +125,6 @@ type Crm struct {
func (c *Crm) SetTransport(transport runtime.ClientTransport) {
c.Transport = transport
c.Accounts.SetTransport(transport)
c.Companies.SetTransport(transport)
c.Contacts.SetTransport(transport)
c.Cors.SetTransport(transport)
c.Leads.SetTransport(transport)

View File

@ -1,248 +0,0 @@
// 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"
)
// Company company
//
// swagger:model Company
type Company struct {
// Taxnexus ID of the Account that owns this Company
AccountID string `json:"AccountID,omitempty"`
// Account Number Prefix
AccountNumberPrefix string `json:"AccountNumberPrefix,omitempty"`
// billing address
BillingAddress *Address `json:"BillingAddress,omitempty"`
// Billing Advice
BillingAdvice string `json:"BillingAdvice,omitempty"`
// Contact ID
BillingContactID string `json:"BillingContactID,omitempty"`
// Billing Email
BillingEmail string `json:"BillingEmail,omitempty"`
// Billing Phone
BillingPhone string `json:"BillingPhone,omitempty"`
// Billing Website
BillingWebsite string `json:"BillingWebsite,omitempty"`
// Chart of Accounts Template Account ID
COATemplateID string `json:"COATemplateID,omitempty"`
// Color Accent1
ColorAccent1 string `json:"ColorAccent1,omitempty"`
// Color Accent2
ColorAccent2 string `json:"ColorAccent2,omitempty"`
// Color Primary
ColorPrimary string `json:"ColorPrimary,omitempty"`
// Created By User ID
CreatedByID string `json:"CreatedByID,omitempty"`
// Created Date
CreatedDate string `json:"CreatedDate,omitempty"`
// User ID of default Customer Success user
CustomerSuccessID string `json:"CustomerSuccessID,omitempty"`
// Date Closed
DateClosed string `json:"DateClosed,omitempty"`
// default address
DefaultAddress *Address `json:"DefaultAddress,omitempty"`
// Default Company?
DefaultCompany bool `json:"DefaultCompany,omitempty"`
// Font Name for Body Text
FontBody string `json:"FontBody,omitempty"`
// Font Name for Heading
FontHeading string `json:"FontHeading,omitempty"`
// Font Name for Heading Narrow
FontHeadingNarrow string `json:"FontHeadingNarrow,omitempty"`
// Font Names for CSS Link
FontLink string `json:"FontLink,omitempty"`
// Font Name for Monospace
FontMono string `json:"FontMono,omitempty"`
// Taxnexus Record Id
ID string `json:"ID,omitempty"`
// International Customers?
International bool `json:"International,omitempty"`
// Last Account Number
LastAccountNumber int64 `json:"LastAccountNumber,omitempty"`
// Last Modified By User ID
LastModifiedByID string `json:"LastModifiedByID,omitempty"`
// Last Modified Date
LastModifiedDate string `json:"LastModifiedDate,omitempty"`
// Last TaxType Number
LastTaxTypeNumber int64 `json:"LastTaxTypeNumber,omitempty"`
// Logo URL
Logo string `json:"Logo,omitempty"`
// Company Name
Name string `json:"Name,omitempty"`
// The ID of the contact who owns this Company
OwnerID string `json:"OwnerID,omitempty"`
// User ID of the default tax preparer
PreparerID string `json:"PreparerID,omitempty"`
// The ID of the default Pricebook for this company
PricebookID string `json:"PricebookID,omitempty"`
// Tenant Identifier
TenantID string `json:"TenantID,omitempty"`
// The ID of the contact who is the User Tech Lead for Company
UserTechLeadID string `json:"UserTechLeadID,omitempty"`
}
// Validate validates this company
func (m *Company) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateBillingAddress(formats); err != nil {
res = append(res, err)
}
if err := m.validateDefaultAddress(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *Company) validateBillingAddress(formats strfmt.Registry) error {
if swag.IsZero(m.BillingAddress) { // not required
return nil
}
if m.BillingAddress != nil {
if err := m.BillingAddress.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("BillingAddress")
}
return err
}
}
return nil
}
func (m *Company) validateDefaultAddress(formats strfmt.Registry) error {
if swag.IsZero(m.DefaultAddress) { // not required
return nil
}
if m.DefaultAddress != nil {
if err := m.DefaultAddress.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("DefaultAddress")
}
return err
}
}
return nil
}
// ContextValidate validate this company based on the context it is used
func (m *Company) 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.contextValidateDefaultAddress(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *Company) 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")
}
return err
}
}
return nil
}
func (m *Company) contextValidateDefaultAddress(ctx context.Context, formats strfmt.Registry) error {
if m.DefaultAddress != nil {
if err := m.DefaultAddress.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("DefaultAddress")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *Company) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Company) UnmarshalBinary(b []byte) error {
var res Company
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -1,116 +0,0 @@
// 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"
)
// CompanyRequest An array of Company objects
//
// swagger:model CompanyRequest
type CompanyRequest struct {
// data
Data []*Company `json:"Data"`
}
// Validate validates this company request
func (m *CompanyRequest) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateData(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *CompanyRequest) validateData(formats strfmt.Registry) error {
if swag.IsZero(m.Data) { // not required
return nil
}
for i := 0; i < len(m.Data); i++ {
if swag.IsZero(m.Data[i]) { // not required
continue
}
if m.Data[i] != nil {
if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this company request based on the context it is used
func (m *CompanyRequest) 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 *CompanyRequest) 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))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *CompanyRequest) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *CompanyRequest) UnmarshalBinary(b []byte) error {
var res CompanyRequest
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,215 @@
// 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 accounts
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
)
// New creates a new accounts API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
return &Client{transport: transport, formats: formats}
}
/*
Client for accounts API
*/
type Client struct {
transport runtime.ClientTransport
formats strfmt.Registry
}
// ClientOption is the option for Client methods
type ClientOption func(*runtime.ClientOperation)
// ClientService is the interface for Client methods
type ClientService interface {
DeleteAccount(params *DeleteAccountParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAccountOK, error)
GetAccounts(params *GetAccountsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAccountsOK, error)
PostAccounts(params *PostAccountsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAccountsOK, error)
PutAccount(params *PutAccountParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutAccountOK, error)
SetTransport(transport runtime.ClientTransport)
}
/*
DeleteAccount deletes an account
Delete Taxnexus Account record
*/
func (a *Client) DeleteAccount(params *DeleteAccountParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAccountOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewDeleteAccountParams()
}
op := &runtime.ClientOperation{
ID: "deleteAccount",
Method: "DELETE",
PathPattern: "/accounts",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &DeleteAccountReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*DeleteAccountOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for deleteAccount: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
GetAccounts gets a list of accounts
Return a list of all available Accounts
*/
func (a *Client) GetAccounts(params *GetAccountsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAccountsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetAccountsParams()
}
op := &runtime.ClientOperation{
ID: "getAccounts",
Method: "GET",
PathPattern: "/accounts",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &GetAccountsReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*GetAccountsOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for getAccounts: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
PostAccounts adds a new account to taxnexus
Account record to be added
*/
func (a *Client) PostAccounts(params *PostAccountsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAccountsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPostAccountsParams()
}
op := &runtime.ClientOperation{
ID: "postAccounts",
Method: "POST",
PathPattern: "/accounts",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PostAccountsReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*PostAccountsOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for postAccounts: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
PutAccount updates a single account
Update a single account specified by accountId
*/
func (a *Client) PutAccount(params *PutAccountParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutAccountOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPutAccountParams()
}
op := &runtime.ClientOperation{
ID: "putAccount",
Method: "PUT",
PathPattern: "/accounts",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PutAccountReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*PutAccountOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for putAccount: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
// SetTransport changes the transport on the client
func (a *Client) SetTransport(transport runtime.ClientTransport) {
a.transport = transport
}

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 accounts
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
)
// NewDeleteAccountParams creates a new DeleteAccountParams object,
// with the default 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 NewDeleteAccountParams() *DeleteAccountParams {
return &DeleteAccountParams{
timeout: cr.DefaultTimeout,
}
}
// NewDeleteAccountParamsWithTimeout creates a new DeleteAccountParams object
// with the ability to set a timeout on a request.
func NewDeleteAccountParamsWithTimeout(timeout time.Duration) *DeleteAccountParams {
return &DeleteAccountParams{
timeout: timeout,
}
}
// NewDeleteAccountParamsWithContext creates a new DeleteAccountParams object
// with the ability to set a context for a request.
func NewDeleteAccountParamsWithContext(ctx context.Context) *DeleteAccountParams {
return &DeleteAccountParams{
Context: ctx,
}
}
// NewDeleteAccountParamsWithHTTPClient creates a new DeleteAccountParams object
// with the ability to set a custom HTTPClient for a request.
func NewDeleteAccountParamsWithHTTPClient(client *http.Client) *DeleteAccountParams {
return &DeleteAccountParams{
HTTPClient: client,
}
}
/* DeleteAccountParams contains all the parameters to send to the API endpoint
for the delete account operation.
Typically these are written to a http.Request.
*/
type DeleteAccountParams struct {
/* AccountID.
Taxnexus Record Id of an Account
*/
AccountID *string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the delete account params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *DeleteAccountParams) WithDefaults() *DeleteAccountParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the delete account params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *DeleteAccountParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the delete account params
func (o *DeleteAccountParams) WithTimeout(timeout time.Duration) *DeleteAccountParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the delete account params
func (o *DeleteAccountParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the delete account params
func (o *DeleteAccountParams) WithContext(ctx context.Context) *DeleteAccountParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the delete account params
func (o *DeleteAccountParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the delete account params
func (o *DeleteAccountParams) WithHTTPClient(client *http.Client) *DeleteAccountParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the delete account params
func (o *DeleteAccountParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithAccountID adds the accountID to the delete account params
func (o *DeleteAccountParams) WithAccountID(accountID *string) *DeleteAccountParams {
o.SetAccountID(accountID)
return o
}
// SetAccountID adds the accountId to the delete account params
func (o *DeleteAccountParams) SetAccountID(accountID *string) {
o.AccountID = accountID
}
// WriteToRequest writes these params to a swagger request
func (o *DeleteAccountParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.AccountID != nil {
// query param accountId
var qrAccountID string
if o.AccountID != nil {
qrAccountID = *o.AccountID
}
qAccountID := qrAccountID
if qAccountID != "" {
if err := r.SetQueryParam("accountId", qAccountID); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

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 accounts
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"code.tnxs.net/vernonkeenan/lib/api/research/research_models"
)
// DeleteAccountReader is a Reader for the DeleteAccount structure.
type DeleteAccountReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *DeleteAccountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewDeleteAccountOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewDeleteAccountUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewDeleteAccountForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewDeleteAccountNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewDeleteAccountUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewDeleteAccountInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
}
}
// NewDeleteAccountOK creates a DeleteAccountOK with default headers values
func NewDeleteAccountOK() *DeleteAccountOK {
return &DeleteAccountOK{}
}
/* DeleteAccountOK describes a response with status code 200, with default header values.
Taxnexus Response with Message Objects with Delete Status
*/
type DeleteAccountOK struct {
AccessControlAllowOrigin string
Payload *research_models.DeleteResponse
}
func (o *DeleteAccountOK) Error() string {
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountOK %+v", 200, o.Payload)
}
func (o *DeleteAccountOK) GetPayload() *research_models.DeleteResponse {
return o.Payload
}
func (o *DeleteAccountOK) 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.DeleteResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewDeleteAccountUnauthorized creates a DeleteAccountUnauthorized with default headers values
func NewDeleteAccountUnauthorized() *DeleteAccountUnauthorized {
return &DeleteAccountUnauthorized{}
}
/* DeleteAccountUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type DeleteAccountUnauthorized struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *DeleteAccountUnauthorized) Error() string {
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountUnauthorized %+v", 401, o.Payload)
}
func (o *DeleteAccountUnauthorized) GetPayload() *research_models.Error {
return o.Payload
}
func (o *DeleteAccountUnauthorized) 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
}
// NewDeleteAccountForbidden creates a DeleteAccountForbidden with default headers values
func NewDeleteAccountForbidden() *DeleteAccountForbidden {
return &DeleteAccountForbidden{}
}
/* DeleteAccountForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type DeleteAccountForbidden struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *DeleteAccountForbidden) Error() string {
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountForbidden %+v", 403, o.Payload)
}
func (o *DeleteAccountForbidden) GetPayload() *research_models.Error {
return o.Payload
}
func (o *DeleteAccountForbidden) 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
}
// NewDeleteAccountNotFound creates a DeleteAccountNotFound with default headers values
func NewDeleteAccountNotFound() *DeleteAccountNotFound {
return &DeleteAccountNotFound{}
}
/* DeleteAccountNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type DeleteAccountNotFound struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *DeleteAccountNotFound) Error() string {
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountNotFound %+v", 404, o.Payload)
}
func (o *DeleteAccountNotFound) GetPayload() *research_models.Error {
return o.Payload
}
func (o *DeleteAccountNotFound) 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
}
// NewDeleteAccountUnprocessableEntity creates a DeleteAccountUnprocessableEntity with default headers values
func NewDeleteAccountUnprocessableEntity() *DeleteAccountUnprocessableEntity {
return &DeleteAccountUnprocessableEntity{}
}
/* DeleteAccountUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type DeleteAccountUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *DeleteAccountUnprocessableEntity) Error() string {
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountUnprocessableEntity %+v", 422, o.Payload)
}
func (o *DeleteAccountUnprocessableEntity) GetPayload() *research_models.Error {
return o.Payload
}
func (o *DeleteAccountUnprocessableEntity) 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
}
// NewDeleteAccountInternalServerError creates a DeleteAccountInternalServerError with default headers values
func NewDeleteAccountInternalServerError() *DeleteAccountInternalServerError {
return &DeleteAccountInternalServerError{}
}
/* DeleteAccountInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type DeleteAccountInternalServerError struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *DeleteAccountInternalServerError) Error() string {
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountInternalServerError %+v", 500, o.Payload)
}
func (o *DeleteAccountInternalServerError) GetPayload() *research_models.Error {
return o.Payload
}
func (o *DeleteAccountInternalServerError) 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,340 @@
// 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 accounts
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// NewGetAccountsParams creates a new GetAccountsParams object,
// with the default 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 NewGetAccountsParams() *GetAccountsParams {
return &GetAccountsParams{
timeout: cr.DefaultTimeout,
}
}
// NewGetAccountsParamsWithTimeout creates a new GetAccountsParams object
// with the ability to set a timeout on a request.
func NewGetAccountsParamsWithTimeout(timeout time.Duration) *GetAccountsParams {
return &GetAccountsParams{
timeout: timeout,
}
}
// NewGetAccountsParamsWithContext creates a new GetAccountsParams object
// with the ability to set a context for a request.
func NewGetAccountsParamsWithContext(ctx context.Context) *GetAccountsParams {
return &GetAccountsParams{
Context: ctx,
}
}
// NewGetAccountsParamsWithHTTPClient creates a new GetAccountsParams object
// with the ability to set a custom HTTPClient for a request.
func NewGetAccountsParamsWithHTTPClient(client *http.Client) *GetAccountsParams {
return &GetAccountsParams{
HTTPClient: client,
}
}
/* GetAccountsParams contains all the parameters to send to the API endpoint
for the get accounts operation.
Typically these are written to a http.Request.
*/
type GetAccountsParams struct {
/* AccountID.
Taxnexus Record Id of an Account
*/
AccountID *string
/* Active.
Only retrieve active records?
*/
Active *bool
/* Email.
Email address used for identity lookup
*/
Email *string
/* Limit.
How many objects to return at one time
Format: int64
*/
Limit *int64
/* Name.
The Name of this Object
*/
Name *string
/* 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 accounts params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetAccountsParams) WithDefaults() *GetAccountsParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the get accounts params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetAccountsParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the get accounts params
func (o *GetAccountsParams) WithTimeout(timeout time.Duration) *GetAccountsParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the get accounts params
func (o *GetAccountsParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the get accounts params
func (o *GetAccountsParams) WithContext(ctx context.Context) *GetAccountsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get accounts params
func (o *GetAccountsParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the get accounts params
func (o *GetAccountsParams) WithHTTPClient(client *http.Client) *GetAccountsParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the get accounts params
func (o *GetAccountsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithAccountID adds the accountID to the get accounts params
func (o *GetAccountsParams) WithAccountID(accountID *string) *GetAccountsParams {
o.SetAccountID(accountID)
return o
}
// SetAccountID adds the accountId to the get accounts params
func (o *GetAccountsParams) SetAccountID(accountID *string) {
o.AccountID = accountID
}
// WithActive adds the active to the get accounts params
func (o *GetAccountsParams) WithActive(active *bool) *GetAccountsParams {
o.SetActive(active)
return o
}
// SetActive adds the active to the get accounts params
func (o *GetAccountsParams) SetActive(active *bool) {
o.Active = active
}
// WithEmail adds the email to the get accounts params
func (o *GetAccountsParams) WithEmail(email *string) *GetAccountsParams {
o.SetEmail(email)
return o
}
// SetEmail adds the email to the get accounts params
func (o *GetAccountsParams) SetEmail(email *string) {
o.Email = email
}
// WithLimit adds the limit to the get accounts params
func (o *GetAccountsParams) WithLimit(limit *int64) *GetAccountsParams {
o.SetLimit(limit)
return o
}
// SetLimit adds the limit to the get accounts params
func (o *GetAccountsParams) SetLimit(limit *int64) {
o.Limit = limit
}
// WithName adds the name to the get accounts params
func (o *GetAccountsParams) WithName(name *string) *GetAccountsParams {
o.SetName(name)
return o
}
// SetName adds the name to the get accounts params
func (o *GetAccountsParams) SetName(name *string) {
o.Name = name
}
// WithOffset adds the offset to the get accounts params
func (o *GetAccountsParams) WithOffset(offset *int64) *GetAccountsParams {
o.SetOffset(offset)
return o
}
// SetOffset adds the offset to the get accounts params
func (o *GetAccountsParams) SetOffset(offset *int64) {
o.Offset = offset
}
// WriteToRequest writes these params to a swagger request
func (o *GetAccountsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.AccountID != nil {
// query param accountId
var qrAccountID string
if o.AccountID != nil {
qrAccountID = *o.AccountID
}
qAccountID := qrAccountID
if qAccountID != "" {
if err := r.SetQueryParam("accountId", qAccountID); err != nil {
return err
}
}
}
if o.Active != nil {
// query param active
var qrActive bool
if o.Active != nil {
qrActive = *o.Active
}
qActive := swag.FormatBool(qrActive)
if qActive != "" {
if err := r.SetQueryParam("active", qActive); err != nil {
return err
}
}
}
if o.Email != nil {
// query param email
var qrEmail string
if o.Email != nil {
qrEmail = *o.Email
}
qEmail := qrEmail
if qEmail != "" {
if err := r.SetQueryParam("email", qEmail); err != nil {
return err
}
}
}
if o.Limit != nil {
// query param limit
var qrLimit int64
if o.Limit != nil {
qrLimit = *o.Limit
}
qLimit := swag.FormatInt64(qrLimit)
if qLimit != "" {
if err := r.SetQueryParam("limit", qLimit); err != nil {
return err
}
}
}
if o.Name != nil {
// query param name
var qrName string
if o.Name != nil {
qrName = *o.Name
}
qName := qrName
if qName != "" {
if err := r.SetQueryParam("name", qName); err != nil {
return err
}
}
}
if o.Offset != nil {
// query param offset
var qrOffset int64
if o.Offset != nil {
qrOffset = *o.Offset
}
qOffset := swag.FormatInt64(qrOffset)
if qOffset != "" {
if err := r.SetQueryParam("offset", qOffset); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

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 accounts
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"code.tnxs.net/vernonkeenan/lib/api/research/research_models"
)
// GetAccountsReader is a Reader for the GetAccounts structure.
type GetAccountsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetAccountsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetAccountsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewGetAccountsUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewGetAccountsForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewGetAccountsNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewGetAccountsUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewGetAccountsInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
}
}
// NewGetAccountsOK creates a GetAccountsOK with default headers values
func NewGetAccountsOK() *GetAccountsOK {
return &GetAccountsOK{}
}
/* GetAccountsOK describes a response with status code 200, with default header values.
Taxnexus Response with Account objects with Contacts
*/
type GetAccountsOK struct {
AccessControlAllowOrigin string
CacheControl string
Payload *research_models.AccountResponse
}
func (o *GetAccountsOK) Error() string {
return fmt.Sprintf("[GET /accounts][%d] getAccountsOK %+v", 200, o.Payload)
}
func (o *GetAccountsOK) GetPayload() *research_models.AccountResponse {
return o.Payload
}
func (o *GetAccountsOK) 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.AccountResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetAccountsUnauthorized creates a GetAccountsUnauthorized with default headers values
func NewGetAccountsUnauthorized() *GetAccountsUnauthorized {
return &GetAccountsUnauthorized{}
}
/* GetAccountsUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type GetAccountsUnauthorized struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *GetAccountsUnauthorized) Error() string {
return fmt.Sprintf("[GET /accounts][%d] getAccountsUnauthorized %+v", 401, o.Payload)
}
func (o *GetAccountsUnauthorized) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetAccountsUnauthorized) 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
}
// NewGetAccountsForbidden creates a GetAccountsForbidden with default headers values
func NewGetAccountsForbidden() *GetAccountsForbidden {
return &GetAccountsForbidden{}
}
/* GetAccountsForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type GetAccountsForbidden struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *GetAccountsForbidden) Error() string {
return fmt.Sprintf("[GET /accounts][%d] getAccountsForbidden %+v", 403, o.Payload)
}
func (o *GetAccountsForbidden) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetAccountsForbidden) 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
}
// NewGetAccountsNotFound creates a GetAccountsNotFound with default headers values
func NewGetAccountsNotFound() *GetAccountsNotFound {
return &GetAccountsNotFound{}
}
/* GetAccountsNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type GetAccountsNotFound struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *GetAccountsNotFound) Error() string {
return fmt.Sprintf("[GET /accounts][%d] getAccountsNotFound %+v", 404, o.Payload)
}
func (o *GetAccountsNotFound) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetAccountsNotFound) 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
}
// NewGetAccountsUnprocessableEntity creates a GetAccountsUnprocessableEntity with default headers values
func NewGetAccountsUnprocessableEntity() *GetAccountsUnprocessableEntity {
return &GetAccountsUnprocessableEntity{}
}
/* GetAccountsUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type GetAccountsUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *GetAccountsUnprocessableEntity) Error() string {
return fmt.Sprintf("[GET /accounts][%d] getAccountsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetAccountsUnprocessableEntity) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetAccountsUnprocessableEntity) 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
}
// NewGetAccountsInternalServerError creates a GetAccountsInternalServerError with default headers values
func NewGetAccountsInternalServerError() *GetAccountsInternalServerError {
return &GetAccountsInternalServerError{}
}
/* GetAccountsInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type GetAccountsInternalServerError struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *GetAccountsInternalServerError) Error() string {
return fmt.Sprintf("[GET /accounts][%d] getAccountsInternalServerError %+v", 500, o.Payload)
}
func (o *GetAccountsInternalServerError) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetAccountsInternalServerError) 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 accounts
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
"code.tnxs.net/vernonkeenan/lib/api/research/research_models"
)
// NewPostAccountsParams creates a new PostAccountsParams 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 NewPostAccountsParams() *PostAccountsParams {
return &PostAccountsParams{
timeout: cr.DefaultTimeout,
}
}
// NewPostAccountsParamsWithTimeout creates a new PostAccountsParams object
// with the ability to set a timeout on a request.
func NewPostAccountsParamsWithTimeout(timeout time.Duration) *PostAccountsParams {
return &PostAccountsParams{
timeout: timeout,
}
}
// NewPostAccountsParamsWithContext creates a new PostAccountsParams object
// with the ability to set a context for a request.
func NewPostAccountsParamsWithContext(ctx context.Context) *PostAccountsParams {
return &PostAccountsParams{
Context: ctx,
}
}
// NewPostAccountsParamsWithHTTPClient creates a new PostAccountsParams object
// with the ability to set a custom HTTPClient for a request.
func NewPostAccountsParamsWithHTTPClient(client *http.Client) *PostAccountsParams {
return &PostAccountsParams{
HTTPClient: client,
}
}
/* PostAccountsParams contains all the parameters to send to the API endpoint
for the post accounts operation.
Typically these are written to a http.Request.
*/
type PostAccountsParams struct {
/* AccountRequest.
A request with an array of Account Objects
*/
AccountRequest *research_models.AccountRequest
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the post accounts params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostAccountsParams) WithDefaults() *PostAccountsParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the post accounts params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostAccountsParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the post accounts params
func (o *PostAccountsParams) WithTimeout(timeout time.Duration) *PostAccountsParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the post accounts params
func (o *PostAccountsParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the post accounts params
func (o *PostAccountsParams) WithContext(ctx context.Context) *PostAccountsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the post accounts params
func (o *PostAccountsParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the post accounts params
func (o *PostAccountsParams) WithHTTPClient(client *http.Client) *PostAccountsParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the post accounts params
func (o *PostAccountsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithAccountRequest adds the accountRequest to the post accounts params
func (o *PostAccountsParams) WithAccountRequest(accountRequest *research_models.AccountRequest) *PostAccountsParams {
o.SetAccountRequest(accountRequest)
return o
}
// SetAccountRequest adds the accountRequest to the post accounts params
func (o *PostAccountsParams) SetAccountRequest(accountRequest *research_models.AccountRequest) {
o.AccountRequest = accountRequest
}
// WriteToRequest writes these params to a swagger request
func (o *PostAccountsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.AccountRequest != nil {
if err := r.SetBodyParam(o.AccountRequest); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -4,7 +4,7 @@
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package companies
package accounts
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
@ -16,49 +16,49 @@ import (
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
"code.tnxs.net/vernonkeenan/lib/api/research/research_models"
)
// GetCompaniesReader is a Reader for the GetCompanies structure.
type GetCompaniesReader struct {
// PostAccountsReader is a Reader for the PostAccounts structure.
type PostAccountsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetCompaniesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
func (o *PostAccountsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetCompaniesOK()
result := NewPostAccountsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewGetCompaniesUnauthorized()
result := NewPostAccountsUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewGetCompaniesForbidden()
result := NewPostAccountsForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewGetCompaniesNotFound()
result := NewPostAccountsNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewGetCompaniesUnprocessableEntity()
result := NewPostAccountsUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewGetCompaniesInternalServerError()
result := NewPostAccountsInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
@ -68,30 +68,30 @@ func (o *GetCompaniesReader) ReadResponse(response runtime.ClientResponse, consu
}
}
// NewGetCompaniesOK creates a GetCompaniesOK with default headers values
func NewGetCompaniesOK() *GetCompaniesOK {
return &GetCompaniesOK{}
// NewPostAccountsOK creates a PostAccountsOK with default headers values
func NewPostAccountsOK() *PostAccountsOK {
return &PostAccountsOK{}
}
/* GetCompaniesOK describes a response with status code 200, with default header values.
/* PostAccountsOK describes a response with status code 200, with default header values.
Taxnexus Response with Company objects
Taxnexus Response with Account objects with Contacts
*/
type GetCompaniesOK struct {
type PostAccountsOK struct {
AccessControlAllowOrigin string
CacheControl string
Payload *crm_models.CompanyResponse
Payload *research_models.AccountResponse
}
func (o *GetCompaniesOK) Error() string {
return fmt.Sprintf("[GET /companies][%d] getCompaniesOK %+v", 200, o.Payload)
func (o *PostAccountsOK) Error() string {
return fmt.Sprintf("[POST /accounts][%d] postAccountsOK %+v", 200, o.Payload)
}
func (o *GetCompaniesOK) GetPayload() *crm_models.CompanyResponse {
func (o *PostAccountsOK) GetPayload() *research_models.AccountResponse {
return o.Payload
}
func (o *GetCompaniesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
func (o *PostAccountsOK) 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")
@ -107,7 +107,7 @@ func (o *GetCompaniesOK) readResponse(response runtime.ClientResponse, consumer
o.CacheControl = hdrCacheControl
}
o.Payload = new(crm_models.CompanyResponse)
o.Payload = new(research_models.AccountResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
@ -117,29 +117,29 @@ func (o *GetCompaniesOK) readResponse(response runtime.ClientResponse, consumer
return nil
}
// NewGetCompaniesUnauthorized creates a GetCompaniesUnauthorized with default headers values
func NewGetCompaniesUnauthorized() *GetCompaniesUnauthorized {
return &GetCompaniesUnauthorized{}
// NewPostAccountsUnauthorized creates a PostAccountsUnauthorized with default headers values
func NewPostAccountsUnauthorized() *PostAccountsUnauthorized {
return &PostAccountsUnauthorized{}
}
/* GetCompaniesUnauthorized describes a response with status code 401, with default header values.
/* PostAccountsUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type GetCompaniesUnauthorized struct {
type PostAccountsUnauthorized struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
Payload *research_models.Error
}
func (o *GetCompaniesUnauthorized) Error() string {
return fmt.Sprintf("[GET /companies][%d] getCompaniesUnauthorized %+v", 401, o.Payload)
func (o *PostAccountsUnauthorized) Error() string {
return fmt.Sprintf("[POST /accounts][%d] postAccountsUnauthorized %+v", 401, o.Payload)
}
func (o *GetCompaniesUnauthorized) GetPayload() *crm_models.Error {
func (o *PostAccountsUnauthorized) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetCompaniesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
func (o *PostAccountsUnauthorized) 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")
@ -148,7 +148,7 @@ func (o *GetCompaniesUnauthorized) readResponse(response runtime.ClientResponse,
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(crm_models.Error)
o.Payload = new(research_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
@ -158,29 +158,29 @@ func (o *GetCompaniesUnauthorized) readResponse(response runtime.ClientResponse,
return nil
}
// NewGetCompaniesForbidden creates a GetCompaniesForbidden with default headers values
func NewGetCompaniesForbidden() *GetCompaniesForbidden {
return &GetCompaniesForbidden{}
// NewPostAccountsForbidden creates a PostAccountsForbidden with default headers values
func NewPostAccountsForbidden() *PostAccountsForbidden {
return &PostAccountsForbidden{}
}
/* GetCompaniesForbidden describes a response with status code 403, with default header values.
/* PostAccountsForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type GetCompaniesForbidden struct {
type PostAccountsForbidden struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
Payload *research_models.Error
}
func (o *GetCompaniesForbidden) Error() string {
return fmt.Sprintf("[GET /companies][%d] getCompaniesForbidden %+v", 403, o.Payload)
func (o *PostAccountsForbidden) Error() string {
return fmt.Sprintf("[POST /accounts][%d] postAccountsForbidden %+v", 403, o.Payload)
}
func (o *GetCompaniesForbidden) GetPayload() *crm_models.Error {
func (o *PostAccountsForbidden) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetCompaniesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
func (o *PostAccountsForbidden) 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")
@ -189,7 +189,7 @@ func (o *GetCompaniesForbidden) readResponse(response runtime.ClientResponse, co
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(crm_models.Error)
o.Payload = new(research_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
@ -199,29 +199,29 @@ func (o *GetCompaniesForbidden) readResponse(response runtime.ClientResponse, co
return nil
}
// NewGetCompaniesNotFound creates a GetCompaniesNotFound with default headers values
func NewGetCompaniesNotFound() *GetCompaniesNotFound {
return &GetCompaniesNotFound{}
// NewPostAccountsNotFound creates a PostAccountsNotFound with default headers values
func NewPostAccountsNotFound() *PostAccountsNotFound {
return &PostAccountsNotFound{}
}
/* GetCompaniesNotFound describes a response with status code 404, with default header values.
/* PostAccountsNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type GetCompaniesNotFound struct {
type PostAccountsNotFound struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
Payload *research_models.Error
}
func (o *GetCompaniesNotFound) Error() string {
return fmt.Sprintf("[GET /companies][%d] getCompaniesNotFound %+v", 404, o.Payload)
func (o *PostAccountsNotFound) Error() string {
return fmt.Sprintf("[POST /accounts][%d] postAccountsNotFound %+v", 404, o.Payload)
}
func (o *GetCompaniesNotFound) GetPayload() *crm_models.Error {
func (o *PostAccountsNotFound) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetCompaniesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
func (o *PostAccountsNotFound) 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")
@ -230,7 +230,7 @@ func (o *GetCompaniesNotFound) readResponse(response runtime.ClientResponse, con
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(crm_models.Error)
o.Payload = new(research_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
@ -240,29 +240,29 @@ func (o *GetCompaniesNotFound) readResponse(response runtime.ClientResponse, con
return nil
}
// NewGetCompaniesUnprocessableEntity creates a GetCompaniesUnprocessableEntity with default headers values
func NewGetCompaniesUnprocessableEntity() *GetCompaniesUnprocessableEntity {
return &GetCompaniesUnprocessableEntity{}
// NewPostAccountsUnprocessableEntity creates a PostAccountsUnprocessableEntity with default headers values
func NewPostAccountsUnprocessableEntity() *PostAccountsUnprocessableEntity {
return &PostAccountsUnprocessableEntity{}
}
/* GetCompaniesUnprocessableEntity describes a response with status code 422, with default header values.
/* PostAccountsUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type GetCompaniesUnprocessableEntity struct {
type PostAccountsUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
Payload *research_models.Error
}
func (o *GetCompaniesUnprocessableEntity) Error() string {
return fmt.Sprintf("[GET /companies][%d] getCompaniesUnprocessableEntity %+v", 422, o.Payload)
func (o *PostAccountsUnprocessableEntity) Error() string {
return fmt.Sprintf("[POST /accounts][%d] postAccountsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetCompaniesUnprocessableEntity) GetPayload() *crm_models.Error {
func (o *PostAccountsUnprocessableEntity) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetCompaniesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
func (o *PostAccountsUnprocessableEntity) 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")
@ -271,7 +271,7 @@ func (o *GetCompaniesUnprocessableEntity) readResponse(response runtime.ClientRe
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(crm_models.Error)
o.Payload = new(research_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
@ -281,29 +281,29 @@ func (o *GetCompaniesUnprocessableEntity) readResponse(response runtime.ClientRe
return nil
}
// NewGetCompaniesInternalServerError creates a GetCompaniesInternalServerError with default headers values
func NewGetCompaniesInternalServerError() *GetCompaniesInternalServerError {
return &GetCompaniesInternalServerError{}
// NewPostAccountsInternalServerError creates a PostAccountsInternalServerError with default headers values
func NewPostAccountsInternalServerError() *PostAccountsInternalServerError {
return &PostAccountsInternalServerError{}
}
/* GetCompaniesInternalServerError describes a response with status code 500, with default header values.
/* PostAccountsInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type GetCompaniesInternalServerError struct {
type PostAccountsInternalServerError struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
Payload *research_models.Error
}
func (o *GetCompaniesInternalServerError) Error() string {
return fmt.Sprintf("[GET /companies][%d] getCompaniesInternalServerError %+v", 500, o.Payload)
func (o *PostAccountsInternalServerError) Error() string {
return fmt.Sprintf("[POST /accounts][%d] postAccountsInternalServerError %+v", 500, o.Payload)
}
func (o *GetCompaniesInternalServerError) GetPayload() *crm_models.Error {
func (o *PostAccountsInternalServerError) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetCompaniesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
func (o *PostAccountsInternalServerError) 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")
@ -312,7 +312,7 @@ func (o *GetCompaniesInternalServerError) readResponse(response runtime.ClientRe
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(crm_models.Error)
o.Payload = new(research_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {

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 accounts
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
"code.tnxs.net/vernonkeenan/lib/api/research/research_models"
)
// NewPutAccountParams creates a new PutAccountParams 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 NewPutAccountParams() *PutAccountParams {
return &PutAccountParams{
timeout: cr.DefaultTimeout,
}
}
// NewPutAccountParamsWithTimeout creates a new PutAccountParams object
// with the ability to set a timeout on a request.
func NewPutAccountParamsWithTimeout(timeout time.Duration) *PutAccountParams {
return &PutAccountParams{
timeout: timeout,
}
}
// NewPutAccountParamsWithContext creates a new PutAccountParams object
// with the ability to set a context for a request.
func NewPutAccountParamsWithContext(ctx context.Context) *PutAccountParams {
return &PutAccountParams{
Context: ctx,
}
}
// NewPutAccountParamsWithHTTPClient creates a new PutAccountParams object
// with the ability to set a custom HTTPClient for a request.
func NewPutAccountParamsWithHTTPClient(client *http.Client) *PutAccountParams {
return &PutAccountParams{
HTTPClient: client,
}
}
/* PutAccountParams contains all the parameters to send to the API endpoint
for the put account operation.
Typically these are written to a http.Request.
*/
type PutAccountParams struct {
/* AccountRequest.
A request with an array of Account Objects
*/
AccountRequest *research_models.AccountRequest
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the put account params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PutAccountParams) WithDefaults() *PutAccountParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the put account params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PutAccountParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the put account params
func (o *PutAccountParams) WithTimeout(timeout time.Duration) *PutAccountParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the put account params
func (o *PutAccountParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the put account params
func (o *PutAccountParams) WithContext(ctx context.Context) *PutAccountParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the put account params
func (o *PutAccountParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the put account params
func (o *PutAccountParams) WithHTTPClient(client *http.Client) *PutAccountParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the put account params
func (o *PutAccountParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithAccountRequest adds the accountRequest to the put account params
func (o *PutAccountParams) WithAccountRequest(accountRequest *research_models.AccountRequest) *PutAccountParams {
o.SetAccountRequest(accountRequest)
return o
}
// SetAccountRequest adds the accountRequest to the put account params
func (o *PutAccountParams) SetAccountRequest(accountRequest *research_models.AccountRequest) {
o.AccountRequest = accountRequest
}
// WriteToRequest writes these params to a swagger request
func (o *PutAccountParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.AccountRequest != nil {
if err := r.SetBodyParam(o.AccountRequest); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

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 accounts
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"code.tnxs.net/vernonkeenan/lib/api/research/research_models"
)
// PutAccountReader is a Reader for the PutAccount structure.
type PutAccountReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PutAccountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewPutAccountOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewPutAccountUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewPutAccountForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewPutAccountNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewPutAccountUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewPutAccountInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
}
}
// NewPutAccountOK creates a PutAccountOK with default headers values
func NewPutAccountOK() *PutAccountOK {
return &PutAccountOK{}
}
/* PutAccountOK describes a response with status code 200, with default header values.
Taxnexus Response with Account objects with Contacts
*/
type PutAccountOK struct {
AccessControlAllowOrigin string
CacheControl string
Payload *research_models.AccountResponse
}
func (o *PutAccountOK) Error() string {
return fmt.Sprintf("[PUT /accounts][%d] putAccountOK %+v", 200, o.Payload)
}
func (o *PutAccountOK) GetPayload() *research_models.AccountResponse {
return o.Payload
}
func (o *PutAccountOK) 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.AccountResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPutAccountUnauthorized creates a PutAccountUnauthorized with default headers values
func NewPutAccountUnauthorized() *PutAccountUnauthorized {
return &PutAccountUnauthorized{}
}
/* PutAccountUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type PutAccountUnauthorized struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *PutAccountUnauthorized) Error() string {
return fmt.Sprintf("[PUT /accounts][%d] putAccountUnauthorized %+v", 401, o.Payload)
}
func (o *PutAccountUnauthorized) GetPayload() *research_models.Error {
return o.Payload
}
func (o *PutAccountUnauthorized) 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
}
// NewPutAccountForbidden creates a PutAccountForbidden with default headers values
func NewPutAccountForbidden() *PutAccountForbidden {
return &PutAccountForbidden{}
}
/* PutAccountForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type PutAccountForbidden struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *PutAccountForbidden) Error() string {
return fmt.Sprintf("[PUT /accounts][%d] putAccountForbidden %+v", 403, o.Payload)
}
func (o *PutAccountForbidden) GetPayload() *research_models.Error {
return o.Payload
}
func (o *PutAccountForbidden) 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
}
// NewPutAccountNotFound creates a PutAccountNotFound with default headers values
func NewPutAccountNotFound() *PutAccountNotFound {
return &PutAccountNotFound{}
}
/* PutAccountNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type PutAccountNotFound struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *PutAccountNotFound) Error() string {
return fmt.Sprintf("[PUT /accounts][%d] putAccountNotFound %+v", 404, o.Payload)
}
func (o *PutAccountNotFound) GetPayload() *research_models.Error {
return o.Payload
}
func (o *PutAccountNotFound) 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
}
// NewPutAccountUnprocessableEntity creates a PutAccountUnprocessableEntity with default headers values
func NewPutAccountUnprocessableEntity() *PutAccountUnprocessableEntity {
return &PutAccountUnprocessableEntity{}
}
/* PutAccountUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type PutAccountUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *PutAccountUnprocessableEntity) Error() string {
return fmt.Sprintf("[PUT /accounts][%d] putAccountUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PutAccountUnprocessableEntity) GetPayload() *research_models.Error {
return o.Payload
}
func (o *PutAccountUnprocessableEntity) 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
}
// NewPutAccountInternalServerError creates a PutAccountInternalServerError with default headers values
func NewPutAccountInternalServerError() *PutAccountInternalServerError {
return &PutAccountInternalServerError{}
}
/* PutAccountInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type PutAccountInternalServerError struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *PutAccountInternalServerError) Error() string {
return fmt.Sprintf("[PUT /accounts][%d] putAccountInternalServerError %+v", 500, o.Payload)
}
func (o *PutAccountInternalServerError) GetPayload() *research_models.Error {
return o.Payload
}
func (o *PutAccountInternalServerError) 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,172 @@
// 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 clusters
// 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 clusters API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
return &Client{transport: transport, formats: formats}
}
/*
Client for clusters 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 {
GetClusters(params *GetClustersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetClustersOK, error)
PostClusters(params *PostClustersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostClustersOK, error)
PutClusters(params *PutClustersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutClustersOK, error)
SetTransport(transport runtime.ClientTransport)
}
/*
GetClusters gets a list clusters
Return a list of Cluster records from the datastore
*/
func (a *Client) GetClusters(params *GetClustersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetClustersOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetClustersParams()
}
op := &runtime.ClientOperation{
ID: "getClusters",
Method: "GET",
PathPattern: "/clusters",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &GetClustersReader{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.(*GetClustersOK)
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 getClusters: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
PostClusters creates new clusters
Create Clusters in Taxnexus
*/
func (a *Client) PostClusters(params *PostClustersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostClustersOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPostClustersParams()
}
op := &runtime.ClientOperation{
ID: "postClusters",
Method: "POST",
PathPattern: "/clusters",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PostClustersReader{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.(*PostClustersOK)
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 postClusters: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
PutClusters updates clusters
Update Cluster in Taxnexus
*/
func (a *Client) PutClusters(params *PutClustersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutClustersOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPutClustersParams()
}
op := &runtime.ClientOperation{
ID: "putClusters",
Method: "PUT",
PathPattern: "/clusters",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PutClustersReader{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.(*PutClustersOK)
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 putClusters: 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,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 clusters
// 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"
)
// NewGetClustersParams creates a new GetClustersParams 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 NewGetClustersParams() *GetClustersParams {
return &GetClustersParams{
timeout: cr.DefaultTimeout,
}
}
// NewGetClustersParamsWithTimeout creates a new GetClustersParams object
// with the ability to set a timeout on a request.
func NewGetClustersParamsWithTimeout(timeout time.Duration) *GetClustersParams {
return &GetClustersParams{
timeout: timeout,
}
}
// NewGetClustersParamsWithContext creates a new GetClustersParams object
// with the ability to set a context for a request.
func NewGetClustersParamsWithContext(ctx context.Context) *GetClustersParams {
return &GetClustersParams{
Context: ctx,
}
}
// NewGetClustersParamsWithHTTPClient creates a new GetClustersParams object
// with the ability to set a custom HTTPClient for a request.
func NewGetClustersParamsWithHTTPClient(client *http.Client) *GetClustersParams {
return &GetClustersParams{
HTTPClient: client,
}
}
/* GetClustersParams contains all the parameters to send to the API endpoint
for the get clusters operation.
Typically these are written to a http.Request.
*/
type GetClustersParams struct {
/* ClusterID.
Taxnexus Record Id of a Cluster
*/
ClusterID *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 clusters params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetClustersParams) WithDefaults() *GetClustersParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the get clusters params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetClustersParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the get clusters params
func (o *GetClustersParams) WithTimeout(timeout time.Duration) *GetClustersParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the get clusters params
func (o *GetClustersParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the get clusters params
func (o *GetClustersParams) WithContext(ctx context.Context) *GetClustersParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get clusters params
func (o *GetClustersParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the get clusters params
func (o *GetClustersParams) WithHTTPClient(client *http.Client) *GetClustersParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the get clusters params
func (o *GetClustersParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithClusterID adds the clusterID to the get clusters params
func (o *GetClustersParams) WithClusterID(clusterID *string) *GetClustersParams {
o.SetClusterID(clusterID)
return o
}
// SetClusterID adds the clusterId to the get clusters params
func (o *GetClustersParams) SetClusterID(clusterID *string) {
o.ClusterID = clusterID
}
// WithLimit adds the limit to the get clusters params
func (o *GetClustersParams) WithLimit(limit *int64) *GetClustersParams {
o.SetLimit(limit)
return o
}
// SetLimit adds the limit to the get clusters params
func (o *GetClustersParams) SetLimit(limit *int64) {
o.Limit = limit
}
// WithOffset adds the offset to the get clusters params
func (o *GetClustersParams) WithOffset(offset *int64) *GetClustersParams {
o.SetOffset(offset)
return o
}
// SetOffset adds the offset to the get clusters params
func (o *GetClustersParams) SetOffset(offset *int64) {
o.Offset = offset
}
// WriteToRequest writes these params to a swagger request
func (o *GetClustersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.ClusterID != nil {
// query param clusterId
var qrClusterID string
if o.ClusterID != nil {
qrClusterID = *o.ClusterID
}
qClusterID := qrClusterID
if qClusterID != "" {
if err := r.SetQueryParam("clusterId", qClusterID); 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,306 @@
// 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 clusters
// 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"
)
// GetClustersReader is a Reader for the GetClusters structure.
type GetClustersReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetClustersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetClustersOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewGetClustersUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewGetClustersForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewGetClustersNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewGetClustersUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewGetClustersInternalServerError()
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())
}
}
// NewGetClustersOK creates a GetClustersOK with default headers values
func NewGetClustersOK() *GetClustersOK {
return &GetClustersOK{}
}
/* GetClustersOK describes a response with status code 200, with default header values.
Taxnexus Response with Cluster objects
*/
type GetClustersOK struct {
Payload *research_models.ClusterResponse
}
func (o *GetClustersOK) Error() string {
return fmt.Sprintf("[GET /clusters][%d] getClustersOK %+v", 200, o.Payload)
}
func (o *GetClustersOK) GetPayload() *research_models.ClusterResponse {
return o.Payload
}
func (o *GetClustersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(research_models.ClusterResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetClustersUnauthorized creates a GetClustersUnauthorized with default headers values
func NewGetClustersUnauthorized() *GetClustersUnauthorized {
return &GetClustersUnauthorized{}
}
/* GetClustersUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type GetClustersUnauthorized struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *GetClustersUnauthorized) Error() string {
return fmt.Sprintf("[GET /clusters][%d] getClustersUnauthorized %+v", 401, o.Payload)
}
func (o *GetClustersUnauthorized) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetClustersUnauthorized) 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
}
// NewGetClustersForbidden creates a GetClustersForbidden with default headers values
func NewGetClustersForbidden() *GetClustersForbidden {
return &GetClustersForbidden{}
}
/* GetClustersForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type GetClustersForbidden struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *GetClustersForbidden) Error() string {
return fmt.Sprintf("[GET /clusters][%d] getClustersForbidden %+v", 403, o.Payload)
}
func (o *GetClustersForbidden) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetClustersForbidden) 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
}
// NewGetClustersNotFound creates a GetClustersNotFound with default headers values
func NewGetClustersNotFound() *GetClustersNotFound {
return &GetClustersNotFound{}
}
/* GetClustersNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type GetClustersNotFound struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *GetClustersNotFound) Error() string {
return fmt.Sprintf("[GET /clusters][%d] getClustersNotFound %+v", 404, o.Payload)
}
func (o *GetClustersNotFound) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetClustersNotFound) 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
}
// NewGetClustersUnprocessableEntity creates a GetClustersUnprocessableEntity with default headers values
func NewGetClustersUnprocessableEntity() *GetClustersUnprocessableEntity {
return &GetClustersUnprocessableEntity{}
}
/* GetClustersUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type GetClustersUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *GetClustersUnprocessableEntity) Error() string {
return fmt.Sprintf("[GET /clusters][%d] getClustersUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetClustersUnprocessableEntity) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetClustersUnprocessableEntity) 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
}
// NewGetClustersInternalServerError creates a GetClustersInternalServerError with default headers values
func NewGetClustersInternalServerError() *GetClustersInternalServerError {
return &GetClustersInternalServerError{}
}
/* GetClustersInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type GetClustersInternalServerError struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *GetClustersInternalServerError) Error() string {
return fmt.Sprintf("[GET /clusters][%d] getClustersInternalServerError %+v", 500, o.Payload)
}
func (o *GetClustersInternalServerError) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetClustersInternalServerError) 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 clusters
// 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"
)
// NewPostClustersParams creates a new PostClustersParams 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 NewPostClustersParams() *PostClustersParams {
return &PostClustersParams{
timeout: cr.DefaultTimeout,
}
}
// NewPostClustersParamsWithTimeout creates a new PostClustersParams object
// with the ability to set a timeout on a request.
func NewPostClustersParamsWithTimeout(timeout time.Duration) *PostClustersParams {
return &PostClustersParams{
timeout: timeout,
}
}
// NewPostClustersParamsWithContext creates a new PostClustersParams object
// with the ability to set a context for a request.
func NewPostClustersParamsWithContext(ctx context.Context) *PostClustersParams {
return &PostClustersParams{
Context: ctx,
}
}
// NewPostClustersParamsWithHTTPClient creates a new PostClustersParams object
// with the ability to set a custom HTTPClient for a request.
func NewPostClustersParamsWithHTTPClient(client *http.Client) *PostClustersParams {
return &PostClustersParams{
HTTPClient: client,
}
}
/* PostClustersParams contains all the parameters to send to the API endpoint
for the post clusters operation.
Typically these are written to a http.Request.
*/
type PostClustersParams struct {
/* ClusterRequest.
An array of Cluster records
*/
ClusterRequest *research_models.ClusterRequest
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the post clusters params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostClustersParams) WithDefaults() *PostClustersParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the post clusters params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostClustersParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the post clusters params
func (o *PostClustersParams) WithTimeout(timeout time.Duration) *PostClustersParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the post clusters params
func (o *PostClustersParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the post clusters params
func (o *PostClustersParams) WithContext(ctx context.Context) *PostClustersParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the post clusters params
func (o *PostClustersParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the post clusters params
func (o *PostClustersParams) WithHTTPClient(client *http.Client) *PostClustersParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the post clusters params
func (o *PostClustersParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithClusterRequest adds the clusterRequest to the post clusters params
func (o *PostClustersParams) WithClusterRequest(clusterRequest *research_models.ClusterRequest) *PostClustersParams {
o.SetClusterRequest(clusterRequest)
return o
}
// SetClusterRequest adds the clusterRequest to the post clusters params
func (o *PostClustersParams) SetClusterRequest(clusterRequest *research_models.ClusterRequest) {
o.ClusterRequest = clusterRequest
}
// WriteToRequest writes these params to a swagger request
func (o *PostClustersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.ClusterRequest != nil {
if err := r.SetBodyParam(o.ClusterRequest); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,306 @@
// 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 clusters
// 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"
)
// PostClustersReader is a Reader for the PostClusters structure.
type PostClustersReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PostClustersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewPostClustersOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewPostClustersUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewPostClustersForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewPostClustersNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewPostClustersUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewPostClustersInternalServerError()
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())
}
}
// NewPostClustersOK creates a PostClustersOK with default headers values
func NewPostClustersOK() *PostClustersOK {
return &PostClustersOK{}
}
/* PostClustersOK describes a response with status code 200, with default header values.
Taxnexus Response with Cluster objects
*/
type PostClustersOK struct {
Payload *research_models.ClusterResponse
}
func (o *PostClustersOK) Error() string {
return fmt.Sprintf("[POST /clusters][%d] postClustersOK %+v", 200, o.Payload)
}
func (o *PostClustersOK) GetPayload() *research_models.ClusterResponse {
return o.Payload
}
func (o *PostClustersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(research_models.ClusterResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostClustersUnauthorized creates a PostClustersUnauthorized with default headers values
func NewPostClustersUnauthorized() *PostClustersUnauthorized {
return &PostClustersUnauthorized{}
}
/* PostClustersUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type PostClustersUnauthorized struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *PostClustersUnauthorized) Error() string {
return fmt.Sprintf("[POST /clusters][%d] postClustersUnauthorized %+v", 401, o.Payload)
}
func (o *PostClustersUnauthorized) GetPayload() *research_models.Error {
return o.Payload
}
func (o *PostClustersUnauthorized) 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
}
// NewPostClustersForbidden creates a PostClustersForbidden with default headers values
func NewPostClustersForbidden() *PostClustersForbidden {
return &PostClustersForbidden{}
}
/* PostClustersForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type PostClustersForbidden struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *PostClustersForbidden) Error() string {
return fmt.Sprintf("[POST /clusters][%d] postClustersForbidden %+v", 403, o.Payload)
}
func (o *PostClustersForbidden) GetPayload() *research_models.Error {
return o.Payload
}
func (o *PostClustersForbidden) 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
}
// NewPostClustersNotFound creates a PostClustersNotFound with default headers values
func NewPostClustersNotFound() *PostClustersNotFound {
return &PostClustersNotFound{}
}
/* PostClustersNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type PostClustersNotFound struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *PostClustersNotFound) Error() string {
return fmt.Sprintf("[POST /clusters][%d] postClustersNotFound %+v", 404, o.Payload)
}
func (o *PostClustersNotFound) GetPayload() *research_models.Error {
return o.Payload
}
func (o *PostClustersNotFound) 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
}
// NewPostClustersUnprocessableEntity creates a PostClustersUnprocessableEntity with default headers values
func NewPostClustersUnprocessableEntity() *PostClustersUnprocessableEntity {
return &PostClustersUnprocessableEntity{}
}
/* PostClustersUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type PostClustersUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *PostClustersUnprocessableEntity) Error() string {
return fmt.Sprintf("[POST /clusters][%d] postClustersUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PostClustersUnprocessableEntity) GetPayload() *research_models.Error {
return o.Payload
}
func (o *PostClustersUnprocessableEntity) 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
}
// NewPostClustersInternalServerError creates a PostClustersInternalServerError with default headers values
func NewPostClustersInternalServerError() *PostClustersInternalServerError {
return &PostClustersInternalServerError{}
}
/* PostClustersInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type PostClustersInternalServerError struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *PostClustersInternalServerError) Error() string {
return fmt.Sprintf("[POST /clusters][%d] postClustersInternalServerError %+v", 500, o.Payload)
}
func (o *PostClustersInternalServerError) GetPayload() *research_models.Error {
return o.Payload
}
func (o *PostClustersInternalServerError) 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 clusters
// 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"
)
// NewPutClustersParams creates a new PutClustersParams 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 NewPutClustersParams() *PutClustersParams {
return &PutClustersParams{
timeout: cr.DefaultTimeout,
}
}
// NewPutClustersParamsWithTimeout creates a new PutClustersParams object
// with the ability to set a timeout on a request.
func NewPutClustersParamsWithTimeout(timeout time.Duration) *PutClustersParams {
return &PutClustersParams{
timeout: timeout,
}
}
// NewPutClustersParamsWithContext creates a new PutClustersParams object
// with the ability to set a context for a request.
func NewPutClustersParamsWithContext(ctx context.Context) *PutClustersParams {
return &PutClustersParams{
Context: ctx,
}
}
// NewPutClustersParamsWithHTTPClient creates a new PutClustersParams object
// with the ability to set a custom HTTPClient for a request.
func NewPutClustersParamsWithHTTPClient(client *http.Client) *PutClustersParams {
return &PutClustersParams{
HTTPClient: client,
}
}
/* PutClustersParams contains all the parameters to send to the API endpoint
for the put clusters operation.
Typically these are written to a http.Request.
*/
type PutClustersParams struct {
/* ClusterRequest.
An array of Cluster records
*/
ClusterRequest *research_models.ClusterRequest
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the put clusters params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PutClustersParams) WithDefaults() *PutClustersParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the put clusters params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PutClustersParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the put clusters params
func (o *PutClustersParams) WithTimeout(timeout time.Duration) *PutClustersParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the put clusters params
func (o *PutClustersParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the put clusters params
func (o *PutClustersParams) WithContext(ctx context.Context) *PutClustersParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the put clusters params
func (o *PutClustersParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the put clusters params
func (o *PutClustersParams) WithHTTPClient(client *http.Client) *PutClustersParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the put clusters params
func (o *PutClustersParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithClusterRequest adds the clusterRequest to the put clusters params
func (o *PutClustersParams) WithClusterRequest(clusterRequest *research_models.ClusterRequest) *PutClustersParams {
o.SetClusterRequest(clusterRequest)
return o
}
// SetClusterRequest adds the clusterRequest to the put clusters params
func (o *PutClustersParams) SetClusterRequest(clusterRequest *research_models.ClusterRequest) {
o.ClusterRequest = clusterRequest
}
// WriteToRequest writes these params to a swagger request
func (o *PutClustersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.ClusterRequest != nil {
if err := r.SetBodyParam(o.ClusterRequest); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,306 @@
// 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 clusters
// 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"
)
// PutClustersReader is a Reader for the PutClusters structure.
type PutClustersReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PutClustersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewPutClustersOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewPutClustersUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewPutClustersForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewPutClustersNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewPutClustersUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewPutClustersInternalServerError()
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())
}
}
// NewPutClustersOK creates a PutClustersOK with default headers values
func NewPutClustersOK() *PutClustersOK {
return &PutClustersOK{}
}
/* PutClustersOK describes a response with status code 200, with default header values.
Taxnexus Response with Cluster objects
*/
type PutClustersOK struct {
Payload *research_models.ClusterResponse
}
func (o *PutClustersOK) Error() string {
return fmt.Sprintf("[PUT /clusters][%d] putClustersOK %+v", 200, o.Payload)
}
func (o *PutClustersOK) GetPayload() *research_models.ClusterResponse {
return o.Payload
}
func (o *PutClustersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(research_models.ClusterResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPutClustersUnauthorized creates a PutClustersUnauthorized with default headers values
func NewPutClustersUnauthorized() *PutClustersUnauthorized {
return &PutClustersUnauthorized{}
}
/* PutClustersUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type PutClustersUnauthorized struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *PutClustersUnauthorized) Error() string {
return fmt.Sprintf("[PUT /clusters][%d] putClustersUnauthorized %+v", 401, o.Payload)
}
func (o *PutClustersUnauthorized) GetPayload() *research_models.Error {
return o.Payload
}
func (o *PutClustersUnauthorized) 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
}
// NewPutClustersForbidden creates a PutClustersForbidden with default headers values
func NewPutClustersForbidden() *PutClustersForbidden {
return &PutClustersForbidden{}
}
/* PutClustersForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type PutClustersForbidden struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *PutClustersForbidden) Error() string {
return fmt.Sprintf("[PUT /clusters][%d] putClustersForbidden %+v", 403, o.Payload)
}
func (o *PutClustersForbidden) GetPayload() *research_models.Error {
return o.Payload
}
func (o *PutClustersForbidden) 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
}
// NewPutClustersNotFound creates a PutClustersNotFound with default headers values
func NewPutClustersNotFound() *PutClustersNotFound {
return &PutClustersNotFound{}
}
/* PutClustersNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type PutClustersNotFound struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *PutClustersNotFound) Error() string {
return fmt.Sprintf("[PUT /clusters][%d] putClustersNotFound %+v", 404, o.Payload)
}
func (o *PutClustersNotFound) GetPayload() *research_models.Error {
return o.Payload
}
func (o *PutClustersNotFound) 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
}
// NewPutClustersUnprocessableEntity creates a PutClustersUnprocessableEntity with default headers values
func NewPutClustersUnprocessableEntity() *PutClustersUnprocessableEntity {
return &PutClustersUnprocessableEntity{}
}
/* PutClustersUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type PutClustersUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *PutClustersUnprocessableEntity) Error() string {
return fmt.Sprintf("[PUT /clusters][%d] putClustersUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PutClustersUnprocessableEntity) GetPayload() *research_models.Error {
return o.Payload
}
func (o *PutClustersUnprocessableEntity) 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
}
// NewPutClustersInternalServerError creates a PutClustersInternalServerError with default headers values
func NewPutClustersInternalServerError() *PutClustersInternalServerError {
return &PutClustersInternalServerError{}
}
/* PutClustersInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type PutClustersInternalServerError struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *PutClustersInternalServerError) Error() string {
return fmt.Sprintf("[PUT /clusters][%d] putClustersInternalServerError %+v", 500, o.Payload)
}
func (o *PutClustersInternalServerError) GetPayload() *research_models.Error {
return o.Payload
}
func (o *PutClustersInternalServerError) 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,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 contacts
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
)
// New creates a new contacts API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
return &Client{transport: transport, formats: formats}
}
/*
Client for contacts API
*/
type Client struct {
transport runtime.ClientTransport
formats strfmt.Registry
}
// ClientOption is the option for Client methods
type ClientOption func(*runtime.ClientOperation)
// ClientService is the interface for Client methods
type ClientService interface {
GetContacts(params *GetContactsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetContactsOK, error)
PostContacts(params *PostContactsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostContactsOK, error)
SetTransport(transport runtime.ClientTransport)
}
/*
GetContacts gets a contact record
Retrieve Contact records from the datastore
*/
func (a *Client) GetContacts(params *GetContactsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetContactsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetContactsParams()
}
op := &runtime.ClientOperation{
ID: "getContacts",
Method: "GET",
PathPattern: "/contacts",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &GetContactsReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*GetContactsOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for getContacts: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
PostContacts adds a new contacts to taxnexus
Contacts record to be added
*/
func (a *Client) PostContacts(params *PostContactsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostContactsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPostContactsParams()
}
op := &runtime.ClientOperation{
ID: "postContacts",
Method: "POST",
PathPattern: "/contacts",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PostContactsReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*PostContactsOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for postContacts: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
// SetTransport changes the transport on the client
func (a *Client) SetTransport(transport runtime.ClientTransport) {
a.transport = transport
}

View File

@ -0,0 +1,374 @@
// 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 contacts
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// NewGetContactsParams creates a new GetContactsParams object,
// with the default 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 NewGetContactsParams() *GetContactsParams {
return &GetContactsParams{
timeout: cr.DefaultTimeout,
}
}
// NewGetContactsParamsWithTimeout creates a new GetContactsParams object
// with the ability to set a timeout on a request.
func NewGetContactsParamsWithTimeout(timeout time.Duration) *GetContactsParams {
return &GetContactsParams{
timeout: timeout,
}
}
// NewGetContactsParamsWithContext creates a new GetContactsParams object
// with the ability to set a context for a request.
func NewGetContactsParamsWithContext(ctx context.Context) *GetContactsParams {
return &GetContactsParams{
Context: ctx,
}
}
// NewGetContactsParamsWithHTTPClient creates a new GetContactsParams object
// with the ability to set a custom HTTPClient for a request.
func NewGetContactsParamsWithHTTPClient(client *http.Client) *GetContactsParams {
return &GetContactsParams{
HTTPClient: client,
}
}
/* GetContactsParams contains all the parameters to send to the API endpoint
for the get contacts operation.
Typically these are written to a http.Request.
*/
type GetContactsParams struct {
/* AccountID.
Taxnexus Record Id of an Account
*/
AccountID *string
/* Active.
Only retrieve active records?
*/
Active *bool
/* ContactID.
Taxnexus Record Id of a Contact
*/
ContactID *string
/* Email.
Email address used for identity lookup
*/
Email *string
/* Limit.
How many objects to return at one time
Format: int64
*/
Limit *int64
/* Name.
The Name of this Object
*/
Name *string
/* 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 contacts params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetContactsParams) WithDefaults() *GetContactsParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the get contacts params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetContactsParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the get contacts params
func (o *GetContactsParams) WithTimeout(timeout time.Duration) *GetContactsParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the get contacts params
func (o *GetContactsParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the get contacts params
func (o *GetContactsParams) WithContext(ctx context.Context) *GetContactsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get contacts params
func (o *GetContactsParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the get contacts params
func (o *GetContactsParams) WithHTTPClient(client *http.Client) *GetContactsParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the get contacts params
func (o *GetContactsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithAccountID adds the accountID to the get contacts params
func (o *GetContactsParams) WithAccountID(accountID *string) *GetContactsParams {
o.SetAccountID(accountID)
return o
}
// SetAccountID adds the accountId to the get contacts params
func (o *GetContactsParams) SetAccountID(accountID *string) {
o.AccountID = accountID
}
// WithActive adds the active to the get contacts params
func (o *GetContactsParams) WithActive(active *bool) *GetContactsParams {
o.SetActive(active)
return o
}
// SetActive adds the active to the get contacts params
func (o *GetContactsParams) SetActive(active *bool) {
o.Active = active
}
// WithContactID adds the contactID to the get contacts params
func (o *GetContactsParams) WithContactID(contactID *string) *GetContactsParams {
o.SetContactID(contactID)
return o
}
// SetContactID adds the contactId to the get contacts params
func (o *GetContactsParams) SetContactID(contactID *string) {
o.ContactID = contactID
}
// WithEmail adds the email to the get contacts params
func (o *GetContactsParams) WithEmail(email *string) *GetContactsParams {
o.SetEmail(email)
return o
}
// SetEmail adds the email to the get contacts params
func (o *GetContactsParams) SetEmail(email *string) {
o.Email = email
}
// WithLimit adds the limit to the get contacts params
func (o *GetContactsParams) WithLimit(limit *int64) *GetContactsParams {
o.SetLimit(limit)
return o
}
// SetLimit adds the limit to the get contacts params
func (o *GetContactsParams) SetLimit(limit *int64) {
o.Limit = limit
}
// WithName adds the name to the get contacts params
func (o *GetContactsParams) WithName(name *string) *GetContactsParams {
o.SetName(name)
return o
}
// SetName adds the name to the get contacts params
func (o *GetContactsParams) SetName(name *string) {
o.Name = name
}
// WithOffset adds the offset to the get contacts params
func (o *GetContactsParams) WithOffset(offset *int64) *GetContactsParams {
o.SetOffset(offset)
return o
}
// SetOffset adds the offset to the get contacts params
func (o *GetContactsParams) SetOffset(offset *int64) {
o.Offset = offset
}
// WriteToRequest writes these params to a swagger request
func (o *GetContactsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.AccountID != nil {
// query param accountId
var qrAccountID string
if o.AccountID != nil {
qrAccountID = *o.AccountID
}
qAccountID := qrAccountID
if qAccountID != "" {
if err := r.SetQueryParam("accountId", qAccountID); err != nil {
return err
}
}
}
if o.Active != nil {
// query param active
var qrActive bool
if o.Active != nil {
qrActive = *o.Active
}
qActive := swag.FormatBool(qrActive)
if qActive != "" {
if err := r.SetQueryParam("active", qActive); err != nil {
return err
}
}
}
if o.ContactID != nil {
// query param contactId
var qrContactID string
if o.ContactID != nil {
qrContactID = *o.ContactID
}
qContactID := qrContactID
if qContactID != "" {
if err := r.SetQueryParam("contactId", qContactID); err != nil {
return err
}
}
}
if o.Email != nil {
// query param email
var qrEmail string
if o.Email != nil {
qrEmail = *o.Email
}
qEmail := qrEmail
if qEmail != "" {
if err := r.SetQueryParam("email", qEmail); err != nil {
return err
}
}
}
if o.Limit != nil {
// query param limit
var qrLimit int64
if o.Limit != nil {
qrLimit = *o.Limit
}
qLimit := swag.FormatInt64(qrLimit)
if qLimit != "" {
if err := r.SetQueryParam("limit", qLimit); err != nil {
return err
}
}
}
if o.Name != nil {
// query param name
var qrName string
if o.Name != nil {
qrName = *o.Name
}
qName := qrName
if qName != "" {
if err := r.SetQueryParam("name", qName); err != nil {
return err
}
}
}
if o.Offset != nil {
// query param offset
var qrOffset int64
if o.Offset != nil {
qrOffset = *o.Offset
}
qOffset := swag.FormatInt64(qrOffset)
if qOffset != "" {
if err := r.SetQueryParam("offset", qOffset); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,306 @@
// 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 contacts
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"code.tnxs.net/vernonkeenan/lib/api/research/research_models"
)
// GetContactsReader is a Reader for the GetContacts structure.
type GetContactsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetContactsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetContactsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewGetContactsUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewGetContactsForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewGetContactsNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewGetContactsUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewGetContactsInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
}
}
// NewGetContactsOK creates a GetContactsOK with default headers values
func NewGetContactsOK() *GetContactsOK {
return &GetContactsOK{}
}
/* GetContactsOK describes a response with status code 200, with default header values.
Taxnexus Response with Contact objects
*/
type GetContactsOK struct {
Payload *research_models.ContactResponse
}
func (o *GetContactsOK) Error() string {
return fmt.Sprintf("[GET /contacts][%d] getContactsOK %+v", 200, o.Payload)
}
func (o *GetContactsOK) GetPayload() *research_models.ContactResponse {
return o.Payload
}
func (o *GetContactsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(research_models.ContactResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetContactsUnauthorized creates a GetContactsUnauthorized with default headers values
func NewGetContactsUnauthorized() *GetContactsUnauthorized {
return &GetContactsUnauthorized{}
}
/* GetContactsUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type GetContactsUnauthorized struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *GetContactsUnauthorized) Error() string {
return fmt.Sprintf("[GET /contacts][%d] getContactsUnauthorized %+v", 401, o.Payload)
}
func (o *GetContactsUnauthorized) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetContactsUnauthorized) 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
}
// NewGetContactsForbidden creates a GetContactsForbidden with default headers values
func NewGetContactsForbidden() *GetContactsForbidden {
return &GetContactsForbidden{}
}
/* GetContactsForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type GetContactsForbidden struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *GetContactsForbidden) Error() string {
return fmt.Sprintf("[GET /contacts][%d] getContactsForbidden %+v", 403, o.Payload)
}
func (o *GetContactsForbidden) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetContactsForbidden) 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
}
// NewGetContactsNotFound creates a GetContactsNotFound with default headers values
func NewGetContactsNotFound() *GetContactsNotFound {
return &GetContactsNotFound{}
}
/* GetContactsNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type GetContactsNotFound struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *GetContactsNotFound) Error() string {
return fmt.Sprintf("[GET /contacts][%d] getContactsNotFound %+v", 404, o.Payload)
}
func (o *GetContactsNotFound) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetContactsNotFound) 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
}
// NewGetContactsUnprocessableEntity creates a GetContactsUnprocessableEntity with default headers values
func NewGetContactsUnprocessableEntity() *GetContactsUnprocessableEntity {
return &GetContactsUnprocessableEntity{}
}
/* GetContactsUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type GetContactsUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *GetContactsUnprocessableEntity) Error() string {
return fmt.Sprintf("[GET /contacts][%d] getContactsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetContactsUnprocessableEntity) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetContactsUnprocessableEntity) 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
}
// NewGetContactsInternalServerError creates a GetContactsInternalServerError with default headers values
func NewGetContactsInternalServerError() *GetContactsInternalServerError {
return &GetContactsInternalServerError{}
}
/* GetContactsInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type GetContactsInternalServerError struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *GetContactsInternalServerError) Error() string {
return fmt.Sprintf("[GET /contacts][%d] getContactsInternalServerError %+v", 500, o.Payload)
}
func (o *GetContactsInternalServerError) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetContactsInternalServerError) 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 contacts
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
"code.tnxs.net/vernonkeenan/lib/api/research/research_models"
)
// NewPostContactsParams creates a new PostContactsParams 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 NewPostContactsParams() *PostContactsParams {
return &PostContactsParams{
timeout: cr.DefaultTimeout,
}
}
// NewPostContactsParamsWithTimeout creates a new PostContactsParams object
// with the ability to set a timeout on a request.
func NewPostContactsParamsWithTimeout(timeout time.Duration) *PostContactsParams {
return &PostContactsParams{
timeout: timeout,
}
}
// NewPostContactsParamsWithContext creates a new PostContactsParams object
// with the ability to set a context for a request.
func NewPostContactsParamsWithContext(ctx context.Context) *PostContactsParams {
return &PostContactsParams{
Context: ctx,
}
}
// NewPostContactsParamsWithHTTPClient creates a new PostContactsParams object
// with the ability to set a custom HTTPClient for a request.
func NewPostContactsParamsWithHTTPClient(client *http.Client) *PostContactsParams {
return &PostContactsParams{
HTTPClient: client,
}
}
/* PostContactsParams contains all the parameters to send to the API endpoint
for the post contacts operation.
Typically these are written to a http.Request.
*/
type PostContactsParams struct {
/* ContactRequest.
An array of new Contact records
*/
ContactRequest *research_models.ContactRequest
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the post contacts params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostContactsParams) WithDefaults() *PostContactsParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the post contacts params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostContactsParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the post contacts params
func (o *PostContactsParams) WithTimeout(timeout time.Duration) *PostContactsParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the post contacts params
func (o *PostContactsParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the post contacts params
func (o *PostContactsParams) WithContext(ctx context.Context) *PostContactsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the post contacts params
func (o *PostContactsParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the post contacts params
func (o *PostContactsParams) WithHTTPClient(client *http.Client) *PostContactsParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the post contacts params
func (o *PostContactsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithContactRequest adds the contactRequest to the post contacts params
func (o *PostContactsParams) WithContactRequest(contactRequest *research_models.ContactRequest) *PostContactsParams {
o.SetContactRequest(contactRequest)
return o
}
// SetContactRequest adds the contactRequest to the post contacts params
func (o *PostContactsParams) SetContactRequest(contactRequest *research_models.ContactRequest) {
o.ContactRequest = contactRequest
}
// WriteToRequest writes these params to a swagger request
func (o *PostContactsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.ContactRequest != nil {
if err := r.SetBodyParam(o.ContactRequest); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,259 @@
// 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 contacts
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"code.tnxs.net/vernonkeenan/lib/api/research/research_models"
)
// PostContactsReader is a Reader for the PostContacts structure.
type PostContactsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PostContactsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewPostContactsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewPostContactsUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewPostContactsForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewPostContactsNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewPostContactsInternalServerError()
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())
}
}
// NewPostContactsOK creates a PostContactsOK with default headers values
func NewPostContactsOK() *PostContactsOK {
return &PostContactsOK{}
}
/* PostContactsOK describes a response with status code 200, with default header values.
Taxnexus Response with Contact objects
*/
type PostContactsOK struct {
Payload *research_models.ContactResponse
}
func (o *PostContactsOK) Error() string {
return fmt.Sprintf("[POST /contacts][%d] postContactsOK %+v", 200, o.Payload)
}
func (o *PostContactsOK) GetPayload() *research_models.ContactResponse {
return o.Payload
}
func (o *PostContactsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(research_models.ContactResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostContactsUnauthorized creates a PostContactsUnauthorized with default headers values
func NewPostContactsUnauthorized() *PostContactsUnauthorized {
return &PostContactsUnauthorized{}
}
/* PostContactsUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type PostContactsUnauthorized struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *PostContactsUnauthorized) Error() string {
return fmt.Sprintf("[POST /contacts][%d] postContactsUnauthorized %+v", 401, o.Payload)
}
func (o *PostContactsUnauthorized) GetPayload() *research_models.Error {
return o.Payload
}
func (o *PostContactsUnauthorized) 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
}
// NewPostContactsForbidden creates a PostContactsForbidden with default headers values
func NewPostContactsForbidden() *PostContactsForbidden {
return &PostContactsForbidden{}
}
/* PostContactsForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type PostContactsForbidden struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *PostContactsForbidden) Error() string {
return fmt.Sprintf("[POST /contacts][%d] postContactsForbidden %+v", 403, o.Payload)
}
func (o *PostContactsForbidden) GetPayload() *research_models.Error {
return o.Payload
}
func (o *PostContactsForbidden) 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
}
// NewPostContactsNotFound creates a PostContactsNotFound with default headers values
func NewPostContactsNotFound() *PostContactsNotFound {
return &PostContactsNotFound{}
}
/* PostContactsNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type PostContactsNotFound struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *PostContactsNotFound) Error() string {
return fmt.Sprintf("[POST /contacts][%d] postContactsNotFound %+v", 404, o.Payload)
}
func (o *PostContactsNotFound) GetPayload() *research_models.Error {
return o.Payload
}
func (o *PostContactsNotFound) 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
}
// NewPostContactsInternalServerError creates a PostContactsInternalServerError with default headers values
func NewPostContactsInternalServerError() *PostContactsInternalServerError {
return &PostContactsInternalServerError{}
}
/* PostContactsInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type PostContactsInternalServerError struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *PostContactsInternalServerError) Error() string {
return fmt.Sprintf("[POST /contacts][%d] postContactsInternalServerError %+v", 500, o.Payload)
}
func (o *PostContactsInternalServerError) GetPayload() *research_models.Error {
return o.Payload
}
func (o *PostContactsInternalServerError) 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

@ -4,7 +4,7 @@
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package notebooks
package databases
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
@ -16,13 +16,13 @@ import (
"github.com/go-openapi/strfmt"
)
// New creates a new notebooks API client.
// New creates a new databases API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
return &Client{transport: transport, formats: formats}
}
/*
Client for notebooks API
Client for databases API
*/
type Client struct {
transport runtime.ClientTransport
@ -34,34 +34,34 @@ type ClientOption func(*runtime.ClientOperation)
// ClientService is the interface for Client methods
type ClientService interface {
GetNotebooks(params *GetNotebooksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetNotebooksOK, error)
GetDatabases(params *GetDatabasesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetDatabasesOK, error)
PostNotebooks(params *PostNotebooksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostNotebooksOK, error)
PostDatabases(params *PostDatabasesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostDatabasesOK, error)
PutNotebooks(params *PutNotebooksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutNotebooksOK, error)
PutDatabases(params *PutDatabasesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutDatabasesOK, error)
SetTransport(transport runtime.ClientTransport)
}
/*
GetNotebooks gets a list of notebooks
GetDatabases gets a list databases
Return a list of Notebook records from the datastore
Return a list of Database records from the datastore
*/
func (a *Client) GetNotebooks(params *GetNotebooksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetNotebooksOK, error) {
func (a *Client) GetDatabases(params *GetDatabasesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetDatabasesOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetNotebooksParams()
params = NewGetDatabasesParams()
}
op := &runtime.ClientOperation{
ID: "getNotebooks",
ID: "getDatabases",
Method: "GET",
PathPattern: "/notebooks",
PathPattern: "/databases",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &GetNotebooksReader{formats: a.formats},
Reader: &GetDatabasesReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
@ -74,35 +74,35 @@ func (a *Client) GetNotebooks(params *GetNotebooksParams, authInfo runtime.Clien
if err != nil {
return nil, err
}
success, ok := result.(*GetNotebooksOK)
success, ok := result.(*GetDatabasesOK)
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 getNotebooks: API contract not enforced by server. Client expected to get an error, but got: %T", result)
msg := fmt.Sprintf("unexpected success response for getDatabases: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
PostNotebooks creates new notebooks
PostDatabases creates new databases
Create Notebooks in Taxnexus
Create Databases in Taxnexus
*/
func (a *Client) PostNotebooks(params *PostNotebooksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostNotebooksOK, error) {
func (a *Client) PostDatabases(params *PostDatabasesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostDatabasesOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPostNotebooksParams()
params = NewPostDatabasesParams()
}
op := &runtime.ClientOperation{
ID: "postNotebooks",
ID: "postDatabases",
Method: "POST",
PathPattern: "/notebooks",
PathPattern: "/databases",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PostNotebooksReader{formats: a.formats},
Reader: &PostDatabasesReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
@ -115,35 +115,35 @@ func (a *Client) PostNotebooks(params *PostNotebooksParams, authInfo runtime.Cli
if err != nil {
return nil, err
}
success, ok := result.(*PostNotebooksOK)
success, ok := result.(*PostDatabasesOK)
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 postNotebooks: API contract not enforced by server. Client expected to get an error, but got: %T", result)
msg := fmt.Sprintf("unexpected success response for postDatabases: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
PutNotebooks updates notebooks
PutDatabases updates databases
Update Notebooks in Taxnexus
Update Database in Taxnexus
*/
func (a *Client) PutNotebooks(params *PutNotebooksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutNotebooksOK, error) {
func (a *Client) PutDatabases(params *PutDatabasesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutDatabasesOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPutNotebooksParams()
params = NewPutDatabasesParams()
}
op := &runtime.ClientOperation{
ID: "putNotebooks",
ID: "putDatabases",
Method: "PUT",
PathPattern: "/notebooks",
PathPattern: "/databases",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PutNotebooksReader{formats: a.formats},
Reader: &PutDatabasesReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
@ -156,13 +156,13 @@ func (a *Client) PutNotebooks(params *PutNotebooksParams, authInfo runtime.Clien
if err != nil {
return nil, err
}
success, ok := result.(*PutNotebooksOK)
success, ok := result.(*PutDatabasesOK)
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 putNotebooks: API contract not enforced by server. Client expected to get an error, but got: %T", result)
msg := fmt.Sprintf("unexpected success response for putDatabases: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}

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 databases
// 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"
)
// NewGetDatabasesParams creates a new GetDatabasesParams 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 NewGetDatabasesParams() *GetDatabasesParams {
return &GetDatabasesParams{
timeout: cr.DefaultTimeout,
}
}
// NewGetDatabasesParamsWithTimeout creates a new GetDatabasesParams object
// with the ability to set a timeout on a request.
func NewGetDatabasesParamsWithTimeout(timeout time.Duration) *GetDatabasesParams {
return &GetDatabasesParams{
timeout: timeout,
}
}
// NewGetDatabasesParamsWithContext creates a new GetDatabasesParams object
// with the ability to set a context for a request.
func NewGetDatabasesParamsWithContext(ctx context.Context) *GetDatabasesParams {
return &GetDatabasesParams{
Context: ctx,
}
}
// NewGetDatabasesParamsWithHTTPClient creates a new GetDatabasesParams object
// with the ability to set a custom HTTPClient for a request.
func NewGetDatabasesParamsWithHTTPClient(client *http.Client) *GetDatabasesParams {
return &GetDatabasesParams{
HTTPClient: client,
}
}
/* GetDatabasesParams contains all the parameters to send to the API endpoint
for the get databases operation.
Typically these are written to a http.Request.
*/
type GetDatabasesParams struct {
/* DatabaseID.
Taxnexus Record Id of a Database
*/
DatabaseID *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 databases params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetDatabasesParams) WithDefaults() *GetDatabasesParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the get databases params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetDatabasesParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the get databases params
func (o *GetDatabasesParams) WithTimeout(timeout time.Duration) *GetDatabasesParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the get databases params
func (o *GetDatabasesParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the get databases params
func (o *GetDatabasesParams) WithContext(ctx context.Context) *GetDatabasesParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get databases params
func (o *GetDatabasesParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the get databases params
func (o *GetDatabasesParams) WithHTTPClient(client *http.Client) *GetDatabasesParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the get databases params
func (o *GetDatabasesParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithDatabaseID adds the databaseID to the get databases params
func (o *GetDatabasesParams) WithDatabaseID(databaseID *string) *GetDatabasesParams {
o.SetDatabaseID(databaseID)
return o
}
// SetDatabaseID adds the databaseId to the get databases params
func (o *GetDatabasesParams) SetDatabaseID(databaseID *string) {
o.DatabaseID = databaseID
}
// WithLimit adds the limit to the get databases params
func (o *GetDatabasesParams) WithLimit(limit *int64) *GetDatabasesParams {
o.SetLimit(limit)
return o
}
// SetLimit adds the limit to the get databases params
func (o *GetDatabasesParams) SetLimit(limit *int64) {
o.Limit = limit
}
// WithOffset adds the offset to the get databases params
func (o *GetDatabasesParams) WithOffset(offset *int64) *GetDatabasesParams {
o.SetOffset(offset)
return o
}
// SetOffset adds the offset to the get databases params
func (o *GetDatabasesParams) SetOffset(offset *int64) {
o.Offset = offset
}
// WriteToRequest writes these params to a swagger request
func (o *GetDatabasesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.DatabaseID != nil {
// query param databaseId
var qrDatabaseID string
if o.DatabaseID != nil {
qrDatabaseID = *o.DatabaseID
}
qDatabaseID := qrDatabaseID
if qDatabaseID != "" {
if err := r.SetQueryParam("databaseId", qDatabaseID); 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,306 @@
// 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 databases
// 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"
)
// GetDatabasesReader is a Reader for the GetDatabases structure.
type GetDatabasesReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetDatabasesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetDatabasesOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewGetDatabasesUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewGetDatabasesForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewGetDatabasesNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewGetDatabasesUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewGetDatabasesInternalServerError()
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())
}
}
// NewGetDatabasesOK creates a GetDatabasesOK with default headers values
func NewGetDatabasesOK() *GetDatabasesOK {
return &GetDatabasesOK{}
}
/* GetDatabasesOK describes a response with status code 200, with default header values.
Taxnexus Response with Database objects
*/
type GetDatabasesOK struct {
Payload *research_models.DatabaseResponse
}
func (o *GetDatabasesOK) Error() string {
return fmt.Sprintf("[GET /databases][%d] getDatabasesOK %+v", 200, o.Payload)
}
func (o *GetDatabasesOK) GetPayload() *research_models.DatabaseResponse {
return o.Payload
}
func (o *GetDatabasesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(research_models.DatabaseResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetDatabasesUnauthorized creates a GetDatabasesUnauthorized with default headers values
func NewGetDatabasesUnauthorized() *GetDatabasesUnauthorized {
return &GetDatabasesUnauthorized{}
}
/* GetDatabasesUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type GetDatabasesUnauthorized struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *GetDatabasesUnauthorized) Error() string {
return fmt.Sprintf("[GET /databases][%d] getDatabasesUnauthorized %+v", 401, o.Payload)
}
func (o *GetDatabasesUnauthorized) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetDatabasesUnauthorized) 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
}
// NewGetDatabasesForbidden creates a GetDatabasesForbidden with default headers values
func NewGetDatabasesForbidden() *GetDatabasesForbidden {
return &GetDatabasesForbidden{}
}
/* GetDatabasesForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type GetDatabasesForbidden struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *GetDatabasesForbidden) Error() string {
return fmt.Sprintf("[GET /databases][%d] getDatabasesForbidden %+v", 403, o.Payload)
}
func (o *GetDatabasesForbidden) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetDatabasesForbidden) 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
}
// NewGetDatabasesNotFound creates a GetDatabasesNotFound with default headers values
func NewGetDatabasesNotFound() *GetDatabasesNotFound {
return &GetDatabasesNotFound{}
}
/* GetDatabasesNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type GetDatabasesNotFound struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *GetDatabasesNotFound) Error() string {
return fmt.Sprintf("[GET /databases][%d] getDatabasesNotFound %+v", 404, o.Payload)
}
func (o *GetDatabasesNotFound) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetDatabasesNotFound) 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
}
// NewGetDatabasesUnprocessableEntity creates a GetDatabasesUnprocessableEntity with default headers values
func NewGetDatabasesUnprocessableEntity() *GetDatabasesUnprocessableEntity {
return &GetDatabasesUnprocessableEntity{}
}
/* GetDatabasesUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type GetDatabasesUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *GetDatabasesUnprocessableEntity) Error() string {
return fmt.Sprintf("[GET /databases][%d] getDatabasesUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetDatabasesUnprocessableEntity) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetDatabasesUnprocessableEntity) 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
}
// NewGetDatabasesInternalServerError creates a GetDatabasesInternalServerError with default headers values
func NewGetDatabasesInternalServerError() *GetDatabasesInternalServerError {
return &GetDatabasesInternalServerError{}
}
/* GetDatabasesInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type GetDatabasesInternalServerError struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *GetDatabasesInternalServerError) Error() string {
return fmt.Sprintf("[GET /databases][%d] getDatabasesInternalServerError %+v", 500, o.Payload)
}
func (o *GetDatabasesInternalServerError) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetDatabasesInternalServerError) 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 databases
// 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"
)
// NewPostDatabasesParams creates a new PostDatabasesParams 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 NewPostDatabasesParams() *PostDatabasesParams {
return &PostDatabasesParams{
timeout: cr.DefaultTimeout,
}
}
// NewPostDatabasesParamsWithTimeout creates a new PostDatabasesParams object
// with the ability to set a timeout on a request.
func NewPostDatabasesParamsWithTimeout(timeout time.Duration) *PostDatabasesParams {
return &PostDatabasesParams{
timeout: timeout,
}
}
// NewPostDatabasesParamsWithContext creates a new PostDatabasesParams object
// with the ability to set a context for a request.
func NewPostDatabasesParamsWithContext(ctx context.Context) *PostDatabasesParams {
return &PostDatabasesParams{
Context: ctx,
}
}
// NewPostDatabasesParamsWithHTTPClient creates a new PostDatabasesParams object
// with the ability to set a custom HTTPClient for a request.
func NewPostDatabasesParamsWithHTTPClient(client *http.Client) *PostDatabasesParams {
return &PostDatabasesParams{
HTTPClient: client,
}
}
/* PostDatabasesParams contains all the parameters to send to the API endpoint
for the post databases operation.
Typically these are written to a http.Request.
*/
type PostDatabasesParams struct {
/* DatabaseRequest.
An array of Database records
*/
DatabaseRequest *research_models.DatabaseRequest
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the post databases params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostDatabasesParams) WithDefaults() *PostDatabasesParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the post databases params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostDatabasesParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the post databases params
func (o *PostDatabasesParams) WithTimeout(timeout time.Duration) *PostDatabasesParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the post databases params
func (o *PostDatabasesParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the post databases params
func (o *PostDatabasesParams) WithContext(ctx context.Context) *PostDatabasesParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the post databases params
func (o *PostDatabasesParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the post databases params
func (o *PostDatabasesParams) WithHTTPClient(client *http.Client) *PostDatabasesParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the post databases params
func (o *PostDatabasesParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithDatabaseRequest adds the databaseRequest to the post databases params
func (o *PostDatabasesParams) WithDatabaseRequest(databaseRequest *research_models.DatabaseRequest) *PostDatabasesParams {
o.SetDatabaseRequest(databaseRequest)
return o
}
// SetDatabaseRequest adds the databaseRequest to the post databases params
func (o *PostDatabasesParams) SetDatabaseRequest(databaseRequest *research_models.DatabaseRequest) {
o.DatabaseRequest = databaseRequest
}
// WriteToRequest writes these params to a swagger request
func (o *PostDatabasesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.DatabaseRequest != nil {
if err := r.SetBodyParam(o.DatabaseRequest); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,306 @@
// 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 databases
// 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"
)
// PostDatabasesReader is a Reader for the PostDatabases structure.
type PostDatabasesReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PostDatabasesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewPostDatabasesOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewPostDatabasesUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewPostDatabasesForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewPostDatabasesNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewPostDatabasesUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewPostDatabasesInternalServerError()
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())
}
}
// NewPostDatabasesOK creates a PostDatabasesOK with default headers values
func NewPostDatabasesOK() *PostDatabasesOK {
return &PostDatabasesOK{}
}
/* PostDatabasesOK describes a response with status code 200, with default header values.
Taxnexus Response with Database objects
*/
type PostDatabasesOK struct {
Payload *research_models.DatabaseResponse
}
func (o *PostDatabasesOK) Error() string {
return fmt.Sprintf("[POST /databases][%d] postDatabasesOK %+v", 200, o.Payload)
}
func (o *PostDatabasesOK) GetPayload() *research_models.DatabaseResponse {
return o.Payload
}
func (o *PostDatabasesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(research_models.DatabaseResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostDatabasesUnauthorized creates a PostDatabasesUnauthorized with default headers values
func NewPostDatabasesUnauthorized() *PostDatabasesUnauthorized {
return &PostDatabasesUnauthorized{}
}
/* PostDatabasesUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type PostDatabasesUnauthorized struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *PostDatabasesUnauthorized) Error() string {
return fmt.Sprintf("[POST /databases][%d] postDatabasesUnauthorized %+v", 401, o.Payload)
}
func (o *PostDatabasesUnauthorized) GetPayload() *research_models.Error {
return o.Payload
}
func (o *PostDatabasesUnauthorized) 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
}
// NewPostDatabasesForbidden creates a PostDatabasesForbidden with default headers values
func NewPostDatabasesForbidden() *PostDatabasesForbidden {
return &PostDatabasesForbidden{}
}
/* PostDatabasesForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type PostDatabasesForbidden struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *PostDatabasesForbidden) Error() string {
return fmt.Sprintf("[POST /databases][%d] postDatabasesForbidden %+v", 403, o.Payload)
}
func (o *PostDatabasesForbidden) GetPayload() *research_models.Error {
return o.Payload
}
func (o *PostDatabasesForbidden) 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
}
// NewPostDatabasesNotFound creates a PostDatabasesNotFound with default headers values
func NewPostDatabasesNotFound() *PostDatabasesNotFound {
return &PostDatabasesNotFound{}
}
/* PostDatabasesNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type PostDatabasesNotFound struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *PostDatabasesNotFound) Error() string {
return fmt.Sprintf("[POST /databases][%d] postDatabasesNotFound %+v", 404, o.Payload)
}
func (o *PostDatabasesNotFound) GetPayload() *research_models.Error {
return o.Payload
}
func (o *PostDatabasesNotFound) 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
}
// NewPostDatabasesUnprocessableEntity creates a PostDatabasesUnprocessableEntity with default headers values
func NewPostDatabasesUnprocessableEntity() *PostDatabasesUnprocessableEntity {
return &PostDatabasesUnprocessableEntity{}
}
/* PostDatabasesUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type PostDatabasesUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *PostDatabasesUnprocessableEntity) Error() string {
return fmt.Sprintf("[POST /databases][%d] postDatabasesUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PostDatabasesUnprocessableEntity) GetPayload() *research_models.Error {
return o.Payload
}
func (o *PostDatabasesUnprocessableEntity) 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
}
// NewPostDatabasesInternalServerError creates a PostDatabasesInternalServerError with default headers values
func NewPostDatabasesInternalServerError() *PostDatabasesInternalServerError {
return &PostDatabasesInternalServerError{}
}
/* PostDatabasesInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type PostDatabasesInternalServerError struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *PostDatabasesInternalServerError) Error() string {
return fmt.Sprintf("[POST /databases][%d] postDatabasesInternalServerError %+v", 500, o.Payload)
}
func (o *PostDatabasesInternalServerError) GetPayload() *research_models.Error {
return o.Payload
}
func (o *PostDatabasesInternalServerError) 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 databases
// 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"
)
// NewPutDatabasesParams creates a new PutDatabasesParams 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 NewPutDatabasesParams() *PutDatabasesParams {
return &PutDatabasesParams{
timeout: cr.DefaultTimeout,
}
}
// NewPutDatabasesParamsWithTimeout creates a new PutDatabasesParams object
// with the ability to set a timeout on a request.
func NewPutDatabasesParamsWithTimeout(timeout time.Duration) *PutDatabasesParams {
return &PutDatabasesParams{
timeout: timeout,
}
}
// NewPutDatabasesParamsWithContext creates a new PutDatabasesParams object
// with the ability to set a context for a request.
func NewPutDatabasesParamsWithContext(ctx context.Context) *PutDatabasesParams {
return &PutDatabasesParams{
Context: ctx,
}
}
// NewPutDatabasesParamsWithHTTPClient creates a new PutDatabasesParams object
// with the ability to set a custom HTTPClient for a request.
func NewPutDatabasesParamsWithHTTPClient(client *http.Client) *PutDatabasesParams {
return &PutDatabasesParams{
HTTPClient: client,
}
}
/* PutDatabasesParams contains all the parameters to send to the API endpoint
for the put databases operation.
Typically these are written to a http.Request.
*/
type PutDatabasesParams struct {
/* DatabaseRequest.
An array of Database records
*/
DatabaseRequest *research_models.DatabaseRequest
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the put databases params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PutDatabasesParams) WithDefaults() *PutDatabasesParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the put databases params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PutDatabasesParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the put databases params
func (o *PutDatabasesParams) WithTimeout(timeout time.Duration) *PutDatabasesParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the put databases params
func (o *PutDatabasesParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the put databases params
func (o *PutDatabasesParams) WithContext(ctx context.Context) *PutDatabasesParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the put databases params
func (o *PutDatabasesParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the put databases params
func (o *PutDatabasesParams) WithHTTPClient(client *http.Client) *PutDatabasesParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the put databases params
func (o *PutDatabasesParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithDatabaseRequest adds the databaseRequest to the put databases params
func (o *PutDatabasesParams) WithDatabaseRequest(databaseRequest *research_models.DatabaseRequest) *PutDatabasesParams {
o.SetDatabaseRequest(databaseRequest)
return o
}
// SetDatabaseRequest adds the databaseRequest to the put databases params
func (o *PutDatabasesParams) SetDatabaseRequest(databaseRequest *research_models.DatabaseRequest) {
o.DatabaseRequest = databaseRequest
}
// WriteToRequest writes these params to a swagger request
func (o *PutDatabasesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.DatabaseRequest != nil {
if err := r.SetBodyParam(o.DatabaseRequest); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,306 @@
// 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 databases
// 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"
)
// PutDatabasesReader is a Reader for the PutDatabases structure.
type PutDatabasesReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PutDatabasesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewPutDatabasesOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewPutDatabasesUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewPutDatabasesForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewPutDatabasesNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewPutDatabasesUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewPutDatabasesInternalServerError()
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())
}
}
// NewPutDatabasesOK creates a PutDatabasesOK with default headers values
func NewPutDatabasesOK() *PutDatabasesOK {
return &PutDatabasesOK{}
}
/* PutDatabasesOK describes a response with status code 200, with default header values.
Taxnexus Response with Database objects
*/
type PutDatabasesOK struct {
Payload *research_models.DatabaseResponse
}
func (o *PutDatabasesOK) Error() string {
return fmt.Sprintf("[PUT /databases][%d] putDatabasesOK %+v", 200, o.Payload)
}
func (o *PutDatabasesOK) GetPayload() *research_models.DatabaseResponse {
return o.Payload
}
func (o *PutDatabasesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(research_models.DatabaseResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPutDatabasesUnauthorized creates a PutDatabasesUnauthorized with default headers values
func NewPutDatabasesUnauthorized() *PutDatabasesUnauthorized {
return &PutDatabasesUnauthorized{}
}
/* PutDatabasesUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type PutDatabasesUnauthorized struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *PutDatabasesUnauthorized) Error() string {
return fmt.Sprintf("[PUT /databases][%d] putDatabasesUnauthorized %+v", 401, o.Payload)
}
func (o *PutDatabasesUnauthorized) GetPayload() *research_models.Error {
return o.Payload
}
func (o *PutDatabasesUnauthorized) 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
}
// NewPutDatabasesForbidden creates a PutDatabasesForbidden with default headers values
func NewPutDatabasesForbidden() *PutDatabasesForbidden {
return &PutDatabasesForbidden{}
}
/* PutDatabasesForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type PutDatabasesForbidden struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *PutDatabasesForbidden) Error() string {
return fmt.Sprintf("[PUT /databases][%d] putDatabasesForbidden %+v", 403, o.Payload)
}
func (o *PutDatabasesForbidden) GetPayload() *research_models.Error {
return o.Payload
}
func (o *PutDatabasesForbidden) 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
}
// NewPutDatabasesNotFound creates a PutDatabasesNotFound with default headers values
func NewPutDatabasesNotFound() *PutDatabasesNotFound {
return &PutDatabasesNotFound{}
}
/* PutDatabasesNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type PutDatabasesNotFound struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *PutDatabasesNotFound) Error() string {
return fmt.Sprintf("[PUT /databases][%d] putDatabasesNotFound %+v", 404, o.Payload)
}
func (o *PutDatabasesNotFound) GetPayload() *research_models.Error {
return o.Payload
}
func (o *PutDatabasesNotFound) 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
}
// NewPutDatabasesUnprocessableEntity creates a PutDatabasesUnprocessableEntity with default headers values
func NewPutDatabasesUnprocessableEntity() *PutDatabasesUnprocessableEntity {
return &PutDatabasesUnprocessableEntity{}
}
/* PutDatabasesUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type PutDatabasesUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *PutDatabasesUnprocessableEntity) Error() string {
return fmt.Sprintf("[PUT /databases][%d] putDatabasesUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PutDatabasesUnprocessableEntity) GetPayload() *research_models.Error {
return o.Payload
}
func (o *PutDatabasesUnprocessableEntity) 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
}
// NewPutDatabasesInternalServerError creates a PutDatabasesInternalServerError with default headers values
func NewPutDatabasesInternalServerError() *PutDatabasesInternalServerError {
return &PutDatabasesInternalServerError{}
}
/* PutDatabasesInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type PutDatabasesInternalServerError struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *PutDatabasesInternalServerError) Error() string {
return fmt.Sprintf("[PUT /databases][%d] putDatabasesInternalServerError %+v", 500, o.Payload)
}
func (o *PutDatabasesInternalServerError) GetPayload() *research_models.Error {
return o.Payload
}
func (o *PutDatabasesInternalServerError) 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,151 @@
// 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_client
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"github.com/go-openapi/runtime"
httptransport "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
"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/contacts"
"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/templates"
"code.tnxs.net/vernonkeenan/lib/api/research/research_client/tenants"
"code.tnxs.net/vernonkeenan/lib/api/research/research_client/users"
)
// Default research HTTP client.
var Default = NewHTTPClient(nil)
const (
// DefaultHost is the default Host
// found in Meta (info) section of spec file
DefaultHost string = "sf-gate.vernonkeenan.com:8080"
// DefaultBasePath is the default BasePath
// found in Meta (info) section of spec file
DefaultBasePath string = "/v1"
)
// DefaultSchemes are the default schemes found in Meta (info) section of spec file
var DefaultSchemes = []string{"http"}
// NewHTTPClient creates a new research HTTP client.
func NewHTTPClient(formats strfmt.Registry) *Research {
return NewHTTPClientWithConfig(formats, nil)
}
// NewHTTPClientWithConfig creates a new research HTTP client,
// using a customizable transport config.
func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Research {
// ensure nullable parameters have default
if cfg == nil {
cfg = DefaultTransportConfig()
}
// create transport and client
transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes)
return New(transport, formats)
}
// New creates a new research client
func New(transport runtime.ClientTransport, formats strfmt.Registry) *Research {
// ensure nullable parameters have default
if formats == nil {
formats = strfmt.Default
}
cli := new(Research)
cli.Transport = transport
cli.Accounts = accounts.New(transport, formats)
cli.Clusters = clusters.New(transport, formats)
cli.Contacts = contacts.New(transport, formats)
cli.Databases = databases.New(transport, formats)
cli.Roles = roles.New(transport, formats)
cli.Templates = templates.New(transport, formats)
cli.Tenants = tenants.New(transport, formats)
cli.Users = users.New(transport, formats)
return cli
}
// DefaultTransportConfig creates a TransportConfig with the
// default settings taken from the meta section of the spec file.
func DefaultTransportConfig() *TransportConfig {
return &TransportConfig{
Host: DefaultHost,
BasePath: DefaultBasePath,
Schemes: DefaultSchemes,
}
}
// TransportConfig contains the transport related info,
// found in the meta section of the spec file.
type TransportConfig struct {
Host string
BasePath string
Schemes []string
}
// WithHost overrides the default host,
// provided by the meta section of the spec file.
func (cfg *TransportConfig) WithHost(host string) *TransportConfig {
cfg.Host = host
return cfg
}
// WithBasePath overrides the default basePath,
// provided by the meta section of the spec file.
func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig {
cfg.BasePath = basePath
return cfg
}
// WithSchemes overrides the default schemes,
// provided by the meta section of the spec file.
func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig {
cfg.Schemes = schemes
return cfg
}
// Research is a client for research
type Research struct {
Accounts accounts.ClientService
Clusters clusters.ClientService
Contacts contacts.ClientService
Databases databases.ClientService
Roles roles.ClientService
Templates templates.ClientService
Tenants tenants.ClientService
Users users.ClientService
Transport runtime.ClientTransport
}
// SetTransport changes the transport on the client and all its subresources
func (c *Research) SetTransport(transport runtime.ClientTransport) {
c.Transport = transport
c.Accounts.SetTransport(transport)
c.Clusters.SetTransport(transport)
c.Contacts.SetTransport(transport)
c.Databases.SetTransport(transport)
c.Roles.SetTransport(transport)
c.Templates.SetTransport(transport)
c.Tenants.SetTransport(transport)
c.Users.SetTransport(transport)
}

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 roles
// 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"
)
// NewGetRolesParams creates a new GetRolesParams 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 NewGetRolesParams() *GetRolesParams {
return &GetRolesParams{
timeout: cr.DefaultTimeout,
}
}
// NewGetRolesParamsWithTimeout creates a new GetRolesParams object
// with the ability to set a timeout on a request.
func NewGetRolesParamsWithTimeout(timeout time.Duration) *GetRolesParams {
return &GetRolesParams{
timeout: timeout,
}
}
// NewGetRolesParamsWithContext creates a new GetRolesParams object
// with the ability to set a context for a request.
func NewGetRolesParamsWithContext(ctx context.Context) *GetRolesParams {
return &GetRolesParams{
Context: ctx,
}
}
// NewGetRolesParamsWithHTTPClient creates a new GetRolesParams object
// with the ability to set a custom HTTPClient for a request.
func NewGetRolesParamsWithHTTPClient(client *http.Client) *GetRolesParams {
return &GetRolesParams{
HTTPClient: client,
}
}
/* GetRolesParams contains all the parameters to send to the API endpoint
for the get roles operation.
Typically these are written to a http.Request.
*/
type GetRolesParams struct {
/* Limit.
How many objects to return at one time
Format: int64
*/
Limit *int64
/* Offset.
How many objects to skip?
Format: int64
*/
Offset *int64
/* RoleID.
Taxnexus Id of the Role to be retrieved
*/
RoleID *string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the get roles params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetRolesParams) WithDefaults() *GetRolesParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the get roles params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetRolesParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the get roles params
func (o *GetRolesParams) WithTimeout(timeout time.Duration) *GetRolesParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the get roles params
func (o *GetRolesParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the get roles params
func (o *GetRolesParams) WithContext(ctx context.Context) *GetRolesParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get roles params
func (o *GetRolesParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the get roles params
func (o *GetRolesParams) WithHTTPClient(client *http.Client) *GetRolesParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the get roles params
func (o *GetRolesParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithLimit adds the limit to the get roles params
func (o *GetRolesParams) WithLimit(limit *int64) *GetRolesParams {
o.SetLimit(limit)
return o
}
// SetLimit adds the limit to the get roles params
func (o *GetRolesParams) SetLimit(limit *int64) {
o.Limit = limit
}
// WithOffset adds the offset to the get roles params
func (o *GetRolesParams) WithOffset(offset *int64) *GetRolesParams {
o.SetOffset(offset)
return o
}
// SetOffset adds the offset to the get roles params
func (o *GetRolesParams) SetOffset(offset *int64) {
o.Offset = offset
}
// WithRoleID adds the roleID to the get roles params
func (o *GetRolesParams) WithRoleID(roleID *string) *GetRolesParams {
o.SetRoleID(roleID)
return o
}
// SetRoleID adds the roleId to the get roles params
func (o *GetRolesParams) SetRoleID(roleID *string) {
o.RoleID = roleID
}
// WriteToRequest writes these params to a swagger request
func (o *GetRolesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
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 o.RoleID != nil {
// query param roleId
var qrRoleID string
if o.RoleID != nil {
qrRoleID = *o.RoleID
}
qRoleID := qrRoleID
if qRoleID != "" {
if err := r.SetQueryParam("roleId", qRoleID); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,306 @@
// 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 roles
// 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"
)
// GetRolesReader is a Reader for the GetRoles structure.
type GetRolesReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetRolesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetRolesOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewGetRolesUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewGetRolesForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewGetRolesNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewGetRolesUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewGetRolesInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
}
}
// NewGetRolesOK creates a GetRolesOK with default headers values
func NewGetRolesOK() *GetRolesOK {
return &GetRolesOK{}
}
/* GetRolesOK describes a response with status code 200, with default header values.
Taxnexus Response with Role objects
*/
type GetRolesOK struct {
Payload *research_models.RoleResponse
}
func (o *GetRolesOK) Error() string {
return fmt.Sprintf("[GET /roles][%d] getRolesOK %+v", 200, o.Payload)
}
func (o *GetRolesOK) GetPayload() *research_models.RoleResponse {
return o.Payload
}
func (o *GetRolesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(research_models.RoleResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetRolesUnauthorized creates a GetRolesUnauthorized with default headers values
func NewGetRolesUnauthorized() *GetRolesUnauthorized {
return &GetRolesUnauthorized{}
}
/* GetRolesUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type GetRolesUnauthorized struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *GetRolesUnauthorized) Error() string {
return fmt.Sprintf("[GET /roles][%d] getRolesUnauthorized %+v", 401, o.Payload)
}
func (o *GetRolesUnauthorized) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetRolesUnauthorized) 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
}
// NewGetRolesForbidden creates a GetRolesForbidden with default headers values
func NewGetRolesForbidden() *GetRolesForbidden {
return &GetRolesForbidden{}
}
/* GetRolesForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type GetRolesForbidden struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *GetRolesForbidden) Error() string {
return fmt.Sprintf("[GET /roles][%d] getRolesForbidden %+v", 403, o.Payload)
}
func (o *GetRolesForbidden) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetRolesForbidden) 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
}
// NewGetRolesNotFound creates a GetRolesNotFound with default headers values
func NewGetRolesNotFound() *GetRolesNotFound {
return &GetRolesNotFound{}
}
/* GetRolesNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type GetRolesNotFound struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *GetRolesNotFound) Error() string {
return fmt.Sprintf("[GET /roles][%d] getRolesNotFound %+v", 404, o.Payload)
}
func (o *GetRolesNotFound) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetRolesNotFound) 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
}
// NewGetRolesUnprocessableEntity creates a GetRolesUnprocessableEntity with default headers values
func NewGetRolesUnprocessableEntity() *GetRolesUnprocessableEntity {
return &GetRolesUnprocessableEntity{}
}
/* GetRolesUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type GetRolesUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *GetRolesUnprocessableEntity) Error() string {
return fmt.Sprintf("[GET /roles][%d] getRolesUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetRolesUnprocessableEntity) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetRolesUnprocessableEntity) 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
}
// NewGetRolesInternalServerError creates a GetRolesInternalServerError with default headers values
func NewGetRolesInternalServerError() *GetRolesInternalServerError {
return &GetRolesInternalServerError{}
}
/* GetRolesInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type GetRolesInternalServerError struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *GetRolesInternalServerError) Error() string {
return fmt.Sprintf("[GET /roles][%d] getRolesInternalServerError %+v", 500, o.Payload)
}
func (o *GetRolesInternalServerError) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetRolesInternalServerError) 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

@ -4,7 +4,7 @@
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package products
package roles
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
@ -16,13 +16,13 @@ import (
"github.com/go-openapi/strfmt"
)
// New creates a new products API client.
// New creates a new roles API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
return &Client{transport: transport, formats: formats}
}
/*
Client for products API
Client for roles API
*/
type Client struct {
transport runtime.ClientTransport
@ -34,30 +34,30 @@ type ClientOption func(*runtime.ClientOperation)
// ClientService is the interface for Client methods
type ClientService interface {
GetProducts(params *GetProductsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetProductsOK, error)
GetRoles(params *GetRolesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetRolesOK, error)
SetTransport(transport runtime.ClientTransport)
}
/*
GetProducts gets a list of products
GetRoles gets a list of roles
Return a list of all available Products
Return a list of Roles
*/
func (a *Client) GetProducts(params *GetProductsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetProductsOK, error) {
func (a *Client) GetRoles(params *GetRolesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetRolesOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetProductsParams()
params = NewGetRolesParams()
}
op := &runtime.ClientOperation{
ID: "getProducts",
ID: "getRoles",
Method: "GET",
PathPattern: "/products",
PathPattern: "/roles",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &GetProductsReader{formats: a.formats},
Reader: &GetRolesReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
@ -70,13 +70,13 @@ func (a *Client) GetProducts(params *GetProductsParams, authInfo runtime.ClientA
if err != nil {
return nil, err
}
success, ok := result.(*GetProductsOK)
success, ok := result.(*GetRolesOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for getProducts: API contract not enforced by server. Client expected to get an error, but got: %T", result)
msg := fmt.Sprintf("unexpected success response for getRoles: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}

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 templates
// 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"
)
// NewGetTemplatesParams creates a new GetTemplatesParams 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 NewGetTemplatesParams() *GetTemplatesParams {
return &GetTemplatesParams{
timeout: cr.DefaultTimeout,
}
}
// NewGetTemplatesParamsWithTimeout creates a new GetTemplatesParams object
// with the ability to set a timeout on a request.
func NewGetTemplatesParamsWithTimeout(timeout time.Duration) *GetTemplatesParams {
return &GetTemplatesParams{
timeout: timeout,
}
}
// NewGetTemplatesParamsWithContext creates a new GetTemplatesParams object
// with the ability to set a context for a request.
func NewGetTemplatesParamsWithContext(ctx context.Context) *GetTemplatesParams {
return &GetTemplatesParams{
Context: ctx,
}
}
// NewGetTemplatesParamsWithHTTPClient creates a new GetTemplatesParams object
// with the ability to set a custom HTTPClient for a request.
func NewGetTemplatesParamsWithHTTPClient(client *http.Client) *GetTemplatesParams {
return &GetTemplatesParams{
HTTPClient: client,
}
}
/* GetTemplatesParams contains all the parameters to send to the API endpoint
for the get templates operation.
Typically these are written to a http.Request.
*/
type GetTemplatesParams struct {
/* Limit.
How many objects to return at one time
Format: int64
*/
Limit *int64
/* Offset.
How many objects to skip?
Format: int64
*/
Offset *int64
/* TemplateID.
Taxnexus Record Id of a Template
*/
TemplateID *string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the get templates params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetTemplatesParams) WithDefaults() *GetTemplatesParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the get templates params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetTemplatesParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the get templates params
func (o *GetTemplatesParams) WithTimeout(timeout time.Duration) *GetTemplatesParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the get templates params
func (o *GetTemplatesParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the get templates params
func (o *GetTemplatesParams) WithContext(ctx context.Context) *GetTemplatesParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get templates params
func (o *GetTemplatesParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the get templates params
func (o *GetTemplatesParams) WithHTTPClient(client *http.Client) *GetTemplatesParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the get templates params
func (o *GetTemplatesParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithLimit adds the limit to the get templates params
func (o *GetTemplatesParams) WithLimit(limit *int64) *GetTemplatesParams {
o.SetLimit(limit)
return o
}
// SetLimit adds the limit to the get templates params
func (o *GetTemplatesParams) SetLimit(limit *int64) {
o.Limit = limit
}
// WithOffset adds the offset to the get templates params
func (o *GetTemplatesParams) WithOffset(offset *int64) *GetTemplatesParams {
o.SetOffset(offset)
return o
}
// SetOffset adds the offset to the get templates params
func (o *GetTemplatesParams) SetOffset(offset *int64) {
o.Offset = offset
}
// WithTemplateID adds the templateID to the get templates params
func (o *GetTemplatesParams) WithTemplateID(templateID *string) *GetTemplatesParams {
o.SetTemplateID(templateID)
return o
}
// SetTemplateID adds the templateId to the get templates params
func (o *GetTemplatesParams) SetTemplateID(templateID *string) {
o.TemplateID = templateID
}
// WriteToRequest writes these params to a swagger request
func (o *GetTemplatesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
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 o.TemplateID != nil {
// query param templateId
var qrTemplateID string
if o.TemplateID != nil {
qrTemplateID = *o.TemplateID
}
qTemplateID := qrTemplateID
if qTemplateID != "" {
if err := r.SetQueryParam("templateId", qTemplateID); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,306 @@
// 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 templates
// 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"
)
// GetTemplatesReader is a Reader for the GetTemplates structure.
type GetTemplatesReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetTemplatesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetTemplatesOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewGetTemplatesUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewGetTemplatesForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewGetTemplatesNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewGetTemplatesUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewGetTemplatesInternalServerError()
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())
}
}
// NewGetTemplatesOK creates a GetTemplatesOK with default headers values
func NewGetTemplatesOK() *GetTemplatesOK {
return &GetTemplatesOK{}
}
/* GetTemplatesOK describes a response with status code 200, with default header values.
Taxnexus Response with Template objects
*/
type GetTemplatesOK struct {
Payload *research_models.TemplateResponse
}
func (o *GetTemplatesOK) Error() string {
return fmt.Sprintf("[GET /templates][%d] getTemplatesOK %+v", 200, o.Payload)
}
func (o *GetTemplatesOK) GetPayload() *research_models.TemplateResponse {
return o.Payload
}
func (o *GetTemplatesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(research_models.TemplateResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetTemplatesUnauthorized creates a GetTemplatesUnauthorized with default headers values
func NewGetTemplatesUnauthorized() *GetTemplatesUnauthorized {
return &GetTemplatesUnauthorized{}
}
/* GetTemplatesUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type GetTemplatesUnauthorized struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *GetTemplatesUnauthorized) Error() string {
return fmt.Sprintf("[GET /templates][%d] getTemplatesUnauthorized %+v", 401, o.Payload)
}
func (o *GetTemplatesUnauthorized) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetTemplatesUnauthorized) 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
}
// NewGetTemplatesForbidden creates a GetTemplatesForbidden with default headers values
func NewGetTemplatesForbidden() *GetTemplatesForbidden {
return &GetTemplatesForbidden{}
}
/* GetTemplatesForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type GetTemplatesForbidden struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *GetTemplatesForbidden) Error() string {
return fmt.Sprintf("[GET /templates][%d] getTemplatesForbidden %+v", 403, o.Payload)
}
func (o *GetTemplatesForbidden) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetTemplatesForbidden) 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
}
// NewGetTemplatesNotFound creates a GetTemplatesNotFound with default headers values
func NewGetTemplatesNotFound() *GetTemplatesNotFound {
return &GetTemplatesNotFound{}
}
/* GetTemplatesNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type GetTemplatesNotFound struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *GetTemplatesNotFound) Error() string {
return fmt.Sprintf("[GET /templates][%d] getTemplatesNotFound %+v", 404, o.Payload)
}
func (o *GetTemplatesNotFound) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetTemplatesNotFound) 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
}
// NewGetTemplatesUnprocessableEntity creates a GetTemplatesUnprocessableEntity with default headers values
func NewGetTemplatesUnprocessableEntity() *GetTemplatesUnprocessableEntity {
return &GetTemplatesUnprocessableEntity{}
}
/* GetTemplatesUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type GetTemplatesUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *GetTemplatesUnprocessableEntity) Error() string {
return fmt.Sprintf("[GET /templates][%d] getTemplatesUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetTemplatesUnprocessableEntity) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetTemplatesUnprocessableEntity) 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
}
// NewGetTemplatesInternalServerError creates a GetTemplatesInternalServerError with default headers values
func NewGetTemplatesInternalServerError() *GetTemplatesInternalServerError {
return &GetTemplatesInternalServerError{}
}
/* GetTemplatesInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type GetTemplatesInternalServerError struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *GetTemplatesInternalServerError) Error() string {
return fmt.Sprintf("[GET /templates][%d] getTemplatesInternalServerError %+v", 500, o.Payload)
}
func (o *GetTemplatesInternalServerError) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetTemplatesInternalServerError) 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

@ -4,7 +4,7 @@
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package companies
package templates
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
@ -16,13 +16,13 @@ import (
"github.com/go-openapi/strfmt"
)
// New creates a new companies API client.
// New creates a new templates API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
return &Client{transport: transport, formats: formats}
}
/*
Client for companies API
Client for templates API
*/
type Client struct {
transport runtime.ClientTransport
@ -34,30 +34,30 @@ type ClientOption func(*runtime.ClientOperation)
// ClientService is the interface for Client methods
type ClientService interface {
GetCompanies(params *GetCompaniesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCompaniesOK, error)
GetTemplates(params *GetTemplatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTemplatesOK, error)
SetTransport(transport runtime.ClientTransport)
}
/*
GetCompanies gets a company record
GetTemplates gets p d f rendering templates
Retrieve a Company record from the datastore
Returns the PDF rendering template, or a link to where to get the template
*/
func (a *Client) GetCompanies(params *GetCompaniesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCompaniesOK, error) {
func (a *Client) GetTemplates(params *GetTemplatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTemplatesOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetCompaniesParams()
params = NewGetTemplatesParams()
}
op := &runtime.ClientOperation{
ID: "getCompanies",
ID: "getTemplates",
Method: "GET",
PathPattern: "/companies",
PathPattern: "/templates",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &GetCompaniesReader{formats: a.formats},
Reader: &GetTemplatesReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
@ -70,13 +70,13 @@ func (a *Client) GetCompanies(params *GetCompaniesParams, authInfo runtime.Clien
if err != nil {
return nil, err
}
success, ok := result.(*GetCompaniesOK)
success, ok := result.(*GetTemplatesOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for getCompanies: API contract not enforced by server. Client expected to get an error, but got: %T", result)
msg := fmt.Sprintf("unexpected success response for getTemplates: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}

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 tenants
// 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"
)
// NewGetTenantsParams creates a new GetTenantsParams 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 NewGetTenantsParams() *GetTenantsParams {
return &GetTenantsParams{
timeout: cr.DefaultTimeout,
}
}
// NewGetTenantsParamsWithTimeout creates a new GetTenantsParams object
// with the ability to set a timeout on a request.
func NewGetTenantsParamsWithTimeout(timeout time.Duration) *GetTenantsParams {
return &GetTenantsParams{
timeout: timeout,
}
}
// NewGetTenantsParamsWithContext creates a new GetTenantsParams object
// with the ability to set a context for a request.
func NewGetTenantsParamsWithContext(ctx context.Context) *GetTenantsParams {
return &GetTenantsParams{
Context: ctx,
}
}
// NewGetTenantsParamsWithHTTPClient creates a new GetTenantsParams object
// with the ability to set a custom HTTPClient for a request.
func NewGetTenantsParamsWithHTTPClient(client *http.Client) *GetTenantsParams {
return &GetTenantsParams{
HTTPClient: client,
}
}
/* GetTenantsParams contains all the parameters to send to the API endpoint
for the get tenants operation.
Typically these are written to a http.Request.
*/
type GetTenantsParams struct {
/* Limit.
How many objects to return at one time
Format: int64
*/
Limit *int64
/* Offset.
How many objects to skip?
Format: int64
*/
Offset *int64
/* TenantID.
Taxnexus Record Id of a Tenant
*/
TenantID *string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the get tenants params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetTenantsParams) WithDefaults() *GetTenantsParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the get tenants params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetTenantsParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the get tenants params
func (o *GetTenantsParams) WithTimeout(timeout time.Duration) *GetTenantsParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the get tenants params
func (o *GetTenantsParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the get tenants params
func (o *GetTenantsParams) WithContext(ctx context.Context) *GetTenantsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get tenants params
func (o *GetTenantsParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the get tenants params
func (o *GetTenantsParams) WithHTTPClient(client *http.Client) *GetTenantsParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the get tenants params
func (o *GetTenantsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithLimit adds the limit to the get tenants params
func (o *GetTenantsParams) WithLimit(limit *int64) *GetTenantsParams {
o.SetLimit(limit)
return o
}
// SetLimit adds the limit to the get tenants params
func (o *GetTenantsParams) SetLimit(limit *int64) {
o.Limit = limit
}
// WithOffset adds the offset to the get tenants params
func (o *GetTenantsParams) WithOffset(offset *int64) *GetTenantsParams {
o.SetOffset(offset)
return o
}
// SetOffset adds the offset to the get tenants params
func (o *GetTenantsParams) SetOffset(offset *int64) {
o.Offset = offset
}
// WithTenantID adds the tenantID to the get tenants params
func (o *GetTenantsParams) WithTenantID(tenantID *string) *GetTenantsParams {
o.SetTenantID(tenantID)
return o
}
// SetTenantID adds the tenantId to the get tenants params
func (o *GetTenantsParams) SetTenantID(tenantID *string) {
o.TenantID = tenantID
}
// WriteToRequest writes these params to a swagger request
func (o *GetTenantsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
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 o.TenantID != nil {
// query param tenantId
var qrTenantID string
if o.TenantID != nil {
qrTenantID = *o.TenantID
}
qTenantID := qrTenantID
if qTenantID != "" {
if err := r.SetQueryParam("tenantId", qTenantID); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,306 @@
// 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 tenants
// 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"
)
// GetTenantsReader is a Reader for the GetTenants structure.
type GetTenantsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetTenantsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetTenantsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewGetTenantsUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewGetTenantsForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewGetTenantsNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewGetTenantsUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewGetTenantsInternalServerError()
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())
}
}
// NewGetTenantsOK creates a GetTenantsOK with default headers values
func NewGetTenantsOK() *GetTenantsOK {
return &GetTenantsOK{}
}
/* GetTenantsOK describes a response with status code 200, with default header values.
Taxnexus Response with Tenant objects
*/
type GetTenantsOK struct {
Payload *research_models.TenantResponse
}
func (o *GetTenantsOK) Error() string {
return fmt.Sprintf("[GET /tenants][%d] getTenantsOK %+v", 200, o.Payload)
}
func (o *GetTenantsOK) GetPayload() *research_models.TenantResponse {
return o.Payload
}
func (o *GetTenantsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(research_models.TenantResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetTenantsUnauthorized creates a GetTenantsUnauthorized with default headers values
func NewGetTenantsUnauthorized() *GetTenantsUnauthorized {
return &GetTenantsUnauthorized{}
}
/* GetTenantsUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type GetTenantsUnauthorized struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *GetTenantsUnauthorized) Error() string {
return fmt.Sprintf("[GET /tenants][%d] getTenantsUnauthorized %+v", 401, o.Payload)
}
func (o *GetTenantsUnauthorized) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetTenantsUnauthorized) 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
}
// NewGetTenantsForbidden creates a GetTenantsForbidden with default headers values
func NewGetTenantsForbidden() *GetTenantsForbidden {
return &GetTenantsForbidden{}
}
/* GetTenantsForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type GetTenantsForbidden struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *GetTenantsForbidden) Error() string {
return fmt.Sprintf("[GET /tenants][%d] getTenantsForbidden %+v", 403, o.Payload)
}
func (o *GetTenantsForbidden) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetTenantsForbidden) 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
}
// NewGetTenantsNotFound creates a GetTenantsNotFound with default headers values
func NewGetTenantsNotFound() *GetTenantsNotFound {
return &GetTenantsNotFound{}
}
/* GetTenantsNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type GetTenantsNotFound struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *GetTenantsNotFound) Error() string {
return fmt.Sprintf("[GET /tenants][%d] getTenantsNotFound %+v", 404, o.Payload)
}
func (o *GetTenantsNotFound) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetTenantsNotFound) 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
}
// NewGetTenantsUnprocessableEntity creates a GetTenantsUnprocessableEntity with default headers values
func NewGetTenantsUnprocessableEntity() *GetTenantsUnprocessableEntity {
return &GetTenantsUnprocessableEntity{}
}
/* GetTenantsUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type GetTenantsUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *GetTenantsUnprocessableEntity) Error() string {
return fmt.Sprintf("[GET /tenants][%d] getTenantsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetTenantsUnprocessableEntity) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetTenantsUnprocessableEntity) 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
}
// NewGetTenantsInternalServerError creates a GetTenantsInternalServerError with default headers values
func NewGetTenantsInternalServerError() *GetTenantsInternalServerError {
return &GetTenantsInternalServerError{}
}
/* GetTenantsInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type GetTenantsInternalServerError struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *GetTenantsInternalServerError) Error() string {
return fmt.Sprintf("[GET /tenants][%d] getTenantsInternalServerError %+v", 500, o.Payload)
}
func (o *GetTenantsInternalServerError) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetTenantsInternalServerError) 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 tenants
// 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"
)
// NewPutTenantsParams creates a new PutTenantsParams 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 NewPutTenantsParams() *PutTenantsParams {
return &PutTenantsParams{
timeout: cr.DefaultTimeout,
}
}
// NewPutTenantsParamsWithTimeout creates a new PutTenantsParams object
// with the ability to set a timeout on a request.
func NewPutTenantsParamsWithTimeout(timeout time.Duration) *PutTenantsParams {
return &PutTenantsParams{
timeout: timeout,
}
}
// NewPutTenantsParamsWithContext creates a new PutTenantsParams object
// with the ability to set a context for a request.
func NewPutTenantsParamsWithContext(ctx context.Context) *PutTenantsParams {
return &PutTenantsParams{
Context: ctx,
}
}
// NewPutTenantsParamsWithHTTPClient creates a new PutTenantsParams object
// with the ability to set a custom HTTPClient for a request.
func NewPutTenantsParamsWithHTTPClient(client *http.Client) *PutTenantsParams {
return &PutTenantsParams{
HTTPClient: client,
}
}
/* PutTenantsParams contains all the parameters to send to the API endpoint
for the put tenants operation.
Typically these are written to a http.Request.
*/
type PutTenantsParams struct {
/* CTenantRequest.
An array of Tenant records
*/
CTenantRequest *research_models.TenantRequest
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the put tenants params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PutTenantsParams) WithDefaults() *PutTenantsParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the put tenants params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PutTenantsParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the put tenants params
func (o *PutTenantsParams) WithTimeout(timeout time.Duration) *PutTenantsParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the put tenants params
func (o *PutTenantsParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the put tenants params
func (o *PutTenantsParams) WithContext(ctx context.Context) *PutTenantsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the put tenants params
func (o *PutTenantsParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the put tenants params
func (o *PutTenantsParams) WithHTTPClient(client *http.Client) *PutTenantsParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the put tenants params
func (o *PutTenantsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithCTenantRequest adds the cTenantRequest to the put tenants params
func (o *PutTenantsParams) WithCTenantRequest(cTenantRequest *research_models.TenantRequest) *PutTenantsParams {
o.SetCTenantRequest(cTenantRequest)
return o
}
// SetCTenantRequest adds the cTenantRequest to the put tenants params
func (o *PutTenantsParams) SetCTenantRequest(cTenantRequest *research_models.TenantRequest) {
o.CTenantRequest = cTenantRequest
}
// WriteToRequest writes these params to a swagger request
func (o *PutTenantsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.CTenantRequest != nil {
if err := r.SetBodyParam(o.CTenantRequest); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,306 @@
// 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 tenants
// 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"
)
// PutTenantsReader is a Reader for the PutTenants structure.
type PutTenantsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PutTenantsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewPutTenantsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewPutTenantsUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewPutTenantsForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewPutTenantsNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewPutTenantsUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewPutTenantsInternalServerError()
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())
}
}
// NewPutTenantsOK creates a PutTenantsOK with default headers values
func NewPutTenantsOK() *PutTenantsOK {
return &PutTenantsOK{}
}
/* PutTenantsOK describes a response with status code 200, with default header values.
Taxnexus Response with Tenant objects
*/
type PutTenantsOK struct {
Payload *research_models.TenantResponse
}
func (o *PutTenantsOK) Error() string {
return fmt.Sprintf("[PUT /tenants][%d] putTenantsOK %+v", 200, o.Payload)
}
func (o *PutTenantsOK) GetPayload() *research_models.TenantResponse {
return o.Payload
}
func (o *PutTenantsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(research_models.TenantResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPutTenantsUnauthorized creates a PutTenantsUnauthorized with default headers values
func NewPutTenantsUnauthorized() *PutTenantsUnauthorized {
return &PutTenantsUnauthorized{}
}
/* PutTenantsUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type PutTenantsUnauthorized struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *PutTenantsUnauthorized) Error() string {
return fmt.Sprintf("[PUT /tenants][%d] putTenantsUnauthorized %+v", 401, o.Payload)
}
func (o *PutTenantsUnauthorized) GetPayload() *research_models.Error {
return o.Payload
}
func (o *PutTenantsUnauthorized) 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
}
// NewPutTenantsForbidden creates a PutTenantsForbidden with default headers values
func NewPutTenantsForbidden() *PutTenantsForbidden {
return &PutTenantsForbidden{}
}
/* PutTenantsForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type PutTenantsForbidden struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *PutTenantsForbidden) Error() string {
return fmt.Sprintf("[PUT /tenants][%d] putTenantsForbidden %+v", 403, o.Payload)
}
func (o *PutTenantsForbidden) GetPayload() *research_models.Error {
return o.Payload
}
func (o *PutTenantsForbidden) 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
}
// NewPutTenantsNotFound creates a PutTenantsNotFound with default headers values
func NewPutTenantsNotFound() *PutTenantsNotFound {
return &PutTenantsNotFound{}
}
/* PutTenantsNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type PutTenantsNotFound struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *PutTenantsNotFound) Error() string {
return fmt.Sprintf("[PUT /tenants][%d] putTenantsNotFound %+v", 404, o.Payload)
}
func (o *PutTenantsNotFound) GetPayload() *research_models.Error {
return o.Payload
}
func (o *PutTenantsNotFound) 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
}
// NewPutTenantsUnprocessableEntity creates a PutTenantsUnprocessableEntity with default headers values
func NewPutTenantsUnprocessableEntity() *PutTenantsUnprocessableEntity {
return &PutTenantsUnprocessableEntity{}
}
/* PutTenantsUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type PutTenantsUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *PutTenantsUnprocessableEntity) Error() string {
return fmt.Sprintf("[PUT /tenants][%d] putTenantsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PutTenantsUnprocessableEntity) GetPayload() *research_models.Error {
return o.Payload
}
func (o *PutTenantsUnprocessableEntity) 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
}
// NewPutTenantsInternalServerError creates a PutTenantsInternalServerError with default headers values
func NewPutTenantsInternalServerError() *PutTenantsInternalServerError {
return &PutTenantsInternalServerError{}
}
/* PutTenantsInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type PutTenantsInternalServerError struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *PutTenantsInternalServerError) Error() string {
return fmt.Sprintf("[PUT /tenants][%d] putTenantsInternalServerError %+v", 500, o.Payload)
}
func (o *PutTenantsInternalServerError) GetPayload() *research_models.Error {
return o.Payload
}
func (o *PutTenantsInternalServerError) 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,171 @@
// 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 tenants
// 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 tenants API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
return &Client{transport: transport, formats: formats}
}
/*
Client for tenants 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 {
Tenants(params *TenantsParams, opts ...ClientOption) (*TenantsOK, error)
GetTenants(params *GetTenantsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTenantsOK, error)
PutTenants(params *PutTenantsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutTenantsOK, error)
SetTransport(transport runtime.ClientTransport)
}
/*
Tenants creates new tenants
Create Tenants in Taxnexus
*/
func (a *Client) Tenants(params *TenantsParams, opts ...ClientOption) (*TenantsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewTenantsParams()
}
op := &runtime.ClientOperation{
ID: "Tenants",
Method: "POST",
PathPattern: "/tenants",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &TenantsReader{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.(*TenantsOK)
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 Tenants: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
GetTenants gets a list tenants
Return a list of Tenant records from the datastore
*/
func (a *Client) GetTenants(params *GetTenantsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTenantsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetTenantsParams()
}
op := &runtime.ClientOperation{
ID: "getTenants",
Method: "GET",
PathPattern: "/tenants",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &GetTenantsReader{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.(*GetTenantsOK)
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 getTenants: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
PutTenants updates tenants
Update Tenant in Taxnexus
*/
func (a *Client) PutTenants(params *PutTenantsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutTenantsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPutTenantsParams()
}
op := &runtime.ClientOperation{
ID: "putTenants",
Method: "PUT",
PathPattern: "/tenants",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PutTenantsReader{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.(*PutTenantsOK)
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 putTenants: 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,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 tenants
// 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"
)
// NewTenantsParams creates a new TenantsParams 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 NewTenantsParams() *TenantsParams {
return &TenantsParams{
timeout: cr.DefaultTimeout,
}
}
// NewTenantsParamsWithTimeout creates a new TenantsParams object
// with the ability to set a timeout on a request.
func NewTenantsParamsWithTimeout(timeout time.Duration) *TenantsParams {
return &TenantsParams{
timeout: timeout,
}
}
// NewTenantsParamsWithContext creates a new TenantsParams object
// with the ability to set a context for a request.
func NewTenantsParamsWithContext(ctx context.Context) *TenantsParams {
return &TenantsParams{
Context: ctx,
}
}
// NewTenantsParamsWithHTTPClient creates a new TenantsParams object
// with the ability to set a custom HTTPClient for a request.
func NewTenantsParamsWithHTTPClient(client *http.Client) *TenantsParams {
return &TenantsParams{
HTTPClient: client,
}
}
/* TenantsParams contains all the parameters to send to the API endpoint
for the tenants operation.
Typically these are written to a http.Request.
*/
type TenantsParams struct {
/* CTenantRequest.
An array of Tenant records
*/
CTenantRequest *research_models.TenantRequest
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the tenants params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *TenantsParams) WithDefaults() *TenantsParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the tenants params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *TenantsParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the tenants params
func (o *TenantsParams) WithTimeout(timeout time.Duration) *TenantsParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the tenants params
func (o *TenantsParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the tenants params
func (o *TenantsParams) WithContext(ctx context.Context) *TenantsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the tenants params
func (o *TenantsParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the tenants params
func (o *TenantsParams) WithHTTPClient(client *http.Client) *TenantsParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the tenants params
func (o *TenantsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithCTenantRequest adds the cTenantRequest to the tenants params
func (o *TenantsParams) WithCTenantRequest(cTenantRequest *research_models.TenantRequest) *TenantsParams {
o.SetCTenantRequest(cTenantRequest)
return o
}
// SetCTenantRequest adds the cTenantRequest to the tenants params
func (o *TenantsParams) SetCTenantRequest(cTenantRequest *research_models.TenantRequest) {
o.CTenantRequest = cTenantRequest
}
// WriteToRequest writes these params to a swagger request
func (o *TenantsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.CTenantRequest != nil {
if err := r.SetBodyParam(o.CTenantRequest); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,306 @@
// 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 tenants
// 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"
)
// TenantsReader is a Reader for the Tenants structure.
type TenantsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *TenantsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewTenantsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewTenantsUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewTenantsForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewTenantsNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewTenantsUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewTenantsInternalServerError()
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())
}
}
// NewTenantsOK creates a TenantsOK with default headers values
func NewTenantsOK() *TenantsOK {
return &TenantsOK{}
}
/* TenantsOK describes a response with status code 200, with default header values.
Taxnexus Response with Tenant objects
*/
type TenantsOK struct {
Payload *research_models.TenantResponse
}
func (o *TenantsOK) Error() string {
return fmt.Sprintf("[POST /tenants][%d] tenantsOK %+v", 200, o.Payload)
}
func (o *TenantsOK) GetPayload() *research_models.TenantResponse {
return o.Payload
}
func (o *TenantsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(research_models.TenantResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewTenantsUnauthorized creates a TenantsUnauthorized with default headers values
func NewTenantsUnauthorized() *TenantsUnauthorized {
return &TenantsUnauthorized{}
}
/* TenantsUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type TenantsUnauthorized struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *TenantsUnauthorized) Error() string {
return fmt.Sprintf("[POST /tenants][%d] tenantsUnauthorized %+v", 401, o.Payload)
}
func (o *TenantsUnauthorized) GetPayload() *research_models.Error {
return o.Payload
}
func (o *TenantsUnauthorized) 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
}
// NewTenantsForbidden creates a TenantsForbidden with default headers values
func NewTenantsForbidden() *TenantsForbidden {
return &TenantsForbidden{}
}
/* TenantsForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type TenantsForbidden struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *TenantsForbidden) Error() string {
return fmt.Sprintf("[POST /tenants][%d] tenantsForbidden %+v", 403, o.Payload)
}
func (o *TenantsForbidden) GetPayload() *research_models.Error {
return o.Payload
}
func (o *TenantsForbidden) 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
}
// NewTenantsNotFound creates a TenantsNotFound with default headers values
func NewTenantsNotFound() *TenantsNotFound {
return &TenantsNotFound{}
}
/* TenantsNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type TenantsNotFound struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *TenantsNotFound) Error() string {
return fmt.Sprintf("[POST /tenants][%d] tenantsNotFound %+v", 404, o.Payload)
}
func (o *TenantsNotFound) GetPayload() *research_models.Error {
return o.Payload
}
func (o *TenantsNotFound) 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
}
// NewTenantsUnprocessableEntity creates a TenantsUnprocessableEntity with default headers values
func NewTenantsUnprocessableEntity() *TenantsUnprocessableEntity {
return &TenantsUnprocessableEntity{}
}
/* TenantsUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type TenantsUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *TenantsUnprocessableEntity) Error() string {
return fmt.Sprintf("[POST /tenants][%d] tenantsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *TenantsUnprocessableEntity) GetPayload() *research_models.Error {
return o.Payload
}
func (o *TenantsUnprocessableEntity) 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
}
// NewTenantsInternalServerError creates a TenantsInternalServerError with default headers values
func NewTenantsInternalServerError() *TenantsInternalServerError {
return &TenantsInternalServerError{}
}
/* TenantsInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type TenantsInternalServerError struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *TenantsInternalServerError) Error() string {
return fmt.Sprintf("[POST /tenants][%d] tenantsInternalServerError %+v", 500, o.Payload)
}
func (o *TenantsInternalServerError) GetPayload() *research_models.Error {
return o.Payload
}
func (o *TenantsInternalServerError) 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,306 @@
// 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 users
// 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"
)
// NewGetUsersParams creates a new GetUsersParams 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 NewGetUsersParams() *GetUsersParams {
return &GetUsersParams{
timeout: cr.DefaultTimeout,
}
}
// NewGetUsersParamsWithTimeout creates a new GetUsersParams object
// with the ability to set a timeout on a request.
func NewGetUsersParamsWithTimeout(timeout time.Duration) *GetUsersParams {
return &GetUsersParams{
timeout: timeout,
}
}
// NewGetUsersParamsWithContext creates a new GetUsersParams object
// with the ability to set a context for a request.
func NewGetUsersParamsWithContext(ctx context.Context) *GetUsersParams {
return &GetUsersParams{
Context: ctx,
}
}
// NewGetUsersParamsWithHTTPClient creates a new GetUsersParams object
// with the ability to set a custom HTTPClient for a request.
func NewGetUsersParamsWithHTTPClient(client *http.Client) *GetUsersParams {
return &GetUsersParams{
HTTPClient: client,
}
}
/* GetUsersParams contains all the parameters to send to the API endpoint
for the get users operation.
Typically these are written to a http.Request.
*/
type GetUsersParams struct {
/* Active.
Only retrieve active records?
*/
Active *bool
/* Apikey.
Taxnexus Id of the User to be retrieved
*/
Apikey *string
/* Limit.
How many objects to return at one time
Format: int64
*/
Limit *int64
/* Offset.
How many objects to skip?
Format: int64
*/
Offset *int64
/* UserID.
Taxnexus Id of the User to be retrieved
*/
UserID *string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the get users params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetUsersParams) WithDefaults() *GetUsersParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the get users params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetUsersParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the get users params
func (o *GetUsersParams) WithTimeout(timeout time.Duration) *GetUsersParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the get users params
func (o *GetUsersParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the get users params
func (o *GetUsersParams) WithContext(ctx context.Context) *GetUsersParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get users params
func (o *GetUsersParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the get users params
func (o *GetUsersParams) WithHTTPClient(client *http.Client) *GetUsersParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the get users params
func (o *GetUsersParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithActive adds the active to the get users params
func (o *GetUsersParams) WithActive(active *bool) *GetUsersParams {
o.SetActive(active)
return o
}
// SetActive adds the active to the get users params
func (o *GetUsersParams) SetActive(active *bool) {
o.Active = active
}
// WithApikey adds the apikey to the get users params
func (o *GetUsersParams) WithApikey(apikey *string) *GetUsersParams {
o.SetApikey(apikey)
return o
}
// SetApikey adds the apikey to the get users params
func (o *GetUsersParams) SetApikey(apikey *string) {
o.Apikey = apikey
}
// WithLimit adds the limit to the get users params
func (o *GetUsersParams) WithLimit(limit *int64) *GetUsersParams {
o.SetLimit(limit)
return o
}
// SetLimit adds the limit to the get users params
func (o *GetUsersParams) SetLimit(limit *int64) {
o.Limit = limit
}
// WithOffset adds the offset to the get users params
func (o *GetUsersParams) WithOffset(offset *int64) *GetUsersParams {
o.SetOffset(offset)
return o
}
// SetOffset adds the offset to the get users params
func (o *GetUsersParams) SetOffset(offset *int64) {
o.Offset = offset
}
// WithUserID adds the userID to the get users params
func (o *GetUsersParams) WithUserID(userID *string) *GetUsersParams {
o.SetUserID(userID)
return o
}
// SetUserID adds the userId to the get users params
func (o *GetUsersParams) SetUserID(userID *string) {
o.UserID = userID
}
// WriteToRequest writes these params to a swagger request
func (o *GetUsersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.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.Apikey != nil {
// query param apikey
var qrApikey string
if o.Apikey != nil {
qrApikey = *o.Apikey
}
qApikey := qrApikey
if qApikey != "" {
if err := r.SetQueryParam("apikey", qApikey); err != nil {
return err
}
}
}
if 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 o.UserID != nil {
// query param userId
var qrUserID string
if o.UserID != nil {
qrUserID = *o.UserID
}
qUserID := qrUserID
if qUserID != "" {
if err := r.SetQueryParam("userId", qUserID); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,306 @@
// 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 users
// 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"
)
// GetUsersReader is a Reader for the GetUsers structure.
type GetUsersReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetUsersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetUsersOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewGetUsersUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewGetUsersForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewGetUsersNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewGetUsersUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewGetUsersInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
}
}
// NewGetUsersOK creates a GetUsersOK with default headers values
func NewGetUsersOK() *GetUsersOK {
return &GetUsersOK{}
}
/* GetUsersOK describes a response with status code 200, with default header values.
Taxnexus Response with User objects
*/
type GetUsersOK struct {
Payload *research_models.UserResponse
}
func (o *GetUsersOK) Error() string {
return fmt.Sprintf("[GET /users][%d] getUsersOK %+v", 200, o.Payload)
}
func (o *GetUsersOK) GetPayload() *research_models.UserResponse {
return o.Payload
}
func (o *GetUsersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(research_models.UserResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetUsersUnauthorized creates a GetUsersUnauthorized with default headers values
func NewGetUsersUnauthorized() *GetUsersUnauthorized {
return &GetUsersUnauthorized{}
}
/* GetUsersUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type GetUsersUnauthorized struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *GetUsersUnauthorized) Error() string {
return fmt.Sprintf("[GET /users][%d] getUsersUnauthorized %+v", 401, o.Payload)
}
func (o *GetUsersUnauthorized) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetUsersUnauthorized) 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
}
// NewGetUsersForbidden creates a GetUsersForbidden with default headers values
func NewGetUsersForbidden() *GetUsersForbidden {
return &GetUsersForbidden{}
}
/* GetUsersForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type GetUsersForbidden struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *GetUsersForbidden) Error() string {
return fmt.Sprintf("[GET /users][%d] getUsersForbidden %+v", 403, o.Payload)
}
func (o *GetUsersForbidden) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetUsersForbidden) 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
}
// NewGetUsersNotFound creates a GetUsersNotFound with default headers values
func NewGetUsersNotFound() *GetUsersNotFound {
return &GetUsersNotFound{}
}
/* GetUsersNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type GetUsersNotFound struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *GetUsersNotFound) Error() string {
return fmt.Sprintf("[GET /users][%d] getUsersNotFound %+v", 404, o.Payload)
}
func (o *GetUsersNotFound) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetUsersNotFound) 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
}
// NewGetUsersUnprocessableEntity creates a GetUsersUnprocessableEntity with default headers values
func NewGetUsersUnprocessableEntity() *GetUsersUnprocessableEntity {
return &GetUsersUnprocessableEntity{}
}
/* GetUsersUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type GetUsersUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *GetUsersUnprocessableEntity) Error() string {
return fmt.Sprintf("[GET /users][%d] getUsersUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetUsersUnprocessableEntity) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetUsersUnprocessableEntity) 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
}
// NewGetUsersInternalServerError creates a GetUsersInternalServerError with default headers values
func NewGetUsersInternalServerError() *GetUsersInternalServerError {
return &GetUsersInternalServerError{}
}
/* GetUsersInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type GetUsersInternalServerError struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
func (o *GetUsersInternalServerError) Error() string {
return fmt.Sprintf("[GET /users][%d] getUsersInternalServerError %+v", 500, o.Payload)
}
func (o *GetUsersInternalServerError) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetUsersInternalServerError) 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,86 @@
// 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 users
// 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 users API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
return &Client{transport: transport, formats: formats}
}
/*
Client for users 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 {
GetUsers(params *GetUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetUsersOK, error)
SetTransport(transport runtime.ClientTransport)
}
/*
GetUsers gets a list users
Return a list of User records from the datastore
*/
func (a *Client) GetUsers(params *GetUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetUsersOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetUsersParams()
}
op := &runtime.ClientOperation{
ID: "getUsers",
Method: "GET",
PathPattern: "/users",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &GetUsersReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*GetUsersOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for getUsers: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
// SetTransport changes the transport on the client
func (a *Client) SetTransport(transport runtime.ClientTransport) {
a.transport = transport
}

View File

@ -0,0 +1,482 @@
// 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"
)
// Account account
//
// swagger:model Account
type Account struct {
// Account Number
Accountnumber string `json:"accountnumber,omitempty"`
// The marketing orgin of this account
Accountsource string `json:"accountsource,omitempty"`
// Active
Active bool `json:"active,omitempty"`
// For tax authorities, this account's administrative level, e.g. Local, County, State or Federal
Administrativelevel string `json:"administrativelevel,omitempty"`
// Rollup Tax Amount
Amount float64 `json:"amount,omitempty"`
// Amount Invoiced
Amountinvoiced float64 `json:"amountinvoiced,omitempty"`
// Amount Paid
Amountpaid float64 `json:"amountpaid,omitempty"`
// Annual Revenue Estimate
Annualrevenue float64 `json:"annualrevenue,omitempty"`
// Account Balance
Balance float64 `json:"balance,omitempty"`
// billingaddress
Billingaddress *Address `json:"billingaddress,omitempty"`
// Contact ID
Billingcontactid string `json:"billingcontactid,omitempty"`
// Billing Preference
Billingpreference string `json:"billingpreference,omitempty"`
// businessaddress
Businessaddress *Address `json:"businessaddress,omitempty"`
// Is this a cannabis customer?
Cannabiscustomer bool `json:"cannabiscustomer,omitempty"`
// Channel Program Level Name
Channelprogramlevelname string `json:"channelprogramlevelname,omitempty"`
// Channel Program Name
Channelprogramname string `json:"channelprogramname,omitempty"`
// Client End Date
Clientenddate string `json:"clientenddate,omitempty"`
// Client Start Date
Clientstartdate string `json:"clientstartdate,omitempty"`
// The Company ID of this Account
Companyid string `json:"companyid,omitempty"`
// The Id of the geo coordinates of this account
Coordinateid string `json:"coordinateid,omitempty"`
// Created By User ID
Createdbyid string `json:"createdbyid,omitempty"`
// Created Date
Createddate string `json:"createddate,omitempty"`
// Customer ID from source system
Customerid string `json:"customerid,omitempty"`
// Customer Priority
Customerpriority string `json:"customerpriority,omitempty"`
// D-n-B Company
Dandbcompanyid string `json:"dandbcompanyid,omitempty"`
// This Account's 'Doing Business As' name
Dba string `json:"dba,omitempty"`
// defaultaddress
Defaultaddress *Address `json:"defaultaddress,omitempty"`
// Default Backend ID
Defaultbackendid string `json:"defaultbackendid,omitempty"`
// Default Delivery Address Contact ID
Defaultdeliverycontactid string `json:"defaultdeliverycontactid,omitempty"`
// Default End User Contact ID
Defaultenduserid string `json:"defaultenduserid,omitempty"`
// Description
Description string `json:"description,omitempty"`
// D-U-N-S Number
Dunsnumber string `json:"dunsnumber,omitempty"`
// EIN
Ein string `json:"ein,omitempty"`
// Main Account Email
Email string `json:"email,omitempty"`
// Enrollment Status
Enrollmentstatus string `json:"enrollmentstatus,omitempty"`
// Fax
Fax string `json:"fax,omitempty"`
// Taxnexus Account Id
ID string `json:"id,omitempty"`
// Industry
Industry string `json:"industry,omitempty"`
// Customer Portal Account
Iscustomerportal bool `json:"iscustomerportal,omitempty"`
// Partner Account
Ispartner bool `json:"ispartner,omitempty"`
// ISP Customer?
Ispcustomer bool `json:"ispcustomer,omitempty"`
// Data.com Key
Jigsaw string `json:"jigsaw,omitempty"`
// Last Modified By User ID
Lastmodifiedbyid string `json:"lastmodifiedbyid,omitempty"`
// Last Modified Date
Lastmodifieddate string `json:"lastmodifieddate,omitempty"`
// MSP Customer?
Mspcustomer bool `json:"mspcustomer,omitempty"`
// NAICS Code
Naicscode string `json:"naicscode,omitempty"`
// NAICS Description
Naicsdesc string `json:"naicsdesc,omitempty"`
// Account Name
Name string `json:"name,omitempty"`
// Employee Count Estimate
Numberofemployees int64 `json:"numberofemployees,omitempty"`
// Number of Locations Estimate
Numberoflocations int64 `json:"numberoflocations,omitempty"`
// Open Charges
Opencharges float64 `json:"opencharges,omitempty"`
// Vendor Order Contact ID
Ordercontactid string `json:"ordercontactid,omitempty"`
// Order Email
Orderemail string `json:"orderemail,omitempty"`
// Account Owner User ID
Ownerid string `json:"ownerid,omitempty"`
// Ownership
Ownership string `json:"ownership,omitempty"`
// Parent Foreign Key
Parentfk string `json:"parentfk,omitempty"`
// Parent Account
Parentid string `json:"parentid,omitempty"`
// Phone
Phone string `json:"phone,omitempty"`
// The ID of the Place situs record that applies to this Account
Placeid string `json:"placeid,omitempty"`
// Tax Preparer Contact ID
Preparerid string `json:"preparerid,omitempty"`
// Rating
Rating string `json:"rating,omitempty"`
// Rating Engine identifier
Ratingengineid string `json:"ratingengineid,omitempty"`
// External Reference ID
Ref string `json:"ref,omitempty"`
// Rollup Revenue Base
Revenuebase float64 `json:"revenuebase,omitempty"`
// Rollup Revenue Net
Revenuenet float64 `json:"revenuenet,omitempty"`
// Rollup Revenue Not Taxable
Revenuenottaxable float64 `json:"revenuenottaxable,omitempty"`
// shippingaddress
Shippingaddress *Address `json:"shippingaddress,omitempty"`
// Shipping Census Tract
Shippingcensustract string `json:"shippingcensustract,omitempty"`
// Shipping Contact ID
Shippingcontactid string `json:"shippingcontactid,omitempty"`
// Shipping County
Shippingcounty string `json:"shippingcounty,omitempty"`
// SIC Code
Sic string `json:"sic,omitempty"`
// SIC Description
Sicdesc string `json:"sicdesc,omitempty"`
// Account Site
Site string `json:"site,omitempty"`
// Account Status
Status string `json:"status,omitempty"`
// Tax Exemption
Taxexemption string `json:"taxexemption,omitempty"`
// Rollup Tax On Tax
Taxontax float64 `json:"taxontax,omitempty"`
// Telecom Customer?
Telecomcustomer bool `json:"telecomcustomer,omitempty"`
// tenant identifier
Tenantid string `json:"tenantid,omitempty"`
// Ticker Symbol
Tickersymbol string `json:"tickersymbol,omitempty"`
// Tradestyle
Tradestyle string `json:"tradestyle,omitempty"`
// Type
Type string `json:"type,omitempty"`
// Unapplied Payments
Unappliedpayments float64 `json:"unappliedpayments,omitempty"`
// Rollup Unit Base
Unitbase float64 `json:"unitbase,omitempty"`
// Upsell Opportunity
Upsellopportunity string `json:"upsellopportunity,omitempty"`
// Website
Website string `json:"website,omitempty"`
// WHMCS Client ID
Whmcsclientid int64 `json:"whmcsclientid,omitempty"`
// Xero Contact ID
Xerocontactid string `json:"xerocontactid,omitempty"`
// Year Started
Yearstarted string `json:"yearstarted,omitempty"`
}
// Validate validates this account
func (m *Account) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateBillingaddress(formats); err != nil {
res = append(res, err)
}
if err := m.validateBusinessaddress(formats); err != nil {
res = append(res, err)
}
if err := m.validateDefaultaddress(formats); err != nil {
res = append(res, err)
}
if err := m.validateShippingaddress(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *Account) validateBillingaddress(formats strfmt.Registry) error {
if swag.IsZero(m.Billingaddress) { // not required
return nil
}
if m.Billingaddress != nil {
if err := m.Billingaddress.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("billingaddress")
}
return err
}
}
return nil
}
func (m *Account) validateBusinessaddress(formats strfmt.Registry) error {
if swag.IsZero(m.Businessaddress) { // not required
return nil
}
if m.Businessaddress != nil {
if err := m.Businessaddress.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("businessaddress")
}
return err
}
}
return nil
}
func (m *Account) validateDefaultaddress(formats strfmt.Registry) error {
if swag.IsZero(m.Defaultaddress) { // not required
return nil
}
if m.Defaultaddress != nil {
if err := m.Defaultaddress.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("defaultaddress")
}
return err
}
}
return nil
}
func (m *Account) validateShippingaddress(formats strfmt.Registry) error {
if swag.IsZero(m.Shippingaddress) { // not required
return nil
}
if m.Shippingaddress != nil {
if err := m.Shippingaddress.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("shippingaddress")
}
return err
}
}
return nil
}
// ContextValidate validate this account based on the context it is used
func (m *Account) 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.contextValidateBusinessaddress(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateDefaultaddress(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 *Account) 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")
}
return err
}
}
return nil
}
func (m *Account) contextValidateBusinessaddress(ctx context.Context, formats strfmt.Registry) error {
if m.Businessaddress != nil {
if err := m.Businessaddress.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("businessaddress")
}
return err
}
}
return nil
}
func (m *Account) contextValidateDefaultaddress(ctx context.Context, formats strfmt.Registry) error {
if m.Defaultaddress != nil {
if err := m.Defaultaddress.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("defaultaddress")
}
return err
}
}
return nil
}
func (m *Account) 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")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *Account) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Account) UnmarshalBinary(b []byte) error {
var res Account
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -4,7 +4,7 @@
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package sfgate_models
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
@ -18,20 +18,20 @@ import (
"github.com/go-openapi/swag"
)
// ProductRequest product request
// AccountRequest account request
//
// swagger:model ProductRequest
type ProductRequest struct {
// swagger:model AccountRequest
type AccountRequest struct {
// data
Data []*Product `json:"data"`
Data []*Account `json:"data"`
// meta
Meta *RequestMeta `json:"meta,omitempty"`
}
// Validate validates this product request
func (m *ProductRequest) Validate(formats strfmt.Registry) error {
// Validate validates this account request
func (m *AccountRequest) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateData(formats); err != nil {
@ -48,7 +48,7 @@ func (m *ProductRequest) Validate(formats strfmt.Registry) error {
return nil
}
func (m *ProductRequest) validateData(formats strfmt.Registry) error {
func (m *AccountRequest) validateData(formats strfmt.Registry) error {
if swag.IsZero(m.Data) { // not required
return nil
}
@ -72,7 +72,7 @@ func (m *ProductRequest) validateData(formats strfmt.Registry) error {
return nil
}
func (m *ProductRequest) validateMeta(formats strfmt.Registry) error {
func (m *AccountRequest) validateMeta(formats strfmt.Registry) error {
if swag.IsZero(m.Meta) { // not required
return nil
}
@ -89,8 +89,8 @@ func (m *ProductRequest) validateMeta(formats strfmt.Registry) error {
return nil
}
// ContextValidate validate this product request based on the context it is used
func (m *ProductRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
// ContextValidate validate this account request based on the context it is used
func (m *AccountRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateData(ctx, formats); err != nil {
@ -107,7 +107,7 @@ func (m *ProductRequest) ContextValidate(ctx context.Context, formats strfmt.Reg
return nil
}
func (m *ProductRequest) contextValidateData(ctx context.Context, formats strfmt.Registry) error {
func (m *AccountRequest) contextValidateData(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Data); i++ {
@ -125,7 +125,7 @@ func (m *ProductRequest) contextValidateData(ctx context.Context, formats strfmt
return nil
}
func (m *ProductRequest) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error {
func (m *AccountRequest) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error {
if m.Meta != nil {
if err := m.Meta.ContextValidate(ctx, formats); err != nil {
@ -140,7 +140,7 @@ func (m *ProductRequest) contextValidateMeta(ctx context.Context, formats strfmt
}
// MarshalBinary interface implementation
func (m *ProductRequest) MarshalBinary() ([]byte, error) {
func (m *AccountRequest) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
@ -148,8 +148,8 @@ func (m *ProductRequest) MarshalBinary() ([]byte, error) {
}
// UnmarshalBinary interface implementation
func (m *ProductRequest) UnmarshalBinary(b []byte) error {
var res ProductRequest
func (m *AccountRequest) UnmarshalBinary(b []byte) error {
var res AccountRequest
if err := swag.ReadJSON(b, &res); err != nil {
return err
}

View File

@ -0,0 +1,158 @@
// 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"
)
// AccountResponse An array of Account objects
//
// swagger:model AccountResponse
type AccountResponse struct {
// data
Data []*Account `json:"data"`
// meta
Meta *ResponseMeta `json:"meta,omitempty"`
}
// Validate validates this account response
func (m *AccountResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateData(formats); err != nil {
res = append(res, err)
}
if err := m.validateMeta(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *AccountResponse) validateData(formats strfmt.Registry) error {
if swag.IsZero(m.Data) { // not required
return nil
}
for i := 0; i < len(m.Data); i++ {
if swag.IsZero(m.Data[i]) { // not required
continue
}
if m.Data[i] != nil {
if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *AccountResponse) validateMeta(formats strfmt.Registry) error {
if swag.IsZero(m.Meta) { // not required
return nil
}
if m.Meta != nil {
if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta")
}
return err
}
}
return nil
}
// ContextValidate validate this account response based on the context it is used
func (m *AccountResponse) 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 *AccountResponse) 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))
}
return err
}
}
}
return nil
}
func (m *AccountResponse) 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")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *AccountResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *AccountResponse) UnmarshalBinary(b []byte) error {
var res AccountResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,107 @@
// 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"
"github.com/go-openapi/validate"
)
// Address address
//
// swagger:model Address
type Address struct {
// City
// Required: true
City *string `json:"city"`
// Country full name
Country string `json:"country,omitempty"`
// Country Code
Countrycode string `json:"countrycode,omitempty"`
// Postal Code
Postalcode string `json:"postalcode,omitempty"`
// State full name
State string `json:"state,omitempty"`
// State Code
// Required: true
Statecode *string `json:"statecode"`
// Street number and name
Street string `json:"street,omitempty"`
}
// Validate validates this address
func (m *Address) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCity(formats); err != nil {
res = append(res, err)
}
if err := m.validateStatecode(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *Address) validateCity(formats strfmt.Registry) error {
if err := validate.Required("city", "body", m.City); err != nil {
return err
}
return nil
}
func (m *Address) validateStatecode(formats strfmt.Registry) error {
if err := validate.Required("statecode", "body", m.Statecode); err != nil {
return err
}
return nil
}
// ContextValidate validates this address based on context it is used
func (m *Address) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *Address) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Address) UnmarshalBinary(b []byte) error {
var res Address
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,102 @@
// 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/strfmt"
"github.com/go-openapi/swag"
)
// Cluster cluster
//
// swagger:model Cluster
type Cluster struct {
// Created By
Createdbyid string `json:"createdbyid,omitempty"`
// Created Date
Createddate string `json:"createddate,omitempty"`
// Description
Description string `json:"description,omitempty"`
// Environment
Environment string `json:"environment,omitempty"`
// Gateway
Gateway string `json:"gateway,omitempty"`
// Taxnexus Record Id
ID string `json:"id,omitempty"`
// IP Address
IPAddress string `json:"ip_address,omitempty"`
// Last Modified By
Lastmodifiedbyid string `json:"lastmodifiedbyid,omitempty"`
// Last Modified Date
Lastmodifieddate string `json:"lastmodifieddate,omitempty"`
// Cluster Name
Name string `json:"name,omitempty"`
// Owner
Ownerid string `json:"ownerid,omitempty"`
// External Reference
Ref string `json:"ref,omitempty"`
// Status
Status string `json:"status,omitempty"`
// Subnet
Subnet string `json:"subnet,omitempty"`
// tenantid
Tenantid string `json:"tenantid,omitempty"`
// Type
Type string `json:"type,omitempty"`
// Zone
Zone string `json:"zone,omitempty"`
}
// Validate validates this cluster
func (m *Cluster) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this cluster based on context it is used
func (m *Cluster) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *Cluster) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Cluster) UnmarshalBinary(b []byte) error {
var res Cluster
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,163 @@
// 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"
"github.com/go-openapi/validate"
)
// ClusterRequest cluster request
//
// swagger:model ClusterRequest
type ClusterRequest struct {
// data
// Required: true
Data []*Cluster `json:"data"`
// meta
// Required: true
Meta *RequestMeta `json:"meta"`
}
// Validate validates this cluster request
func (m *ClusterRequest) 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 *ClusterRequest) validateData(formats strfmt.Registry) error {
if err := validate.Required("data", "body", m.Data); err != nil {
return err
}
for i := 0; i < len(m.Data); i++ {
if swag.IsZero(m.Data[i]) { // not required
continue
}
if m.Data[i] != nil {
if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *ClusterRequest) validateMeta(formats strfmt.Registry) error {
if err := validate.Required("meta", "body", m.Meta); err != nil {
return err
}
if m.Meta != nil {
if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta")
}
return err
}
}
return nil
}
// ContextValidate validate this cluster request based on the context it is used
func (m *ClusterRequest) 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 *ClusterRequest) 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))
}
return err
}
}
}
return nil
}
func (m *ClusterRequest) 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")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *ClusterRequest) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *ClusterRequest) UnmarshalBinary(b []byte) error {
var res ClusterRequest
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,158 @@
// 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"
)
// ClusterResponse An array of cluster objects
//
// swagger:model ClusterResponse
type ClusterResponse struct {
// data
Data []*Cluster `json:"data"`
// meta
Meta *ResponseMeta `json:"meta,omitempty"`
}
// Validate validates this cluster response
func (m *ClusterResponse) 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 *ClusterResponse) validateData(formats strfmt.Registry) error {
if swag.IsZero(m.Data) { // not required
return nil
}
for i := 0; i < len(m.Data); i++ {
if swag.IsZero(m.Data[i]) { // not required
continue
}
if m.Data[i] != nil {
if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *ClusterResponse) validateMeta(formats strfmt.Registry) error {
if swag.IsZero(m.Meta) { // not required
return nil
}
if m.Meta != nil {
if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta")
}
return err
}
}
return nil
}
// ContextValidate validate this cluster response based on the context it is used
func (m *ClusterResponse) 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 *ClusterResponse) 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))
}
return err
}
}
}
return nil
}
func (m *ClusterResponse) 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")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *ClusterResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *ClusterResponse) UnmarshalBinary(b []byte) error {
var res ClusterResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,275 @@
// 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"
)
// Contact contact
//
// swagger:model Contact
type Contact struct {
// The primary account ID of this contact
Accountid string `json:"accountid,omitempty"`
// Assistant Name
Assistantname string `json:"assistantname,omitempty"`
// Asst. Phone
Assistantphone string `json:"assistantphone,omitempty"`
// Birthdate
Birthdate string `json:"birthdate,omitempty"`
// Created By User ID
Createdbyid string `json:"createdbyid,omitempty"`
// Created Date
Createddate string `json:"createddate,omitempty"`
// Department
Department string `json:"department,omitempty"`
// Description
Description string `json:"description,omitempty"`
// Do Not Call?
Donotcall bool `json:"donotcall,omitempty"`
// Email address
Email string `json:"email,omitempty"`
// Email Bounce Date
Emailbounceddate string `json:"emailbounceddate,omitempty"`
// Email Bounce Reason
Emailbouncedreason string `json:"emailbouncedreason,omitempty"`
// Taxnexus Enrollment Status
Enrollmentstatus string `json:"enrollmentstatus,omitempty"`
// Fax Number
Fax string `json:"fax,omitempty"`
// First Name
Firstname string `json:"firstname,omitempty"`
// Email Opt Out
Hasoptedoutofemail bool `json:"hasoptedoutofemail,omitempty"`
// Fax Opt Out
Hasoptedoutoffax bool `json:"hasoptedoutoffax,omitempty"`
// Home Phone
Homephone string `json:"homephone,omitempty"`
// Taxnexus Record Id
ID string `json:"id,omitempty"`
// Does this contact have bounced emails?
Isemailbounced bool `json:"isemailbounced,omitempty"`
// Is Provisioned?
Isprovisioned bool `json:"isprovisioned,omitempty"`
// Last Modified By User ID
Lastmodifiedbyid string `json:"lastmodifiedbyid,omitempty"`
// Last Modified Date
Lastmodifieddate string `json:"lastmodifieddate,omitempty"`
// Last Name
Lastname string `json:"lastname,omitempty"`
// Lead Source
Leadsource string `json:"leadsource,omitempty"`
// Level
Level string `json:"level,omitempty"`
// LinkedIn Page
Linkedin string `json:"linkedin,omitempty"`
// mailingaddress
Mailingaddress *Address `json:"mailingaddress,omitempty"`
// Mailing Lists
Mailinglists string `json:"mailinglists,omitempty"`
// Mobile Phone
Mobilephone string `json:"mobilephone,omitempty"`
// Full Name
Name string `json:"name,omitempty"`
// otheraddress
Otheraddress *Address `json:"otheraddress,omitempty"`
// Other Phone
Otherphone string `json:"otherphone,omitempty"`
// The User ID of the user who owns this Contact
Ownerid string `json:"ownerid,omitempty"`
// Personal Email Address for this Contact
Personalemail string `json:"personalemail,omitempty"`
// Phone Number
Phone string `json:"phone,omitempty"`
// URL of a photograph of this User
Photourl string `json:"photourl,omitempty"`
// Recruiting Status
Recruitingstatus string `json:"recruitingstatus,omitempty"`
// External reference to this contact, if any
Ref string `json:"ref,omitempty"`
// Reports To Contact ID
Reportstoid string `json:"reportstoid,omitempty"`
// Contact Salutation
Salutation string `json:"salutation,omitempty"`
// The Contact Status
Status string `json:"status,omitempty"`
// tenant identifier
Tenantid string `json:"tenantid,omitempty"`
// Contact Title
Title string `json:"title,omitempty"`
// Contact Type
Type string `json:"type,omitempty"`
}
// Validate validates this contact
func (m *Contact) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateMailingaddress(formats); err != nil {
res = append(res, err)
}
if err := m.validateOtheraddress(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *Contact) validateMailingaddress(formats strfmt.Registry) error {
if swag.IsZero(m.Mailingaddress) { // not required
return nil
}
if m.Mailingaddress != nil {
if err := m.Mailingaddress.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("mailingaddress")
}
return err
}
}
return nil
}
func (m *Contact) validateOtheraddress(formats strfmt.Registry) error {
if swag.IsZero(m.Otheraddress) { // not required
return nil
}
if m.Otheraddress != nil {
if err := m.Otheraddress.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("otheraddress")
}
return err
}
}
return nil
}
// ContextValidate validate this contact based on the context it is used
func (m *Contact) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateMailingaddress(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateOtheraddress(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *Contact) contextValidateMailingaddress(ctx context.Context, formats strfmt.Registry) error {
if m.Mailingaddress != nil {
if err := m.Mailingaddress.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("mailingaddress")
}
return err
}
}
return nil
}
func (m *Contact) contextValidateOtheraddress(ctx context.Context, formats strfmt.Registry) error {
if m.Otheraddress != nil {
if err := m.Otheraddress.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("otheraddress")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *Contact) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Contact) UnmarshalBinary(b []byte) error {
var res Contact
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,163 @@
// 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"
"github.com/go-openapi/validate"
)
// ContactRequest contact request
//
// swagger:model ContactRequest
type ContactRequest struct {
// data
// Required: true
Data []*Contact `json:"data"`
// meta
// Required: true
Meta *RequestMeta `json:"meta"`
}
// Validate validates this contact request
func (m *ContactRequest) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateData(formats); err != nil {
res = append(res, err)
}
if err := m.validateMeta(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *ContactRequest) validateData(formats strfmt.Registry) error {
if err := validate.Required("data", "body", m.Data); err != nil {
return err
}
for i := 0; i < len(m.Data); i++ {
if swag.IsZero(m.Data[i]) { // not required
continue
}
if m.Data[i] != nil {
if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *ContactRequest) validateMeta(formats strfmt.Registry) error {
if err := validate.Required("meta", "body", m.Meta); err != nil {
return err
}
if m.Meta != nil {
if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta")
}
return err
}
}
return nil
}
// ContextValidate validate this contact request based on the context it is used
func (m *ContactRequest) 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 *ContactRequest) 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))
}
return err
}
}
}
return nil
}
func (m *ContactRequest) 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")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *ContactRequest) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *ContactRequest) UnmarshalBinary(b []byte) error {
var res ContactRequest
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -4,7 +4,7 @@
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package sfgate_models
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
@ -18,20 +18,20 @@ import (
"github.com/go-openapi/swag"
)
// ProductResponse product response
// ContactResponse contact response
//
// swagger:model ProductResponse
type ProductResponse struct {
// swagger:model ContactResponse
type ContactResponse struct {
// data
Data []*Product `json:"data"`
Data []*Contact `json:"data"`
// meta
Meta *ResponseMeta `json:"meta,omitempty"`
}
// Validate validates this product response
func (m *ProductResponse) Validate(formats strfmt.Registry) error {
// Validate validates this contact response
func (m *ContactResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateData(formats); err != nil {
@ -48,7 +48,7 @@ func (m *ProductResponse) Validate(formats strfmt.Registry) error {
return nil
}
func (m *ProductResponse) validateData(formats strfmt.Registry) error {
func (m *ContactResponse) validateData(formats strfmt.Registry) error {
if swag.IsZero(m.Data) { // not required
return nil
}
@ -72,7 +72,7 @@ func (m *ProductResponse) validateData(formats strfmt.Registry) error {
return nil
}
func (m *ProductResponse) validateMeta(formats strfmt.Registry) error {
func (m *ContactResponse) validateMeta(formats strfmt.Registry) error {
if swag.IsZero(m.Meta) { // not required
return nil
}
@ -89,8 +89,8 @@ func (m *ProductResponse) validateMeta(formats strfmt.Registry) error {
return nil
}
// ContextValidate validate this product response based on the context it is used
func (m *ProductResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
// ContextValidate validate this contact response based on the context it is used
func (m *ContactResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateData(ctx, formats); err != nil {
@ -107,7 +107,7 @@ func (m *ProductResponse) ContextValidate(ctx context.Context, formats strfmt.Re
return nil
}
func (m *ProductResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error {
func (m *ContactResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Data); i++ {
@ -125,7 +125,7 @@ func (m *ProductResponse) contextValidateData(ctx context.Context, formats strfm
return nil
}
func (m *ProductResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error {
func (m *ContactResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error {
if m.Meta != nil {
if err := m.Meta.ContextValidate(ctx, formats); err != nil {
@ -140,7 +140,7 @@ func (m *ProductResponse) contextValidateMeta(ctx context.Context, formats strfm
}
// MarshalBinary interface implementation
func (m *ProductResponse) MarshalBinary() ([]byte, error) {
func (m *ContactResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
@ -148,8 +148,8 @@ func (m *ProductResponse) MarshalBinary() ([]byte, error) {
}
// UnmarshalBinary interface implementation
func (m *ProductResponse) UnmarshalBinary(b []byte) error {
var res ProductResponse
func (m *ContactResponse) UnmarshalBinary(b []byte) error {
var res ContactResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}

View File

@ -0,0 +1,90 @@
// 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/strfmt"
"github.com/go-openapi/swag"
)
// Database A Database provisioned and owned by a Tenant
//
// swagger:model Database
type Database struct {
// Is this database active?
Active bool `json:"active,omitempty"`
// The ID of the Cluster in which this database is deployed
Clusterid string `json:"clusterid,omitempty"`
// Created By
Createdbyid string `json:"createdbyid,omitempty"`
// Created Date
Createddate string `json:"createddate,omitempty"`
// The name of the physical database in the cluster
Databasename string `json:"databasename,omitempty"`
// Database connection string
Dsn string `json:"dsn,omitempty"`
// Record Id
ID string `json:"id,omitempty"`
// Last Modified By
Lastmodifiedbyid string `json:"lastmodifiedbyid,omitempty"`
// Last Modifed Date
Lastmodifieddate string `json:"lastmodifieddate,omitempty"`
// List of Taxnexus microservices implemented by this Database
Microservices string `json:"microservices,omitempty"`
// The current status of this Tenant
Status string `json:"status,omitempty"`
// The ID of the tenant who owns this Database
Tenantid string `json:"tenantid,omitempty"`
// The type of Database (mysql, etc)
Type string `json:"type,omitempty"`
}
// Validate validates this database
func (m *Database) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this database based on context it is used
func (m *Database) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *Database) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Database) UnmarshalBinary(b []byte) error {
var res Database
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,158 @@
// 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"
)
// DatabaseRequest An array of Database objects
//
// swagger:model DatabaseRequest
type DatabaseRequest struct {
// data
Data []*Database `json:"data"`
// meta
Meta *RequestMeta `json:"meta,omitempty"`
}
// Validate validates this database request
func (m *DatabaseRequest) 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 *DatabaseRequest) validateData(formats strfmt.Registry) error {
if swag.IsZero(m.Data) { // not required
return nil
}
for i := 0; i < len(m.Data); i++ {
if swag.IsZero(m.Data[i]) { // not required
continue
}
if m.Data[i] != nil {
if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *DatabaseRequest) validateMeta(formats strfmt.Registry) error {
if swag.IsZero(m.Meta) { // not required
return nil
}
if m.Meta != nil {
if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta")
}
return err
}
}
return nil
}
// ContextValidate validate this database request based on the context it is used
func (m *DatabaseRequest) 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 *DatabaseRequest) 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))
}
return err
}
}
}
return nil
}
func (m *DatabaseRequest) 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")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *DatabaseRequest) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *DatabaseRequest) UnmarshalBinary(b []byte) error {
var res DatabaseRequest
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,158 @@
// 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"
)
// DatabaseResponse An array of Database objects
//
// swagger:model DatabaseResponse
type DatabaseResponse struct {
// data
Data []*Database `json:"data"`
// meta
Meta *ResponseMeta `json:"meta,omitempty"`
}
// Validate validates this database response
func (m *DatabaseResponse) 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 *DatabaseResponse) validateData(formats strfmt.Registry) error {
if swag.IsZero(m.Data) { // not required
return nil
}
for i := 0; i < len(m.Data); i++ {
if swag.IsZero(m.Data[i]) { // not required
continue
}
if m.Data[i] != nil {
if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *DatabaseResponse) validateMeta(formats strfmt.Registry) error {
if swag.IsZero(m.Meta) { // not required
return nil
}
if m.Meta != nil {
if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta")
}
return err
}
}
return nil
}
// ContextValidate validate this database response based on the context it is used
func (m *DatabaseResponse) 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 *DatabaseResponse) 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))
}
return err
}
}
}
return nil
}
func (m *DatabaseResponse) 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")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *DatabaseResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *DatabaseResponse) UnmarshalBinary(b []byte) error {
var res DatabaseResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -4,7 +4,7 @@
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package crm_models
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
@ -18,20 +18,20 @@ import (
"github.com/go-openapi/swag"
)
// CompanyResponse An array of Company objects
// DeleteResponse delete response
//
// swagger:model CompanyResponse
type CompanyResponse struct {
// swagger:model DeleteResponse
type DeleteResponse struct {
// data
Data []*Company `json:"Data"`
Data []*Message `json:"Data"`
// meta
Meta *ResponseMeta `json:"Meta,omitempty"`
}
// Validate validates this company response
func (m *CompanyResponse) Validate(formats strfmt.Registry) error {
// Validate validates this delete response
func (m *DeleteResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateData(formats); err != nil {
@ -48,7 +48,7 @@ func (m *CompanyResponse) Validate(formats strfmt.Registry) error {
return nil
}
func (m *CompanyResponse) validateData(formats strfmt.Registry) error {
func (m *DeleteResponse) validateData(formats strfmt.Registry) error {
if swag.IsZero(m.Data) { // not required
return nil
}
@ -72,7 +72,7 @@ func (m *CompanyResponse) validateData(formats strfmt.Registry) error {
return nil
}
func (m *CompanyResponse) validateMeta(formats strfmt.Registry) error {
func (m *DeleteResponse) validateMeta(formats strfmt.Registry) error {
if swag.IsZero(m.Meta) { // not required
return nil
}
@ -89,8 +89,8 @@ func (m *CompanyResponse) validateMeta(formats strfmt.Registry) error {
return nil
}
// ContextValidate validate this company response based on the context it is used
func (m *CompanyResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
// ContextValidate validate this delete response based on the context it is used
func (m *DeleteResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateData(ctx, formats); err != nil {
@ -107,7 +107,7 @@ func (m *CompanyResponse) ContextValidate(ctx context.Context, formats strfmt.Re
return nil
}
func (m *CompanyResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error {
func (m *DeleteResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Data); i++ {
@ -125,7 +125,7 @@ func (m *CompanyResponse) contextValidateData(ctx context.Context, formats strfm
return nil
}
func (m *CompanyResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error {
func (m *DeleteResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error {
if m.Meta != nil {
if err := m.Meta.ContextValidate(ctx, formats); err != nil {
@ -140,7 +140,7 @@ func (m *CompanyResponse) contextValidateMeta(ctx context.Context, formats strfm
}
// MarshalBinary interface implementation
func (m *CompanyResponse) MarshalBinary() ([]byte, error) {
func (m *DeleteResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
@ -148,8 +148,8 @@ func (m *CompanyResponse) MarshalBinary() ([]byte, error) {
}
// UnmarshalBinary interface implementation
func (m *CompanyResponse) UnmarshalBinary(b []byte) error {
var res CompanyResponse
func (m *DeleteResponse) UnmarshalBinary(b []byte) error {
var res DeleteResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}

View File

@ -0,0 +1,60 @@
// 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/strfmt"
"github.com/go-openapi/swag"
)
// Error error
//
// swagger:model Error
type Error struct {
// code
Code int64 `json:"Code,omitempty"`
// fields
Fields string `json:"Fields,omitempty"`
// message
Message string `json:"Message,omitempty"`
}
// Validate validates this error
func (m *Error) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this error based on context it is used
func (m *Error) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *Error) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Error) UnmarshalBinary(b []byte) error {
var res Error
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,121 @@
// 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"
)
// InvalidError invalid error
//
// swagger:model InvalidError
type InvalidError struct {
Error
// details
Details []string `json:"details"`
}
// UnmarshalJSON unmarshals this object from a JSON structure
func (m *InvalidError) UnmarshalJSON(raw []byte) error {
// AO0
var aO0 Error
if err := swag.ReadJSON(raw, &aO0); err != nil {
return err
}
m.Error = aO0
// AO1
var dataAO1 struct {
Details []string `json:"details"`
}
if err := swag.ReadJSON(raw, &dataAO1); err != nil {
return err
}
m.Details = dataAO1.Details
return nil
}
// MarshalJSON marshals this object to a JSON structure
func (m InvalidError) MarshalJSON() ([]byte, error) {
_parts := make([][]byte, 0, 2)
aO0, err := swag.WriteJSON(m.Error)
if err != nil {
return nil, err
}
_parts = append(_parts, aO0)
var dataAO1 struct {
Details []string `json:"details"`
}
dataAO1.Details = m.Details
jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1)
if errAO1 != nil {
return nil, errAO1
}
_parts = append(_parts, jsonDataAO1)
return swag.ConcatJSON(_parts...), nil
}
// Validate validates this invalid error
func (m *InvalidError) Validate(formats strfmt.Registry) error {
var res []error
// validation for a type composition with Error
if err := m.Error.Validate(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
// ContextValidate validate this invalid error based on the context it is used
func (m *InvalidError) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
// validation for a type composition with Error
if err := m.Error.ContextValidate(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
// MarshalBinary interface implementation
func (m *InvalidError) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *InvalidError) UnmarshalBinary(b []byte) error {
var res InvalidError
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,60 @@
// 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/strfmt"
"github.com/go-openapi/swag"
)
// Message message
//
// swagger:model Message
type Message struct {
// message
Message string `json:"message,omitempty"`
// ref
Ref string `json:"ref,omitempty"`
// status
Status int64 `json:"status,omitempty"`
}
// Validate validates this message
func (m *Message) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this message based on context it is used
func (m *Message) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *Message) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Message) UnmarshalBinary(b []byte) error {
var res Message
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,63 @@
// 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/strfmt"
"github.com/go-openapi/swag"
)
// Pagination pagination
//
// swagger:model Pagination
type Pagination struct {
// limit
Limit int64 `json:"limit,omitempty"`
// pagesize
Pagesize int64 `json:"pagesize,omitempty"`
// poffset
Poffset int64 `json:"poffset,omitempty"`
// setsize
Setsize int64 `json:"setsize,omitempty"`
}
// Validate validates this pagination
func (m *Pagination) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this pagination based on context it is used
func (m *Pagination) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *Pagination) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Pagination) UnmarshalBinary(b []byte) error {
var res Pagination
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,75 @@
// 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"
"github.com/go-openapi/validate"
)
// RequestMeta request meta
//
// swagger:model RequestMeta
type RequestMeta struct {
// Taxnexus Account Number of the Reseller or OEM
// Required: true
TaxnexusAccount *string `json:"TaxnexusAccount"`
}
// Validate validates this request meta
func (m *RequestMeta) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateTaxnexusAccount(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *RequestMeta) validateTaxnexusAccount(formats strfmt.Registry) error {
if err := validate.Required("TaxnexusAccount", "body", m.TaxnexusAccount); err != nil {
return err
}
return nil
}
// ContextValidate validates this request meta based on context it is used
func (m *RequestMeta) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *RequestMeta) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *RequestMeta) UnmarshalBinary(b []byte) error {
var res RequestMeta
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,137 @@
// 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"
)
// ResponseMeta response meta
//
// swagger:model ResponseMeta
type ResponseMeta struct {
// Microservice Contact Info
Contact string `json:"Contact,omitempty"`
// Copyright Info
Copyright string `json:"Copyright,omitempty"`
// License Information and Restrictions
License string `json:"License,omitempty"`
// Operation ID
OperationID string `json:"OperationID,omitempty"`
// pagination
Pagination *Pagination `json:"Pagination,omitempty"`
// Request IP Address
RequestIP string `json:"RequestIP,omitempty"`
// Request Type
RequestType string `json:"RequestType,omitempty"`
// Request URL
RequestURL string `json:"RequestURL,omitempty"`
// Data Server Info
ServerInfo string `json:"ServerInfo,omitempty"`
// Data Server Response Time (ms)
ServerResponseTime string `json:"ServerResponseTime,omitempty"`
// Backend Server Timestamp
ServerTimestamp string `json:"ServerTimestamp,omitempty"`
// Taxnexus Account Number used for recording transactions
TaxnexusAccount string `json:"TaxnexusAccount,omitempty"`
}
// Validate validates this response meta
func (m *ResponseMeta) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validatePagination(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *ResponseMeta) validatePagination(formats strfmt.Registry) error {
if swag.IsZero(m.Pagination) { // not required
return nil
}
if m.Pagination != nil {
if err := m.Pagination.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Pagination")
}
return err
}
}
return nil
}
// ContextValidate validate this response meta based on the context it is used
func (m *ResponseMeta) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidatePagination(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *ResponseMeta) contextValidatePagination(ctx context.Context, formats strfmt.Registry) error {
if m.Pagination != nil {
if err := m.Pagination.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Pagination")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *ResponseMeta) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *ResponseMeta) UnmarshalBinary(b []byte) error {
var res ResponseMeta
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,78 @@
// 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/strfmt"
"github.com/go-openapi/swag"
)
// Role A functional role within a Tenant
//
// swagger:model Role
type Role struct {
// the corresponding auth0 role
Auth0roleid string `json:"auth0roleid,omitempty"`
// created by
Createdbyid string `json:"createdbyid,omitempty"`
// created date
Createddate string `json:"createddate,omitempty"`
// role description
Description string `json:"description,omitempty"`
// record id
ID string `json:"id,omitempty"`
// last modified by
Lastmodifiedbyid string `json:"lastmodifiedbyid,omitempty"`
// last modifed date
Lastmodifieddate string `json:"lastmodifieddate,omitempty"`
// the name of this role
Rolename string `json:"rolename,omitempty"`
// the id of the tenant that owns this role
Tenantid string `json:"tenantid,omitempty"`
}
// Validate validates this role
func (m *Role) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this role based on context it is used
func (m *Role) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *Role) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Role) UnmarshalBinary(b []byte) error {
var res Role
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,158 @@
// 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"
)
// RoleRequest An array of Role objects
//
// swagger:model RoleRequest
type RoleRequest struct {
// data
Data []*Role `json:"data"`
// meta
Meta *RequestMeta `json:"meta,omitempty"`
}
// Validate validates this role request
func (m *RoleRequest) 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 *RoleRequest) validateData(formats strfmt.Registry) error {
if swag.IsZero(m.Data) { // not required
return nil
}
for i := 0; i < len(m.Data); i++ {
if swag.IsZero(m.Data[i]) { // not required
continue
}
if m.Data[i] != nil {
if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *RoleRequest) validateMeta(formats strfmt.Registry) error {
if swag.IsZero(m.Meta) { // not required
return nil
}
if m.Meta != nil {
if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta")
}
return err
}
}
return nil
}
// ContextValidate validate this role request based on the context it is used
func (m *RoleRequest) 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 *RoleRequest) 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))
}
return err
}
}
}
return nil
}
func (m *RoleRequest) 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")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *RoleRequest) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *RoleRequest) UnmarshalBinary(b []byte) error {
var res RoleRequest
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,158 @@
// 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"
)
// RoleResponse An array of Role objects
//
// swagger:model RoleResponse
type RoleResponse struct {
// data
Data []*Role `json:"data"`
// meta
Meta *ResponseMeta `json:"meta,omitempty"`
}
// Validate validates this role response
func (m *RoleResponse) 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 *RoleResponse) validateData(formats strfmt.Registry) error {
if swag.IsZero(m.Data) { // not required
return nil
}
for i := 0; i < len(m.Data); i++ {
if swag.IsZero(m.Data[i]) { // not required
continue
}
if m.Data[i] != nil {
if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *RoleResponse) validateMeta(formats strfmt.Registry) error {
if swag.IsZero(m.Meta) { // not required
return nil
}
if m.Meta != nil {
if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta")
}
return err
}
}
return nil
}
// ContextValidate validate this role response based on the context it is used
func (m *RoleResponse) 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 *RoleResponse) 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))
}
return err
}
}
}
return nil
}
func (m *RoleResponse) 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")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *RoleResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *RoleResponse) UnmarshalBinary(b []byte) error {
var res RoleResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,100 @@
// 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/strfmt"
"github.com/go-openapi/swag"
)
// Template template
//
// swagger:model Template
type Template struct {
// Company
CompanyID string `json:"CompanyID,omitempty"`
// created by ID
CreatedByID string `json:"CreatedByID,omitempty"`
// created date
CreatedDate string `json:"CreatedDate,omitempty"`
// Description
Description string `json:"Description,omitempty"`
// HTML Body
// Format: byte
HTML strfmt.Base64 `json:"HTML,omitempty"`
// Taxnexus Record Id
ID string `json:"ID,omitempty"`
// Active?
IsActive bool `json:"IsActive,omitempty"`
// Master Template?
IsMaster bool `json:"IsMaster,omitempty"`
// last modified by ID
LastModifiedByID string `json:"LastModifiedByID,omitempty"`
// last modified date
LastModifiedDate string `json:"LastModifiedDate,omitempty"`
// Template Name
Name string `json:"Name,omitempty"`
// Object
ObjectType string `json:"ObjectType,omitempty"`
// Record Type Name
RecordTypeName string `json:"RecordTypeName,omitempty"`
// Type
Type string `json:"Type,omitempty"`
// URL
URL string `json:"URL,omitempty"`
// tenant identifier
Tenantid string `json:"tenantid,omitempty"`
}
// Validate validates this template
func (m *Template) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this template based on context it is used
func (m *Template) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *Template) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Template) UnmarshalBinary(b []byte) error {
var res Template
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -4,7 +4,7 @@
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package sfgate_models
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
@ -18,20 +18,20 @@ import (
"github.com/go-openapi/swag"
)
// AuthorityRequest authority request
// TemplateResponse template response
//
// swagger:model AuthorityRequest
type AuthorityRequest struct {
// swagger:model TemplateResponse
type TemplateResponse struct {
// data
Data []*Authority `json:"data"`
Data []*Template `json:"data"`
// meta
Meta *RequestMeta `json:"meta,omitempty"`
Meta *ResponseMeta `json:"meta,omitempty"`
}
// Validate validates this authority request
func (m *AuthorityRequest) Validate(formats strfmt.Registry) error {
// Validate validates this template response
func (m *TemplateResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateData(formats); err != nil {
@ -48,7 +48,7 @@ func (m *AuthorityRequest) Validate(formats strfmt.Registry) error {
return nil
}
func (m *AuthorityRequest) validateData(formats strfmt.Registry) error {
func (m *TemplateResponse) validateData(formats strfmt.Registry) error {
if swag.IsZero(m.Data) { // not required
return nil
}
@ -72,7 +72,7 @@ func (m *AuthorityRequest) validateData(formats strfmt.Registry) error {
return nil
}
func (m *AuthorityRequest) validateMeta(formats strfmt.Registry) error {
func (m *TemplateResponse) validateMeta(formats strfmt.Registry) error {
if swag.IsZero(m.Meta) { // not required
return nil
}
@ -89,8 +89,8 @@ func (m *AuthorityRequest) validateMeta(formats strfmt.Registry) error {
return nil
}
// ContextValidate validate this authority request based on the context it is used
func (m *AuthorityRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
// ContextValidate validate this template response based on the context it is used
func (m *TemplateResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateData(ctx, formats); err != nil {
@ -107,7 +107,7 @@ func (m *AuthorityRequest) ContextValidate(ctx context.Context, formats strfmt.R
return nil
}
func (m *AuthorityRequest) contextValidateData(ctx context.Context, formats strfmt.Registry) error {
func (m *TemplateResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Data); i++ {
@ -125,7 +125,7 @@ func (m *AuthorityRequest) contextValidateData(ctx context.Context, formats strf
return nil
}
func (m *AuthorityRequest) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error {
func (m *TemplateResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error {
if m.Meta != nil {
if err := m.Meta.ContextValidate(ctx, formats); err != nil {
@ -140,7 +140,7 @@ func (m *AuthorityRequest) contextValidateMeta(ctx context.Context, formats strf
}
// MarshalBinary interface implementation
func (m *AuthorityRequest) MarshalBinary() ([]byte, error) {
func (m *TemplateResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
@ -148,8 +148,8 @@ func (m *AuthorityRequest) MarshalBinary() ([]byte, error) {
}
// UnmarshalBinary interface implementation
func (m *AuthorityRequest) UnmarshalBinary(b []byte) error {
var res AuthorityRequest
func (m *TemplateResponse) UnmarshalBinary(b []byte) error {
var res TemplateResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}

View File

@ -0,0 +1,255 @@
// 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"
)
// Tenant Taxnexus Account Tenant
//
// swagger:model Tenant
type Tenant struct {
// The Account that owns this Tenant
Accountid string `json:"accountid,omitempty"`
// Is this Tenant currently active?
Active bool `json:"active,omitempty"`
// Created By
Createdbyid string `json:"createdbyid,omitempty"`
// Created Date
Createddate string `json:"createddate,omitempty"`
// databases
Databases []*Database `json:"databases"`
// Record Id
ID string `json:"id,omitempty"`
// Last Modified By
Lastmodifiedbyid string `json:"lastmodifiedbyid,omitempty"`
// Last Modifed Date
Lastmodifieddate string `json:"lastmodifieddate,omitempty"`
// roles
Roles []*Role `json:"roles"`
// The current status of this Tenant
Status string `json:"status,omitempty"`
// Name of the Tenant Resource
Tenantname string `json:"tenantname,omitempty"`
// tenantusers
Tenantusers []*TenantUser `json:"tenantusers"`
// Type of tenant
Type string `json:"type,omitempty"`
// The version number of the Tenant Onboarding system used to create this tenant
Version string `json:"version,omitempty"`
}
// Validate validates this tenant
func (m *Tenant) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateDatabases(formats); err != nil {
res = append(res, err)
}
if err := m.validateRoles(formats); err != nil {
res = append(res, err)
}
if err := m.validateTenantusers(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *Tenant) validateDatabases(formats strfmt.Registry) error {
if swag.IsZero(m.Databases) { // not required
return nil
}
for i := 0; i < len(m.Databases); i++ {
if swag.IsZero(m.Databases[i]) { // not required
continue
}
if m.Databases[i] != nil {
if err := m.Databases[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("databases" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *Tenant) validateRoles(formats strfmt.Registry) error {
if swag.IsZero(m.Roles) { // not required
return nil
}
for i := 0; i < len(m.Roles); i++ {
if swag.IsZero(m.Roles[i]) { // not required
continue
}
if m.Roles[i] != nil {
if err := m.Roles[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("roles" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *Tenant) validateTenantusers(formats strfmt.Registry) error {
if swag.IsZero(m.Tenantusers) { // not required
return nil
}
for i := 0; i < len(m.Tenantusers); i++ {
if swag.IsZero(m.Tenantusers[i]) { // not required
continue
}
if m.Tenantusers[i] != nil {
if err := m.Tenantusers[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("tenantusers" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this tenant based on the context it is used
func (m *Tenant) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateDatabases(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateRoles(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateTenantusers(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *Tenant) contextValidateDatabases(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Databases); i++ {
if m.Databases[i] != nil {
if err := m.Databases[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("databases" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *Tenant) contextValidateRoles(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Roles); i++ {
if m.Roles[i] != nil {
if err := m.Roles[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("roles" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *Tenant) contextValidateTenantusers(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Tenantusers); i++ {
if m.Tenantusers[i] != nil {
if err := m.Tenantusers[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("tenantusers" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *Tenant) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Tenant) UnmarshalBinary(b []byte) error {
var res Tenant
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -4,7 +4,7 @@
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package sfgate_models
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
@ -18,20 +18,20 @@ import (
"github.com/go-openapi/swag"
)
// AuthorityResponse authority response
// TenantRequest An array of Tenant objects
//
// swagger:model AuthorityResponse
type AuthorityResponse struct {
// swagger:model TenantRequest
type TenantRequest struct {
// data
Data []*Authority `json:"data"`
Data []*Tenant `json:"data"`
// meta
Meta *ResponseMeta `json:"meta,omitempty"`
Meta *RequestMeta `json:"meta,omitempty"`
}
// Validate validates this authority response
func (m *AuthorityResponse) Validate(formats strfmt.Registry) error {
// Validate validates this tenant request
func (m *TenantRequest) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateData(formats); err != nil {
@ -48,7 +48,7 @@ func (m *AuthorityResponse) Validate(formats strfmt.Registry) error {
return nil
}
func (m *AuthorityResponse) validateData(formats strfmt.Registry) error {
func (m *TenantRequest) validateData(formats strfmt.Registry) error {
if swag.IsZero(m.Data) { // not required
return nil
}
@ -72,7 +72,7 @@ func (m *AuthorityResponse) validateData(formats strfmt.Registry) error {
return nil
}
func (m *AuthorityResponse) validateMeta(formats strfmt.Registry) error {
func (m *TenantRequest) validateMeta(formats strfmt.Registry) error {
if swag.IsZero(m.Meta) { // not required
return nil
}
@ -89,8 +89,8 @@ func (m *AuthorityResponse) validateMeta(formats strfmt.Registry) error {
return nil
}
// ContextValidate validate this authority response based on the context it is used
func (m *AuthorityResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
// ContextValidate validate this tenant request based on the context it is used
func (m *TenantRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateData(ctx, formats); err != nil {
@ -107,7 +107,7 @@ func (m *AuthorityResponse) ContextValidate(ctx context.Context, formats strfmt.
return nil
}
func (m *AuthorityResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error {
func (m *TenantRequest) contextValidateData(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Data); i++ {
@ -125,7 +125,7 @@ func (m *AuthorityResponse) contextValidateData(ctx context.Context, formats str
return nil
}
func (m *AuthorityResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error {
func (m *TenantRequest) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error {
if m.Meta != nil {
if err := m.Meta.ContextValidate(ctx, formats); err != nil {
@ -140,7 +140,7 @@ func (m *AuthorityResponse) contextValidateMeta(ctx context.Context, formats str
}
// MarshalBinary interface implementation
func (m *AuthorityResponse) MarshalBinary() ([]byte, error) {
func (m *TenantRequest) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
@ -148,8 +148,8 @@ func (m *AuthorityResponse) MarshalBinary() ([]byte, error) {
}
// UnmarshalBinary interface implementation
func (m *AuthorityResponse) UnmarshalBinary(b []byte) error {
var res AuthorityResponse
func (m *TenantRequest) UnmarshalBinary(b []byte) error {
var res TenantRequest
if err := swag.ReadJSON(b, &res); err != nil {
return err
}

View File

@ -0,0 +1,158 @@
// 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"
)
// TenantResponse An array of Tenant objects
//
// swagger:model TenantResponse
type TenantResponse struct {
// data
Data []*Tenant `json:"data"`
// meta
Meta *ResponseMeta `json:"meta,omitempty"`
}
// Validate validates this tenant response
func (m *TenantResponse) 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 *TenantResponse) validateData(formats strfmt.Registry) error {
if swag.IsZero(m.Data) { // not required
return nil
}
for i := 0; i < len(m.Data); i++ {
if swag.IsZero(m.Data[i]) { // not required
continue
}
if m.Data[i] != nil {
if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *TenantResponse) validateMeta(formats strfmt.Registry) error {
if swag.IsZero(m.Meta) { // not required
return nil
}
if m.Meta != nil {
if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta")
}
return err
}
}
return nil
}
// ContextValidate validate this tenant response based on the context it is used
func (m *TenantResponse) 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 *TenantResponse) 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))
}
return err
}
}
}
return nil
}
func (m *TenantResponse) 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")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *TenantResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *TenantResponse) UnmarshalBinary(b []byte) error {
var res TenantResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,60 @@
// 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/strfmt"
"github.com/go-openapi/swag"
)
// TenantUser Relationship object that connects users to a tenant
//
// swagger:model TenantUser
type TenantUser struct {
// The Tenant access level for this User
Accesslevel string `json:"accesslevel,omitempty"`
// The Tenant ID
Tenantid string `json:"tenantid,omitempty"`
// The User ID
Userid string `json:"userid,omitempty"`
}
// Validate validates this tenant user
func (m *TenantUser) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this tenant user based on context it is used
func (m *TenantUser) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *TenantUser) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *TenantUser) UnmarshalBinary(b []byte) error {
var res TenantUser
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,376 @@
// 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"
)
// User user
//
// swagger:model User
type User struct {
// About Me
Aboutme string `json:"aboutme,omitempty"`
// Account ID
Accountid string `json:"accountid,omitempty"`
// address
Address *Address `json:"address,omitempty"`
// Alias
Alias string `json:"alias,omitempty"`
// API Key
Apikey string `json:"apikey,omitempty"`
// Auth0 User ID
Auth0userid string `json:"auth0userid,omitempty"`
// Nickname
Communitynickname string `json:"communitynickname,omitempty"`
// Company Name
Companyname string `json:"companyname,omitempty"`
// Contact
Contactid string `json:"contactid,omitempty"`
// Created User ID
Createdbyid string `json:"createdbyid,omitempty"`
// Date Created
Createddate string `json:"createddate,omitempty"`
// Delegated Approver
Delegatedapproverid string `json:"delegatedapproverid,omitempty"`
// Department
Department string `json:"department,omitempty"`
// Division
Division string `json:"division,omitempty"`
// Email address
Email string `json:"email,omitempty"`
// Employee Number
Employeenumber string `json:"employeenumber,omitempty"`
// Time day ends
Endday string `json:"endday,omitempty"`
// Environment
Environment string `json:"environment,omitempty"`
// Extension
Extension string `json:"extension,omitempty"`
// Fabric API Key
Fabricapikey string `json:"fabricapikey,omitempty"`
// Fax
Fax string `json:"fax,omitempty"`
// The first name
Firstname string `json:"firstname,omitempty"`
// Allow Forecasting
Forecastenabled bool `json:"forecastenabled,omitempty"`
// Full Photo URL
Fullphotourl string `json:"fullphotourl,omitempty"`
// Taxnexus ID
ID string `json:"id,omitempty"`
// Active
Isactive bool `json:"isactive,omitempty"`
// Is the user enabled for Communities?
Isportalenabled bool `json:"isportalenabled,omitempty"`
// Has Profile Photo
Isprofilephotoactive bool `json:"isprofilephotoactive,omitempty"`
// issystemcontrolled
Issystemcontrolled bool `json:"issystemcontrolled,omitempty"`
// ip address of last login
Lastip string `json:"lastip,omitempty"`
// last login time
Lastlogin string `json:"lastlogin,omitempty"`
// Last Modified User ID
Lastmodifiedbyid string `json:"lastmodifiedbyid,omitempty"`
// Last Modified Date
Lastmodifieddate string `json:"lastmodifieddate,omitempty"`
// The Last Name
Lastname string `json:"lastname,omitempty"`
// number of times user has logged in
Logincount int64 `json:"logincount,omitempty"`
// Manager
Managerid string `json:"managerid,omitempty"`
// Mobile
Mobilephone string `json:"mobilephone,omitempty"`
// Name
Name string `json:"name,omitempty"`
// Out of office message
Outofofficemessage string `json:"outofofficemessage,omitempty"`
// Phone
Phone string `json:"phone,omitempty"`
// Portal Role Level
Portalrole string `json:"portalrole,omitempty"`
// Profile
Profileid string `json:"profileid,omitempty"`
// Admin Info Emails
Receivesadmininfoemails bool `json:"receivesadmininfoemails,omitempty"`
// Info Emails
Receivesinfoemails bool `json:"receivesinfoemails,omitempty"`
// Email Sender Address
Senderemail string `json:"senderemail,omitempty"`
// Email Sender Name
Sendername string `json:"sendername,omitempty"`
// Email Signature
Signature string `json:"signature,omitempty"`
// Small Photo URL
Smallphotourl string `json:"smallphotourl,omitempty"`
// The time day starts
Startday string `json:"startday,omitempty"`
// Taxnexus Account
Taxnexusaccount string `json:"taxnexusaccount,omitempty"`
// tenantid
Tenantid string `json:"tenantid,omitempty"`
// tenantusers
Tenantusers []*TenantUser `json:"tenantusers"`
// Time Zone
Timezonesidkey string `json:"timezonesidkey,omitempty"`
// Title
Title string `json:"title,omitempty"`
// Username
Username string `json:"username,omitempty"`
// Role
Userroleid string `json:"userroleid,omitempty"`
// userroles
Userroles []*UserRole `json:"userroles"`
// User Type
Usertype string `json:"usertype,omitempty"`
}
// Validate validates this user
func (m *User) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateAddress(formats); err != nil {
res = append(res, err)
}
if err := m.validateTenantusers(formats); err != nil {
res = append(res, err)
}
if err := m.validateUserroles(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *User) validateAddress(formats strfmt.Registry) error {
if swag.IsZero(m.Address) { // not required
return nil
}
if m.Address != nil {
if err := m.Address.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("address")
}
return err
}
}
return nil
}
func (m *User) validateTenantusers(formats strfmt.Registry) error {
if swag.IsZero(m.Tenantusers) { // not required
return nil
}
for i := 0; i < len(m.Tenantusers); i++ {
if swag.IsZero(m.Tenantusers[i]) { // not required
continue
}
if m.Tenantusers[i] != nil {
if err := m.Tenantusers[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("tenantusers" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *User) validateUserroles(formats strfmt.Registry) error {
if swag.IsZero(m.Userroles) { // not required
return nil
}
for i := 0; i < len(m.Userroles); i++ {
if swag.IsZero(m.Userroles[i]) { // not required
continue
}
if m.Userroles[i] != nil {
if err := m.Userroles[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("userroles" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this user based on the context it is used
func (m *User) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateAddress(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateTenantusers(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateUserroles(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *User) contextValidateAddress(ctx context.Context, formats strfmt.Registry) error {
if m.Address != nil {
if err := m.Address.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("address")
}
return err
}
}
return nil
}
func (m *User) contextValidateTenantusers(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Tenantusers); i++ {
if m.Tenantusers[i] != nil {
if err := m.Tenantusers[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("tenantusers" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *User) contextValidateUserroles(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Userroles); i++ {
if m.Userroles[i] != nil {
if err := m.Userroles[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("userroles" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *User) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *User) UnmarshalBinary(b []byte) error {
var res User
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,158 @@
// 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"
)
// UserResponse An array of Print-Ready ingest Objects
//
// swagger:model UserResponse
type UserResponse struct {
// data
Data []*User `json:"data"`
// meta
Meta *ResponseMeta `json:"meta,omitempty"`
}
// Validate validates this user response
func (m *UserResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateData(formats); err != nil {
res = append(res, err)
}
if err := m.validateMeta(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *UserResponse) validateData(formats strfmt.Registry) error {
if swag.IsZero(m.Data) { // not required
return nil
}
for i := 0; i < len(m.Data); i++ {
if swag.IsZero(m.Data[i]) { // not required
continue
}
if m.Data[i] != nil {
if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *UserResponse) validateMeta(formats strfmt.Registry) error {
if swag.IsZero(m.Meta) { // not required
return nil
}
if m.Meta != nil {
if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("meta")
}
return err
}
}
return nil
}
// ContextValidate validate this user response based on the context it is used
func (m *UserResponse) 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 *UserResponse) 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))
}
return err
}
}
}
return nil
}
func (m *UserResponse) 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")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *UserResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *UserResponse) UnmarshalBinary(b []byte) error {
var res UserResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,66 @@
// 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/strfmt"
"github.com/go-openapi/swag"
)
// UserRole Relationship object that connects user to a role
//
// swagger:model UserRole
type UserRole struct {
// Linked role ID
Auth0roleid string `json:"auth0roleid,omitempty"`
// Role description
Description string `json:"description,omitempty"`
// Role Name
Name string `json:"name,omitempty"`
// The Role ID
Roleid string `json:"roleid,omitempty"`
// The User ID
Userid string `json:"userid,omitempty"`
}
// Validate validates this user role
func (m *UserRole) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this user role based on context it is used
func (m *UserRole) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *UserRole) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *UserRole) UnmarshalBinary(b []byte) error {
var res UserRole
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -34,6 +34,8 @@ type ClientOption func(*runtime.ClientOperation)
// ClientService is the interface for Client methods
type ClientService interface {
DeleteAccount(params *DeleteAccountParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAccountOK, error)
GetAccounts(params *GetAccountsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAccountsOK, error)
PostAccounts(params *PostAccountsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAccountsOK, error)
@ -43,10 +45,51 @@ type ClientService interface {
SetTransport(transport runtime.ClientTransport)
}
/*
DeleteAccount deletes an account
Delete Taxnexus Account record
*/
func (a *Client) DeleteAccount(params *DeleteAccountParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAccountOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewDeleteAccountParams()
}
op := &runtime.ClientOperation{
ID: "deleteAccount",
Method: "DELETE",
PathPattern: "/accounts",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &DeleteAccountReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*DeleteAccountOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for deleteAccount: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
GetAccounts gets a list of accounts
Return a list of Accounts
Return a list of all available Accounts
*/
func (a *Client) GetAccounts(params *GetAccountsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAccountsOK, error) {
// TODO: Validate the params before sending

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 accounts
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
)
// NewDeleteAccountParams creates a new DeleteAccountParams object,
// with the default 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 NewDeleteAccountParams() *DeleteAccountParams {
return &DeleteAccountParams{
timeout: cr.DefaultTimeout,
}
}
// NewDeleteAccountParamsWithTimeout creates a new DeleteAccountParams object
// with the ability to set a timeout on a request.
func NewDeleteAccountParamsWithTimeout(timeout time.Duration) *DeleteAccountParams {
return &DeleteAccountParams{
timeout: timeout,
}
}
// NewDeleteAccountParamsWithContext creates a new DeleteAccountParams object
// with the ability to set a context for a request.
func NewDeleteAccountParamsWithContext(ctx context.Context) *DeleteAccountParams {
return &DeleteAccountParams{
Context: ctx,
}
}
// NewDeleteAccountParamsWithHTTPClient creates a new DeleteAccountParams object
// with the ability to set a custom HTTPClient for a request.
func NewDeleteAccountParamsWithHTTPClient(client *http.Client) *DeleteAccountParams {
return &DeleteAccountParams{
HTTPClient: client,
}
}
/* DeleteAccountParams contains all the parameters to send to the API endpoint
for the delete account operation.
Typically these are written to a http.Request.
*/
type DeleteAccountParams struct {
/* AccountID.
Taxnexus Record Id of an Account
*/
AccountID *string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the delete account params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *DeleteAccountParams) WithDefaults() *DeleteAccountParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the delete account params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *DeleteAccountParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the delete account params
func (o *DeleteAccountParams) WithTimeout(timeout time.Duration) *DeleteAccountParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the delete account params
func (o *DeleteAccountParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the delete account params
func (o *DeleteAccountParams) WithContext(ctx context.Context) *DeleteAccountParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the delete account params
func (o *DeleteAccountParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the delete account params
func (o *DeleteAccountParams) WithHTTPClient(client *http.Client) *DeleteAccountParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the delete account params
func (o *DeleteAccountParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithAccountID adds the accountID to the delete account params
func (o *DeleteAccountParams) WithAccountID(accountID *string) *DeleteAccountParams {
o.SetAccountID(accountID)
return o
}
// SetAccountID adds the accountId to the delete account params
func (o *DeleteAccountParams) SetAccountID(accountID *string) {
o.AccountID = accountID
}
// WriteToRequest writes these params to a swagger request
func (o *DeleteAccountParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.AccountID != nil {
// query param accountId
var qrAccountID string
if o.AccountID != nil {
qrAccountID = *o.AccountID
}
qAccountID := qrAccountID
if qAccountID != "" {
if err := r.SetQueryParam("accountId", qAccountID); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -4,7 +4,7 @@
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package companies
package accounts
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
@ -16,49 +16,49 @@ import (
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
"code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_models"
)
// PostCompaniesReader is a Reader for the PostCompanies structure.
type PostCompaniesReader struct {
// DeleteAccountReader is a Reader for the DeleteAccount structure.
type DeleteAccountReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PostCompaniesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
func (o *DeleteAccountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewPostCompaniesOK()
result := NewDeleteAccountOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewPostCompaniesUnauthorized()
result := NewDeleteAccountUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewPostCompaniesForbidden()
result := NewDeleteAccountForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewPostCompaniesNotFound()
result := NewDeleteAccountNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewPostCompaniesUnprocessableEntity()
result := NewDeleteAccountUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewPostCompaniesInternalServerError()
result := NewDeleteAccountInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
@ -68,30 +68,29 @@ func (o *PostCompaniesReader) ReadResponse(response runtime.ClientResponse, cons
}
}
// NewPostCompaniesOK creates a PostCompaniesOK with default headers values
func NewPostCompaniesOK() *PostCompaniesOK {
return &PostCompaniesOK{}
// NewDeleteAccountOK creates a DeleteAccountOK with default headers values
func NewDeleteAccountOK() *DeleteAccountOK {
return &DeleteAccountOK{}
}
/* PostCompaniesOK describes a response with status code 200, with default header values.
/* DeleteAccountOK describes a response with status code 200, with default header values.
Taxnexus Response with Company objects
Taxnexus Response with Message Objects with Delete Status
*/
type PostCompaniesOK struct {
type DeleteAccountOK struct {
AccessControlAllowOrigin string
CacheControl string
Payload *crm_models.CompanyResponse
Payload *sfgate_models.DeleteResponse
}
func (o *PostCompaniesOK) Error() string {
return fmt.Sprintf("[POST /companies][%d] postCompaniesOK %+v", 200, o.Payload)
func (o *DeleteAccountOK) Error() string {
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountOK %+v", 200, o.Payload)
}
func (o *PostCompaniesOK) GetPayload() *crm_models.CompanyResponse {
func (o *DeleteAccountOK) GetPayload() *sfgate_models.DeleteResponse {
return o.Payload
}
func (o *PostCompaniesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
func (o *DeleteAccountOK) 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")
@ -100,14 +99,7 @@ func (o *PostCompaniesOK) readResponse(response runtime.ClientResponse, consumer
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
// hydrates response header Cache-Control
hdrCacheControl := response.GetHeader("Cache-Control")
if hdrCacheControl != "" {
o.CacheControl = hdrCacheControl
}
o.Payload = new(crm_models.CompanyResponse)
o.Payload = new(sfgate_models.DeleteResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
@ -117,29 +109,29 @@ func (o *PostCompaniesOK) readResponse(response runtime.ClientResponse, consumer
return nil
}
// NewPostCompaniesUnauthorized creates a PostCompaniesUnauthorized with default headers values
func NewPostCompaniesUnauthorized() *PostCompaniesUnauthorized {
return &PostCompaniesUnauthorized{}
// NewDeleteAccountUnauthorized creates a DeleteAccountUnauthorized with default headers values
func NewDeleteAccountUnauthorized() *DeleteAccountUnauthorized {
return &DeleteAccountUnauthorized{}
}
/* PostCompaniesUnauthorized describes a response with status code 401, with default header values.
/* DeleteAccountUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type PostCompaniesUnauthorized struct {
type DeleteAccountUnauthorized struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
Payload *sfgate_models.Error
}
func (o *PostCompaniesUnauthorized) Error() string {
return fmt.Sprintf("[POST /companies][%d] postCompaniesUnauthorized %+v", 401, o.Payload)
func (o *DeleteAccountUnauthorized) Error() string {
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountUnauthorized %+v", 401, o.Payload)
}
func (o *PostCompaniesUnauthorized) GetPayload() *crm_models.Error {
func (o *DeleteAccountUnauthorized) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostCompaniesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
func (o *DeleteAccountUnauthorized) 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")
@ -148,7 +140,7 @@ func (o *PostCompaniesUnauthorized) readResponse(response runtime.ClientResponse
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(crm_models.Error)
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
@ -158,29 +150,29 @@ func (o *PostCompaniesUnauthorized) readResponse(response runtime.ClientResponse
return nil
}
// NewPostCompaniesForbidden creates a PostCompaniesForbidden with default headers values
func NewPostCompaniesForbidden() *PostCompaniesForbidden {
return &PostCompaniesForbidden{}
// NewDeleteAccountForbidden creates a DeleteAccountForbidden with default headers values
func NewDeleteAccountForbidden() *DeleteAccountForbidden {
return &DeleteAccountForbidden{}
}
/* PostCompaniesForbidden describes a response with status code 403, with default header values.
/* DeleteAccountForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type PostCompaniesForbidden struct {
type DeleteAccountForbidden struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
Payload *sfgate_models.Error
}
func (o *PostCompaniesForbidden) Error() string {
return fmt.Sprintf("[POST /companies][%d] postCompaniesForbidden %+v", 403, o.Payload)
func (o *DeleteAccountForbidden) Error() string {
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountForbidden %+v", 403, o.Payload)
}
func (o *PostCompaniesForbidden) GetPayload() *crm_models.Error {
func (o *DeleteAccountForbidden) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostCompaniesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
func (o *DeleteAccountForbidden) 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")
@ -189,7 +181,7 @@ func (o *PostCompaniesForbidden) readResponse(response runtime.ClientResponse, c
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(crm_models.Error)
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
@ -199,29 +191,29 @@ func (o *PostCompaniesForbidden) readResponse(response runtime.ClientResponse, c
return nil
}
// NewPostCompaniesNotFound creates a PostCompaniesNotFound with default headers values
func NewPostCompaniesNotFound() *PostCompaniesNotFound {
return &PostCompaniesNotFound{}
// NewDeleteAccountNotFound creates a DeleteAccountNotFound with default headers values
func NewDeleteAccountNotFound() *DeleteAccountNotFound {
return &DeleteAccountNotFound{}
}
/* PostCompaniesNotFound describes a response with status code 404, with default header values.
/* DeleteAccountNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type PostCompaniesNotFound struct {
type DeleteAccountNotFound struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
Payload *sfgate_models.Error
}
func (o *PostCompaniesNotFound) Error() string {
return fmt.Sprintf("[POST /companies][%d] postCompaniesNotFound %+v", 404, o.Payload)
func (o *DeleteAccountNotFound) Error() string {
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountNotFound %+v", 404, o.Payload)
}
func (o *PostCompaniesNotFound) GetPayload() *crm_models.Error {
func (o *DeleteAccountNotFound) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostCompaniesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
func (o *DeleteAccountNotFound) 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")
@ -230,7 +222,7 @@ func (o *PostCompaniesNotFound) readResponse(response runtime.ClientResponse, co
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(crm_models.Error)
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
@ -240,29 +232,29 @@ func (o *PostCompaniesNotFound) readResponse(response runtime.ClientResponse, co
return nil
}
// NewPostCompaniesUnprocessableEntity creates a PostCompaniesUnprocessableEntity with default headers values
func NewPostCompaniesUnprocessableEntity() *PostCompaniesUnprocessableEntity {
return &PostCompaniesUnprocessableEntity{}
// NewDeleteAccountUnprocessableEntity creates a DeleteAccountUnprocessableEntity with default headers values
func NewDeleteAccountUnprocessableEntity() *DeleteAccountUnprocessableEntity {
return &DeleteAccountUnprocessableEntity{}
}
/* PostCompaniesUnprocessableEntity describes a response with status code 422, with default header values.
/* DeleteAccountUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type PostCompaniesUnprocessableEntity struct {
type DeleteAccountUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
Payload *sfgate_models.Error
}
func (o *PostCompaniesUnprocessableEntity) Error() string {
return fmt.Sprintf("[POST /companies][%d] postCompaniesUnprocessableEntity %+v", 422, o.Payload)
func (o *DeleteAccountUnprocessableEntity) Error() string {
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PostCompaniesUnprocessableEntity) GetPayload() *crm_models.Error {
func (o *DeleteAccountUnprocessableEntity) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostCompaniesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
func (o *DeleteAccountUnprocessableEntity) 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")
@ -271,7 +263,7 @@ func (o *PostCompaniesUnprocessableEntity) readResponse(response runtime.ClientR
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(crm_models.Error)
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
@ -281,29 +273,29 @@ func (o *PostCompaniesUnprocessableEntity) readResponse(response runtime.ClientR
return nil
}
// NewPostCompaniesInternalServerError creates a PostCompaniesInternalServerError with default headers values
func NewPostCompaniesInternalServerError() *PostCompaniesInternalServerError {
return &PostCompaniesInternalServerError{}
// NewDeleteAccountInternalServerError creates a DeleteAccountInternalServerError with default headers values
func NewDeleteAccountInternalServerError() *DeleteAccountInternalServerError {
return &DeleteAccountInternalServerError{}
}
/* PostCompaniesInternalServerError describes a response with status code 500, with default header values.
/* DeleteAccountInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type PostCompaniesInternalServerError struct {
type DeleteAccountInternalServerError struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
Payload *sfgate_models.Error
}
func (o *PostCompaniesInternalServerError) Error() string {
return fmt.Sprintf("[POST /companies][%d] postCompaniesInternalServerError %+v", 500, o.Payload)
func (o *DeleteAccountInternalServerError) Error() string {
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountInternalServerError %+v", 500, o.Payload)
}
func (o *PostCompaniesInternalServerError) GetPayload() *crm_models.Error {
func (o *DeleteAccountInternalServerError) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostCompaniesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
func (o *DeleteAccountInternalServerError) 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")
@ -312,7 +304,7 @@ func (o *PostCompaniesInternalServerError) readResponse(response runtime.ClientR
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(crm_models.Error)
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {

View File

@ -66,16 +66,22 @@ type GetAccountsParams struct {
/* AccountID.
Taxnexus Id of the Account to be used a record retrieval
Taxnexus Record Id of an Account
*/
AccountID *string
/* Active.
Retrieve only active records?
Only retrieve active records?
*/
Active *bool
/* Email.
Email address used for identity lookup
*/
Email *string
/* Limit.
How many objects to return at one time
@ -84,9 +90,15 @@ type GetAccountsParams struct {
*/
Limit *int64
/* Name.
The Name of this Object
*/
Name *string
/* Offset.
How many objects to skip? (default 0)
How many objects to skip?
Format: int64
*/
@ -167,6 +179,17 @@ func (o *GetAccountsParams) SetActive(active *bool) {
o.Active = active
}
// WithEmail adds the email to the get accounts params
func (o *GetAccountsParams) WithEmail(email *string) *GetAccountsParams {
o.SetEmail(email)
return o
}
// SetEmail adds the email to the get accounts params
func (o *GetAccountsParams) SetEmail(email *string) {
o.Email = email
}
// WithLimit adds the limit to the get accounts params
func (o *GetAccountsParams) WithLimit(limit *int64) *GetAccountsParams {
o.SetLimit(limit)
@ -178,6 +201,17 @@ func (o *GetAccountsParams) SetLimit(limit *int64) {
o.Limit = limit
}
// WithName adds the name to the get accounts params
func (o *GetAccountsParams) WithName(name *string) *GetAccountsParams {
o.SetName(name)
return o
}
// SetName adds the name to the get accounts params
func (o *GetAccountsParams) SetName(name *string) {
o.Name = name
}
// WithOffset adds the offset to the get accounts params
func (o *GetAccountsParams) WithOffset(offset *int64) *GetAccountsParams {
o.SetOffset(offset)
@ -231,6 +265,23 @@ func (o *GetAccountsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R
}
}
if o.Email != nil {
// query param email
var qrEmail string
if o.Email != nil {
qrEmail = *o.Email
}
qEmail := qrEmail
if qEmail != "" {
if err := r.SetQueryParam("email", qEmail); err != nil {
return err
}
}
}
if o.Limit != nil {
// query param limit
@ -248,6 +299,23 @@ func (o *GetAccountsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R
}
}
if o.Name != nil {
// query param name
var qrName string
if o.Name != nil {
qrName = *o.Name
}
qName := qrName
if qName != "" {
if err := r.SetQueryParam("name", qName); err != nil {
return err
}
}
}
if o.Offset != nil {
// query param offset

View File

@ -75,9 +75,12 @@ func NewGetAccountsOK() *GetAccountsOK {
/* GetAccountsOK describes a response with status code 200, with default header values.
Taxnexus Response with Account objects
Taxnexus Response with Account objects with Contacts
*/
type GetAccountsOK struct {
AccessControlAllowOrigin string
CacheControl string
Payload *sfgate_models.AccountResponse
}
@ -90,6 +93,20 @@ func (o *GetAccountsOK) GetPayload() *sfgate_models.AccountResponse {
func (o *GetAccountsOK) 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.AccountResponse)
// response payload
@ -110,6 +127,8 @@ func NewGetAccountsUnauthorized() *GetAccountsUnauthorized {
Access unauthorized, invalid API-KEY was used
*/
type GetAccountsUnauthorized struct {
AccessControlAllowOrigin string
Payload *sfgate_models.Error
}
@ -122,6 +141,13 @@ func (o *GetAccountsUnauthorized) GetPayload() *sfgate_models.Error {
func (o *GetAccountsUnauthorized) 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
@ -142,6 +168,8 @@ func NewGetAccountsForbidden() *GetAccountsForbidden {
Access forbidden, account lacks access
*/
type GetAccountsForbidden struct {
AccessControlAllowOrigin string
Payload *sfgate_models.Error
}
@ -154,6 +182,13 @@ func (o *GetAccountsForbidden) GetPayload() *sfgate_models.Error {
func (o *GetAccountsForbidden) 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
@ -174,6 +209,8 @@ func NewGetAccountsNotFound() *GetAccountsNotFound {
Resource was not found
*/
type GetAccountsNotFound struct {
AccessControlAllowOrigin string
Payload *sfgate_models.Error
}
@ -186,6 +223,13 @@ func (o *GetAccountsNotFound) GetPayload() *sfgate_models.Error {
func (o *GetAccountsNotFound) 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
@ -206,6 +250,8 @@ func NewGetAccountsUnprocessableEntity() *GetAccountsUnprocessableEntity {
Unprocessable Entity, likely a bad parameter
*/
type GetAccountsUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *sfgate_models.Error
}
@ -218,6 +264,13 @@ func (o *GetAccountsUnprocessableEntity) GetPayload() *sfgate_models.Error {
func (o *GetAccountsUnprocessableEntity) 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
@ -238,6 +291,8 @@ func NewGetAccountsInternalServerError() *GetAccountsInternalServerError {
Server Internal Error
*/
type GetAccountsInternalServerError struct {
AccessControlAllowOrigin string
Payload *sfgate_models.Error
}
@ -250,6 +305,13 @@ func (o *GetAccountsInternalServerError) GetPayload() *sfgate_models.Error {
func (o *GetAccountsInternalServerError) 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

View File

@ -51,6 +51,12 @@ func (o *PostAccountsReader) ReadResponse(response runtime.ClientResponse, consu
return nil, err
}
return nil, result
case 422:
result := NewPostAccountsUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewPostAccountsInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
@ -69,9 +75,12 @@ func NewPostAccountsOK() *PostAccountsOK {
/* PostAccountsOK describes a response with status code 200, with default header values.
Taxnexus Response with Account objects
Taxnexus Response with Account objects with Contacts
*/
type PostAccountsOK struct {
AccessControlAllowOrigin string
CacheControl string
Payload *sfgate_models.AccountResponse
}
@ -84,6 +93,20 @@ func (o *PostAccountsOK) GetPayload() *sfgate_models.AccountResponse {
func (o *PostAccountsOK) 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.AccountResponse)
// response payload
@ -104,6 +127,8 @@ func NewPostAccountsUnauthorized() *PostAccountsUnauthorized {
Access unauthorized, invalid API-KEY was used
*/
type PostAccountsUnauthorized struct {
AccessControlAllowOrigin string
Payload *sfgate_models.Error
}
@ -116,6 +141,13 @@ func (o *PostAccountsUnauthorized) GetPayload() *sfgate_models.Error {
func (o *PostAccountsUnauthorized) 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
@ -136,6 +168,8 @@ func NewPostAccountsForbidden() *PostAccountsForbidden {
Access forbidden, account lacks access
*/
type PostAccountsForbidden struct {
AccessControlAllowOrigin string
Payload *sfgate_models.Error
}
@ -148,6 +182,13 @@ func (o *PostAccountsForbidden) GetPayload() *sfgate_models.Error {
func (o *PostAccountsForbidden) 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
@ -168,6 +209,8 @@ func NewPostAccountsNotFound() *PostAccountsNotFound {
Resource was not found
*/
type PostAccountsNotFound struct {
AccessControlAllowOrigin string
Payload *sfgate_models.Error
}
@ -180,6 +223,54 @@ func (o *PostAccountsNotFound) GetPayload() *sfgate_models.Error {
func (o *PostAccountsNotFound) 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
}
// NewPostAccountsUnprocessableEntity creates a PostAccountsUnprocessableEntity with default headers values
func NewPostAccountsUnprocessableEntity() *PostAccountsUnprocessableEntity {
return &PostAccountsUnprocessableEntity{}
}
/* PostAccountsUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type PostAccountsUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *sfgate_models.Error
}
func (o *PostAccountsUnprocessableEntity) Error() string {
return fmt.Sprintf("[POST /accounts][%d] postAccountsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PostAccountsUnprocessableEntity) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostAccountsUnprocessableEntity) 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
@ -200,6 +291,8 @@ func NewPostAccountsInternalServerError() *PostAccountsInternalServerError {
Server Internal Error
*/
type PostAccountsInternalServerError struct {
AccessControlAllowOrigin string
Payload *sfgate_models.Error
}
@ -212,6 +305,13 @@ func (o *PostAccountsInternalServerError) GetPayload() *sfgate_models.Error {
func (o *PostAccountsInternalServerError) 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

View File

@ -51,6 +51,12 @@ func (o *PutAccountReader) ReadResponse(response runtime.ClientResponse, consume
return nil, err
}
return nil, result
case 422:
result := NewPutAccountUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewPutAccountInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
@ -69,9 +75,12 @@ func NewPutAccountOK() *PutAccountOK {
/* PutAccountOK describes a response with status code 200, with default header values.
Taxnexus Response with Account objects
Taxnexus Response with Account objects with Contacts
*/
type PutAccountOK struct {
AccessControlAllowOrigin string
CacheControl string
Payload *sfgate_models.AccountResponse
}
@ -84,6 +93,20 @@ func (o *PutAccountOK) GetPayload() *sfgate_models.AccountResponse {
func (o *PutAccountOK) 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.AccountResponse)
// response payload
@ -104,6 +127,8 @@ func NewPutAccountUnauthorized() *PutAccountUnauthorized {
Access unauthorized, invalid API-KEY was used
*/
type PutAccountUnauthorized struct {
AccessControlAllowOrigin string
Payload *sfgate_models.Error
}
@ -116,6 +141,13 @@ func (o *PutAccountUnauthorized) GetPayload() *sfgate_models.Error {
func (o *PutAccountUnauthorized) 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
@ -136,6 +168,8 @@ func NewPutAccountForbidden() *PutAccountForbidden {
Access forbidden, account lacks access
*/
type PutAccountForbidden struct {
AccessControlAllowOrigin string
Payload *sfgate_models.Error
}
@ -148,6 +182,13 @@ func (o *PutAccountForbidden) GetPayload() *sfgate_models.Error {
func (o *PutAccountForbidden) 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
@ -168,6 +209,8 @@ func NewPutAccountNotFound() *PutAccountNotFound {
Resource was not found
*/
type PutAccountNotFound struct {
AccessControlAllowOrigin string
Payload *sfgate_models.Error
}
@ -180,6 +223,54 @@ func (o *PutAccountNotFound) GetPayload() *sfgate_models.Error {
func (o *PutAccountNotFound) 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
}
// NewPutAccountUnprocessableEntity creates a PutAccountUnprocessableEntity with default headers values
func NewPutAccountUnprocessableEntity() *PutAccountUnprocessableEntity {
return &PutAccountUnprocessableEntity{}
}
/* PutAccountUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type PutAccountUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *sfgate_models.Error
}
func (o *PutAccountUnprocessableEntity) Error() string {
return fmt.Sprintf("[PUT /accounts][%d] putAccountUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PutAccountUnprocessableEntity) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PutAccountUnprocessableEntity) 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
@ -200,6 +291,8 @@ func NewPutAccountInternalServerError() *PutAccountInternalServerError {
Server Internal Error
*/
type PutAccountInternalServerError struct {
AccessControlAllowOrigin string
Payload *sfgate_models.Error
}
@ -212,6 +305,13 @@ func (o *PutAccountInternalServerError) GetPayload() *sfgate_models.Error {
func (o *PutAccountInternalServerError) 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

View File

@ -0,0 +1,172 @@
// 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 clusters
// 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 clusters API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
return &Client{transport: transport, formats: formats}
}
/*
Client for clusters 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 {
GetClusters(params *GetClustersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetClustersOK, error)
PostClusters(params *PostClustersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostClustersOK, error)
PutClusters(params *PutClustersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutClustersOK, error)
SetTransport(transport runtime.ClientTransport)
}
/*
GetClusters gets a list clusters
Return a list of Cluster records from the datastore
*/
func (a *Client) GetClusters(params *GetClustersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetClustersOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetClustersParams()
}
op := &runtime.ClientOperation{
ID: "getClusters",
Method: "GET",
PathPattern: "/clusters",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &GetClustersReader{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.(*GetClustersOK)
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 getClusters: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
PostClusters creates new clusters
Create Clusters in Taxnexus
*/
func (a *Client) PostClusters(params *PostClustersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostClustersOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPostClustersParams()
}
op := &runtime.ClientOperation{
ID: "postClusters",
Method: "POST",
PathPattern: "/clusters",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PostClustersReader{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.(*PostClustersOK)
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 postClusters: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
PutClusters updates clusters
Update Cluster in Taxnexus
*/
func (a *Client) PutClusters(params *PutClustersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutClustersOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPutClustersParams()
}
op := &runtime.ClientOperation{
ID: "putClusters",
Method: "PUT",
PathPattern: "/clusters",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PutClustersReader{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.(*PutClustersOK)
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 putClusters: 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,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 clusters
// 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"
)
// NewGetClustersParams creates a new GetClustersParams 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 NewGetClustersParams() *GetClustersParams {
return &GetClustersParams{
timeout: cr.DefaultTimeout,
}
}
// NewGetClustersParamsWithTimeout creates a new GetClustersParams object
// with the ability to set a timeout on a request.
func NewGetClustersParamsWithTimeout(timeout time.Duration) *GetClustersParams {
return &GetClustersParams{
timeout: timeout,
}
}
// NewGetClustersParamsWithContext creates a new GetClustersParams object
// with the ability to set a context for a request.
func NewGetClustersParamsWithContext(ctx context.Context) *GetClustersParams {
return &GetClustersParams{
Context: ctx,
}
}
// NewGetClustersParamsWithHTTPClient creates a new GetClustersParams object
// with the ability to set a custom HTTPClient for a request.
func NewGetClustersParamsWithHTTPClient(client *http.Client) *GetClustersParams {
return &GetClustersParams{
HTTPClient: client,
}
}
/* GetClustersParams contains all the parameters to send to the API endpoint
for the get clusters operation.
Typically these are written to a http.Request.
*/
type GetClustersParams struct {
/* ClusterID.
Taxnexus Record Id of a Cluster
*/
ClusterID *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 clusters params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetClustersParams) WithDefaults() *GetClustersParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the get clusters params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetClustersParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the get clusters params
func (o *GetClustersParams) WithTimeout(timeout time.Duration) *GetClustersParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the get clusters params
func (o *GetClustersParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the get clusters params
func (o *GetClustersParams) WithContext(ctx context.Context) *GetClustersParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get clusters params
func (o *GetClustersParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the get clusters params
func (o *GetClustersParams) WithHTTPClient(client *http.Client) *GetClustersParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the get clusters params
func (o *GetClustersParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithClusterID adds the clusterID to the get clusters params
func (o *GetClustersParams) WithClusterID(clusterID *string) *GetClustersParams {
o.SetClusterID(clusterID)
return o
}
// SetClusterID adds the clusterId to the get clusters params
func (o *GetClustersParams) SetClusterID(clusterID *string) {
o.ClusterID = clusterID
}
// WithLimit adds the limit to the get clusters params
func (o *GetClustersParams) WithLimit(limit *int64) *GetClustersParams {
o.SetLimit(limit)
return o
}
// SetLimit adds the limit to the get clusters params
func (o *GetClustersParams) SetLimit(limit *int64) {
o.Limit = limit
}
// WithOffset adds the offset to the get clusters params
func (o *GetClustersParams) WithOffset(offset *int64) *GetClustersParams {
o.SetOffset(offset)
return o
}
// SetOffset adds the offset to the get clusters params
func (o *GetClustersParams) SetOffset(offset *int64) {
o.Offset = offset
}
// WriteToRequest writes these params to a swagger request
func (o *GetClustersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.ClusterID != nil {
// query param clusterId
var qrClusterID string
if o.ClusterID != nil {
qrClusterID = *o.ClusterID
}
qClusterID := qrClusterID
if qClusterID != "" {
if err := r.SetQueryParam("clusterId", qClusterID); 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,306 @@
// 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 clusters
// 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"
)
// GetClustersReader is a Reader for the GetClusters structure.
type GetClustersReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetClustersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetClustersOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewGetClustersUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewGetClustersForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewGetClustersNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewGetClustersUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewGetClustersInternalServerError()
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())
}
}
// NewGetClustersOK creates a GetClustersOK with default headers values
func NewGetClustersOK() *GetClustersOK {
return &GetClustersOK{}
}
/* GetClustersOK describes a response with status code 200, with default header values.
Taxnexus Response with Cluster objects
*/
type GetClustersOK struct {
Payload *sfgate_models.ClusterResponse
}
func (o *GetClustersOK) Error() string {
return fmt.Sprintf("[GET /clusters][%d] getClustersOK %+v", 200, o.Payload)
}
func (o *GetClustersOK) GetPayload() *sfgate_models.ClusterResponse {
return o.Payload
}
func (o *GetClustersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.ClusterResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetClustersUnauthorized creates a GetClustersUnauthorized with default headers values
func NewGetClustersUnauthorized() *GetClustersUnauthorized {
return &GetClustersUnauthorized{}
}
/* GetClustersUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type GetClustersUnauthorized struct {
AccessControlAllowOrigin string
Payload *sfgate_models.Error
}
func (o *GetClustersUnauthorized) Error() string {
return fmt.Sprintf("[GET /clusters][%d] getClustersUnauthorized %+v", 401, o.Payload)
}
func (o *GetClustersUnauthorized) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetClustersUnauthorized) 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
}
// NewGetClustersForbidden creates a GetClustersForbidden with default headers values
func NewGetClustersForbidden() *GetClustersForbidden {
return &GetClustersForbidden{}
}
/* GetClustersForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type GetClustersForbidden struct {
AccessControlAllowOrigin string
Payload *sfgate_models.Error
}
func (o *GetClustersForbidden) Error() string {
return fmt.Sprintf("[GET /clusters][%d] getClustersForbidden %+v", 403, o.Payload)
}
func (o *GetClustersForbidden) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetClustersForbidden) 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
}
// NewGetClustersNotFound creates a GetClustersNotFound with default headers values
func NewGetClustersNotFound() *GetClustersNotFound {
return &GetClustersNotFound{}
}
/* GetClustersNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type GetClustersNotFound struct {
AccessControlAllowOrigin string
Payload *sfgate_models.Error
}
func (o *GetClustersNotFound) Error() string {
return fmt.Sprintf("[GET /clusters][%d] getClustersNotFound %+v", 404, o.Payload)
}
func (o *GetClustersNotFound) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetClustersNotFound) 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
}
// NewGetClustersUnprocessableEntity creates a GetClustersUnprocessableEntity with default headers values
func NewGetClustersUnprocessableEntity() *GetClustersUnprocessableEntity {
return &GetClustersUnprocessableEntity{}
}
/* GetClustersUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type GetClustersUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *sfgate_models.Error
}
func (o *GetClustersUnprocessableEntity) Error() string {
return fmt.Sprintf("[GET /clusters][%d] getClustersUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetClustersUnprocessableEntity) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetClustersUnprocessableEntity) 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
}
// NewGetClustersInternalServerError creates a GetClustersInternalServerError with default headers values
func NewGetClustersInternalServerError() *GetClustersInternalServerError {
return &GetClustersInternalServerError{}
}
/* GetClustersInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type GetClustersInternalServerError struct {
AccessControlAllowOrigin string
Payload *sfgate_models.Error
}
func (o *GetClustersInternalServerError) Error() string {
return fmt.Sprintf("[GET /clusters][%d] getClustersInternalServerError %+v", 500, o.Payload)
}
func (o *GetClustersInternalServerError) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetClustersInternalServerError) 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 clusters
// 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"
)
// NewPostClustersParams creates a new PostClustersParams 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 NewPostClustersParams() *PostClustersParams {
return &PostClustersParams{
timeout: cr.DefaultTimeout,
}
}
// NewPostClustersParamsWithTimeout creates a new PostClustersParams object
// with the ability to set a timeout on a request.
func NewPostClustersParamsWithTimeout(timeout time.Duration) *PostClustersParams {
return &PostClustersParams{
timeout: timeout,
}
}
// NewPostClustersParamsWithContext creates a new PostClustersParams object
// with the ability to set a context for a request.
func NewPostClustersParamsWithContext(ctx context.Context) *PostClustersParams {
return &PostClustersParams{
Context: ctx,
}
}
// NewPostClustersParamsWithHTTPClient creates a new PostClustersParams object
// with the ability to set a custom HTTPClient for a request.
func NewPostClustersParamsWithHTTPClient(client *http.Client) *PostClustersParams {
return &PostClustersParams{
HTTPClient: client,
}
}
/* PostClustersParams contains all the parameters to send to the API endpoint
for the post clusters operation.
Typically these are written to a http.Request.
*/
type PostClustersParams struct {
/* ClusterRequest.
An array of Cluster records
*/
ClusterRequest *sfgate_models.ClusterRequest
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the post clusters params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostClustersParams) WithDefaults() *PostClustersParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the post clusters params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostClustersParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the post clusters params
func (o *PostClustersParams) WithTimeout(timeout time.Duration) *PostClustersParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the post clusters params
func (o *PostClustersParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the post clusters params
func (o *PostClustersParams) WithContext(ctx context.Context) *PostClustersParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the post clusters params
func (o *PostClustersParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the post clusters params
func (o *PostClustersParams) WithHTTPClient(client *http.Client) *PostClustersParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the post clusters params
func (o *PostClustersParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithClusterRequest adds the clusterRequest to the post clusters params
func (o *PostClustersParams) WithClusterRequest(clusterRequest *sfgate_models.ClusterRequest) *PostClustersParams {
o.SetClusterRequest(clusterRequest)
return o
}
// SetClusterRequest adds the clusterRequest to the post clusters params
func (o *PostClustersParams) SetClusterRequest(clusterRequest *sfgate_models.ClusterRequest) {
o.ClusterRequest = clusterRequest
}
// WriteToRequest writes these params to a swagger request
func (o *PostClustersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.ClusterRequest != nil {
if err := r.SetBodyParam(o.ClusterRequest); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

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