Compare commits
4 Commits
Author | SHA1 | Date |
---|---|---|
Vernon Keenan | 0ee3e2122f | |
Vernon Keenan | 652d4873be | |
Vernon Keenan | d71d3ccdef | |
Vernon Keenan | 83795da8f0 |
72
Makefile
72
Makefile
|
@ -6,7 +6,7 @@ swagger:
|
|||
#
|
||||
rm -rf ./api
|
||||
mkdir -p api/auth
|
||||
swagger generate client \
|
||||
swagger-new generate client \
|
||||
--log-output=./swagger/logs/generate-auth-client.log \
|
||||
--copyright-file=./build/COPYRIGHT \
|
||||
--name=auth \
|
||||
|
@ -14,12 +14,12 @@ swagger:
|
|||
--target=./api/auth \
|
||||
--client-package=auth-client \
|
||||
--model-package=auth-models \
|
||||
--principal=app.User
|
||||
--principal=app.User &
|
||||
#
|
||||
# generate auth0
|
||||
#
|
||||
mkdir -p api/auth0
|
||||
swagger generate client \
|
||||
swagger-new generate client \
|
||||
--log-output=./swagger/logs/generate-auth0-client.log \
|
||||
--copyright-file=./build/COPYRIGHT \
|
||||
--name=auth0 \
|
||||
|
@ -27,12 +27,12 @@ swagger:
|
|||
--target=./api/auth0 \
|
||||
--client-package=auth0-client \
|
||||
--model-package=auth0-models \
|
||||
--principal=app.User
|
||||
--principal=app.User &
|
||||
#
|
||||
# generate blaze
|
||||
#
|
||||
mkdir api/blaze
|
||||
swagger generate client \
|
||||
swagger-new generate client \
|
||||
--log-output=./swagger/logs/generate-blaze-client.log \
|
||||
--copyright-file=./build/COPYRIGHT \
|
||||
--name=blaze \
|
||||
|
@ -40,12 +40,12 @@ swagger:
|
|||
--target=./api/blaze \
|
||||
--client-package=blaze-client \
|
||||
--model-package=blaze-models \
|
||||
--principal=app.User
|
||||
--principal=app.User &
|
||||
#
|
||||
# generate crm
|
||||
#
|
||||
mkdir api/crm
|
||||
swagger generate client \
|
||||
swagger-new generate client \
|
||||
--log-output=./swagger/logs/generate-crm-client.log \
|
||||
--copyright-file=./build/COPYRIGHT \
|
||||
--name=crm \
|
||||
|
@ -53,12 +53,12 @@ swagger:
|
|||
--target=./api/crm \
|
||||
--client-package=crm-client \
|
||||
--model-package=crm-models \
|
||||
--principal=app.User
|
||||
--principal=app.User &
|
||||
#
|
||||
# generate devops
|
||||
#
|
||||
mkdir api/devops
|
||||
swagger generate client \
|
||||
swagger-new generate client \
|
||||
--log-output=./swagger/logs/generate-devops-client.log \
|
||||
--copyright-file=./build/COPYRIGHT \
|
||||
--name=devops \
|
||||
|
@ -66,12 +66,12 @@ swagger:
|
|||
--target=./api/devops \
|
||||
--client-package=devops-client \
|
||||
--model-package=devops-models \
|
||||
--principal=app.User
|
||||
--principal=app.User &
|
||||
#
|
||||
# generate geo
|
||||
#
|
||||
mkdir api/geo
|
||||
swagger generate client \
|
||||
swagger-new generate client \
|
||||
--log-output=./swagger/logs/generate-geo-client.log \
|
||||
--copyright-file=./build/COPYRIGHT \
|
||||
--name=geo \
|
||||
|
@ -79,12 +79,12 @@ swagger:
|
|||
--target=./api/geo \
|
||||
--client-package=geo-client \
|
||||
--model-package=geo-models \
|
||||
--principal=app.User
|
||||
--principal=app.User &
|
||||
#
|
||||
# generate gov-gw
|
||||
#
|
||||
mkdir api/gov-gw
|
||||
swagger generate client \
|
||||
swagger-new generate client \
|
||||
--log-output=./swagger/logs/generate-gov-gw-client.log \
|
||||
--copyright-file=./build/COPYRIGHT \
|
||||
--name=gov-gw \
|
||||
|
@ -92,12 +92,12 @@ swagger:
|
|||
--target=./api/gov-gw \
|
||||
--client-package=gov-gw-client \
|
||||
--model-package=gov-gw-models \
|
||||
--principal=app.User
|
||||
--principal=app.User &
|
||||
#
|
||||
# generate ledger
|
||||
#
|
||||
mkdir api/ledger
|
||||
swagger generate client \
|
||||
swagger-new generate client \
|
||||
--log-output=./swagger/logs/generate-ledger-client.log \
|
||||
--copyright-file=./build/COPYRIGHT \
|
||||
--name=ledger \
|
||||
|
@ -105,12 +105,12 @@ swagger:
|
|||
--target=./api/ledger \
|
||||
--client-package=ledger-client \
|
||||
--model-package=ledger-models \
|
||||
--principal=app.User
|
||||
--principal=app.User &
|
||||
#
|
||||
# generate metrc-gw
|
||||
#
|
||||
mkdir api/metrc-gw
|
||||
swagger generate client \
|
||||
swagger-new generate client \
|
||||
--log-output=./swagger/logs/generate-metrc-gw-client.log \
|
||||
--copyright-file=./build/COPYRIGHT \
|
||||
--name=metrc-gw \
|
||||
|
@ -118,12 +118,12 @@ swagger:
|
|||
--target=./api/metrc-gw \
|
||||
--client-package=metrc-gw-client \
|
||||
--model-package=metrc-gw-models \
|
||||
--principal=app.User
|
||||
--principal=app.User &
|
||||
#
|
||||
# generate ops
|
||||
#
|
||||
mkdir api/ops
|
||||
swagger generate client \
|
||||
swagger-new generate client \
|
||||
--log-output=./swagger/logs/generate-ops-client.log \
|
||||
--copyright-file=./build/COPYRIGHT \
|
||||
--name=ops \
|
||||
|
@ -131,12 +131,12 @@ swagger:
|
|||
--target=./api/ops \
|
||||
--client-package=ops-client \
|
||||
--model-package=ops-models \
|
||||
--principal=app.User
|
||||
--principal=app.User &
|
||||
#
|
||||
# generate pdf
|
||||
#
|
||||
mkdir api/pdf
|
||||
swagger generate client \
|
||||
swagger-new generate client \
|
||||
--log-output=./swagger/logs/generate-pdf-client.log \
|
||||
--copyright-file=./build/COPYRIGHT \
|
||||
--name=pdf \
|
||||
|
@ -144,12 +144,12 @@ swagger:
|
|||
--target=./api/pdf \
|
||||
--client-package=pdf-client \
|
||||
--model-package=pdf-models \
|
||||
--principal=app.User
|
||||
--principal=app.User &
|
||||
#
|
||||
# generate plex
|
||||
#
|
||||
mkdir api/plex
|
||||
swagger generate client \
|
||||
swagger-new generate client \
|
||||
--log-output=./swagger/logs/generate-plex-client.log \
|
||||
--copyright-file=./build/COPYRIGHT \
|
||||
--name=plex \
|
||||
|
@ -157,12 +157,12 @@ swagger:
|
|||
--target=./api/plex \
|
||||
--client-package=plex-client \
|
||||
--model-package=plex-models \
|
||||
--principal=app.User
|
||||
--principal=app.User &
|
||||
#
|
||||
# generate regs
|
||||
#
|
||||
mkdir api/regs
|
||||
swagger generate client \
|
||||
swagger-new generate client \
|
||||
--log-output=./swagger/logs/generate-regs-client.log \
|
||||
--copyright-file=./build/COPYRIGHT \
|
||||
--name=regs \
|
||||
|
@ -170,12 +170,12 @@ swagger:
|
|||
--target=./api/regs \
|
||||
--client-package=regs-client \
|
||||
--model-package=regs-models \
|
||||
--principal=app.User
|
||||
--principal=app.User &
|
||||
#
|
||||
# generate render
|
||||
#
|
||||
mkdir api/render
|
||||
swagger generate client \
|
||||
swagger-new generate client \
|
||||
--log-output=./swagger/logs/generate-render-client.log \
|
||||
--copyright-file=./build/COPYRIGHT \
|
||||
--name=render \
|
||||
|
@ -183,12 +183,12 @@ swagger:
|
|||
--target=./api/render \
|
||||
--client-package=render-client \
|
||||
--model-package=render-models \
|
||||
--principal=app.User
|
||||
--principal=app.User &
|
||||
#
|
||||
# generate sf-gate
|
||||
#
|
||||
mkdir api/sf-gate
|
||||
swagger generate client \
|
||||
swagger-new generate client \
|
||||
--log-output=./swagger/logs/generate-sf-gate-client.log \
|
||||
--copyright-file=./build/COPYRIGHT \
|
||||
--name=sf-gate \
|
||||
|
@ -196,12 +196,12 @@ swagger:
|
|||
--target=./api/sf-gate \
|
||||
--client-package=sf-gate-client \
|
||||
--model-package=sf-gate-models \
|
||||
--principal=app.User
|
||||
--principal=app.User &
|
||||
#
|
||||
# generate stash
|
||||
#
|
||||
mkdir api/stash
|
||||
swagger generate client \
|
||||
swagger-new generate client \
|
||||
--log-output=./swagger/logs/generate-stash-client.log \
|
||||
--copyright-file=./build/COPYRIGHT \
|
||||
--name=stash \
|
||||
|
@ -209,12 +209,12 @@ swagger:
|
|||
--target=./api/stash \
|
||||
--client-package=stash-client \
|
||||
--model-package=stash-models \
|
||||
--principal=app.User
|
||||
--principal=app.User &
|
||||
#
|
||||
# generate vendor-gw
|
||||
#
|
||||
mkdir api/vendor-gw
|
||||
swagger generate client \
|
||||
swagger-new generate client \
|
||||
--log-output=./swagger/logs/generate-vendor-gw-client.log \
|
||||
--copyright-file=./build/COPYRIGHT \
|
||||
--name=vendor-gw \
|
||||
|
@ -222,12 +222,12 @@ swagger:
|
|||
--target=./api/vendor-gw \
|
||||
--client-package=vendor-gw-client \
|
||||
--model-package=vendor-gw-models \
|
||||
--principal=app.User
|
||||
--principal=app.User &
|
||||
#
|
||||
# generate workflow
|
||||
#
|
||||
mkdir api/workflow
|
||||
swagger generate client \
|
||||
swagger-new generate client \
|
||||
--log-output=./swagger/logs/generate-workflow-client.log \
|
||||
--copyright-file=./build/COPYRIGHT \
|
||||
--name=workflow \
|
||||
|
@ -235,4 +235,4 @@ swagger:
|
|||
--target=./api/workflow \
|
||||
--client-package=workflow-client \
|
||||
--model-package=workflow-models \
|
||||
--principal=app.User
|
||||
--principal=app.User &
|
||||
|
|
|
@ -20,53 +20,52 @@ import (
|
|||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// NewGetUsersParams creates a new GetUsersParams object
|
||||
// with the default values initialized.
|
||||
// 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 {
|
||||
var ()
|
||||
return &GetUsersParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetUsersParamsWithTimeout creates a new GetUsersParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetUsersParamsWithTimeout(timeout time.Duration) *GetUsersParams {
|
||||
var ()
|
||||
return &GetUsersParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetUsersParamsWithContext creates a new GetUsersParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
// with the ability to set a context for a request.
|
||||
func NewGetUsersParamsWithContext(ctx context.Context) *GetUsersParams {
|
||||
var ()
|
||||
return &GetUsersParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetUsersParamsWithHTTPClient creates a new GetUsersParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewGetUsersParamsWithHTTPClient(client *http.Client) *GetUsersParams {
|
||||
var ()
|
||||
return &GetUsersParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/* GetUsersParams contains all the parameters to send to the API endpoint
|
||||
for the get users operation typically these are written to a http.Request
|
||||
for the get users operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type GetUsersParams struct {
|
||||
|
||||
/*Apikey
|
||||
Service account or developer API key
|
||||
/* Apikey.
|
||||
|
||||
Service account or developer API key
|
||||
*/
|
||||
Apikey *string
|
||||
|
||||
|
@ -75,6 +74,21 @@ type GetUsersParams struct {
|
|||
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)
|
||||
|
@ -131,16 +145,17 @@ func (o *GetUsersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Regi
|
|||
|
||||
// query param apikey
|
||||
var qrApikey string
|
||||
|
||||
if o.Apikey != nil {
|
||||
qrApikey = *o.Apikey
|
||||
}
|
||||
qApikey := qrApikey
|
||||
if qApikey != "" {
|
||||
|
||||
if err := r.SetQueryParam("apikey", qApikey); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
|
|
|
@ -63,9 +63,8 @@ func (o *GetUsersReader) ReadResponse(response runtime.ClientResponse, consumer
|
|||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -74,7 +73,7 @@ func NewGetUsersOK() *GetUsersOK {
|
|||
return &GetUsersOK{}
|
||||
}
|
||||
|
||||
/*GetUsersOK handles this case with default header values.
|
||||
/* GetUsersOK describes a response with status code 200, with default header values.
|
||||
|
||||
Taxnexus Response with User objects
|
||||
*/
|
||||
|
@ -85,7 +84,6 @@ type GetUsersOK struct {
|
|||
func (o *GetUsersOK) Error() string {
|
||||
return fmt.Sprintf("[GET /users][%d] getUsersOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetUsersOK) GetPayload() *auth_models.UserResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -107,7 +105,7 @@ func NewGetUsersUnauthorized() *GetUsersUnauthorized {
|
|||
return &GetUsersUnauthorized{}
|
||||
}
|
||||
|
||||
/*GetUsersUnauthorized handles this case with default header values.
|
||||
/* GetUsersUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access Unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
|
@ -118,7 +116,6 @@ type GetUsersUnauthorized struct {
|
|||
func (o *GetUsersUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /users][%d] getUsersUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetUsersUnauthorized) GetPayload() *auth_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -140,7 +137,7 @@ func NewGetUsersForbidden() *GetUsersForbidden {
|
|||
return &GetUsersForbidden{}
|
||||
}
|
||||
|
||||
/*GetUsersForbidden handles this case with default header values.
|
||||
/* GetUsersForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
|
@ -151,7 +148,6 @@ type GetUsersForbidden struct {
|
|||
func (o *GetUsersForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /users][%d] getUsersForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetUsersForbidden) GetPayload() *auth_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -173,7 +169,7 @@ func NewGetUsersNotFound() *GetUsersNotFound {
|
|||
return &GetUsersNotFound{}
|
||||
}
|
||||
|
||||
/*GetUsersNotFound handles this case with default header values.
|
||||
/* GetUsersNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
|
@ -184,7 +180,6 @@ type GetUsersNotFound struct {
|
|||
func (o *GetUsersNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /users][%d] getUsersNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetUsersNotFound) GetPayload() *auth_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -206,7 +201,7 @@ func NewGetUsersUnprocessableEntity() *GetUsersUnprocessableEntity {
|
|||
return &GetUsersUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*GetUsersUnprocessableEntity handles this case with default header values.
|
||||
/* GetUsersUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
|
@ -217,7 +212,6 @@ type GetUsersUnprocessableEntity struct {
|
|||
func (o *GetUsersUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[GET /users][%d] getUsersUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetUsersUnprocessableEntity) GetPayload() *auth_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -239,7 +233,7 @@ func NewGetUsersInternalServerError() *GetUsersInternalServerError {
|
|||
return &GetUsersInternalServerError{}
|
||||
}
|
||||
|
||||
/*GetUsersInternalServerError handles this case with default header values.
|
||||
/* GetUsersInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
|
@ -250,7 +244,6 @@ type GetUsersInternalServerError struct {
|
|||
func (o *GetUsersInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /users][%d] getUsersInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetUsersInternalServerError) GetPayload() *auth_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
|
|
@ -29,9 +29,12 @@ type Client struct {
|
|||
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) (*GetUsersOK, error)
|
||||
GetUsers(params *GetUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetUsersOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
@ -41,13 +44,12 @@ type ClientService interface {
|
|||
|
||||
Checks for a valid API key, and returns full user record
|
||||
*/
|
||||
func (a *Client) GetUsers(params *GetUsersParams, authInfo runtime.ClientAuthInfoWriter) (*GetUsersOK, error) {
|
||||
func (a *Client) GetUsers(params *GetUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetUsersOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetUsersParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "getUsers",
|
||||
Method: "GET",
|
||||
PathPattern: "/users",
|
||||
|
@ -59,7 +61,12 @@ func (a *Client) GetUsers(params *GetUsersParams, authInfo runtime.ClientAuthInf
|
|||
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
|
||||
}
|
||||
|
|
|
@ -10,6 +10,8 @@ package auth_models
|
|||
// 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"
|
||||
)
|
||||
|
@ -46,6 +48,11 @@ func (m *Address) Validate(formats strfmt.Registry) error {
|
|||
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 {
|
||||
|
|
|
@ -10,6 +10,8 @@ package auth_models
|
|||
// 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"
|
||||
)
|
||||
|
@ -34,6 +36,11 @@ 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 {
|
||||
|
|
|
@ -10,6 +10,8 @@ package auth_models
|
|||
// 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"
|
||||
)
|
||||
|
@ -58,6 +60,11 @@ func (m *ResponseMeta) Validate(formats strfmt.Registry) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this response meta based on context it is used
|
||||
func (m *ResponseMeta) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *ResponseMeta) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
|
|
|
@ -10,6 +10,8 @@ package auth_models
|
|||
// 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"
|
||||
)
|
||||
|
@ -73,6 +75,11 @@ 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 {
|
||||
|
|
|
@ -10,6 +10,7 @@ package auth_models
|
|||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strconv"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
|
@ -220,7 +221,6 @@ func (m *User) Validate(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *User) validateAddress(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Address) { // not required
|
||||
return nil
|
||||
}
|
||||
|
@ -238,7 +238,6 @@ func (m *User) validateAddress(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *User) validateTenantUsers(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.TenantUsers) { // not required
|
||||
return nil
|
||||
}
|
||||
|
@ -263,7 +262,6 @@ func (m *User) validateTenantUsers(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *User) validateUserRoles(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.UserRoles) { // not required
|
||||
return nil
|
||||
}
|
||||
|
@ -287,6 +285,78 @@ func (m *User) validateUserRoles(formats strfmt.Registry) error {
|
|||
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 {
|
||||
|
|
|
@ -10,6 +10,7 @@ package auth_models
|
|||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strconv"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
|
@ -48,7 +49,6 @@ func (m *UserResponse) Validate(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *UserResponse) validateData(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Data) { // not required
|
||||
return nil
|
||||
}
|
||||
|
@ -73,7 +73,6 @@ func (m *UserResponse) validateData(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *UserResponse) validateMeta(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Meta) { // not required
|
||||
return nil
|
||||
}
|
||||
|
@ -90,6 +89,56 @@ func (m *UserResponse) validateMeta(formats strfmt.Registry) error {
|
|||
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 {
|
||||
|
|
|
@ -10,6 +10,8 @@ package auth_models
|
|||
// 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"
|
||||
)
|
||||
|
@ -64,6 +66,11 @@ 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 {
|
||||
|
|
|
@ -29,9 +29,12 @@ type Client struct {
|
|||
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 {
|
||||
PostCredentials(params *PostCredentialsParams) (*PostCredentialsOK, error)
|
||||
PostCredentials(params *PostCredentialsParams, opts ...ClientOption) (*PostCredentialsOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
@ -41,13 +44,12 @@ type ClientService interface {
|
|||
|
||||
Get credential token
|
||||
*/
|
||||
func (a *Client) PostCredentials(params *PostCredentialsParams) (*PostCredentialsOK, error) {
|
||||
func (a *Client) PostCredentials(params *PostCredentialsParams, opts ...ClientOption) (*PostCredentialsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPostCredentialsParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "postCredentials",
|
||||
Method: "POST",
|
||||
PathPattern: "/oauth/token",
|
||||
|
@ -58,7 +60,12 @@ func (a *Client) PostCredentials(params *PostCredentialsParams) (*PostCredential
|
|||
Reader: &PostCredentialsReader{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
|
||||
}
|
||||
|
|
|
@ -22,53 +22,52 @@ import (
|
|||
"code.tnxs.net/taxnexus/lib/api/auth0/auth0_models"
|
||||
)
|
||||
|
||||
// NewPostCredentialsParams creates a new PostCredentialsParams object
|
||||
// with the default values initialized.
|
||||
// NewPostCredentialsParams creates a new PostCredentialsParams 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 NewPostCredentialsParams() *PostCredentialsParams {
|
||||
var ()
|
||||
return &PostCredentialsParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostCredentialsParamsWithTimeout creates a new PostCredentialsParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPostCredentialsParamsWithTimeout(timeout time.Duration) *PostCredentialsParams {
|
||||
var ()
|
||||
return &PostCredentialsParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostCredentialsParamsWithContext creates a new PostCredentialsParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
// with the ability to set a context for a request.
|
||||
func NewPostCredentialsParamsWithContext(ctx context.Context) *PostCredentialsParams {
|
||||
var ()
|
||||
return &PostCredentialsParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostCredentialsParamsWithHTTPClient creates a new PostCredentialsParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPostCredentialsParamsWithHTTPClient(client *http.Client) *PostCredentialsParams {
|
||||
var ()
|
||||
return &PostCredentialsParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/* PostCredentialsParams contains all the parameters to send to the API endpoint
|
||||
for the post credentials operation typically these are written to a http.Request
|
||||
for the post credentials operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PostCredentialsParams struct {
|
||||
|
||||
/*CredentialsRequest
|
||||
Get Authentation Token
|
||||
/* CredentialsRequest.
|
||||
|
||||
Get Authentation Token
|
||||
*/
|
||||
CredentialsRequest *auth0_models.CredentialsRequest
|
||||
|
||||
|
@ -77,6 +76,21 @@ type PostCredentialsParams struct {
|
|||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the post credentials params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostCredentialsParams) WithDefaults() *PostCredentialsParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the post credentials params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostCredentialsParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the post credentials params
|
||||
func (o *PostCredentialsParams) WithTimeout(timeout time.Duration) *PostCredentialsParams {
|
||||
o.SetTimeout(timeout)
|
||||
|
@ -128,7 +142,6 @@ func (o *PostCredentialsParams) WriteToRequest(r runtime.ClientRequest, reg strf
|
|||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if o.CredentialsRequest != nil {
|
||||
if err := r.SetBodyParam(o.CredentialsRequest); err != nil {
|
||||
return err
|
||||
|
|
|
@ -63,9 +63,8 @@ func (o *PostCredentialsReader) ReadResponse(response runtime.ClientResponse, co
|
|||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -74,7 +73,7 @@ func NewPostCredentialsOK() *PostCredentialsOK {
|
|||
return &PostCredentialsOK{}
|
||||
}
|
||||
|
||||
/*PostCredentialsOK handles this case with default header values.
|
||||
/* PostCredentialsOK describes a response with status code 200, with default header values.
|
||||
|
||||
Credentials response from Auth0
|
||||
*/
|
||||
|
@ -85,7 +84,6 @@ type PostCredentialsOK struct {
|
|||
func (o *PostCredentialsOK) Error() string {
|
||||
return fmt.Sprintf("[POST /oauth/token][%d] postCredentialsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCredentialsOK) GetPayload() *auth0_models.CredentialsResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -107,7 +105,7 @@ func NewPostCredentialsUnauthorized() *PostCredentialsUnauthorized {
|
|||
return &PostCredentialsUnauthorized{}
|
||||
}
|
||||
|
||||
/*PostCredentialsUnauthorized handles this case with default header values.
|
||||
/* PostCredentialsUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access Unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
|
@ -118,7 +116,6 @@ type PostCredentialsUnauthorized struct {
|
|||
func (o *PostCredentialsUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[POST /oauth/token][%d] postCredentialsUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCredentialsUnauthorized) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -140,7 +137,7 @@ func NewPostCredentialsForbidden() *PostCredentialsForbidden {
|
|||
return &PostCredentialsForbidden{}
|
||||
}
|
||||
|
||||
/*PostCredentialsForbidden handles this case with default header values.
|
||||
/* PostCredentialsForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
|
@ -151,7 +148,6 @@ type PostCredentialsForbidden struct {
|
|||
func (o *PostCredentialsForbidden) Error() string {
|
||||
return fmt.Sprintf("[POST /oauth/token][%d] postCredentialsForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCredentialsForbidden) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -173,7 +169,7 @@ func NewPostCredentialsNotFound() *PostCredentialsNotFound {
|
|||
return &PostCredentialsNotFound{}
|
||||
}
|
||||
|
||||
/*PostCredentialsNotFound handles this case with default header values.
|
||||
/* PostCredentialsNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
|
@ -184,7 +180,6 @@ type PostCredentialsNotFound struct {
|
|||
func (o *PostCredentialsNotFound) Error() string {
|
||||
return fmt.Sprintf("[POST /oauth/token][%d] postCredentialsNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCredentialsNotFound) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -206,7 +201,7 @@ func NewPostCredentialsUnprocessableEntity() *PostCredentialsUnprocessableEntity
|
|||
return &PostCredentialsUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*PostCredentialsUnprocessableEntity handles this case with default header values.
|
||||
/* PostCredentialsUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
|
@ -217,7 +212,6 @@ type PostCredentialsUnprocessableEntity struct {
|
|||
func (o *PostCredentialsUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[POST /oauth/token][%d] postCredentialsUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCredentialsUnprocessableEntity) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -239,7 +233,7 @@ func NewPostCredentialsInternalServerError() *PostCredentialsInternalServerError
|
|||
return &PostCredentialsInternalServerError{}
|
||||
}
|
||||
|
||||
/*PostCredentialsInternalServerError handles this case with default header values.
|
||||
/* PostCredentialsInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
|
@ -250,7 +244,6 @@ type PostCredentialsInternalServerError struct {
|
|||
func (o *PostCredentialsInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[POST /oauth/token][%d] postCredentialsInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCredentialsInternalServerError) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
|
|
@ -20,51 +20,50 @@ import (
|
|||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// NewGetRolesParams creates a new GetRolesParams object
|
||||
// with the default values initialized.
|
||||
// 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 {
|
||||
var ()
|
||||
return &GetRolesParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetRolesParamsWithTimeout creates a new GetRolesParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetRolesParamsWithTimeout(timeout time.Duration) *GetRolesParams {
|
||||
var ()
|
||||
return &GetRolesParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetRolesParamsWithContext creates a new GetRolesParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
// with the ability to set a context for a request.
|
||||
func NewGetRolesParamsWithContext(ctx context.Context) *GetRolesParams {
|
||||
var ()
|
||||
return &GetRolesParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetRolesParamsWithHTTPClient creates a new GetRolesParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewGetRolesParamsWithHTTPClient(client *http.Client) *GetRolesParams {
|
||||
var ()
|
||||
return &GetRolesParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/* GetRolesParams contains all the parameters to send to the API endpoint
|
||||
for the get roles operation typically these are written to a http.Request
|
||||
for the get roles operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type GetRolesParams struct {
|
||||
|
||||
/*Authorization*/
|
||||
// Authorization.
|
||||
Authorization string
|
||||
|
||||
timeout time.Duration
|
||||
|
@ -72,6 +71,21 @@ type GetRolesParams struct {
|
|||
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)
|
||||
|
|
|
@ -63,9 +63,8 @@ func (o *GetRolesReader) ReadResponse(response runtime.ClientResponse, consumer
|
|||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -74,7 +73,7 @@ func NewGetRolesOK() *GetRolesOK {
|
|||
return &GetRolesOK{}
|
||||
}
|
||||
|
||||
/*GetRolesOK handles this case with default header values.
|
||||
/* GetRolesOK describes a response with status code 200, with default header values.
|
||||
|
||||
Taxnexus Response with User objects
|
||||
*/
|
||||
|
@ -85,7 +84,6 @@ type GetRolesOK struct {
|
|||
func (o *GetRolesOK) Error() string {
|
||||
return fmt.Sprintf("[GET /api/v2/roles][%d] getRolesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetRolesOK) GetPayload() []*auth0_models.User {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -105,7 +103,7 @@ func NewGetRolesUnauthorized() *GetRolesUnauthorized {
|
|||
return &GetRolesUnauthorized{}
|
||||
}
|
||||
|
||||
/*GetRolesUnauthorized handles this case with default header values.
|
||||
/* GetRolesUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access Unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
|
@ -116,7 +114,6 @@ type GetRolesUnauthorized struct {
|
|||
func (o *GetRolesUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /api/v2/roles][%d] getRolesUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetRolesUnauthorized) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -138,7 +135,7 @@ func NewGetRolesForbidden() *GetRolesForbidden {
|
|||
return &GetRolesForbidden{}
|
||||
}
|
||||
|
||||
/*GetRolesForbidden handles this case with default header values.
|
||||
/* GetRolesForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
|
@ -149,7 +146,6 @@ type GetRolesForbidden struct {
|
|||
func (o *GetRolesForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /api/v2/roles][%d] getRolesForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetRolesForbidden) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -171,7 +167,7 @@ func NewGetRolesNotFound() *GetRolesNotFound {
|
|||
return &GetRolesNotFound{}
|
||||
}
|
||||
|
||||
/*GetRolesNotFound handles this case with default header values.
|
||||
/* GetRolesNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
|
@ -182,7 +178,6 @@ type GetRolesNotFound struct {
|
|||
func (o *GetRolesNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /api/v2/roles][%d] getRolesNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetRolesNotFound) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -204,7 +199,7 @@ func NewGetRolesUnprocessableEntity() *GetRolesUnprocessableEntity {
|
|||
return &GetRolesUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*GetRolesUnprocessableEntity handles this case with default header values.
|
||||
/* GetRolesUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
|
@ -215,7 +210,6 @@ type GetRolesUnprocessableEntity struct {
|
|||
func (o *GetRolesUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[GET /api/v2/roles][%d] getRolesUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetRolesUnprocessableEntity) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -237,7 +231,7 @@ func NewGetRolesInternalServerError() *GetRolesInternalServerError {
|
|||
return &GetRolesInternalServerError{}
|
||||
}
|
||||
|
||||
/*GetRolesInternalServerError handles this case with default header values.
|
||||
/* GetRolesInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
|
@ -248,7 +242,6 @@ type GetRolesInternalServerError struct {
|
|||
func (o *GetRolesInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /api/v2/roles][%d] getRolesInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetRolesInternalServerError) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
|
|
@ -22,60 +22,61 @@ import (
|
|||
"code.tnxs.net/taxnexus/lib/api/auth0/auth0_models"
|
||||
)
|
||||
|
||||
// NewPostRoleUsersParams creates a new PostRoleUsersParams object
|
||||
// with the default values initialized.
|
||||
// NewPostRoleUsersParams creates a new PostRoleUsersParams 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 NewPostRoleUsersParams() *PostRoleUsersParams {
|
||||
var ()
|
||||
return &PostRoleUsersParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostRoleUsersParamsWithTimeout creates a new PostRoleUsersParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPostRoleUsersParamsWithTimeout(timeout time.Duration) *PostRoleUsersParams {
|
||||
var ()
|
||||
return &PostRoleUsersParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostRoleUsersParamsWithContext creates a new PostRoleUsersParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
// with the ability to set a context for a request.
|
||||
func NewPostRoleUsersParamsWithContext(ctx context.Context) *PostRoleUsersParams {
|
||||
var ()
|
||||
return &PostRoleUsersParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostRoleUsersParamsWithHTTPClient creates a new PostRoleUsersParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPostRoleUsersParamsWithHTTPClient(client *http.Client) *PostRoleUsersParams {
|
||||
var ()
|
||||
return &PostRoleUsersParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/* PostRoleUsersParams contains all the parameters to send to the API endpoint
|
||||
for the post role users operation typically these are written to a http.Request
|
||||
for the post role users operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PostRoleUsersParams struct {
|
||||
|
||||
/*Authorization*/
|
||||
// Authorization.
|
||||
Authorization string
|
||||
/*RoleUsersRequest
|
||||
An array of User IDs to add to a Role
|
||||
|
||||
/* RoleUsersRequest.
|
||||
|
||||
An array of User IDs to add to a Role
|
||||
*/
|
||||
RoleUsersRequest *auth0_models.RoleUsersRequest
|
||||
/*RoleID
|
||||
An Auth0 Role ID
|
||||
|
||||
/* RoleID.
|
||||
|
||||
An Auth0 Role ID
|
||||
*/
|
||||
RoleID string
|
||||
|
||||
|
@ -84,6 +85,21 @@ type PostRoleUsersParams struct {
|
|||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the post role users params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostRoleUsersParams) WithDefaults() *PostRoleUsersParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the post role users params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostRoleUsersParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the post role users params
|
||||
func (o *PostRoleUsersParams) WithTimeout(timeout time.Duration) *PostRoleUsersParams {
|
||||
o.SetTimeout(timeout)
|
||||
|
@ -162,7 +178,6 @@ func (o *PostRoleUsersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt
|
|||
if err := r.SetHeaderParam("Authorization", o.Authorization); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if o.RoleUsersRequest != nil {
|
||||
if err := r.SetBodyParam(o.RoleUsersRequest); err != nil {
|
||||
return err
|
||||
|
|
|
@ -57,9 +57,8 @@ func (o *PostRoleUsersReader) ReadResponse(response runtime.ClientResponse, cons
|
|||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -68,7 +67,7 @@ func NewPostRoleUsersOK() *PostRoleUsersOK {
|
|||
return &PostRoleUsersOK{}
|
||||
}
|
||||
|
||||
/*PostRoleUsersOK handles this case with default header values.
|
||||
/* PostRoleUsersOK describes a response with status code 200, with default header values.
|
||||
|
||||
Role users successfully updated
|
||||
*/
|
||||
|
@ -89,7 +88,7 @@ func NewPostRoleUsersUnauthorized() *PostRoleUsersUnauthorized {
|
|||
return &PostRoleUsersUnauthorized{}
|
||||
}
|
||||
|
||||
/*PostRoleUsersUnauthorized handles this case with default header values.
|
||||
/* PostRoleUsersUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access Unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
|
@ -100,7 +99,6 @@ type PostRoleUsersUnauthorized struct {
|
|||
func (o *PostRoleUsersUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[POST /api/v2/roles/{roleId}/users][%d] postRoleUsersUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostRoleUsersUnauthorized) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -122,7 +120,7 @@ func NewPostRoleUsersForbidden() *PostRoleUsersForbidden {
|
|||
return &PostRoleUsersForbidden{}
|
||||
}
|
||||
|
||||
/*PostRoleUsersForbidden handles this case with default header values.
|
||||
/* PostRoleUsersForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
|
@ -133,7 +131,6 @@ type PostRoleUsersForbidden struct {
|
|||
func (o *PostRoleUsersForbidden) Error() string {
|
||||
return fmt.Sprintf("[POST /api/v2/roles/{roleId}/users][%d] postRoleUsersForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostRoleUsersForbidden) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -155,7 +152,7 @@ func NewPostRoleUsersNotFound() *PostRoleUsersNotFound {
|
|||
return &PostRoleUsersNotFound{}
|
||||
}
|
||||
|
||||
/*PostRoleUsersNotFound handles this case with default header values.
|
||||
/* PostRoleUsersNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
|
@ -166,7 +163,6 @@ type PostRoleUsersNotFound struct {
|
|||
func (o *PostRoleUsersNotFound) Error() string {
|
||||
return fmt.Sprintf("[POST /api/v2/roles/{roleId}/users][%d] postRoleUsersNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostRoleUsersNotFound) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -188,7 +184,7 @@ func NewPostRoleUsersInternalServerError() *PostRoleUsersInternalServerError {
|
|||
return &PostRoleUsersInternalServerError{}
|
||||
}
|
||||
|
||||
/*PostRoleUsersInternalServerError handles this case with default header values.
|
||||
/* PostRoleUsersInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
|
@ -199,7 +195,6 @@ type PostRoleUsersInternalServerError struct {
|
|||
func (o *PostRoleUsersInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[POST /api/v2/roles/{roleId}/users][%d] postRoleUsersInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostRoleUsersInternalServerError) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
|
|
@ -29,11 +29,14 @@ type Client struct {
|
|||
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 {
|
||||
GetRoles(params *GetRolesParams) (*GetRolesOK, error)
|
||||
GetRoles(params *GetRolesParams, opts ...ClientOption) (*GetRolesOK, error)
|
||||
|
||||
PostRoleUsers(params *PostRoleUsersParams) (*PostRoleUsersOK, error)
|
||||
PostRoleUsers(params *PostRoleUsersParams, opts ...ClientOption) (*PostRoleUsersOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
@ -43,13 +46,12 @@ type ClientService interface {
|
|||
|
||||
Get Roles from Auth0
|
||||
*/
|
||||
func (a *Client) GetRoles(params *GetRolesParams) (*GetRolesOK, error) {
|
||||
func (a *Client) GetRoles(params *GetRolesParams, opts ...ClientOption) (*GetRolesOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetRolesParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "getRoles",
|
||||
Method: "GET",
|
||||
PathPattern: "/api/v2/roles",
|
||||
|
@ -60,7 +62,12 @@ func (a *Client) GetRoles(params *GetRolesParams) (*GetRolesOK, error) {
|
|||
Reader: &GetRolesReader{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
|
||||
}
|
||||
|
@ -79,13 +86,12 @@ func (a *Client) GetRoles(params *GetRolesParams) (*GetRolesOK, error) {
|
|||
|
||||
Add users to role
|
||||
*/
|
||||
func (a *Client) PostRoleUsers(params *PostRoleUsersParams) (*PostRoleUsersOK, error) {
|
||||
func (a *Client) PostRoleUsers(params *PostRoleUsersParams, opts ...ClientOption) (*PostRoleUsersOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPostRoleUsersParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "postRoleUsers",
|
||||
Method: "POST",
|
||||
PathPattern: "/api/v2/roles/{roleId}/users",
|
||||
|
@ -96,7 +102,12 @@ func (a *Client) PostRoleUsers(params *PostRoleUsersParams) (*PostRoleUsersOK, e
|
|||
Reader: &PostRoleUsersReader{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
|
||||
}
|
||||
|
|
|
@ -22,60 +22,61 @@ import (
|
|||
"code.tnxs.net/taxnexus/lib/api/auth0/auth0_models"
|
||||
)
|
||||
|
||||
// NewDeleteAPIV2UsersUserIDRolesParams creates a new DeleteAPIV2UsersUserIDRolesParams object
|
||||
// with the default values initialized.
|
||||
// NewDeleteAPIV2UsersUserIDRolesParams creates a new DeleteAPIV2UsersUserIDRolesParams 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 NewDeleteAPIV2UsersUserIDRolesParams() *DeleteAPIV2UsersUserIDRolesParams {
|
||||
var ()
|
||||
return &DeleteAPIV2UsersUserIDRolesParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAPIV2UsersUserIDRolesParamsWithTimeout creates a new DeleteAPIV2UsersUserIDRolesParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewDeleteAPIV2UsersUserIDRolesParamsWithTimeout(timeout time.Duration) *DeleteAPIV2UsersUserIDRolesParams {
|
||||
var ()
|
||||
return &DeleteAPIV2UsersUserIDRolesParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAPIV2UsersUserIDRolesParamsWithContext creates a new DeleteAPIV2UsersUserIDRolesParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
// with the ability to set a context for a request.
|
||||
func NewDeleteAPIV2UsersUserIDRolesParamsWithContext(ctx context.Context) *DeleteAPIV2UsersUserIDRolesParams {
|
||||
var ()
|
||||
return &DeleteAPIV2UsersUserIDRolesParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAPIV2UsersUserIDRolesParamsWithHTTPClient creates a new DeleteAPIV2UsersUserIDRolesParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewDeleteAPIV2UsersUserIDRolesParamsWithHTTPClient(client *http.Client) *DeleteAPIV2UsersUserIDRolesParams {
|
||||
var ()
|
||||
return &DeleteAPIV2UsersUserIDRolesParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/* DeleteAPIV2UsersUserIDRolesParams contains all the parameters to send to the API endpoint
|
||||
for the delete API v2 users user ID roles operation typically these are written to a http.Request
|
||||
for the delete API v2 users user ID roles operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type DeleteAPIV2UsersUserIDRolesParams struct {
|
||||
|
||||
/*Authorization*/
|
||||
// Authorization.
|
||||
Authorization string
|
||||
/*UserRolesRequest
|
||||
An array of User IDs to add to a Role
|
||||
|
||||
/* UserRolesRequest.
|
||||
|
||||
An array of User IDs to add to a Role
|
||||
*/
|
||||
UserRolesRequest *auth0_models.UserRolesRequest
|
||||
/*UserID
|
||||
An Auth0 User ID
|
||||
|
||||
/* UserID.
|
||||
|
||||
An Auth0 User ID
|
||||
*/
|
||||
UserID string
|
||||
|
||||
|
@ -84,6 +85,21 @@ type DeleteAPIV2UsersUserIDRolesParams struct {
|
|||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the delete API v2 users user ID roles params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *DeleteAPIV2UsersUserIDRolesParams) WithDefaults() *DeleteAPIV2UsersUserIDRolesParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the delete API v2 users user ID roles params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *DeleteAPIV2UsersUserIDRolesParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the delete API v2 users user ID roles params
|
||||
func (o *DeleteAPIV2UsersUserIDRolesParams) WithTimeout(timeout time.Duration) *DeleteAPIV2UsersUserIDRolesParams {
|
||||
o.SetTimeout(timeout)
|
||||
|
@ -162,7 +178,6 @@ func (o *DeleteAPIV2UsersUserIDRolesParams) WriteToRequest(r runtime.ClientReque
|
|||
if err := r.SetHeaderParam("Authorization", o.Authorization); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if o.UserRolesRequest != nil {
|
||||
if err := r.SetBodyParam(o.UserRolesRequest); err != nil {
|
||||
return err
|
||||
|
|
|
@ -57,9 +57,8 @@ func (o *DeleteAPIV2UsersUserIDRolesReader) ReadResponse(response runtime.Client
|
|||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -68,7 +67,7 @@ func NewDeleteAPIV2UsersUserIDRolesNoContent() *DeleteAPIV2UsersUserIDRolesNoCon
|
|||
return &DeleteAPIV2UsersUserIDRolesNoContent{}
|
||||
}
|
||||
|
||||
/*DeleteAPIV2UsersUserIDRolesNoContent handles this case with default header values.
|
||||
/* DeleteAPIV2UsersUserIDRolesNoContent describes a response with status code 204, with default header values.
|
||||
|
||||
User roles successfully removed
|
||||
*/
|
||||
|
@ -89,7 +88,7 @@ func NewDeleteAPIV2UsersUserIDRolesUnauthorized() *DeleteAPIV2UsersUserIDRolesUn
|
|||
return &DeleteAPIV2UsersUserIDRolesUnauthorized{}
|
||||
}
|
||||
|
||||
/*DeleteAPIV2UsersUserIDRolesUnauthorized handles this case with default header values.
|
||||
/* DeleteAPIV2UsersUserIDRolesUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access Unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
|
@ -100,7 +99,6 @@ type DeleteAPIV2UsersUserIDRolesUnauthorized struct {
|
|||
func (o *DeleteAPIV2UsersUserIDRolesUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[DELETE /api/v2/users/{userId}/roles][%d] deleteApiV2UsersUserIdRolesUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAPIV2UsersUserIDRolesUnauthorized) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -122,7 +120,7 @@ func NewDeleteAPIV2UsersUserIDRolesForbidden() *DeleteAPIV2UsersUserIDRolesForbi
|
|||
return &DeleteAPIV2UsersUserIDRolesForbidden{}
|
||||
}
|
||||
|
||||
/*DeleteAPIV2UsersUserIDRolesForbidden handles this case with default header values.
|
||||
/* DeleteAPIV2UsersUserIDRolesForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
|
@ -133,7 +131,6 @@ type DeleteAPIV2UsersUserIDRolesForbidden struct {
|
|||
func (o *DeleteAPIV2UsersUserIDRolesForbidden) Error() string {
|
||||
return fmt.Sprintf("[DELETE /api/v2/users/{userId}/roles][%d] deleteApiV2UsersUserIdRolesForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAPIV2UsersUserIDRolesForbidden) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -155,7 +152,7 @@ func NewDeleteAPIV2UsersUserIDRolesNotFound() *DeleteAPIV2UsersUserIDRolesNotFou
|
|||
return &DeleteAPIV2UsersUserIDRolesNotFound{}
|
||||
}
|
||||
|
||||
/*DeleteAPIV2UsersUserIDRolesNotFound handles this case with default header values.
|
||||
/* DeleteAPIV2UsersUserIDRolesNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
|
@ -166,7 +163,6 @@ type DeleteAPIV2UsersUserIDRolesNotFound struct {
|
|||
func (o *DeleteAPIV2UsersUserIDRolesNotFound) Error() string {
|
||||
return fmt.Sprintf("[DELETE /api/v2/users/{userId}/roles][%d] deleteApiV2UsersUserIdRolesNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAPIV2UsersUserIDRolesNotFound) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -188,7 +184,7 @@ func NewDeleteAPIV2UsersUserIDRolesInternalServerError() *DeleteAPIV2UsersUserID
|
|||
return &DeleteAPIV2UsersUserIDRolesInternalServerError{}
|
||||
}
|
||||
|
||||
/*DeleteAPIV2UsersUserIDRolesInternalServerError handles this case with default header values.
|
||||
/* DeleteAPIV2UsersUserIDRolesInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
|
@ -199,7 +195,6 @@ type DeleteAPIV2UsersUserIDRolesInternalServerError struct {
|
|||
func (o *DeleteAPIV2UsersUserIDRolesInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[DELETE /api/v2/users/{userId}/roles][%d] deleteApiV2UsersUserIdRolesInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAPIV2UsersUserIDRolesInternalServerError) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
|
|
@ -20,53 +20,53 @@ import (
|
|||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// NewGetUserByEmailParams creates a new GetUserByEmailParams object
|
||||
// with the default values initialized.
|
||||
// NewGetUserByEmailParams creates a new GetUserByEmailParams 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 NewGetUserByEmailParams() *GetUserByEmailParams {
|
||||
var ()
|
||||
return &GetUserByEmailParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetUserByEmailParamsWithTimeout creates a new GetUserByEmailParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetUserByEmailParamsWithTimeout(timeout time.Duration) *GetUserByEmailParams {
|
||||
var ()
|
||||
return &GetUserByEmailParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetUserByEmailParamsWithContext creates a new GetUserByEmailParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
// with the ability to set a context for a request.
|
||||
func NewGetUserByEmailParamsWithContext(ctx context.Context) *GetUserByEmailParams {
|
||||
var ()
|
||||
return &GetUserByEmailParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetUserByEmailParamsWithHTTPClient creates a new GetUserByEmailParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewGetUserByEmailParamsWithHTTPClient(client *http.Client) *GetUserByEmailParams {
|
||||
var ()
|
||||
return &GetUserByEmailParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/* GetUserByEmailParams contains all the parameters to send to the API endpoint
|
||||
for the get user by email operation typically these are written to a http.Request
|
||||
for the get user by email operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type GetUserByEmailParams struct {
|
||||
|
||||
/*Authorization*/
|
||||
// Authorization.
|
||||
Authorization string
|
||||
/*Email*/
|
||||
|
||||
// Email.
|
||||
Email string
|
||||
|
||||
timeout time.Duration
|
||||
|
@ -74,6 +74,21 @@ type GetUserByEmailParams struct {
|
|||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the get user by email params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetUserByEmailParams) WithDefaults() *GetUserByEmailParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the get user by email params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetUserByEmailParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get user by email params
|
||||
func (o *GetUserByEmailParams) WithTimeout(timeout time.Duration) *GetUserByEmailParams {
|
||||
o.SetTimeout(timeout)
|
||||
|
@ -146,6 +161,7 @@ func (o *GetUserByEmailParams) WriteToRequest(r runtime.ClientRequest, reg strfm
|
|||
qrEmail := o.Email
|
||||
qEmail := qrEmail
|
||||
if qEmail != "" {
|
||||
|
||||
if err := r.SetQueryParam("email", qEmail); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -57,9 +57,8 @@ func (o *GetUserByEmailReader) ReadResponse(response runtime.ClientResponse, con
|
|||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -68,7 +67,7 @@ func NewGetUserByEmailOK() *GetUserByEmailOK {
|
|||
return &GetUserByEmailOK{}
|
||||
}
|
||||
|
||||
/*GetUserByEmailOK handles this case with default header values.
|
||||
/* GetUserByEmailOK describes a response with status code 200, with default header values.
|
||||
|
||||
Taxnexus Response with User objects
|
||||
*/
|
||||
|
@ -79,7 +78,6 @@ type GetUserByEmailOK struct {
|
|||
func (o *GetUserByEmailOK) Error() string {
|
||||
return fmt.Sprintf("[GET /api/v2/users-by-email][%d] getUserByEmailOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetUserByEmailOK) GetPayload() []*auth0_models.User {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -99,7 +97,7 @@ func NewGetUserByEmailUnauthorized() *GetUserByEmailUnauthorized {
|
|||
return &GetUserByEmailUnauthorized{}
|
||||
}
|
||||
|
||||
/*GetUserByEmailUnauthorized handles this case with default header values.
|
||||
/* GetUserByEmailUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access Unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
|
@ -110,7 +108,6 @@ type GetUserByEmailUnauthorized struct {
|
|||
func (o *GetUserByEmailUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /api/v2/users-by-email][%d] getUserByEmailUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetUserByEmailUnauthorized) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -132,7 +129,7 @@ func NewGetUserByEmailForbidden() *GetUserByEmailForbidden {
|
|||
return &GetUserByEmailForbidden{}
|
||||
}
|
||||
|
||||
/*GetUserByEmailForbidden handles this case with default header values.
|
||||
/* GetUserByEmailForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
|
@ -143,7 +140,6 @@ type GetUserByEmailForbidden struct {
|
|||
func (o *GetUserByEmailForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /api/v2/users-by-email][%d] getUserByEmailForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetUserByEmailForbidden) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -165,7 +161,7 @@ func NewGetUserByEmailNotFound() *GetUserByEmailNotFound {
|
|||
return &GetUserByEmailNotFound{}
|
||||
}
|
||||
|
||||
/*GetUserByEmailNotFound handles this case with default header values.
|
||||
/* GetUserByEmailNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
|
@ -176,7 +172,6 @@ type GetUserByEmailNotFound struct {
|
|||
func (o *GetUserByEmailNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /api/v2/users-by-email][%d] getUserByEmailNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetUserByEmailNotFound) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -198,7 +193,7 @@ func NewGetUserByEmailInternalServerError() *GetUserByEmailInternalServerError {
|
|||
return &GetUserByEmailInternalServerError{}
|
||||
}
|
||||
|
||||
/*GetUserByEmailInternalServerError handles this case with default header values.
|
||||
/* GetUserByEmailInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
|
@ -209,7 +204,6 @@ type GetUserByEmailInternalServerError struct {
|
|||
func (o *GetUserByEmailInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /api/v2/users-by-email][%d] getUserByEmailInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetUserByEmailInternalServerError) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
|
|
@ -20,55 +20,55 @@ import (
|
|||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// NewGetUserRolesParams creates a new GetUserRolesParams object
|
||||
// with the default values initialized.
|
||||
// NewGetUserRolesParams creates a new GetUserRolesParams 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 NewGetUserRolesParams() *GetUserRolesParams {
|
||||
var ()
|
||||
return &GetUserRolesParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetUserRolesParamsWithTimeout creates a new GetUserRolesParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetUserRolesParamsWithTimeout(timeout time.Duration) *GetUserRolesParams {
|
||||
var ()
|
||||
return &GetUserRolesParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetUserRolesParamsWithContext creates a new GetUserRolesParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
// with the ability to set a context for a request.
|
||||
func NewGetUserRolesParamsWithContext(ctx context.Context) *GetUserRolesParams {
|
||||
var ()
|
||||
return &GetUserRolesParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetUserRolesParamsWithHTTPClient creates a new GetUserRolesParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewGetUserRolesParamsWithHTTPClient(client *http.Client) *GetUserRolesParams {
|
||||
var ()
|
||||
return &GetUserRolesParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/* GetUserRolesParams contains all the parameters to send to the API endpoint
|
||||
for the get user roles operation typically these are written to a http.Request
|
||||
for the get user roles operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type GetUserRolesParams struct {
|
||||
|
||||
/*Authorization*/
|
||||
// Authorization.
|
||||
Authorization string
|
||||
/*UserID
|
||||
An Auth0 User ID
|
||||
|
||||
/* UserID.
|
||||
|
||||
An Auth0 User ID
|
||||
*/
|
||||
UserID string
|
||||
|
||||
|
@ -77,6 +77,21 @@ type GetUserRolesParams struct {
|
|||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the get user roles params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetUserRolesParams) WithDefaults() *GetUserRolesParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the get user roles params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetUserRolesParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get user roles params
|
||||
func (o *GetUserRolesParams) WithTimeout(timeout time.Duration) *GetUserRolesParams {
|
||||
o.SetTimeout(timeout)
|
||||
|
|
|
@ -57,9 +57,8 @@ func (o *GetUserRolesReader) ReadResponse(response runtime.ClientResponse, consu
|
|||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -68,7 +67,7 @@ func NewGetUserRolesOK() *GetUserRolesOK {
|
|||
return &GetUserRolesOK{}
|
||||
}
|
||||
|
||||
/*GetUserRolesOK handles this case with default header values.
|
||||
/* GetUserRolesOK describes a response with status code 200, with default header values.
|
||||
|
||||
Taxnexus Response with User objects
|
||||
*/
|
||||
|
@ -79,7 +78,6 @@ type GetUserRolesOK struct {
|
|||
func (o *GetUserRolesOK) Error() string {
|
||||
return fmt.Sprintf("[GET /api/v2/users/{userId}/roles][%d] getUserRolesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetUserRolesOK) GetPayload() *auth0_models.RoleResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -101,7 +99,7 @@ func NewGetUserRolesUnauthorized() *GetUserRolesUnauthorized {
|
|||
return &GetUserRolesUnauthorized{}
|
||||
}
|
||||
|
||||
/*GetUserRolesUnauthorized handles this case with default header values.
|
||||
/* GetUserRolesUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access Unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
|
@ -112,7 +110,6 @@ type GetUserRolesUnauthorized struct {
|
|||
func (o *GetUserRolesUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /api/v2/users/{userId}/roles][%d] getUserRolesUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetUserRolesUnauthorized) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -134,7 +131,7 @@ func NewGetUserRolesForbidden() *GetUserRolesForbidden {
|
|||
return &GetUserRolesForbidden{}
|
||||
}
|
||||
|
||||
/*GetUserRolesForbidden handles this case with default header values.
|
||||
/* GetUserRolesForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
|
@ -145,7 +142,6 @@ type GetUserRolesForbidden struct {
|
|||
func (o *GetUserRolesForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /api/v2/users/{userId}/roles][%d] getUserRolesForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetUserRolesForbidden) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -167,7 +163,7 @@ func NewGetUserRolesNotFound() *GetUserRolesNotFound {
|
|||
return &GetUserRolesNotFound{}
|
||||
}
|
||||
|
||||
/*GetUserRolesNotFound handles this case with default header values.
|
||||
/* GetUserRolesNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
|
@ -178,7 +174,6 @@ type GetUserRolesNotFound struct {
|
|||
func (o *GetUserRolesNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /api/v2/users/{userId}/roles][%d] getUserRolesNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetUserRolesNotFound) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -200,7 +195,7 @@ func NewGetUserRolesInternalServerError() *GetUserRolesInternalServerError {
|
|||
return &GetUserRolesInternalServerError{}
|
||||
}
|
||||
|
||||
/*GetUserRolesInternalServerError handles this case with default header values.
|
||||
/* GetUserRolesInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
|
@ -211,7 +206,6 @@ type GetUserRolesInternalServerError struct {
|
|||
func (o *GetUserRolesInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /api/v2/users/{userId}/roles][%d] getUserRolesInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetUserRolesInternalServerError) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
|
|
@ -20,51 +20,50 @@ import (
|
|||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// NewGetUsersParams creates a new GetUsersParams object
|
||||
// with the default values initialized.
|
||||
// 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 {
|
||||
var ()
|
||||
return &GetUsersParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetUsersParamsWithTimeout creates a new GetUsersParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetUsersParamsWithTimeout(timeout time.Duration) *GetUsersParams {
|
||||
var ()
|
||||
return &GetUsersParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetUsersParamsWithContext creates a new GetUsersParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
// with the ability to set a context for a request.
|
||||
func NewGetUsersParamsWithContext(ctx context.Context) *GetUsersParams {
|
||||
var ()
|
||||
return &GetUsersParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetUsersParamsWithHTTPClient creates a new GetUsersParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewGetUsersParamsWithHTTPClient(client *http.Client) *GetUsersParams {
|
||||
var ()
|
||||
return &GetUsersParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/* GetUsersParams contains all the parameters to send to the API endpoint
|
||||
for the get users operation typically these are written to a http.Request
|
||||
for the get users operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type GetUsersParams struct {
|
||||
|
||||
/*Authorization*/
|
||||
// Authorization.
|
||||
Authorization string
|
||||
|
||||
timeout time.Duration
|
||||
|
@ -72,6 +71,21 @@ type GetUsersParams struct {
|
|||
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)
|
||||
|
|
|
@ -57,9 +57,8 @@ func (o *GetUsersReader) ReadResponse(response runtime.ClientResponse, consumer
|
|||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -68,7 +67,7 @@ func NewGetUsersOK() *GetUsersOK {
|
|||
return &GetUsersOK{}
|
||||
}
|
||||
|
||||
/*GetUsersOK handles this case with default header values.
|
||||
/* GetUsersOK describes a response with status code 200, with default header values.
|
||||
|
||||
Taxnexus Response with User objects
|
||||
*/
|
||||
|
@ -79,7 +78,6 @@ type GetUsersOK struct {
|
|||
func (o *GetUsersOK) Error() string {
|
||||
return fmt.Sprintf("[GET /api/v2/users][%d] getUsersOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetUsersOK) GetPayload() []*auth0_models.User {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -99,7 +97,7 @@ func NewGetUsersUnauthorized() *GetUsersUnauthorized {
|
|||
return &GetUsersUnauthorized{}
|
||||
}
|
||||
|
||||
/*GetUsersUnauthorized handles this case with default header values.
|
||||
/* GetUsersUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access Unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
|
@ -110,7 +108,6 @@ type GetUsersUnauthorized struct {
|
|||
func (o *GetUsersUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /api/v2/users][%d] getUsersUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetUsersUnauthorized) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -132,7 +129,7 @@ func NewGetUsersForbidden() *GetUsersForbidden {
|
|||
return &GetUsersForbidden{}
|
||||
}
|
||||
|
||||
/*GetUsersForbidden handles this case with default header values.
|
||||
/* GetUsersForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
|
@ -143,7 +140,6 @@ type GetUsersForbidden struct {
|
|||
func (o *GetUsersForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /api/v2/users][%d] getUsersForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetUsersForbidden) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -165,7 +161,7 @@ func NewGetUsersNotFound() *GetUsersNotFound {
|
|||
return &GetUsersNotFound{}
|
||||
}
|
||||
|
||||
/*GetUsersNotFound handles this case with default header values.
|
||||
/* GetUsersNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
|
@ -176,7 +172,6 @@ type GetUsersNotFound struct {
|
|||
func (o *GetUsersNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /api/v2/users][%d] getUsersNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetUsersNotFound) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -198,7 +193,7 @@ func NewGetUsersInternalServerError() *GetUsersInternalServerError {
|
|||
return &GetUsersInternalServerError{}
|
||||
}
|
||||
|
||||
/*GetUsersInternalServerError handles this case with default header values.
|
||||
/* GetUsersInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
|
@ -209,7 +204,6 @@ type GetUsersInternalServerError struct {
|
|||
func (o *GetUsersInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /api/v2/users][%d] getUsersInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetUsersInternalServerError) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
|
|
@ -22,55 +22,55 @@ import (
|
|||
"code.tnxs.net/taxnexus/lib/api/auth0/auth0_models"
|
||||
)
|
||||
|
||||
// NewPostUsersParams creates a new PostUsersParams object
|
||||
// with the default values initialized.
|
||||
// NewPostUsersParams creates a new PostUsersParams 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 NewPostUsersParams() *PostUsersParams {
|
||||
var ()
|
||||
return &PostUsersParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostUsersParamsWithTimeout creates a new PostUsersParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPostUsersParamsWithTimeout(timeout time.Duration) *PostUsersParams {
|
||||
var ()
|
||||
return &PostUsersParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostUsersParamsWithContext creates a new PostUsersParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
// with the ability to set a context for a request.
|
||||
func NewPostUsersParamsWithContext(ctx context.Context) *PostUsersParams {
|
||||
var ()
|
||||
return &PostUsersParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostUsersParamsWithHTTPClient creates a new PostUsersParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPostUsersParamsWithHTTPClient(client *http.Client) *PostUsersParams {
|
||||
var ()
|
||||
return &PostUsersParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/* PostUsersParams contains all the parameters to send to the API endpoint
|
||||
for the post users operation typically these are written to a http.Request
|
||||
for the post users operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PostUsersParams struct {
|
||||
|
||||
/*Authorization*/
|
||||
// Authorization.
|
||||
Authorization string
|
||||
/*UserRequest
|
||||
An array of User records
|
||||
|
||||
/* UserRequest.
|
||||
|
||||
An array of User records
|
||||
*/
|
||||
UserRequest *auth0_models.UserRequest
|
||||
|
||||
|
@ -79,6 +79,21 @@ type PostUsersParams struct {
|
|||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the post users params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostUsersParams) WithDefaults() *PostUsersParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the post users params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostUsersParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the post users params
|
||||
func (o *PostUsersParams) WithTimeout(timeout time.Duration) *PostUsersParams {
|
||||
o.SetTimeout(timeout)
|
||||
|
@ -146,7 +161,6 @@ func (o *PostUsersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Reg
|
|||
if err := r.SetHeaderParam("Authorization", o.Authorization); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if o.UserRequest != nil {
|
||||
if err := r.SetBodyParam(o.UserRequest); err != nil {
|
||||
return err
|
||||
|
|
|
@ -63,9 +63,8 @@ func (o *PostUsersReader) ReadResponse(response runtime.ClientResponse, consumer
|
|||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -74,7 +73,7 @@ func NewPostUsersCreated() *PostUsersCreated {
|
|||
return &PostUsersCreated{}
|
||||
}
|
||||
|
||||
/*PostUsersCreated handles this case with default header values.
|
||||
/* PostUsersCreated describes a response with status code 201, with default header values.
|
||||
|
||||
New user created
|
||||
*/
|
||||
|
@ -95,7 +94,7 @@ func NewPostUsersUnauthorized() *PostUsersUnauthorized {
|
|||
return &PostUsersUnauthorized{}
|
||||
}
|
||||
|
||||
/*PostUsersUnauthorized handles this case with default header values.
|
||||
/* PostUsersUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access Unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
|
@ -106,7 +105,6 @@ type PostUsersUnauthorized struct {
|
|||
func (o *PostUsersUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[POST /api/v2/users-by-email][%d] postUsersUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostUsersUnauthorized) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -128,7 +126,7 @@ func NewPostUsersForbidden() *PostUsersForbidden {
|
|||
return &PostUsersForbidden{}
|
||||
}
|
||||
|
||||
/*PostUsersForbidden handles this case with default header values.
|
||||
/* PostUsersForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
|
@ -139,7 +137,6 @@ type PostUsersForbidden struct {
|
|||
func (o *PostUsersForbidden) Error() string {
|
||||
return fmt.Sprintf("[POST /api/v2/users-by-email][%d] postUsersForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostUsersForbidden) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -161,7 +158,7 @@ func NewPostUsersNotFound() *PostUsersNotFound {
|
|||
return &PostUsersNotFound{}
|
||||
}
|
||||
|
||||
/*PostUsersNotFound handles this case with default header values.
|
||||
/* PostUsersNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
|
@ -172,7 +169,6 @@ type PostUsersNotFound struct {
|
|||
func (o *PostUsersNotFound) Error() string {
|
||||
return fmt.Sprintf("[POST /api/v2/users-by-email][%d] postUsersNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostUsersNotFound) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -194,7 +190,7 @@ func NewPostUsersConflict() *PostUsersConflict {
|
|||
return &PostUsersConflict{}
|
||||
}
|
||||
|
||||
/*PostUsersConflict handles this case with default header values.
|
||||
/* PostUsersConflict describes a response with status code 409, with default header values.
|
||||
|
||||
User already exists
|
||||
*/
|
||||
|
@ -215,7 +211,7 @@ func NewPostUsersInternalServerError() *PostUsersInternalServerError {
|
|||
return &PostUsersInternalServerError{}
|
||||
}
|
||||
|
||||
/*PostUsersInternalServerError handles this case with default header values.
|
||||
/* PostUsersInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
|
@ -226,7 +222,6 @@ type PostUsersInternalServerError struct {
|
|||
func (o *PostUsersInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[POST /api/v2/users-by-email][%d] postUsersInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostUsersInternalServerError) GetPayload() *auth0_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
|
|
@ -29,17 +29,20 @@ type Client struct {
|
|||
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 {
|
||||
DeleteAPIV2UsersUserIDRoles(params *DeleteAPIV2UsersUserIDRolesParams) (*DeleteAPIV2UsersUserIDRolesNoContent, error)
|
||||
DeleteAPIV2UsersUserIDRoles(params *DeleteAPIV2UsersUserIDRolesParams, opts ...ClientOption) (*DeleteAPIV2UsersUserIDRolesNoContent, error)
|
||||
|
||||
GetUserByEmail(params *GetUserByEmailParams) (*GetUserByEmailOK, error)
|
||||
GetUserByEmail(params *GetUserByEmailParams, opts ...ClientOption) (*GetUserByEmailOK, error)
|
||||
|
||||
GetUserRoles(params *GetUserRolesParams) (*GetUserRolesOK, error)
|
||||
GetUserRoles(params *GetUserRolesParams, opts ...ClientOption) (*GetUserRolesOK, error)
|
||||
|
||||
GetUsers(params *GetUsersParams) (*GetUsersOK, error)
|
||||
GetUsers(params *GetUsersParams, opts ...ClientOption) (*GetUsersOK, error)
|
||||
|
||||
PostUsers(params *PostUsersParams) (*PostUsersCreated, error)
|
||||
PostUsers(params *PostUsersParams, opts ...ClientOption) (*PostUsersCreated, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
@ -47,13 +50,12 @@ type ClientService interface {
|
|||
/*
|
||||
DeleteAPIV2UsersUserIDRoles delete API v2 users user ID roles API
|
||||
*/
|
||||
func (a *Client) DeleteAPIV2UsersUserIDRoles(params *DeleteAPIV2UsersUserIDRolesParams) (*DeleteAPIV2UsersUserIDRolesNoContent, error) {
|
||||
func (a *Client) DeleteAPIV2UsersUserIDRoles(params *DeleteAPIV2UsersUserIDRolesParams, opts ...ClientOption) (*DeleteAPIV2UsersUserIDRolesNoContent, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewDeleteAPIV2UsersUserIDRolesParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "DeleteAPIV2UsersUserIDRoles",
|
||||
Method: "DELETE",
|
||||
PathPattern: "/api/v2/users/{userId}/roles",
|
||||
|
@ -64,7 +66,12 @@ func (a *Client) DeleteAPIV2UsersUserIDRoles(params *DeleteAPIV2UsersUserIDRoles
|
|||
Reader: &DeleteAPIV2UsersUserIDRolesReader{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
|
||||
}
|
||||
|
@ -83,13 +90,12 @@ func (a *Client) DeleteAPIV2UsersUserIDRoles(params *DeleteAPIV2UsersUserIDRoles
|
|||
|
||||
Get a single user from Auth0 by Email Address
|
||||
*/
|
||||
func (a *Client) GetUserByEmail(params *GetUserByEmailParams) (*GetUserByEmailOK, error) {
|
||||
func (a *Client) GetUserByEmail(params *GetUserByEmailParams, opts ...ClientOption) (*GetUserByEmailOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetUserByEmailParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "getUserByEmail",
|
||||
Method: "GET",
|
||||
PathPattern: "/api/v2/users-by-email",
|
||||
|
@ -100,7 +106,12 @@ func (a *Client) GetUserByEmail(params *GetUserByEmailParams) (*GetUserByEmailOK
|
|||
Reader: &GetUserByEmailReader{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
|
||||
}
|
||||
|
@ -119,13 +130,12 @@ func (a *Client) GetUserByEmail(params *GetUserByEmailParams) (*GetUserByEmailOK
|
|||
|
||||
Get a User's Roles
|
||||
*/
|
||||
func (a *Client) GetUserRoles(params *GetUserRolesParams) (*GetUserRolesOK, error) {
|
||||
func (a *Client) GetUserRoles(params *GetUserRolesParams, opts ...ClientOption) (*GetUserRolesOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetUserRolesParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "getUserRoles",
|
||||
Method: "GET",
|
||||
PathPattern: "/api/v2/users/{userId}/roles",
|
||||
|
@ -136,7 +146,12 @@ func (a *Client) GetUserRoles(params *GetUserRolesParams) (*GetUserRolesOK, erro
|
|||
Reader: &GetUserRolesReader{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
|
||||
}
|
||||
|
@ -155,13 +170,12 @@ func (a *Client) GetUserRoles(params *GetUserRolesParams) (*GetUserRolesOK, erro
|
|||
|
||||
Get all users from Auth0
|
||||
*/
|
||||
func (a *Client) GetUsers(params *GetUsersParams) (*GetUsersOK, error) {
|
||||
func (a *Client) GetUsers(params *GetUsersParams, opts ...ClientOption) (*GetUsersOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetUsersParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "getUsers",
|
||||
Method: "GET",
|
||||
PathPattern: "/api/v2/users",
|
||||
|
@ -172,7 +186,12 @@ func (a *Client) GetUsers(params *GetUsersParams) (*GetUsersOK, error) {
|
|||
Reader: &GetUsersReader{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
|
||||
}
|
||||
|
@ -191,13 +210,12 @@ func (a *Client) GetUsers(params *GetUsersParams) (*GetUsersOK, error) {
|
|||
|
||||
create new Auth0 user
|
||||
*/
|
||||
func (a *Client) PostUsers(params *PostUsersParams) (*PostUsersCreated, error) {
|
||||
func (a *Client) PostUsers(params *PostUsersParams, opts ...ClientOption) (*PostUsersCreated, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPostUsersParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "postUsers",
|
||||
Method: "POST",
|
||||
PathPattern: "/api/v2/users-by-email",
|
||||
|
@ -208,7 +226,12 @@ func (a *Client) PostUsers(params *PostUsersParams) (*PostUsersCreated, error) {
|
|||
Reader: &PostUsersReader{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
|
||||
}
|
||||
|
|
|
@ -10,6 +10,8 @@ package auth0_models
|
|||
// 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"
|
||||
)
|
||||
|
@ -37,6 +39,11 @@ func (m *CredentialsRequest) Validate(formats strfmt.Registry) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this credentials request based on context it is used
|
||||
func (m *CredentialsRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *CredentialsRequest) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
|
|
|
@ -10,6 +10,8 @@ package auth0_models
|
|||
// 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"
|
||||
)
|
||||
|
@ -37,6 +39,11 @@ func (m *CredentialsResponse) Validate(formats strfmt.Registry) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this credentials response based on context it is used
|
||||
func (m *CredentialsResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *CredentialsResponse) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
|
|
|
@ -10,6 +10,8 @@ package auth0_models
|
|||
// 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"
|
||||
)
|
||||
|
@ -34,6 +36,11 @@ 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 {
|
||||
|
|
|
@ -10,6 +10,8 @@ package auth0_models
|
|||
// 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"
|
||||
)
|
||||
|
@ -20,48 +22,63 @@ import (
|
|||
type NewUser struct {
|
||||
|
||||
// blocked
|
||||
// Example: false
|
||||
Blocked bool `json:"blocked,omitempty"`
|
||||
|
||||
// connection
|
||||
// Example: Initial-Connection
|
||||
Connection string `json:"connection,omitempty"`
|
||||
|
||||
// email
|
||||
// Example: john.doe@gmail.com
|
||||
Email string `json:"email,omitempty"`
|
||||
|
||||
// email verified
|
||||
// Example: false
|
||||
EmailVerified bool `json:"email_verified,omitempty"`
|
||||
|
||||
// family name
|
||||
// Example: Doe
|
||||
FamilyName string `json:"family_name,omitempty"`
|
||||
|
||||
// given name
|
||||
// Example: John
|
||||
GivenName string `json:"given_name,omitempty"`
|
||||
|
||||
// name
|
||||
// Example: John Doe
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// nickname
|
||||
// Example: Johnny
|
||||
Nickname string `json:"nickname,omitempty"`
|
||||
|
||||
// password
|
||||
// Example: secret
|
||||
Password string `json:"password,omitempty"`
|
||||
|
||||
// phone number
|
||||
// Example: +199999999999999
|
||||
PhoneNumber string `json:"phone_number,omitempty"`
|
||||
|
||||
// phone verified
|
||||
// Example: false
|
||||
PhoneVerified bool `json:"phone_verified,omitempty"`
|
||||
|
||||
// picture
|
||||
// Example: https://secure.gravatar.com/avatar/15626c5e0c749cb912f9d1ad48dba440?s=480\u0026r=pg\u0026d=https%3A%2F%2Fssl.gstatic.com%2Fs2%2Fprofiles%2Fimages%2Fsilhouette80.png
|
||||
Picture string `json:"picture,omitempty"`
|
||||
|
||||
// user id
|
||||
// Example: abc
|
||||
UserID string `json:"user_id,omitempty"`
|
||||
|
||||
// username
|
||||
// Example: johndoe
|
||||
Username string `json:"username,omitempty"`
|
||||
|
||||
// verify email
|
||||
// Example: false
|
||||
VerifyEmail bool `json:"verify_email,omitempty"`
|
||||
}
|
||||
|
||||
|
@ -70,6 +87,11 @@ func (m *NewUser) Validate(formats strfmt.Registry) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this new user based on context it is used
|
||||
func (m *NewUser) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *NewUser) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
|
|
|
@ -10,6 +10,8 @@ package auth0_models
|
|||
// 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"
|
||||
)
|
||||
|
@ -20,12 +22,15 @@ import (
|
|||
type Role struct {
|
||||
|
||||
// description
|
||||
// Example: Taxnexus API Developer
|
||||
Description string `json:"description,omitempty"`
|
||||
|
||||
// id
|
||||
// Example: rol_oWVoMn2Zx2qDSGUL
|
||||
ID string `json:"id,omitempty"`
|
||||
|
||||
// name
|
||||
// Example: Developer
|
||||
Name string `json:"name,omitempty"`
|
||||
}
|
||||
|
||||
|
@ -34,6 +39,11 @@ 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 {
|
||||
|
|
|
@ -10,6 +10,7 @@ package auth0_models
|
|||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strconv"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
|
@ -41,7 +42,6 @@ func (m *RoleResponse) Validate(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *RoleResponse) validateRoles(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Roles) { // not required
|
||||
return nil
|
||||
}
|
||||
|
@ -65,6 +65,38 @@ func (m *RoleResponse) validateRoles(formats strfmt.Registry) error {
|
|||
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.contextValidateRoles(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *RoleResponse) 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
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *RoleResponse) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
|
|
|
@ -10,6 +10,8 @@ package auth0_models
|
|||
// 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"
|
||||
)
|
||||
|
@ -28,6 +30,11 @@ func (m *RoleUsersRequest) Validate(formats strfmt.Registry) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this role users request based on context it is used
|
||||
func (m *RoleUsersRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *RoleUsersRequest) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
|
|
|
@ -10,6 +10,7 @@ package auth0_models
|
|||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strconv"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
|
@ -26,51 +27,66 @@ type User struct {
|
|||
AppMetadata *UserAppMetadata `json:"app_metadata,omitempty"`
|
||||
|
||||
// created at
|
||||
// Example: 2018-06-06T16:00:55.930Z
|
||||
CreatedAt string `json:"created_at,omitempty"`
|
||||
|
||||
// email
|
||||
// Example: vern@taxnexus.net
|
||||
Email string `json:"email,omitempty"`
|
||||
|
||||
// email verified
|
||||
// Example: true
|
||||
EmailVerified bool `json:"email_verified,omitempty"`
|
||||
|
||||
// family name
|
||||
// Example: Keenan
|
||||
FamilyName string `json:"family_name,omitempty"`
|
||||
|
||||
// given name
|
||||
// Example: Vernon
|
||||
GivenName string `json:"given_name,omitempty"`
|
||||
|
||||
// identities
|
||||
Identities []*UserIdentitiesItems0 `json:"identities"`
|
||||
|
||||
// last ip
|
||||
// Example: 67.188.106.161
|
||||
LastIP string `json:"last_ip,omitempty"`
|
||||
|
||||
// last login
|
||||
// Example: 2020-09-22T19:19:02.706Z
|
||||
LastLogin string `json:"last_login,omitempty"`
|
||||
|
||||
// last password reset
|
||||
// Example: 2020-09-21T00:11:47.397Z
|
||||
LastPasswordReset string `json:"last_password_reset,omitempty"`
|
||||
|
||||
// logins count
|
||||
// Example: 178
|
||||
LoginsCount int64 `json:"logins_count,omitempty"`
|
||||
|
||||
// multifactor last modified
|
||||
// Example: 2020-09-21T00:30:34.081Z
|
||||
MultifactorLastModified string `json:"multifactor_last_modified,omitempty"`
|
||||
|
||||
// name
|
||||
// Example: Vernon Keenan
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// nickname
|
||||
// Example: vern
|
||||
Nickname string `json:"nickname,omitempty"`
|
||||
|
||||
// picture
|
||||
// Example: https://s.gravatar.com/avatar/a08710b8d49416c729a0da8a9c34cdb0?s=480\u0026r=pg\u0026d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fve.png
|
||||
Picture string `json:"picture,omitempty"`
|
||||
|
||||
// updated at
|
||||
// Example: 2020-09-22T19:19:02.706Z
|
||||
UpdatedAt string `json:"updated_at,omitempty"`
|
||||
|
||||
// user id
|
||||
// Example: auth0|5b180537157859716f2c9df5
|
||||
UserID string `json:"user_id,omitempty"`
|
||||
|
||||
// user metadata
|
||||
|
@ -100,7 +116,6 @@ func (m *User) Validate(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *User) validateAppMetadata(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.AppMetadata) { // not required
|
||||
return nil
|
||||
}
|
||||
|
@ -118,7 +133,6 @@ func (m *User) validateAppMetadata(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *User) validateIdentities(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Identities) { // not required
|
||||
return nil
|
||||
}
|
||||
|
@ -143,7 +157,6 @@ func (m *User) validateIdentities(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *User) validateUserMetadata(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.UserMetadata) { // not required
|
||||
return nil
|
||||
}
|
||||
|
@ -160,6 +173,74 @@ func (m *User) validateUserMetadata(formats strfmt.Registry) error {
|
|||
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.contextValidateAppMetadata(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.contextValidateIdentities(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.contextValidateUserMetadata(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *User) contextValidateAppMetadata(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.AppMetadata != nil {
|
||||
if err := m.AppMetadata.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("app_metadata")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *User) contextValidateIdentities(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
for i := 0; i < len(m.Identities); i++ {
|
||||
|
||||
if m.Identities[i] != nil {
|
||||
if err := m.Identities[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("identities" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *User) contextValidateUserMetadata(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.UserMetadata != nil {
|
||||
if err := m.UserMetadata.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("user_metadata")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *User) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
|
@ -184,15 +265,19 @@ func (m *User) UnmarshalBinary(b []byte) error {
|
|||
type UserAppMetadata struct {
|
||||
|
||||
// roles
|
||||
// Example: ["login"]
|
||||
Roles []string `json:"roles"`
|
||||
|
||||
// taxnexus account id
|
||||
// Example: 7f661ca6-ae4a-486f-9c3c-cd292685a46d
|
||||
TaxnexusAccountID string `json:"taxnexus_account_id,omitempty"`
|
||||
|
||||
// taxnexus contact id
|
||||
// Example: 9f79dca8-e875-4e2b-a5ad-001a3d32e83d
|
||||
TaxnexusContactID string `json:"taxnexus_contact_id,omitempty"`
|
||||
|
||||
// taxnexus user id
|
||||
// Example: f04da03d-70ad-46df-a46c-a676388aadd7
|
||||
TaxnexusUserID string `json:"taxnexus_user_id,omitempty"`
|
||||
}
|
||||
|
||||
|
@ -201,6 +286,11 @@ func (m *UserAppMetadata) Validate(formats strfmt.Registry) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this user app metadata based on context it is used
|
||||
func (m *UserAppMetadata) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *UserAppMetadata) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
|
@ -225,15 +315,19 @@ func (m *UserAppMetadata) UnmarshalBinary(b []byte) error {
|
|||
type UserIdentitiesItems0 struct {
|
||||
|
||||
// connection
|
||||
// Example: Username-Password-Authentication
|
||||
Connection string `json:"connection,omitempty"`
|
||||
|
||||
// is social
|
||||
// Example: false
|
||||
IsSocial bool `json:"isSocial,omitempty"`
|
||||
|
||||
// provider
|
||||
// Example: auth0
|
||||
Provider string `json:"provider,omitempty"`
|
||||
|
||||
// user id
|
||||
// Example: 5b180537157859716f2c9df5
|
||||
UserID string `json:"user_id,omitempty"`
|
||||
}
|
||||
|
||||
|
@ -242,6 +336,11 @@ func (m *UserIdentitiesItems0) Validate(formats strfmt.Registry) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this user identities items0 based on context it is used
|
||||
func (m *UserIdentitiesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *UserIdentitiesItems0) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
|
@ -266,18 +365,23 @@ func (m *UserIdentitiesItems0) UnmarshalBinary(b []byte) error {
|
|||
type UserUserMetadata struct {
|
||||
|
||||
// taxnexus email
|
||||
// Example: vern@taxnexus.net
|
||||
TaxnexusEmail string `json:"taxnexus_email,omitempty"`
|
||||
|
||||
// taxnexus firstname
|
||||
// Example: Vernon
|
||||
TaxnexusFirstname string `json:"taxnexus_firstname,omitempty"`
|
||||
|
||||
// taxnexus fullname
|
||||
// Example: Vernon Keenan
|
||||
TaxnexusFullname string `json:"taxnexus_fullname,omitempty"`
|
||||
|
||||
// taxnexus lastname
|
||||
// Example: Keenan
|
||||
TaxnexusLastname string `json:"taxnexus_lastname,omitempty"`
|
||||
|
||||
// taxnexus phone
|
||||
// Example: +15106791900
|
||||
TaxnexusPhone string `json:"taxnexus_phone,omitempty"`
|
||||
}
|
||||
|
||||
|
@ -286,6 +390,11 @@ func (m *UserUserMetadata) Validate(formats strfmt.Registry) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this user user metadata based on context it is used
|
||||
func (m *UserUserMetadata) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *UserUserMetadata) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
|
|
|
@ -10,6 +10,7 @@ package auth0_models
|
|||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strconv"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
|
@ -41,7 +42,6 @@ func (m *UserRequest) Validate(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *UserRequest) validateUsers(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Users) { // not required
|
||||
return nil
|
||||
}
|
||||
|
@ -65,6 +65,38 @@ func (m *UserRequest) validateUsers(formats strfmt.Registry) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validate this user request based on the context it is used
|
||||
func (m *UserRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.contextValidateUsers(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *UserRequest) contextValidateUsers(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
for i := 0; i < len(m.Users); i++ {
|
||||
|
||||
if m.Users[i] != nil {
|
||||
if err := m.Users[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("users" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *UserRequest) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
|
|
|
@ -10,6 +10,8 @@ package auth0_models
|
|||
// 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"
|
||||
)
|
||||
|
@ -28,6 +30,11 @@ func (m *UserRolesRequest) Validate(formats strfmt.Registry) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this user roles request based on context it is used
|
||||
func (m *UserRolesRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *UserRolesRequest) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
|
|
|
@ -20,53 +20,52 @@ import (
|
|||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// NewGetMemberParams creates a new GetMemberParams object
|
||||
// with the default values initialized.
|
||||
// NewGetMemberParams creates a new GetMemberParams 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 NewGetMemberParams() *GetMemberParams {
|
||||
var ()
|
||||
return &GetMemberParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetMemberParamsWithTimeout creates a new GetMemberParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetMemberParamsWithTimeout(timeout time.Duration) *GetMemberParams {
|
||||
var ()
|
||||
return &GetMemberParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetMemberParamsWithContext creates a new GetMemberParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
// with the ability to set a context for a request.
|
||||
func NewGetMemberParamsWithContext(ctx context.Context) *GetMemberParams {
|
||||
var ()
|
||||
return &GetMemberParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetMemberParamsWithHTTPClient creates a new GetMemberParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewGetMemberParamsWithHTTPClient(client *http.Client) *GetMemberParams {
|
||||
var ()
|
||||
return &GetMemberParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/* GetMemberParams contains all the parameters to send to the API endpoint
|
||||
for the get member operation typically these are written to a http.Request
|
||||
for the get member operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type GetMemberParams struct {
|
||||
|
||||
/*MemberID
|
||||
The Blaze Member Object Id
|
||||
/* MemberID.
|
||||
|
||||
The Blaze Member Object Id
|
||||
*/
|
||||
MemberID string
|
||||
|
||||
|
@ -75,6 +74,21 @@ type GetMemberParams struct {
|
|||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the get member params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetMemberParams) WithDefaults() *GetMemberParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the get member params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetMemberParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get member params
|
||||
func (o *GetMemberParams) WithTimeout(timeout time.Duration) *GetMemberParams {
|
||||
o.SetTimeout(timeout)
|
||||
|
|
|
@ -57,9 +57,8 @@ func (o *GetMemberReader) ReadResponse(response runtime.ClientResponse, consumer
|
|||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -68,7 +67,7 @@ func NewGetMemberOK() *GetMemberOK {
|
|||
return &GetMemberOK{}
|
||||
}
|
||||
|
||||
/*GetMemberOK handles this case with default header values.
|
||||
/* GetMemberOK describes a response with status code 200, with default header values.
|
||||
|
||||
Product was successfully retrieved
|
||||
*/
|
||||
|
@ -79,7 +78,6 @@ type GetMemberOK struct {
|
|||
func (o *GetMemberOK) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/members/{memberId}][%d] getMemberOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetMemberOK) GetPayload() *blaze_models.MemberResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -101,7 +99,7 @@ func NewGetMemberUnauthorized() *GetMemberUnauthorized {
|
|||
return &GetMemberUnauthorized{}
|
||||
}
|
||||
|
||||
/*GetMemberUnauthorized handles this case with default header values.
|
||||
/* GetMemberUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
|
@ -112,7 +110,6 @@ type GetMemberUnauthorized struct {
|
|||
func (o *GetMemberUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/members/{memberId}][%d] getMemberUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetMemberUnauthorized) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -134,7 +131,7 @@ func NewGetMemberForbidden() *GetMemberForbidden {
|
|||
return &GetMemberForbidden{}
|
||||
}
|
||||
|
||||
/*GetMemberForbidden handles this case with default header values.
|
||||
/* GetMemberForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
|
@ -145,7 +142,6 @@ type GetMemberForbidden struct {
|
|||
func (o *GetMemberForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/members/{memberId}][%d] getMemberForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetMemberForbidden) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -167,7 +163,7 @@ func NewGetMemberNotFound() *GetMemberNotFound {
|
|||
return &GetMemberNotFound{}
|
||||
}
|
||||
|
||||
/*GetMemberNotFound handles this case with default header values.
|
||||
/* GetMemberNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
|
@ -178,7 +174,6 @@ type GetMemberNotFound struct {
|
|||
func (o *GetMemberNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/members/{memberId}][%d] getMemberNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetMemberNotFound) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -200,7 +195,7 @@ func NewGetMemberInternalServerError() *GetMemberInternalServerError {
|
|||
return &GetMemberInternalServerError{}
|
||||
}
|
||||
|
||||
/*GetMemberInternalServerError handles this case with default header values.
|
||||
/* GetMemberInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
|
@ -211,7 +206,6 @@ type GetMemberInternalServerError struct {
|
|||
func (o *GetMemberInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/members/{memberId}][%d] getMemberInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetMemberInternalServerError) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
|
|
@ -29,9 +29,12 @@ type Client struct {
|
|||
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 {
|
||||
GetMember(params *GetMemberParams, authInfo runtime.ClientAuthInfoWriter) (*GetMemberOK, error)
|
||||
GetMember(params *GetMemberParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetMemberOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
@ -39,13 +42,12 @@ type ClientService interface {
|
|||
/*
|
||||
GetMember Get A Member (contact)
|
||||
*/
|
||||
func (a *Client) GetMember(params *GetMemberParams, authInfo runtime.ClientAuthInfoWriter) (*GetMemberOK, error) {
|
||||
func (a *Client) GetMember(params *GetMemberParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetMemberOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetMemberParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "getMember",
|
||||
Method: "GET",
|
||||
PathPattern: "/partner/members/{memberId}",
|
||||
|
@ -57,7 +59,12 @@ func (a *Client) GetMember(params *GetMemberParams, authInfo runtime.ClientAuthI
|
|||
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
|
||||
}
|
||||
|
|
|
@ -20,53 +20,52 @@ import (
|
|||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// NewGetProductParams creates a new GetProductParams object
|
||||
// with the default values initialized.
|
||||
// NewGetProductParams creates a new GetProductParams 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 NewGetProductParams() *GetProductParams {
|
||||
var ()
|
||||
return &GetProductParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetProductParamsWithTimeout creates a new GetProductParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetProductParamsWithTimeout(timeout time.Duration) *GetProductParams {
|
||||
var ()
|
||||
return &GetProductParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetProductParamsWithContext creates a new GetProductParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
// with the ability to set a context for a request.
|
||||
func NewGetProductParamsWithContext(ctx context.Context) *GetProductParams {
|
||||
var ()
|
||||
return &GetProductParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetProductParamsWithHTTPClient creates a new GetProductParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewGetProductParamsWithHTTPClient(client *http.Client) *GetProductParams {
|
||||
var ()
|
||||
return &GetProductParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/* GetProductParams contains all the parameters to send to the API endpoint
|
||||
for the get product operation typically these are written to a http.Request
|
||||
for the get product operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type GetProductParams struct {
|
||||
|
||||
/*ProductID
|
||||
The Blaze Product Object Id
|
||||
/* ProductID.
|
||||
|
||||
The Blaze Product Object Id
|
||||
*/
|
||||
ProductID string
|
||||
|
||||
|
@ -75,6 +74,21 @@ type GetProductParams struct {
|
|||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the get product params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetProductParams) WithDefaults() *GetProductParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the get product params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetProductParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get product params
|
||||
func (o *GetProductParams) WithTimeout(timeout time.Duration) *GetProductParams {
|
||||
o.SetTimeout(timeout)
|
||||
|
|
|
@ -57,9 +57,8 @@ func (o *GetProductReader) ReadResponse(response runtime.ClientResponse, consume
|
|||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -68,7 +67,7 @@ func NewGetProductOK() *GetProductOK {
|
|||
return &GetProductOK{}
|
||||
}
|
||||
|
||||
/*GetProductOK handles this case with default header values.
|
||||
/* GetProductOK describes a response with status code 200, with default header values.
|
||||
|
||||
Product was successfully retrieved
|
||||
*/
|
||||
|
@ -79,7 +78,6 @@ type GetProductOK struct {
|
|||
func (o *GetProductOK) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/products/{productId}][%d] getProductOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetProductOK) GetPayload() *blaze_models.ProductResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -101,7 +99,7 @@ func NewGetProductUnauthorized() *GetProductUnauthorized {
|
|||
return &GetProductUnauthorized{}
|
||||
}
|
||||
|
||||
/*GetProductUnauthorized handles this case with default header values.
|
||||
/* GetProductUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
|
@ -112,7 +110,6 @@ type GetProductUnauthorized struct {
|
|||
func (o *GetProductUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/products/{productId}][%d] getProductUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetProductUnauthorized) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -134,7 +131,7 @@ func NewGetProductForbidden() *GetProductForbidden {
|
|||
return &GetProductForbidden{}
|
||||
}
|
||||
|
||||
/*GetProductForbidden handles this case with default header values.
|
||||
/* GetProductForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
|
@ -145,7 +142,6 @@ type GetProductForbidden struct {
|
|||
func (o *GetProductForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/products/{productId}][%d] getProductForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetProductForbidden) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -167,7 +163,7 @@ func NewGetProductNotFound() *GetProductNotFound {
|
|||
return &GetProductNotFound{}
|
||||
}
|
||||
|
||||
/*GetProductNotFound handles this case with default header values.
|
||||
/* GetProductNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
|
@ -178,7 +174,6 @@ type GetProductNotFound struct {
|
|||
func (o *GetProductNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/products/{productId}][%d] getProductNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetProductNotFound) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -200,7 +195,7 @@ func NewGetProductInternalServerError() *GetProductInternalServerError {
|
|||
return &GetProductInternalServerError{}
|
||||
}
|
||||
|
||||
/*GetProductInternalServerError handles this case with default header values.
|
||||
/* GetProductInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
|
@ -211,7 +206,6 @@ type GetProductInternalServerError struct {
|
|||
func (o *GetProductInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/products/{productId}][%d] getProductInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetProductInternalServerError) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
|
|
@ -20,47 +20,46 @@ import (
|
|||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// NewGetProductsParams creates a new GetProductsParams object
|
||||
// with the default values initialized.
|
||||
// NewGetProductsParams creates a new GetProductsParams 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 NewGetProductsParams() *GetProductsParams {
|
||||
|
||||
return &GetProductsParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetProductsParamsWithTimeout creates a new GetProductsParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetProductsParamsWithTimeout(timeout time.Duration) *GetProductsParams {
|
||||
|
||||
return &GetProductsParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetProductsParamsWithContext creates a new GetProductsParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
// with the ability to set a context for a request.
|
||||
func NewGetProductsParamsWithContext(ctx context.Context) *GetProductsParams {
|
||||
|
||||
return &GetProductsParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetProductsParamsWithHTTPClient creates a new GetProductsParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewGetProductsParamsWithHTTPClient(client *http.Client) *GetProductsParams {
|
||||
|
||||
return &GetProductsParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/* GetProductsParams contains all the parameters to send to the API endpoint
|
||||
for the get products operation typically these are written to a http.Request
|
||||
for the get products operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type GetProductsParams struct {
|
||||
timeout time.Duration
|
||||
|
@ -68,6 +67,21 @@ type GetProductsParams struct {
|
|||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the get products params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetProductsParams) WithDefaults() *GetProductsParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the get products params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetProductsParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get products params
|
||||
func (o *GetProductsParams) WithTimeout(timeout time.Duration) *GetProductsParams {
|
||||
o.SetTimeout(timeout)
|
||||
|
|
|
@ -57,9 +57,8 @@ func (o *GetProductsReader) ReadResponse(response runtime.ClientResponse, consum
|
|||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -68,7 +67,7 @@ func NewGetProductsOK() *GetProductsOK {
|
|||
return &GetProductsOK{}
|
||||
}
|
||||
|
||||
/*GetProductsOK handles this case with default header values.
|
||||
/* GetProductsOK describes a response with status code 200, with default header values.
|
||||
|
||||
Products were successfully retrieved
|
||||
*/
|
||||
|
@ -79,7 +78,6 @@ type GetProductsOK struct {
|
|||
func (o *GetProductsOK) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/products][%d] getProductsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetProductsOK) GetPayload() *blaze_models.ProductsResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -101,7 +99,7 @@ func NewGetProductsUnauthorized() *GetProductsUnauthorized {
|
|||
return &GetProductsUnauthorized{}
|
||||
}
|
||||
|
||||
/*GetProductsUnauthorized handles this case with default header values.
|
||||
/* GetProductsUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
|
@ -112,7 +110,6 @@ type GetProductsUnauthorized struct {
|
|||
func (o *GetProductsUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/products][%d] getProductsUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetProductsUnauthorized) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -134,7 +131,7 @@ func NewGetProductsForbidden() *GetProductsForbidden {
|
|||
return &GetProductsForbidden{}
|
||||
}
|
||||
|
||||
/*GetProductsForbidden handles this case with default header values.
|
||||
/* GetProductsForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
|
@ -145,7 +142,6 @@ type GetProductsForbidden struct {
|
|||
func (o *GetProductsForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/products][%d] getProductsForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetProductsForbidden) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -167,7 +163,7 @@ func NewGetProductsNotFound() *GetProductsNotFound {
|
|||
return &GetProductsNotFound{}
|
||||
}
|
||||
|
||||
/*GetProductsNotFound handles this case with default header values.
|
||||
/* GetProductsNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
|
@ -178,7 +174,6 @@ type GetProductsNotFound struct {
|
|||
func (o *GetProductsNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/products][%d] getProductsNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetProductsNotFound) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -200,7 +195,7 @@ func NewGetProductsInternalServerError() *GetProductsInternalServerError {
|
|||
return &GetProductsInternalServerError{}
|
||||
}
|
||||
|
||||
/*GetProductsInternalServerError handles this case with default header values.
|
||||
/* GetProductsInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
|
@ -211,7 +206,6 @@ type GetProductsInternalServerError struct {
|
|||
func (o *GetProductsInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/products][%d] getProductsInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetProductsInternalServerError) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
|
|
@ -29,11 +29,14 @@ type Client struct {
|
|||
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 {
|
||||
GetProduct(params *GetProductParams, authInfo runtime.ClientAuthInfoWriter) (*GetProductOK, error)
|
||||
GetProduct(params *GetProductParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetProductOK, error)
|
||||
|
||||
GetProducts(params *GetProductsParams, authInfo runtime.ClientAuthInfoWriter) (*GetProductsOK, error)
|
||||
GetProducts(params *GetProductsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetProductsOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
@ -41,13 +44,12 @@ type ClientService interface {
|
|||
/*
|
||||
GetProduct Get A Product
|
||||
*/
|
||||
func (a *Client) GetProduct(params *GetProductParams, authInfo runtime.ClientAuthInfoWriter) (*GetProductOK, error) {
|
||||
func (a *Client) GetProduct(params *GetProductParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetProductOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetProductParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "getProduct",
|
||||
Method: "GET",
|
||||
PathPattern: "/partner/products/{productId}",
|
||||
|
@ -59,7 +61,12 @@ func (a *Client) GetProduct(params *GetProductParams, authInfo runtime.ClientAut
|
|||
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
|
||||
}
|
||||
|
@ -76,13 +83,12 @@ func (a *Client) GetProduct(params *GetProductParams, authInfo runtime.ClientAut
|
|||
/*
|
||||
GetProducts Get All Products
|
||||
*/
|
||||
func (a *Client) GetProducts(params *GetProductsParams, authInfo runtime.ClientAuthInfoWriter) (*GetProductsOK, error) {
|
||||
func (a *Client) GetProducts(params *GetProductsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetProductsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetProductsParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "getProducts",
|
||||
Method: "GET",
|
||||
PathPattern: "/partner/products",
|
||||
|
@ -94,7 +100,12 @@ func (a *Client) GetProducts(params *GetProductsParams, authInfo runtime.ClientA
|
|||
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
|
||||
}
|
||||
|
|
|
@ -21,68 +21,70 @@ import (
|
|||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// NewGetPurchaseOrderListParams creates a new GetPurchaseOrderListParams object
|
||||
// with the default values initialized.
|
||||
// NewGetPurchaseOrderListParams creates a new GetPurchaseOrderListParams 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 NewGetPurchaseOrderListParams() *GetPurchaseOrderListParams {
|
||||
var ()
|
||||
return &GetPurchaseOrderListParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetPurchaseOrderListParamsWithTimeout creates a new GetPurchaseOrderListParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetPurchaseOrderListParamsWithTimeout(timeout time.Duration) *GetPurchaseOrderListParams {
|
||||
var ()
|
||||
return &GetPurchaseOrderListParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetPurchaseOrderListParamsWithContext creates a new GetPurchaseOrderListParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
// with the ability to set a context for a request.
|
||||
func NewGetPurchaseOrderListParamsWithContext(ctx context.Context) *GetPurchaseOrderListParams {
|
||||
var ()
|
||||
return &GetPurchaseOrderListParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetPurchaseOrderListParamsWithHTTPClient creates a new GetPurchaseOrderListParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewGetPurchaseOrderListParamsWithHTTPClient(client *http.Client) *GetPurchaseOrderListParams {
|
||||
var ()
|
||||
return &GetPurchaseOrderListParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/* GetPurchaseOrderListParams contains all the parameters to send to the API endpoint
|
||||
for the get purchase order list operation typically these are written to a http.Request
|
||||
for the get purchase order list operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type GetPurchaseOrderListParams struct {
|
||||
|
||||
/*EndDate
|
||||
The end date of transaction query
|
||||
/* EndDate.
|
||||
|
||||
The end date of transaction query
|
||||
*/
|
||||
EndDate string
|
||||
/*Limit
|
||||
The number of records to retrieve
|
||||
|
||||
/* Limit.
|
||||
|
||||
The number of records to retrieve
|
||||
*/
|
||||
Limit *float64
|
||||
/*Start
|
||||
The starting record in multi-record retrievals
|
||||
|
||||
/* Start.
|
||||
|
||||
The starting record in multi-record retrievals
|
||||
*/
|
||||
Start *float64
|
||||
/*StartDate
|
||||
The start date of transaction query
|
||||
|
||||
/* StartDate.
|
||||
|
||||
The start date of transaction query
|
||||
*/
|
||||
StartDate string
|
||||
|
||||
|
@ -91,6 +93,21 @@ type GetPurchaseOrderListParams struct {
|
|||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the get purchase order list params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetPurchaseOrderListParams) WithDefaults() *GetPurchaseOrderListParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the get purchase order list params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetPurchaseOrderListParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get purchase order list params
|
||||
func (o *GetPurchaseOrderListParams) WithTimeout(timeout time.Duration) *GetPurchaseOrderListParams {
|
||||
o.SetTimeout(timeout)
|
||||
|
@ -180,6 +197,7 @@ func (o *GetPurchaseOrderListParams) WriteToRequest(r runtime.ClientRequest, reg
|
|||
qrEndDate := o.EndDate
|
||||
qEndDate := qrEndDate
|
||||
if qEndDate != "" {
|
||||
|
||||
if err := r.SetQueryParam("endDate", qEndDate); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -189,38 +207,41 @@ func (o *GetPurchaseOrderListParams) WriteToRequest(r runtime.ClientRequest, reg
|
|||
|
||||
// query param limit
|
||||
var qrLimit float64
|
||||
|
||||
if o.Limit != nil {
|
||||
qrLimit = *o.Limit
|
||||
}
|
||||
qLimit := swag.FormatFloat64(qrLimit)
|
||||
if qLimit != "" {
|
||||
|
||||
if err := r.SetQueryParam("limit", qLimit); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if o.Start != nil {
|
||||
|
||||
// query param start
|
||||
var qrStart float64
|
||||
|
||||
if o.Start != nil {
|
||||
qrStart = *o.Start
|
||||
}
|
||||
qStart := swag.FormatFloat64(qrStart)
|
||||
if qStart != "" {
|
||||
|
||||
if err := r.SetQueryParam("start", qStart); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// query param startDate
|
||||
qrStartDate := o.StartDate
|
||||
qStartDate := qrStartDate
|
||||
if qStartDate != "" {
|
||||
|
||||
if err := r.SetQueryParam("startDate", qStartDate); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -57,9 +57,8 @@ func (o *GetPurchaseOrderListReader) ReadResponse(response runtime.ClientRespons
|
|||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -68,7 +67,7 @@ func NewGetPurchaseOrderListOK() *GetPurchaseOrderListOK {
|
|||
return &GetPurchaseOrderListOK{}
|
||||
}
|
||||
|
||||
/*GetPurchaseOrderListOK handles this case with default header values.
|
||||
/* GetPurchaseOrderListOK describes a response with status code 200, with default header values.
|
||||
|
||||
Shop was successfully retrieved
|
||||
*/
|
||||
|
@ -79,7 +78,6 @@ type GetPurchaseOrderListOK struct {
|
|||
func (o *GetPurchaseOrderListOK) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/store/purchaseOrder/list][%d] getPurchaseOrderListOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetPurchaseOrderListOK) GetPayload() *blaze_models.PurchaseOrderListResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -101,7 +99,7 @@ func NewGetPurchaseOrderListUnauthorized() *GetPurchaseOrderListUnauthorized {
|
|||
return &GetPurchaseOrderListUnauthorized{}
|
||||
}
|
||||
|
||||
/*GetPurchaseOrderListUnauthorized handles this case with default header values.
|
||||
/* GetPurchaseOrderListUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
|
@ -112,7 +110,6 @@ type GetPurchaseOrderListUnauthorized struct {
|
|||
func (o *GetPurchaseOrderListUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/store/purchaseOrder/list][%d] getPurchaseOrderListUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetPurchaseOrderListUnauthorized) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -134,7 +131,7 @@ func NewGetPurchaseOrderListForbidden() *GetPurchaseOrderListForbidden {
|
|||
return &GetPurchaseOrderListForbidden{}
|
||||
}
|
||||
|
||||
/*GetPurchaseOrderListForbidden handles this case with default header values.
|
||||
/* GetPurchaseOrderListForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
|
@ -145,7 +142,6 @@ type GetPurchaseOrderListForbidden struct {
|
|||
func (o *GetPurchaseOrderListForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/store/purchaseOrder/list][%d] getPurchaseOrderListForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetPurchaseOrderListForbidden) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -167,7 +163,7 @@ func NewGetPurchaseOrderListNotFound() *GetPurchaseOrderListNotFound {
|
|||
return &GetPurchaseOrderListNotFound{}
|
||||
}
|
||||
|
||||
/*GetPurchaseOrderListNotFound handles this case with default header values.
|
||||
/* GetPurchaseOrderListNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
|
@ -178,7 +174,6 @@ type GetPurchaseOrderListNotFound struct {
|
|||
func (o *GetPurchaseOrderListNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/store/purchaseOrder/list][%d] getPurchaseOrderListNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetPurchaseOrderListNotFound) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -200,7 +195,7 @@ func NewGetPurchaseOrderListInternalServerError() *GetPurchaseOrderListInternalS
|
|||
return &GetPurchaseOrderListInternalServerError{}
|
||||
}
|
||||
|
||||
/*GetPurchaseOrderListInternalServerError handles this case with default header values.
|
||||
/* GetPurchaseOrderListInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
|
@ -211,7 +206,6 @@ type GetPurchaseOrderListInternalServerError struct {
|
|||
func (o *GetPurchaseOrderListInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/store/purchaseOrder/list][%d] getPurchaseOrderListInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetPurchaseOrderListInternalServerError) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
|
|
@ -29,9 +29,12 @@ type Client struct {
|
|||
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 {
|
||||
GetPurchaseOrderList(params *GetPurchaseOrderListParams, authInfo runtime.ClientAuthInfoWriter) (*GetPurchaseOrderListOK, error)
|
||||
GetPurchaseOrderList(params *GetPurchaseOrderListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPurchaseOrderListOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
@ -39,13 +42,12 @@ type ClientService interface {
|
|||
/*
|
||||
GetPurchaseOrderList Get a list of purchase orders
|
||||
*/
|
||||
func (a *Client) GetPurchaseOrderList(params *GetPurchaseOrderListParams, authInfo runtime.ClientAuthInfoWriter) (*GetPurchaseOrderListOK, error) {
|
||||
func (a *Client) GetPurchaseOrderList(params *GetPurchaseOrderListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPurchaseOrderListOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetPurchaseOrderListParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "getPurchaseOrderList",
|
||||
Method: "GET",
|
||||
PathPattern: "/partner/store/purchaseOrder/list",
|
||||
|
@ -57,7 +59,12 @@ func (a *Client) GetPurchaseOrderList(params *GetPurchaseOrderListParams, authIn
|
|||
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
|
||||
}
|
||||
|
|
|
@ -20,47 +20,46 @@ import (
|
|||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// NewGetShopParams creates a new GetShopParams object
|
||||
// with the default values initialized.
|
||||
// NewGetShopParams creates a new GetShopParams 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 NewGetShopParams() *GetShopParams {
|
||||
|
||||
return &GetShopParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetShopParamsWithTimeout creates a new GetShopParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetShopParamsWithTimeout(timeout time.Duration) *GetShopParams {
|
||||
|
||||
return &GetShopParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetShopParamsWithContext creates a new GetShopParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
// with the ability to set a context for a request.
|
||||
func NewGetShopParamsWithContext(ctx context.Context) *GetShopParams {
|
||||
|
||||
return &GetShopParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetShopParamsWithHTTPClient creates a new GetShopParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewGetShopParamsWithHTTPClient(client *http.Client) *GetShopParams {
|
||||
|
||||
return &GetShopParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/* GetShopParams contains all the parameters to send to the API endpoint
|
||||
for the get shop operation typically these are written to a http.Request
|
||||
for the get shop operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type GetShopParams struct {
|
||||
timeout time.Duration
|
||||
|
@ -68,6 +67,21 @@ type GetShopParams struct {
|
|||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the get shop params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetShopParams) WithDefaults() *GetShopParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the get shop params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetShopParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get shop params
|
||||
func (o *GetShopParams) WithTimeout(timeout time.Duration) *GetShopParams {
|
||||
o.SetTimeout(timeout)
|
||||
|
|
|
@ -57,9 +57,8 @@ func (o *GetShopReader) ReadResponse(response runtime.ClientResponse, consumer r
|
|||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -68,7 +67,7 @@ func NewGetShopOK() *GetShopOK {
|
|||
return &GetShopOK{}
|
||||
}
|
||||
|
||||
/*GetShopOK handles this case with default header values.
|
||||
/* GetShopOK describes a response with status code 200, with default header values.
|
||||
|
||||
Shop was successfully retrieved
|
||||
*/
|
||||
|
@ -79,7 +78,6 @@ type GetShopOK struct {
|
|||
func (o *GetShopOK) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/store][%d] getShopOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetShopOK) GetPayload() *blaze_models.ShopResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -101,7 +99,7 @@ func NewGetShopUnauthorized() *GetShopUnauthorized {
|
|||
return &GetShopUnauthorized{}
|
||||
}
|
||||
|
||||
/*GetShopUnauthorized handles this case with default header values.
|
||||
/* GetShopUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
|
@ -112,7 +110,6 @@ type GetShopUnauthorized struct {
|
|||
func (o *GetShopUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/store][%d] getShopUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetShopUnauthorized) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -134,7 +131,7 @@ func NewGetShopForbidden() *GetShopForbidden {
|
|||
return &GetShopForbidden{}
|
||||
}
|
||||
|
||||
/*GetShopForbidden handles this case with default header values.
|
||||
/* GetShopForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
|
@ -145,7 +142,6 @@ type GetShopForbidden struct {
|
|||
func (o *GetShopForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/store][%d] getShopForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetShopForbidden) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -167,7 +163,7 @@ func NewGetShopNotFound() *GetShopNotFound {
|
|||
return &GetShopNotFound{}
|
||||
}
|
||||
|
||||
/*GetShopNotFound handles this case with default header values.
|
||||
/* GetShopNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
|
@ -178,7 +174,6 @@ type GetShopNotFound struct {
|
|||
func (o *GetShopNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/store][%d] getShopNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetShopNotFound) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -200,7 +195,7 @@ func NewGetShopInternalServerError() *GetShopInternalServerError {
|
|||
return &GetShopInternalServerError{}
|
||||
}
|
||||
|
||||
/*GetShopInternalServerError handles this case with default header values.
|
||||
/* GetShopInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
|
@ -211,7 +206,6 @@ type GetShopInternalServerError struct {
|
|||
func (o *GetShopInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/store][%d] getShopInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetShopInternalServerError) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
|
|
@ -29,9 +29,12 @@ type Client struct {
|
|||
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 {
|
||||
GetShop(params *GetShopParams, authInfo runtime.ClientAuthInfoWriter) (*GetShopOK, error)
|
||||
GetShop(params *GetShopParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetShopOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
@ -39,13 +42,12 @@ type ClientService interface {
|
|||
/*
|
||||
GetShop Get basic Shop parameters
|
||||
*/
|
||||
func (a *Client) GetShop(params *GetShopParams, authInfo runtime.ClientAuthInfoWriter) (*GetShopOK, error) {
|
||||
func (a *Client) GetShop(params *GetShopParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetShopOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetShopParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "getShop",
|
||||
Method: "GET",
|
||||
PathPattern: "/partner/store",
|
||||
|
@ -57,7 +59,12 @@ func (a *Client) GetShop(params *GetShopParams, authInfo runtime.ClientAuthInfoW
|
|||
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
|
||||
}
|
||||
|
|
|
@ -20,53 +20,52 @@ import (
|
|||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// NewGetTransactionByIDParams creates a new GetTransactionByIDParams object
|
||||
// with the default values initialized.
|
||||
// NewGetTransactionByIDParams creates a new GetTransactionByIDParams 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 NewGetTransactionByIDParams() *GetTransactionByIDParams {
|
||||
var ()
|
||||
return &GetTransactionByIDParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetTransactionByIDParamsWithTimeout creates a new GetTransactionByIDParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetTransactionByIDParamsWithTimeout(timeout time.Duration) *GetTransactionByIDParams {
|
||||
var ()
|
||||
return &GetTransactionByIDParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetTransactionByIDParamsWithContext creates a new GetTransactionByIDParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
// with the ability to set a context for a request.
|
||||
func NewGetTransactionByIDParamsWithContext(ctx context.Context) *GetTransactionByIDParams {
|
||||
var ()
|
||||
return &GetTransactionByIDParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetTransactionByIDParamsWithHTTPClient creates a new GetTransactionByIDParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewGetTransactionByIDParamsWithHTTPClient(client *http.Client) *GetTransactionByIDParams {
|
||||
var ()
|
||||
return &GetTransactionByIDParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/* GetTransactionByIDParams contains all the parameters to send to the API endpoint
|
||||
for the get transaction by Id operation typically these are written to a http.Request
|
||||
for the get transaction by Id operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type GetTransactionByIDParams struct {
|
||||
|
||||
/*ItemNumber
|
||||
The Blaze Transaction Number
|
||||
/* ItemNumber.
|
||||
|
||||
The Blaze Transaction Number
|
||||
*/
|
||||
ItemNumber string
|
||||
|
||||
|
@ -75,6 +74,21 @@ type GetTransactionByIDParams struct {
|
|||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the get transaction by Id params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetTransactionByIDParams) WithDefaults() *GetTransactionByIDParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the get transaction by Id params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetTransactionByIDParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get transaction by Id params
|
||||
func (o *GetTransactionByIDParams) WithTimeout(timeout time.Duration) *GetTransactionByIDParams {
|
||||
o.SetTimeout(timeout)
|
||||
|
|
|
@ -57,9 +57,8 @@ func (o *GetTransactionByIDReader) ReadResponse(response runtime.ClientResponse,
|
|||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -68,7 +67,7 @@ func NewGetTransactionByIDOK() *GetTransactionByIDOK {
|
|||
return &GetTransactionByIDOK{}
|
||||
}
|
||||
|
||||
/*GetTransactionByIDOK handles this case with default header values.
|
||||
/* GetTransactionByIDOK describes a response with status code 200, with default header values.
|
||||
|
||||
A Transaction was successfully retrieved
|
||||
*/
|
||||
|
@ -79,7 +78,6 @@ type GetTransactionByIDOK struct {
|
|||
func (o *GetTransactionByIDOK) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/transactions/{itemNumber}][%d] getTransactionByIdOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetTransactionByIDOK) GetPayload() *blaze_models.TransactionByIDResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -101,7 +99,7 @@ func NewGetTransactionByIDUnauthorized() *GetTransactionByIDUnauthorized {
|
|||
return &GetTransactionByIDUnauthorized{}
|
||||
}
|
||||
|
||||
/*GetTransactionByIDUnauthorized handles this case with default header values.
|
||||
/* GetTransactionByIDUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
|
@ -112,7 +110,6 @@ type GetTransactionByIDUnauthorized struct {
|
|||
func (o *GetTransactionByIDUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/transactions/{itemNumber}][%d] getTransactionByIdUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetTransactionByIDUnauthorized) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -134,7 +131,7 @@ func NewGetTransactionByIDForbidden() *GetTransactionByIDForbidden {
|
|||
return &GetTransactionByIDForbidden{}
|
||||
}
|
||||
|
||||
/*GetTransactionByIDForbidden handles this case with default header values.
|
||||
/* GetTransactionByIDForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
|
@ -145,7 +142,6 @@ type GetTransactionByIDForbidden struct {
|
|||
func (o *GetTransactionByIDForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/transactions/{itemNumber}][%d] getTransactionByIdForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetTransactionByIDForbidden) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -167,7 +163,7 @@ func NewGetTransactionByIDNotFound() *GetTransactionByIDNotFound {
|
|||
return &GetTransactionByIDNotFound{}
|
||||
}
|
||||
|
||||
/*GetTransactionByIDNotFound handles this case with default header values.
|
||||
/* GetTransactionByIDNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
|
@ -178,7 +174,6 @@ type GetTransactionByIDNotFound struct {
|
|||
func (o *GetTransactionByIDNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/transactions/{itemNumber}][%d] getTransactionByIdNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetTransactionByIDNotFound) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -200,7 +195,7 @@ func NewGetTransactionByIDInternalServerError() *GetTransactionByIDInternalServe
|
|||
return &GetTransactionByIDInternalServerError{}
|
||||
}
|
||||
|
||||
/*GetTransactionByIDInternalServerError handles this case with default header values.
|
||||
/* GetTransactionByIDInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
|
@ -211,7 +206,6 @@ type GetTransactionByIDInternalServerError struct {
|
|||
func (o *GetTransactionByIDInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/transactions/{itemNumber}][%d] getTransactionByIdInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetTransactionByIDInternalServerError) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
|
|
@ -21,68 +21,70 @@ import (
|
|||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// NewGetTransactionsParams creates a new GetTransactionsParams object
|
||||
// with the default values initialized.
|
||||
// NewGetTransactionsParams creates a new GetTransactionsParams 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 NewGetTransactionsParams() *GetTransactionsParams {
|
||||
var ()
|
||||
return &GetTransactionsParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetTransactionsParamsWithTimeout creates a new GetTransactionsParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetTransactionsParamsWithTimeout(timeout time.Duration) *GetTransactionsParams {
|
||||
var ()
|
||||
return &GetTransactionsParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetTransactionsParamsWithContext creates a new GetTransactionsParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
// with the ability to set a context for a request.
|
||||
func NewGetTransactionsParamsWithContext(ctx context.Context) *GetTransactionsParams {
|
||||
var ()
|
||||
return &GetTransactionsParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetTransactionsParamsWithHTTPClient creates a new GetTransactionsParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewGetTransactionsParamsWithHTTPClient(client *http.Client) *GetTransactionsParams {
|
||||
var ()
|
||||
return &GetTransactionsParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/* GetTransactionsParams contains all the parameters to send to the API endpoint
|
||||
for the get transactions operation typically these are written to a http.Request
|
||||
for the get transactions operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type GetTransactionsParams struct {
|
||||
|
||||
/*EndDate
|
||||
The end date of transaction query
|
||||
/* EndDate.
|
||||
|
||||
The end date of transaction query
|
||||
*/
|
||||
EndDate string
|
||||
/*Limit
|
||||
The number of records to retrieve
|
||||
|
||||
/* Limit.
|
||||
|
||||
The number of records to retrieve
|
||||
*/
|
||||
Limit *float64
|
||||
/*Start
|
||||
The starting record in multi-record retrievals
|
||||
|
||||
/* Start.
|
||||
|
||||
The starting record in multi-record retrievals
|
||||
*/
|
||||
Start *float64
|
||||
/*StartDate
|
||||
The start date of transaction query
|
||||
|
||||
/* StartDate.
|
||||
|
||||
The start date of transaction query
|
||||
*/
|
||||
StartDate string
|
||||
|
||||
|
@ -91,6 +93,21 @@ type GetTransactionsParams struct {
|
|||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the get transactions params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetTransactionsParams) WithDefaults() *GetTransactionsParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the get transactions params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetTransactionsParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get transactions params
|
||||
func (o *GetTransactionsParams) WithTimeout(timeout time.Duration) *GetTransactionsParams {
|
||||
o.SetTimeout(timeout)
|
||||
|
@ -180,6 +197,7 @@ func (o *GetTransactionsParams) WriteToRequest(r runtime.ClientRequest, reg strf
|
|||
qrEndDate := o.EndDate
|
||||
qEndDate := qrEndDate
|
||||
if qEndDate != "" {
|
||||
|
||||
if err := r.SetQueryParam("endDate", qEndDate); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -189,38 +207,41 @@ func (o *GetTransactionsParams) WriteToRequest(r runtime.ClientRequest, reg strf
|
|||
|
||||
// query param limit
|
||||
var qrLimit float64
|
||||
|
||||
if o.Limit != nil {
|
||||
qrLimit = *o.Limit
|
||||
}
|
||||
qLimit := swag.FormatFloat64(qrLimit)
|
||||
if qLimit != "" {
|
||||
|
||||
if err := r.SetQueryParam("limit", qLimit); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if o.Start != nil {
|
||||
|
||||
// query param start
|
||||
var qrStart float64
|
||||
|
||||
if o.Start != nil {
|
||||
qrStart = *o.Start
|
||||
}
|
||||
qStart := swag.FormatFloat64(qrStart)
|
||||
if qStart != "" {
|
||||
|
||||
if err := r.SetQueryParam("start", qStart); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// query param startDate
|
||||
qrStartDate := o.StartDate
|
||||
qStartDate := qrStartDate
|
||||
if qStartDate != "" {
|
||||
|
||||
if err := r.SetQueryParam("startDate", qStartDate); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -57,9 +57,8 @@ func (o *GetTransactionsReader) ReadResponse(response runtime.ClientResponse, co
|
|||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -68,7 +67,7 @@ func NewGetTransactionsOK() *GetTransactionsOK {
|
|||
return &GetTransactionsOK{}
|
||||
}
|
||||
|
||||
/*GetTransactionsOK handles this case with default header values.
|
||||
/* GetTransactionsOK describes a response with status code 200, with default header values.
|
||||
|
||||
Transactions were successfully retrieved
|
||||
*/
|
||||
|
@ -79,7 +78,6 @@ type GetTransactionsOK struct {
|
|||
func (o *GetTransactionsOK) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/transactions][%d] getTransactionsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetTransactionsOK) GetPayload() *blaze_models.TransactionsResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -101,7 +99,7 @@ func NewGetTransactionsUnauthorized() *GetTransactionsUnauthorized {
|
|||
return &GetTransactionsUnauthorized{}
|
||||
}
|
||||
|
||||
/*GetTransactionsUnauthorized handles this case with default header values.
|
||||
/* GetTransactionsUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
|
@ -112,7 +110,6 @@ type GetTransactionsUnauthorized struct {
|
|||
func (o *GetTransactionsUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/transactions][%d] getTransactionsUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetTransactionsUnauthorized) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -134,7 +131,7 @@ func NewGetTransactionsForbidden() *GetTransactionsForbidden {
|
|||
return &GetTransactionsForbidden{}
|
||||
}
|
||||
|
||||
/*GetTransactionsForbidden handles this case with default header values.
|
||||
/* GetTransactionsForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
|
@ -145,7 +142,6 @@ type GetTransactionsForbidden struct {
|
|||
func (o *GetTransactionsForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/transactions][%d] getTransactionsForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetTransactionsForbidden) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -167,7 +163,7 @@ func NewGetTransactionsNotFound() *GetTransactionsNotFound {
|
|||
return &GetTransactionsNotFound{}
|
||||
}
|
||||
|
||||
/*GetTransactionsNotFound handles this case with default header values.
|
||||
/* GetTransactionsNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
|
@ -178,7 +174,6 @@ type GetTransactionsNotFound struct {
|
|||
func (o *GetTransactionsNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/transactions][%d] getTransactionsNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetTransactionsNotFound) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -200,7 +195,7 @@ func NewGetTransactionsInternalServerError() *GetTransactionsInternalServerError
|
|||
return &GetTransactionsInternalServerError{}
|
||||
}
|
||||
|
||||
/*GetTransactionsInternalServerError handles this case with default header values.
|
||||
/* GetTransactionsInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
|
@ -211,7 +206,6 @@ type GetTransactionsInternalServerError struct {
|
|||
func (o *GetTransactionsInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/transactions][%d] getTransactionsInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetTransactionsInternalServerError) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
|
|
@ -29,11 +29,14 @@ type Client struct {
|
|||
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 {
|
||||
GetTransactionByID(params *GetTransactionByIDParams, authInfo runtime.ClientAuthInfoWriter) (*GetTransactionByIDOK, error)
|
||||
GetTransactionByID(params *GetTransactionByIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTransactionByIDOK, error)
|
||||
|
||||
GetTransactions(params *GetTransactionsParams, authInfo runtime.ClientAuthInfoWriter) (*GetTransactionsOK, error)
|
||||
GetTransactions(params *GetTransactionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTransactionsOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
@ -41,13 +44,12 @@ type ClientService interface {
|
|||
/*
|
||||
GetTransactionByID Get a single transaction by ID
|
||||
*/
|
||||
func (a *Client) GetTransactionByID(params *GetTransactionByIDParams, authInfo runtime.ClientAuthInfoWriter) (*GetTransactionByIDOK, error) {
|
||||
func (a *Client) GetTransactionByID(params *GetTransactionByIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTransactionByIDOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetTransactionByIDParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "getTransactionById",
|
||||
Method: "GET",
|
||||
PathPattern: "/partner/transactions/{itemNumber}",
|
||||
|
@ -59,7 +61,12 @@ func (a *Client) GetTransactionByID(params *GetTransactionByIDParams, authInfo r
|
|||
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
|
||||
}
|
||||
|
@ -76,13 +83,12 @@ func (a *Client) GetTransactionByID(params *GetTransactionByIDParams, authInfo r
|
|||
/*
|
||||
GetTransactions Get a Range of Transactions
|
||||
*/
|
||||
func (a *Client) GetTransactions(params *GetTransactionsParams, authInfo runtime.ClientAuthInfoWriter) (*GetTransactionsOK, error) {
|
||||
func (a *Client) GetTransactions(params *GetTransactionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTransactionsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetTransactionsParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "getTransactions",
|
||||
Method: "GET",
|
||||
PathPattern: "/partner/transactions",
|
||||
|
@ -94,7 +100,12 @@ func (a *Client) GetTransactions(params *GetTransactionsParams, authInfo runtime
|
|||
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
|
||||
}
|
||||
|
|
|
@ -20,53 +20,52 @@ import (
|
|||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// NewGetVendorParams creates a new GetVendorParams object
|
||||
// with the default values initialized.
|
||||
// NewGetVendorParams creates a new GetVendorParams 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 NewGetVendorParams() *GetVendorParams {
|
||||
var ()
|
||||
return &GetVendorParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetVendorParamsWithTimeout creates a new GetVendorParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetVendorParamsWithTimeout(timeout time.Duration) *GetVendorParams {
|
||||
var ()
|
||||
return &GetVendorParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetVendorParamsWithContext creates a new GetVendorParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
// with the ability to set a context for a request.
|
||||
func NewGetVendorParamsWithContext(ctx context.Context) *GetVendorParams {
|
||||
var ()
|
||||
return &GetVendorParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetVendorParamsWithHTTPClient creates a new GetVendorParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewGetVendorParamsWithHTTPClient(client *http.Client) *GetVendorParams {
|
||||
var ()
|
||||
return &GetVendorParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/* GetVendorParams contains all the parameters to send to the API endpoint
|
||||
for the get vendor operation typically these are written to a http.Request
|
||||
for the get vendor operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type GetVendorParams struct {
|
||||
|
||||
/*VendorID
|
||||
The Blaze Vendor Object Id
|
||||
/* VendorID.
|
||||
|
||||
The Blaze Vendor Object Id
|
||||
*/
|
||||
VendorID string
|
||||
|
||||
|
@ -75,6 +74,21 @@ type GetVendorParams struct {
|
|||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the get vendor params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetVendorParams) WithDefaults() *GetVendorParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the get vendor params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetVendorParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get vendor params
|
||||
func (o *GetVendorParams) WithTimeout(timeout time.Duration) *GetVendorParams {
|
||||
o.SetTimeout(timeout)
|
||||
|
|
|
@ -57,9 +57,8 @@ func (o *GetVendorReader) ReadResponse(response runtime.ClientResponse, consumer
|
|||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -68,7 +67,7 @@ func NewGetVendorOK() *GetVendorOK {
|
|||
return &GetVendorOK{}
|
||||
}
|
||||
|
||||
/*GetVendorOK handles this case with default header values.
|
||||
/* GetVendorOK describes a response with status code 200, with default header values.
|
||||
|
||||
Product was successfully retrieved
|
||||
*/
|
||||
|
@ -79,7 +78,6 @@ type GetVendorOK struct {
|
|||
func (o *GetVendorOK) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/vendors/{vendorId}][%d] getVendorOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetVendorOK) GetPayload() *blaze_models.VendorResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -101,7 +99,7 @@ func NewGetVendorUnauthorized() *GetVendorUnauthorized {
|
|||
return &GetVendorUnauthorized{}
|
||||
}
|
||||
|
||||
/*GetVendorUnauthorized handles this case with default header values.
|
||||
/* GetVendorUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
|
@ -112,7 +110,6 @@ type GetVendorUnauthorized struct {
|
|||
func (o *GetVendorUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/vendors/{vendorId}][%d] getVendorUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetVendorUnauthorized) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -134,7 +131,7 @@ func NewGetVendorForbidden() *GetVendorForbidden {
|
|||
return &GetVendorForbidden{}
|
||||
}
|
||||
|
||||
/*GetVendorForbidden handles this case with default header values.
|
||||
/* GetVendorForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
|
@ -145,7 +142,6 @@ type GetVendorForbidden struct {
|
|||
func (o *GetVendorForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/vendors/{vendorId}][%d] getVendorForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetVendorForbidden) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -167,7 +163,7 @@ func NewGetVendorNotFound() *GetVendorNotFound {
|
|||
return &GetVendorNotFound{}
|
||||
}
|
||||
|
||||
/*GetVendorNotFound handles this case with default header values.
|
||||
/* GetVendorNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
|
@ -178,7 +174,6 @@ type GetVendorNotFound struct {
|
|||
func (o *GetVendorNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/vendors/{vendorId}][%d] getVendorNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetVendorNotFound) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
@ -200,7 +195,7 @@ func NewGetVendorInternalServerError() *GetVendorInternalServerError {
|
|||
return &GetVendorInternalServerError{}
|
||||
}
|
||||
|
||||
/*GetVendorInternalServerError handles this case with default header values.
|
||||
/* GetVendorInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
|
@ -211,7 +206,6 @@ type GetVendorInternalServerError struct {
|
|||
func (o *GetVendorInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /partner/vendors/{vendorId}][%d] getVendorInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetVendorInternalServerError) GetPayload() *blaze_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
|
|
@ -29,9 +29,12 @@ type Client struct {
|
|||
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 {
|
||||
GetVendor(params *GetVendorParams, authInfo runtime.ClientAuthInfoWriter) (*GetVendorOK, error)
|
||||
GetVendor(params *GetVendorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetVendorOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
@ -39,13 +42,12 @@ type ClientService interface {
|
|||
/*
|
||||
GetVendor Get A Vendor
|
||||
*/
|
||||
func (a *Client) GetVendor(params *GetVendorParams, authInfo runtime.ClientAuthInfoWriter) (*GetVendorOK, error) {
|
||||
func (a *Client) GetVendor(params *GetVendorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetVendorOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetVendorParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "getVendor",
|
||||
Method: "GET",
|
||||
PathPattern: "/partner/vendors/{vendorId}",
|
||||
|
@ -57,7 +59,12 @@ func (a *Client) GetVendor(params *GetVendorParams, authInfo runtime.ClientAuthI
|
|||
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
|
||||
}
|
||||
|
|
|
@ -10,6 +10,8 @@ package blaze_models
|
|||
// 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"
|
||||
|
@ -45,22 +47,26 @@ func (m *Error) Validate(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *Error) validateStatus(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Status) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := validate.MinimumInt("status", "body", int64(m.Status), 100, false); err != nil {
|
||||
if err := validate.MinimumInt("status", "body", m.Status, 100, false); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validate.MaximumInt("status", "body", int64(m.Status), 600, false); err != nil {
|
||||
if err := validate.MaximumInt("status", "body", m.Status, 600, false); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
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 {
|
||||
|
|
|
@ -10,6 +10,8 @@ package blaze_models
|
|||
// 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"
|
||||
|
@ -85,6 +87,21 @@ func (m *InvalidError) Validate(formats strfmt.Registry) error {
|
|||
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 {
|
||||
|
|
|
@ -10,6 +10,7 @@ package blaze_models
|
|||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strconv"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
|
@ -23,183 +24,238 @@ import (
|
|||
type MemberResponse struct {
|
||||
|
||||
// active transaction
|
||||
// Example: 0
|
||||
ActiveTransaction float64 `json:"activeTransaction,omitempty"`
|
||||
|
||||
// address
|
||||
Address *MemberResponseAddress `json:"address,omitempty"`
|
||||
|
||||
// addresses
|
||||
// Example: ["string"]
|
||||
Addresses []string `json:"addresses"`
|
||||
|
||||
// agreement expired
|
||||
// Example: false
|
||||
AgreementExpired bool `json:"agreementExpired,omitempty"`
|
||||
|
||||
// anonymous
|
||||
// Example: false
|
||||
Anonymous bool `json:"anonymous,omitempty"`
|
||||
|
||||
// ban patient
|
||||
// Example: false
|
||||
BanPatient bool `json:"banPatient,omitempty"`
|
||||
|
||||
// cannabis result
|
||||
// Example: string
|
||||
CannabisResult string `json:"cannabisResult,omitempty"`
|
||||
|
||||
// care giver list
|
||||
// Example: ["string"]
|
||||
CareGiverList []string `json:"careGiverList"`
|
||||
|
||||
// care givers
|
||||
// Example: ["string"]
|
||||
CareGivers []string `json:"careGivers"`
|
||||
|
||||
// company Id
|
||||
// Example: 5cabd4ba6218d148395b402c
|
||||
CompanyID string `json:"companyId,omitempty"`
|
||||
|
||||
// consumer type
|
||||
// Example: AdultUse
|
||||
ConsumerType string `json:"consumerType,omitempty"`
|
||||
|
||||
// consumer user Id
|
||||
// Example: string
|
||||
ConsumerUserID string `json:"consumerUserId,omitempty"`
|
||||
|
||||
// contracts
|
||||
// Example: ["string"]
|
||||
Contracts []string `json:"contracts"`
|
||||
|
||||
// created
|
||||
// Example: 1554826014780
|
||||
Created int64 `json:"created,omitempty"`
|
||||
|
||||
// current cannabis limit
|
||||
// Example: string
|
||||
CurrentCannabisLimit string `json:"currentCannabisLimit,omitempty"`
|
||||
|
||||
// deleted
|
||||
// Example: false
|
||||
Deleted bool `json:"deleted,omitempty"`
|
||||
|
||||
// dirty
|
||||
// Example: false
|
||||
Dirty bool `json:"dirty,omitempty"`
|
||||
|
||||
// dl expired
|
||||
// Example: false
|
||||
DlExpired bool `json:"dlExpired,omitempty"`
|
||||
|
||||
// dob
|
||||
// Example: 631180800000
|
||||
Dob float64 `json:"dob,omitempty"`
|
||||
|
||||
// email
|
||||
// Example: hokus@taxnexus.net
|
||||
Email string `json:"email,omitempty"`
|
||||
|
||||
// email opt in
|
||||
// Example: true
|
||||
EmailOptIn bool `json:"emailOptIn,omitempty"`
|
||||
|
||||
// email verified
|
||||
// Example: false
|
||||
EmailVerified bool `json:"emailVerified,omitempty"`
|
||||
|
||||
// enable loyalty
|
||||
// Example: true
|
||||
EnableLoyalty bool `json:"enableLoyalty,omitempty"`
|
||||
|
||||
// enabled care giver
|
||||
// Example: false
|
||||
EnabledCareGiver bool `json:"enabledCareGiver,omitempty"`
|
||||
|
||||
// exp statuses
|
||||
// Example: ["string"]
|
||||
ExpStatuses []string `json:"expStatuses"`
|
||||
|
||||
// first name
|
||||
// Example: Hokus
|
||||
FirstName string `json:"firstName,omitempty"`
|
||||
|
||||
// id
|
||||
// Example: 5cacc31e6218d174d3f17b70
|
||||
ID string `json:"id,omitempty"`
|
||||
|
||||
// identifications
|
||||
Identifications []*MemberResponseIdentificationsItems0 `json:"identifications"`
|
||||
|
||||
// import Id
|
||||
// Example: string
|
||||
ImportID string `json:"importId,omitempty"`
|
||||
|
||||
// in queue
|
||||
// Example: false
|
||||
InQueue bool `json:"inQueue,omitempty"`
|
||||
|
||||
// last name
|
||||
// Example: Pokus
|
||||
LastName string `json:"lastName,omitempty"`
|
||||
|
||||
// last visit date
|
||||
// Example: 1554826633661
|
||||
LastVisitDate int64 `json:"lastVisitDate,omitempty"`
|
||||
|
||||
// lifetime points
|
||||
// Example: 0
|
||||
LifetimePoints float64 `json:"lifetimePoints,omitempty"`
|
||||
|
||||
// loyalty points
|
||||
// Example: 0
|
||||
LoyaltyPoints float64 `json:"loyaltyPoints,omitempty"`
|
||||
|
||||
// marketing source
|
||||
MarketingSource string `json:"marketingSource,omitempty"`
|
||||
|
||||
// medical
|
||||
// Example: false
|
||||
Medical bool `json:"medical,omitempty"`
|
||||
|
||||
// member activities
|
||||
// Example: ["string"]
|
||||
MemberActivities []string `json:"memberActivities"`
|
||||
|
||||
// member group
|
||||
MemberGroup *MemberResponseMemberGroup `json:"memberGroup,omitempty"`
|
||||
|
||||
// member group Id
|
||||
// Example: 5cabd4ba6218d148395b404b
|
||||
MemberGroupID string `json:"memberGroupId,omitempty"`
|
||||
|
||||
// middle name
|
||||
// Example: string
|
||||
MiddleName string `json:"middleName,omitempty"`
|
||||
|
||||
// modified
|
||||
// Example: 1554826633661
|
||||
Modified int64 `json:"modified,omitempty"`
|
||||
|
||||
// notes
|
||||
// Example: ["string"]
|
||||
Notes []string `json:"notes"`
|
||||
|
||||
// preferences
|
||||
// Example: ["string"]
|
||||
Preferences []string `json:"preferences"`
|
||||
|
||||
// primary phone
|
||||
// Example: (510) 859-7000
|
||||
PrimaryPhone string `json:"primaryPhone,omitempty"`
|
||||
|
||||
// qb customer ref
|
||||
// Example: ["string"]
|
||||
QbCustomerRef []string `json:"qbCustomerRef"`
|
||||
|
||||
// qb desktop customer ref
|
||||
// Example: string
|
||||
QbDesktopCustomerRef string `json:"qbDesktopCustomerRef,omitempty"`
|
||||
|
||||
// recent products
|
||||
// Example: ["Binsky Flower","Tommy's Bong"]
|
||||
RecentProducts []string `json:"recentProducts"`
|
||||
|
||||
// recommendation expired
|
||||
// Example: true
|
||||
RecommendationExpired bool `json:"recommendationExpired,omitempty"`
|
||||
|
||||
// recommendation expiry left
|
||||
// Example: 0
|
||||
RecommendationExpiryLeft float64 `json:"recommendationExpiryLeft,omitempty"`
|
||||
|
||||
// recommendations
|
||||
Recommendations []*MemberResponseRecommendationsItems0 `json:"recommendations"`
|
||||
|
||||
// region Id
|
||||
// Example: string
|
||||
RegionID string `json:"regionId,omitempty"`
|
||||
|
||||
// search text
|
||||
// Example: hokus pokus 5125 miles ave hokus@taxnexus.net (510) 859-7000 delivery
|
||||
SearchText string `json:"searchText,omitempty"`
|
||||
|
||||
// sex
|
||||
// Example: 0
|
||||
Sex float64 `json:"sex,omitempty"`
|
||||
|
||||
// shop Id
|
||||
// Example: 5cabd4ba6218d148395b4043
|
||||
ShopID string `json:"shopId,omitempty"`
|
||||
|
||||
// start date
|
||||
// Example: 1554826014781
|
||||
StartDate int64 `json:"startDate,omitempty"`
|
||||
|
||||
// state cannabis limit
|
||||
// Example: string
|
||||
StateCannabisLimit string `json:"stateCannabisLimit,omitempty"`
|
||||
|
||||
// status
|
||||
// Example: Active
|
||||
Status string `json:"status,omitempty"`
|
||||
|
||||
// tags
|
||||
// Example: ["string"]
|
||||
Tags []string `json:"tags"`
|
||||
|
||||
// text opt in
|
||||
// Example: true
|
||||
TextOptIn bool `json:"textOptIn,omitempty"`
|
||||
|
||||
// updated
|
||||
// Example: false
|
||||
Updated bool `json:"updated,omitempty"`
|
||||
}
|
||||
|
||||
|
@ -230,7 +286,6 @@ func (m *MemberResponse) Validate(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *MemberResponse) validateAddress(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Address) { // not required
|
||||
return nil
|
||||
}
|
||||
|
@ -248,7 +303,6 @@ func (m *MemberResponse) validateAddress(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *MemberResponse) validateIdentifications(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Identifications) { // not required
|
||||
return nil
|
||||
}
|
||||
|
@ -273,7 +327,6 @@ func (m *MemberResponse) validateIdentifications(formats strfmt.Registry) error
|
|||
}
|
||||
|
||||
func (m *MemberResponse) validateMemberGroup(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.MemberGroup) { // not required
|
||||
return nil
|
||||
}
|
||||
|
@ -291,7 +344,6 @@ func (m *MemberResponse) validateMemberGroup(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *MemberResponse) validateRecommendations(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Recommendations) { // not required
|
||||
return nil
|
||||
}
|
||||
|
@ -315,6 +367,96 @@ func (m *MemberResponse) validateRecommendations(formats strfmt.Registry) error
|
|||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validate this member response based on the context it is used
|
||||
func (m *MemberResponse) 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.contextValidateIdentifications(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.contextValidateMemberGroup(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.contextValidateRecommendations(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *MemberResponse) 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 *MemberResponse) contextValidateIdentifications(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
for i := 0; i < len(m.Identifications); i++ {
|
||||
|
||||
if m.Identifications[i] != nil {
|
||||
if err := m.Identifications[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("identifications" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *MemberResponse) contextValidateMemberGroup(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.MemberGroup != nil {
|
||||
if err := m.MemberGroup.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("memberGroup")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *MemberResponse) contextValidateRecommendations(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
for i := 0; i < len(m.Recommendations); i++ {
|
||||
|
||||
if m.Recommendations[i] != nil {
|
||||
if err := m.Recommendations[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("recommendations" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *MemberResponse) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
|
@ -339,36 +481,47 @@ func (m *MemberResponse) UnmarshalBinary(b []byte) error {
|
|||
type MemberResponseAddress struct {
|
||||
|
||||
// address
|
||||
// Example: 5125 Miles Ave
|
||||
Address string `json:"address,omitempty"`
|
||||
|
||||
// city
|
||||
// Example: Oakland
|
||||
City string `json:"city,omitempty"`
|
||||
|
||||
// company Id
|
||||
// Example: string
|
||||
CompanyID string `json:"companyId,omitempty"`
|
||||
|
||||
// country
|
||||
// Example: US
|
||||
Country string `json:"country,omitempty"`
|
||||
|
||||
// created
|
||||
// Example: 1554826014782
|
||||
Created int64 `json:"created,omitempty"`
|
||||
|
||||
// deleted
|
||||
// Example: false
|
||||
Deleted bool `json:"deleted,omitempty"`
|
||||
|
||||
// id
|
||||
// Example: 5cacc31e6218d174d3f17b6d
|
||||
ID string `json:"id,omitempty"`
|
||||
|
||||
// modified
|
||||
// Example: 1554826014782
|
||||
Modified int64 `json:"modified,omitempty"`
|
||||
|
||||
// state
|
||||
// Example: CA
|
||||
State string `json:"state,omitempty"`
|
||||
|
||||
// updated
|
||||
// Example: false
|
||||
Updated bool `json:"updated,omitempty"`
|
||||
|
||||
// zip code
|
||||
// Example: 94618
|
||||
ZipCode string `json:"zipCode,omitempty"`
|
||||
}
|
||||
|
||||
|
@ -377,6 +530,11 @@ func (m *MemberResponseAddress) Validate(formats strfmt.Registry) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this member response address based on context it is used
|
||||
func (m *MemberResponseAddress) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *MemberResponseAddress) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
|
@ -404,36 +562,47 @@ type MemberResponseIdentificationsItems0 struct {
|
|||
Assets []*MemberResponseIdentificationsItems0AssetsItems0 `json:"assets"`
|
||||
|
||||
// company Id
|
||||
// Example: 5cabd4ba6218d148395b402c
|
||||
CompanyID string `json:"companyId,omitempty"`
|
||||
|
||||
// created
|
||||
// Example: 1554826014782
|
||||
Created int64 `json:"created,omitempty"`
|
||||
|
||||
// deleted
|
||||
// Example: false
|
||||
Deleted bool `json:"deleted,omitempty"`
|
||||
|
||||
// expiration date
|
||||
// Example: 1577779200000
|
||||
ExpirationDate int64 `json:"expirationDate,omitempty"`
|
||||
|
||||
// front photo
|
||||
// Example: string
|
||||
FrontPhoto string `json:"frontPhoto,omitempty"`
|
||||
|
||||
// id
|
||||
// Example: 5cacc31e6218d174d3f17b6e
|
||||
ID string `json:"id,omitempty"`
|
||||
|
||||
// license number
|
||||
// Example: MYLICENSENUM
|
||||
LicenseNumber string `json:"licenseNumber,omitempty"`
|
||||
|
||||
// modified
|
||||
// Example: 1554826014782
|
||||
Modified int64 `json:"modified,omitempty"`
|
||||
|
||||
// state
|
||||
// Example: string
|
||||
State string `json:"state,omitempty"`
|
||||
|
||||
// type
|
||||
// Example: string
|
||||
Type string `json:"type,omitempty"`
|
||||
|
||||
// updated
|
||||
// Example: false
|
||||
Updated bool `json:"updated,omitempty"`
|
||||
}
|
||||
|
||||
|
@ -452,7 +621,6 @@ func (m *MemberResponseIdentificationsItems0) Validate(formats strfmt.Registry)
|
|||
}
|
||||
|
||||
func (m *MemberResponseIdentificationsItems0) validateAssets(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Assets) { // not required
|
||||
return nil
|
||||
}
|
||||
|
@ -476,6 +644,38 @@ func (m *MemberResponseIdentificationsItems0) validateAssets(formats strfmt.Regi
|
|||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validate this member response identifications items0 based on the context it is used
|
||||
func (m *MemberResponseIdentificationsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.contextValidateAssets(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *MemberResponseIdentificationsItems0) contextValidateAssets(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
for i := 0; i < len(m.Assets); i++ {
|
||||
|
||||
if m.Assets[i] != nil {
|
||||
if err := m.Assets[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("assets" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *MemberResponseIdentificationsItems0) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
|
@ -500,54 +700,71 @@ func (m *MemberResponseIdentificationsItems0) UnmarshalBinary(b []byte) error {
|
|||
type MemberResponseIdentificationsItems0AssetsItems0 struct {
|
||||
|
||||
// active
|
||||
// Example: true
|
||||
Active bool `json:"active,omitempty"`
|
||||
|
||||
// asset type
|
||||
// Example: Photo
|
||||
AssetType string `json:"assetType,omitempty"`
|
||||
|
||||
// company Id
|
||||
// Example: 5c7e8c7b722ed607e61edb06
|
||||
CompanyID string `json:"companyId,omitempty"`
|
||||
|
||||
// created
|
||||
// Example: 1556052368662
|
||||
Created int64 `json:"created,omitempty"`
|
||||
|
||||
// deleted
|
||||
// Example: false
|
||||
Deleted bool `json:"deleted,omitempty"`
|
||||
|
||||
// id
|
||||
// Example: 5cbf79908a29f808183540e7
|
||||
ID string `json:"id,omitempty"`
|
||||
|
||||
// key
|
||||
// Example: c71adc95-bb07-47f2-b9f6-cc4db7936686.png
|
||||
Key string `json:"key,omitempty"`
|
||||
|
||||
// large URL
|
||||
// Example: https://connect-files-p1.s3.amazonaws.com/c71adc95-bb07-47f2-b9f6-cc4db7936686-800x800.png
|
||||
LargeURL string `json:"largeURL,omitempty"`
|
||||
|
||||
// large x2 URL
|
||||
// Example: https://connect-files-p1.s3.amazonaws.com/c71adc95-bb07-47f2-b9f6-cc4db7936686-1600x1600.png
|
||||
LargeX2URL string `json:"largeX2URL,omitempty"`
|
||||
|
||||
// medium URL
|
||||
// Example: https://connect-files-p1.s3.amazonaws.com/c71adc95-bb07-47f2-b9f6-cc4db7936686-500x500.png
|
||||
MediumURL string `json:"mediumURL,omitempty"`
|
||||
|
||||
// modified
|
||||
// Example: 1556052368662
|
||||
Modified int64 `json:"modified,omitempty"`
|
||||
|
||||
// name
|
||||
// Example: Brian Main DL.png
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// priority
|
||||
// Example: 0
|
||||
Priority float64 `json:"priority,omitempty"`
|
||||
|
||||
// secured
|
||||
// Example: true
|
||||
Secured bool `json:"secured,omitempty"`
|
||||
|
||||
// thumb URL
|
||||
// Example: https://connect-files-p1.s3.amazonaws.com/c71adc95-bb07-47f2-b9f6-cc4db7936686-200x200.png
|
||||
ThumbURL string `json:"thumbURL,omitempty"`
|
||||
|
||||
// type
|
||||
// Example: Photo
|
||||
Type string `json:"type,omitempty"`
|
||||
|
||||
// updated
|
||||
// Example: false
|
||||
Updated bool `json:"updated,omitempty"`
|
||||
}
|
||||
|
||||
|
@ -556,6 +773,11 @@ func (m *MemberResponseIdentificationsItems0AssetsItems0) Validate(formats strfm
|
|||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this member response identifications items0 assets items0 based on context it is used
|
||||
func (m *MemberResponseIdentificationsItems0AssetsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *MemberResponseIdentificationsItems0AssetsItems0) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
|
@ -580,57 +802,75 @@ func (m *MemberResponseIdentificationsItems0AssetsItems0) UnmarshalBinary(b []by
|
|||
type MemberResponseMemberGroup struct {
|
||||
|
||||
// active
|
||||
// Example: true
|
||||
Active bool `json:"active,omitempty"`
|
||||
|
||||
// company Id
|
||||
// Example: 5cabd4ba6218d148395b402c
|
||||
CompanyID string `json:"companyId,omitempty"`
|
||||
|
||||
// created
|
||||
// Example: 1554746451740
|
||||
Created int64 `json:"created,omitempty"`
|
||||
|
||||
// default group
|
||||
// Example: true
|
||||
DefaultGroup bool `json:"defaultGroup,omitempty"`
|
||||
|
||||
// deleted
|
||||
// Example: false
|
||||
Deleted bool `json:"deleted,omitempty"`
|
||||
|
||||
// dirty
|
||||
// Example: false
|
||||
Dirty bool `json:"dirty,omitempty"`
|
||||
|
||||
// discount
|
||||
// Example: 0
|
||||
Discount float64 `json:"discount,omitempty"`
|
||||
|
||||
// discount type
|
||||
// Example: Percentage
|
||||
DiscountType string `json:"discountType,omitempty"`
|
||||
|
||||
// enable promotion
|
||||
// Example: false
|
||||
EnablePromotion bool `json:"enablePromotion,omitempty"`
|
||||
|
||||
// id
|
||||
// Example: 5cabd4ba6218d148395b404b
|
||||
ID string `json:"id,omitempty"`
|
||||
|
||||
// member count
|
||||
// Example: 0
|
||||
MemberCount float64 `json:"memberCount,omitempty"`
|
||||
|
||||
// member count email opt in
|
||||
// Example: 0
|
||||
MemberCountEmailOptIn float64 `json:"memberCountEmailOptIn,omitempty"`
|
||||
|
||||
// member count text opt in
|
||||
// Example: 0
|
||||
MemberCountTextOptIn float64 `json:"memberCountTextOptIn,omitempty"`
|
||||
|
||||
// modified
|
||||
// Example: 1554824536062
|
||||
Modified int64 `json:"modified,omitempty"`
|
||||
|
||||
// name
|
||||
// Example: Delivery
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// promotion Id
|
||||
// Example: string
|
||||
PromotionID string `json:"promotionId,omitempty"`
|
||||
|
||||
// shop Id
|
||||
// Example: 5cabd4ba6218d148395b4043
|
||||
ShopID string `json:"shopId,omitempty"`
|
||||
|
||||
// updated
|
||||
// Example: false
|
||||
Updated bool `json:"updated,omitempty"`
|
||||
}
|
||||
|
||||
|
@ -639,6 +879,11 @@ func (m *MemberResponseMemberGroup) Validate(formats strfmt.Registry) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this member response member group based on context it is used
|
||||
func (m *MemberResponseMemberGroup) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *MemberResponseMemberGroup) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
|
@ -666,54 +911,71 @@ type MemberResponseRecommendationsItems0 struct {
|
|||
Assets []*MemberResponseRecommendationsItems0AssetsItems0 `json:"assets"`
|
||||
|
||||
// company Id
|
||||
// Example: 5cabd4ba6218d148395b402c
|
||||
CompanyID string `json:"companyId,omitempty"`
|
||||
|
||||
// created
|
||||
// Example: 1554826014782
|
||||
Created int64 `json:"created,omitempty"`
|
||||
|
||||
// deleted
|
||||
// Example: false
|
||||
Deleted bool `json:"deleted,omitempty"`
|
||||
|
||||
// doctor
|
||||
// Example: string
|
||||
Doctor string `json:"doctor,omitempty"`
|
||||
|
||||
// doctor Id
|
||||
// Example: string
|
||||
DoctorID string `json:"doctorId,omitempty"`
|
||||
|
||||
// expiration date
|
||||
// Example: string
|
||||
ExpirationDate string `json:"expirationDate,omitempty"`
|
||||
|
||||
// front photo
|
||||
// Example: string
|
||||
FrontPhoto string `json:"frontPhoto,omitempty"`
|
||||
|
||||
// id
|
||||
// Example: 5cacc31e6218d174d3f17b6f
|
||||
ID string `json:"id,omitempty"`
|
||||
|
||||
// issue date
|
||||
// Example: string
|
||||
IssueDate string `json:"issueDate,omitempty"`
|
||||
|
||||
// modified
|
||||
// Example: 1554826014782
|
||||
Modified int64 `json:"modified,omitempty"`
|
||||
|
||||
// recommendation number
|
||||
// Example: string
|
||||
RecommendationNumber string `json:"recommendationNumber,omitempty"`
|
||||
|
||||
// state
|
||||
// Example: string
|
||||
State string `json:"state,omitempty"`
|
||||
|
||||
// updated
|
||||
// Example: false
|
||||
Updated bool `json:"updated,omitempty"`
|
||||
|
||||
// verified
|
||||
// Example: false
|
||||
Verified bool `json:"verified,omitempty"`
|
||||
|
||||
// verify method
|
||||
// Example: MANUAL
|
||||
VerifyMethod string `json:"verifyMethod,omitempty"`
|
||||
|
||||
// verify phone number
|
||||
// Example: string
|
||||
VerifyPhoneNumber string `json:"verifyPhoneNumber,omitempty"`
|
||||
|
||||
// verify website
|
||||
// Example: string
|
||||
VerifyWebsite string `json:"verifyWebsite,omitempty"`
|
||||
}
|
||||
|
||||
|
@ -732,7 +994,6 @@ func (m *MemberResponseRecommendationsItems0) Validate(formats strfmt.Registry)
|
|||
}
|
||||
|
||||
func (m *MemberResponseRecommendationsItems0) validateAssets(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Assets) { // not required
|
||||
return nil
|
||||
}
|
||||
|
@ -756,6 +1017,38 @@ func (m *MemberResponseRecommendationsItems0) validateAssets(formats strfmt.Regi
|
|||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validate this member response recommendations items0 based on the context it is used
|
||||
func (m *MemberResponseRecommendationsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.contextValidateAssets(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *MemberResponseRecommendationsItems0) contextValidateAssets(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
for i := 0; i < len(m.Assets); i++ {
|
||||
|
||||
if m.Assets[i] != nil {
|
||||
if err := m.Assets[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("assets" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *MemberResponseRecommendationsItems0) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
|
@ -780,54 +1073,71 @@ func (m *MemberResponseRecommendationsItems0) UnmarshalBinary(b []byte) error {
|
|||
type MemberResponseRecommendationsItems0AssetsItems0 struct {
|
||||
|
||||
// active
|
||||
// Example: true
|
||||
Active bool `json:"active,omitempty"`
|
||||
|
||||
// asset type
|
||||
// Example: Photo
|
||||
AssetType string `json:"assetType,omitempty"`
|
||||
|
||||
// company Id
|
||||
// Example: 5c7e8c7b722ed607e61edb06
|
||||
CompanyID string `json:"companyId,omitempty"`
|
||||
|
||||
// created
|
||||
// Example: 1556052368662
|
||||
Created int64 `json:"created,omitempty"`
|
||||
|
||||
// deleted
|
||||
// Example: false
|
||||
Deleted bool `json:"deleted,omitempty"`
|
||||
|
||||
// id
|
||||
// Example: 5cbf79908a29f808183540e7
|
||||
ID string `json:"id,omitempty"`
|
||||
|
||||
// key
|
||||
// Example: c71adc95-bb07-47f2-b9f6-cc4db7936686.png
|
||||
Key string `json:"key,omitempty"`
|
||||
|
||||
// large URL
|
||||
// Example: https://connect-files-p1.s3.amazonaws.com/c71adc95-bb07-47f2-b9f6-cc4db7936686-800x800.png
|
||||
LargeURL string `json:"largeURL,omitempty"`
|
||||
|
||||
// large x2 URL
|
||||
// Example: https://connect-files-p1.s3.amazonaws.com/c71adc95-bb07-47f2-b9f6-cc4db7936686-1600x1600.png
|
||||
LargeX2URL string `json:"largeX2URL,omitempty"`
|
||||
|
||||
// medium URL
|
||||
// Example: https://connect-files-p1.s3.amazonaws.com/c71adc95-bb07-47f2-b9f6-cc4db7936686-500x500.png
|
||||
MediumURL string `json:"mediumURL,omitempty"`
|
||||
|
||||
// modified
|
||||
// Example: 1556052368662
|
||||
Modified int64 `json:"modified,omitempty"`
|
||||
|
||||
// name
|
||||
// Example: Brian Main DL.png
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// priority
|
||||
// Example: 0
|
||||
Priority float64 `json:"priority,omitempty"`
|
||||
|
||||
// secured
|
||||
// Example: true
|
||||
Secured bool `json:"secured,omitempty"`
|
||||
|
||||
// thumb URL
|
||||
// Example: https://connect-files-p1.s3.amazonaws.com/c71adc95-bb07-47f2-b9f6-cc4db7936686-200x200.png
|
||||
ThumbURL string `json:"thumbURL,omitempty"`
|
||||
|
||||
// type
|
||||
// Example: Photo
|
||||
Type string `json:"type,omitempty"`
|
||||
|
||||
// updated
|
||||
// Example: false
|
||||
Updated bool `json:"updated,omitempty"`
|
||||
}
|
||||
|
||||
|
@ -836,6 +1146,11 @@ func (m *MemberResponseRecommendationsItems0AssetsItems0) Validate(formats strfm
|
|||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this member response recommendations items0 assets items0 based on context it is used
|
||||
func (m *MemberResponseRecommendationsItems0AssetsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *MemberResponseRecommendationsItems0AssetsItems0) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
|
|
|
@ -10,6 +10,8 @@ package blaze_models
|
|||
// 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"
|
||||
)
|
||||
|
@ -20,9 +22,11 @@ import (
|
|||
type Message struct {
|
||||
|
||||
// code
|
||||
// Example: 200
|
||||
Code float64 `json:"code,omitempty"`
|
||||
|
||||
// message
|
||||
// Example: successful operation
|
||||
Message string `json:"message,omitempty"`
|
||||
}
|
||||
|
||||
|
@ -31,6 +35,11 @@ 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 {
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -10,6 +10,7 @@ package blaze_models
|
|||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strconv"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
|
@ -23,12 +24,15 @@ import (
|
|||
type ProductsResponse struct {
|
||||
|
||||
// limit
|
||||
// Example: 200
|
||||
Limit float64 `json:"limit,omitempty"`
|
||||
|
||||
// skip
|
||||
// Example: 0
|
||||
Skip float64 `json:"skip,omitempty"`
|
||||
|
||||
// total
|
||||
// Example: 2
|
||||
Total float64 `json:"total,omitempty"`
|
||||
|
||||
// values
|
||||
|
@ -50,7 +54,6 @@ func (m *ProductsResponse) Validate(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *ProductsResponse) validateValues(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Values) { // not required
|
||||
return nil
|
||||
}
|
||||
|
@ -74,6 +77,38 @@ func (m *ProductsResponse) validateValues(formats strfmt.Registry) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validate this products response based on the context it is used
|
||||
func (m *ProductsResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.contextValidateValues(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ProductsResponse) contextValidateValues(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
for i := 0; i < len(m.Values); i++ {
|
||||
|
||||
if m.Values[i] != nil {
|
||||
if err := m.Values[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("values" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *ProductsResponse) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
|
@ -98,204 +133,267 @@ func (m *ProductsResponse) UnmarshalBinary(b []byte) error {
|
|||
type ProductsResponseValuesItems0 struct {
|
||||
|
||||
// active
|
||||
// Example: true
|
||||
Active bool `json:"active,omitempty"`
|
||||
|
||||
// assets
|
||||
// Example: ["string"]
|
||||
Assets []*ProductsResponseValuesItems0AssetsItems0 `json:"assets"`
|
||||
|
||||
// automatic re order
|
||||
// Example: false
|
||||
AutomaticReOrder bool `json:"automaticReOrder,omitempty"`
|
||||
|
||||
// brand
|
||||
// Example: string
|
||||
Brand string `json:"brand,omitempty"`
|
||||
|
||||
// brand Id
|
||||
// Example: string
|
||||
BrandID string `json:"brandId,omitempty"`
|
||||
|
||||
// bundle items
|
||||
// Example: ["string"]
|
||||
BundleItems []string `json:"bundleItems"`
|
||||
|
||||
// by gram
|
||||
// Example: true
|
||||
ByGram bool `json:"byGram,omitempty"`
|
||||
|
||||
// by prepackage
|
||||
// Example: false
|
||||
ByPrepackage bool `json:"byPrepackage,omitempty"`
|
||||
|
||||
// cannabis type
|
||||
// Example: DEFAULT
|
||||
CannabisType string `json:"cannabisType,omitempty"`
|
||||
|
||||
// category
|
||||
Category *ProductsResponseValuesItems0Category `json:"category,omitempty"`
|
||||
|
||||
// category Id
|
||||
// Example: 5cabd4ba6218d148395b405b
|
||||
CategoryID string `json:"categoryId,omitempty"`
|
||||
|
||||
// cbd
|
||||
// Example: 0
|
||||
Cbd float64 `json:"cbd,omitempty"`
|
||||
|
||||
// cbda
|
||||
// Example: 0
|
||||
Cbda float64 `json:"cbda,omitempty"`
|
||||
|
||||
// cbn
|
||||
// Example: 0
|
||||
Cbn float64 `json:"cbn,omitempty"`
|
||||
|
||||
// company Id
|
||||
// Example: 5cabd4ba6218d148395b402c
|
||||
CompanyID string `json:"companyId,omitempty"`
|
||||
|
||||
// company link Id
|
||||
// Example: VEIxMFBSTzE=
|
||||
CompanyLinkID string `json:"companyLinkId,omitempty"`
|
||||
|
||||
// created
|
||||
// Example: 1554825555219
|
||||
Created int64 `json:"created,omitempty"`
|
||||
|
||||
// custom gram type
|
||||
// Example: GRAM
|
||||
CustomGramType string `json:"customGramType,omitempty"`
|
||||
|
||||
// custom tax info
|
||||
// Example: string
|
||||
CustomTaxInfo string `json:"customTaxInfo,omitempty"`
|
||||
|
||||
// custom weight
|
||||
// Example: 0
|
||||
CustomWeight float64 `json:"customWeight,omitempty"`
|
||||
|
||||
// deleted
|
||||
// Example: false
|
||||
Deleted bool `json:"deleted,omitempty"`
|
||||
|
||||
// description
|
||||
Description string `json:"description,omitempty"`
|
||||
|
||||
// dirty
|
||||
// Example: false
|
||||
Dirty bool `json:"dirty,omitempty"`
|
||||
|
||||
// discountable
|
||||
// Example: true
|
||||
Discountable bool `json:"discountable,omitempty"`
|
||||
|
||||
// enable excise tax
|
||||
// Example: false
|
||||
EnableExciseTax bool `json:"enableExciseTax,omitempty"`
|
||||
|
||||
// enable mix match
|
||||
// Example: false
|
||||
EnableMixMatch bool `json:"enableMixMatch,omitempty"`
|
||||
|
||||
// enable weedmap
|
||||
// Example: false
|
||||
EnableWeedmap bool `json:"enableWeedmap,omitempty"`
|
||||
|
||||
// flower type
|
||||
// Example: Sativa
|
||||
FlowerType string `json:"flowerType,omitempty"`
|
||||
|
||||
// genetics
|
||||
// Example: string
|
||||
Genetics string `json:"genetics,omitempty"`
|
||||
|
||||
// id
|
||||
// Example: 5cacc1536218d174d3f17b10
|
||||
ID string `json:"id,omitempty"`
|
||||
|
||||
// import Id
|
||||
// Example: string
|
||||
ImportID string `json:"importId,omitempty"`
|
||||
|
||||
// import src
|
||||
// Example: string
|
||||
ImportSrc string `json:"importSrc,omitempty"`
|
||||
|
||||
// low inventory notification
|
||||
// Example: false
|
||||
LowInventoryNotification bool `json:"lowInventoryNotification,omitempty"`
|
||||
|
||||
// low threshold
|
||||
// Example: 0
|
||||
LowThreshold float64 `json:"lowThreshold,omitempty"`
|
||||
|
||||
// medical conditions
|
||||
// Example: ["string"]
|
||||
MedicalConditions []string `json:"medicalConditions"`
|
||||
|
||||
// medicinal
|
||||
// Example: true
|
||||
Medicinal bool `json:"medicinal,omitempty"`
|
||||
|
||||
// modified
|
||||
// Example: 1554942857511
|
||||
Modified int64 `json:"modified,omitempty"`
|
||||
|
||||
// name
|
||||
// Example: Binsky Flower
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// notes
|
||||
// Example: ["string"]
|
||||
Notes []string `json:"notes"`
|
||||
|
||||
// potency
|
||||
// Example: false
|
||||
Potency bool `json:"potency,omitempty"`
|
||||
|
||||
// potency amount
|
||||
// Example: string
|
||||
PotencyAmount string `json:"potencyAmount,omitempty"`
|
||||
|
||||
// price breaks
|
||||
// Example: ["1234"]
|
||||
PriceBreaks []string `json:"priceBreaks"`
|
||||
|
||||
// price includes a l excise
|
||||
// Example: false
|
||||
PriceIncludesALExcise bool `json:"priceIncludesALExcise,omitempty"`
|
||||
|
||||
// price includes excise
|
||||
// Example: false
|
||||
PriceIncludesExcise bool `json:"priceIncludesExcise,omitempty"`
|
||||
|
||||
// price ranges
|
||||
PriceRanges []*ProductsResponseValuesItems0PriceRangesItems0 `json:"priceRanges"`
|
||||
|
||||
// pricing template Id
|
||||
// Example: string
|
||||
PricingTemplateID string `json:"pricingTemplateId,omitempty"`
|
||||
|
||||
// product sale type
|
||||
// Example: Both
|
||||
ProductSaleType string `json:"productSaleType,omitempty"`
|
||||
|
||||
// product type
|
||||
// Example: REGULAR
|
||||
ProductType string `json:"productType,omitempty"`
|
||||
|
||||
// qb desktop item ref
|
||||
// Example: string
|
||||
QbDesktopItemRef string `json:"qbDesktopItemRef,omitempty"`
|
||||
|
||||
// qb item ref
|
||||
// Example: string
|
||||
QbItemRef string `json:"qbItemRef,omitempty"`
|
||||
|
||||
// quantities
|
||||
Quantities []*ProductsResponseValuesItems0QuantitiesItems0 `json:"quantities"`
|
||||
|
||||
// re order level
|
||||
// Example: 0
|
||||
ReOrderLevel float64 `json:"reOrderLevel,omitempty"`
|
||||
|
||||
// shop Id
|
||||
// Example: 5cabd4ba6218d148395b4043
|
||||
ShopID string `json:"shopId,omitempty"`
|
||||
|
||||
// show in widget
|
||||
// Example: true
|
||||
ShowInWidget bool `json:"showInWidget,omitempty"`
|
||||
|
||||
// sku
|
||||
// Example: TB10PRO1
|
||||
Sku string `json:"sku,omitempty"`
|
||||
|
||||
// tags
|
||||
// Example: ["string"]
|
||||
Tags []string `json:"tags"`
|
||||
|
||||
// tax order
|
||||
// Example: PostTaxed
|
||||
TaxOrder string `json:"taxOrder,omitempty"`
|
||||
|
||||
// tax tables
|
||||
// Example: ["string"]
|
||||
TaxTables []string `json:"taxTables"`
|
||||
|
||||
// tax type
|
||||
// Example: Inherit
|
||||
TaxType string `json:"taxType,omitempty"`
|
||||
|
||||
// thc
|
||||
// Example: 0
|
||||
Thc float64 `json:"thc,omitempty"`
|
||||
|
||||
// thca
|
||||
// Example: 0
|
||||
Thca float64 `json:"thca,omitempty"`
|
||||
|
||||
// unit price
|
||||
// Example: 0
|
||||
UnitPrice float64 `json:"unitPrice,omitempty"`
|
||||
|
||||
// unit value
|
||||
// Example: 1
|
||||
UnitValue float64 `json:"unitValue,omitempty"`
|
||||
|
||||
// updated
|
||||
// Example: false
|
||||
Updated bool `json:"updated,omitempty"`
|
||||
|
||||
// vendor
|
||||
// Example: string
|
||||
Vendor string `json:"vendor,omitempty"`
|
||||
|
||||
// vendor Id
|
||||
// Example: 5cacc0c66218d174d3f17b0d
|
||||
VendorID string `json:"vendorId,omitempty"`
|
||||
|
||||
// weight per unit
|
||||
// Example: EACH
|
||||
WeightPerUnit string `json:"weightPerUnit,omitempty"`
|
||||
}
|
||||
|
||||
|
@ -326,7 +424,6 @@ func (m *ProductsResponseValuesItems0) Validate(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *ProductsResponseValuesItems0) validateAssets(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Assets) { // not required
|
||||
return nil
|
||||
}
|
||||
|
@ -351,7 +448,6 @@ func (m *ProductsResponseValuesItems0) validateAssets(formats strfmt.Registry) e
|
|||
}
|
||||
|
||||
func (m *ProductsResponseValuesItems0) validateCategory(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Category) { // not required
|
||||
return nil
|
||||
}
|
||||
|
@ -369,7 +465,6 @@ func (m *ProductsResponseValuesItems0) validateCategory(formats strfmt.Registry)
|
|||
}
|
||||
|
||||
func (m *ProductsResponseValuesItems0) validatePriceRanges(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.PriceRanges) { // not required
|
||||
return nil
|
||||
}
|
||||
|
@ -394,7 +489,6 @@ func (m *ProductsResponseValuesItems0) validatePriceRanges(formats strfmt.Regist
|
|||
}
|
||||
|
||||
func (m *ProductsResponseValuesItems0) validateQuantities(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Quantities) { // not required
|
||||
return nil
|
||||
}
|
||||
|
@ -418,6 +512,100 @@ func (m *ProductsResponseValuesItems0) validateQuantities(formats strfmt.Registr
|
|||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validate this products response values items0 based on the context it is used
|
||||
func (m *ProductsResponseValuesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.contextValidateAssets(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.contextValidateCategory(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.contextValidatePriceRanges(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.contextValidateQuantities(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ProductsResponseValuesItems0) contextValidateAssets(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
for i := 0; i < len(m.Assets); i++ {
|
||||
|
||||
if m.Assets[i] != nil {
|
||||
if err := m.Assets[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("assets" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ProductsResponseValuesItems0) contextValidateCategory(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Category != nil {
|
||||
if err := m.Category.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("category")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ProductsResponseValuesItems0) contextValidatePriceRanges(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
for i := 0; i < len(m.PriceRanges); i++ {
|
||||
|
||||
if m.PriceRanges[i] != nil {
|
||||
if err := m.PriceRanges[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("priceRanges" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ProductsResponseValuesItems0) contextValidateQuantities(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
for i := 0; i < len(m.Quantities); i++ {
|
||||
|
||||
if m.Quantities[i] != nil {
|
||||
if err := m.Quantities[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("quantities" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *ProductsResponseValuesItems0) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
|
@ -442,54 +630,71 @@ func (m *ProductsResponseValuesItems0) UnmarshalBinary(b []byte) error {
|
|||
type ProductsResponseValuesItems0AssetsItems0 struct {
|
||||
|
||||
// active
|
||||
// Example: true
|
||||
Active bool `json:"active,omitempty"`
|
||||
|
||||
// asset type
|
||||
// Example: Photo
|
||||
AssetType string `json:"assetType,omitempty"`
|
||||
|
||||
// company Id
|
||||
// Example: 5c7e8c7b722ed607e61edb06
|
||||
CompanyID string `json:"companyId,omitempty"`
|
||||
|
||||
// created
|
||||
// Example: 1556052368662
|
||||
Created int64 `json:"created,omitempty"`
|
||||
|
||||
// deleted
|
||||
// Example: false
|
||||
Deleted bool `json:"deleted,omitempty"`
|
||||
|
||||
// id
|
||||
// Example: 5cbf79908a29f808183540e7
|
||||
ID string `json:"id,omitempty"`
|
||||
|
||||
// key
|
||||
// Example: c71adc95-bb07-47f2-b9f6-cc4db7936686.png
|
||||
Key string `json:"key,omitempty"`
|
||||
|
||||
// large URL
|
||||
// Example: https://connect-files-p1.s3.amazonaws.com/c71adc95-bb07-47f2-b9f6-cc4db7936686-800x800.png
|
||||
LargeURL string `json:"largeURL,omitempty"`
|
||||
|
||||
// large x2 URL
|
||||
// Example: https://connect-files-p1.s3.amazonaws.com/c71adc95-bb07-47f2-b9f6-cc4db7936686-1600x1600.png
|
||||
LargeX2URL string `json:"largeX2URL,omitempty"`
|
||||
|
||||
// medium URL
|
||||
// Example: https://connect-files-p1.s3.amazonaws.com/c71adc95-bb07-47f2-b9f6-cc4db7936686-500x500.png
|
||||
MediumURL string `json:"mediumURL,omitempty"`
|
||||
|
||||
// modified
|
||||
// Example: 1556052368662
|
||||
Modified int64 `json:"modified,omitempty"`
|
||||
|
||||
// name
|
||||
// Example: Brian Main DL.png
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// priority
|
||||
// Example: 0
|
||||
Priority float64 `json:"priority,omitempty"`
|
||||
|
||||
// secured
|
||||
// Example: true
|
||||
Secured bool `json:"secured,omitempty"`
|
||||
|
||||
// thumb URL
|
||||
// Example: https://connect-files-p1.s3.amazonaws.com/c71adc95-bb07-47f2-b9f6-cc4db7936686-200x200.png
|
||||
ThumbURL string `json:"thumbURL,omitempty"`
|
||||
|
||||
// type
|
||||
// Example: Photo
|
||||
Type string `json:"type,omitempty"`
|
||||
|
||||
// updated
|
||||
// Example: false
|
||||
Updated bool `json:"updated,omitempty"`
|
||||
}
|
||||
|
||||
|
@ -498,6 +703,11 @@ func (m *ProductsResponseValuesItems0AssetsItems0) Validate(formats strfmt.Regis
|
|||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this products response values items0 assets items0 based on context it is used
|
||||
func (m *ProductsResponseValuesItems0AssetsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *ProductsResponseValuesItems0AssetsItems0) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
|
@ -522,51 +732,66 @@ func (m *ProductsResponseValuesItems0AssetsItems0) UnmarshalBinary(b []byte) err
|
|||
type ProductsResponseValuesItems0Category struct {
|
||||
|
||||
// active
|
||||
// Example: true
|
||||
Active bool `json:"active,omitempty"`
|
||||
|
||||
// cannabis
|
||||
// Example: true
|
||||
Cannabis bool `json:"cannabis,omitempty"`
|
||||
|
||||
// cannabis type
|
||||
// Example: DEFAULT
|
||||
CannabisType string `json:"cannabisType,omitempty"`
|
||||
|
||||
// company Id
|
||||
// Example: 5cabd4ba6218d148395b402c
|
||||
CompanyID string `json:"companyId,omitempty"`
|
||||
|
||||
// created
|
||||
// Example: 1554764986388
|
||||
Created int64 `json:"created,omitempty"`
|
||||
|
||||
// deleted
|
||||
// Example: false
|
||||
Deleted bool `json:"deleted,omitempty"`
|
||||
|
||||
// dirty
|
||||
// Example: false
|
||||
Dirty bool `json:"dirty,omitempty"`
|
||||
|
||||
// id
|
||||
// Example: 5cabd4ba6218d148395b405b
|
||||
ID string `json:"id,omitempty"`
|
||||
|
||||
// low threshold
|
||||
// Example: string
|
||||
LowThreshold string `json:"lowThreshold,omitempty"`
|
||||
|
||||
// modified
|
||||
// Example: 1554764986388
|
||||
Modified int64 `json:"modified,omitempty"`
|
||||
|
||||
// name
|
||||
// Example: Flowers
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// photo
|
||||
Photo *ProductsResponseValuesItems0CategoryPhoto `json:"photo,omitempty"`
|
||||
|
||||
// priority
|
||||
// Example: 0
|
||||
Priority float64 `json:"priority,omitempty"`
|
||||
|
||||
// shop Id
|
||||
// Example: 5cabd4ba6218d148395b4043
|
||||
ShopID string `json:"shopId,omitempty"`
|
||||
|
||||
// unit type
|
||||
// Example: grams
|
||||
UnitType string `json:"unitType,omitempty"`
|
||||
|
||||
// updated
|
||||
// Example: false
|
||||
Updated bool `json:"updated,omitempty"`
|
||||
}
|
||||
|
||||
|
@ -585,7 +810,6 @@ func (m *ProductsResponseValuesItems0Category) Validate(formats strfmt.Registry)
|
|||
}
|
||||
|
||||
func (m *ProductsResponseValuesItems0Category) validatePhoto(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Photo) { // not required
|
||||
return nil
|
||||
}
|
||||
|
@ -602,6 +826,34 @@ func (m *ProductsResponseValuesItems0Category) validatePhoto(formats strfmt.Regi
|
|||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validate this products response values items0 category based on the context it is used
|
||||
func (m *ProductsResponseValuesItems0Category) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.contextValidatePhoto(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ProductsResponseValuesItems0Category) contextValidatePhoto(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Photo != nil {
|
||||
if err := m.Photo.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("category" + "." + "photo")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *ProductsResponseValuesItems0Category) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
|
@ -626,60 +878,79 @@ func (m *ProductsResponseValuesItems0Category) UnmarshalBinary(b []byte) error {
|
|||
type ProductsResponseValuesItems0CategoryPhoto struct {
|
||||
|
||||
// active
|
||||
// Example: true
|
||||
Active bool `json:"active,omitempty"`
|
||||
|
||||
// asset type
|
||||
// Example: Photo
|
||||
AssetType string `json:"assetType,omitempty"`
|
||||
|
||||
// company Id
|
||||
// Example: 5cabd4ba6218d148395b402c
|
||||
CompanyID string `json:"companyId,omitempty"`
|
||||
|
||||
// created
|
||||
// Example: 1554764986388
|
||||
Created int64 `json:"created,omitempty"`
|
||||
|
||||
// deleted
|
||||
// Example: false
|
||||
Deleted bool `json:"deleted,omitempty"`
|
||||
|
||||
// id
|
||||
// Example: 5cabd4ba6218d148395b404f
|
||||
ID string `json:"id,omitempty"`
|
||||
|
||||
// key
|
||||
// Example: 420default-Flower.jpg
|
||||
Key string `json:"key,omitempty"`
|
||||
|
||||
// large URL
|
||||
// Example: string
|
||||
LargeURL string `json:"largeURL,omitempty"`
|
||||
|
||||
// large x2 URL
|
||||
// Example: string
|
||||
LargeX2URL string `json:"largeX2URL,omitempty"`
|
||||
|
||||
// medium URL
|
||||
// Example: string
|
||||
MediumURL string `json:"mediumURL,omitempty"`
|
||||
|
||||
// modified
|
||||
// Example: 1554764986388
|
||||
Modified int64 `json:"modified,omitempty"`
|
||||
|
||||
// name
|
||||
// Example: Flower.jpg
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// orig URL
|
||||
// Example: string
|
||||
OrigURL string `json:"origURL,omitempty"`
|
||||
|
||||
// priority
|
||||
// Example: 0
|
||||
Priority float64 `json:"priority,omitempty"`
|
||||
|
||||
// public URL
|
||||
// Example: https://s3.amazonaws.com/connect-files-public/420default-Flower.jpg
|
||||
PublicURL string `json:"publicURL,omitempty"`
|
||||
|
||||
// secured
|
||||
// Example: false
|
||||
Secured bool `json:"secured,omitempty"`
|
||||
|
||||
// thumb URL
|
||||
// Example: string
|
||||
ThumbURL string `json:"thumbURL,omitempty"`
|
||||
|
||||
// type
|
||||
// Example: Photo
|
||||
Type string `json:"type,omitempty"`
|
||||
|
||||
// updated
|
||||
// Example: false
|
||||
Updated bool `json:"updated,omitempty"`
|
||||
}
|
||||
|
||||
|
@ -688,6 +959,11 @@ func (m *ProductsResponseValuesItems0CategoryPhoto) Validate(formats strfmt.Regi
|
|||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this products response values items0 category photo based on context it is used
|
||||
func (m *ProductsResponseValuesItems0CategoryPhoto) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *ProductsResponseValuesItems0CategoryPhoto) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
|
@ -712,18 +988,22 @@ func (m *ProductsResponseValuesItems0CategoryPhoto) UnmarshalBinary(b []byte) er
|
|||
type ProductsResponseValuesItems0PriceRangesItems0 struct {
|
||||
|
||||
// id
|
||||
// Example: 5cacc1536218d174d3f17b10_5cabd4ba6218d148395b402e
|
||||
ID string `json:"id,omitempty"`
|
||||
|
||||
// price
|
||||
// Example: 10
|
||||
Price float64 `json:"price,omitempty"`
|
||||
|
||||
// priority
|
||||
// Example: 0
|
||||
Priority float64 `json:"priority,omitempty"`
|
||||
|
||||
// weight tolerance
|
||||
WeightTolerance *ProductsResponseValuesItems0PriceRangesItems0WeightTolerance `json:"weightTolerance,omitempty"`
|
||||
|
||||
// weight tolerance Id
|
||||
// Example: 5cabd4ba6218d148395b402e
|
||||
WeightToleranceID string `json:"weightToleranceId,omitempty"`
|
||||
}
|
||||
|
||||
|
@ -742,7 +1022,6 @@ func (m *ProductsResponseValuesItems0PriceRangesItems0) Validate(formats strfmt.
|
|||
}
|
||||
|
||||
func (m *ProductsResponseValuesItems0PriceRangesItems0) validateWeightTolerance(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.WeightTolerance) { // not required
|
||||
return nil
|
||||
}
|
||||
|
@ -759,6 +1038,34 @@ func (m *ProductsResponseValuesItems0PriceRangesItems0) validateWeightTolerance(
|
|||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validate this products response values items0 price ranges items0 based on the context it is used
|
||||
func (m *ProductsResponseValuesItems0PriceRangesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.contextValidateWeightTolerance(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ProductsResponseValuesItems0PriceRangesItems0) contextValidateWeightTolerance(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.WeightTolerance != nil {
|
||||
if err := m.WeightTolerance.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("weightTolerance")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *ProductsResponseValuesItems0PriceRangesItems0) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
|
@ -783,45 +1090,59 @@ func (m *ProductsResponseValuesItems0PriceRangesItems0) UnmarshalBinary(b []byte
|
|||
type ProductsResponseValuesItems0PriceRangesItems0WeightTolerance struct {
|
||||
|
||||
// company Id
|
||||
// Example: 5cabd4ba6218d148395b402c
|
||||
CompanyID string `json:"companyId,omitempty"`
|
||||
|
||||
// created
|
||||
// Example: 1554746451739
|
||||
Created int64 `json:"created,omitempty"`
|
||||
|
||||
// deleted
|
||||
// Example: false
|
||||
Deleted bool `json:"deleted,omitempty"`
|
||||
|
||||
// enabled
|
||||
// Example: true
|
||||
Enabled bool `json:"enabled,omitempty"`
|
||||
|
||||
// end weight
|
||||
// Example: 0.6
|
||||
EndWeight float64 `json:"endWeight,omitempty"`
|
||||
|
||||
// id
|
||||
// Example: 5cabd4ba6218d148395b402e
|
||||
ID string `json:"id,omitempty"`
|
||||
|
||||
// modified
|
||||
// Example: 1554746451739
|
||||
Modified int64 `json:"modified,omitempty"`
|
||||
|
||||
// name
|
||||
// Example: .5 Gram
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// priority
|
||||
// Example: 0
|
||||
Priority float64 `json:"priority,omitempty"`
|
||||
|
||||
// start weight
|
||||
// Example: 0.5
|
||||
StartWeight float64 `json:"startWeight,omitempty"`
|
||||
|
||||
// unit value
|
||||
// Example: 0.5
|
||||
UnitValue float64 `json:"unitValue,omitempty"`
|
||||
|
||||
// updated
|
||||
// Example: false
|
||||
Updated bool `json:"updated,omitempty"`
|
||||
|
||||
// weight key
|
||||
// Example: HALF_GRAM
|
||||
WeightKey string `json:"weightKey,omitempty"`
|
||||
|
||||
// weight value
|
||||
// Example: 0.5
|
||||
WeightValue float64 `json:"weightValue,omitempty"`
|
||||
}
|
||||
|
||||
|
@ -830,6 +1151,11 @@ func (m *ProductsResponseValuesItems0PriceRangesItems0WeightTolerance) Validate(
|
|||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this products response values items0 price ranges items0 weight tolerance based on context it is used
|
||||
func (m *ProductsResponseValuesItems0PriceRangesItems0WeightTolerance) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *ProductsResponseValuesItems0PriceRangesItems0WeightTolerance) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
|
@ -854,33 +1180,43 @@ func (m *ProductsResponseValuesItems0PriceRangesItems0WeightTolerance) Unmarshal
|
|||
type ProductsResponseValuesItems0QuantitiesItems0 struct {
|
||||
|
||||
// company Id
|
||||
// Example: 5cabd4ba6218d148395b402c
|
||||
CompanyID string `json:"companyId,omitempty"`
|
||||
|
||||
// created
|
||||
// Example: 1554825661504
|
||||
Created int64 `json:"created,omitempty"`
|
||||
|
||||
// deleted
|
||||
// Example: false
|
||||
Deleted bool `json:"deleted,omitempty"`
|
||||
|
||||
// dirty
|
||||
// Example: false
|
||||
Dirty bool `json:"dirty,omitempty"`
|
||||
|
||||
// id
|
||||
// Example: 5cacc1bd6218d174d3f17b38
|
||||
ID string `json:"id,omitempty"`
|
||||
|
||||
// inventory Id
|
||||
// Example: 5cabd4ba6218d148395b4067
|
||||
InventoryID string `json:"inventoryId,omitempty"`
|
||||
|
||||
// modified
|
||||
// Example: 1554825661504
|
||||
Modified int64 `json:"modified,omitempty"`
|
||||
|
||||
// quantity
|
||||
// Example: 890
|
||||
Quantity float64 `json:"quantity,omitempty"`
|
||||
|
||||
// shop Id
|
||||
// Example: 5cabd4ba6218d148395b4043
|
||||
ShopID string `json:"shopId,omitempty"`
|
||||
|
||||
// updated
|
||||
// Example: false
|
||||
Updated bool `json:"updated,omitempty"`
|
||||
}
|
||||
|
||||
|
@ -889,6 +1225,11 @@ func (m *ProductsResponseValuesItems0QuantitiesItems0) Validate(formats strfmt.R
|
|||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this products response values items0 quantities items0 based on context it is used
|
||||
func (m *ProductsResponseValuesItems0QuantitiesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *ProductsResponseValuesItems0QuantitiesItems0) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -10,6 +10,7 @@ package blaze_models
|
|||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strconv"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
|
@ -23,48 +24,62 @@ import (
|
|||
type VendorResponse struct {
|
||||
|
||||
// active
|
||||
// Example: true
|
||||
Active bool `json:"active,omitempty"`
|
||||
|
||||
// additional address list
|
||||
// Example: ["string"]
|
||||
AdditionalAddressList []string `json:"additionalAddressList"`
|
||||
|
||||
// address
|
||||
Address *VendorResponseAddress `json:"address,omitempty"`
|
||||
|
||||
// arms length type
|
||||
// Example: ARMS_LENGTH
|
||||
ArmsLengthType string `json:"armsLengthType,omitempty"`
|
||||
|
||||
// assets
|
||||
// Example: ["string"]
|
||||
Assets []*VendorResponseAssetsItems0 `json:"assets"`
|
||||
|
||||
// back order enabled
|
||||
// Example: false
|
||||
BackOrderEnabled bool `json:"backOrderEnabled,omitempty"`
|
||||
|
||||
// brand list
|
||||
// Example: ["string"]
|
||||
BrandList []string `json:"brandList"`
|
||||
|
||||
// brands
|
||||
// Example: ["string"]
|
||||
Brands []string `json:"brands"`
|
||||
|
||||
// company Id
|
||||
// Example: 5cabd4ba6218d148395b402c
|
||||
CompanyID string `json:"companyId,omitempty"`
|
||||
|
||||
// company licenses
|
||||
// Example: ["string"]
|
||||
CompanyLicenses []string `json:"companyLicenses"`
|
||||
|
||||
// company type
|
||||
// Example: string
|
||||
CompanyType string `json:"companyType,omitempty"`
|
||||
|
||||
// created
|
||||
// Example: 1554825414778
|
||||
Created int64 `json:"created,omitempty"`
|
||||
|
||||
// credits
|
||||
// Example: 0
|
||||
Credits float64 `json:"credits,omitempty"`
|
||||
|
||||
// dba name
|
||||
// Example: string
|
||||
DbaName string `json:"dbaName,omitempty"`
|
||||
|
||||
// deleted
|
||||
// Example: false
|
||||
Deleted bool `json:"deleted,omitempty"`
|
||||
|
||||
// description
|
||||
|
@ -80,54 +95,68 @@ type VendorResponse struct {
|
|||
FirstName string `json:"firstName,omitempty"`
|
||||
|
||||
// id
|
||||
// Example: 5cacc0c66218d174d3f17b0d
|
||||
ID string `json:"id,omitempty"`
|
||||
|
||||
// import Id
|
||||
// Example: string
|
||||
ImportID string `json:"importId,omitempty"`
|
||||
|
||||
// last name
|
||||
LastName string `json:"lastName,omitempty"`
|
||||
|
||||
// licence type
|
||||
// Example: string
|
||||
LicenceType string `json:"licenceType,omitempty"`
|
||||
|
||||
// license expiration date
|
||||
// Example: 0
|
||||
LicenseExpirationDate float64 `json:"licenseExpirationDate,omitempty"`
|
||||
|
||||
// license number
|
||||
LicenseNumber string `json:"licenseNumber,omitempty"`
|
||||
|
||||
// mobile number
|
||||
// Example: string
|
||||
MobileNumber string `json:"mobileNumber,omitempty"`
|
||||
|
||||
// modified
|
||||
// Example: 1554825414778
|
||||
Modified int64 `json:"modified,omitempty"`
|
||||
|
||||
// name
|
||||
// Example: Binsky
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// notes
|
||||
// Example: ["string"]
|
||||
Notes []string `json:"notes"`
|
||||
|
||||
// phone
|
||||
Phone string `json:"phone,omitempty"`
|
||||
|
||||
// qb desktop ref
|
||||
// Example: string
|
||||
QbDesktopRef string `json:"qbDesktopRef,omitempty"`
|
||||
|
||||
// qb vendor ref
|
||||
// Example: ["string"]
|
||||
QbVendorRef []string `json:"qbVendorRef"`
|
||||
|
||||
// related entity
|
||||
// Example: false
|
||||
RelatedEntity bool `json:"relatedEntity,omitempty"`
|
||||
|
||||
// updated
|
||||
// Example: false
|
||||
Updated bool `json:"updated,omitempty"`
|
||||
|
||||
// vendor key
|
||||
// Example: NWNhYmQ0YmE2MjE4ZDE0ODM5NWI0MDJjX2JpbnNreQ==
|
||||
VendorKey string `json:"vendorKey,omitempty"`
|
||||
|
||||
// vendor type
|
||||
// Example: VENDOR
|
||||
VendorType string `json:"vendorType,omitempty"`
|
||||
|
||||
// website
|
||||
|
@ -153,7 +182,6 @@ func (m *VendorResponse) Validate(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *VendorResponse) validateAddress(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Address) { // not required
|
||||
return nil
|
||||
}
|
||||
|
@ -171,7 +199,6 @@ func (m *VendorResponse) validateAddress(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *VendorResponse) validateAssets(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Assets) { // not required
|
||||
return nil
|
||||
}
|
||||
|
@ -195,6 +222,56 @@ func (m *VendorResponse) validateAssets(formats strfmt.Registry) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validate this vendor response based on the context it is used
|
||||
func (m *VendorResponse) 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.contextValidateAssets(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *VendorResponse) 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 *VendorResponse) contextValidateAssets(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
for i := 0; i < len(m.Assets); i++ {
|
||||
|
||||
if m.Assets[i] != nil {
|
||||
if err := m.Assets[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("assets" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *VendorResponse) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
|
@ -225,27 +302,34 @@ type VendorResponseAddress struct {
|
|||
City string `json:"city,omitempty"`
|
||||
|
||||
// company Id
|
||||
// Example: string
|
||||
CompanyID string `json:"companyId,omitempty"`
|
||||
|
||||
// country
|
||||
// Example: US
|
||||
Country string `json:"country,omitempty"`
|
||||
|
||||
// created
|
||||
// Example: 1554825414778
|
||||
Created int64 `json:"created,omitempty"`
|
||||
|
||||
// deleted
|
||||
// Example: false
|
||||
Deleted bool `json:"deleted,omitempty"`
|
||||
|
||||
// id
|
||||
// Example: 5cacc0c66218d174d3f17b0c
|
||||
ID string `json:"id,omitempty"`
|
||||
|
||||
// modified
|
||||
// Example: 1554825414778
|
||||
Modified int64 `json:"modified,omitempty"`
|
||||
|
||||
// state
|
||||
State string `json:"state,omitempty"`
|
||||
|
||||
// updated
|
||||
// Example: false
|
||||
Updated bool `json:"updated,omitempty"`
|
||||
|
||||
// zip code
|
||||
|
@ -257,6 +341,11 @@ func (m *VendorResponseAddress) Validate(formats strfmt.Registry) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this vendor response address based on context it is used
|
||||
func (m *VendorResponseAddress) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *VendorResponseAddress) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
|
@ -281,54 +370,71 @@ func (m *VendorResponseAddress) UnmarshalBinary(b []byte) error {
|
|||
type VendorResponseAssetsItems0 struct {
|
||||
|
||||
// active
|
||||
// Example: true
|
||||
Active bool `json:"active,omitempty"`
|
||||
|
||||
// asset type
|
||||
// Example: Photo
|
||||
AssetType string `json:"assetType,omitempty"`
|
||||
|
||||
// company Id
|
||||
// Example: 5c7e8c7b722ed607e61edb06
|
||||
CompanyID string `json:"companyId,omitempty"`
|
||||
|
||||
// created
|
||||
// Example: 1556052368662
|
||||
Created int64 `json:"created,omitempty"`
|
||||
|
||||
// deleted
|
||||
// Example: false
|
||||
Deleted bool `json:"deleted,omitempty"`
|
||||
|
||||
// id
|
||||
// Example: 5cbf79908a29f808183540e7
|
||||
ID string `json:"id,omitempty"`
|
||||
|
||||
// key
|
||||
// Example: c71adc95-bb07-47f2-b9f6-cc4db7936686.png
|
||||
Key string `json:"key,omitempty"`
|
||||
|
||||
// large URL
|
||||
// Example: https://connect-files-p1.s3.amazonaws.com/c71adc95-bb07-47f2-b9f6-cc4db7936686-800x800.png
|
||||
LargeURL string `json:"largeURL,omitempty"`
|
||||
|
||||
// large x2 URL
|
||||
// Example: https://connect-files-p1.s3.amazonaws.com/c71adc95-bb07-47f2-b9f6-cc4db7936686-1600x1600.png
|
||||
LargeX2URL string `json:"largeX2URL,omitempty"`
|
||||
|
||||
// medium URL
|
||||
// Example: https://connect-files-p1.s3.amazonaws.com/c71adc95-bb07-47f2-b9f6-cc4db7936686-500x500.png
|
||||
MediumURL string `json:"mediumURL,omitempty"`
|
||||
|
||||
// modified
|
||||
// Example: 1556052368662
|
||||
Modified int64 `json:"modified,omitempty"`
|
||||
|
||||
// name
|
||||
// Example: Brian Main DL.png
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// priority
|
||||
// Example: 0
|
||||
Priority float64 `json:"priority,omitempty"`
|
||||
|
||||
// secured
|
||||
// Example: true
|
||||
Secured bool `json:"secured,omitempty"`
|
||||
|
||||
// thumb URL
|
||||
// Example: https://connect-files-p1.s3.amazonaws.com/c71adc95-bb07-47f2-b9f6-cc4db7936686-200x200.png
|
||||
ThumbURL string `json:"thumbURL,omitempty"`
|
||||
|
||||
// type
|
||||
// Example: Photo
|
||||
Type string `json:"type,omitempty"`
|
||||
|
||||
// updated
|
||||
// Example: false
|
||||
Updated bool `json:"updated,omitempty"`
|
||||
}
|
||||
|
||||
|
@ -337,6 +443,11 @@ func (m *VendorResponseAssetsItems0) Validate(formats strfmt.Registry) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this vendor response assets items0 based on context it is used
|
||||
func (m *VendorResponseAssetsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *VendorResponseAssetsItems0) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
|
|
|
@ -29,17 +29,20 @@ type Client struct {
|
|||
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) (*DeleteAccountOK, error)
|
||||
DeleteAccount(params *DeleteAccountParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAccountOK, error)
|
||||
|
||||
GetAccounts(params *GetAccountsParams, authInfo runtime.ClientAuthInfoWriter) (*GetAccountsOK, error)
|
||||
GetAccounts(params *GetAccountsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAccountsOK, error)
|
||||
|
||||
GetAccountsObservable(params *GetAccountsObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetAccountsObservableOK, error)
|
||||
GetAccountsObservable(params *GetAccountsObservableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAccountsObservableOK, error)
|
||||
|
||||
PostAccounts(params *PostAccountsParams, authInfo runtime.ClientAuthInfoWriter) (*PostAccountsOK, error)
|
||||
PostAccounts(params *PostAccountsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAccountsOK, error)
|
||||
|
||||
PutAccount(params *PutAccountParams, authInfo runtime.ClientAuthInfoWriter) (*PutAccountOK, error)
|
||||
PutAccount(params *PutAccountParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutAccountOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
@ -49,13 +52,12 @@ type ClientService interface {
|
|||
|
||||
Delete Taxnexus Account record
|
||||
*/
|
||||
func (a *Client) DeleteAccount(params *DeleteAccountParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteAccountOK, error) {
|
||||
func (a *Client) DeleteAccount(params *DeleteAccountParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAccountOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewDeleteAccountParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "deleteAccount",
|
||||
Method: "DELETE",
|
||||
PathPattern: "/accounts",
|
||||
|
@ -67,7 +69,12 @@ func (a *Client) DeleteAccount(params *DeleteAccountParams, authInfo runtime.Cli
|
|||
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
|
||||
}
|
||||
|
@ -86,13 +93,12 @@ func (a *Client) DeleteAccount(params *DeleteAccountParams, authInfo runtime.Cli
|
|||
|
||||
Return a list of all available Accounts
|
||||
*/
|
||||
func (a *Client) GetAccounts(params *GetAccountsParams, authInfo runtime.ClientAuthInfoWriter) (*GetAccountsOK, error) {
|
||||
func (a *Client) GetAccounts(params *GetAccountsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAccountsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetAccountsParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "getAccounts",
|
||||
Method: "GET",
|
||||
PathPattern: "/accounts",
|
||||
|
@ -104,7 +110,12 @@ func (a *Client) GetAccounts(params *GetAccountsParams, authInfo runtime.ClientA
|
|||
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
|
||||
}
|
||||
|
@ -123,13 +134,12 @@ func (a *Client) GetAccounts(params *GetAccountsParams, authInfo runtime.ClientA
|
|||
|
||||
A list of accounts in a simple JSON array
|
||||
*/
|
||||
func (a *Client) GetAccountsObservable(params *GetAccountsObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetAccountsObservableOK, error) {
|
||||
func (a *Client) GetAccountsObservable(params *GetAccountsObservableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAccountsObservableOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetAccountsObservableParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "getAccountsObservable",
|
||||
Method: "GET",
|
||||
PathPattern: "/accounts/observable",
|
||||
|
@ -141,7 +151,12 @@ func (a *Client) GetAccountsObservable(params *GetAccountsObservableParams, auth
|
|||
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
|
||||
}
|
||||
|
@ -160,13 +175,12 @@ func (a *Client) GetAccountsObservable(params *GetAccountsObservableParams, auth
|
|||
|
||||
Account record to be added
|
||||
*/
|
||||
func (a *Client) PostAccounts(params *PostAccountsParams, authInfo runtime.ClientAuthInfoWriter) (*PostAccountsOK, error) {
|
||||
func (a *Client) PostAccounts(params *PostAccountsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAccountsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPostAccountsParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "postAccounts",
|
||||
Method: "POST",
|
||||
PathPattern: "/accounts",
|
||||
|
@ -178,7 +192,12 @@ func (a *Client) PostAccounts(params *PostAccountsParams, authInfo runtime.Clien
|
|||
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
|
||||
}
|
||||
|
@ -197,13 +216,12 @@ func (a *Client) PostAccounts(params *PostAccountsParams, authInfo runtime.Clien
|
|||
|
||||
Update a single account specified by accountId
|
||||
*/
|
||||
func (a *Client) PutAccount(params *PutAccountParams, authInfo runtime.ClientAuthInfoWriter) (*PutAccountOK, error) {
|
||||
func (a *Client) PutAccount(params *PutAccountParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutAccountOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPutAccountParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "putAccount",
|
||||
Method: "PUT",
|
||||
PathPattern: "/accounts",
|
||||
|
@ -215,7 +233,12 @@ func (a *Client) PutAccount(params *PutAccountParams, authInfo runtime.ClientAut
|
|||
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
|
||||
}
|
||||
|
|
|
@ -20,53 +20,52 @@ import (
|
|||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// NewDeleteAccountParams creates a new DeleteAccountParams object
|
||||
// with the default values initialized.
|
||||
// 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 {
|
||||
var ()
|
||||
return &DeleteAccountParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAccountParamsWithTimeout creates a new DeleteAccountParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewDeleteAccountParamsWithTimeout(timeout time.Duration) *DeleteAccountParams {
|
||||
var ()
|
||||
return &DeleteAccountParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAccountParamsWithContext creates a new DeleteAccountParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
// with the ability to set a context for a request.
|
||||
func NewDeleteAccountParamsWithContext(ctx context.Context) *DeleteAccountParams {
|
||||
var ()
|
||||
return &DeleteAccountParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAccountParamsWithHTTPClient creates a new DeleteAccountParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewDeleteAccountParamsWithHTTPClient(client *http.Client) *DeleteAccountParams {
|
||||
var ()
|
||||
return &DeleteAccountParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/* DeleteAccountParams contains all the parameters to send to the API endpoint
|
||||
for the delete account operation typically these are written to a http.Request
|
||||
for the delete account operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type DeleteAccountParams struct {
|
||||
|
||||
/*AccountID
|
||||
Taxnexus Record Id of an Account
|
||||
/* AccountID.
|
||||
|
||||
Taxnexus Record Id of an Account
|
||||
*/
|
||||
AccountID *string
|
||||
|
||||
|
@ -75,6 +74,21 @@ type DeleteAccountParams struct {
|
|||
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)
|
||||
|
@ -131,16 +145,17 @@ func (o *DeleteAccountParams) WriteToRequest(r runtime.ClientRequest, reg strfmt
|
|||
|
||||
// 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 {
|
||||
|
|
|
@ -63,9 +63,8 @@ func (o *DeleteAccountReader) ReadResponse(response runtime.ClientResponse, cons
|
|||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -74,7 +73,7 @@ func NewDeleteAccountOK() *DeleteAccountOK {
|
|||
return &DeleteAccountOK{}
|
||||
}
|
||||
|
||||
/*DeleteAccountOK handles this case with default header values.
|
||||
/* DeleteAccountOK describes a response with status code 200, with default header values.
|
||||
|
||||
Taxnexus Response with Message Objects with Delete Status
|
||||
*/
|
||||
|
@ -87,15 +86,18 @@ type DeleteAccountOK struct {
|
|||
func (o *DeleteAccountOK) Error() string {
|
||||
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAccountOK) GetPayload() *crm_models.DeleteResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *DeleteAccountOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// hydrates response header Access-Control-Allow-Origin
|
||||
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
if hdrAccessControlAllowOrigin != "" {
|
||||
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
|
||||
}
|
||||
|
||||
o.Payload = new(crm_models.DeleteResponse)
|
||||
|
||||
|
@ -112,7 +114,7 @@ func NewDeleteAccountUnauthorized() *DeleteAccountUnauthorized {
|
|||
return &DeleteAccountUnauthorized{}
|
||||
}
|
||||
|
||||
/*DeleteAccountUnauthorized handles this case with default header values.
|
||||
/* DeleteAccountUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
|
@ -125,15 +127,18 @@ type DeleteAccountUnauthorized struct {
|
|||
func (o *DeleteAccountUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAccountUnauthorized) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *DeleteAccountUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -150,7 +155,7 @@ func NewDeleteAccountForbidden() *DeleteAccountForbidden {
|
|||
return &DeleteAccountForbidden{}
|
||||
}
|
||||
|
||||
/*DeleteAccountForbidden handles this case with default header values.
|
||||
/* DeleteAccountForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
|
@ -163,15 +168,18 @@ type DeleteAccountForbidden struct {
|
|||
func (o *DeleteAccountForbidden) Error() string {
|
||||
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAccountForbidden) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *DeleteAccountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -188,7 +196,7 @@ func NewDeleteAccountNotFound() *DeleteAccountNotFound {
|
|||
return &DeleteAccountNotFound{}
|
||||
}
|
||||
|
||||
/*DeleteAccountNotFound handles this case with default header values.
|
||||
/* DeleteAccountNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
|
@ -201,15 +209,18 @@ type DeleteAccountNotFound struct {
|
|||
func (o *DeleteAccountNotFound) Error() string {
|
||||
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAccountNotFound) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *DeleteAccountNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -226,7 +237,7 @@ func NewDeleteAccountUnprocessableEntity() *DeleteAccountUnprocessableEntity {
|
|||
return &DeleteAccountUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*DeleteAccountUnprocessableEntity handles this case with default header values.
|
||||
/* DeleteAccountUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
|
@ -239,15 +250,18 @@ type DeleteAccountUnprocessableEntity struct {
|
|||
func (o *DeleteAccountUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAccountUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *DeleteAccountUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -264,7 +278,7 @@ func NewDeleteAccountInternalServerError() *DeleteAccountInternalServerError {
|
|||
return &DeleteAccountInternalServerError{}
|
||||
}
|
||||
|
||||
/*DeleteAccountInternalServerError handles this case with default header values.
|
||||
/* DeleteAccountInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
|
@ -277,15 +291,18 @@ type DeleteAccountInternalServerError struct {
|
|||
func (o *DeleteAccountInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAccountInternalServerError) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *DeleteAccountInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
|
|
@ -21,68 +21,70 @@ import (
|
|||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// NewGetAccountsObservableParams creates a new GetAccountsObservableParams object
|
||||
// with the default values initialized.
|
||||
// NewGetAccountsObservableParams creates a new GetAccountsObservableParams 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 NewGetAccountsObservableParams() *GetAccountsObservableParams {
|
||||
var ()
|
||||
return &GetAccountsObservableParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAccountsObservableParamsWithTimeout creates a new GetAccountsObservableParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetAccountsObservableParamsWithTimeout(timeout time.Duration) *GetAccountsObservableParams {
|
||||
var ()
|
||||
return &GetAccountsObservableParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAccountsObservableParamsWithContext creates a new GetAccountsObservableParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
// with the ability to set a context for a request.
|
||||
func NewGetAccountsObservableParamsWithContext(ctx context.Context) *GetAccountsObservableParams {
|
||||
var ()
|
||||
return &GetAccountsObservableParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAccountsObservableParamsWithHTTPClient creates a new GetAccountsObservableParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewGetAccountsObservableParamsWithHTTPClient(client *http.Client) *GetAccountsObservableParams {
|
||||
var ()
|
||||
return &GetAccountsObservableParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/* GetAccountsObservableParams contains all the parameters to send to the API endpoint
|
||||
for the get accounts observable operation typically these are written to a http.Request
|
||||
for the get accounts observable operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type GetAccountsObservableParams struct {
|
||||
|
||||
/*AccountID
|
||||
Taxnexus Record Id of an Account
|
||||
/* AccountID.
|
||||
|
||||
Taxnexus Record Id of an Account
|
||||
*/
|
||||
AccountID *string
|
||||
/*Active
|
||||
Only retrieve active records?
|
||||
|
||||
/* Active.
|
||||
|
||||
Only retrieve active records?
|
||||
*/
|
||||
Active *bool
|
||||
/*Email
|
||||
Email address used for identity lookup
|
||||
|
||||
/* Email.
|
||||
|
||||
Email address used for identity lookup
|
||||
*/
|
||||
Email *string
|
||||
/*Name
|
||||
The Name of this Object
|
||||
|
||||
/* Name.
|
||||
|
||||
The Name of this Object
|
||||
*/
|
||||
Name *string
|
||||
|
||||
|
@ -91,6 +93,21 @@ type GetAccountsObservableParams struct {
|
|||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the get accounts observable params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetAccountsObservableParams) WithDefaults() *GetAccountsObservableParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the get accounts observable params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetAccountsObservableParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get accounts observable params
|
||||
func (o *GetAccountsObservableParams) WithTimeout(timeout time.Duration) *GetAccountsObservableParams {
|
||||
o.SetTimeout(timeout)
|
||||
|
@ -180,64 +197,68 @@ func (o *GetAccountsObservableParams) WriteToRequest(r runtime.ClientRequest, re
|
|||
|
||||
// query param accountId
|
||||
var qrAccountID string
|
||||
|
||||
if o.AccountID != nil {
|
||||
qrAccountID = *o.AccountID
|
||||
}
|
||||
qAccountID := qrAccountID
|
||||
if qAccountID != "" {
|
||||
|
||||
if err := r.SetQueryParam("accountId", qAccountID); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if o.Active != nil {
|
||||
|
||||
// query param active
|
||||
var qrActive bool
|
||||
|
||||
if o.Active != nil {
|
||||
qrActive = *o.Active
|
||||
}
|
||||
qActive := swag.FormatBool(qrActive)
|
||||
if qActive != "" {
|
||||
|
||||
if err := r.SetQueryParam("active", qActive); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if o.Email != nil {
|
||||
|
||||
// query param email
|
||||
var qrEmail string
|
||||
|
||||
if o.Email != nil {
|
||||
qrEmail = *o.Email
|
||||
}
|
||||
qEmail := qrEmail
|
||||
if qEmail != "" {
|
||||
|
||||
if err := r.SetQueryParam("email", qEmail); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if o.Name != nil {
|
||||
|
||||
// query param name
|
||||
var qrName string
|
||||
|
||||
if o.Name != nil {
|
||||
qrName = *o.Name
|
||||
}
|
||||
qName := qrName
|
||||
if qName != "" {
|
||||
|
||||
if err := r.SetQueryParam("name", qName); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
|
|
|
@ -63,9 +63,8 @@ func (o *GetAccountsObservableReader) ReadResponse(response runtime.ClientRespon
|
|||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -74,13 +73,12 @@ func NewGetAccountsObservableOK() *GetAccountsObservableOK {
|
|||
return &GetAccountsObservableOK{}
|
||||
}
|
||||
|
||||
/*GetAccountsObservableOK handles this case with default header values.
|
||||
/* GetAccountsObservableOK describes a response with status code 200, with default header values.
|
||||
|
||||
Taxnexus Response with an array of Account objects
|
||||
*/
|
||||
type GetAccountsObservableOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
CacheControl string
|
||||
|
||||
Payload []*crm_models.Account
|
||||
|
@ -89,18 +87,25 @@ type GetAccountsObservableOK struct {
|
|||
func (o *GetAccountsObservableOK) Error() string {
|
||||
return fmt.Sprintf("[GET /accounts/observable][%d] getAccountsObservableOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAccountsObservableOK) GetPayload() []*crm_models.Account {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAccountsObservableOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// hydrates response header Access-Control-Allow-Origin
|
||||
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
// response header Cache-Control
|
||||
o.CacheControl = response.GetHeader("Cache-Control")
|
||||
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 {
|
||||
|
@ -115,7 +120,7 @@ func NewGetAccountsObservableUnauthorized() *GetAccountsObservableUnauthorized {
|
|||
return &GetAccountsObservableUnauthorized{}
|
||||
}
|
||||
|
||||
/*GetAccountsObservableUnauthorized handles this case with default header values.
|
||||
/* GetAccountsObservableUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
|
@ -128,15 +133,18 @@ type GetAccountsObservableUnauthorized struct {
|
|||
func (o *GetAccountsObservableUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /accounts/observable][%d] getAccountsObservableUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAccountsObservableUnauthorized) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAccountsObservableUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -153,7 +161,7 @@ func NewGetAccountsObservableForbidden() *GetAccountsObservableForbidden {
|
|||
return &GetAccountsObservableForbidden{}
|
||||
}
|
||||
|
||||
/*GetAccountsObservableForbidden handles this case with default header values.
|
||||
/* GetAccountsObservableForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
|
@ -166,15 +174,18 @@ type GetAccountsObservableForbidden struct {
|
|||
func (o *GetAccountsObservableForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /accounts/observable][%d] getAccountsObservableForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAccountsObservableForbidden) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAccountsObservableForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -191,7 +202,7 @@ func NewGetAccountsObservableNotFound() *GetAccountsObservableNotFound {
|
|||
return &GetAccountsObservableNotFound{}
|
||||
}
|
||||
|
||||
/*GetAccountsObservableNotFound handles this case with default header values.
|
||||
/* GetAccountsObservableNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
|
@ -204,15 +215,18 @@ type GetAccountsObservableNotFound struct {
|
|||
func (o *GetAccountsObservableNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /accounts/observable][%d] getAccountsObservableNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAccountsObservableNotFound) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAccountsObservableNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -229,7 +243,7 @@ func NewGetAccountsObservableUnprocessableEntity() *GetAccountsObservableUnproce
|
|||
return &GetAccountsObservableUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*GetAccountsObservableUnprocessableEntity handles this case with default header values.
|
||||
/* GetAccountsObservableUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
|
@ -242,15 +256,18 @@ type GetAccountsObservableUnprocessableEntity struct {
|
|||
func (o *GetAccountsObservableUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[GET /accounts/observable][%d] getAccountsObservableUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAccountsObservableUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAccountsObservableUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -267,7 +284,7 @@ func NewGetAccountsObservableInternalServerError() *GetAccountsObservableInterna
|
|||
return &GetAccountsObservableInternalServerError{}
|
||||
}
|
||||
|
||||
/*GetAccountsObservableInternalServerError handles this case with default header values.
|
||||
/* GetAccountsObservableInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
|
@ -280,15 +297,18 @@ type GetAccountsObservableInternalServerError struct {
|
|||
func (o *GetAccountsObservableInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /accounts/observable][%d] getAccountsObservableInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAccountsObservableInternalServerError) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAccountsObservableInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
|
|
@ -21,78 +21,86 @@ import (
|
|||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// NewGetAccountsParams creates a new GetAccountsParams object
|
||||
// with the default values initialized.
|
||||
// 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 {
|
||||
var ()
|
||||
return &GetAccountsParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAccountsParamsWithTimeout creates a new GetAccountsParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetAccountsParamsWithTimeout(timeout time.Duration) *GetAccountsParams {
|
||||
var ()
|
||||
return &GetAccountsParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAccountsParamsWithContext creates a new GetAccountsParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
// with the ability to set a context for a request.
|
||||
func NewGetAccountsParamsWithContext(ctx context.Context) *GetAccountsParams {
|
||||
var ()
|
||||
return &GetAccountsParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAccountsParamsWithHTTPClient creates a new GetAccountsParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewGetAccountsParamsWithHTTPClient(client *http.Client) *GetAccountsParams {
|
||||
var ()
|
||||
return &GetAccountsParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/* GetAccountsParams contains all the parameters to send to the API endpoint
|
||||
for the get accounts operation typically these are written to a http.Request
|
||||
for the get accounts operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type GetAccountsParams struct {
|
||||
|
||||
/*AccountID
|
||||
Taxnexus Record Id of an Account
|
||||
/* AccountID.
|
||||
|
||||
Taxnexus Record Id of an Account
|
||||
*/
|
||||
AccountID *string
|
||||
/*Active
|
||||
Only retrieve active records?
|
||||
|
||||
/* Active.
|
||||
|
||||
Only retrieve active records?
|
||||
*/
|
||||
Active *bool
|
||||
/*Email
|
||||
Email address used for identity lookup
|
||||
|
||||
/* Email.
|
||||
|
||||
Email address used for identity lookup
|
||||
*/
|
||||
Email *string
|
||||
/*Limit
|
||||
|
||||
/* Limit.
|
||||
|
||||
How many objects to return at one time
|
||||
|
||||
Format: int64
|
||||
*/
|
||||
Limit *int64
|
||||
/*Name
|
||||
The Name of this Object
|
||||
|
||||
/* Name.
|
||||
|
||||
The Name of this Object
|
||||
*/
|
||||
Name *string
|
||||
/*Offset
|
||||
|
||||
/* Offset.
|
||||
|
||||
How many objects to skip?
|
||||
|
||||
Format: int64
|
||||
*/
|
||||
Offset *int64
|
||||
|
||||
|
@ -101,6 +109,21 @@ type GetAccountsParams struct {
|
|||
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)
|
||||
|
@ -212,96 +235,102 @@ func (o *GetAccountsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R
|
|||
|
||||
// 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 {
|
||||
|
|
|
@ -63,9 +63,8 @@ func (o *GetAccountsReader) ReadResponse(response runtime.ClientResponse, consum
|
|||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -74,13 +73,12 @@ func NewGetAccountsOK() *GetAccountsOK {
|
|||
return &GetAccountsOK{}
|
||||
}
|
||||
|
||||
/*GetAccountsOK handles this case with default header values.
|
||||
/* 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 *crm_models.AccountResponse
|
||||
|
@ -89,18 +87,25 @@ type GetAccountsOK struct {
|
|||
func (o *GetAccountsOK) Error() string {
|
||||
return fmt.Sprintf("[GET /accounts][%d] getAccountsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAccountsOK) GetPayload() *crm_models.AccountResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAccountsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// hydrates response header Access-Control-Allow-Origin
|
||||
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
// response header Cache-Control
|
||||
o.CacheControl = response.GetHeader("Cache-Control")
|
||||
if hdrAccessControlAllowOrigin != "" {
|
||||
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
|
||||
}
|
||||
|
||||
// hydrates response header Cache-Control
|
||||
hdrCacheControl := response.GetHeader("Cache-Control")
|
||||
|
||||
if hdrCacheControl != "" {
|
||||
o.CacheControl = hdrCacheControl
|
||||
}
|
||||
|
||||
o.Payload = new(crm_models.AccountResponse)
|
||||
|
||||
|
@ -117,7 +122,7 @@ func NewGetAccountsUnauthorized() *GetAccountsUnauthorized {
|
|||
return &GetAccountsUnauthorized{}
|
||||
}
|
||||
|
||||
/*GetAccountsUnauthorized handles this case with default header values.
|
||||
/* GetAccountsUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
|
@ -130,15 +135,18 @@ type GetAccountsUnauthorized struct {
|
|||
func (o *GetAccountsUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /accounts][%d] getAccountsUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAccountsUnauthorized) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAccountsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -155,7 +163,7 @@ func NewGetAccountsForbidden() *GetAccountsForbidden {
|
|||
return &GetAccountsForbidden{}
|
||||
}
|
||||
|
||||
/*GetAccountsForbidden handles this case with default header values.
|
||||
/* GetAccountsForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
|
@ -168,15 +176,18 @@ type GetAccountsForbidden struct {
|
|||
func (o *GetAccountsForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /accounts][%d] getAccountsForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAccountsForbidden) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAccountsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -193,7 +204,7 @@ func NewGetAccountsNotFound() *GetAccountsNotFound {
|
|||
return &GetAccountsNotFound{}
|
||||
}
|
||||
|
||||
/*GetAccountsNotFound handles this case with default header values.
|
||||
/* GetAccountsNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
|
@ -206,15 +217,18 @@ type GetAccountsNotFound struct {
|
|||
func (o *GetAccountsNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /accounts][%d] getAccountsNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAccountsNotFound) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAccountsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -231,7 +245,7 @@ func NewGetAccountsUnprocessableEntity() *GetAccountsUnprocessableEntity {
|
|||
return &GetAccountsUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*GetAccountsUnprocessableEntity handles this case with default header values.
|
||||
/* GetAccountsUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
|
@ -244,15 +258,18 @@ type GetAccountsUnprocessableEntity struct {
|
|||
func (o *GetAccountsUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[GET /accounts][%d] getAccountsUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAccountsUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAccountsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -269,7 +286,7 @@ func NewGetAccountsInternalServerError() *GetAccountsInternalServerError {
|
|||
return &GetAccountsInternalServerError{}
|
||||
}
|
||||
|
||||
/*GetAccountsInternalServerError handles this case with default header values.
|
||||
/* GetAccountsInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
|
@ -282,15 +299,18 @@ type GetAccountsInternalServerError struct {
|
|||
func (o *GetAccountsInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /accounts][%d] getAccountsInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAccountsInternalServerError) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAccountsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
|
|
@ -22,53 +22,52 @@ import (
|
|||
"code.tnxs.net/taxnexus/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// NewPostAccountsParams creates a new PostAccountsParams object
|
||||
// with the default values initialized.
|
||||
// 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 {
|
||||
var ()
|
||||
return &PostAccountsParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAccountsParamsWithTimeout creates a new PostAccountsParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPostAccountsParamsWithTimeout(timeout time.Duration) *PostAccountsParams {
|
||||
var ()
|
||||
return &PostAccountsParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAccountsParamsWithContext creates a new PostAccountsParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
// with the ability to set a context for a request.
|
||||
func NewPostAccountsParamsWithContext(ctx context.Context) *PostAccountsParams {
|
||||
var ()
|
||||
return &PostAccountsParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAccountsParamsWithHTTPClient creates a new PostAccountsParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPostAccountsParamsWithHTTPClient(client *http.Client) *PostAccountsParams {
|
||||
var ()
|
||||
return &PostAccountsParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/* PostAccountsParams contains all the parameters to send to the API endpoint
|
||||
for the post accounts operation typically these are written to a http.Request
|
||||
for the post accounts operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PostAccountsParams struct {
|
||||
|
||||
/*AccountRequest
|
||||
An array of new Account records
|
||||
/* AccountRequest.
|
||||
|
||||
An array of new Account records
|
||||
*/
|
||||
AccountRequest *crm_models.AccountRequest
|
||||
|
||||
|
@ -77,6 +76,21 @@ type PostAccountsParams struct {
|
|||
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)
|
||||
|
@ -128,7 +142,6 @@ func (o *PostAccountsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.
|
|||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if o.AccountRequest != nil {
|
||||
if err := r.SetBodyParam(o.AccountRequest); err != nil {
|
||||
return err
|
||||
|
|
|
@ -63,9 +63,8 @@ func (o *PostAccountsReader) ReadResponse(response runtime.ClientResponse, consu
|
|||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -74,13 +73,12 @@ func NewPostAccountsOK() *PostAccountsOK {
|
|||
return &PostAccountsOK{}
|
||||
}
|
||||
|
||||
/*PostAccountsOK handles this case with default header values.
|
||||
/* PostAccountsOK describes a response with status code 200, with default header values.
|
||||
|
||||
Taxnexus Response with Account objects with Contacts
|
||||
*/
|
||||
type PostAccountsOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
CacheControl string
|
||||
|
||||
Payload *crm_models.AccountResponse
|
||||
|
@ -89,18 +87,25 @@ type PostAccountsOK struct {
|
|||
func (o *PostAccountsOK) Error() string {
|
||||
return fmt.Sprintf("[POST /accounts][%d] postAccountsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostAccountsOK) GetPayload() *crm_models.AccountResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostAccountsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// hydrates response header Access-Control-Allow-Origin
|
||||
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
// response header Cache-Control
|
||||
o.CacheControl = response.GetHeader("Cache-Control")
|
||||
if hdrAccessControlAllowOrigin != "" {
|
||||
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
|
||||
}
|
||||
|
||||
// hydrates response header Cache-Control
|
||||
hdrCacheControl := response.GetHeader("Cache-Control")
|
||||
|
||||
if hdrCacheControl != "" {
|
||||
o.CacheControl = hdrCacheControl
|
||||
}
|
||||
|
||||
o.Payload = new(crm_models.AccountResponse)
|
||||
|
||||
|
@ -117,7 +122,7 @@ func NewPostAccountsUnauthorized() *PostAccountsUnauthorized {
|
|||
return &PostAccountsUnauthorized{}
|
||||
}
|
||||
|
||||
/*PostAccountsUnauthorized handles this case with default header values.
|
||||
/* PostAccountsUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
|
@ -130,15 +135,18 @@ type PostAccountsUnauthorized struct {
|
|||
func (o *PostAccountsUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[POST /accounts][%d] postAccountsUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostAccountsUnauthorized) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostAccountsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -155,7 +163,7 @@ func NewPostAccountsForbidden() *PostAccountsForbidden {
|
|||
return &PostAccountsForbidden{}
|
||||
}
|
||||
|
||||
/*PostAccountsForbidden handles this case with default header values.
|
||||
/* PostAccountsForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
|
@ -168,15 +176,18 @@ type PostAccountsForbidden struct {
|
|||
func (o *PostAccountsForbidden) Error() string {
|
||||
return fmt.Sprintf("[POST /accounts][%d] postAccountsForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostAccountsForbidden) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostAccountsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -193,7 +204,7 @@ func NewPostAccountsNotFound() *PostAccountsNotFound {
|
|||
return &PostAccountsNotFound{}
|
||||
}
|
||||
|
||||
/*PostAccountsNotFound handles this case with default header values.
|
||||
/* PostAccountsNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
|
@ -206,15 +217,18 @@ type PostAccountsNotFound struct {
|
|||
func (o *PostAccountsNotFound) Error() string {
|
||||
return fmt.Sprintf("[POST /accounts][%d] postAccountsNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostAccountsNotFound) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostAccountsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -231,7 +245,7 @@ func NewPostAccountsUnprocessableEntity() *PostAccountsUnprocessableEntity {
|
|||
return &PostAccountsUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*PostAccountsUnprocessableEntity handles this case with default header values.
|
||||
/* PostAccountsUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
|
@ -244,15 +258,18 @@ type PostAccountsUnprocessableEntity struct {
|
|||
func (o *PostAccountsUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[POST /accounts][%d] postAccountsUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostAccountsUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostAccountsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -269,7 +286,7 @@ func NewPostAccountsInternalServerError() *PostAccountsInternalServerError {
|
|||
return &PostAccountsInternalServerError{}
|
||||
}
|
||||
|
||||
/*PostAccountsInternalServerError handles this case with default header values.
|
||||
/* PostAccountsInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
|
@ -282,15 +299,18 @@ type PostAccountsInternalServerError struct {
|
|||
func (o *PostAccountsInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[POST /accounts][%d] postAccountsInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostAccountsInternalServerError) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostAccountsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
|
|
@ -22,53 +22,52 @@ import (
|
|||
"code.tnxs.net/taxnexus/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// NewPutAccountParams creates a new PutAccountParams object
|
||||
// with the default values initialized.
|
||||
// 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 {
|
||||
var ()
|
||||
return &PutAccountParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPutAccountParamsWithTimeout creates a new PutAccountParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPutAccountParamsWithTimeout(timeout time.Duration) *PutAccountParams {
|
||||
var ()
|
||||
return &PutAccountParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPutAccountParamsWithContext creates a new PutAccountParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
// with the ability to set a context for a request.
|
||||
func NewPutAccountParamsWithContext(ctx context.Context) *PutAccountParams {
|
||||
var ()
|
||||
return &PutAccountParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPutAccountParamsWithHTTPClient creates a new PutAccountParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPutAccountParamsWithHTTPClient(client *http.Client) *PutAccountParams {
|
||||
var ()
|
||||
return &PutAccountParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/* PutAccountParams contains all the parameters to send to the API endpoint
|
||||
for the put account operation typically these are written to a http.Request
|
||||
for the put account operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PutAccountParams struct {
|
||||
|
||||
/*AccountRequest
|
||||
An array of new Account records
|
||||
/* AccountRequest.
|
||||
|
||||
An array of new Account records
|
||||
*/
|
||||
AccountRequest *crm_models.AccountRequest
|
||||
|
||||
|
@ -77,6 +76,21 @@ type PutAccountParams struct {
|
|||
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)
|
||||
|
@ -128,7 +142,6 @@ func (o *PutAccountParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Re
|
|||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if o.AccountRequest != nil {
|
||||
if err := r.SetBodyParam(o.AccountRequest); err != nil {
|
||||
return err
|
||||
|
|
|
@ -63,9 +63,8 @@ func (o *PutAccountReader) ReadResponse(response runtime.ClientResponse, consume
|
|||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -74,13 +73,12 @@ func NewPutAccountOK() *PutAccountOK {
|
|||
return &PutAccountOK{}
|
||||
}
|
||||
|
||||
/*PutAccountOK handles this case with default header values.
|
||||
/* 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 *crm_models.AccountResponse
|
||||
|
@ -89,18 +87,25 @@ type PutAccountOK struct {
|
|||
func (o *PutAccountOK) Error() string {
|
||||
return fmt.Sprintf("[PUT /accounts][%d] putAccountOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutAccountOK) GetPayload() *crm_models.AccountResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutAccountOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// hydrates response header Access-Control-Allow-Origin
|
||||
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
// response header Cache-Control
|
||||
o.CacheControl = response.GetHeader("Cache-Control")
|
||||
if hdrAccessControlAllowOrigin != "" {
|
||||
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
|
||||
}
|
||||
|
||||
// hydrates response header Cache-Control
|
||||
hdrCacheControl := response.GetHeader("Cache-Control")
|
||||
|
||||
if hdrCacheControl != "" {
|
||||
o.CacheControl = hdrCacheControl
|
||||
}
|
||||
|
||||
o.Payload = new(crm_models.AccountResponse)
|
||||
|
||||
|
@ -117,7 +122,7 @@ func NewPutAccountUnauthorized() *PutAccountUnauthorized {
|
|||
return &PutAccountUnauthorized{}
|
||||
}
|
||||
|
||||
/*PutAccountUnauthorized handles this case with default header values.
|
||||
/* PutAccountUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
|
@ -130,15 +135,18 @@ type PutAccountUnauthorized struct {
|
|||
func (o *PutAccountUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[PUT /accounts][%d] putAccountUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutAccountUnauthorized) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutAccountUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -155,7 +163,7 @@ func NewPutAccountForbidden() *PutAccountForbidden {
|
|||
return &PutAccountForbidden{}
|
||||
}
|
||||
|
||||
/*PutAccountForbidden handles this case with default header values.
|
||||
/* PutAccountForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
|
@ -168,15 +176,18 @@ type PutAccountForbidden struct {
|
|||
func (o *PutAccountForbidden) Error() string {
|
||||
return fmt.Sprintf("[PUT /accounts][%d] putAccountForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutAccountForbidden) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutAccountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -193,7 +204,7 @@ func NewPutAccountNotFound() *PutAccountNotFound {
|
|||
return &PutAccountNotFound{}
|
||||
}
|
||||
|
||||
/*PutAccountNotFound handles this case with default header values.
|
||||
/* PutAccountNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
|
@ -206,15 +217,18 @@ type PutAccountNotFound struct {
|
|||
func (o *PutAccountNotFound) Error() string {
|
||||
return fmt.Sprintf("[PUT /accounts][%d] putAccountNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutAccountNotFound) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutAccountNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -231,7 +245,7 @@ func NewPutAccountUnprocessableEntity() *PutAccountUnprocessableEntity {
|
|||
return &PutAccountUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*PutAccountUnprocessableEntity handles this case with default header values.
|
||||
/* PutAccountUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
|
@ -244,15 +258,18 @@ type PutAccountUnprocessableEntity struct {
|
|||
func (o *PutAccountUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[PUT /accounts][%d] putAccountUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutAccountUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutAccountUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -269,7 +286,7 @@ func NewPutAccountInternalServerError() *PutAccountInternalServerError {
|
|||
return &PutAccountInternalServerError{}
|
||||
}
|
||||
|
||||
/*PutAccountInternalServerError handles this case with default header values.
|
||||
/* PutAccountInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
|
@ -282,15 +299,18 @@ type PutAccountInternalServerError struct {
|
|||
func (o *PutAccountInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[PUT /accounts][%d] putAccountInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutAccountInternalServerError) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutAccountInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
|
|
@ -29,13 +29,16 @@ type Client struct {
|
|||
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 {
|
||||
GetCompanies(params *GetCompaniesParams, authInfo runtime.ClientAuthInfoWriter) (*GetCompaniesOK, error)
|
||||
GetCompanies(params *GetCompaniesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCompaniesOK, error)
|
||||
|
||||
GetCompaniesObservable(params *GetCompaniesObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetCompaniesObservableOK, error)
|
||||
GetCompaniesObservable(params *GetCompaniesObservableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCompaniesObservableOK, error)
|
||||
|
||||
PostCompanies(params *PostCompaniesParams, authInfo runtime.ClientAuthInfoWriter) (*PostCompaniesOK, error)
|
||||
PostCompanies(params *PostCompaniesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostCompaniesOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
@ -45,13 +48,12 @@ type ClientService interface {
|
|||
|
||||
Retrieve Company records from the datastore
|
||||
*/
|
||||
func (a *Client) GetCompanies(params *GetCompaniesParams, authInfo runtime.ClientAuthInfoWriter) (*GetCompaniesOK, error) {
|
||||
func (a *Client) GetCompanies(params *GetCompaniesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCompaniesOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetCompaniesParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "getCompanies",
|
||||
Method: "GET",
|
||||
PathPattern: "/companies",
|
||||
|
@ -63,7 +65,12 @@ func (a *Client) GetCompanies(params *GetCompaniesParams, authInfo runtime.Clien
|
|||
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
|
||||
}
|
||||
|
@ -82,13 +89,12 @@ func (a *Client) GetCompanies(params *GetCompaniesParams, authInfo runtime.Clien
|
|||
|
||||
A list of companies in a simple JSON array
|
||||
*/
|
||||
func (a *Client) GetCompaniesObservable(params *GetCompaniesObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetCompaniesObservableOK, error) {
|
||||
func (a *Client) GetCompaniesObservable(params *GetCompaniesObservableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCompaniesObservableOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetCompaniesObservableParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "getCompaniesObservable",
|
||||
Method: "GET",
|
||||
PathPattern: "/companies/observable",
|
||||
|
@ -100,7 +106,12 @@ func (a *Client) GetCompaniesObservable(params *GetCompaniesObservableParams, au
|
|||
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
|
||||
}
|
||||
|
@ -119,13 +130,12 @@ func (a *Client) GetCompaniesObservable(params *GetCompaniesObservableParams, au
|
|||
|
||||
Add new companies
|
||||
*/
|
||||
func (a *Client) PostCompanies(params *PostCompaniesParams, authInfo runtime.ClientAuthInfoWriter) (*PostCompaniesOK, error) {
|
||||
func (a *Client) PostCompanies(params *PostCompaniesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostCompaniesOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPostCompaniesParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "postCompanies",
|
||||
Method: "POST",
|
||||
PathPattern: "/companies",
|
||||
|
@ -137,7 +147,12 @@ func (a *Client) PostCompanies(params *PostCompaniesParams, authInfo runtime.Cli
|
|||
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
|
||||
}
|
||||
|
|
|
@ -20,53 +20,52 @@ import (
|
|||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// NewGetCompaniesObservableParams creates a new GetCompaniesObservableParams object
|
||||
// with the default values initialized.
|
||||
// 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 {
|
||||
var ()
|
||||
return &GetCompaniesObservableParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetCompaniesObservableParamsWithTimeout creates a new GetCompaniesObservableParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetCompaniesObservableParamsWithTimeout(timeout time.Duration) *GetCompaniesObservableParams {
|
||||
var ()
|
||||
return &GetCompaniesObservableParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetCompaniesObservableParamsWithContext creates a new GetCompaniesObservableParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
// with the ability to set a context for a request.
|
||||
func NewGetCompaniesObservableParamsWithContext(ctx context.Context) *GetCompaniesObservableParams {
|
||||
var ()
|
||||
return &GetCompaniesObservableParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetCompaniesObservableParamsWithHTTPClient creates a new GetCompaniesObservableParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewGetCompaniesObservableParamsWithHTTPClient(client *http.Client) *GetCompaniesObservableParams {
|
||||
var ()
|
||||
return &GetCompaniesObservableParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/* GetCompaniesObservableParams contains all the parameters to send to the API endpoint
|
||||
for the get companies observable operation typically these are written to a http.Request
|
||||
for the get companies observable operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type GetCompaniesObservableParams struct {
|
||||
|
||||
/*CompanyID
|
||||
Taxnexus Company record ID
|
||||
/* CompanyID.
|
||||
|
||||
Taxnexus Company record ID
|
||||
*/
|
||||
CompanyID *string
|
||||
|
||||
|
@ -75,6 +74,21 @@ type GetCompaniesObservableParams struct {
|
|||
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)
|
||||
|
@ -131,16 +145,17 @@ func (o *GetCompaniesObservableParams) WriteToRequest(r runtime.ClientRequest, r
|
|||
|
||||
// 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 {
|
||||
|
|
|
@ -63,9 +63,8 @@ func (o *GetCompaniesObservableReader) ReadResponse(response runtime.ClientRespo
|
|||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -74,13 +73,12 @@ func NewGetCompaniesObservableOK() *GetCompaniesObservableOK {
|
|||
return &GetCompaniesObservableOK{}
|
||||
}
|
||||
|
||||
/*GetCompaniesObservableOK handles this case with default header values.
|
||||
/* 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
|
||||
|
@ -89,18 +87,25 @@ type GetCompaniesObservableOK struct {
|
|||
func (o *GetCompaniesObservableOK) Error() string {
|
||||
return fmt.Sprintf("[GET /companies/observable][%d] getCompaniesObservableOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCompaniesObservableOK) GetPayload() []*crm_models.Company {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCompaniesObservableOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// hydrates response header Access-Control-Allow-Origin
|
||||
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
// response header Cache-Control
|
||||
o.CacheControl = response.GetHeader("Cache-Control")
|
||||
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 {
|
||||
|
@ -115,7 +120,7 @@ func NewGetCompaniesObservableUnauthorized() *GetCompaniesObservableUnauthorized
|
|||
return &GetCompaniesObservableUnauthorized{}
|
||||
}
|
||||
|
||||
/*GetCompaniesObservableUnauthorized handles this case with default header values.
|
||||
/* GetCompaniesObservableUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
|
@ -128,15 +133,18 @@ type GetCompaniesObservableUnauthorized struct {
|
|||
func (o *GetCompaniesObservableUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /companies/observable][%d] getCompaniesObservableUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCompaniesObservableUnauthorized) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCompaniesObservableUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -153,7 +161,7 @@ func NewGetCompaniesObservableForbidden() *GetCompaniesObservableForbidden {
|
|||
return &GetCompaniesObservableForbidden{}
|
||||
}
|
||||
|
||||
/*GetCompaniesObservableForbidden handles this case with default header values.
|
||||
/* GetCompaniesObservableForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
|
@ -166,15 +174,18 @@ type GetCompaniesObservableForbidden struct {
|
|||
func (o *GetCompaniesObservableForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /companies/observable][%d] getCompaniesObservableForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCompaniesObservableForbidden) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCompaniesObservableForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -191,7 +202,7 @@ func NewGetCompaniesObservableNotFound() *GetCompaniesObservableNotFound {
|
|||
return &GetCompaniesObservableNotFound{}
|
||||
}
|
||||
|
||||
/*GetCompaniesObservableNotFound handles this case with default header values.
|
||||
/* GetCompaniesObservableNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
|
@ -204,15 +215,18 @@ type GetCompaniesObservableNotFound struct {
|
|||
func (o *GetCompaniesObservableNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /companies/observable][%d] getCompaniesObservableNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCompaniesObservableNotFound) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCompaniesObservableNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -229,7 +243,7 @@ func NewGetCompaniesObservableUnprocessableEntity() *GetCompaniesObservableUnpro
|
|||
return &GetCompaniesObservableUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*GetCompaniesObservableUnprocessableEntity handles this case with default header values.
|
||||
/* GetCompaniesObservableUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
|
@ -242,15 +256,18 @@ type GetCompaniesObservableUnprocessableEntity struct {
|
|||
func (o *GetCompaniesObservableUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[GET /companies/observable][%d] getCompaniesObservableUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCompaniesObservableUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCompaniesObservableUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -267,7 +284,7 @@ func NewGetCompaniesObservableInternalServerError() *GetCompaniesObservableInter
|
|||
return &GetCompaniesObservableInternalServerError{}
|
||||
}
|
||||
|
||||
/*GetCompaniesObservableInternalServerError handles this case with default header values.
|
||||
/* GetCompaniesObservableInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
|
@ -280,15 +297,18 @@ type GetCompaniesObservableInternalServerError struct {
|
|||
func (o *GetCompaniesObservableInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /companies/observable][%d] getCompaniesObservableInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCompaniesObservableInternalServerError) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCompaniesObservableInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
|
|
@ -20,53 +20,52 @@ import (
|
|||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// NewGetCompaniesParams creates a new GetCompaniesParams object
|
||||
// with the default values initialized.
|
||||
// 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 {
|
||||
var ()
|
||||
return &GetCompaniesParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetCompaniesParamsWithTimeout creates a new GetCompaniesParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetCompaniesParamsWithTimeout(timeout time.Duration) *GetCompaniesParams {
|
||||
var ()
|
||||
return &GetCompaniesParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetCompaniesParamsWithContext creates a new GetCompaniesParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
// with the ability to set a context for a request.
|
||||
func NewGetCompaniesParamsWithContext(ctx context.Context) *GetCompaniesParams {
|
||||
var ()
|
||||
return &GetCompaniesParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetCompaniesParamsWithHTTPClient creates a new GetCompaniesParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewGetCompaniesParamsWithHTTPClient(client *http.Client) *GetCompaniesParams {
|
||||
var ()
|
||||
return &GetCompaniesParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/* GetCompaniesParams contains all the parameters to send to the API endpoint
|
||||
for the get companies operation typically these are written to a http.Request
|
||||
for the get companies operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type GetCompaniesParams struct {
|
||||
|
||||
/*CompanyID
|
||||
Taxnexus Company record ID
|
||||
/* CompanyID.
|
||||
|
||||
Taxnexus Company record ID
|
||||
*/
|
||||
CompanyID *string
|
||||
|
||||
|
@ -75,6 +74,21 @@ type GetCompaniesParams struct {
|
|||
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)
|
||||
|
@ -131,16 +145,17 @@ func (o *GetCompaniesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.
|
|||
|
||||
// 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 {
|
||||
|
|
|
@ -63,9 +63,8 @@ func (o *GetCompaniesReader) ReadResponse(response runtime.ClientResponse, consu
|
|||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -74,13 +73,12 @@ func NewGetCompaniesOK() *GetCompaniesOK {
|
|||
return &GetCompaniesOK{}
|
||||
}
|
||||
|
||||
/*GetCompaniesOK handles this case with default header values.
|
||||
/* GetCompaniesOK describes a response with status code 200, with default header values.
|
||||
|
||||
Taxnexus Response with Company objects
|
||||
*/
|
||||
type GetCompaniesOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
CacheControl string
|
||||
|
||||
Payload *crm_models.CompanyResponse
|
||||
|
@ -89,18 +87,25 @@ type GetCompaniesOK struct {
|
|||
func (o *GetCompaniesOK) Error() string {
|
||||
return fmt.Sprintf("[GET /companies][%d] getCompaniesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCompaniesOK) GetPayload() *crm_models.CompanyResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCompaniesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// hydrates response header Access-Control-Allow-Origin
|
||||
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
// response header Cache-Control
|
||||
o.CacheControl = response.GetHeader("Cache-Control")
|
||||
if hdrAccessControlAllowOrigin != "" {
|
||||
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
|
||||
}
|
||||
|
||||
// hydrates response header Cache-Control
|
||||
hdrCacheControl := response.GetHeader("Cache-Control")
|
||||
|
||||
if hdrCacheControl != "" {
|
||||
o.CacheControl = hdrCacheControl
|
||||
}
|
||||
|
||||
o.Payload = new(crm_models.CompanyResponse)
|
||||
|
||||
|
@ -117,7 +122,7 @@ func NewGetCompaniesUnauthorized() *GetCompaniesUnauthorized {
|
|||
return &GetCompaniesUnauthorized{}
|
||||
}
|
||||
|
||||
/*GetCompaniesUnauthorized handles this case with default header values.
|
||||
/* GetCompaniesUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
|
@ -130,15 +135,18 @@ type GetCompaniesUnauthorized struct {
|
|||
func (o *GetCompaniesUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /companies][%d] getCompaniesUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCompaniesUnauthorized) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCompaniesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -155,7 +163,7 @@ func NewGetCompaniesForbidden() *GetCompaniesForbidden {
|
|||
return &GetCompaniesForbidden{}
|
||||
}
|
||||
|
||||
/*GetCompaniesForbidden handles this case with default header values.
|
||||
/* GetCompaniesForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
|
@ -168,15 +176,18 @@ type GetCompaniesForbidden struct {
|
|||
func (o *GetCompaniesForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /companies][%d] getCompaniesForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCompaniesForbidden) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCompaniesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -193,7 +204,7 @@ func NewGetCompaniesNotFound() *GetCompaniesNotFound {
|
|||
return &GetCompaniesNotFound{}
|
||||
}
|
||||
|
||||
/*GetCompaniesNotFound handles this case with default header values.
|
||||
/* GetCompaniesNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
|
@ -206,15 +217,18 @@ type GetCompaniesNotFound struct {
|
|||
func (o *GetCompaniesNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /companies][%d] getCompaniesNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCompaniesNotFound) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCompaniesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -231,7 +245,7 @@ func NewGetCompaniesUnprocessableEntity() *GetCompaniesUnprocessableEntity {
|
|||
return &GetCompaniesUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*GetCompaniesUnprocessableEntity handles this case with default header values.
|
||||
/* GetCompaniesUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
|
@ -244,15 +258,18 @@ type GetCompaniesUnprocessableEntity struct {
|
|||
func (o *GetCompaniesUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[GET /companies][%d] getCompaniesUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCompaniesUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCompaniesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -269,7 +286,7 @@ func NewGetCompaniesInternalServerError() *GetCompaniesInternalServerError {
|
|||
return &GetCompaniesInternalServerError{}
|
||||
}
|
||||
|
||||
/*GetCompaniesInternalServerError handles this case with default header values.
|
||||
/* GetCompaniesInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
|
@ -282,15 +299,18 @@ type GetCompaniesInternalServerError struct {
|
|||
func (o *GetCompaniesInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /companies][%d] getCompaniesInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCompaniesInternalServerError) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCompaniesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
|
|
@ -22,53 +22,52 @@ import (
|
|||
"code.tnxs.net/taxnexus/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// NewPostCompaniesParams creates a new PostCompaniesParams object
|
||||
// with the default values initialized.
|
||||
// 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 {
|
||||
var ()
|
||||
return &PostCompaniesParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostCompaniesParamsWithTimeout creates a new PostCompaniesParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPostCompaniesParamsWithTimeout(timeout time.Duration) *PostCompaniesParams {
|
||||
var ()
|
||||
return &PostCompaniesParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostCompaniesParamsWithContext creates a new PostCompaniesParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
// with the ability to set a context for a request.
|
||||
func NewPostCompaniesParamsWithContext(ctx context.Context) *PostCompaniesParams {
|
||||
var ()
|
||||
return &PostCompaniesParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostCompaniesParamsWithHTTPClient creates a new PostCompaniesParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPostCompaniesParamsWithHTTPClient(client *http.Client) *PostCompaniesParams {
|
||||
var ()
|
||||
return &PostCompaniesParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/* PostCompaniesParams contains all the parameters to send to the API endpoint
|
||||
for the post companies operation typically these are written to a http.Request
|
||||
for the post companies operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PostCompaniesParams struct {
|
||||
|
||||
/*CompaniesRequest
|
||||
An array of new Contact records
|
||||
/* CompaniesRequest.
|
||||
|
||||
An array of new Contact records
|
||||
*/
|
||||
CompaniesRequest *crm_models.CompanyRequest
|
||||
|
||||
|
@ -77,6 +76,21 @@ type PostCompaniesParams struct {
|
|||
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)
|
||||
|
@ -128,7 +142,6 @@ func (o *PostCompaniesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt
|
|||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if o.CompaniesRequest != nil {
|
||||
if err := r.SetBodyParam(o.CompaniesRequest); err != nil {
|
||||
return err
|
||||
|
|
|
@ -63,9 +63,8 @@ func (o *PostCompaniesReader) ReadResponse(response runtime.ClientResponse, cons
|
|||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -74,13 +73,12 @@ func NewPostCompaniesOK() *PostCompaniesOK {
|
|||
return &PostCompaniesOK{}
|
||||
}
|
||||
|
||||
/*PostCompaniesOK handles this case with default header values.
|
||||
/* PostCompaniesOK describes a response with status code 200, with default header values.
|
||||
|
||||
Taxnexus Response with Company objects
|
||||
*/
|
||||
type PostCompaniesOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
CacheControl string
|
||||
|
||||
Payload *crm_models.CompanyResponse
|
||||
|
@ -89,18 +87,25 @@ type PostCompaniesOK struct {
|
|||
func (o *PostCompaniesOK) Error() string {
|
||||
return fmt.Sprintf("[POST /companies][%d] postCompaniesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCompaniesOK) GetPayload() *crm_models.CompanyResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostCompaniesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// hydrates response header Access-Control-Allow-Origin
|
||||
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
// response header Cache-Control
|
||||
o.CacheControl = response.GetHeader("Cache-Control")
|
||||
if hdrAccessControlAllowOrigin != "" {
|
||||
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
|
||||
}
|
||||
|
||||
// hydrates response header Cache-Control
|
||||
hdrCacheControl := response.GetHeader("Cache-Control")
|
||||
|
||||
if hdrCacheControl != "" {
|
||||
o.CacheControl = hdrCacheControl
|
||||
}
|
||||
|
||||
o.Payload = new(crm_models.CompanyResponse)
|
||||
|
||||
|
@ -117,7 +122,7 @@ func NewPostCompaniesUnauthorized() *PostCompaniesUnauthorized {
|
|||
return &PostCompaniesUnauthorized{}
|
||||
}
|
||||
|
||||
/*PostCompaniesUnauthorized handles this case with default header values.
|
||||
/* PostCompaniesUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
|
@ -130,15 +135,18 @@ type PostCompaniesUnauthorized struct {
|
|||
func (o *PostCompaniesUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[POST /companies][%d] postCompaniesUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCompaniesUnauthorized) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostCompaniesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -155,7 +163,7 @@ func NewPostCompaniesForbidden() *PostCompaniesForbidden {
|
|||
return &PostCompaniesForbidden{}
|
||||
}
|
||||
|
||||
/*PostCompaniesForbidden handles this case with default header values.
|
||||
/* PostCompaniesForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
|
@ -168,15 +176,18 @@ type PostCompaniesForbidden struct {
|
|||
func (o *PostCompaniesForbidden) Error() string {
|
||||
return fmt.Sprintf("[POST /companies][%d] postCompaniesForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCompaniesForbidden) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostCompaniesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -193,7 +204,7 @@ func NewPostCompaniesNotFound() *PostCompaniesNotFound {
|
|||
return &PostCompaniesNotFound{}
|
||||
}
|
||||
|
||||
/*PostCompaniesNotFound handles this case with default header values.
|
||||
/* PostCompaniesNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
|
@ -206,15 +217,18 @@ type PostCompaniesNotFound struct {
|
|||
func (o *PostCompaniesNotFound) Error() string {
|
||||
return fmt.Sprintf("[POST /companies][%d] postCompaniesNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCompaniesNotFound) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostCompaniesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -231,7 +245,7 @@ func NewPostCompaniesUnprocessableEntity() *PostCompaniesUnprocessableEntity {
|
|||
return &PostCompaniesUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*PostCompaniesUnprocessableEntity handles this case with default header values.
|
||||
/* PostCompaniesUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
|
@ -244,15 +258,18 @@ type PostCompaniesUnprocessableEntity struct {
|
|||
func (o *PostCompaniesUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[POST /companies][%d] postCompaniesUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCompaniesUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostCompaniesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -269,7 +286,7 @@ func NewPostCompaniesInternalServerError() *PostCompaniesInternalServerError {
|
|||
return &PostCompaniesInternalServerError{}
|
||||
}
|
||||
|
||||
/*PostCompaniesInternalServerError handles this case with default header values.
|
||||
/* PostCompaniesInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
|
@ -282,15 +299,18 @@ type PostCompaniesInternalServerError struct {
|
|||
func (o *PostCompaniesInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[POST /companies][%d] postCompaniesInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCompaniesInternalServerError) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostCompaniesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
|
|
@ -29,17 +29,20 @@ type Client struct {
|
|||
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 {
|
||||
DeleteContact(params *DeleteContactParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteContactOK, error)
|
||||
DeleteContact(params *DeleteContactParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteContactOK, error)
|
||||
|
||||
GetContacts(params *GetContactsParams, authInfo runtime.ClientAuthInfoWriter) (*GetContactsOK, error)
|
||||
GetContacts(params *GetContactsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetContactsOK, error)
|
||||
|
||||
GetContactsObservable(params *GetContactsObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetContactsObservableOK, error)
|
||||
GetContactsObservable(params *GetContactsObservableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetContactsObservableOK, error)
|
||||
|
||||
PostContacts(params *PostContactsParams, authInfo runtime.ClientAuthInfoWriter) (*PostContactsOK, error)
|
||||
PostContacts(params *PostContactsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostContactsOK, error)
|
||||
|
||||
PutContacts(params *PutContactsParams, authInfo runtime.ClientAuthInfoWriter) (*PutContactsOK, error)
|
||||
PutContacts(params *PutContactsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutContactsOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
@ -49,13 +52,12 @@ type ClientService interface {
|
|||
|
||||
Delete Taxnexus Contact record
|
||||
*/
|
||||
func (a *Client) DeleteContact(params *DeleteContactParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteContactOK, error) {
|
||||
func (a *Client) DeleteContact(params *DeleteContactParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteContactOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewDeleteContactParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "deleteContact",
|
||||
Method: "DELETE",
|
||||
PathPattern: "/contacts",
|
||||
|
@ -67,7 +69,12 @@ func (a *Client) DeleteContact(params *DeleteContactParams, authInfo runtime.Cli
|
|||
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
|
||||
}
|
||||
|
@ -86,13 +93,12 @@ func (a *Client) DeleteContact(params *DeleteContactParams, authInfo runtime.Cli
|
|||
|
||||
Return a list of all available Contacts
|
||||
*/
|
||||
func (a *Client) GetContacts(params *GetContactsParams, authInfo runtime.ClientAuthInfoWriter) (*GetContactsOK, error) {
|
||||
func (a *Client) GetContacts(params *GetContactsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetContactsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetContactsParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "getContacts",
|
||||
Method: "GET",
|
||||
PathPattern: "/contacts",
|
||||
|
@ -104,7 +110,12 @@ func (a *Client) GetContacts(params *GetContactsParams, authInfo runtime.ClientA
|
|||
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
|
||||
}
|
||||
|
@ -123,13 +134,12 @@ func (a *Client) GetContacts(params *GetContactsParams, authInfo runtime.ClientA
|
|||
|
||||
A list of contacts in a simple JSON array
|
||||
*/
|
||||
func (a *Client) GetContactsObservable(params *GetContactsObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetContactsObservableOK, error) {
|
||||
func (a *Client) GetContactsObservable(params *GetContactsObservableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetContactsObservableOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetContactsObservableParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "getContactsObservable",
|
||||
Method: "GET",
|
||||
PathPattern: "/contacts/observable",
|
||||
|
@ -141,7 +151,12 @@ func (a *Client) GetContactsObservable(params *GetContactsObservableParams, auth
|
|||
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
|
||||
}
|
||||
|
@ -160,13 +175,12 @@ func (a *Client) GetContactsObservable(params *GetContactsObservableParams, auth
|
|||
|
||||
Contact record to be added
|
||||
*/
|
||||
func (a *Client) PostContacts(params *PostContactsParams, authInfo runtime.ClientAuthInfoWriter) (*PostContactsOK, error) {
|
||||
func (a *Client) PostContacts(params *PostContactsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostContactsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPostContactsParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "postContacts",
|
||||
Method: "POST",
|
||||
PathPattern: "/contacts",
|
||||
|
@ -178,7 +192,12 @@ func (a *Client) PostContacts(params *PostContactsParams, authInfo runtime.Clien
|
|||
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
|
||||
}
|
||||
|
@ -197,13 +216,12 @@ func (a *Client) PostContacts(params *PostContactsParams, authInfo runtime.Clien
|
|||
|
||||
Update Contact records
|
||||
*/
|
||||
func (a *Client) PutContacts(params *PutContactsParams, authInfo runtime.ClientAuthInfoWriter) (*PutContactsOK, error) {
|
||||
func (a *Client) PutContacts(params *PutContactsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutContactsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPutContactsParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "putContacts",
|
||||
Method: "PUT",
|
||||
PathPattern: "/contacts",
|
||||
|
@ -215,7 +233,12 @@ func (a *Client) PutContacts(params *PutContactsParams, authInfo runtime.ClientA
|
|||
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
|
||||
}
|
||||
|
|
|
@ -20,53 +20,52 @@ import (
|
|||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// NewDeleteContactParams creates a new DeleteContactParams object
|
||||
// with the default values initialized.
|
||||
// NewDeleteContactParams creates a new DeleteContactParams 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 NewDeleteContactParams() *DeleteContactParams {
|
||||
var ()
|
||||
return &DeleteContactParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteContactParamsWithTimeout creates a new DeleteContactParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewDeleteContactParamsWithTimeout(timeout time.Duration) *DeleteContactParams {
|
||||
var ()
|
||||
return &DeleteContactParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteContactParamsWithContext creates a new DeleteContactParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
// with the ability to set a context for a request.
|
||||
func NewDeleteContactParamsWithContext(ctx context.Context) *DeleteContactParams {
|
||||
var ()
|
||||
return &DeleteContactParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteContactParamsWithHTTPClient creates a new DeleteContactParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewDeleteContactParamsWithHTTPClient(client *http.Client) *DeleteContactParams {
|
||||
var ()
|
||||
return &DeleteContactParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/* DeleteContactParams contains all the parameters to send to the API endpoint
|
||||
for the delete contact operation typically these are written to a http.Request
|
||||
for the delete contact operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type DeleteContactParams struct {
|
||||
|
||||
/*ContactID
|
||||
Taxnexus Contact record ID
|
||||
/* ContactID.
|
||||
|
||||
Taxnexus Contact record ID
|
||||
*/
|
||||
ContactID *string
|
||||
|
||||
|
@ -75,6 +74,21 @@ type DeleteContactParams struct {
|
|||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the delete contact params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *DeleteContactParams) WithDefaults() *DeleteContactParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the delete contact params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *DeleteContactParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the delete contact params
|
||||
func (o *DeleteContactParams) WithTimeout(timeout time.Duration) *DeleteContactParams {
|
||||
o.SetTimeout(timeout)
|
||||
|
@ -131,16 +145,17 @@ func (o *DeleteContactParams) WriteToRequest(r runtime.ClientRequest, reg strfmt
|
|||
|
||||
// query param contactId
|
||||
var qrContactID string
|
||||
|
||||
if o.ContactID != nil {
|
||||
qrContactID = *o.ContactID
|
||||
}
|
||||
qContactID := qrContactID
|
||||
if qContactID != "" {
|
||||
|
||||
if err := r.SetQueryParam("contactId", qContactID); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
|
|
|
@ -63,9 +63,8 @@ func (o *DeleteContactReader) ReadResponse(response runtime.ClientResponse, cons
|
|||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -74,7 +73,7 @@ func NewDeleteContactOK() *DeleteContactOK {
|
|||
return &DeleteContactOK{}
|
||||
}
|
||||
|
||||
/*DeleteContactOK handles this case with default header values.
|
||||
/* DeleteContactOK describes a response with status code 200, with default header values.
|
||||
|
||||
Taxnexus Response with Message Objects with Delete Status
|
||||
*/
|
||||
|
@ -87,15 +86,18 @@ type DeleteContactOK struct {
|
|||
func (o *DeleteContactOK) Error() string {
|
||||
return fmt.Sprintf("[DELETE /contacts][%d] deleteContactOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteContactOK) GetPayload() *crm_models.DeleteResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *DeleteContactOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// hydrates response header Access-Control-Allow-Origin
|
||||
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
if hdrAccessControlAllowOrigin != "" {
|
||||
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
|
||||
}
|
||||
|
||||
o.Payload = new(crm_models.DeleteResponse)
|
||||
|
||||
|
@ -112,7 +114,7 @@ func NewDeleteContactUnauthorized() *DeleteContactUnauthorized {
|
|||
return &DeleteContactUnauthorized{}
|
||||
}
|
||||
|
||||
/*DeleteContactUnauthorized handles this case with default header values.
|
||||
/* DeleteContactUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
|
@ -125,15 +127,18 @@ type DeleteContactUnauthorized struct {
|
|||
func (o *DeleteContactUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[DELETE /contacts][%d] deleteContactUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteContactUnauthorized) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *DeleteContactUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -150,7 +155,7 @@ func NewDeleteContactForbidden() *DeleteContactForbidden {
|
|||
return &DeleteContactForbidden{}
|
||||
}
|
||||
|
||||
/*DeleteContactForbidden handles this case with default header values.
|
||||
/* DeleteContactForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
|
@ -163,15 +168,18 @@ type DeleteContactForbidden struct {
|
|||
func (o *DeleteContactForbidden) Error() string {
|
||||
return fmt.Sprintf("[DELETE /contacts][%d] deleteContactForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteContactForbidden) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *DeleteContactForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -188,7 +196,7 @@ func NewDeleteContactNotFound() *DeleteContactNotFound {
|
|||
return &DeleteContactNotFound{}
|
||||
}
|
||||
|
||||
/*DeleteContactNotFound handles this case with default header values.
|
||||
/* DeleteContactNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
|
@ -201,15 +209,18 @@ type DeleteContactNotFound struct {
|
|||
func (o *DeleteContactNotFound) Error() string {
|
||||
return fmt.Sprintf("[DELETE /contacts][%d] deleteContactNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteContactNotFound) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *DeleteContactNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -226,7 +237,7 @@ func NewDeleteContactUnprocessableEntity() *DeleteContactUnprocessableEntity {
|
|||
return &DeleteContactUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*DeleteContactUnprocessableEntity handles this case with default header values.
|
||||
/* DeleteContactUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
|
@ -239,15 +250,18 @@ type DeleteContactUnprocessableEntity struct {
|
|||
func (o *DeleteContactUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[DELETE /contacts][%d] deleteContactUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteContactUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *DeleteContactUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -264,7 +278,7 @@ func NewDeleteContactInternalServerError() *DeleteContactInternalServerError {
|
|||
return &DeleteContactInternalServerError{}
|
||||
}
|
||||
|
||||
/*DeleteContactInternalServerError handles this case with default header values.
|
||||
/* DeleteContactInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
|
@ -277,15 +291,18 @@ type DeleteContactInternalServerError struct {
|
|||
func (o *DeleteContactInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[DELETE /contacts][%d] deleteContactInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteContactInternalServerError) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *DeleteContactInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
|
|
@ -21,68 +21,70 @@ import (
|
|||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// NewGetContactsObservableParams creates a new GetContactsObservableParams object
|
||||
// with the default values initialized.
|
||||
// NewGetContactsObservableParams creates a new GetContactsObservableParams 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 NewGetContactsObservableParams() *GetContactsObservableParams {
|
||||
var ()
|
||||
return &GetContactsObservableParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetContactsObservableParamsWithTimeout creates a new GetContactsObservableParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetContactsObservableParamsWithTimeout(timeout time.Duration) *GetContactsObservableParams {
|
||||
var ()
|
||||
return &GetContactsObservableParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetContactsObservableParamsWithContext creates a new GetContactsObservableParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
// with the ability to set a context for a request.
|
||||
func NewGetContactsObservableParamsWithContext(ctx context.Context) *GetContactsObservableParams {
|
||||
var ()
|
||||
return &GetContactsObservableParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetContactsObservableParamsWithHTTPClient creates a new GetContactsObservableParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewGetContactsObservableParamsWithHTTPClient(client *http.Client) *GetContactsObservableParams {
|
||||
var ()
|
||||
return &GetContactsObservableParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/* GetContactsObservableParams contains all the parameters to send to the API endpoint
|
||||
for the get contacts observable operation typically these are written to a http.Request
|
||||
for the get contacts observable operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type GetContactsObservableParams struct {
|
||||
|
||||
/*Active
|
||||
Only retrieve active records?
|
||||
/* Active.
|
||||
|
||||
Only retrieve active records?
|
||||
*/
|
||||
Active *bool
|
||||
/*ContactID
|
||||
Taxnexus Contact record ID
|
||||
|
||||
/* ContactID.
|
||||
|
||||
Taxnexus Contact record ID
|
||||
*/
|
||||
ContactID *string
|
||||
/*Email
|
||||
Email address used for identity lookup
|
||||
|
||||
/* Email.
|
||||
|
||||
Email address used for identity lookup
|
||||
*/
|
||||
Email *string
|
||||
/*Name
|
||||
The Name of this Object
|
||||
|
||||
/* Name.
|
||||
|
||||
The Name of this Object
|
||||
*/
|
||||
Name *string
|
||||
|
||||
|
@ -91,6 +93,21 @@ type GetContactsObservableParams struct {
|
|||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the get contacts observable params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetContactsObservableParams) WithDefaults() *GetContactsObservableParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the get contacts observable params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetContactsObservableParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get contacts observable params
|
||||
func (o *GetContactsObservableParams) WithTimeout(timeout time.Duration) *GetContactsObservableParams {
|
||||
o.SetTimeout(timeout)
|
||||
|
@ -180,64 +197,68 @@ func (o *GetContactsObservableParams) WriteToRequest(r runtime.ClientRequest, re
|
|||
|
||||
// query param active
|
||||
var qrActive bool
|
||||
|
||||
if o.Active != nil {
|
||||
qrActive = *o.Active
|
||||
}
|
||||
qActive := swag.FormatBool(qrActive)
|
||||
if qActive != "" {
|
||||
|
||||
if err := r.SetQueryParam("active", qActive); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if o.ContactID != nil {
|
||||
|
||||
// query param contactId
|
||||
var qrContactID string
|
||||
|
||||
if o.ContactID != nil {
|
||||
qrContactID = *o.ContactID
|
||||
}
|
||||
qContactID := qrContactID
|
||||
if qContactID != "" {
|
||||
|
||||
if err := r.SetQueryParam("contactId", qContactID); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if o.Email != nil {
|
||||
|
||||
// query param email
|
||||
var qrEmail string
|
||||
|
||||
if o.Email != nil {
|
||||
qrEmail = *o.Email
|
||||
}
|
||||
qEmail := qrEmail
|
||||
if qEmail != "" {
|
||||
|
||||
if err := r.SetQueryParam("email", qEmail); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if o.Name != nil {
|
||||
|
||||
// query param name
|
||||
var qrName string
|
||||
|
||||
if o.Name != nil {
|
||||
qrName = *o.Name
|
||||
}
|
||||
qName := qrName
|
||||
if qName != "" {
|
||||
|
||||
if err := r.SetQueryParam("name", qName); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
|
|
|
@ -63,9 +63,8 @@ func (o *GetContactsObservableReader) ReadResponse(response runtime.ClientRespon
|
|||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -74,13 +73,12 @@ func NewGetContactsObservableOK() *GetContactsObservableOK {
|
|||
return &GetContactsObservableOK{}
|
||||
}
|
||||
|
||||
/*GetContactsObservableOK handles this case with default header values.
|
||||
/* GetContactsObservableOK describes a response with status code 200, with default header values.
|
||||
|
||||
Taxnexus Response with an array of Contact objects
|
||||
*/
|
||||
type GetContactsObservableOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
CacheControl string
|
||||
|
||||
Payload []*crm_models.Contact
|
||||
|
@ -89,18 +87,25 @@ type GetContactsObservableOK struct {
|
|||
func (o *GetContactsObservableOK) Error() string {
|
||||
return fmt.Sprintf("[GET /contacts/observable][%d] getContactsObservableOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetContactsObservableOK) GetPayload() []*crm_models.Contact {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetContactsObservableOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// hydrates response header Access-Control-Allow-Origin
|
||||
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
// response header Cache-Control
|
||||
o.CacheControl = response.GetHeader("Cache-Control")
|
||||
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 {
|
||||
|
@ -115,7 +120,7 @@ func NewGetContactsObservableUnauthorized() *GetContactsObservableUnauthorized {
|
|||
return &GetContactsObservableUnauthorized{}
|
||||
}
|
||||
|
||||
/*GetContactsObservableUnauthorized handles this case with default header values.
|
||||
/* GetContactsObservableUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
|
@ -128,15 +133,18 @@ type GetContactsObservableUnauthorized struct {
|
|||
func (o *GetContactsObservableUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /contacts/observable][%d] getContactsObservableUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetContactsObservableUnauthorized) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetContactsObservableUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -153,7 +161,7 @@ func NewGetContactsObservableForbidden() *GetContactsObservableForbidden {
|
|||
return &GetContactsObservableForbidden{}
|
||||
}
|
||||
|
||||
/*GetContactsObservableForbidden handles this case with default header values.
|
||||
/* GetContactsObservableForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
|
@ -166,15 +174,18 @@ type GetContactsObservableForbidden struct {
|
|||
func (o *GetContactsObservableForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /contacts/observable][%d] getContactsObservableForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetContactsObservableForbidden) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetContactsObservableForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -191,7 +202,7 @@ func NewGetContactsObservableNotFound() *GetContactsObservableNotFound {
|
|||
return &GetContactsObservableNotFound{}
|
||||
}
|
||||
|
||||
/*GetContactsObservableNotFound handles this case with default header values.
|
||||
/* GetContactsObservableNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
|
@ -204,15 +215,18 @@ type GetContactsObservableNotFound struct {
|
|||
func (o *GetContactsObservableNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /contacts/observable][%d] getContactsObservableNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetContactsObservableNotFound) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetContactsObservableNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -229,7 +243,7 @@ func NewGetContactsObservableUnprocessableEntity() *GetContactsObservableUnproce
|
|||
return &GetContactsObservableUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*GetContactsObservableUnprocessableEntity handles this case with default header values.
|
||||
/* GetContactsObservableUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
|
@ -242,15 +256,18 @@ type GetContactsObservableUnprocessableEntity struct {
|
|||
func (o *GetContactsObservableUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[GET /contacts/observable][%d] getContactsObservableUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetContactsObservableUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetContactsObservableUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -267,7 +284,7 @@ func NewGetContactsObservableInternalServerError() *GetContactsObservableInterna
|
|||
return &GetContactsObservableInternalServerError{}
|
||||
}
|
||||
|
||||
/*GetContactsObservableInternalServerError handles this case with default header values.
|
||||
/* GetContactsObservableInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
|
@ -280,15 +297,18 @@ type GetContactsObservableInternalServerError struct {
|
|||
func (o *GetContactsObservableInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /contacts/observable][%d] getContactsObservableInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetContactsObservableInternalServerError) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetContactsObservableInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
|
|
@ -21,78 +21,86 @@ import (
|
|||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// NewGetContactsParams creates a new GetContactsParams object
|
||||
// with the default values initialized.
|
||||
// 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 {
|
||||
var ()
|
||||
return &GetContactsParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetContactsParamsWithTimeout creates a new GetContactsParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetContactsParamsWithTimeout(timeout time.Duration) *GetContactsParams {
|
||||
var ()
|
||||
return &GetContactsParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetContactsParamsWithContext creates a new GetContactsParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
// with the ability to set a context for a request.
|
||||
func NewGetContactsParamsWithContext(ctx context.Context) *GetContactsParams {
|
||||
var ()
|
||||
return &GetContactsParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetContactsParamsWithHTTPClient creates a new GetContactsParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewGetContactsParamsWithHTTPClient(client *http.Client) *GetContactsParams {
|
||||
var ()
|
||||
return &GetContactsParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/* GetContactsParams contains all the parameters to send to the API endpoint
|
||||
for the get contacts operation typically these are written to a http.Request
|
||||
for the get contacts operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type GetContactsParams struct {
|
||||
|
||||
/*Active
|
||||
Only retrieve active records?
|
||||
/* Active.
|
||||
|
||||
Only retrieve active records?
|
||||
*/
|
||||
Active *bool
|
||||
/*ContactID
|
||||
Taxnexus Contact record ID
|
||||
|
||||
/* ContactID.
|
||||
|
||||
Taxnexus Contact record ID
|
||||
*/
|
||||
ContactID *string
|
||||
/*Email
|
||||
Email address used for identity lookup
|
||||
|
||||
/* Email.
|
||||
|
||||
Email address used for identity lookup
|
||||
*/
|
||||
Email *string
|
||||
/*Limit
|
||||
|
||||
/* Limit.
|
||||
|
||||
How many objects to return at one time
|
||||
|
||||
Format: int64
|
||||
*/
|
||||
Limit *int64
|
||||
/*Name
|
||||
The Name of this Object
|
||||
|
||||
/* Name.
|
||||
|
||||
The Name of this Object
|
||||
*/
|
||||
Name *string
|
||||
/*Offset
|
||||
|
||||
/* Offset.
|
||||
|
||||
How many objects to skip?
|
||||
|
||||
Format: int64
|
||||
*/
|
||||
Offset *int64
|
||||
|
||||
|
@ -101,6 +109,21 @@ type GetContactsParams struct {
|
|||
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)
|
||||
|
@ -212,96 +235,102 @@ func (o *GetContactsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R
|
|||
|
||||
// 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 {
|
||||
|
|
|
@ -63,9 +63,8 @@ func (o *GetContactsReader) ReadResponse(response runtime.ClientResponse, consum
|
|||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -74,13 +73,12 @@ func NewGetContactsOK() *GetContactsOK {
|
|||
return &GetContactsOK{}
|
||||
}
|
||||
|
||||
/*GetContactsOK handles this case with default header values.
|
||||
/* GetContactsOK describes a response with status code 200, with default header values.
|
||||
|
||||
Taxnexus Response with an array of Contact objects
|
||||
*/
|
||||
type GetContactsOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
CacheControl string
|
||||
|
||||
Payload *crm_models.ContactResponse
|
||||
|
@ -89,18 +87,25 @@ type GetContactsOK struct {
|
|||
func (o *GetContactsOK) Error() string {
|
||||
return fmt.Sprintf("[GET /contacts][%d] getContactsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetContactsOK) GetPayload() *crm_models.ContactResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetContactsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// hydrates response header Access-Control-Allow-Origin
|
||||
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
// response header Cache-Control
|
||||
o.CacheControl = response.GetHeader("Cache-Control")
|
||||
if hdrAccessControlAllowOrigin != "" {
|
||||
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
|
||||
}
|
||||
|
||||
// hydrates response header Cache-Control
|
||||
hdrCacheControl := response.GetHeader("Cache-Control")
|
||||
|
||||
if hdrCacheControl != "" {
|
||||
o.CacheControl = hdrCacheControl
|
||||
}
|
||||
|
||||
o.Payload = new(crm_models.ContactResponse)
|
||||
|
||||
|
@ -117,7 +122,7 @@ func NewGetContactsUnauthorized() *GetContactsUnauthorized {
|
|||
return &GetContactsUnauthorized{}
|
||||
}
|
||||
|
||||
/*GetContactsUnauthorized handles this case with default header values.
|
||||
/* GetContactsUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
|
@ -130,15 +135,18 @@ type GetContactsUnauthorized struct {
|
|||
func (o *GetContactsUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /contacts][%d] getContactsUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetContactsUnauthorized) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetContactsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -155,7 +163,7 @@ func NewGetContactsForbidden() *GetContactsForbidden {
|
|||
return &GetContactsForbidden{}
|
||||
}
|
||||
|
||||
/*GetContactsForbidden handles this case with default header values.
|
||||
/* GetContactsForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
|
@ -168,15 +176,18 @@ type GetContactsForbidden struct {
|
|||
func (o *GetContactsForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /contacts][%d] getContactsForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetContactsForbidden) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetContactsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -193,7 +204,7 @@ func NewGetContactsNotFound() *GetContactsNotFound {
|
|||
return &GetContactsNotFound{}
|
||||
}
|
||||
|
||||
/*GetContactsNotFound handles this case with default header values.
|
||||
/* GetContactsNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
|
@ -206,15 +217,18 @@ type GetContactsNotFound struct {
|
|||
func (o *GetContactsNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /contacts][%d] getContactsNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetContactsNotFound) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetContactsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -231,7 +245,7 @@ func NewGetContactsUnprocessableEntity() *GetContactsUnprocessableEntity {
|
|||
return &GetContactsUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*GetContactsUnprocessableEntity handles this case with default header values.
|
||||
/* GetContactsUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
|
@ -244,15 +258,18 @@ type GetContactsUnprocessableEntity struct {
|
|||
func (o *GetContactsUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[GET /contacts][%d] getContactsUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetContactsUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetContactsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -269,7 +286,7 @@ func NewGetContactsInternalServerError() *GetContactsInternalServerError {
|
|||
return &GetContactsInternalServerError{}
|
||||
}
|
||||
|
||||
/*GetContactsInternalServerError handles this case with default header values.
|
||||
/* GetContactsInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
|
@ -282,15 +299,18 @@ type GetContactsInternalServerError struct {
|
|||
func (o *GetContactsInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /contacts][%d] getContactsInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetContactsInternalServerError) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetContactsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
|
|
@ -22,53 +22,52 @@ import (
|
|||
"code.tnxs.net/taxnexus/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// NewPostContactsParams creates a new PostContactsParams object
|
||||
// with the default values initialized.
|
||||
// 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 {
|
||||
var ()
|
||||
return &PostContactsParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostContactsParamsWithTimeout creates a new PostContactsParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPostContactsParamsWithTimeout(timeout time.Duration) *PostContactsParams {
|
||||
var ()
|
||||
return &PostContactsParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostContactsParamsWithContext creates a new PostContactsParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
// with the ability to set a context for a request.
|
||||
func NewPostContactsParamsWithContext(ctx context.Context) *PostContactsParams {
|
||||
var ()
|
||||
return &PostContactsParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostContactsParamsWithHTTPClient creates a new PostContactsParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPostContactsParamsWithHTTPClient(client *http.Client) *PostContactsParams {
|
||||
var ()
|
||||
return &PostContactsParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/* PostContactsParams contains all the parameters to send to the API endpoint
|
||||
for the post contacts operation typically these are written to a http.Request
|
||||
for the post contacts operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PostContactsParams struct {
|
||||
|
||||
/*ContactsRequest
|
||||
An array of new Contact records
|
||||
/* ContactsRequest.
|
||||
|
||||
An array of new Contact records
|
||||
*/
|
||||
ContactsRequest *crm_models.ContactRequest
|
||||
|
||||
|
@ -77,6 +76,21 @@ type PostContactsParams struct {
|
|||
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)
|
||||
|
@ -128,7 +142,6 @@ func (o *PostContactsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.
|
|||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if o.ContactsRequest != nil {
|
||||
if err := r.SetBodyParam(o.ContactsRequest); err != nil {
|
||||
return err
|
||||
|
|
|
@ -63,9 +63,8 @@ func (o *PostContactsReader) ReadResponse(response runtime.ClientResponse, consu
|
|||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -74,13 +73,12 @@ func NewPostContactsOK() *PostContactsOK {
|
|||
return &PostContactsOK{}
|
||||
}
|
||||
|
||||
/*PostContactsOK handles this case with default header values.
|
||||
/* PostContactsOK describes a response with status code 200, with default header values.
|
||||
|
||||
Taxnexus Response with an array of Contact objects
|
||||
*/
|
||||
type PostContactsOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
CacheControl string
|
||||
|
||||
Payload *crm_models.ContactResponse
|
||||
|
@ -89,18 +87,25 @@ type PostContactsOK struct {
|
|||
func (o *PostContactsOK) Error() string {
|
||||
return fmt.Sprintf("[POST /contacts][%d] postContactsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostContactsOK) GetPayload() *crm_models.ContactResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostContactsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// hydrates response header Access-Control-Allow-Origin
|
||||
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
// response header Cache-Control
|
||||
o.CacheControl = response.GetHeader("Cache-Control")
|
||||
if hdrAccessControlAllowOrigin != "" {
|
||||
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
|
||||
}
|
||||
|
||||
// hydrates response header Cache-Control
|
||||
hdrCacheControl := response.GetHeader("Cache-Control")
|
||||
|
||||
if hdrCacheControl != "" {
|
||||
o.CacheControl = hdrCacheControl
|
||||
}
|
||||
|
||||
o.Payload = new(crm_models.ContactResponse)
|
||||
|
||||
|
@ -117,7 +122,7 @@ func NewPostContactsUnauthorized() *PostContactsUnauthorized {
|
|||
return &PostContactsUnauthorized{}
|
||||
}
|
||||
|
||||
/*PostContactsUnauthorized handles this case with default header values.
|
||||
/* PostContactsUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
|
@ -130,15 +135,18 @@ type PostContactsUnauthorized struct {
|
|||
func (o *PostContactsUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[POST /contacts][%d] postContactsUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostContactsUnauthorized) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostContactsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -155,7 +163,7 @@ func NewPostContactsForbidden() *PostContactsForbidden {
|
|||
return &PostContactsForbidden{}
|
||||
}
|
||||
|
||||
/*PostContactsForbidden handles this case with default header values.
|
||||
/* PostContactsForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
|
@ -168,15 +176,18 @@ type PostContactsForbidden struct {
|
|||
func (o *PostContactsForbidden) Error() string {
|
||||
return fmt.Sprintf("[POST /contacts][%d] postContactsForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostContactsForbidden) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostContactsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -193,7 +204,7 @@ func NewPostContactsNotFound() *PostContactsNotFound {
|
|||
return &PostContactsNotFound{}
|
||||
}
|
||||
|
||||
/*PostContactsNotFound handles this case with default header values.
|
||||
/* PostContactsNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
|
@ -206,15 +217,18 @@ type PostContactsNotFound struct {
|
|||
func (o *PostContactsNotFound) Error() string {
|
||||
return fmt.Sprintf("[POST /contacts][%d] postContactsNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostContactsNotFound) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostContactsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -231,7 +245,7 @@ func NewPostContactsUnprocessableEntity() *PostContactsUnprocessableEntity {
|
|||
return &PostContactsUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*PostContactsUnprocessableEntity handles this case with default header values.
|
||||
/* PostContactsUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
|
@ -244,15 +258,18 @@ type PostContactsUnprocessableEntity struct {
|
|||
func (o *PostContactsUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[POST /contacts][%d] postContactsUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostContactsUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostContactsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
@ -269,7 +286,7 @@ func NewPostContactsInternalServerError() *PostContactsInternalServerError {
|
|||
return &PostContactsInternalServerError{}
|
||||
}
|
||||
|
||||
/*PostContactsInternalServerError handles this case with default header values.
|
||||
/* PostContactsInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
|
@ -282,15 +299,18 @@ type PostContactsInternalServerError struct {
|
|||
func (o *PostContactsInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[POST /contacts][%d] postContactsInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostContactsInternalServerError) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostContactsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response header Access-Control-Allow-Origin
|
||||
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||||
// 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)
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue