mirror of https://github.com/vernonkeenan/lib
feat(api): Generate session management API client and models
- Added `get_me` and `refresh_session` parameters and responses for user session management. - Implemented `sessions_client` for handling session-related API calls. - Created models for `Credentials`, `Category`, `Product`, and `Service` with validation. - Defined Swagger specifications for `Credentials`. - Ensured all generated files are marked as non-editable to prevent manual changes.v0.7.4 v0.7.4
parent
2e3fdeec39
commit
a13ad35fe2
|
@ -31,6 +31,7 @@ import (
|
||||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_client/payment_methods"
|
"code.tnxs.net/vernonkeenan/lib/api/members/members_client/payment_methods"
|
||||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_client/prompts"
|
"code.tnxs.net/vernonkeenan/lib/api/members/members_client/prompts"
|
||||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_client/research_projects"
|
"code.tnxs.net/vernonkeenan/lib/api/members/members_client/research_projects"
|
||||||
|
"code.tnxs.net/vernonkeenan/lib/api/members/members_client/sessions"
|
||||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_client/templates"
|
"code.tnxs.net/vernonkeenan/lib/api/members/members_client/templates"
|
||||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_client/tenants"
|
"code.tnxs.net/vernonkeenan/lib/api/members/members_client/tenants"
|
||||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_client/tickets"
|
"code.tnxs.net/vernonkeenan/lib/api/members/members_client/tickets"
|
||||||
|
@ -98,6 +99,7 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *Members {
|
||||||
cli.PaymentMethods = payment_methods.New(transport, formats)
|
cli.PaymentMethods = payment_methods.New(transport, formats)
|
||||||
cli.Prompts = prompts.New(transport, formats)
|
cli.Prompts = prompts.New(transport, formats)
|
||||||
cli.ResearchProjects = research_projects.New(transport, formats)
|
cli.ResearchProjects = research_projects.New(transport, formats)
|
||||||
|
cli.Sessions = sessions.New(transport, formats)
|
||||||
cli.Templates = templates.New(transport, formats)
|
cli.Templates = templates.New(transport, formats)
|
||||||
cli.Tenants = tenants.New(transport, formats)
|
cli.Tenants = tenants.New(transport, formats)
|
||||||
cli.Tickets = tickets.New(transport, formats)
|
cli.Tickets = tickets.New(transport, formats)
|
||||||
|
@ -182,6 +184,8 @@ type Members struct {
|
||||||
|
|
||||||
ResearchProjects research_projects.ClientService
|
ResearchProjects research_projects.ClientService
|
||||||
|
|
||||||
|
Sessions sessions.ClientService
|
||||||
|
|
||||||
Templates templates.ClientService
|
Templates templates.ClientService
|
||||||
|
|
||||||
Tenants tenants.ClientService
|
Tenants tenants.ClientService
|
||||||
|
@ -217,6 +221,7 @@ func (c *Members) SetTransport(transport runtime.ClientTransport) {
|
||||||
c.PaymentMethods.SetTransport(transport)
|
c.PaymentMethods.SetTransport(transport)
|
||||||
c.Prompts.SetTransport(transport)
|
c.Prompts.SetTransport(transport)
|
||||||
c.ResearchProjects.SetTransport(transport)
|
c.ResearchProjects.SetTransport(transport)
|
||||||
|
c.Sessions.SetTransport(transport)
|
||||||
c.Templates.SetTransport(transport)
|
c.Templates.SetTransport(transport)
|
||||||
c.Tenants.SetTransport(transport)
|
c.Tenants.SetTransport(transport)
|
||||||
c.Tickets.SetTransport(transport)
|
c.Tickets.SetTransport(transport)
|
||||||
|
|
|
@ -0,0 +1,154 @@
|
||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// (c) 2012-2020 by Taxnexus, Inc.
|
||||||
|
// All rights reserved worldwide.
|
||||||
|
// Proprietary product; unlicensed use is not allowed
|
||||||
|
|
||||||
|
package sessions
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
cr "github.com/go-openapi/runtime/client"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
|
||||||
|
"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewCreateSessionParams creates a new CreateSessionParams 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 NewCreateSessionParams() *CreateSessionParams {
|
||||||
|
return &CreateSessionParams{
|
||||||
|
timeout: cr.DefaultTimeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewCreateSessionParamsWithTimeout creates a new CreateSessionParams object
|
||||||
|
// with the ability to set a timeout on a request.
|
||||||
|
func NewCreateSessionParamsWithTimeout(timeout time.Duration) *CreateSessionParams {
|
||||||
|
return &CreateSessionParams{
|
||||||
|
timeout: timeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewCreateSessionParamsWithContext creates a new CreateSessionParams object
|
||||||
|
// with the ability to set a context for a request.
|
||||||
|
func NewCreateSessionParamsWithContext(ctx context.Context) *CreateSessionParams {
|
||||||
|
return &CreateSessionParams{
|
||||||
|
Context: ctx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewCreateSessionParamsWithHTTPClient creates a new CreateSessionParams object
|
||||||
|
// with the ability to set a custom HTTPClient for a request.
|
||||||
|
func NewCreateSessionParamsWithHTTPClient(client *http.Client) *CreateSessionParams {
|
||||||
|
return &CreateSessionParams{
|
||||||
|
HTTPClient: client,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
CreateSessionParams contains all the parameters to send to the API endpoint
|
||||||
|
|
||||||
|
for the create session operation.
|
||||||
|
|
||||||
|
Typically these are written to a http.Request.
|
||||||
|
*/
|
||||||
|
type CreateSessionParams struct {
|
||||||
|
|
||||||
|
// Credentials.
|
||||||
|
Credentials *members_models.Credentials
|
||||||
|
|
||||||
|
timeout time.Duration
|
||||||
|
Context context.Context
|
||||||
|
HTTPClient *http.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithDefaults hydrates default values in the create session params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *CreateSessionParams) WithDefaults() *CreateSessionParams {
|
||||||
|
o.SetDefaults()
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetDefaults hydrates default values in the create session params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *CreateSessionParams) SetDefaults() {
|
||||||
|
// no default values defined for this parameter
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithTimeout adds the timeout to the create session params
|
||||||
|
func (o *CreateSessionParams) WithTimeout(timeout time.Duration) *CreateSessionParams {
|
||||||
|
o.SetTimeout(timeout)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetTimeout adds the timeout to the create session params
|
||||||
|
func (o *CreateSessionParams) SetTimeout(timeout time.Duration) {
|
||||||
|
o.timeout = timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithContext adds the context to the create session params
|
||||||
|
func (o *CreateSessionParams) WithContext(ctx context.Context) *CreateSessionParams {
|
||||||
|
o.SetContext(ctx)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetContext adds the context to the create session params
|
||||||
|
func (o *CreateSessionParams) SetContext(ctx context.Context) {
|
||||||
|
o.Context = ctx
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithHTTPClient adds the HTTPClient to the create session params
|
||||||
|
func (o *CreateSessionParams) WithHTTPClient(client *http.Client) *CreateSessionParams {
|
||||||
|
o.SetHTTPClient(client)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetHTTPClient adds the HTTPClient to the create session params
|
||||||
|
func (o *CreateSessionParams) SetHTTPClient(client *http.Client) {
|
||||||
|
o.HTTPClient = client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithCredentials adds the credentials to the create session params
|
||||||
|
func (o *CreateSessionParams) WithCredentials(credentials *members_models.Credentials) *CreateSessionParams {
|
||||||
|
o.SetCredentials(credentials)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetCredentials adds the credentials to the create session params
|
||||||
|
func (o *CreateSessionParams) SetCredentials(credentials *members_models.Credentials) {
|
||||||
|
o.Credentials = credentials
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteToRequest writes these params to a swagger request
|
||||||
|
func (o *CreateSessionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := r.SetTimeout(o.timeout); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var res []error
|
||||||
|
if o.Credentials != nil {
|
||||||
|
if err := r.SetBodyParam(o.Credentials); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
|
@ -0,0 +1,266 @@
|
||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// (c) 2012-2020 by Taxnexus, Inc.
|
||||||
|
// All rights reserved worldwide.
|
||||||
|
// Proprietary product; unlicensed use is not allowed
|
||||||
|
|
||||||
|
package sessions
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"io"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
|
||||||
|
"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
|
||||||
|
)
|
||||||
|
|
||||||
|
// CreateSessionReader is a Reader for the CreateSession structure.
|
||||||
|
type CreateSessionReader struct {
|
||||||
|
formats strfmt.Registry
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReadResponse reads a server response into the received o.
|
||||||
|
func (o *CreateSessionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||||
|
switch response.Code() {
|
||||||
|
case 200:
|
||||||
|
result := NewCreateSessionOK()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return result, nil
|
||||||
|
case 401:
|
||||||
|
result := NewCreateSessionUnauthorized()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 429:
|
||||||
|
result := NewCreateSessionTooManyRequests()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
default:
|
||||||
|
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewCreateSessionOK creates a CreateSessionOK with default headers values
|
||||||
|
func NewCreateSessionOK() *CreateSessionOK {
|
||||||
|
return &CreateSessionOK{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
CreateSessionOK describes a response with status code 200, with default header values.
|
||||||
|
|
||||||
|
Successful sign-in
|
||||||
|
*/
|
||||||
|
type CreateSessionOK struct {
|
||||||
|
|
||||||
|
/* kvSession=<jwt>; HttpOnly; Secure; SameSite=None; Domain=.keenanvision.net; Path=/; Max-Age=5400
|
||||||
|
|
||||||
|
*/
|
||||||
|
SetCookie string
|
||||||
|
|
||||||
|
Payload interface{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this create session o k response has a 2xx status code
|
||||||
|
func (o *CreateSessionOK) IsSuccess() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this create session o k response has a 3xx status code
|
||||||
|
func (o *CreateSessionOK) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this create session o k response has a 4xx status code
|
||||||
|
func (o *CreateSessionOK) IsClientError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this create session o k response has a 5xx status code
|
||||||
|
func (o *CreateSessionOK) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this create session o k response a status code equal to that given
|
||||||
|
func (o *CreateSessionOK) IsCode(code int) bool {
|
||||||
|
return code == 200
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the create session o k response
|
||||||
|
func (o *CreateSessionOK) Code() int {
|
||||||
|
return 200
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *CreateSessionOK) Error() string {
|
||||||
|
return fmt.Sprintf("[POST /sessions][%d] createSessionOK %+v", 200, o.Payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *CreateSessionOK) String() string {
|
||||||
|
return fmt.Sprintf("[POST /sessions][%d] createSessionOK %+v", 200, o.Payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *CreateSessionOK) GetPayload() interface{} {
|
||||||
|
return o.Payload
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *CreateSessionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// hydrates response header Set-Cookie
|
||||||
|
hdrSetCookie := response.GetHeader("Set-Cookie")
|
||||||
|
|
||||||
|
if hdrSetCookie != "" {
|
||||||
|
o.SetCookie = hdrSetCookie
|
||||||
|
}
|
||||||
|
|
||||||
|
// response payload
|
||||||
|
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewCreateSessionUnauthorized creates a CreateSessionUnauthorized with default headers values
|
||||||
|
func NewCreateSessionUnauthorized() *CreateSessionUnauthorized {
|
||||||
|
return &CreateSessionUnauthorized{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
CreateSessionUnauthorized describes a response with status code 401, with default header values.
|
||||||
|
|
||||||
|
Access Unauthorized, invalid API-KEY was used
|
||||||
|
*/
|
||||||
|
type CreateSessionUnauthorized struct {
|
||||||
|
Payload *members_models.Error
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this create session unauthorized response has a 2xx status code
|
||||||
|
func (o *CreateSessionUnauthorized) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this create session unauthorized response has a 3xx status code
|
||||||
|
func (o *CreateSessionUnauthorized) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this create session unauthorized response has a 4xx status code
|
||||||
|
func (o *CreateSessionUnauthorized) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this create session unauthorized response has a 5xx status code
|
||||||
|
func (o *CreateSessionUnauthorized) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this create session unauthorized response a status code equal to that given
|
||||||
|
func (o *CreateSessionUnauthorized) IsCode(code int) bool {
|
||||||
|
return code == 401
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the create session unauthorized response
|
||||||
|
func (o *CreateSessionUnauthorized) Code() int {
|
||||||
|
return 401
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *CreateSessionUnauthorized) Error() string {
|
||||||
|
return fmt.Sprintf("[POST /sessions][%d] createSessionUnauthorized %+v", 401, o.Payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *CreateSessionUnauthorized) String() string {
|
||||||
|
return fmt.Sprintf("[POST /sessions][%d] createSessionUnauthorized %+v", 401, o.Payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *CreateSessionUnauthorized) GetPayload() *members_models.Error {
|
||||||
|
return o.Payload
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *CreateSessionUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
o.Payload = new(members_models.Error)
|
||||||
|
|
||||||
|
// response payload
|
||||||
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewCreateSessionTooManyRequests creates a CreateSessionTooManyRequests with default headers values
|
||||||
|
func NewCreateSessionTooManyRequests() *CreateSessionTooManyRequests {
|
||||||
|
return &CreateSessionTooManyRequests{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
CreateSessionTooManyRequests describes a response with status code 429, with default header values.
|
||||||
|
|
||||||
|
Server Internal Error
|
||||||
|
*/
|
||||||
|
type CreateSessionTooManyRequests struct {
|
||||||
|
Payload *members_models.Error
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this create session too many requests response has a 2xx status code
|
||||||
|
func (o *CreateSessionTooManyRequests) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this create session too many requests response has a 3xx status code
|
||||||
|
func (o *CreateSessionTooManyRequests) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this create session too many requests response has a 4xx status code
|
||||||
|
func (o *CreateSessionTooManyRequests) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this create session too many requests response has a 5xx status code
|
||||||
|
func (o *CreateSessionTooManyRequests) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this create session too many requests response a status code equal to that given
|
||||||
|
func (o *CreateSessionTooManyRequests) IsCode(code int) bool {
|
||||||
|
return code == 429
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the create session too many requests response
|
||||||
|
func (o *CreateSessionTooManyRequests) Code() int {
|
||||||
|
return 429
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *CreateSessionTooManyRequests) Error() string {
|
||||||
|
return fmt.Sprintf("[POST /sessions][%d] createSessionTooManyRequests %+v", 429, o.Payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *CreateSessionTooManyRequests) String() string {
|
||||||
|
return fmt.Sprintf("[POST /sessions][%d] createSessionTooManyRequests %+v", 429, o.Payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *CreateSessionTooManyRequests) GetPayload() *members_models.Error {
|
||||||
|
return o.Payload
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *CreateSessionTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
o.Payload = new(members_models.Error)
|
||||||
|
|
||||||
|
// response payload
|
||||||
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
|
@ -0,0 +1,132 @@
|
||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// (c) 2012-2020 by Taxnexus, Inc.
|
||||||
|
// All rights reserved worldwide.
|
||||||
|
// Proprietary product; unlicensed use is not allowed
|
||||||
|
|
||||||
|
package sessions
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
cr "github.com/go-openapi/runtime/client"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewDeleteSessionParams creates a new DeleteSessionParams 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 NewDeleteSessionParams() *DeleteSessionParams {
|
||||||
|
return &DeleteSessionParams{
|
||||||
|
timeout: cr.DefaultTimeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewDeleteSessionParamsWithTimeout creates a new DeleteSessionParams object
|
||||||
|
// with the ability to set a timeout on a request.
|
||||||
|
func NewDeleteSessionParamsWithTimeout(timeout time.Duration) *DeleteSessionParams {
|
||||||
|
return &DeleteSessionParams{
|
||||||
|
timeout: timeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewDeleteSessionParamsWithContext creates a new DeleteSessionParams object
|
||||||
|
// with the ability to set a context for a request.
|
||||||
|
func NewDeleteSessionParamsWithContext(ctx context.Context) *DeleteSessionParams {
|
||||||
|
return &DeleteSessionParams{
|
||||||
|
Context: ctx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewDeleteSessionParamsWithHTTPClient creates a new DeleteSessionParams object
|
||||||
|
// with the ability to set a custom HTTPClient for a request.
|
||||||
|
func NewDeleteSessionParamsWithHTTPClient(client *http.Client) *DeleteSessionParams {
|
||||||
|
return &DeleteSessionParams{
|
||||||
|
HTTPClient: client,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
DeleteSessionParams contains all the parameters to send to the API endpoint
|
||||||
|
|
||||||
|
for the delete session operation.
|
||||||
|
|
||||||
|
Typically these are written to a http.Request.
|
||||||
|
*/
|
||||||
|
type DeleteSessionParams struct {
|
||||||
|
timeout time.Duration
|
||||||
|
Context context.Context
|
||||||
|
HTTPClient *http.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithDefaults hydrates default values in the delete session params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *DeleteSessionParams) WithDefaults() *DeleteSessionParams {
|
||||||
|
o.SetDefaults()
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetDefaults hydrates default values in the delete session params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *DeleteSessionParams) SetDefaults() {
|
||||||
|
// no default values defined for this parameter
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithTimeout adds the timeout to the delete session params
|
||||||
|
func (o *DeleteSessionParams) WithTimeout(timeout time.Duration) *DeleteSessionParams {
|
||||||
|
o.SetTimeout(timeout)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetTimeout adds the timeout to the delete session params
|
||||||
|
func (o *DeleteSessionParams) SetTimeout(timeout time.Duration) {
|
||||||
|
o.timeout = timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithContext adds the context to the delete session params
|
||||||
|
func (o *DeleteSessionParams) WithContext(ctx context.Context) *DeleteSessionParams {
|
||||||
|
o.SetContext(ctx)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetContext adds the context to the delete session params
|
||||||
|
func (o *DeleteSessionParams) SetContext(ctx context.Context) {
|
||||||
|
o.Context = ctx
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithHTTPClient adds the HTTPClient to the delete session params
|
||||||
|
func (o *DeleteSessionParams) WithHTTPClient(client *http.Client) *DeleteSessionParams {
|
||||||
|
o.SetHTTPClient(client)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetHTTPClient adds the HTTPClient to the delete session params
|
||||||
|
func (o *DeleteSessionParams) SetHTTPClient(client *http.Client) {
|
||||||
|
o.HTTPClient = client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteToRequest writes these params to a swagger request
|
||||||
|
func (o *DeleteSessionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := r.SetTimeout(o.timeout); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
|
@ -0,0 +1,169 @@
|
||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// (c) 2012-2020 by Taxnexus, Inc.
|
||||||
|
// All rights reserved worldwide.
|
||||||
|
// Proprietary product; unlicensed use is not allowed
|
||||||
|
|
||||||
|
package sessions
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"io"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
|
||||||
|
"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
|
||||||
|
)
|
||||||
|
|
||||||
|
// DeleteSessionReader is a Reader for the DeleteSession structure.
|
||||||
|
type DeleteSessionReader struct {
|
||||||
|
formats strfmt.Registry
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReadResponse reads a server response into the received o.
|
||||||
|
func (o *DeleteSessionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||||
|
switch response.Code() {
|
||||||
|
case 204:
|
||||||
|
result := NewDeleteSessionNoContent()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return result, nil
|
||||||
|
case 401:
|
||||||
|
result := NewDeleteSessionUnauthorized()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
default:
|
||||||
|
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewDeleteSessionNoContent creates a DeleteSessionNoContent with default headers values
|
||||||
|
func NewDeleteSessionNoContent() *DeleteSessionNoContent {
|
||||||
|
return &DeleteSessionNoContent{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
DeleteSessionNoContent describes a response with status code 204, with default header values.
|
||||||
|
|
||||||
|
Logged out; kvSession cookie cleared
|
||||||
|
*/
|
||||||
|
type DeleteSessionNoContent struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this delete session no content response has a 2xx status code
|
||||||
|
func (o *DeleteSessionNoContent) IsSuccess() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this delete session no content response has a 3xx status code
|
||||||
|
func (o *DeleteSessionNoContent) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this delete session no content response has a 4xx status code
|
||||||
|
func (o *DeleteSessionNoContent) IsClientError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this delete session no content response has a 5xx status code
|
||||||
|
func (o *DeleteSessionNoContent) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this delete session no content response a status code equal to that given
|
||||||
|
func (o *DeleteSessionNoContent) IsCode(code int) bool {
|
||||||
|
return code == 204
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the delete session no content response
|
||||||
|
func (o *DeleteSessionNoContent) Code() int {
|
||||||
|
return 204
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *DeleteSessionNoContent) Error() string {
|
||||||
|
return fmt.Sprintf("[DELETE /sessions/current][%d] deleteSessionNoContent ", 204)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *DeleteSessionNoContent) String() string {
|
||||||
|
return fmt.Sprintf("[DELETE /sessions/current][%d] deleteSessionNoContent ", 204)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *DeleteSessionNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewDeleteSessionUnauthorized creates a DeleteSessionUnauthorized with default headers values
|
||||||
|
func NewDeleteSessionUnauthorized() *DeleteSessionUnauthorized {
|
||||||
|
return &DeleteSessionUnauthorized{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
DeleteSessionUnauthorized describes a response with status code 401, with default header values.
|
||||||
|
|
||||||
|
Access Unauthorized, invalid API-KEY was used
|
||||||
|
*/
|
||||||
|
type DeleteSessionUnauthorized struct {
|
||||||
|
Payload *members_models.Error
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this delete session unauthorized response has a 2xx status code
|
||||||
|
func (o *DeleteSessionUnauthorized) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this delete session unauthorized response has a 3xx status code
|
||||||
|
func (o *DeleteSessionUnauthorized) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this delete session unauthorized response has a 4xx status code
|
||||||
|
func (o *DeleteSessionUnauthorized) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this delete session unauthorized response has a 5xx status code
|
||||||
|
func (o *DeleteSessionUnauthorized) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this delete session unauthorized response a status code equal to that given
|
||||||
|
func (o *DeleteSessionUnauthorized) IsCode(code int) bool {
|
||||||
|
return code == 401
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the delete session unauthorized response
|
||||||
|
func (o *DeleteSessionUnauthorized) Code() int {
|
||||||
|
return 401
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *DeleteSessionUnauthorized) Error() string {
|
||||||
|
return fmt.Sprintf("[DELETE /sessions/current][%d] deleteSessionUnauthorized %+v", 401, o.Payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *DeleteSessionUnauthorized) String() string {
|
||||||
|
return fmt.Sprintf("[DELETE /sessions/current][%d] deleteSessionUnauthorized %+v", 401, o.Payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *DeleteSessionUnauthorized) GetPayload() *members_models.Error {
|
||||||
|
return o.Payload
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *DeleteSessionUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
o.Payload = new(members_models.Error)
|
||||||
|
|
||||||
|
// response payload
|
||||||
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
|
@ -0,0 +1,132 @@
|
||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// (c) 2012-2020 by Taxnexus, Inc.
|
||||||
|
// All rights reserved worldwide.
|
||||||
|
// Proprietary product; unlicensed use is not allowed
|
||||||
|
|
||||||
|
package sessions
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
cr "github.com/go-openapi/runtime/client"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewGetMeParams creates a new GetMeParams 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 NewGetMeParams() *GetMeParams {
|
||||||
|
return &GetMeParams{
|
||||||
|
timeout: cr.DefaultTimeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetMeParamsWithTimeout creates a new GetMeParams object
|
||||||
|
// with the ability to set a timeout on a request.
|
||||||
|
func NewGetMeParamsWithTimeout(timeout time.Duration) *GetMeParams {
|
||||||
|
return &GetMeParams{
|
||||||
|
timeout: timeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetMeParamsWithContext creates a new GetMeParams object
|
||||||
|
// with the ability to set a context for a request.
|
||||||
|
func NewGetMeParamsWithContext(ctx context.Context) *GetMeParams {
|
||||||
|
return &GetMeParams{
|
||||||
|
Context: ctx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetMeParamsWithHTTPClient creates a new GetMeParams object
|
||||||
|
// with the ability to set a custom HTTPClient for a request.
|
||||||
|
func NewGetMeParamsWithHTTPClient(client *http.Client) *GetMeParams {
|
||||||
|
return &GetMeParams{
|
||||||
|
HTTPClient: client,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GetMeParams contains all the parameters to send to the API endpoint
|
||||||
|
|
||||||
|
for the get me operation.
|
||||||
|
|
||||||
|
Typically these are written to a http.Request.
|
||||||
|
*/
|
||||||
|
type GetMeParams struct {
|
||||||
|
timeout time.Duration
|
||||||
|
Context context.Context
|
||||||
|
HTTPClient *http.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithDefaults hydrates default values in the get me params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *GetMeParams) WithDefaults() *GetMeParams {
|
||||||
|
o.SetDefaults()
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetDefaults hydrates default values in the get me params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *GetMeParams) SetDefaults() {
|
||||||
|
// no default values defined for this parameter
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithTimeout adds the timeout to the get me params
|
||||||
|
func (o *GetMeParams) WithTimeout(timeout time.Duration) *GetMeParams {
|
||||||
|
o.SetTimeout(timeout)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetTimeout adds the timeout to the get me params
|
||||||
|
func (o *GetMeParams) SetTimeout(timeout time.Duration) {
|
||||||
|
o.timeout = timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithContext adds the context to the get me params
|
||||||
|
func (o *GetMeParams) WithContext(ctx context.Context) *GetMeParams {
|
||||||
|
o.SetContext(ctx)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetContext adds the context to the get me params
|
||||||
|
func (o *GetMeParams) SetContext(ctx context.Context) {
|
||||||
|
o.Context = ctx
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithHTTPClient adds the HTTPClient to the get me params
|
||||||
|
func (o *GetMeParams) WithHTTPClient(client *http.Client) *GetMeParams {
|
||||||
|
o.SetHTTPClient(client)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetHTTPClient adds the HTTPClient to the get me params
|
||||||
|
func (o *GetMeParams) SetHTTPClient(client *http.Client) {
|
||||||
|
o.HTTPClient = client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteToRequest writes these params to a swagger request
|
||||||
|
func (o *GetMeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := r.SetTimeout(o.timeout); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
|
@ -0,0 +1,179 @@
|
||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// (c) 2012-2020 by Taxnexus, Inc.
|
||||||
|
// All rights reserved worldwide.
|
||||||
|
// Proprietary product; unlicensed use is not allowed
|
||||||
|
|
||||||
|
package sessions
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"io"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
|
||||||
|
"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
|
||||||
|
)
|
||||||
|
|
||||||
|
// GetMeReader is a Reader for the GetMe structure.
|
||||||
|
type GetMeReader struct {
|
||||||
|
formats strfmt.Registry
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReadResponse reads a server response into the received o.
|
||||||
|
func (o *GetMeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||||
|
switch response.Code() {
|
||||||
|
case 200:
|
||||||
|
result := NewGetMeOK()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return result, nil
|
||||||
|
case 401:
|
||||||
|
result := NewGetMeUnauthorized()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
default:
|
||||||
|
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetMeOK creates a GetMeOK with default headers values
|
||||||
|
func NewGetMeOK() *GetMeOK {
|
||||||
|
return &GetMeOK{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GetMeOK describes a response with status code 200, with default header values.
|
||||||
|
|
||||||
|
Current user profile
|
||||||
|
*/
|
||||||
|
type GetMeOK struct {
|
||||||
|
Payload interface{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this get me o k response has a 2xx status code
|
||||||
|
func (o *GetMeOK) IsSuccess() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this get me o k response has a 3xx status code
|
||||||
|
func (o *GetMeOK) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this get me o k response has a 4xx status code
|
||||||
|
func (o *GetMeOK) IsClientError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this get me o k response has a 5xx status code
|
||||||
|
func (o *GetMeOK) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this get me o k response a status code equal to that given
|
||||||
|
func (o *GetMeOK) IsCode(code int) bool {
|
||||||
|
return code == 200
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the get me o k response
|
||||||
|
func (o *GetMeOK) Code() int {
|
||||||
|
return 200
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetMeOK) Error() string {
|
||||||
|
return fmt.Sprintf("[GET /sessions/me][%d] getMeOK %+v", 200, o.Payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetMeOK) String() string {
|
||||||
|
return fmt.Sprintf("[GET /sessions/me][%d] getMeOK %+v", 200, o.Payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetMeOK) GetPayload() interface{} {
|
||||||
|
return o.Payload
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetMeOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// response payload
|
||||||
|
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetMeUnauthorized creates a GetMeUnauthorized with default headers values
|
||||||
|
func NewGetMeUnauthorized() *GetMeUnauthorized {
|
||||||
|
return &GetMeUnauthorized{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GetMeUnauthorized describes a response with status code 401, with default header values.
|
||||||
|
|
||||||
|
Access Unauthorized, invalid API-KEY was used
|
||||||
|
*/
|
||||||
|
type GetMeUnauthorized struct {
|
||||||
|
Payload *members_models.Error
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this get me unauthorized response has a 2xx status code
|
||||||
|
func (o *GetMeUnauthorized) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this get me unauthorized response has a 3xx status code
|
||||||
|
func (o *GetMeUnauthorized) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this get me unauthorized response has a 4xx status code
|
||||||
|
func (o *GetMeUnauthorized) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this get me unauthorized response has a 5xx status code
|
||||||
|
func (o *GetMeUnauthorized) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this get me unauthorized response a status code equal to that given
|
||||||
|
func (o *GetMeUnauthorized) IsCode(code int) bool {
|
||||||
|
return code == 401
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the get me unauthorized response
|
||||||
|
func (o *GetMeUnauthorized) Code() int {
|
||||||
|
return 401
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetMeUnauthorized) Error() string {
|
||||||
|
return fmt.Sprintf("[GET /sessions/me][%d] getMeUnauthorized %+v", 401, o.Payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetMeUnauthorized) String() string {
|
||||||
|
return fmt.Sprintf("[GET /sessions/me][%d] getMeUnauthorized %+v", 401, o.Payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetMeUnauthorized) GetPayload() *members_models.Error {
|
||||||
|
return o.Payload
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetMeUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
o.Payload = new(members_models.Error)
|
||||||
|
|
||||||
|
// response payload
|
||||||
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
|
@ -0,0 +1,132 @@
|
||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// (c) 2012-2020 by Taxnexus, Inc.
|
||||||
|
// All rights reserved worldwide.
|
||||||
|
// Proprietary product; unlicensed use is not allowed
|
||||||
|
|
||||||
|
package sessions
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
cr "github.com/go-openapi/runtime/client"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewRefreshSessionParams creates a new RefreshSessionParams 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 NewRefreshSessionParams() *RefreshSessionParams {
|
||||||
|
return &RefreshSessionParams{
|
||||||
|
timeout: cr.DefaultTimeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewRefreshSessionParamsWithTimeout creates a new RefreshSessionParams object
|
||||||
|
// with the ability to set a timeout on a request.
|
||||||
|
func NewRefreshSessionParamsWithTimeout(timeout time.Duration) *RefreshSessionParams {
|
||||||
|
return &RefreshSessionParams{
|
||||||
|
timeout: timeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewRefreshSessionParamsWithContext creates a new RefreshSessionParams object
|
||||||
|
// with the ability to set a context for a request.
|
||||||
|
func NewRefreshSessionParamsWithContext(ctx context.Context) *RefreshSessionParams {
|
||||||
|
return &RefreshSessionParams{
|
||||||
|
Context: ctx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewRefreshSessionParamsWithHTTPClient creates a new RefreshSessionParams object
|
||||||
|
// with the ability to set a custom HTTPClient for a request.
|
||||||
|
func NewRefreshSessionParamsWithHTTPClient(client *http.Client) *RefreshSessionParams {
|
||||||
|
return &RefreshSessionParams{
|
||||||
|
HTTPClient: client,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
RefreshSessionParams contains all the parameters to send to the API endpoint
|
||||||
|
|
||||||
|
for the refresh session operation.
|
||||||
|
|
||||||
|
Typically these are written to a http.Request.
|
||||||
|
*/
|
||||||
|
type RefreshSessionParams struct {
|
||||||
|
timeout time.Duration
|
||||||
|
Context context.Context
|
||||||
|
HTTPClient *http.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithDefaults hydrates default values in the refresh session params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *RefreshSessionParams) WithDefaults() *RefreshSessionParams {
|
||||||
|
o.SetDefaults()
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetDefaults hydrates default values in the refresh session params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *RefreshSessionParams) SetDefaults() {
|
||||||
|
// no default values defined for this parameter
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithTimeout adds the timeout to the refresh session params
|
||||||
|
func (o *RefreshSessionParams) WithTimeout(timeout time.Duration) *RefreshSessionParams {
|
||||||
|
o.SetTimeout(timeout)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetTimeout adds the timeout to the refresh session params
|
||||||
|
func (o *RefreshSessionParams) SetTimeout(timeout time.Duration) {
|
||||||
|
o.timeout = timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithContext adds the context to the refresh session params
|
||||||
|
func (o *RefreshSessionParams) WithContext(ctx context.Context) *RefreshSessionParams {
|
||||||
|
o.SetContext(ctx)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetContext adds the context to the refresh session params
|
||||||
|
func (o *RefreshSessionParams) SetContext(ctx context.Context) {
|
||||||
|
o.Context = ctx
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithHTTPClient adds the HTTPClient to the refresh session params
|
||||||
|
func (o *RefreshSessionParams) WithHTTPClient(client *http.Client) *RefreshSessionParams {
|
||||||
|
o.SetHTTPClient(client)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetHTTPClient adds the HTTPClient to the refresh session params
|
||||||
|
func (o *RefreshSessionParams) SetHTTPClient(client *http.Client) {
|
||||||
|
o.HTTPClient = client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteToRequest writes these params to a swagger request
|
||||||
|
func (o *RefreshSessionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := r.SetTimeout(o.timeout); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
|
@ -0,0 +1,180 @@
|
||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// (c) 2012-2020 by Taxnexus, Inc.
|
||||||
|
// All rights reserved worldwide.
|
||||||
|
// Proprietary product; unlicensed use is not allowed
|
||||||
|
|
||||||
|
package sessions
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"io"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
|
||||||
|
"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
|
||||||
|
)
|
||||||
|
|
||||||
|
// RefreshSessionReader is a Reader for the RefreshSession structure.
|
||||||
|
type RefreshSessionReader struct {
|
||||||
|
formats strfmt.Registry
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReadResponse reads a server response into the received o.
|
||||||
|
func (o *RefreshSessionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||||
|
switch response.Code() {
|
||||||
|
case 200:
|
||||||
|
result := NewRefreshSessionOK()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return result, nil
|
||||||
|
case 401:
|
||||||
|
result := NewRefreshSessionUnauthorized()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
default:
|
||||||
|
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewRefreshSessionOK creates a RefreshSessionOK with default headers values
|
||||||
|
func NewRefreshSessionOK() *RefreshSessionOK {
|
||||||
|
return &RefreshSessionOK{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
RefreshSessionOK describes a response with status code 200, with default header values.
|
||||||
|
|
||||||
|
Token refreshed
|
||||||
|
*/
|
||||||
|
type RefreshSessionOK struct {
|
||||||
|
|
||||||
|
/* New kvSession cookie with updated expiry
|
||||||
|
*/
|
||||||
|
SetCookie string
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this refresh session o k response has a 2xx status code
|
||||||
|
func (o *RefreshSessionOK) IsSuccess() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this refresh session o k response has a 3xx status code
|
||||||
|
func (o *RefreshSessionOK) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this refresh session o k response has a 4xx status code
|
||||||
|
func (o *RefreshSessionOK) IsClientError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this refresh session o k response has a 5xx status code
|
||||||
|
func (o *RefreshSessionOK) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this refresh session o k response a status code equal to that given
|
||||||
|
func (o *RefreshSessionOK) IsCode(code int) bool {
|
||||||
|
return code == 200
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the refresh session o k response
|
||||||
|
func (o *RefreshSessionOK) Code() int {
|
||||||
|
return 200
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *RefreshSessionOK) Error() string {
|
||||||
|
return fmt.Sprintf("[POST /sessions/refresh][%d] refreshSessionOK ", 200)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *RefreshSessionOK) String() string {
|
||||||
|
return fmt.Sprintf("[POST /sessions/refresh][%d] refreshSessionOK ", 200)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *RefreshSessionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// hydrates response header Set-Cookie
|
||||||
|
hdrSetCookie := response.GetHeader("Set-Cookie")
|
||||||
|
|
||||||
|
if hdrSetCookie != "" {
|
||||||
|
o.SetCookie = hdrSetCookie
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewRefreshSessionUnauthorized creates a RefreshSessionUnauthorized with default headers values
|
||||||
|
func NewRefreshSessionUnauthorized() *RefreshSessionUnauthorized {
|
||||||
|
return &RefreshSessionUnauthorized{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
RefreshSessionUnauthorized describes a response with status code 401, with default header values.
|
||||||
|
|
||||||
|
Access Unauthorized, invalid API-KEY was used
|
||||||
|
*/
|
||||||
|
type RefreshSessionUnauthorized struct {
|
||||||
|
Payload *members_models.Error
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this refresh session unauthorized response has a 2xx status code
|
||||||
|
func (o *RefreshSessionUnauthorized) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this refresh session unauthorized response has a 3xx status code
|
||||||
|
func (o *RefreshSessionUnauthorized) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this refresh session unauthorized response has a 4xx status code
|
||||||
|
func (o *RefreshSessionUnauthorized) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this refresh session unauthorized response has a 5xx status code
|
||||||
|
func (o *RefreshSessionUnauthorized) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this refresh session unauthorized response a status code equal to that given
|
||||||
|
func (o *RefreshSessionUnauthorized) IsCode(code int) bool {
|
||||||
|
return code == 401
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the refresh session unauthorized response
|
||||||
|
func (o *RefreshSessionUnauthorized) Code() int {
|
||||||
|
return 401
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *RefreshSessionUnauthorized) Error() string {
|
||||||
|
return fmt.Sprintf("[POST /sessions/refresh][%d] refreshSessionUnauthorized %+v", 401, o.Payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *RefreshSessionUnauthorized) String() string {
|
||||||
|
return fmt.Sprintf("[POST /sessions/refresh][%d] refreshSessionUnauthorized %+v", 401, o.Payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *RefreshSessionUnauthorized) GetPayload() *members_models.Error {
|
||||||
|
return o.Payload
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *RefreshSessionUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
o.Payload = new(members_models.Error)
|
||||||
|
|
||||||
|
// response payload
|
||||||
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
|
@ -0,0 +1,206 @@
|
||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// (c) 2012-2020 by Taxnexus, Inc.
|
||||||
|
// All rights reserved worldwide.
|
||||||
|
// Proprietary product; unlicensed use is not allowed
|
||||||
|
|
||||||
|
package sessions
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// New creates a new sessions API client.
|
||||||
|
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
|
||||||
|
return &Client{transport: transport, formats: formats}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Client for sessions API
|
||||||
|
*/
|
||||||
|
type Client struct {
|
||||||
|
transport runtime.ClientTransport
|
||||||
|
formats strfmt.Registry
|
||||||
|
}
|
||||||
|
|
||||||
|
// ClientOption is the option for Client methods
|
||||||
|
type ClientOption func(*runtime.ClientOperation)
|
||||||
|
|
||||||
|
// ClientService is the interface for Client methods
|
||||||
|
type ClientService interface {
|
||||||
|
CreateSession(params *CreateSessionParams, opts ...ClientOption) (*CreateSessionOK, error)
|
||||||
|
|
||||||
|
DeleteSession(params *DeleteSessionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteSessionNoContent, error)
|
||||||
|
|
||||||
|
GetMe(params *GetMeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetMeOK, error)
|
||||||
|
|
||||||
|
RefreshSession(params *RefreshSessionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RefreshSessionOK, error)
|
||||||
|
|
||||||
|
SetTransport(transport runtime.ClientTransport)
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
CreateSession creates new session sign in
|
||||||
|
*/
|
||||||
|
func (a *Client) CreateSession(params *CreateSessionParams, opts ...ClientOption) (*CreateSessionOK, error) {
|
||||||
|
// TODO: Validate the params before sending
|
||||||
|
if params == nil {
|
||||||
|
params = NewCreateSessionParams()
|
||||||
|
}
|
||||||
|
op := &runtime.ClientOperation{
|
||||||
|
ID: "createSession",
|
||||||
|
Method: "POST",
|
||||||
|
PathPattern: "/sessions",
|
||||||
|
ProducesMediaTypes: []string{"application/json"},
|
||||||
|
ConsumesMediaTypes: []string{"application/json"},
|
||||||
|
Schemes: []string{"http"},
|
||||||
|
Params: params,
|
||||||
|
Reader: &CreateSessionReader{formats: a.formats},
|
||||||
|
Context: params.Context,
|
||||||
|
Client: params.HTTPClient,
|
||||||
|
}
|
||||||
|
for _, opt := range opts {
|
||||||
|
opt(op)
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err := a.transport.Submit(op)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
success, ok := result.(*CreateSessionOK)
|
||||||
|
if ok {
|
||||||
|
return success, nil
|
||||||
|
}
|
||||||
|
// unexpected success response
|
||||||
|
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||||
|
msg := fmt.Sprintf("unexpected success response for createSession: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||||
|
panic(msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
DeleteSession deletes current session log out
|
||||||
|
*/
|
||||||
|
func (a *Client) DeleteSession(params *DeleteSessionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteSessionNoContent, error) {
|
||||||
|
// TODO: Validate the params before sending
|
||||||
|
if params == nil {
|
||||||
|
params = NewDeleteSessionParams()
|
||||||
|
}
|
||||||
|
op := &runtime.ClientOperation{
|
||||||
|
ID: "deleteSession",
|
||||||
|
Method: "DELETE",
|
||||||
|
PathPattern: "/sessions/current",
|
||||||
|
ProducesMediaTypes: []string{"application/json"},
|
||||||
|
ConsumesMediaTypes: []string{"application/json"},
|
||||||
|
Schemes: []string{"http"},
|
||||||
|
Params: params,
|
||||||
|
Reader: &DeleteSessionReader{formats: a.formats},
|
||||||
|
AuthInfo: authInfo,
|
||||||
|
Context: params.Context,
|
||||||
|
Client: params.HTTPClient,
|
||||||
|
}
|
||||||
|
for _, opt := range opts {
|
||||||
|
opt(op)
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err := a.transport.Submit(op)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
success, ok := result.(*DeleteSessionNoContent)
|
||||||
|
if ok {
|
||||||
|
return success, nil
|
||||||
|
}
|
||||||
|
// unexpected success response
|
||||||
|
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||||
|
msg := fmt.Sprintf("unexpected success response for deleteSession: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||||
|
panic(msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GetMe gets current user
|
||||||
|
*/
|
||||||
|
func (a *Client) GetMe(params *GetMeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetMeOK, error) {
|
||||||
|
// TODO: Validate the params before sending
|
||||||
|
if params == nil {
|
||||||
|
params = NewGetMeParams()
|
||||||
|
}
|
||||||
|
op := &runtime.ClientOperation{
|
||||||
|
ID: "getMe",
|
||||||
|
Method: "GET",
|
||||||
|
PathPattern: "/sessions/me",
|
||||||
|
ProducesMediaTypes: []string{"application/json"},
|
||||||
|
ConsumesMediaTypes: []string{"application/json"},
|
||||||
|
Schemes: []string{"http"},
|
||||||
|
Params: params,
|
||||||
|
Reader: &GetMeReader{formats: a.formats},
|
||||||
|
AuthInfo: authInfo,
|
||||||
|
Context: params.Context,
|
||||||
|
Client: params.HTTPClient,
|
||||||
|
}
|
||||||
|
for _, opt := range opts {
|
||||||
|
opt(op)
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err := a.transport.Submit(op)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
success, ok := result.(*GetMeOK)
|
||||||
|
if ok {
|
||||||
|
return success, nil
|
||||||
|
}
|
||||||
|
// unexpected success response
|
||||||
|
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||||
|
msg := fmt.Sprintf("unexpected success response for getMe: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||||
|
panic(msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
RefreshSession refreshes session cookie
|
||||||
|
*/
|
||||||
|
func (a *Client) RefreshSession(params *RefreshSessionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RefreshSessionOK, error) {
|
||||||
|
// TODO: Validate the params before sending
|
||||||
|
if params == nil {
|
||||||
|
params = NewRefreshSessionParams()
|
||||||
|
}
|
||||||
|
op := &runtime.ClientOperation{
|
||||||
|
ID: "refreshSession",
|
||||||
|
Method: "POST",
|
||||||
|
PathPattern: "/sessions/refresh",
|
||||||
|
ProducesMediaTypes: []string{"application/json"},
|
||||||
|
ConsumesMediaTypes: []string{"application/json"},
|
||||||
|
Schemes: []string{"http"},
|
||||||
|
Params: params,
|
||||||
|
Reader: &RefreshSessionReader{formats: a.formats},
|
||||||
|
AuthInfo: authInfo,
|
||||||
|
Context: params.Context,
|
||||||
|
Client: params.HTTPClient,
|
||||||
|
}
|
||||||
|
for _, opt := range opts {
|
||||||
|
opt(op)
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err := a.transport.Submit(op)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
success, ok := result.(*RefreshSessionOK)
|
||||||
|
if ok {
|
||||||
|
return success, nil
|
||||||
|
}
|
||||||
|
// unexpected success response
|
||||||
|
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||||
|
msg := fmt.Sprintf("unexpected success response for refreshSession: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||||
|
panic(msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetTransport changes the transport on the client
|
||||||
|
func (a *Client) SetTransport(transport runtime.ClientTransport) {
|
||||||
|
a.transport = transport
|
||||||
|
}
|
|
@ -0,0 +1,104 @@
|
||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// (c) 2012-2020 by Taxnexus, Inc.
|
||||||
|
// All rights reserved worldwide.
|
||||||
|
// Proprietary product; unlicensed use is not allowed
|
||||||
|
|
||||||
|
package members_models
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/swag"
|
||||||
|
"github.com/go-openapi/validate"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Credentials credentials
|
||||||
|
//
|
||||||
|
// swagger:model credentials
|
||||||
|
type Credentials struct {
|
||||||
|
|
||||||
|
// email
|
||||||
|
// Example: user@example.com
|
||||||
|
// Required: true
|
||||||
|
// Format: email
|
||||||
|
Email *strfmt.Email `json:"email"`
|
||||||
|
|
||||||
|
// password
|
||||||
|
// Example: p@55w0rd-example
|
||||||
|
// Required: true
|
||||||
|
// Min Length: 12
|
||||||
|
Password *string `json:"password"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this credentials
|
||||||
|
func (m *Credentials) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validateEmail(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validatePassword(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Credentials) validateEmail(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("email", "body", m.Email); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := validate.FormatOf("email", "body", "email", m.Email.String(), formats); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Credentials) validatePassword(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("password", "body", m.Password); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := validate.MinLength("password", "body", *m.Password, 12); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// ContextValidate validates this credentials based on context it is used
|
||||||
|
func (m *Credentials) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *Credentials) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *Credentials) UnmarshalBinary(b []byte) error {
|
||||||
|
var res Credentials
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
|
@ -65,6 +65,12 @@ GetCompaniesParams contains all the parameters to send to the API endpoint
|
||||||
*/
|
*/
|
||||||
type GetCompaniesParams struct {
|
type GetCompaniesParams struct {
|
||||||
|
|
||||||
|
/* Channel.
|
||||||
|
|
||||||
|
The channel to filter companies by
|
||||||
|
*/
|
||||||
|
Channel *string
|
||||||
|
|
||||||
/* CompanyID.
|
/* CompanyID.
|
||||||
|
|
||||||
Record Id of an Company
|
Record Id of an Company
|
||||||
|
@ -130,6 +136,17 @@ func (o *GetCompaniesParams) SetHTTPClient(client *http.Client) {
|
||||||
o.HTTPClient = client
|
o.HTTPClient = client
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// WithChannel adds the channel to the get companies params
|
||||||
|
func (o *GetCompaniesParams) WithChannel(channel *string) *GetCompaniesParams {
|
||||||
|
o.SetChannel(channel)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetChannel adds the channel to the get companies params
|
||||||
|
func (o *GetCompaniesParams) SetChannel(channel *string) {
|
||||||
|
o.Channel = channel
|
||||||
|
}
|
||||||
|
|
||||||
// WithCompanyID adds the companyID to the get companies params
|
// WithCompanyID adds the companyID to the get companies params
|
||||||
func (o *GetCompaniesParams) WithCompanyID(companyID *string) *GetCompaniesParams {
|
func (o *GetCompaniesParams) WithCompanyID(companyID *string) *GetCompaniesParams {
|
||||||
o.SetCompanyID(companyID)
|
o.SetCompanyID(companyID)
|
||||||
|
@ -160,6 +177,23 @@ func (o *GetCompaniesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.
|
||||||
}
|
}
|
||||||
var res []error
|
var res []error
|
||||||
|
|
||||||
|
if o.Channel != nil {
|
||||||
|
|
||||||
|
// query param channel
|
||||||
|
var qrChannel string
|
||||||
|
|
||||||
|
if o.Channel != nil {
|
||||||
|
qrChannel = *o.Channel
|
||||||
|
}
|
||||||
|
qChannel := qrChannel
|
||||||
|
if qChannel != "" {
|
||||||
|
|
||||||
|
if err := r.SetQueryParam("channel", qChannel); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if o.CompanyID != nil {
|
if o.CompanyID != nil {
|
||||||
|
|
||||||
// query param companyId
|
// query param companyId
|
||||||
|
|
|
@ -0,0 +1,87 @@
|
||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// (c) 2012-2020 by Taxnexus, Inc.
|
||||||
|
// All rights reserved worldwide.
|
||||||
|
// Proprietary product; unlicensed use is not allowed
|
||||||
|
|
||||||
|
package plex_models
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/swag"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Category Junction object between Industry and Company
|
||||||
|
//
|
||||||
|
// swagger:model Category
|
||||||
|
type Category struct {
|
||||||
|
|
||||||
|
// ID of the Company that owns this Category
|
||||||
|
CompanyID *string `json:"CompanyID,omitempty"`
|
||||||
|
|
||||||
|
// Name of the Company
|
||||||
|
CompanyName *string `json:"CompanyName,omitempty"`
|
||||||
|
|
||||||
|
// Slug of the Company
|
||||||
|
CompanySlug *string `json:"CompanySlug,omitempty"`
|
||||||
|
|
||||||
|
// TagLine of the Company
|
||||||
|
CompanyTagLine *string `json:"CompanyTagLine,omitempty"`
|
||||||
|
|
||||||
|
// Created Date
|
||||||
|
CreatedByDate *string `json:"CreatedByDate,omitempty"`
|
||||||
|
|
||||||
|
// Created By User ID
|
||||||
|
CreatedByID *string `json:"CreatedByID,omitempty"`
|
||||||
|
|
||||||
|
// Record Id
|
||||||
|
ID string `json:"ID,omitempty"`
|
||||||
|
|
||||||
|
// ID of the Industry that owns this Category
|
||||||
|
IndustryID *string `json:"IndustryID,omitempty"`
|
||||||
|
|
||||||
|
// Name of the Industry
|
||||||
|
IndustryName *string `json:"IndustryName,omitempty"`
|
||||||
|
|
||||||
|
// Slug of the Industry
|
||||||
|
IndustrySlug *string `json:"IndustrySlug,omitempty"`
|
||||||
|
|
||||||
|
// TagLine of the Industry
|
||||||
|
IndustryTagLine *string `json:"IndustryTagLine,omitempty"`
|
||||||
|
|
||||||
|
// The full path of this category, including Parent
|
||||||
|
Path *string `json:"Path,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this category
|
||||||
|
func (m *Category) Validate(formats strfmt.Registry) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// ContextValidate validates this category based on context it is used
|
||||||
|
func (m *Category) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *Category) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *Category) UnmarshalBinary(b []byte) error {
|
||||||
|
var res Category
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
|
@ -41,6 +41,9 @@ type Company struct {
|
||||||
// Salesforce AppExchange URL
|
// Salesforce AppExchange URL
|
||||||
AppExchange *string `json:"AppExchange,omitempty"`
|
AppExchange *string `json:"AppExchange,omitempty"`
|
||||||
|
|
||||||
|
// Company Categories
|
||||||
|
Categories []*Category `json:"Categories"`
|
||||||
|
|
||||||
// cloud revenue total
|
// cloud revenue total
|
||||||
CloudRevenueTotal *float64 `json:"CloudRevenueTotal,omitempty"`
|
CloudRevenueTotal *float64 `json:"CloudRevenueTotal,omitempty"`
|
||||||
|
|
||||||
|
@ -50,12 +53,6 @@ type Company struct {
|
||||||
// The year company started cloud revenue
|
// The year company started cloud revenue
|
||||||
CloudYear *string `json:"CloudYear,omitempty"`
|
CloudYear *string `json:"CloudYear,omitempty"`
|
||||||
|
|
||||||
// Company Products
|
|
||||||
CompanyProducts []*CompanyProduct `json:"CompanyProducts"`
|
|
||||||
|
|
||||||
// Company Services
|
|
||||||
CompanyServices []*CompanyService `json:"CompanyServices"`
|
|
||||||
|
|
||||||
// Company Crunchbase URL
|
// Company Crunchbase URL
|
||||||
CrunchbaseURL *string `json:"CrunchbaseURL,omitempty"`
|
CrunchbaseURL *string `json:"CrunchbaseURL,omitempty"`
|
||||||
|
|
||||||
|
@ -104,9 +101,6 @@ type Company struct {
|
||||||
// Industry
|
// Industry
|
||||||
Industry *string `json:"Industry,omitempty"`
|
Industry *string `json:"Industry,omitempty"`
|
||||||
|
|
||||||
// Similar Companies
|
|
||||||
IndustryCompanies []*IndustryCompany `json:"IndustryCompanies"`
|
|
||||||
|
|
||||||
// Company LinkedIn URL
|
// Company LinkedIn URL
|
||||||
LinkedIn *string `json:"LinkedIn,omitempty"`
|
LinkedIn *string `json:"LinkedIn,omitempty"`
|
||||||
|
|
||||||
|
@ -140,12 +134,18 @@ type Company struct {
|
||||||
// Phone
|
// Phone
|
||||||
Phone *string `json:"Phone,omitempty"`
|
Phone *string `json:"Phone,omitempty"`
|
||||||
|
|
||||||
|
// Company Products
|
||||||
|
Products []*Product `json:"Products"`
|
||||||
|
|
||||||
// Publish this record?
|
// Publish this record?
|
||||||
Publish *bool `json:"Publish,omitempty"`
|
Publish *bool `json:"Publish,omitempty"`
|
||||||
|
|
||||||
// A Salesforce-First company?
|
// A Salesforce-First company?
|
||||||
SalesforceFirst *bool `json:"SalesforceFirst,omitempty"`
|
SalesforceFirst *bool `json:"SalesforceFirst,omitempty"`
|
||||||
|
|
||||||
|
// Company Services
|
||||||
|
Services []*Service `json:"Services"`
|
||||||
|
|
||||||
// Slug
|
// Slug
|
||||||
Slug *string `json:"Slug,omitempty"`
|
Slug *string `json:"Slug,omitempty"`
|
||||||
|
|
||||||
|
@ -172,11 +172,7 @@ type Company struct {
|
||||||
func (m *Company) Validate(formats strfmt.Registry) error {
|
func (m *Company) Validate(formats strfmt.Registry) error {
|
||||||
var res []error
|
var res []error
|
||||||
|
|
||||||
if err := m.validateCompanyProducts(formats); err != nil {
|
if err := m.validateCategories(formats); err != nil {
|
||||||
res = append(res, err)
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := m.validateCompanyServices(formats); err != nil {
|
|
||||||
res = append(res, err)
|
res = append(res, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -184,11 +180,15 @@ func (m *Company) Validate(formats strfmt.Registry) error {
|
||||||
res = append(res, err)
|
res = append(res, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := m.validateIndustryCompanies(formats); err != nil {
|
if err := m.validateListingAddress(formats); err != nil {
|
||||||
res = append(res, err)
|
res = append(res, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := m.validateListingAddress(formats); err != nil {
|
if err := m.validateProducts(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateServices(formats); err != nil {
|
||||||
res = append(res, err)
|
res = append(res, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -198,48 +198,22 @@ func (m *Company) Validate(formats strfmt.Registry) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Company) validateCompanyProducts(formats strfmt.Registry) error {
|
func (m *Company) validateCategories(formats strfmt.Registry) error {
|
||||||
if swag.IsZero(m.CompanyProducts) { // not required
|
if swag.IsZero(m.Categories) { // not required
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
for i := 0; i < len(m.CompanyProducts); i++ {
|
for i := 0; i < len(m.Categories); i++ {
|
||||||
if swag.IsZero(m.CompanyProducts[i]) { // not required
|
if swag.IsZero(m.Categories[i]) { // not required
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if m.CompanyProducts[i] != nil {
|
if m.Categories[i] != nil {
|
||||||
if err := m.CompanyProducts[i].Validate(formats); err != nil {
|
if err := m.Categories[i].Validate(formats); err != nil {
|
||||||
if ve, ok := err.(*errors.Validation); ok {
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
return ve.ValidateName("CompanyProducts" + "." + strconv.Itoa(i))
|
return ve.ValidateName("Categories" + "." + strconv.Itoa(i))
|
||||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||||
return ce.ValidateName("CompanyProducts" + "." + strconv.Itoa(i))
|
return ce.ValidateName("Categories" + "." + strconv.Itoa(i))
|
||||||
}
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Company) validateCompanyServices(formats strfmt.Registry) error {
|
|
||||||
if swag.IsZero(m.CompanyServices) { // not required
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
for i := 0; i < len(m.CompanyServices); i++ {
|
|
||||||
if swag.IsZero(m.CompanyServices[i]) { // not required
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
if m.CompanyServices[i] != nil {
|
|
||||||
if err := m.CompanyServices[i].Validate(formats); err != nil {
|
|
||||||
if ve, ok := err.(*errors.Validation); ok {
|
|
||||||
return ve.ValidateName("CompanyServices" + "." + strconv.Itoa(i))
|
|
||||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
|
||||||
return ce.ValidateName("CompanyServices" + "." + strconv.Itoa(i))
|
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -276,32 +250,6 @@ func (m *Company) validateFinancialStatements(formats strfmt.Registry) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Company) validateIndustryCompanies(formats strfmt.Registry) error {
|
|
||||||
if swag.IsZero(m.IndustryCompanies) { // not required
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
for i := 0; i < len(m.IndustryCompanies); i++ {
|
|
||||||
if swag.IsZero(m.IndustryCompanies[i]) { // not required
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
if m.IndustryCompanies[i] != nil {
|
|
||||||
if err := m.IndustryCompanies[i].Validate(formats); err != nil {
|
|
||||||
if ve, ok := err.(*errors.Validation); ok {
|
|
||||||
return ve.ValidateName("IndustryCompanies" + "." + strconv.Itoa(i))
|
|
||||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
|
||||||
return ce.ValidateName("IndustryCompanies" + "." + strconv.Itoa(i))
|
|
||||||
}
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Company) validateListingAddress(formats strfmt.Registry) error {
|
func (m *Company) validateListingAddress(formats strfmt.Registry) error {
|
||||||
if swag.IsZero(m.ListingAddress) { // not required
|
if swag.IsZero(m.ListingAddress) { // not required
|
||||||
return nil
|
return nil
|
||||||
|
@ -321,46 +269,22 @@ func (m *Company) validateListingAddress(formats strfmt.Registry) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ContextValidate validate this company based on the context it is used
|
func (m *Company) validateProducts(formats strfmt.Registry) error {
|
||||||
func (m *Company) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
if swag.IsZero(m.Products) { // not required
|
||||||
var res []error
|
return nil
|
||||||
|
|
||||||
if err := m.contextValidateCompanyProducts(ctx, formats); err != nil {
|
|
||||||
res = append(res, err)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := m.contextValidateCompanyServices(ctx, formats); err != nil {
|
for i := 0; i < len(m.Products); i++ {
|
||||||
res = append(res, err)
|
if swag.IsZero(m.Products[i]) { // not required
|
||||||
}
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
if err := m.contextValidateFinancialStatements(ctx, formats); err != nil {
|
if m.Products[i] != nil {
|
||||||
res = append(res, err)
|
if err := m.Products[i].Validate(formats); err != nil {
|
||||||
}
|
|
||||||
|
|
||||||
if err := m.contextValidateIndustryCompanies(ctx, formats); err != nil {
|
|
||||||
res = append(res, err)
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := m.contextValidateListingAddress(ctx, formats); err != nil {
|
|
||||||
res = append(res, err)
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(res) > 0 {
|
|
||||||
return errors.CompositeValidationError(res...)
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Company) contextValidateCompanyProducts(ctx context.Context, formats strfmt.Registry) error {
|
|
||||||
|
|
||||||
for i := 0; i < len(m.CompanyProducts); i++ {
|
|
||||||
|
|
||||||
if m.CompanyProducts[i] != nil {
|
|
||||||
if err := m.CompanyProducts[i].ContextValidate(ctx, formats); err != nil {
|
|
||||||
if ve, ok := err.(*errors.Validation); ok {
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
return ve.ValidateName("CompanyProducts" + "." + strconv.Itoa(i))
|
return ve.ValidateName("Products" + "." + strconv.Itoa(i))
|
||||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||||
return ce.ValidateName("CompanyProducts" + "." + strconv.Itoa(i))
|
return ce.ValidateName("Products" + "." + strconv.Itoa(i))
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -371,16 +295,72 @@ func (m *Company) contextValidateCompanyProducts(ctx context.Context, formats st
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Company) contextValidateCompanyServices(ctx context.Context, formats strfmt.Registry) error {
|
func (m *Company) validateServices(formats strfmt.Registry) error {
|
||||||
|
if swag.IsZero(m.Services) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
for i := 0; i < len(m.CompanyServices); i++ {
|
for i := 0; i < len(m.Services); i++ {
|
||||||
|
if swag.IsZero(m.Services[i]) { // not required
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
if m.CompanyServices[i] != nil {
|
if m.Services[i] != nil {
|
||||||
if err := m.CompanyServices[i].ContextValidate(ctx, formats); err != nil {
|
if err := m.Services[i].Validate(formats); err != nil {
|
||||||
if ve, ok := err.(*errors.Validation); ok {
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
return ve.ValidateName("CompanyServices" + "." + strconv.Itoa(i))
|
return ve.ValidateName("Services" + "." + strconv.Itoa(i))
|
||||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||||
return ce.ValidateName("CompanyServices" + "." + strconv.Itoa(i))
|
return ce.ValidateName("Services" + "." + strconv.Itoa(i))
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// ContextValidate validate this company based on the context it is used
|
||||||
|
func (m *Company) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.contextValidateCategories(ctx, formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.contextValidateFinancialStatements(ctx, formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.contextValidateListingAddress(ctx, formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.contextValidateProducts(ctx, formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.contextValidateServices(ctx, formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Company) contextValidateCategories(ctx context.Context, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
for i := 0; i < len(m.Categories); i++ {
|
||||||
|
|
||||||
|
if m.Categories[i] != nil {
|
||||||
|
if err := m.Categories[i].ContextValidate(ctx, formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("Categories" + "." + strconv.Itoa(i))
|
||||||
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||||
|
return ce.ValidateName("Categories" + "." + strconv.Itoa(i))
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -411,26 +391,6 @@ func (m *Company) contextValidateFinancialStatements(ctx context.Context, format
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Company) contextValidateIndustryCompanies(ctx context.Context, formats strfmt.Registry) error {
|
|
||||||
|
|
||||||
for i := 0; i < len(m.IndustryCompanies); i++ {
|
|
||||||
|
|
||||||
if m.IndustryCompanies[i] != nil {
|
|
||||||
if err := m.IndustryCompanies[i].ContextValidate(ctx, formats); err != nil {
|
|
||||||
if ve, ok := err.(*errors.Validation); ok {
|
|
||||||
return ve.ValidateName("IndustryCompanies" + "." + strconv.Itoa(i))
|
|
||||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
|
||||||
return ce.ValidateName("IndustryCompanies" + "." + strconv.Itoa(i))
|
|
||||||
}
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Company) contextValidateListingAddress(ctx context.Context, formats strfmt.Registry) error {
|
func (m *Company) contextValidateListingAddress(ctx context.Context, formats strfmt.Registry) error {
|
||||||
|
|
||||||
if m.ListingAddress != nil {
|
if m.ListingAddress != nil {
|
||||||
|
@ -447,6 +407,46 @@ func (m *Company) contextValidateListingAddress(ctx context.Context, formats str
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *Company) contextValidateProducts(ctx context.Context, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
for i := 0; i < len(m.Products); i++ {
|
||||||
|
|
||||||
|
if m.Products[i] != nil {
|
||||||
|
if err := m.Products[i].ContextValidate(ctx, formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("Products" + "." + strconv.Itoa(i))
|
||||||
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||||
|
return ce.ValidateName("Products" + "." + strconv.Itoa(i))
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Company) contextValidateServices(ctx context.Context, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
for i := 0; i < len(m.Services); i++ {
|
||||||
|
|
||||||
|
if m.Services[i] != nil {
|
||||||
|
if err := m.Services[i].ContextValidate(ctx, formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("Services" + "." + strconv.Itoa(i))
|
||||||
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||||
|
return ce.ValidateName("Services" + "." + strconv.Itoa(i))
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// MarshalBinary interface implementation
|
// MarshalBinary interface implementation
|
||||||
func (m *Company) MarshalBinary() ([]byte, error) {
|
func (m *Company) MarshalBinary() ([]byte, error) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
|
|
|
@ -22,52 +22,52 @@ import (
|
||||||
type FinancialStatement struct {
|
type FinancialStatement struct {
|
||||||
|
|
||||||
// EDGAR Access Number
|
// EDGAR Access Number
|
||||||
AccessNumber string `json:"AccessNumber,omitempty"`
|
AccessNumber *string `json:"AccessNumber,omitempty"`
|
||||||
|
|
||||||
// Account ID
|
// Account ID
|
||||||
AccountID string `json:"AccountID,omitempty"`
|
AccountID *string `json:"AccountID,omitempty"`
|
||||||
|
|
||||||
// Cloud Revenue
|
// Cloud Revenue
|
||||||
CloudRevenue float64 `json:"CloudRevenue,omitempty"`
|
CloudRevenue *float64 `json:"CloudRevenue,omitempty"`
|
||||||
|
|
||||||
// Created By User ID
|
// Created By User ID
|
||||||
CreatedByID string `json:"CreatedByID,omitempty"`
|
CreatedByID *string `json:"CreatedByID,omitempty"`
|
||||||
|
|
||||||
// Created Date
|
// Created Date
|
||||||
CreatedDate string `json:"CreatedDate,omitempty"`
|
CreatedDate *string `json:"CreatedDate,omitempty"`
|
||||||
|
|
||||||
// Description
|
// Description
|
||||||
Description string `json:"Description,omitempty"`
|
Description *string `json:"Description,omitempty"`
|
||||||
|
|
||||||
// EDGAR URL
|
// EDGAR URL
|
||||||
EdgarURL string `json:"EdgarURL,omitempty"`
|
EdgarURL *string `json:"EdgarURL,omitempty"`
|
||||||
|
|
||||||
// Filing Type
|
// Filing Type
|
||||||
FilingType string `json:"FilingType,omitempty"`
|
FilingType *string `json:"FilingType,omitempty"`
|
||||||
|
|
||||||
// Gross Profit
|
// Gross Profit
|
||||||
GrossProfit float64 `json:"GrossProfit,omitempty"`
|
GrossProfit *float64 `json:"GrossProfit,omitempty"`
|
||||||
|
|
||||||
// Record Id
|
// Record Id
|
||||||
ID string `json:"ID,omitempty"`
|
ID string `json:"ID,omitempty"`
|
||||||
|
|
||||||
// Last Modified By User ID
|
// Last Modified By User ID
|
||||||
LastModifiedByID string `json:"LastModifiedByID,omitempty"`
|
LastModifiedByID *string `json:"LastModifiedByID,omitempty"`
|
||||||
|
|
||||||
// Last Modified Date
|
// Last Modified Date
|
||||||
LastModifiedDate string `json:"LastModifiedDate,omitempty"`
|
LastModifiedDate *string `json:"LastModifiedDate,omitempty"`
|
||||||
|
|
||||||
// Net Income
|
// Net Income
|
||||||
NetIncome float64 `json:"NetIncome,omitempty"`
|
NetIncome *float64 `json:"NetIncome,omitempty"`
|
||||||
|
|
||||||
// Period End Date
|
// Period End Date
|
||||||
PeriodEndDate string `json:"PeriodEndDate,omitempty"`
|
PeriodEndDate *string `json:"PeriodEndDate,omitempty"`
|
||||||
|
|
||||||
// Total Revenue
|
// Total Revenue
|
||||||
TotalRevenue float64 `json:"TotalRevenue,omitempty"`
|
TotalRevenue *float64 `json:"TotalRevenue,omitempty"`
|
||||||
|
|
||||||
// Year
|
// Year
|
||||||
Year string `json:"Year,omitempty"`
|
Year *string `json:"Year,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate validates this financial statement
|
// Validate validates this financial statement
|
||||||
|
|
|
@ -26,9 +26,6 @@ type Industry struct {
|
||||||
// The AccountIDs of the Companies in this Industry
|
// The AccountIDs of the Companies in this Industry
|
||||||
Companies []string `json:"Companies"`
|
Companies []string `json:"Companies"`
|
||||||
|
|
||||||
// The list of Products in this industry
|
|
||||||
CompanyProducts []*CompanyProduct `json:"CompanyProducts"`
|
|
||||||
|
|
||||||
// Created By User ID
|
// Created By User ID
|
||||||
CreatedByID *string `json:"CreatedByID,omitempty"`
|
CreatedByID *string `json:"CreatedByID,omitempty"`
|
||||||
|
|
||||||
|
@ -68,6 +65,9 @@ type Industry struct {
|
||||||
// The full path of this industry, including Parent
|
// The full path of this industry, including Parent
|
||||||
Path *string `json:"Path,omitempty"`
|
Path *string `json:"Path,omitempty"`
|
||||||
|
|
||||||
|
// The list of Products in this industry
|
||||||
|
Products []*Product `json:"Products"`
|
||||||
|
|
||||||
// The CMS Slug for this Industry
|
// The CMS Slug for this Industry
|
||||||
Slug *string `json:"Slug,omitempty"`
|
Slug *string `json:"Slug,omitempty"`
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ type Industry struct {
|
||||||
func (m *Industry) Validate(formats strfmt.Registry) error {
|
func (m *Industry) Validate(formats strfmt.Registry) error {
|
||||||
var res []error
|
var res []error
|
||||||
|
|
||||||
if err := m.validateCompanyProducts(formats); err != nil {
|
if err := m.validateProducts(formats); err != nil {
|
||||||
res = append(res, err)
|
res = append(res, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,22 +89,22 @@ func (m *Industry) Validate(formats strfmt.Registry) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Industry) validateCompanyProducts(formats strfmt.Registry) error {
|
func (m *Industry) validateProducts(formats strfmt.Registry) error {
|
||||||
if swag.IsZero(m.CompanyProducts) { // not required
|
if swag.IsZero(m.Products) { // not required
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
for i := 0; i < len(m.CompanyProducts); i++ {
|
for i := 0; i < len(m.Products); i++ {
|
||||||
if swag.IsZero(m.CompanyProducts[i]) { // not required
|
if swag.IsZero(m.Products[i]) { // not required
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if m.CompanyProducts[i] != nil {
|
if m.Products[i] != nil {
|
||||||
if err := m.CompanyProducts[i].Validate(formats); err != nil {
|
if err := m.Products[i].Validate(formats); err != nil {
|
||||||
if ve, ok := err.(*errors.Validation); ok {
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
return ve.ValidateName("CompanyProducts" + "." + strconv.Itoa(i))
|
return ve.ValidateName("Products" + "." + strconv.Itoa(i))
|
||||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||||
return ce.ValidateName("CompanyProducts" + "." + strconv.Itoa(i))
|
return ce.ValidateName("Products" + "." + strconv.Itoa(i))
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -119,7 +119,7 @@ func (m *Industry) validateCompanyProducts(formats strfmt.Registry) error {
|
||||||
func (m *Industry) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
func (m *Industry) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||||
var res []error
|
var res []error
|
||||||
|
|
||||||
if err := m.contextValidateCompanyProducts(ctx, formats); err != nil {
|
if err := m.contextValidateProducts(ctx, formats); err != nil {
|
||||||
res = append(res, err)
|
res = append(res, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,16 +129,16 @@ func (m *Industry) ContextValidate(ctx context.Context, formats strfmt.Registry)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Industry) contextValidateCompanyProducts(ctx context.Context, formats strfmt.Registry) error {
|
func (m *Industry) contextValidateProducts(ctx context.Context, formats strfmt.Registry) error {
|
||||||
|
|
||||||
for i := 0; i < len(m.CompanyProducts); i++ {
|
for i := 0; i < len(m.Products); i++ {
|
||||||
|
|
||||||
if m.CompanyProducts[i] != nil {
|
if m.Products[i] != nil {
|
||||||
if err := m.CompanyProducts[i].ContextValidate(ctx, formats); err != nil {
|
if err := m.Products[i].ContextValidate(ctx, formats); err != nil {
|
||||||
if ve, ok := err.(*errors.Validation); ok {
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
return ve.ValidateName("CompanyProducts" + "." + strconv.Itoa(i))
|
return ve.ValidateName("Products" + "." + strconv.Itoa(i))
|
||||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||||
return ce.ValidateName("CompanyProducts" + "." + strconv.Itoa(i))
|
return ce.ValidateName("Products" + "." + strconv.Itoa(i))
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,87 +0,0 @@
|
||||||
// Code generated by go-swagger; DO NOT EDIT.
|
|
||||||
|
|
||||||
// (c) 2012-2020 by Taxnexus, Inc.
|
|
||||||
// All rights reserved worldwide.
|
|
||||||
// Proprietary product; unlicensed use is not allowed
|
|
||||||
|
|
||||||
package plex_models
|
|
||||||
|
|
||||||
// This file was generated by the swagger tool.
|
|
||||||
// Editing this file might prove futile when you re-run the swagger generate command
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
|
|
||||||
"github.com/go-openapi/strfmt"
|
|
||||||
"github.com/go-openapi/swag"
|
|
||||||
)
|
|
||||||
|
|
||||||
// IndustryCompany Junction object between Industry and Company
|
|
||||||
//
|
|
||||||
// swagger:model IndustryCompany
|
|
||||||
type IndustryCompany struct {
|
|
||||||
|
|
||||||
// company ID
|
|
||||||
CompanyID string `json:"CompanyID,omitempty"`
|
|
||||||
|
|
||||||
// company name
|
|
||||||
CompanyName string `json:"CompanyName,omitempty"`
|
|
||||||
|
|
||||||
// company slug
|
|
||||||
CompanySlug string `json:"CompanySlug,omitempty"`
|
|
||||||
|
|
||||||
// company website
|
|
||||||
CompanyWebsite string `json:"CompanyWebsite,omitempty"`
|
|
||||||
|
|
||||||
// Record Id
|
|
||||||
ID string `json:"ID,omitempty"`
|
|
||||||
|
|
||||||
// industry ID
|
|
||||||
IndustryID string `json:"IndustryID,omitempty"`
|
|
||||||
|
|
||||||
// industry name
|
|
||||||
IndustryName string `json:"IndustryName,omitempty"`
|
|
||||||
|
|
||||||
// industry slug
|
|
||||||
IndustrySlug string `json:"IndustrySlug,omitempty"`
|
|
||||||
|
|
||||||
// industry tag line
|
|
||||||
IndustryTagLine string `json:"IndustryTagLine,omitempty"`
|
|
||||||
|
|
||||||
// Last Modified By User ID
|
|
||||||
LastModifiedByID string `json:"LastModifiedByID,omitempty"`
|
|
||||||
|
|
||||||
// Last Modified Date
|
|
||||||
LastModifiedDate string `json:"LastModifiedDate,omitempty"`
|
|
||||||
|
|
||||||
// path
|
|
||||||
Path string `json:"Path,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// Validate validates this industry company
|
|
||||||
func (m *IndustryCompany) Validate(formats strfmt.Registry) error {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// ContextValidate validates this industry company based on context it is used
|
|
||||||
func (m *IndustryCompany) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// MarshalBinary interface implementation
|
|
||||||
func (m *IndustryCompany) MarshalBinary() ([]byte, error) {
|
|
||||||
if m == nil {
|
|
||||||
return nil, nil
|
|
||||||
}
|
|
||||||
return swag.WriteJSON(m)
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnmarshalBinary interface implementation
|
|
||||||
func (m *IndustryCompany) UnmarshalBinary(b []byte) error {
|
|
||||||
var res IndustryCompany
|
|
||||||
if err := swag.ReadJSON(b, &res); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
*m = res
|
|
||||||
return nil
|
|
||||||
}
|
|
|
@ -18,10 +18,10 @@ import (
|
||||||
"github.com/go-openapi/swag"
|
"github.com/go-openapi/swag"
|
||||||
)
|
)
|
||||||
|
|
||||||
// CompanyProduct A software product or service vended by a Company
|
// Product A software product or service vended by a Company
|
||||||
//
|
//
|
||||||
// swagger:model CompanyProduct
|
// swagger:model Product
|
||||||
type CompanyProduct struct {
|
type Product struct {
|
||||||
|
|
||||||
// ID of the Company that owns this Product
|
// ID of the Company that owns this Product
|
||||||
AccountID *string `json:"AccountID,omitempty"`
|
AccountID *string `json:"AccountID,omitempty"`
|
||||||
|
@ -84,8 +84,8 @@ type CompanyProduct struct {
|
||||||
URL *string `json:"URL,omitempty"`
|
URL *string `json:"URL,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate validates this company product
|
// Validate validates this product
|
||||||
func (m *CompanyProduct) Validate(formats strfmt.Registry) error {
|
func (m *Product) Validate(formats strfmt.Registry) error {
|
||||||
var res []error
|
var res []error
|
||||||
|
|
||||||
if err := m.validateIndustries(formats); err != nil {
|
if err := m.validateIndustries(formats); err != nil {
|
||||||
|
@ -98,7 +98,7 @@ func (m *CompanyProduct) Validate(formats strfmt.Registry) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *CompanyProduct) validateIndustries(formats strfmt.Registry) error {
|
func (m *Product) validateIndustries(formats strfmt.Registry) error {
|
||||||
if swag.IsZero(m.Industries) { // not required
|
if swag.IsZero(m.Industries) { // not required
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -124,8 +124,8 @@ func (m *CompanyProduct) validateIndustries(formats strfmt.Registry) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ContextValidate validate this company product based on the context it is used
|
// ContextValidate validate this product based on the context it is used
|
||||||
func (m *CompanyProduct) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
func (m *Product) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||||
var res []error
|
var res []error
|
||||||
|
|
||||||
if err := m.contextValidateIndustries(ctx, formats); err != nil {
|
if err := m.contextValidateIndustries(ctx, formats); err != nil {
|
||||||
|
@ -138,7 +138,7 @@ func (m *CompanyProduct) ContextValidate(ctx context.Context, formats strfmt.Reg
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *CompanyProduct) contextValidateIndustries(ctx context.Context, formats strfmt.Registry) error {
|
func (m *Product) contextValidateIndustries(ctx context.Context, formats strfmt.Registry) error {
|
||||||
|
|
||||||
for i := 0; i < len(m.Industries); i++ {
|
for i := 0; i < len(m.Industries); i++ {
|
||||||
|
|
||||||
|
@ -159,7 +159,7 @@ func (m *CompanyProduct) contextValidateIndustries(ctx context.Context, formats
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalBinary interface implementation
|
// MarshalBinary interface implementation
|
||||||
func (m *CompanyProduct) MarshalBinary() ([]byte, error) {
|
func (m *Product) MarshalBinary() ([]byte, error) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
@ -167,8 +167,8 @@ func (m *CompanyProduct) MarshalBinary() ([]byte, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalBinary interface implementation
|
// UnmarshalBinary interface implementation
|
||||||
func (m *CompanyProduct) UnmarshalBinary(b []byte) error {
|
func (m *Product) UnmarshalBinary(b []byte) error {
|
||||||
var res CompanyProduct
|
var res Product
|
||||||
if err := swag.ReadJSON(b, &res); err != nil {
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
|
@ -18,10 +18,10 @@ import (
|
||||||
"github.com/go-openapi/swag"
|
"github.com/go-openapi/swag"
|
||||||
)
|
)
|
||||||
|
|
||||||
// CompanyService A service performed by a Company
|
// Service A service performed by a Company
|
||||||
//
|
//
|
||||||
// swagger:model CompanyService
|
// swagger:model Service
|
||||||
type CompanyService struct {
|
type Service struct {
|
||||||
|
|
||||||
// ID of the Company that owns this Service
|
// ID of the Company that owns this Service
|
||||||
AccountID *string `json:"AccountID,omitempty"`
|
AccountID *string `json:"AccountID,omitempty"`
|
||||||
|
@ -84,8 +84,8 @@ type CompanyService struct {
|
||||||
URL *string `json:"URL,omitempty"`
|
URL *string `json:"URL,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate validates this company service
|
// Validate validates this service
|
||||||
func (m *CompanyService) Validate(formats strfmt.Registry) error {
|
func (m *Service) Validate(formats strfmt.Registry) error {
|
||||||
var res []error
|
var res []error
|
||||||
|
|
||||||
if err := m.validateIndustries(formats); err != nil {
|
if err := m.validateIndustries(formats); err != nil {
|
||||||
|
@ -98,7 +98,7 @@ func (m *CompanyService) Validate(formats strfmt.Registry) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *CompanyService) validateIndustries(formats strfmt.Registry) error {
|
func (m *Service) validateIndustries(formats strfmt.Registry) error {
|
||||||
if swag.IsZero(m.Industries) { // not required
|
if swag.IsZero(m.Industries) { // not required
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -124,8 +124,8 @@ func (m *CompanyService) validateIndustries(formats strfmt.Registry) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ContextValidate validate this company service based on the context it is used
|
// ContextValidate validate this service based on the context it is used
|
||||||
func (m *CompanyService) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
func (m *Service) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||||
var res []error
|
var res []error
|
||||||
|
|
||||||
if err := m.contextValidateIndustries(ctx, formats); err != nil {
|
if err := m.contextValidateIndustries(ctx, formats); err != nil {
|
||||||
|
@ -138,7 +138,7 @@ func (m *CompanyService) ContextValidate(ctx context.Context, formats strfmt.Reg
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *CompanyService) contextValidateIndustries(ctx context.Context, formats strfmt.Registry) error {
|
func (m *Service) contextValidateIndustries(ctx context.Context, formats strfmt.Registry) error {
|
||||||
|
|
||||||
for i := 0; i < len(m.Industries); i++ {
|
for i := 0; i < len(m.Industries); i++ {
|
||||||
|
|
||||||
|
@ -159,7 +159,7 @@ func (m *CompanyService) contextValidateIndustries(ctx context.Context, formats
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalBinary interface implementation
|
// MarshalBinary interface implementation
|
||||||
func (m *CompanyService) MarshalBinary() ([]byte, error) {
|
func (m *Service) MarshalBinary() ([]byte, error) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
@ -167,8 +167,8 @@ func (m *CompanyService) MarshalBinary() ([]byte, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalBinary interface implementation
|
// UnmarshalBinary interface implementation
|
||||||
func (m *CompanyService) UnmarshalBinary(b []byte) error {
|
func (m *Service) UnmarshalBinary(b []byte) error {
|
||||||
var res CompanyService
|
var res Service
|
||||||
if err := swag.ReadJSON(b, &res); err != nil {
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
Credentials:
|
||||||
|
type: object
|
||||||
|
required: [email, password]
|
||||||
|
properties:
|
||||||
|
email:
|
||||||
|
type: string
|
||||||
|
format: email
|
||||||
|
example: user@example.com
|
||||||
|
password:
|
||||||
|
type: string
|
||||||
|
minLength: 12
|
||||||
|
example: "p@55w0rd-example"
|
|
@ -1,5 +1,8 @@
|
||||||
User:
|
User:
|
||||||
properties:
|
properties:
|
||||||
|
ID:
|
||||||
|
description: Record ID
|
||||||
|
type: string
|
||||||
APIGatewayURL:
|
APIGatewayURL:
|
||||||
description: API Gateway URL
|
description: API Gateway URL
|
||||||
type: string
|
type: string
|
||||||
|
@ -21,7 +24,7 @@ User:
|
||||||
type: string
|
type: string
|
||||||
x-nullable: true
|
x-nullable: true
|
||||||
Address:
|
Address:
|
||||||
$ref: "./address.yaml#/Address"
|
$ref: ./address.yaml#/Address
|
||||||
x-nullable: true
|
x-nullable: true
|
||||||
Alias:
|
Alias:
|
||||||
description: Alias
|
description: Alias
|
||||||
|
@ -83,6 +86,10 @@ User:
|
||||||
description: Extension
|
description: Extension
|
||||||
type: string
|
type: string
|
||||||
x-nullable: true
|
x-nullable: true
|
||||||
|
ExternalAccount:
|
||||||
|
description: Account
|
||||||
|
type: string
|
||||||
|
x-nullable: true
|
||||||
Fax:
|
Fax:
|
||||||
description: Fax
|
description: Fax
|
||||||
type: string
|
type: string
|
||||||
|
@ -103,9 +110,6 @@ User:
|
||||||
description: GitHub
|
description: GitHub
|
||||||
type: string
|
type: string
|
||||||
x-nullable: true
|
x-nullable: true
|
||||||
ID:
|
|
||||||
description: Record ID
|
|
||||||
type: string
|
|
||||||
IsActive:
|
IsActive:
|
||||||
description: Active
|
description: Active
|
||||||
type: boolean
|
type: boolean
|
||||||
|
@ -198,17 +202,13 @@ User:
|
||||||
description: Onboarding Status
|
description: Onboarding Status
|
||||||
type: string
|
type: string
|
||||||
x-nullable: true
|
x-nullable: true
|
||||||
ExternalAccount:
|
|
||||||
description: Account
|
|
||||||
type: string
|
|
||||||
x-nullable: true
|
|
||||||
TenantID:
|
TenantID:
|
||||||
description: Tenant ID associated with this user
|
description: Tenant ID associated with this user
|
||||||
type: string
|
type: string
|
||||||
x-nullable: true
|
x-nullable: true
|
||||||
TenantUsers:
|
TenantUsers:
|
||||||
items:
|
items:
|
||||||
$ref: "./tenant-user.yaml#/TenantUser"
|
$ref: ./tenant-user.yaml#/TenantUser
|
||||||
type: array
|
type: array
|
||||||
x-nullable: true
|
x-nullable: true
|
||||||
TimeZone:
|
TimeZone:
|
||||||
|
@ -229,7 +229,7 @@ User:
|
||||||
x-nullable: true
|
x-nullable: true
|
||||||
UserRoles:
|
UserRoles:
|
||||||
items:
|
items:
|
||||||
$ref: "./user-role.yaml#/UserRole"
|
$ref: ./user-role.yaml#/UserRole
|
||||||
type: array
|
type: array
|
||||||
x-nullable: true
|
x-nullable: true
|
||||||
UserType:
|
UserType:
|
||||||
|
|
|
@ -13,6 +13,13 @@ securityDefinitions:
|
||||||
type: "apiKey"
|
type: "apiKey"
|
||||||
in: "header"
|
in: "header"
|
||||||
name: "X-API-Key"
|
name: "X-API-Key"
|
||||||
|
kvSessionCookie:
|
||||||
|
type: apiKey
|
||||||
|
in: header
|
||||||
|
name: Cookie
|
||||||
|
description: >
|
||||||
|
Include a Cookie header containing kvSession=<JWT>. Example:
|
||||||
|
Cookie: kvSession=eyJhbGciOiJFZERTQSJ9...
|
||||||
schemes:
|
schemes:
|
||||||
- "https"
|
- "https"
|
||||||
basePath: "/vk/members/v1"
|
basePath: "/vk/members/v1"
|
||||||
|
@ -527,6 +534,77 @@ responses:
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/definitions/WebhookClerkResponse"
|
$ref: "#/definitions/WebhookClerkResponse"
|
||||||
paths:
|
paths:
|
||||||
|
/sessions:
|
||||||
|
post:
|
||||||
|
tags: [sessions]
|
||||||
|
summary: Create new session (sign-in)
|
||||||
|
operationId: createSession
|
||||||
|
parameters:
|
||||||
|
- in: body
|
||||||
|
name: credentials
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
$ref: "../../lib/swagger/defs/credentials.yaml#/Credentials"
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: Successful sign-in
|
||||||
|
headers:
|
||||||
|
Set-Cookie:
|
||||||
|
type: string
|
||||||
|
description: |
|
||||||
|
kvSession=<jwt>; HttpOnly; Secure; SameSite=None; Domain=.keenanvision.net; Path=/; Max-Age=5400
|
||||||
|
schema:
|
||||||
|
$ref: "#/responses/UserResponse"
|
||||||
|
401:
|
||||||
|
$ref: "#/responses/Unauthorized"
|
||||||
|
429:
|
||||||
|
$ref: "#/responses/ServerError"
|
||||||
|
|
||||||
|
/sessions/refresh:
|
||||||
|
post:
|
||||||
|
tags: [sessions]
|
||||||
|
summary: Refresh session cookie
|
||||||
|
operationId: refreshSession
|
||||||
|
security:
|
||||||
|
- kvSessionCookie: []
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: Token refreshed
|
||||||
|
headers:
|
||||||
|
Set-Cookie:
|
||||||
|
type: string
|
||||||
|
description: New kvSession cookie with updated expiry
|
||||||
|
401:
|
||||||
|
$ref: "#/responses/Unauthorized"
|
||||||
|
|
||||||
|
/sessions/current:
|
||||||
|
delete:
|
||||||
|
tags: [sessions]
|
||||||
|
summary: Delete current session (log out)
|
||||||
|
operationId: deleteSession
|
||||||
|
security:
|
||||||
|
- kvSessionCookie: []
|
||||||
|
responses:
|
||||||
|
204:
|
||||||
|
description: Logged out; kvSession cookie cleared
|
||||||
|
401:
|
||||||
|
$ref: "#/responses/Unauthorized"
|
||||||
|
|
||||||
|
/sessions/me:
|
||||||
|
get:
|
||||||
|
tags: [sessions]
|
||||||
|
summary: Get current user
|
||||||
|
operationId: getMe
|
||||||
|
security:
|
||||||
|
- kvSessionCookie: []
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: Current user profile
|
||||||
|
schema:
|
||||||
|
$ref: "#/responses/UserResponse"
|
||||||
|
401:
|
||||||
|
$ref: "#/responses/Unauthorized"
|
||||||
|
|
||||||
/attendees:
|
/attendees:
|
||||||
get:
|
get:
|
||||||
description: Return a list of Attendee records from the datastore
|
description: Return a list of Attendee records from the datastore
|
||||||
|
|
|
@ -34,6 +34,12 @@ parameters:
|
||||||
name: companyId
|
name: companyId
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
|
ChannelQuery:
|
||||||
|
description: The channel to filter companies by
|
||||||
|
in: query
|
||||||
|
name: channel
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
limitQuery:
|
limitQuery:
|
||||||
description: "How many objects to return at one time"
|
description: "How many objects to return at one time"
|
||||||
format: int64
|
format: int64
|
||||||
|
@ -91,6 +97,7 @@ paths:
|
||||||
parameters:
|
parameters:
|
||||||
- $ref: "#/parameters/CompanyIdQuery"
|
- $ref: "#/parameters/CompanyIdQuery"
|
||||||
- $ref: "#/parameters/slugQuery"
|
- $ref: "#/parameters/slugQuery"
|
||||||
|
- $ref: "#/parameters/ChannelQuery"
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
$ref: "#/responses/CompanyResponse"
|
$ref: "#/responses/CompanyResponse"
|
||||||
|
@ -315,30 +322,30 @@ definitions:
|
||||||
x-nullable: true
|
x-nullable: true
|
||||||
description: Year Started
|
description: Year Started
|
||||||
type: string
|
type: string
|
||||||
CompanyProducts:
|
Products:
|
||||||
description: Company Products
|
description: Company Products
|
||||||
x-nullable: true
|
x-nullable: true
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
$ref: "#/definitions/CompanyProduct"
|
$ref: "#/definitions/Product"
|
||||||
CompanyServices:
|
Services:
|
||||||
description: Company Services
|
description: Company Services
|
||||||
x-nullable: true
|
x-nullable: true
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
$ref: "#/definitions/CompanyService"
|
$ref: "#/definitions/Service"
|
||||||
FinancialStatements:
|
FinancialStatements:
|
||||||
description: Financial Statements
|
description: Financial Statements
|
||||||
x-nullable: true
|
x-nullable: true
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
$ref: "#/definitions/FinancialStatement"
|
$ref: "#/definitions/FinancialStatement"
|
||||||
IndustryCompanies:
|
Categories:
|
||||||
description: Similar Companies
|
description: Company Categories
|
||||||
x-nullable: true
|
x-nullable: true
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
$ref: "#/definitions/IndustryCompany"
|
$ref: "#/definitions/Category"
|
||||||
type: object
|
type: object
|
||||||
FinancialStatement:
|
FinancialStatement:
|
||||||
type: object
|
type: object
|
||||||
|
@ -348,51 +355,66 @@ definitions:
|
||||||
description: Record Id
|
description: Record Id
|
||||||
type: string
|
type: string
|
||||||
AccessNumber:
|
AccessNumber:
|
||||||
|
x-nullable: true
|
||||||
description: EDGAR Access Number
|
description: EDGAR Access Number
|
||||||
type: string
|
type: string
|
||||||
AccountID:
|
AccountID:
|
||||||
|
x-nullable: true
|
||||||
description: Account ID
|
description: Account ID
|
||||||
type: string
|
type: string
|
||||||
CloudRevenue:
|
CloudRevenue:
|
||||||
|
x-nullable: true
|
||||||
description: Cloud Revenue
|
description: Cloud Revenue
|
||||||
type: number
|
type: number
|
||||||
CreatedByID:
|
CreatedByID:
|
||||||
|
x-nullable: true
|
||||||
description: Created By User ID
|
description: Created By User ID
|
||||||
type: string
|
type: string
|
||||||
CreatedDate:
|
CreatedDate:
|
||||||
|
x-nullable: true
|
||||||
description: Created Date
|
description: Created Date
|
||||||
type: string
|
type: string
|
||||||
Description:
|
Description:
|
||||||
|
x-nullable: true
|
||||||
description: Description
|
description: Description
|
||||||
type: string
|
type: string
|
||||||
EdgarURL:
|
EdgarURL:
|
||||||
|
x-nullable: true
|
||||||
description: EDGAR URL
|
description: EDGAR URL
|
||||||
type: string
|
type: string
|
||||||
FilingType:
|
FilingType:
|
||||||
|
x-nullable: true
|
||||||
description: Filing Type
|
description: Filing Type
|
||||||
type: string
|
type: string
|
||||||
GrossProfit:
|
GrossProfit:
|
||||||
|
x-nullable: true
|
||||||
description: Gross Profit
|
description: Gross Profit
|
||||||
type: number
|
type: number
|
||||||
LastModifiedByID:
|
LastModifiedByID:
|
||||||
|
x-nullable: true
|
||||||
description: Last Modified By User ID
|
description: Last Modified By User ID
|
||||||
type: string
|
type: string
|
||||||
LastModifiedDate:
|
LastModifiedDate:
|
||||||
|
x-nullable: true
|
||||||
description: Last Modified Date
|
description: Last Modified Date
|
||||||
type: string
|
type: string
|
||||||
NetIncome:
|
NetIncome:
|
||||||
|
x-nullable: true
|
||||||
description: Net Income
|
description: Net Income
|
||||||
type: number
|
type: number
|
||||||
PeriodEndDate:
|
PeriodEndDate:
|
||||||
|
x-nullable: true
|
||||||
description: Period End Date
|
description: Period End Date
|
||||||
type: string
|
type: string
|
||||||
TotalRevenue:
|
TotalRevenue:
|
||||||
|
x-nullable: true
|
||||||
description: Total Revenue
|
description: Total Revenue
|
||||||
type: number
|
type: number
|
||||||
Year:
|
Year:
|
||||||
|
x-nullable: true
|
||||||
description: Year
|
description: Year
|
||||||
type: string
|
type: string
|
||||||
CompanyProduct:
|
Product:
|
||||||
description: A software product or service vended by a Company
|
description: A software product or service vended by a Company
|
||||||
properties:
|
properties:
|
||||||
ID:
|
ID:
|
||||||
|
@ -477,7 +499,7 @@ definitions:
|
||||||
description: Website
|
description: Website
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
CompanyService:
|
Service:
|
||||||
description: A service performed by a Company
|
description: A service performed by a Company
|
||||||
properties:
|
properties:
|
||||||
ID:
|
ID:
|
||||||
|
@ -575,12 +597,12 @@ definitions:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
CompanyProducts:
|
Products:
|
||||||
x-nullable: true
|
x-nullable: true
|
||||||
description: The list of Products in this industry
|
description: The list of Products in this industry
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
$ref: "#/definitions/CompanyProduct"
|
$ref: "#/definitions/Product"
|
||||||
CreatedByID:
|
CreatedByID:
|
||||||
x-nullable: true
|
x-nullable: true
|
||||||
description: Created By User ID
|
description: Created By User ID
|
||||||
|
@ -638,35 +660,55 @@ definitions:
|
||||||
description: TagLine
|
description: TagLine
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
IndustryCompany:
|
Category:
|
||||||
description: Junction object between Industry and Company
|
description: Junction object between Industry and Company
|
||||||
properties:
|
properties:
|
||||||
ID:
|
ID:
|
||||||
description: Record Id
|
description: Record Id
|
||||||
type: string
|
type: string
|
||||||
CompanyID:
|
CompanyID:
|
||||||
|
x-nullable: true
|
||||||
|
description: ID of the Company that owns this Category
|
||||||
type: string
|
type: string
|
||||||
CompanyName:
|
CompanyName:
|
||||||
|
x-nullable: true
|
||||||
|
description: Name of the Company
|
||||||
type: string
|
type: string
|
||||||
CompanySlug:
|
CompanySlug:
|
||||||
|
x-nullable: true
|
||||||
|
description: Slug of the Company
|
||||||
type: string
|
type: string
|
||||||
CompanyWebsite:
|
CompanyTagLine:
|
||||||
|
x-nullable: true
|
||||||
|
description: TagLine of the Company
|
||||||
type: string
|
type: string
|
||||||
IndustryID:
|
IndustryID:
|
||||||
|
x-nullable: true
|
||||||
|
description: ID of the Industry that owns this Category
|
||||||
type: string
|
type: string
|
||||||
IndustryName:
|
IndustryName:
|
||||||
|
x-nullable: true
|
||||||
|
description: Name of the Industry
|
||||||
type: string
|
type: string
|
||||||
IndustrySlug:
|
IndustrySlug:
|
||||||
|
x-nullable: true
|
||||||
|
description: Slug of the Industry
|
||||||
type: string
|
type: string
|
||||||
IndustryTagLine:
|
IndustryTagLine:
|
||||||
|
x-nullable: true
|
||||||
|
description: TagLine of the Industry
|
||||||
type: string
|
type: string
|
||||||
LastModifiedByID:
|
CreatedByID:
|
||||||
description: Last Modified By User ID
|
x-nullable: true
|
||||||
|
description: Created By User ID
|
||||||
type: string
|
type: string
|
||||||
LastModifiedDate:
|
CreatedByDate:
|
||||||
description: Last Modified Date
|
x-nullable: true
|
||||||
|
description: Created Date
|
||||||
type: string
|
type: string
|
||||||
Path:
|
Path:
|
||||||
|
x-nullable: true
|
||||||
|
description: The full path of this category, including Parent
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
CompanyRequest:
|
CompanyRequest:
|
||||||
|
|
|
@ -13,6 +13,13 @@ securityDefinitions:
|
||||||
type: "apiKey"
|
type: "apiKey"
|
||||||
in: "header"
|
in: "header"
|
||||||
name: "X-API-Key"
|
name: "X-API-Key"
|
||||||
|
kvSessionCookie:
|
||||||
|
type: apiKey
|
||||||
|
in: header
|
||||||
|
name: Cookie
|
||||||
|
description: >
|
||||||
|
Include a Cookie header containing kvSession=<JWT>. Example:
|
||||||
|
Cookie: kvSession=eyJhbGciOiJFZERTQSJ9...
|
||||||
schemes:
|
schemes:
|
||||||
- "http"
|
- "http"
|
||||||
basePath: "/v1"
|
basePath: "/v1"
|
||||||
|
@ -527,6 +534,77 @@ responses:
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/definitions/WebhookClerkResponse"
|
$ref: "#/definitions/WebhookClerkResponse"
|
||||||
paths:
|
paths:
|
||||||
|
/sessions:
|
||||||
|
post:
|
||||||
|
tags: [sessions]
|
||||||
|
summary: Create new session (sign-in)
|
||||||
|
operationId: createSession
|
||||||
|
parameters:
|
||||||
|
- in: body
|
||||||
|
name: credentials
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
$ref: "../../lib/swagger/defs/credentials.yaml#/Credentials"
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: Successful sign-in
|
||||||
|
headers:
|
||||||
|
Set-Cookie:
|
||||||
|
type: string
|
||||||
|
description: |
|
||||||
|
kvSession=<jwt>; HttpOnly; Secure; SameSite=None; Domain=.keenanvision.net; Path=/; Max-Age=5400
|
||||||
|
schema:
|
||||||
|
$ref: "#/responses/UserResponse"
|
||||||
|
401:
|
||||||
|
$ref: "#/responses/Unauthorized"
|
||||||
|
429:
|
||||||
|
$ref: "#/responses/ServerError"
|
||||||
|
|
||||||
|
/sessions/refresh:
|
||||||
|
post:
|
||||||
|
tags: [sessions]
|
||||||
|
summary: Refresh session cookie
|
||||||
|
operationId: refreshSession
|
||||||
|
security:
|
||||||
|
- kvSessionCookie: []
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: Token refreshed
|
||||||
|
headers:
|
||||||
|
Set-Cookie:
|
||||||
|
type: string
|
||||||
|
description: New kvSession cookie with updated expiry
|
||||||
|
401:
|
||||||
|
$ref: "#/responses/Unauthorized"
|
||||||
|
|
||||||
|
/sessions/current:
|
||||||
|
delete:
|
||||||
|
tags: [sessions]
|
||||||
|
summary: Delete current session (log out)
|
||||||
|
operationId: deleteSession
|
||||||
|
security:
|
||||||
|
- kvSessionCookie: []
|
||||||
|
responses:
|
||||||
|
204:
|
||||||
|
description: Logged out; kvSession cookie cleared
|
||||||
|
401:
|
||||||
|
$ref: "#/responses/Unauthorized"
|
||||||
|
|
||||||
|
/sessions/me:
|
||||||
|
get:
|
||||||
|
tags: [sessions]
|
||||||
|
summary: Get current user
|
||||||
|
operationId: getMe
|
||||||
|
security:
|
||||||
|
- kvSessionCookie: []
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: Current user profile
|
||||||
|
schema:
|
||||||
|
$ref: "#/responses/UserResponse"
|
||||||
|
401:
|
||||||
|
$ref: "#/responses/Unauthorized"
|
||||||
|
|
||||||
/attendees:
|
/attendees:
|
||||||
get:
|
get:
|
||||||
description: Return a list of Attendee records from the datastore
|
description: Return a list of Attendee records from the datastore
|
||||||
|
|
|
@ -34,6 +34,12 @@ parameters:
|
||||||
name: companyId
|
name: companyId
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
|
ChannelQuery:
|
||||||
|
description: The channel to filter companies by
|
||||||
|
in: query
|
||||||
|
name: channel
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
limitQuery:
|
limitQuery:
|
||||||
description: "How many objects to return at one time"
|
description: "How many objects to return at one time"
|
||||||
format: int64
|
format: int64
|
||||||
|
@ -91,6 +97,7 @@ paths:
|
||||||
parameters:
|
parameters:
|
||||||
- $ref: "#/parameters/CompanyIdQuery"
|
- $ref: "#/parameters/CompanyIdQuery"
|
||||||
- $ref: "#/parameters/slugQuery"
|
- $ref: "#/parameters/slugQuery"
|
||||||
|
- $ref: "#/parameters/ChannelQuery"
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
$ref: "#/responses/CompanyResponse"
|
$ref: "#/responses/CompanyResponse"
|
||||||
|
@ -315,30 +322,30 @@ definitions:
|
||||||
x-nullable: true
|
x-nullable: true
|
||||||
description: Year Started
|
description: Year Started
|
||||||
type: string
|
type: string
|
||||||
CompanyProducts:
|
Products:
|
||||||
description: Company Products
|
description: Company Products
|
||||||
x-nullable: true
|
x-nullable: true
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
$ref: "#/definitions/CompanyProduct"
|
$ref: "#/definitions/Product"
|
||||||
CompanyServices:
|
Services:
|
||||||
description: Company Services
|
description: Company Services
|
||||||
x-nullable: true
|
x-nullable: true
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
$ref: "#/definitions/CompanyService"
|
$ref: "#/definitions/Service"
|
||||||
FinancialStatements:
|
FinancialStatements:
|
||||||
description: Financial Statements
|
description: Financial Statements
|
||||||
x-nullable: true
|
x-nullable: true
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
$ref: "#/definitions/FinancialStatement"
|
$ref: "#/definitions/FinancialStatement"
|
||||||
IndustryCompanies:
|
Categories:
|
||||||
description: Similar Companies
|
description: Company Categories
|
||||||
x-nullable: true
|
x-nullable: true
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
$ref: "#/definitions/IndustryCompany"
|
$ref: "#/definitions/Category"
|
||||||
type: object
|
type: object
|
||||||
FinancialStatement:
|
FinancialStatement:
|
||||||
type: object
|
type: object
|
||||||
|
@ -348,51 +355,66 @@ definitions:
|
||||||
description: Record Id
|
description: Record Id
|
||||||
type: string
|
type: string
|
||||||
AccessNumber:
|
AccessNumber:
|
||||||
|
x-nullable: true
|
||||||
description: EDGAR Access Number
|
description: EDGAR Access Number
|
||||||
type: string
|
type: string
|
||||||
AccountID:
|
AccountID:
|
||||||
|
x-nullable: true
|
||||||
description: Account ID
|
description: Account ID
|
||||||
type: string
|
type: string
|
||||||
CloudRevenue:
|
CloudRevenue:
|
||||||
|
x-nullable: true
|
||||||
description: Cloud Revenue
|
description: Cloud Revenue
|
||||||
type: number
|
type: number
|
||||||
CreatedByID:
|
CreatedByID:
|
||||||
|
x-nullable: true
|
||||||
description: Created By User ID
|
description: Created By User ID
|
||||||
type: string
|
type: string
|
||||||
CreatedDate:
|
CreatedDate:
|
||||||
|
x-nullable: true
|
||||||
description: Created Date
|
description: Created Date
|
||||||
type: string
|
type: string
|
||||||
Description:
|
Description:
|
||||||
|
x-nullable: true
|
||||||
description: Description
|
description: Description
|
||||||
type: string
|
type: string
|
||||||
EdgarURL:
|
EdgarURL:
|
||||||
|
x-nullable: true
|
||||||
description: EDGAR URL
|
description: EDGAR URL
|
||||||
type: string
|
type: string
|
||||||
FilingType:
|
FilingType:
|
||||||
|
x-nullable: true
|
||||||
description: Filing Type
|
description: Filing Type
|
||||||
type: string
|
type: string
|
||||||
GrossProfit:
|
GrossProfit:
|
||||||
|
x-nullable: true
|
||||||
description: Gross Profit
|
description: Gross Profit
|
||||||
type: number
|
type: number
|
||||||
LastModifiedByID:
|
LastModifiedByID:
|
||||||
|
x-nullable: true
|
||||||
description: Last Modified By User ID
|
description: Last Modified By User ID
|
||||||
type: string
|
type: string
|
||||||
LastModifiedDate:
|
LastModifiedDate:
|
||||||
|
x-nullable: true
|
||||||
description: Last Modified Date
|
description: Last Modified Date
|
||||||
type: string
|
type: string
|
||||||
NetIncome:
|
NetIncome:
|
||||||
|
x-nullable: true
|
||||||
description: Net Income
|
description: Net Income
|
||||||
type: number
|
type: number
|
||||||
PeriodEndDate:
|
PeriodEndDate:
|
||||||
|
x-nullable: true
|
||||||
description: Period End Date
|
description: Period End Date
|
||||||
type: string
|
type: string
|
||||||
TotalRevenue:
|
TotalRevenue:
|
||||||
|
x-nullable: true
|
||||||
description: Total Revenue
|
description: Total Revenue
|
||||||
type: number
|
type: number
|
||||||
Year:
|
Year:
|
||||||
|
x-nullable: true
|
||||||
description: Year
|
description: Year
|
||||||
type: string
|
type: string
|
||||||
CompanyProduct:
|
Product:
|
||||||
description: A software product or service vended by a Company
|
description: A software product or service vended by a Company
|
||||||
properties:
|
properties:
|
||||||
ID:
|
ID:
|
||||||
|
@ -477,7 +499,7 @@ definitions:
|
||||||
description: Website
|
description: Website
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
CompanyService:
|
Service:
|
||||||
description: A service performed by a Company
|
description: A service performed by a Company
|
||||||
properties:
|
properties:
|
||||||
ID:
|
ID:
|
||||||
|
@ -575,12 +597,12 @@ definitions:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
CompanyProducts:
|
Products:
|
||||||
x-nullable: true
|
x-nullable: true
|
||||||
description: The list of Products in this industry
|
description: The list of Products in this industry
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
$ref: "#/definitions/CompanyProduct"
|
$ref: "#/definitions/Product"
|
||||||
CreatedByID:
|
CreatedByID:
|
||||||
x-nullable: true
|
x-nullable: true
|
||||||
description: Created By User ID
|
description: Created By User ID
|
||||||
|
@ -638,35 +660,55 @@ definitions:
|
||||||
description: TagLine
|
description: TagLine
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
IndustryCompany:
|
Category:
|
||||||
description: Junction object between Industry and Company
|
description: Junction object between Industry and Company
|
||||||
properties:
|
properties:
|
||||||
ID:
|
ID:
|
||||||
description: Record Id
|
description: Record Id
|
||||||
type: string
|
type: string
|
||||||
CompanyID:
|
CompanyID:
|
||||||
|
x-nullable: true
|
||||||
|
description: ID of the Company that owns this Category
|
||||||
type: string
|
type: string
|
||||||
CompanyName:
|
CompanyName:
|
||||||
|
x-nullable: true
|
||||||
|
description: Name of the Company
|
||||||
type: string
|
type: string
|
||||||
CompanySlug:
|
CompanySlug:
|
||||||
|
x-nullable: true
|
||||||
|
description: Slug of the Company
|
||||||
type: string
|
type: string
|
||||||
CompanyWebsite:
|
CompanyTagLine:
|
||||||
|
x-nullable: true
|
||||||
|
description: TagLine of the Company
|
||||||
type: string
|
type: string
|
||||||
IndustryID:
|
IndustryID:
|
||||||
|
x-nullable: true
|
||||||
|
description: ID of the Industry that owns this Category
|
||||||
type: string
|
type: string
|
||||||
IndustryName:
|
IndustryName:
|
||||||
|
x-nullable: true
|
||||||
|
description: Name of the Industry
|
||||||
type: string
|
type: string
|
||||||
IndustrySlug:
|
IndustrySlug:
|
||||||
|
x-nullable: true
|
||||||
|
description: Slug of the Industry
|
||||||
type: string
|
type: string
|
||||||
IndustryTagLine:
|
IndustryTagLine:
|
||||||
|
x-nullable: true
|
||||||
|
description: TagLine of the Industry
|
||||||
type: string
|
type: string
|
||||||
LastModifiedByID:
|
CreatedByID:
|
||||||
description: Last Modified By User ID
|
x-nullable: true
|
||||||
|
description: Created By User ID
|
||||||
type: string
|
type: string
|
||||||
LastModifiedDate:
|
CreatedByDate:
|
||||||
description: Last Modified Date
|
x-nullable: true
|
||||||
|
description: Created Date
|
||||||
type: string
|
type: string
|
||||||
Path:
|
Path:
|
||||||
|
x-nullable: true
|
||||||
|
description: The full path of this category, including Parent
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
CompanyRequest:
|
CompanyRequest:
|
||||||
|
|
Loading…
Reference in New Issue