From 6f7d308ba6f47988a8adf08d045a77e9937110d8 Mon Sep 17 00:00:00 2001 From: Vernon Keenan Date: Mon, 29 May 2023 15:13:02 +0000 Subject: [PATCH] cleanup --- .../company_services_client.go | 86 +-- .../create_company_service_parameters.go | 157 ----- .../create_company_service_responses.go | 522 ----------------- .../post_company_services_parameters.go | 157 +++++ .../post_company_services_responses.go | 522 +++++++++++++++++ .../documents/documents_client.go | 172 ++++++ .../documents/get_documents_parameters.go | 240 ++++++++ .../documents/get_documents_responses.go | 477 +++++++++++++++ .../documents/post_documents_parameters.go | 157 +++++ .../documents/post_documents_responses.go | 477 +++++++++++++++ .../documents/put_documents_parameters.go | 157 +++++ .../documents/put_documents_responses.go | 477 +++++++++++++++ ...t_research_project_documents_parameters.go | 240 ++++++++ ...et_research_project_documents_responses.go | 477 +++++++++++++++ ...t_research_project_documents_parameters.go | 157 +++++ ...st_research_project_documents_responses.go | 551 ++++++++++++++++++ ...t_research_project_documents_parameters.go | 157 +++++ ...ut_research_project_documents_responses.go | 551 ++++++++++++++++++ .../research_projects_client.go | 131 +++++ api/sfgate/sfgate_client/sfgate_client.go | 5 + api/sfgate/sfgate_models/document.go | 117 ++++ api/sfgate/sfgate_models/document_request.go | 166 ++++++ api/sfgate/sfgate_models/document_response.go | 166 ++++++ .../research_project_document_request.go | 120 ++++ .../research_project_document_response.go | 166 ++++++ swagger/external/research-vernonkeenan.yaml | 2 +- swagger/external/sf-gate-vernonkeenan.yaml | 208 +++++++ swagger/research-vernonkeenan.yaml | 2 +- swagger/sf-gate-vernonkeenan.yaml | 208 +++++++ 29 files changed, 6301 insertions(+), 724 deletions(-) delete mode 100644 api/research/research_client/company_services/create_company_service_parameters.go delete mode 100644 api/research/research_client/company_services/create_company_service_responses.go create mode 100644 api/research/research_client/company_services/post_company_services_parameters.go create mode 100644 api/research/research_client/company_services/post_company_services_responses.go create mode 100644 api/sfgate/sfgate_client/documents/documents_client.go create mode 100644 api/sfgate/sfgate_client/documents/get_documents_parameters.go create mode 100644 api/sfgate/sfgate_client/documents/get_documents_responses.go create mode 100644 api/sfgate/sfgate_client/documents/post_documents_parameters.go create mode 100644 api/sfgate/sfgate_client/documents/post_documents_responses.go create mode 100644 api/sfgate/sfgate_client/documents/put_documents_parameters.go create mode 100644 api/sfgate/sfgate_client/documents/put_documents_responses.go create mode 100644 api/sfgate/sfgate_client/research_projects/get_research_project_documents_parameters.go create mode 100644 api/sfgate/sfgate_client/research_projects/get_research_project_documents_responses.go create mode 100644 api/sfgate/sfgate_client/research_projects/post_research_project_documents_parameters.go create mode 100644 api/sfgate/sfgate_client/research_projects/post_research_project_documents_responses.go create mode 100644 api/sfgate/sfgate_client/research_projects/put_research_project_documents_parameters.go create mode 100644 api/sfgate/sfgate_client/research_projects/put_research_project_documents_responses.go create mode 100644 api/sfgate/sfgate_models/document.go create mode 100644 api/sfgate/sfgate_models/document_request.go create mode 100644 api/sfgate/sfgate_models/document_response.go create mode 100644 api/sfgate/sfgate_models/research_project_document_request.go create mode 100644 api/sfgate/sfgate_models/research_project_document_response.go diff --git a/api/research/research_client/company_services/company_services_client.go b/api/research/research_client/company_services/company_services_client.go index e23daa1..2b5bac5 100644 --- a/api/research/research_client/company_services/company_services_client.go +++ b/api/research/research_client/company_services/company_services_client.go @@ -34,56 +34,15 @@ type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods type ClientService interface { - CreateCompanyService(params *CreateCompanyServiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateCompanyServiceOK, error) - DeleteCompanyService(params *DeleteCompanyServiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteCompanyServiceOK, error) GetCompanyServices(params *GetCompanyServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCompanyServicesOK, error) + PostCompanyServices(params *PostCompanyServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostCompanyServicesOK, error) + SetTransport(transport runtime.ClientTransport) } -/* -CreateCompanyService creates a new company service - -Create a new CompanyService record -*/ -func (a *Client) CreateCompanyService(params *CreateCompanyServiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateCompanyServiceOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateCompanyServiceParams() - } - op := &runtime.ClientOperation{ - ID: "createCompanyService", - Method: "POST", - PathPattern: "/companyservices", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &CreateCompanyServiceReader{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.(*CreateCompanyServiceOK) - 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 createCompanyService: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - /* DeleteCompanyService deletes a company service @@ -166,6 +125,47 @@ func (a *Client) GetCompanyServices(params *GetCompanyServicesParams, authInfo r panic(msg) } +/* +PostCompanyServices creates a new company service + +Create a new CompanyService record +*/ +func (a *Client) PostCompanyServices(params *PostCompanyServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostCompanyServicesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostCompanyServicesParams() + } + op := &runtime.ClientOperation{ + ID: "postCompanyServices", + Method: "POST", + PathPattern: "/companyservices", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostCompanyServicesReader{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.(*PostCompanyServicesOK) + 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 postCompanyServices: 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 diff --git a/api/research/research_client/company_services/create_company_service_parameters.go b/api/research/research_client/company_services/create_company_service_parameters.go deleted file mode 100644 index 53d963b..0000000 --- a/api/research/research_client/company_services/create_company_service_parameters.go +++ /dev/null @@ -1,157 +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 company_services - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "code.tnxs.net/vernonkeenan/lib/api/research/research_models" -) - -// NewCreateCompanyServiceParams creates a new CreateCompanyServiceParams 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 NewCreateCompanyServiceParams() *CreateCompanyServiceParams { - return &CreateCompanyServiceParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateCompanyServiceParamsWithTimeout creates a new CreateCompanyServiceParams object -// with the ability to set a timeout on a request. -func NewCreateCompanyServiceParamsWithTimeout(timeout time.Duration) *CreateCompanyServiceParams { - return &CreateCompanyServiceParams{ - timeout: timeout, - } -} - -// NewCreateCompanyServiceParamsWithContext creates a new CreateCompanyServiceParams object -// with the ability to set a context for a request. -func NewCreateCompanyServiceParamsWithContext(ctx context.Context) *CreateCompanyServiceParams { - return &CreateCompanyServiceParams{ - Context: ctx, - } -} - -// NewCreateCompanyServiceParamsWithHTTPClient creates a new CreateCompanyServiceParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateCompanyServiceParamsWithHTTPClient(client *http.Client) *CreateCompanyServiceParams { - return &CreateCompanyServiceParams{ - HTTPClient: client, - } -} - -/* -CreateCompanyServiceParams contains all the parameters to send to the API endpoint - - for the create company service operation. - - Typically these are written to a http.Request. -*/ -type CreateCompanyServiceParams struct { - - /* CompanyServiceRequest. - - An array of new CompanyService records - */ - CompanyServiceRequest *research_models.CompanyServiceRequest - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create company service params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateCompanyServiceParams) WithDefaults() *CreateCompanyServiceParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create company service params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateCompanyServiceParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create company service params -func (o *CreateCompanyServiceParams) WithTimeout(timeout time.Duration) *CreateCompanyServiceParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create company service params -func (o *CreateCompanyServiceParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create company service params -func (o *CreateCompanyServiceParams) WithContext(ctx context.Context) *CreateCompanyServiceParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create company service params -func (o *CreateCompanyServiceParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create company service params -func (o *CreateCompanyServiceParams) WithHTTPClient(client *http.Client) *CreateCompanyServiceParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create company service params -func (o *CreateCompanyServiceParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCompanyServiceRequest adds the companyServiceRequest to the create company service params -func (o *CreateCompanyServiceParams) WithCompanyServiceRequest(companyServiceRequest *research_models.CompanyServiceRequest) *CreateCompanyServiceParams { - o.SetCompanyServiceRequest(companyServiceRequest) - return o -} - -// SetCompanyServiceRequest adds the companyServiceRequest to the create company service params -func (o *CreateCompanyServiceParams) SetCompanyServiceRequest(companyServiceRequest *research_models.CompanyServiceRequest) { - o.CompanyServiceRequest = companyServiceRequest -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateCompanyServiceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.CompanyServiceRequest != nil { - if err := r.SetBodyParam(o.CompanyServiceRequest); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/research/research_client/company_services/create_company_service_responses.go b/api/research/research_client/company_services/create_company_service_responses.go deleted file mode 100644 index e57efc8..0000000 --- a/api/research/research_client/company_services/create_company_service_responses.go +++ /dev/null @@ -1,522 +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 company_services - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "code.tnxs.net/vernonkeenan/lib/api/research/research_models" -) - -// CreateCompanyServiceReader is a Reader for the CreateCompanyService structure. -type CreateCompanyServiceReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateCompanyServiceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewCreateCompanyServiceOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewCreateCompanyServiceUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewCreateCompanyServiceForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewCreateCompanyServiceConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewCreateCompanyServiceUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewCreateCompanyServiceInternalServerError() - 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()) - } -} - -// NewCreateCompanyServiceOK creates a CreateCompanyServiceOK with default headers values -func NewCreateCompanyServiceOK() *CreateCompanyServiceOK { - return &CreateCompanyServiceOK{} -} - -/* -CreateCompanyServiceOK describes a response with status code 200, with default header values. - -Response with CompanyService objects -*/ -type CreateCompanyServiceOK struct { - Payload *research_models.CompanyServiceResponse -} - -// IsSuccess returns true when this create company service o k response has a 2xx status code -func (o *CreateCompanyServiceOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this create company service o k response has a 3xx status code -func (o *CreateCompanyServiceOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create company service o k response has a 4xx status code -func (o *CreateCompanyServiceOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this create company service o k response has a 5xx status code -func (o *CreateCompanyServiceOK) IsServerError() bool { - return false -} - -// IsCode returns true when this create company service o k response a status code equal to that given -func (o *CreateCompanyServiceOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the create company service o k response -func (o *CreateCompanyServiceOK) Code() int { - return 200 -} - -func (o *CreateCompanyServiceOK) Error() string { - return fmt.Sprintf("[POST /companyservices][%d] createCompanyServiceOK %+v", 200, o.Payload) -} - -func (o *CreateCompanyServiceOK) String() string { - return fmt.Sprintf("[POST /companyservices][%d] createCompanyServiceOK %+v", 200, o.Payload) -} - -func (o *CreateCompanyServiceOK) GetPayload() *research_models.CompanyServiceResponse { - return o.Payload -} - -func (o *CreateCompanyServiceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(research_models.CompanyServiceResponse) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateCompanyServiceUnauthorized creates a CreateCompanyServiceUnauthorized with default headers values -func NewCreateCompanyServiceUnauthorized() *CreateCompanyServiceUnauthorized { - return &CreateCompanyServiceUnauthorized{} -} - -/* -CreateCompanyServiceUnauthorized describes a response with status code 401, with default header values. - -Access unauthorized, invalid API-KEY was used -*/ -type CreateCompanyServiceUnauthorized struct { - AccessControlAllowOrigin string - - Payload *research_models.Error -} - -// IsSuccess returns true when this create company service unauthorized response has a 2xx status code -func (o *CreateCompanyServiceUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create company service unauthorized response has a 3xx status code -func (o *CreateCompanyServiceUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create company service unauthorized response has a 4xx status code -func (o *CreateCompanyServiceUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this create company service unauthorized response has a 5xx status code -func (o *CreateCompanyServiceUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this create company service unauthorized response a status code equal to that given -func (o *CreateCompanyServiceUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the create company service unauthorized response -func (o *CreateCompanyServiceUnauthorized) Code() int { - return 401 -} - -func (o *CreateCompanyServiceUnauthorized) Error() string { - return fmt.Sprintf("[POST /companyservices][%d] createCompanyServiceUnauthorized %+v", 401, o.Payload) -} - -func (o *CreateCompanyServiceUnauthorized) String() string { - return fmt.Sprintf("[POST /companyservices][%d] createCompanyServiceUnauthorized %+v", 401, o.Payload) -} - -func (o *CreateCompanyServiceUnauthorized) GetPayload() *research_models.Error { - return o.Payload -} - -func (o *CreateCompanyServiceUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - o.Payload = new(research_models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateCompanyServiceForbidden creates a CreateCompanyServiceForbidden with default headers values -func NewCreateCompanyServiceForbidden() *CreateCompanyServiceForbidden { - return &CreateCompanyServiceForbidden{} -} - -/* -CreateCompanyServiceForbidden describes a response with status code 403, with default header values. - -Access forbidden, account lacks access -*/ -type CreateCompanyServiceForbidden struct { - AccessControlAllowOrigin string - - Payload *research_models.Error -} - -// IsSuccess returns true when this create company service forbidden response has a 2xx status code -func (o *CreateCompanyServiceForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create company service forbidden response has a 3xx status code -func (o *CreateCompanyServiceForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create company service forbidden response has a 4xx status code -func (o *CreateCompanyServiceForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this create company service forbidden response has a 5xx status code -func (o *CreateCompanyServiceForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this create company service forbidden response a status code equal to that given -func (o *CreateCompanyServiceForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the create company service forbidden response -func (o *CreateCompanyServiceForbidden) Code() int { - return 403 -} - -func (o *CreateCompanyServiceForbidden) Error() string { - return fmt.Sprintf("[POST /companyservices][%d] createCompanyServiceForbidden %+v", 403, o.Payload) -} - -func (o *CreateCompanyServiceForbidden) String() string { - return fmt.Sprintf("[POST /companyservices][%d] createCompanyServiceForbidden %+v", 403, o.Payload) -} - -func (o *CreateCompanyServiceForbidden) GetPayload() *research_models.Error { - return o.Payload -} - -func (o *CreateCompanyServiceForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - o.Payload = new(research_models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateCompanyServiceConflict creates a CreateCompanyServiceConflict with default headers values -func NewCreateCompanyServiceConflict() *CreateCompanyServiceConflict { - return &CreateCompanyServiceConflict{} -} - -/* -CreateCompanyServiceConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type CreateCompanyServiceConflict struct { - AccessControlAllowOrigin string - - Payload *research_models.Error -} - -// IsSuccess returns true when this create company service conflict response has a 2xx status code -func (o *CreateCompanyServiceConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create company service conflict response has a 3xx status code -func (o *CreateCompanyServiceConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create company service conflict response has a 4xx status code -func (o *CreateCompanyServiceConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this create company service conflict response has a 5xx status code -func (o *CreateCompanyServiceConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this create company service conflict response a status code equal to that given -func (o *CreateCompanyServiceConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the create company service conflict response -func (o *CreateCompanyServiceConflict) Code() int { - return 409 -} - -func (o *CreateCompanyServiceConflict) Error() string { - return fmt.Sprintf("[POST /companyservices][%d] createCompanyServiceConflict %+v", 409, o.Payload) -} - -func (o *CreateCompanyServiceConflict) String() string { - return fmt.Sprintf("[POST /companyservices][%d] createCompanyServiceConflict %+v", 409, o.Payload) -} - -func (o *CreateCompanyServiceConflict) GetPayload() *research_models.Error { - return o.Payload -} - -func (o *CreateCompanyServiceConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - o.Payload = new(research_models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateCompanyServiceUnprocessableEntity creates a CreateCompanyServiceUnprocessableEntity with default headers values -func NewCreateCompanyServiceUnprocessableEntity() *CreateCompanyServiceUnprocessableEntity { - return &CreateCompanyServiceUnprocessableEntity{} -} - -/* -CreateCompanyServiceUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity, likely a bad parameter -*/ -type CreateCompanyServiceUnprocessableEntity struct { - AccessControlAllowOrigin string - - Payload *research_models.Error -} - -// IsSuccess returns true when this create company service unprocessable entity response has a 2xx status code -func (o *CreateCompanyServiceUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create company service unprocessable entity response has a 3xx status code -func (o *CreateCompanyServiceUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create company service unprocessable entity response has a 4xx status code -func (o *CreateCompanyServiceUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this create company service unprocessable entity response has a 5xx status code -func (o *CreateCompanyServiceUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this create company service unprocessable entity response a status code equal to that given -func (o *CreateCompanyServiceUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the create company service unprocessable entity response -func (o *CreateCompanyServiceUnprocessableEntity) Code() int { - return 422 -} - -func (o *CreateCompanyServiceUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /companyservices][%d] createCompanyServiceUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *CreateCompanyServiceUnprocessableEntity) String() string { - return fmt.Sprintf("[POST /companyservices][%d] createCompanyServiceUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *CreateCompanyServiceUnprocessableEntity) GetPayload() *research_models.Error { - return o.Payload -} - -func (o *CreateCompanyServiceUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - o.Payload = new(research_models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateCompanyServiceInternalServerError creates a CreateCompanyServiceInternalServerError with default headers values -func NewCreateCompanyServiceInternalServerError() *CreateCompanyServiceInternalServerError { - return &CreateCompanyServiceInternalServerError{} -} - -/* -CreateCompanyServiceInternalServerError describes a response with status code 500, with default header values. - -Server Internal Error -*/ -type CreateCompanyServiceInternalServerError struct { - AccessControlAllowOrigin string - - Payload *research_models.Error -} - -// IsSuccess returns true when this create company service internal server error response has a 2xx status code -func (o *CreateCompanyServiceInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create company service internal server error response has a 3xx status code -func (o *CreateCompanyServiceInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create company service internal server error response has a 4xx status code -func (o *CreateCompanyServiceInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this create company service internal server error response has a 5xx status code -func (o *CreateCompanyServiceInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this create company service internal server error response a status code equal to that given -func (o *CreateCompanyServiceInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the create company service internal server error response -func (o *CreateCompanyServiceInternalServerError) Code() int { - return 500 -} - -func (o *CreateCompanyServiceInternalServerError) Error() string { - return fmt.Sprintf("[POST /companyservices][%d] createCompanyServiceInternalServerError %+v", 500, o.Payload) -} - -func (o *CreateCompanyServiceInternalServerError) String() string { - return fmt.Sprintf("[POST /companyservices][%d] createCompanyServiceInternalServerError %+v", 500, o.Payload) -} - -func (o *CreateCompanyServiceInternalServerError) GetPayload() *research_models.Error { - return o.Payload -} - -func (o *CreateCompanyServiceInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - o.Payload = new(research_models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/api/research/research_client/company_services/post_company_services_parameters.go b/api/research/research_client/company_services/post_company_services_parameters.go new file mode 100644 index 0000000..9fd1c97 --- /dev/null +++ b/api/research/research_client/company_services/post_company_services_parameters.go @@ -0,0 +1,157 @@ +// 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 company_services + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "code.tnxs.net/vernonkeenan/lib/api/research/research_models" +) + +// NewPostCompanyServicesParams creates a new PostCompanyServicesParams 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 NewPostCompanyServicesParams() *PostCompanyServicesParams { + return &PostCompanyServicesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPostCompanyServicesParamsWithTimeout creates a new PostCompanyServicesParams object +// with the ability to set a timeout on a request. +func NewPostCompanyServicesParamsWithTimeout(timeout time.Duration) *PostCompanyServicesParams { + return &PostCompanyServicesParams{ + timeout: timeout, + } +} + +// NewPostCompanyServicesParamsWithContext creates a new PostCompanyServicesParams object +// with the ability to set a context for a request. +func NewPostCompanyServicesParamsWithContext(ctx context.Context) *PostCompanyServicesParams { + return &PostCompanyServicesParams{ + Context: ctx, + } +} + +// NewPostCompanyServicesParamsWithHTTPClient creates a new PostCompanyServicesParams object +// with the ability to set a custom HTTPClient for a request. +func NewPostCompanyServicesParamsWithHTTPClient(client *http.Client) *PostCompanyServicesParams { + return &PostCompanyServicesParams{ + HTTPClient: client, + } +} + +/* +PostCompanyServicesParams contains all the parameters to send to the API endpoint + + for the post company services operation. + + Typically these are written to a http.Request. +*/ +type PostCompanyServicesParams struct { + + /* CompanyServiceRequest. + + An array of new CompanyService records + */ + CompanyServiceRequest *research_models.CompanyServiceRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the post company services params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostCompanyServicesParams) WithDefaults() *PostCompanyServicesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the post company services params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostCompanyServicesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the post company services params +func (o *PostCompanyServicesParams) WithTimeout(timeout time.Duration) *PostCompanyServicesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post company services params +func (o *PostCompanyServicesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post company services params +func (o *PostCompanyServicesParams) WithContext(ctx context.Context) *PostCompanyServicesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post company services params +func (o *PostCompanyServicesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post company services params +func (o *PostCompanyServicesParams) WithHTTPClient(client *http.Client) *PostCompanyServicesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post company services params +func (o *PostCompanyServicesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCompanyServiceRequest adds the companyServiceRequest to the post company services params +func (o *PostCompanyServicesParams) WithCompanyServiceRequest(companyServiceRequest *research_models.CompanyServiceRequest) *PostCompanyServicesParams { + o.SetCompanyServiceRequest(companyServiceRequest) + return o +} + +// SetCompanyServiceRequest adds the companyServiceRequest to the post company services params +func (o *PostCompanyServicesParams) SetCompanyServiceRequest(companyServiceRequest *research_models.CompanyServiceRequest) { + o.CompanyServiceRequest = companyServiceRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostCompanyServicesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CompanyServiceRequest != nil { + if err := r.SetBodyParam(o.CompanyServiceRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/research/research_client/company_services/post_company_services_responses.go b/api/research/research_client/company_services/post_company_services_responses.go new file mode 100644 index 0000000..3dfc8aa --- /dev/null +++ b/api/research/research_client/company_services/post_company_services_responses.go @@ -0,0 +1,522 @@ +// 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 company_services + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "code.tnxs.net/vernonkeenan/lib/api/research/research_models" +) + +// PostCompanyServicesReader is a Reader for the PostCompanyServices structure. +type PostCompanyServicesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostCompanyServicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostCompanyServicesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostCompanyServicesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostCompanyServicesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewPostCompanyServicesConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostCompanyServicesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostCompanyServicesInternalServerError() + 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()) + } +} + +// NewPostCompanyServicesOK creates a PostCompanyServicesOK with default headers values +func NewPostCompanyServicesOK() *PostCompanyServicesOK { + return &PostCompanyServicesOK{} +} + +/* +PostCompanyServicesOK describes a response with status code 200, with default header values. + +Response with CompanyService objects +*/ +type PostCompanyServicesOK struct { + Payload *research_models.CompanyServiceResponse +} + +// IsSuccess returns true when this post company services o k response has a 2xx status code +func (o *PostCompanyServicesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this post company services o k response has a 3xx status code +func (o *PostCompanyServicesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post company services o k response has a 4xx status code +func (o *PostCompanyServicesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this post company services o k response has a 5xx status code +func (o *PostCompanyServicesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this post company services o k response a status code equal to that given +func (o *PostCompanyServicesOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the post company services o k response +func (o *PostCompanyServicesOK) Code() int { + return 200 +} + +func (o *PostCompanyServicesOK) Error() string { + return fmt.Sprintf("[POST /companyservices][%d] postCompanyServicesOK %+v", 200, o.Payload) +} + +func (o *PostCompanyServicesOK) String() string { + return fmt.Sprintf("[POST /companyservices][%d] postCompanyServicesOK %+v", 200, o.Payload) +} + +func (o *PostCompanyServicesOK) GetPayload() *research_models.CompanyServiceResponse { + return o.Payload +} + +func (o *PostCompanyServicesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(research_models.CompanyServiceResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostCompanyServicesUnauthorized creates a PostCompanyServicesUnauthorized with default headers values +func NewPostCompanyServicesUnauthorized() *PostCompanyServicesUnauthorized { + return &PostCompanyServicesUnauthorized{} +} + +/* +PostCompanyServicesUnauthorized describes a response with status code 401, with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostCompanyServicesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *research_models.Error +} + +// IsSuccess returns true when this post company services unauthorized response has a 2xx status code +func (o *PostCompanyServicesUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this post company services unauthorized response has a 3xx status code +func (o *PostCompanyServicesUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post company services unauthorized response has a 4xx status code +func (o *PostCompanyServicesUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this post company services unauthorized response has a 5xx status code +func (o *PostCompanyServicesUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this post company services unauthorized response a status code equal to that given +func (o *PostCompanyServicesUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the post company services unauthorized response +func (o *PostCompanyServicesUnauthorized) Code() int { + return 401 +} + +func (o *PostCompanyServicesUnauthorized) Error() string { + return fmt.Sprintf("[POST /companyservices][%d] postCompanyServicesUnauthorized %+v", 401, o.Payload) +} + +func (o *PostCompanyServicesUnauthorized) String() string { + return fmt.Sprintf("[POST /companyservices][%d] postCompanyServicesUnauthorized %+v", 401, o.Payload) +} + +func (o *PostCompanyServicesUnauthorized) GetPayload() *research_models.Error { + return o.Payload +} + +func (o *PostCompanyServicesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + o.Payload = new(research_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostCompanyServicesForbidden creates a PostCompanyServicesForbidden with default headers values +func NewPostCompanyServicesForbidden() *PostCompanyServicesForbidden { + return &PostCompanyServicesForbidden{} +} + +/* +PostCompanyServicesForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PostCompanyServicesForbidden struct { + AccessControlAllowOrigin string + + Payload *research_models.Error +} + +// IsSuccess returns true when this post company services forbidden response has a 2xx status code +func (o *PostCompanyServicesForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this post company services forbidden response has a 3xx status code +func (o *PostCompanyServicesForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post company services forbidden response has a 4xx status code +func (o *PostCompanyServicesForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this post company services forbidden response has a 5xx status code +func (o *PostCompanyServicesForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this post company services forbidden response a status code equal to that given +func (o *PostCompanyServicesForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the post company services forbidden response +func (o *PostCompanyServicesForbidden) Code() int { + return 403 +} + +func (o *PostCompanyServicesForbidden) Error() string { + return fmt.Sprintf("[POST /companyservices][%d] postCompanyServicesForbidden %+v", 403, o.Payload) +} + +func (o *PostCompanyServicesForbidden) String() string { + return fmt.Sprintf("[POST /companyservices][%d] postCompanyServicesForbidden %+v", 403, o.Payload) +} + +func (o *PostCompanyServicesForbidden) GetPayload() *research_models.Error { + return o.Payload +} + +func (o *PostCompanyServicesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + o.Payload = new(research_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostCompanyServicesConflict creates a PostCompanyServicesConflict with default headers values +func NewPostCompanyServicesConflict() *PostCompanyServicesConflict { + return &PostCompanyServicesConflict{} +} + +/* +PostCompanyServicesConflict describes a response with status code 409, with default header values. + +Conflict +*/ +type PostCompanyServicesConflict struct { + AccessControlAllowOrigin string + + Payload *research_models.Error +} + +// IsSuccess returns true when this post company services conflict response has a 2xx status code +func (o *PostCompanyServicesConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this post company services conflict response has a 3xx status code +func (o *PostCompanyServicesConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post company services conflict response has a 4xx status code +func (o *PostCompanyServicesConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this post company services conflict response has a 5xx status code +func (o *PostCompanyServicesConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this post company services conflict response a status code equal to that given +func (o *PostCompanyServicesConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the post company services conflict response +func (o *PostCompanyServicesConflict) Code() int { + return 409 +} + +func (o *PostCompanyServicesConflict) Error() string { + return fmt.Sprintf("[POST /companyservices][%d] postCompanyServicesConflict %+v", 409, o.Payload) +} + +func (o *PostCompanyServicesConflict) String() string { + return fmt.Sprintf("[POST /companyservices][%d] postCompanyServicesConflict %+v", 409, o.Payload) +} + +func (o *PostCompanyServicesConflict) GetPayload() *research_models.Error { + return o.Payload +} + +func (o *PostCompanyServicesConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + o.Payload = new(research_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostCompanyServicesUnprocessableEntity creates a PostCompanyServicesUnprocessableEntity with default headers values +func NewPostCompanyServicesUnprocessableEntity() *PostCompanyServicesUnprocessableEntity { + return &PostCompanyServicesUnprocessableEntity{} +} + +/* +PostCompanyServicesUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostCompanyServicesUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *research_models.Error +} + +// IsSuccess returns true when this post company services unprocessable entity response has a 2xx status code +func (o *PostCompanyServicesUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this post company services unprocessable entity response has a 3xx status code +func (o *PostCompanyServicesUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post company services unprocessable entity response has a 4xx status code +func (o *PostCompanyServicesUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this post company services unprocessable entity response has a 5xx status code +func (o *PostCompanyServicesUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this post company services unprocessable entity response a status code equal to that given +func (o *PostCompanyServicesUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the post company services unprocessable entity response +func (o *PostCompanyServicesUnprocessableEntity) Code() int { + return 422 +} + +func (o *PostCompanyServicesUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /companyservices][%d] postCompanyServicesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostCompanyServicesUnprocessableEntity) String() string { + return fmt.Sprintf("[POST /companyservices][%d] postCompanyServicesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostCompanyServicesUnprocessableEntity) GetPayload() *research_models.Error { + return o.Payload +} + +func (o *PostCompanyServicesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + o.Payload = new(research_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostCompanyServicesInternalServerError creates a PostCompanyServicesInternalServerError with default headers values +func NewPostCompanyServicesInternalServerError() *PostCompanyServicesInternalServerError { + return &PostCompanyServicesInternalServerError{} +} + +/* +PostCompanyServicesInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PostCompanyServicesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *research_models.Error +} + +// IsSuccess returns true when this post company services internal server error response has a 2xx status code +func (o *PostCompanyServicesInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this post company services internal server error response has a 3xx status code +func (o *PostCompanyServicesInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post company services internal server error response has a 4xx status code +func (o *PostCompanyServicesInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this post company services internal server error response has a 5xx status code +func (o *PostCompanyServicesInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this post company services internal server error response a status code equal to that given +func (o *PostCompanyServicesInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the post company services internal server error response +func (o *PostCompanyServicesInternalServerError) Code() int { + return 500 +} + +func (o *PostCompanyServicesInternalServerError) Error() string { + return fmt.Sprintf("[POST /companyservices][%d] postCompanyServicesInternalServerError %+v", 500, o.Payload) +} + +func (o *PostCompanyServicesInternalServerError) String() string { + return fmt.Sprintf("[POST /companyservices][%d] postCompanyServicesInternalServerError %+v", 500, o.Payload) +} + +func (o *PostCompanyServicesInternalServerError) GetPayload() *research_models.Error { + return o.Payload +} + +func (o *PostCompanyServicesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + o.Payload = new(research_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/sfgate/sfgate_client/documents/documents_client.go b/api/sfgate/sfgate_client/documents/documents_client.go new file mode 100644 index 0000000..0290ad3 --- /dev/null +++ b/api/sfgate/sfgate_client/documents/documents_client.go @@ -0,0 +1,172 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package documents + +// 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 documents API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for documents 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 { + GetDocuments(params *GetDocumentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetDocumentsOK, error) + + PostDocuments(params *PostDocumentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostDocumentsCreated, error) + + PutDocuments(params *PutDocumentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutDocumentsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +GetDocuments gets a list documents + +Return a list of Document records from the datastore +*/ +func (a *Client) GetDocuments(params *GetDocumentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetDocumentsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetDocumentsParams() + } + op := &runtime.ClientOperation{ + ID: "getDocuments", + Method: "GET", + PathPattern: "/documents", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetDocumentsReader{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.(*GetDocumentsOK) + 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 getDocuments: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +PostDocuments creates new documents + +Create Documents in Salesforce +*/ +func (a *Client) PostDocuments(params *PostDocumentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostDocumentsCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostDocumentsParams() + } + op := &runtime.ClientOperation{ + ID: "postDocuments", + Method: "POST", + PathPattern: "/documents", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostDocumentsReader{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.(*PostDocumentsCreated) + 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 postDocuments: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +PutDocuments updates documents + +Update Document in Salesforce +*/ +func (a *Client) PutDocuments(params *PutDocumentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutDocumentsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutDocumentsParams() + } + op := &runtime.ClientOperation{ + ID: "putDocuments", + Method: "PUT", + PathPattern: "/documents", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutDocumentsReader{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.(*PutDocumentsOK) + 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 putDocuments: 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 +} diff --git a/api/sfgate/sfgate_client/documents/get_documents_parameters.go b/api/sfgate/sfgate_client/documents/get_documents_parameters.go new file mode 100644 index 0000000..033ca48 --- /dev/null +++ b/api/sfgate/sfgate_client/documents/get_documents_parameters.go @@ -0,0 +1,240 @@ +// 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 documents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetDocumentsParams creates a new GetDocumentsParams 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 NewGetDocumentsParams() *GetDocumentsParams { + return &GetDocumentsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetDocumentsParamsWithTimeout creates a new GetDocumentsParams object +// with the ability to set a timeout on a request. +func NewGetDocumentsParamsWithTimeout(timeout time.Duration) *GetDocumentsParams { + return &GetDocumentsParams{ + timeout: timeout, + } +} + +// NewGetDocumentsParamsWithContext creates a new GetDocumentsParams object +// with the ability to set a context for a request. +func NewGetDocumentsParamsWithContext(ctx context.Context) *GetDocumentsParams { + return &GetDocumentsParams{ + Context: ctx, + } +} + +// NewGetDocumentsParamsWithHTTPClient creates a new GetDocumentsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetDocumentsParamsWithHTTPClient(client *http.Client) *GetDocumentsParams { + return &GetDocumentsParams{ + HTTPClient: client, + } +} + +/* +GetDocumentsParams contains all the parameters to send to the API endpoint + + for the get documents operation. + + Typically these are written to a http.Request. +*/ +type GetDocumentsParams struct { + + /* ID. + + Unique Record ID + */ + ID *string + + /* Limit. + + How many objects to return at one time + + Format: int64 + */ + Limit *int64 + + /* Offset. + + How many objects to skip? + + Format: int64 + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get documents params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDocumentsParams) WithDefaults() *GetDocumentsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get documents params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDocumentsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get documents params +func (o *GetDocumentsParams) WithTimeout(timeout time.Duration) *GetDocumentsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get documents params +func (o *GetDocumentsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get documents params +func (o *GetDocumentsParams) WithContext(ctx context.Context) *GetDocumentsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get documents params +func (o *GetDocumentsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get documents params +func (o *GetDocumentsParams) WithHTTPClient(client *http.Client) *GetDocumentsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get documents params +func (o *GetDocumentsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the get documents params +func (o *GetDocumentsParams) WithID(id *string) *GetDocumentsParams { + o.SetID(id) + return o +} + +// SetID adds the id to the get documents params +func (o *GetDocumentsParams) SetID(id *string) { + o.ID = id +} + +// WithLimit adds the limit to the get documents params +func (o *GetDocumentsParams) WithLimit(limit *int64) *GetDocumentsParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get documents params +func (o *GetDocumentsParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get documents params +func (o *GetDocumentsParams) WithOffset(offset *int64) *GetDocumentsParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get documents params +func (o *GetDocumentsParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *GetDocumentsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ID != nil { + + // query param id + var qrID string + + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sfgate/sfgate_client/documents/get_documents_responses.go b/api/sfgate/sfgate_client/documents/get_documents_responses.go new file mode 100644 index 0000000..1781f1d --- /dev/null +++ b/api/sfgate/sfgate_client/documents/get_documents_responses.go @@ -0,0 +1,477 @@ +// 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 documents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_models" +) + +// GetDocumentsReader is a Reader for the GetDocuments structure. +type GetDocumentsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetDocumentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetDocumentsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetDocumentsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetDocumentsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetDocumentsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetDocumentsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetDocumentsInternalServerError() + 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()) + } +} + +// NewGetDocumentsOK creates a GetDocumentsOK with default headers values +func NewGetDocumentsOK() *GetDocumentsOK { + return &GetDocumentsOK{} +} + +/* +GetDocumentsOK describes a response with status code 200, with default header values. + +Response with Document objects +*/ +type GetDocumentsOK struct { + Payload *sfgate_models.DocumentResponse +} + +// IsSuccess returns true when this get documents o k response has a 2xx status code +func (o *GetDocumentsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get documents o k response has a 3xx status code +func (o *GetDocumentsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get documents o k response has a 4xx status code +func (o *GetDocumentsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get documents o k response has a 5xx status code +func (o *GetDocumentsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get documents o k response a status code equal to that given +func (o *GetDocumentsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get documents o k response +func (o *GetDocumentsOK) Code() int { + return 200 +} + +func (o *GetDocumentsOK) Error() string { + return fmt.Sprintf("[GET /documents][%d] getDocumentsOK %+v", 200, o.Payload) +} + +func (o *GetDocumentsOK) String() string { + return fmt.Sprintf("[GET /documents][%d] getDocumentsOK %+v", 200, o.Payload) +} + +func (o *GetDocumentsOK) GetPayload() *sfgate_models.DocumentResponse { + return o.Payload +} + +func (o *GetDocumentsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sfgate_models.DocumentResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDocumentsUnauthorized creates a GetDocumentsUnauthorized with default headers values +func NewGetDocumentsUnauthorized() *GetDocumentsUnauthorized { + return &GetDocumentsUnauthorized{} +} + +/* +GetDocumentsUnauthorized describes a response with status code 401, with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetDocumentsUnauthorized struct { + Payload *sfgate_models.Error +} + +// IsSuccess returns true when this get documents unauthorized response has a 2xx status code +func (o *GetDocumentsUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get documents unauthorized response has a 3xx status code +func (o *GetDocumentsUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get documents unauthorized response has a 4xx status code +func (o *GetDocumentsUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this get documents unauthorized response has a 5xx status code +func (o *GetDocumentsUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this get documents unauthorized response a status code equal to that given +func (o *GetDocumentsUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the get documents unauthorized response +func (o *GetDocumentsUnauthorized) Code() int { + return 401 +} + +func (o *GetDocumentsUnauthorized) Error() string { + return fmt.Sprintf("[GET /documents][%d] getDocumentsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetDocumentsUnauthorized) String() string { + return fmt.Sprintf("[GET /documents][%d] getDocumentsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetDocumentsUnauthorized) GetPayload() *sfgate_models.Error { + return o.Payload +} + +func (o *GetDocumentsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sfgate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDocumentsForbidden creates a GetDocumentsForbidden with default headers values +func NewGetDocumentsForbidden() *GetDocumentsForbidden { + return &GetDocumentsForbidden{} +} + +/* +GetDocumentsForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetDocumentsForbidden struct { + Payload *sfgate_models.Error +} + +// IsSuccess returns true when this get documents forbidden response has a 2xx status code +func (o *GetDocumentsForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get documents forbidden response has a 3xx status code +func (o *GetDocumentsForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get documents forbidden response has a 4xx status code +func (o *GetDocumentsForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this get documents forbidden response has a 5xx status code +func (o *GetDocumentsForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this get documents forbidden response a status code equal to that given +func (o *GetDocumentsForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the get documents forbidden response +func (o *GetDocumentsForbidden) Code() int { + return 403 +} + +func (o *GetDocumentsForbidden) Error() string { + return fmt.Sprintf("[GET /documents][%d] getDocumentsForbidden %+v", 403, o.Payload) +} + +func (o *GetDocumentsForbidden) String() string { + return fmt.Sprintf("[GET /documents][%d] getDocumentsForbidden %+v", 403, o.Payload) +} + +func (o *GetDocumentsForbidden) GetPayload() *sfgate_models.Error { + return o.Payload +} + +func (o *GetDocumentsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sfgate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDocumentsNotFound creates a GetDocumentsNotFound with default headers values +func NewGetDocumentsNotFound() *GetDocumentsNotFound { + return &GetDocumentsNotFound{} +} + +/* +GetDocumentsNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetDocumentsNotFound struct { + Payload *sfgate_models.Error +} + +// IsSuccess returns true when this get documents not found response has a 2xx status code +func (o *GetDocumentsNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get documents not found response has a 3xx status code +func (o *GetDocumentsNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get documents not found response has a 4xx status code +func (o *GetDocumentsNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get documents not found response has a 5xx status code +func (o *GetDocumentsNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get documents not found response a status code equal to that given +func (o *GetDocumentsNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get documents not found response +func (o *GetDocumentsNotFound) Code() int { + return 404 +} + +func (o *GetDocumentsNotFound) Error() string { + return fmt.Sprintf("[GET /documents][%d] getDocumentsNotFound %+v", 404, o.Payload) +} + +func (o *GetDocumentsNotFound) String() string { + return fmt.Sprintf("[GET /documents][%d] getDocumentsNotFound %+v", 404, o.Payload) +} + +func (o *GetDocumentsNotFound) GetPayload() *sfgate_models.Error { + return o.Payload +} + +func (o *GetDocumentsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sfgate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDocumentsUnprocessableEntity creates a GetDocumentsUnprocessableEntity with default headers values +func NewGetDocumentsUnprocessableEntity() *GetDocumentsUnprocessableEntity { + return &GetDocumentsUnprocessableEntity{} +} + +/* +GetDocumentsUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetDocumentsUnprocessableEntity struct { + Payload *sfgate_models.Error +} + +// IsSuccess returns true when this get documents unprocessable entity response has a 2xx status code +func (o *GetDocumentsUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get documents unprocessable entity response has a 3xx status code +func (o *GetDocumentsUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get documents unprocessable entity response has a 4xx status code +func (o *GetDocumentsUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this get documents unprocessable entity response has a 5xx status code +func (o *GetDocumentsUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this get documents unprocessable entity response a status code equal to that given +func (o *GetDocumentsUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the get documents unprocessable entity response +func (o *GetDocumentsUnprocessableEntity) Code() int { + return 422 +} + +func (o *GetDocumentsUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /documents][%d] getDocumentsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetDocumentsUnprocessableEntity) String() string { + return fmt.Sprintf("[GET /documents][%d] getDocumentsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetDocumentsUnprocessableEntity) GetPayload() *sfgate_models.Error { + return o.Payload +} + +func (o *GetDocumentsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sfgate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDocumentsInternalServerError creates a GetDocumentsInternalServerError with default headers values +func NewGetDocumentsInternalServerError() *GetDocumentsInternalServerError { + return &GetDocumentsInternalServerError{} +} + +/* +GetDocumentsInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetDocumentsInternalServerError struct { + Payload *sfgate_models.Error +} + +// IsSuccess returns true when this get documents internal server error response has a 2xx status code +func (o *GetDocumentsInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get documents internal server error response has a 3xx status code +func (o *GetDocumentsInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get documents internal server error response has a 4xx status code +func (o *GetDocumentsInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get documents internal server error response has a 5xx status code +func (o *GetDocumentsInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get documents internal server error response a status code equal to that given +func (o *GetDocumentsInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the get documents internal server error response +func (o *GetDocumentsInternalServerError) Code() int { + return 500 +} + +func (o *GetDocumentsInternalServerError) Error() string { + return fmt.Sprintf("[GET /documents][%d] getDocumentsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetDocumentsInternalServerError) String() string { + return fmt.Sprintf("[GET /documents][%d] getDocumentsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetDocumentsInternalServerError) GetPayload() *sfgate_models.Error { + return o.Payload +} + +func (o *GetDocumentsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sfgate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/sfgate/sfgate_client/documents/post_documents_parameters.go b/api/sfgate/sfgate_client/documents/post_documents_parameters.go new file mode 100644 index 0000000..4dda296 --- /dev/null +++ b/api/sfgate/sfgate_client/documents/post_documents_parameters.go @@ -0,0 +1,157 @@ +// 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 documents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_models" +) + +// NewPostDocumentsParams creates a new PostDocumentsParams 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 NewPostDocumentsParams() *PostDocumentsParams { + return &PostDocumentsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPostDocumentsParamsWithTimeout creates a new PostDocumentsParams object +// with the ability to set a timeout on a request. +func NewPostDocumentsParamsWithTimeout(timeout time.Duration) *PostDocumentsParams { + return &PostDocumentsParams{ + timeout: timeout, + } +} + +// NewPostDocumentsParamsWithContext creates a new PostDocumentsParams object +// with the ability to set a context for a request. +func NewPostDocumentsParamsWithContext(ctx context.Context) *PostDocumentsParams { + return &PostDocumentsParams{ + Context: ctx, + } +} + +// NewPostDocumentsParamsWithHTTPClient creates a new PostDocumentsParams object +// with the ability to set a custom HTTPClient for a request. +func NewPostDocumentsParamsWithHTTPClient(client *http.Client) *PostDocumentsParams { + return &PostDocumentsParams{ + HTTPClient: client, + } +} + +/* +PostDocumentsParams contains all the parameters to send to the API endpoint + + for the post documents operation. + + Typically these are written to a http.Request. +*/ +type PostDocumentsParams struct { + + /* DocumentRequest. + + An array of new Document records + */ + DocumentRequest *sfgate_models.DocumentRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the post documents params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostDocumentsParams) WithDefaults() *PostDocumentsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the post documents params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostDocumentsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the post documents params +func (o *PostDocumentsParams) WithTimeout(timeout time.Duration) *PostDocumentsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post documents params +func (o *PostDocumentsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post documents params +func (o *PostDocumentsParams) WithContext(ctx context.Context) *PostDocumentsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post documents params +func (o *PostDocumentsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post documents params +func (o *PostDocumentsParams) WithHTTPClient(client *http.Client) *PostDocumentsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post documents params +func (o *PostDocumentsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDocumentRequest adds the documentRequest to the post documents params +func (o *PostDocumentsParams) WithDocumentRequest(documentRequest *sfgate_models.DocumentRequest) *PostDocumentsParams { + o.SetDocumentRequest(documentRequest) + return o +} + +// SetDocumentRequest adds the documentRequest to the post documents params +func (o *PostDocumentsParams) SetDocumentRequest(documentRequest *sfgate_models.DocumentRequest) { + o.DocumentRequest = documentRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostDocumentsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.DocumentRequest != nil { + if err := r.SetBodyParam(o.DocumentRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sfgate/sfgate_client/documents/post_documents_responses.go b/api/sfgate/sfgate_client/documents/post_documents_responses.go new file mode 100644 index 0000000..5b71243 --- /dev/null +++ b/api/sfgate/sfgate_client/documents/post_documents_responses.go @@ -0,0 +1,477 @@ +// 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 documents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_models" +) + +// PostDocumentsReader is a Reader for the PostDocuments structure. +type PostDocumentsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostDocumentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewPostDocumentsCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostDocumentsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostDocumentsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostDocumentsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostDocumentsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostDocumentsInternalServerError() + 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()) + } +} + +// NewPostDocumentsCreated creates a PostDocumentsCreated with default headers values +func NewPostDocumentsCreated() *PostDocumentsCreated { + return &PostDocumentsCreated{} +} + +/* +PostDocumentsCreated describes a response with status code 201, with default header values. + +Response from Salesforce +*/ +type PostDocumentsCreated struct { + Payload *sfgate_models.SalesforcePostResponse +} + +// IsSuccess returns true when this post documents created response has a 2xx status code +func (o *PostDocumentsCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this post documents created response has a 3xx status code +func (o *PostDocumentsCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post documents created response has a 4xx status code +func (o *PostDocumentsCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this post documents created response has a 5xx status code +func (o *PostDocumentsCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this post documents created response a status code equal to that given +func (o *PostDocumentsCreated) IsCode(code int) bool { + return code == 201 +} + +// Code gets the status code for the post documents created response +func (o *PostDocumentsCreated) Code() int { + return 201 +} + +func (o *PostDocumentsCreated) Error() string { + return fmt.Sprintf("[POST /documents][%d] postDocumentsCreated %+v", 201, o.Payload) +} + +func (o *PostDocumentsCreated) String() string { + return fmt.Sprintf("[POST /documents][%d] postDocumentsCreated %+v", 201, o.Payload) +} + +func (o *PostDocumentsCreated) GetPayload() *sfgate_models.SalesforcePostResponse { + return o.Payload +} + +func (o *PostDocumentsCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sfgate_models.SalesforcePostResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostDocumentsUnauthorized creates a PostDocumentsUnauthorized with default headers values +func NewPostDocumentsUnauthorized() *PostDocumentsUnauthorized { + return &PostDocumentsUnauthorized{} +} + +/* +PostDocumentsUnauthorized describes a response with status code 401, with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostDocumentsUnauthorized struct { + Payload *sfgate_models.Error +} + +// IsSuccess returns true when this post documents unauthorized response has a 2xx status code +func (o *PostDocumentsUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this post documents unauthorized response has a 3xx status code +func (o *PostDocumentsUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post documents unauthorized response has a 4xx status code +func (o *PostDocumentsUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this post documents unauthorized response has a 5xx status code +func (o *PostDocumentsUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this post documents unauthorized response a status code equal to that given +func (o *PostDocumentsUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the post documents unauthorized response +func (o *PostDocumentsUnauthorized) Code() int { + return 401 +} + +func (o *PostDocumentsUnauthorized) Error() string { + return fmt.Sprintf("[POST /documents][%d] postDocumentsUnauthorized %+v", 401, o.Payload) +} + +func (o *PostDocumentsUnauthorized) String() string { + return fmt.Sprintf("[POST /documents][%d] postDocumentsUnauthorized %+v", 401, o.Payload) +} + +func (o *PostDocumentsUnauthorized) GetPayload() *sfgate_models.Error { + return o.Payload +} + +func (o *PostDocumentsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sfgate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostDocumentsForbidden creates a PostDocumentsForbidden with default headers values +func NewPostDocumentsForbidden() *PostDocumentsForbidden { + return &PostDocumentsForbidden{} +} + +/* +PostDocumentsForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PostDocumentsForbidden struct { + Payload *sfgate_models.Error +} + +// IsSuccess returns true when this post documents forbidden response has a 2xx status code +func (o *PostDocumentsForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this post documents forbidden response has a 3xx status code +func (o *PostDocumentsForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post documents forbidden response has a 4xx status code +func (o *PostDocumentsForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this post documents forbidden response has a 5xx status code +func (o *PostDocumentsForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this post documents forbidden response a status code equal to that given +func (o *PostDocumentsForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the post documents forbidden response +func (o *PostDocumentsForbidden) Code() int { + return 403 +} + +func (o *PostDocumentsForbidden) Error() string { + return fmt.Sprintf("[POST /documents][%d] postDocumentsForbidden %+v", 403, o.Payload) +} + +func (o *PostDocumentsForbidden) String() string { + return fmt.Sprintf("[POST /documents][%d] postDocumentsForbidden %+v", 403, o.Payload) +} + +func (o *PostDocumentsForbidden) GetPayload() *sfgate_models.Error { + return o.Payload +} + +func (o *PostDocumentsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sfgate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostDocumentsNotFound creates a PostDocumentsNotFound with default headers values +func NewPostDocumentsNotFound() *PostDocumentsNotFound { + return &PostDocumentsNotFound{} +} + +/* +PostDocumentsNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PostDocumentsNotFound struct { + Payload *sfgate_models.Error +} + +// IsSuccess returns true when this post documents not found response has a 2xx status code +func (o *PostDocumentsNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this post documents not found response has a 3xx status code +func (o *PostDocumentsNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post documents not found response has a 4xx status code +func (o *PostDocumentsNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this post documents not found response has a 5xx status code +func (o *PostDocumentsNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this post documents not found response a status code equal to that given +func (o *PostDocumentsNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the post documents not found response +func (o *PostDocumentsNotFound) Code() int { + return 404 +} + +func (o *PostDocumentsNotFound) Error() string { + return fmt.Sprintf("[POST /documents][%d] postDocumentsNotFound %+v", 404, o.Payload) +} + +func (o *PostDocumentsNotFound) String() string { + return fmt.Sprintf("[POST /documents][%d] postDocumentsNotFound %+v", 404, o.Payload) +} + +func (o *PostDocumentsNotFound) GetPayload() *sfgate_models.Error { + return o.Payload +} + +func (o *PostDocumentsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sfgate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostDocumentsUnprocessableEntity creates a PostDocumentsUnprocessableEntity with default headers values +func NewPostDocumentsUnprocessableEntity() *PostDocumentsUnprocessableEntity { + return &PostDocumentsUnprocessableEntity{} +} + +/* +PostDocumentsUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostDocumentsUnprocessableEntity struct { + Payload *sfgate_models.Error +} + +// IsSuccess returns true when this post documents unprocessable entity response has a 2xx status code +func (o *PostDocumentsUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this post documents unprocessable entity response has a 3xx status code +func (o *PostDocumentsUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post documents unprocessable entity response has a 4xx status code +func (o *PostDocumentsUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this post documents unprocessable entity response has a 5xx status code +func (o *PostDocumentsUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this post documents unprocessable entity response a status code equal to that given +func (o *PostDocumentsUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the post documents unprocessable entity response +func (o *PostDocumentsUnprocessableEntity) Code() int { + return 422 +} + +func (o *PostDocumentsUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /documents][%d] postDocumentsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostDocumentsUnprocessableEntity) String() string { + return fmt.Sprintf("[POST /documents][%d] postDocumentsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostDocumentsUnprocessableEntity) GetPayload() *sfgate_models.Error { + return o.Payload +} + +func (o *PostDocumentsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sfgate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostDocumentsInternalServerError creates a PostDocumentsInternalServerError with default headers values +func NewPostDocumentsInternalServerError() *PostDocumentsInternalServerError { + return &PostDocumentsInternalServerError{} +} + +/* +PostDocumentsInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PostDocumentsInternalServerError struct { + Payload *sfgate_models.Error +} + +// IsSuccess returns true when this post documents internal server error response has a 2xx status code +func (o *PostDocumentsInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this post documents internal server error response has a 3xx status code +func (o *PostDocumentsInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post documents internal server error response has a 4xx status code +func (o *PostDocumentsInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this post documents internal server error response has a 5xx status code +func (o *PostDocumentsInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this post documents internal server error response a status code equal to that given +func (o *PostDocumentsInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the post documents internal server error response +func (o *PostDocumentsInternalServerError) Code() int { + return 500 +} + +func (o *PostDocumentsInternalServerError) Error() string { + return fmt.Sprintf("[POST /documents][%d] postDocumentsInternalServerError %+v", 500, o.Payload) +} + +func (o *PostDocumentsInternalServerError) String() string { + return fmt.Sprintf("[POST /documents][%d] postDocumentsInternalServerError %+v", 500, o.Payload) +} + +func (o *PostDocumentsInternalServerError) GetPayload() *sfgate_models.Error { + return o.Payload +} + +func (o *PostDocumentsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sfgate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/sfgate/sfgate_client/documents/put_documents_parameters.go b/api/sfgate/sfgate_client/documents/put_documents_parameters.go new file mode 100644 index 0000000..540d715 --- /dev/null +++ b/api/sfgate/sfgate_client/documents/put_documents_parameters.go @@ -0,0 +1,157 @@ +// 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 documents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_models" +) + +// NewPutDocumentsParams creates a new PutDocumentsParams 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 NewPutDocumentsParams() *PutDocumentsParams { + return &PutDocumentsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPutDocumentsParamsWithTimeout creates a new PutDocumentsParams object +// with the ability to set a timeout on a request. +func NewPutDocumentsParamsWithTimeout(timeout time.Duration) *PutDocumentsParams { + return &PutDocumentsParams{ + timeout: timeout, + } +} + +// NewPutDocumentsParamsWithContext creates a new PutDocumentsParams object +// with the ability to set a context for a request. +func NewPutDocumentsParamsWithContext(ctx context.Context) *PutDocumentsParams { + return &PutDocumentsParams{ + Context: ctx, + } +} + +// NewPutDocumentsParamsWithHTTPClient creates a new PutDocumentsParams object +// with the ability to set a custom HTTPClient for a request. +func NewPutDocumentsParamsWithHTTPClient(client *http.Client) *PutDocumentsParams { + return &PutDocumentsParams{ + HTTPClient: client, + } +} + +/* +PutDocumentsParams contains all the parameters to send to the API endpoint + + for the put documents operation. + + Typically these are written to a http.Request. +*/ +type PutDocumentsParams struct { + + /* DocumentRequest. + + An array of new Document records + */ + DocumentRequest *sfgate_models.DocumentRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the put documents params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutDocumentsParams) WithDefaults() *PutDocumentsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the put documents params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutDocumentsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the put documents params +func (o *PutDocumentsParams) WithTimeout(timeout time.Duration) *PutDocumentsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put documents params +func (o *PutDocumentsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put documents params +func (o *PutDocumentsParams) WithContext(ctx context.Context) *PutDocumentsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put documents params +func (o *PutDocumentsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put documents params +func (o *PutDocumentsParams) WithHTTPClient(client *http.Client) *PutDocumentsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put documents params +func (o *PutDocumentsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDocumentRequest adds the documentRequest to the put documents params +func (o *PutDocumentsParams) WithDocumentRequest(documentRequest *sfgate_models.DocumentRequest) *PutDocumentsParams { + o.SetDocumentRequest(documentRequest) + return o +} + +// SetDocumentRequest adds the documentRequest to the put documents params +func (o *PutDocumentsParams) SetDocumentRequest(documentRequest *sfgate_models.DocumentRequest) { + o.DocumentRequest = documentRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutDocumentsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.DocumentRequest != nil { + if err := r.SetBodyParam(o.DocumentRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sfgate/sfgate_client/documents/put_documents_responses.go b/api/sfgate/sfgate_client/documents/put_documents_responses.go new file mode 100644 index 0000000..6f9ad0a --- /dev/null +++ b/api/sfgate/sfgate_client/documents/put_documents_responses.go @@ -0,0 +1,477 @@ +// 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 documents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_models" +) + +// PutDocumentsReader is a Reader for the PutDocuments structure. +type PutDocumentsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutDocumentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutDocumentsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutDocumentsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutDocumentsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutDocumentsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPutDocumentsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutDocumentsInternalServerError() + 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()) + } +} + +// NewPutDocumentsOK creates a PutDocumentsOK with default headers values +func NewPutDocumentsOK() *PutDocumentsOK { + return &PutDocumentsOK{} +} + +/* +PutDocumentsOK describes a response with status code 200, with default header values. + +Response with Document objects +*/ +type PutDocumentsOK struct { + Payload *sfgate_models.DocumentResponse +} + +// IsSuccess returns true when this put documents o k response has a 2xx status code +func (o *PutDocumentsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this put documents o k response has a 3xx status code +func (o *PutDocumentsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this put documents o k response has a 4xx status code +func (o *PutDocumentsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this put documents o k response has a 5xx status code +func (o *PutDocumentsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this put documents o k response a status code equal to that given +func (o *PutDocumentsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the put documents o k response +func (o *PutDocumentsOK) Code() int { + return 200 +} + +func (o *PutDocumentsOK) Error() string { + return fmt.Sprintf("[PUT /documents][%d] putDocumentsOK %+v", 200, o.Payload) +} + +func (o *PutDocumentsOK) String() string { + return fmt.Sprintf("[PUT /documents][%d] putDocumentsOK %+v", 200, o.Payload) +} + +func (o *PutDocumentsOK) GetPayload() *sfgate_models.DocumentResponse { + return o.Payload +} + +func (o *PutDocumentsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sfgate_models.DocumentResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutDocumentsUnauthorized creates a PutDocumentsUnauthorized with default headers values +func NewPutDocumentsUnauthorized() *PutDocumentsUnauthorized { + return &PutDocumentsUnauthorized{} +} + +/* +PutDocumentsUnauthorized describes a response with status code 401, with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PutDocumentsUnauthorized struct { + Payload *sfgate_models.Error +} + +// IsSuccess returns true when this put documents unauthorized response has a 2xx status code +func (o *PutDocumentsUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this put documents unauthorized response has a 3xx status code +func (o *PutDocumentsUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this put documents unauthorized response has a 4xx status code +func (o *PutDocumentsUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this put documents unauthorized response has a 5xx status code +func (o *PutDocumentsUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this put documents unauthorized response a status code equal to that given +func (o *PutDocumentsUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the put documents unauthorized response +func (o *PutDocumentsUnauthorized) Code() int { + return 401 +} + +func (o *PutDocumentsUnauthorized) Error() string { + return fmt.Sprintf("[PUT /documents][%d] putDocumentsUnauthorized %+v", 401, o.Payload) +} + +func (o *PutDocumentsUnauthorized) String() string { + return fmt.Sprintf("[PUT /documents][%d] putDocumentsUnauthorized %+v", 401, o.Payload) +} + +func (o *PutDocumentsUnauthorized) GetPayload() *sfgate_models.Error { + return o.Payload +} + +func (o *PutDocumentsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sfgate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutDocumentsForbidden creates a PutDocumentsForbidden with default headers values +func NewPutDocumentsForbidden() *PutDocumentsForbidden { + return &PutDocumentsForbidden{} +} + +/* +PutDocumentsForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PutDocumentsForbidden struct { + Payload *sfgate_models.Error +} + +// IsSuccess returns true when this put documents forbidden response has a 2xx status code +func (o *PutDocumentsForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this put documents forbidden response has a 3xx status code +func (o *PutDocumentsForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this put documents forbidden response has a 4xx status code +func (o *PutDocumentsForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this put documents forbidden response has a 5xx status code +func (o *PutDocumentsForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this put documents forbidden response a status code equal to that given +func (o *PutDocumentsForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the put documents forbidden response +func (o *PutDocumentsForbidden) Code() int { + return 403 +} + +func (o *PutDocumentsForbidden) Error() string { + return fmt.Sprintf("[PUT /documents][%d] putDocumentsForbidden %+v", 403, o.Payload) +} + +func (o *PutDocumentsForbidden) String() string { + return fmt.Sprintf("[PUT /documents][%d] putDocumentsForbidden %+v", 403, o.Payload) +} + +func (o *PutDocumentsForbidden) GetPayload() *sfgate_models.Error { + return o.Payload +} + +func (o *PutDocumentsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sfgate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutDocumentsNotFound creates a PutDocumentsNotFound with default headers values +func NewPutDocumentsNotFound() *PutDocumentsNotFound { + return &PutDocumentsNotFound{} +} + +/* +PutDocumentsNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PutDocumentsNotFound struct { + Payload *sfgate_models.Error +} + +// IsSuccess returns true when this put documents not found response has a 2xx status code +func (o *PutDocumentsNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this put documents not found response has a 3xx status code +func (o *PutDocumentsNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this put documents not found response has a 4xx status code +func (o *PutDocumentsNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this put documents not found response has a 5xx status code +func (o *PutDocumentsNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this put documents not found response a status code equal to that given +func (o *PutDocumentsNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the put documents not found response +func (o *PutDocumentsNotFound) Code() int { + return 404 +} + +func (o *PutDocumentsNotFound) Error() string { + return fmt.Sprintf("[PUT /documents][%d] putDocumentsNotFound %+v", 404, o.Payload) +} + +func (o *PutDocumentsNotFound) String() string { + return fmt.Sprintf("[PUT /documents][%d] putDocumentsNotFound %+v", 404, o.Payload) +} + +func (o *PutDocumentsNotFound) GetPayload() *sfgate_models.Error { + return o.Payload +} + +func (o *PutDocumentsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sfgate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutDocumentsUnprocessableEntity creates a PutDocumentsUnprocessableEntity with default headers values +func NewPutDocumentsUnprocessableEntity() *PutDocumentsUnprocessableEntity { + return &PutDocumentsUnprocessableEntity{} +} + +/* +PutDocumentsUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PutDocumentsUnprocessableEntity struct { + Payload *sfgate_models.Error +} + +// IsSuccess returns true when this put documents unprocessable entity response has a 2xx status code +func (o *PutDocumentsUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this put documents unprocessable entity response has a 3xx status code +func (o *PutDocumentsUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this put documents unprocessable entity response has a 4xx status code +func (o *PutDocumentsUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this put documents unprocessable entity response has a 5xx status code +func (o *PutDocumentsUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this put documents unprocessable entity response a status code equal to that given +func (o *PutDocumentsUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the put documents unprocessable entity response +func (o *PutDocumentsUnprocessableEntity) Code() int { + return 422 +} + +func (o *PutDocumentsUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /documents][%d] putDocumentsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PutDocumentsUnprocessableEntity) String() string { + return fmt.Sprintf("[PUT /documents][%d] putDocumentsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PutDocumentsUnprocessableEntity) GetPayload() *sfgate_models.Error { + return o.Payload +} + +func (o *PutDocumentsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sfgate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutDocumentsInternalServerError creates a PutDocumentsInternalServerError with default headers values +func NewPutDocumentsInternalServerError() *PutDocumentsInternalServerError { + return &PutDocumentsInternalServerError{} +} + +/* +PutDocumentsInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PutDocumentsInternalServerError struct { + Payload *sfgate_models.Error +} + +// IsSuccess returns true when this put documents internal server error response has a 2xx status code +func (o *PutDocumentsInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this put documents internal server error response has a 3xx status code +func (o *PutDocumentsInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this put documents internal server error response has a 4xx status code +func (o *PutDocumentsInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this put documents internal server error response has a 5xx status code +func (o *PutDocumentsInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this put documents internal server error response a status code equal to that given +func (o *PutDocumentsInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the put documents internal server error response +func (o *PutDocumentsInternalServerError) Code() int { + return 500 +} + +func (o *PutDocumentsInternalServerError) Error() string { + return fmt.Sprintf("[PUT /documents][%d] putDocumentsInternalServerError %+v", 500, o.Payload) +} + +func (o *PutDocumentsInternalServerError) String() string { + return fmt.Sprintf("[PUT /documents][%d] putDocumentsInternalServerError %+v", 500, o.Payload) +} + +func (o *PutDocumentsInternalServerError) GetPayload() *sfgate_models.Error { + return o.Payload +} + +func (o *PutDocumentsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sfgate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/sfgate/sfgate_client/research_projects/get_research_project_documents_parameters.go b/api/sfgate/sfgate_client/research_projects/get_research_project_documents_parameters.go new file mode 100644 index 0000000..05b6d26 --- /dev/null +++ b/api/sfgate/sfgate_client/research_projects/get_research_project_documents_parameters.go @@ -0,0 +1,240 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package research_projects + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetResearchProjectDocumentsParams creates a new GetResearchProjectDocumentsParams 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 NewGetResearchProjectDocumentsParams() *GetResearchProjectDocumentsParams { + return &GetResearchProjectDocumentsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetResearchProjectDocumentsParamsWithTimeout creates a new GetResearchProjectDocumentsParams object +// with the ability to set a timeout on a request. +func NewGetResearchProjectDocumentsParamsWithTimeout(timeout time.Duration) *GetResearchProjectDocumentsParams { + return &GetResearchProjectDocumentsParams{ + timeout: timeout, + } +} + +// NewGetResearchProjectDocumentsParamsWithContext creates a new GetResearchProjectDocumentsParams object +// with the ability to set a context for a request. +func NewGetResearchProjectDocumentsParamsWithContext(ctx context.Context) *GetResearchProjectDocumentsParams { + return &GetResearchProjectDocumentsParams{ + Context: ctx, + } +} + +// NewGetResearchProjectDocumentsParamsWithHTTPClient creates a new GetResearchProjectDocumentsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetResearchProjectDocumentsParamsWithHTTPClient(client *http.Client) *GetResearchProjectDocumentsParams { + return &GetResearchProjectDocumentsParams{ + HTTPClient: client, + } +} + +/* +GetResearchProjectDocumentsParams contains all the parameters to send to the API endpoint + + for the get research project documents operation. + + Typically these are written to a http.Request. +*/ +type GetResearchProjectDocumentsParams struct { + + /* ID. + + Unique Record ID + */ + ID *string + + /* Limit. + + How many objects to return at one time + + Format: int64 + */ + Limit *int64 + + /* Offset. + + How many objects to skip? + + Format: int64 + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get research project documents params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetResearchProjectDocumentsParams) WithDefaults() *GetResearchProjectDocumentsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get research project documents params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetResearchProjectDocumentsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get research project documents params +func (o *GetResearchProjectDocumentsParams) WithTimeout(timeout time.Duration) *GetResearchProjectDocumentsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get research project documents params +func (o *GetResearchProjectDocumentsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get research project documents params +func (o *GetResearchProjectDocumentsParams) WithContext(ctx context.Context) *GetResearchProjectDocumentsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get research project documents params +func (o *GetResearchProjectDocumentsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get research project documents params +func (o *GetResearchProjectDocumentsParams) WithHTTPClient(client *http.Client) *GetResearchProjectDocumentsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get research project documents params +func (o *GetResearchProjectDocumentsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the get research project documents params +func (o *GetResearchProjectDocumentsParams) WithID(id *string) *GetResearchProjectDocumentsParams { + o.SetID(id) + return o +} + +// SetID adds the id to the get research project documents params +func (o *GetResearchProjectDocumentsParams) SetID(id *string) { + o.ID = id +} + +// WithLimit adds the limit to the get research project documents params +func (o *GetResearchProjectDocumentsParams) WithLimit(limit *int64) *GetResearchProjectDocumentsParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get research project documents params +func (o *GetResearchProjectDocumentsParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get research project documents params +func (o *GetResearchProjectDocumentsParams) WithOffset(offset *int64) *GetResearchProjectDocumentsParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get research project documents params +func (o *GetResearchProjectDocumentsParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *GetResearchProjectDocumentsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ID != nil { + + // query param id + var qrID string + + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sfgate/sfgate_client/research_projects/get_research_project_documents_responses.go b/api/sfgate/sfgate_client/research_projects/get_research_project_documents_responses.go new file mode 100644 index 0000000..0a01abe --- /dev/null +++ b/api/sfgate/sfgate_client/research_projects/get_research_project_documents_responses.go @@ -0,0 +1,477 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package research_projects + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_models" +) + +// GetResearchProjectDocumentsReader is a Reader for the GetResearchProjectDocuments structure. +type GetResearchProjectDocumentsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetResearchProjectDocumentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetResearchProjectDocumentsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetResearchProjectDocumentsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetResearchProjectDocumentsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetResearchProjectDocumentsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetResearchProjectDocumentsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetResearchProjectDocumentsInternalServerError() + 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()) + } +} + +// NewGetResearchProjectDocumentsOK creates a GetResearchProjectDocumentsOK with default headers values +func NewGetResearchProjectDocumentsOK() *GetResearchProjectDocumentsOK { + return &GetResearchProjectDocumentsOK{} +} + +/* +GetResearchProjectDocumentsOK describes a response with status code 200, with default header values. + +ResearchProjectDocument Response Object +*/ +type GetResearchProjectDocumentsOK struct { + Payload *sfgate_models.ResearchProjectDocumentResponse +} + +// IsSuccess returns true when this get research project documents o k response has a 2xx status code +func (o *GetResearchProjectDocumentsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get research project documents o k response has a 3xx status code +func (o *GetResearchProjectDocumentsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get research project documents o k response has a 4xx status code +func (o *GetResearchProjectDocumentsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get research project documents o k response has a 5xx status code +func (o *GetResearchProjectDocumentsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get research project documents o k response a status code equal to that given +func (o *GetResearchProjectDocumentsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get research project documents o k response +func (o *GetResearchProjectDocumentsOK) Code() int { + return 200 +} + +func (o *GetResearchProjectDocumentsOK) Error() string { + return fmt.Sprintf("[GET /researchprojectdocuments][%d] getResearchProjectDocumentsOK %+v", 200, o.Payload) +} + +func (o *GetResearchProjectDocumentsOK) String() string { + return fmt.Sprintf("[GET /researchprojectdocuments][%d] getResearchProjectDocumentsOK %+v", 200, o.Payload) +} + +func (o *GetResearchProjectDocumentsOK) GetPayload() *sfgate_models.ResearchProjectDocumentResponse { + return o.Payload +} + +func (o *GetResearchProjectDocumentsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sfgate_models.ResearchProjectDocumentResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetResearchProjectDocumentsUnauthorized creates a GetResearchProjectDocumentsUnauthorized with default headers values +func NewGetResearchProjectDocumentsUnauthorized() *GetResearchProjectDocumentsUnauthorized { + return &GetResearchProjectDocumentsUnauthorized{} +} + +/* +GetResearchProjectDocumentsUnauthorized describes a response with status code 401, with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetResearchProjectDocumentsUnauthorized struct { + Payload *sfgate_models.Error +} + +// IsSuccess returns true when this get research project documents unauthorized response has a 2xx status code +func (o *GetResearchProjectDocumentsUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get research project documents unauthorized response has a 3xx status code +func (o *GetResearchProjectDocumentsUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get research project documents unauthorized response has a 4xx status code +func (o *GetResearchProjectDocumentsUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this get research project documents unauthorized response has a 5xx status code +func (o *GetResearchProjectDocumentsUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this get research project documents unauthorized response a status code equal to that given +func (o *GetResearchProjectDocumentsUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the get research project documents unauthorized response +func (o *GetResearchProjectDocumentsUnauthorized) Code() int { + return 401 +} + +func (o *GetResearchProjectDocumentsUnauthorized) Error() string { + return fmt.Sprintf("[GET /researchprojectdocuments][%d] getResearchProjectDocumentsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetResearchProjectDocumentsUnauthorized) String() string { + return fmt.Sprintf("[GET /researchprojectdocuments][%d] getResearchProjectDocumentsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetResearchProjectDocumentsUnauthorized) GetPayload() *sfgate_models.Error { + return o.Payload +} + +func (o *GetResearchProjectDocumentsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sfgate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetResearchProjectDocumentsForbidden creates a GetResearchProjectDocumentsForbidden with default headers values +func NewGetResearchProjectDocumentsForbidden() *GetResearchProjectDocumentsForbidden { + return &GetResearchProjectDocumentsForbidden{} +} + +/* +GetResearchProjectDocumentsForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetResearchProjectDocumentsForbidden struct { + Payload *sfgate_models.Error +} + +// IsSuccess returns true when this get research project documents forbidden response has a 2xx status code +func (o *GetResearchProjectDocumentsForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get research project documents forbidden response has a 3xx status code +func (o *GetResearchProjectDocumentsForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get research project documents forbidden response has a 4xx status code +func (o *GetResearchProjectDocumentsForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this get research project documents forbidden response has a 5xx status code +func (o *GetResearchProjectDocumentsForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this get research project documents forbidden response a status code equal to that given +func (o *GetResearchProjectDocumentsForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the get research project documents forbidden response +func (o *GetResearchProjectDocumentsForbidden) Code() int { + return 403 +} + +func (o *GetResearchProjectDocumentsForbidden) Error() string { + return fmt.Sprintf("[GET /researchprojectdocuments][%d] getResearchProjectDocumentsForbidden %+v", 403, o.Payload) +} + +func (o *GetResearchProjectDocumentsForbidden) String() string { + return fmt.Sprintf("[GET /researchprojectdocuments][%d] getResearchProjectDocumentsForbidden %+v", 403, o.Payload) +} + +func (o *GetResearchProjectDocumentsForbidden) GetPayload() *sfgate_models.Error { + return o.Payload +} + +func (o *GetResearchProjectDocumentsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sfgate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetResearchProjectDocumentsNotFound creates a GetResearchProjectDocumentsNotFound with default headers values +func NewGetResearchProjectDocumentsNotFound() *GetResearchProjectDocumentsNotFound { + return &GetResearchProjectDocumentsNotFound{} +} + +/* +GetResearchProjectDocumentsNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetResearchProjectDocumentsNotFound struct { + Payload *sfgate_models.Error +} + +// IsSuccess returns true when this get research project documents not found response has a 2xx status code +func (o *GetResearchProjectDocumentsNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get research project documents not found response has a 3xx status code +func (o *GetResearchProjectDocumentsNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get research project documents not found response has a 4xx status code +func (o *GetResearchProjectDocumentsNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get research project documents not found response has a 5xx status code +func (o *GetResearchProjectDocumentsNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get research project documents not found response a status code equal to that given +func (o *GetResearchProjectDocumentsNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get research project documents not found response +func (o *GetResearchProjectDocumentsNotFound) Code() int { + return 404 +} + +func (o *GetResearchProjectDocumentsNotFound) Error() string { + return fmt.Sprintf("[GET /researchprojectdocuments][%d] getResearchProjectDocumentsNotFound %+v", 404, o.Payload) +} + +func (o *GetResearchProjectDocumentsNotFound) String() string { + return fmt.Sprintf("[GET /researchprojectdocuments][%d] getResearchProjectDocumentsNotFound %+v", 404, o.Payload) +} + +func (o *GetResearchProjectDocumentsNotFound) GetPayload() *sfgate_models.Error { + return o.Payload +} + +func (o *GetResearchProjectDocumentsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sfgate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetResearchProjectDocumentsUnprocessableEntity creates a GetResearchProjectDocumentsUnprocessableEntity with default headers values +func NewGetResearchProjectDocumentsUnprocessableEntity() *GetResearchProjectDocumentsUnprocessableEntity { + return &GetResearchProjectDocumentsUnprocessableEntity{} +} + +/* +GetResearchProjectDocumentsUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetResearchProjectDocumentsUnprocessableEntity struct { + Payload *sfgate_models.Error +} + +// IsSuccess returns true when this get research project documents unprocessable entity response has a 2xx status code +func (o *GetResearchProjectDocumentsUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get research project documents unprocessable entity response has a 3xx status code +func (o *GetResearchProjectDocumentsUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get research project documents unprocessable entity response has a 4xx status code +func (o *GetResearchProjectDocumentsUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this get research project documents unprocessable entity response has a 5xx status code +func (o *GetResearchProjectDocumentsUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this get research project documents unprocessable entity response a status code equal to that given +func (o *GetResearchProjectDocumentsUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the get research project documents unprocessable entity response +func (o *GetResearchProjectDocumentsUnprocessableEntity) Code() int { + return 422 +} + +func (o *GetResearchProjectDocumentsUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /researchprojectdocuments][%d] getResearchProjectDocumentsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetResearchProjectDocumentsUnprocessableEntity) String() string { + return fmt.Sprintf("[GET /researchprojectdocuments][%d] getResearchProjectDocumentsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetResearchProjectDocumentsUnprocessableEntity) GetPayload() *sfgate_models.Error { + return o.Payload +} + +func (o *GetResearchProjectDocumentsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sfgate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetResearchProjectDocumentsInternalServerError creates a GetResearchProjectDocumentsInternalServerError with default headers values +func NewGetResearchProjectDocumentsInternalServerError() *GetResearchProjectDocumentsInternalServerError { + return &GetResearchProjectDocumentsInternalServerError{} +} + +/* +GetResearchProjectDocumentsInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetResearchProjectDocumentsInternalServerError struct { + Payload *sfgate_models.Error +} + +// IsSuccess returns true when this get research project documents internal server error response has a 2xx status code +func (o *GetResearchProjectDocumentsInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get research project documents internal server error response has a 3xx status code +func (o *GetResearchProjectDocumentsInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get research project documents internal server error response has a 4xx status code +func (o *GetResearchProjectDocumentsInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get research project documents internal server error response has a 5xx status code +func (o *GetResearchProjectDocumentsInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get research project documents internal server error response a status code equal to that given +func (o *GetResearchProjectDocumentsInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the get research project documents internal server error response +func (o *GetResearchProjectDocumentsInternalServerError) Code() int { + return 500 +} + +func (o *GetResearchProjectDocumentsInternalServerError) Error() string { + return fmt.Sprintf("[GET /researchprojectdocuments][%d] getResearchProjectDocumentsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetResearchProjectDocumentsInternalServerError) String() string { + return fmt.Sprintf("[GET /researchprojectdocuments][%d] getResearchProjectDocumentsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetResearchProjectDocumentsInternalServerError) GetPayload() *sfgate_models.Error { + return o.Payload +} + +func (o *GetResearchProjectDocumentsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sfgate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/sfgate/sfgate_client/research_projects/post_research_project_documents_parameters.go b/api/sfgate/sfgate_client/research_projects/post_research_project_documents_parameters.go new file mode 100644 index 0000000..16ce90b --- /dev/null +++ b/api/sfgate/sfgate_client/research_projects/post_research_project_documents_parameters.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package research_projects + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_models" +) + +// NewPostResearchProjectDocumentsParams creates a new PostResearchProjectDocumentsParams 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 NewPostResearchProjectDocumentsParams() *PostResearchProjectDocumentsParams { + return &PostResearchProjectDocumentsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPostResearchProjectDocumentsParamsWithTimeout creates a new PostResearchProjectDocumentsParams object +// with the ability to set a timeout on a request. +func NewPostResearchProjectDocumentsParamsWithTimeout(timeout time.Duration) *PostResearchProjectDocumentsParams { + return &PostResearchProjectDocumentsParams{ + timeout: timeout, + } +} + +// NewPostResearchProjectDocumentsParamsWithContext creates a new PostResearchProjectDocumentsParams object +// with the ability to set a context for a request. +func NewPostResearchProjectDocumentsParamsWithContext(ctx context.Context) *PostResearchProjectDocumentsParams { + return &PostResearchProjectDocumentsParams{ + Context: ctx, + } +} + +// NewPostResearchProjectDocumentsParamsWithHTTPClient creates a new PostResearchProjectDocumentsParams object +// with the ability to set a custom HTTPClient for a request. +func NewPostResearchProjectDocumentsParamsWithHTTPClient(client *http.Client) *PostResearchProjectDocumentsParams { + return &PostResearchProjectDocumentsParams{ + HTTPClient: client, + } +} + +/* +PostResearchProjectDocumentsParams contains all the parameters to send to the API endpoint + + for the post research project documents operation. + + Typically these are written to a http.Request. +*/ +type PostResearchProjectDocumentsParams struct { + + /* ResearchProjectDocumentRequest. + + An array of new ResearchProjectDocument records + */ + ResearchProjectDocumentRequest *sfgate_models.ResearchProjectDocumentRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the post research project documents params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostResearchProjectDocumentsParams) WithDefaults() *PostResearchProjectDocumentsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the post research project documents params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostResearchProjectDocumentsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the post research project documents params +func (o *PostResearchProjectDocumentsParams) WithTimeout(timeout time.Duration) *PostResearchProjectDocumentsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post research project documents params +func (o *PostResearchProjectDocumentsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post research project documents params +func (o *PostResearchProjectDocumentsParams) WithContext(ctx context.Context) *PostResearchProjectDocumentsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post research project documents params +func (o *PostResearchProjectDocumentsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post research project documents params +func (o *PostResearchProjectDocumentsParams) WithHTTPClient(client *http.Client) *PostResearchProjectDocumentsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post research project documents params +func (o *PostResearchProjectDocumentsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithResearchProjectDocumentRequest adds the researchProjectDocumentRequest to the post research project documents params +func (o *PostResearchProjectDocumentsParams) WithResearchProjectDocumentRequest(researchProjectDocumentRequest *sfgate_models.ResearchProjectDocumentRequest) *PostResearchProjectDocumentsParams { + o.SetResearchProjectDocumentRequest(researchProjectDocumentRequest) + return o +} + +// SetResearchProjectDocumentRequest adds the researchProjectDocumentRequest to the post research project documents params +func (o *PostResearchProjectDocumentsParams) SetResearchProjectDocumentRequest(researchProjectDocumentRequest *sfgate_models.ResearchProjectDocumentRequest) { + o.ResearchProjectDocumentRequest = researchProjectDocumentRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostResearchProjectDocumentsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.ResearchProjectDocumentRequest != nil { + if err := r.SetBodyParam(o.ResearchProjectDocumentRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sfgate/sfgate_client/research_projects/post_research_project_documents_responses.go b/api/sfgate/sfgate_client/research_projects/post_research_project_documents_responses.go new file mode 100644 index 0000000..da38260 --- /dev/null +++ b/api/sfgate/sfgate_client/research_projects/post_research_project_documents_responses.go @@ -0,0 +1,551 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package research_projects + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_models" +) + +// PostResearchProjectDocumentsReader is a Reader for the PostResearchProjectDocuments structure. +type PostResearchProjectDocumentsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostResearchProjectDocumentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostResearchProjectDocumentsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 201: + result := NewPostResearchProjectDocumentsCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostResearchProjectDocumentsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostResearchProjectDocumentsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostResearchProjectDocumentsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostResearchProjectDocumentsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostResearchProjectDocumentsInternalServerError() + 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()) + } +} + +// NewPostResearchProjectDocumentsOK creates a PostResearchProjectDocumentsOK with default headers values +func NewPostResearchProjectDocumentsOK() *PostResearchProjectDocumentsOK { + return &PostResearchProjectDocumentsOK{} +} + +/* +PostResearchProjectDocumentsOK describes a response with status code 200, with default header values. + +ResearchProjectDocument Response Object +*/ +type PostResearchProjectDocumentsOK struct { + Payload *sfgate_models.ResearchProjectDocumentResponse +} + +// IsSuccess returns true when this post research project documents o k response has a 2xx status code +func (o *PostResearchProjectDocumentsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this post research project documents o k response has a 3xx status code +func (o *PostResearchProjectDocumentsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post research project documents o k response has a 4xx status code +func (o *PostResearchProjectDocumentsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this post research project documents o k response has a 5xx status code +func (o *PostResearchProjectDocumentsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this post research project documents o k response a status code equal to that given +func (o *PostResearchProjectDocumentsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the post research project documents o k response +func (o *PostResearchProjectDocumentsOK) Code() int { + return 200 +} + +func (o *PostResearchProjectDocumentsOK) Error() string { + return fmt.Sprintf("[POST /researchprojectdocuments][%d] postResearchProjectDocumentsOK %+v", 200, o.Payload) +} + +func (o *PostResearchProjectDocumentsOK) String() string { + return fmt.Sprintf("[POST /researchprojectdocuments][%d] postResearchProjectDocumentsOK %+v", 200, o.Payload) +} + +func (o *PostResearchProjectDocumentsOK) GetPayload() *sfgate_models.ResearchProjectDocumentResponse { + return o.Payload +} + +func (o *PostResearchProjectDocumentsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sfgate_models.ResearchProjectDocumentResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostResearchProjectDocumentsCreated creates a PostResearchProjectDocumentsCreated with default headers values +func NewPostResearchProjectDocumentsCreated() *PostResearchProjectDocumentsCreated { + return &PostResearchProjectDocumentsCreated{} +} + +/* +PostResearchProjectDocumentsCreated describes a response with status code 201, with default header values. + +ResearchProjectDocument Response Object +*/ +type PostResearchProjectDocumentsCreated struct { + Payload *sfgate_models.ResearchProjectDocumentResponse +} + +// IsSuccess returns true when this post research project documents created response has a 2xx status code +func (o *PostResearchProjectDocumentsCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this post research project documents created response has a 3xx status code +func (o *PostResearchProjectDocumentsCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post research project documents created response has a 4xx status code +func (o *PostResearchProjectDocumentsCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this post research project documents created response has a 5xx status code +func (o *PostResearchProjectDocumentsCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this post research project documents created response a status code equal to that given +func (o *PostResearchProjectDocumentsCreated) IsCode(code int) bool { + return code == 201 +} + +// Code gets the status code for the post research project documents created response +func (o *PostResearchProjectDocumentsCreated) Code() int { + return 201 +} + +func (o *PostResearchProjectDocumentsCreated) Error() string { + return fmt.Sprintf("[POST /researchprojectdocuments][%d] postResearchProjectDocumentsCreated %+v", 201, o.Payload) +} + +func (o *PostResearchProjectDocumentsCreated) String() string { + return fmt.Sprintf("[POST /researchprojectdocuments][%d] postResearchProjectDocumentsCreated %+v", 201, o.Payload) +} + +func (o *PostResearchProjectDocumentsCreated) GetPayload() *sfgate_models.ResearchProjectDocumentResponse { + return o.Payload +} + +func (o *PostResearchProjectDocumentsCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sfgate_models.ResearchProjectDocumentResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostResearchProjectDocumentsUnauthorized creates a PostResearchProjectDocumentsUnauthorized with default headers values +func NewPostResearchProjectDocumentsUnauthorized() *PostResearchProjectDocumentsUnauthorized { + return &PostResearchProjectDocumentsUnauthorized{} +} + +/* +PostResearchProjectDocumentsUnauthorized describes a response with status code 401, with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostResearchProjectDocumentsUnauthorized struct { + Payload *sfgate_models.Error +} + +// IsSuccess returns true when this post research project documents unauthorized response has a 2xx status code +func (o *PostResearchProjectDocumentsUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this post research project documents unauthorized response has a 3xx status code +func (o *PostResearchProjectDocumentsUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post research project documents unauthorized response has a 4xx status code +func (o *PostResearchProjectDocumentsUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this post research project documents unauthorized response has a 5xx status code +func (o *PostResearchProjectDocumentsUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this post research project documents unauthorized response a status code equal to that given +func (o *PostResearchProjectDocumentsUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the post research project documents unauthorized response +func (o *PostResearchProjectDocumentsUnauthorized) Code() int { + return 401 +} + +func (o *PostResearchProjectDocumentsUnauthorized) Error() string { + return fmt.Sprintf("[POST /researchprojectdocuments][%d] postResearchProjectDocumentsUnauthorized %+v", 401, o.Payload) +} + +func (o *PostResearchProjectDocumentsUnauthorized) String() string { + return fmt.Sprintf("[POST /researchprojectdocuments][%d] postResearchProjectDocumentsUnauthorized %+v", 401, o.Payload) +} + +func (o *PostResearchProjectDocumentsUnauthorized) GetPayload() *sfgate_models.Error { + return o.Payload +} + +func (o *PostResearchProjectDocumentsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sfgate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostResearchProjectDocumentsForbidden creates a PostResearchProjectDocumentsForbidden with default headers values +func NewPostResearchProjectDocumentsForbidden() *PostResearchProjectDocumentsForbidden { + return &PostResearchProjectDocumentsForbidden{} +} + +/* +PostResearchProjectDocumentsForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PostResearchProjectDocumentsForbidden struct { + Payload *sfgate_models.Error +} + +// IsSuccess returns true when this post research project documents forbidden response has a 2xx status code +func (o *PostResearchProjectDocumentsForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this post research project documents forbidden response has a 3xx status code +func (o *PostResearchProjectDocumentsForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post research project documents forbidden response has a 4xx status code +func (o *PostResearchProjectDocumentsForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this post research project documents forbidden response has a 5xx status code +func (o *PostResearchProjectDocumentsForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this post research project documents forbidden response a status code equal to that given +func (o *PostResearchProjectDocumentsForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the post research project documents forbidden response +func (o *PostResearchProjectDocumentsForbidden) Code() int { + return 403 +} + +func (o *PostResearchProjectDocumentsForbidden) Error() string { + return fmt.Sprintf("[POST /researchprojectdocuments][%d] postResearchProjectDocumentsForbidden %+v", 403, o.Payload) +} + +func (o *PostResearchProjectDocumentsForbidden) String() string { + return fmt.Sprintf("[POST /researchprojectdocuments][%d] postResearchProjectDocumentsForbidden %+v", 403, o.Payload) +} + +func (o *PostResearchProjectDocumentsForbidden) GetPayload() *sfgate_models.Error { + return o.Payload +} + +func (o *PostResearchProjectDocumentsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sfgate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostResearchProjectDocumentsNotFound creates a PostResearchProjectDocumentsNotFound with default headers values +func NewPostResearchProjectDocumentsNotFound() *PostResearchProjectDocumentsNotFound { + return &PostResearchProjectDocumentsNotFound{} +} + +/* +PostResearchProjectDocumentsNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PostResearchProjectDocumentsNotFound struct { + Payload *sfgate_models.Error +} + +// IsSuccess returns true when this post research project documents not found response has a 2xx status code +func (o *PostResearchProjectDocumentsNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this post research project documents not found response has a 3xx status code +func (o *PostResearchProjectDocumentsNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post research project documents not found response has a 4xx status code +func (o *PostResearchProjectDocumentsNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this post research project documents not found response has a 5xx status code +func (o *PostResearchProjectDocumentsNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this post research project documents not found response a status code equal to that given +func (o *PostResearchProjectDocumentsNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the post research project documents not found response +func (o *PostResearchProjectDocumentsNotFound) Code() int { + return 404 +} + +func (o *PostResearchProjectDocumentsNotFound) Error() string { + return fmt.Sprintf("[POST /researchprojectdocuments][%d] postResearchProjectDocumentsNotFound %+v", 404, o.Payload) +} + +func (o *PostResearchProjectDocumentsNotFound) String() string { + return fmt.Sprintf("[POST /researchprojectdocuments][%d] postResearchProjectDocumentsNotFound %+v", 404, o.Payload) +} + +func (o *PostResearchProjectDocumentsNotFound) GetPayload() *sfgate_models.Error { + return o.Payload +} + +func (o *PostResearchProjectDocumentsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sfgate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostResearchProjectDocumentsUnprocessableEntity creates a PostResearchProjectDocumentsUnprocessableEntity with default headers values +func NewPostResearchProjectDocumentsUnprocessableEntity() *PostResearchProjectDocumentsUnprocessableEntity { + return &PostResearchProjectDocumentsUnprocessableEntity{} +} + +/* +PostResearchProjectDocumentsUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostResearchProjectDocumentsUnprocessableEntity struct { + Payload *sfgate_models.Error +} + +// IsSuccess returns true when this post research project documents unprocessable entity response has a 2xx status code +func (o *PostResearchProjectDocumentsUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this post research project documents unprocessable entity response has a 3xx status code +func (o *PostResearchProjectDocumentsUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post research project documents unprocessable entity response has a 4xx status code +func (o *PostResearchProjectDocumentsUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this post research project documents unprocessable entity response has a 5xx status code +func (o *PostResearchProjectDocumentsUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this post research project documents unprocessable entity response a status code equal to that given +func (o *PostResearchProjectDocumentsUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the post research project documents unprocessable entity response +func (o *PostResearchProjectDocumentsUnprocessableEntity) Code() int { + return 422 +} + +func (o *PostResearchProjectDocumentsUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /researchprojectdocuments][%d] postResearchProjectDocumentsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostResearchProjectDocumentsUnprocessableEntity) String() string { + return fmt.Sprintf("[POST /researchprojectdocuments][%d] postResearchProjectDocumentsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostResearchProjectDocumentsUnprocessableEntity) GetPayload() *sfgate_models.Error { + return o.Payload +} + +func (o *PostResearchProjectDocumentsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sfgate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostResearchProjectDocumentsInternalServerError creates a PostResearchProjectDocumentsInternalServerError with default headers values +func NewPostResearchProjectDocumentsInternalServerError() *PostResearchProjectDocumentsInternalServerError { + return &PostResearchProjectDocumentsInternalServerError{} +} + +/* +PostResearchProjectDocumentsInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PostResearchProjectDocumentsInternalServerError struct { + Payload *sfgate_models.Error +} + +// IsSuccess returns true when this post research project documents internal server error response has a 2xx status code +func (o *PostResearchProjectDocumentsInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this post research project documents internal server error response has a 3xx status code +func (o *PostResearchProjectDocumentsInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post research project documents internal server error response has a 4xx status code +func (o *PostResearchProjectDocumentsInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this post research project documents internal server error response has a 5xx status code +func (o *PostResearchProjectDocumentsInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this post research project documents internal server error response a status code equal to that given +func (o *PostResearchProjectDocumentsInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the post research project documents internal server error response +func (o *PostResearchProjectDocumentsInternalServerError) Code() int { + return 500 +} + +func (o *PostResearchProjectDocumentsInternalServerError) Error() string { + return fmt.Sprintf("[POST /researchprojectdocuments][%d] postResearchProjectDocumentsInternalServerError %+v", 500, o.Payload) +} + +func (o *PostResearchProjectDocumentsInternalServerError) String() string { + return fmt.Sprintf("[POST /researchprojectdocuments][%d] postResearchProjectDocumentsInternalServerError %+v", 500, o.Payload) +} + +func (o *PostResearchProjectDocumentsInternalServerError) GetPayload() *sfgate_models.Error { + return o.Payload +} + +func (o *PostResearchProjectDocumentsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sfgate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/sfgate/sfgate_client/research_projects/put_research_project_documents_parameters.go b/api/sfgate/sfgate_client/research_projects/put_research_project_documents_parameters.go new file mode 100644 index 0000000..6f0e2f9 --- /dev/null +++ b/api/sfgate/sfgate_client/research_projects/put_research_project_documents_parameters.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package research_projects + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_models" +) + +// NewPutResearchProjectDocumentsParams creates a new PutResearchProjectDocumentsParams 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 NewPutResearchProjectDocumentsParams() *PutResearchProjectDocumentsParams { + return &PutResearchProjectDocumentsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPutResearchProjectDocumentsParamsWithTimeout creates a new PutResearchProjectDocumentsParams object +// with the ability to set a timeout on a request. +func NewPutResearchProjectDocumentsParamsWithTimeout(timeout time.Duration) *PutResearchProjectDocumentsParams { + return &PutResearchProjectDocumentsParams{ + timeout: timeout, + } +} + +// NewPutResearchProjectDocumentsParamsWithContext creates a new PutResearchProjectDocumentsParams object +// with the ability to set a context for a request. +func NewPutResearchProjectDocumentsParamsWithContext(ctx context.Context) *PutResearchProjectDocumentsParams { + return &PutResearchProjectDocumentsParams{ + Context: ctx, + } +} + +// NewPutResearchProjectDocumentsParamsWithHTTPClient creates a new PutResearchProjectDocumentsParams object +// with the ability to set a custom HTTPClient for a request. +func NewPutResearchProjectDocumentsParamsWithHTTPClient(client *http.Client) *PutResearchProjectDocumentsParams { + return &PutResearchProjectDocumentsParams{ + HTTPClient: client, + } +} + +/* +PutResearchProjectDocumentsParams contains all the parameters to send to the API endpoint + + for the put research project documents operation. + + Typically these are written to a http.Request. +*/ +type PutResearchProjectDocumentsParams struct { + + /* ResearchProjectDocumentRequest. + + An array of new ResearchProjectDocument records + */ + ResearchProjectDocumentRequest *sfgate_models.ResearchProjectDocumentRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the put research project documents params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutResearchProjectDocumentsParams) WithDefaults() *PutResearchProjectDocumentsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the put research project documents params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutResearchProjectDocumentsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the put research project documents params +func (o *PutResearchProjectDocumentsParams) WithTimeout(timeout time.Duration) *PutResearchProjectDocumentsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put research project documents params +func (o *PutResearchProjectDocumentsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put research project documents params +func (o *PutResearchProjectDocumentsParams) WithContext(ctx context.Context) *PutResearchProjectDocumentsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put research project documents params +func (o *PutResearchProjectDocumentsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put research project documents params +func (o *PutResearchProjectDocumentsParams) WithHTTPClient(client *http.Client) *PutResearchProjectDocumentsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put research project documents params +func (o *PutResearchProjectDocumentsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithResearchProjectDocumentRequest adds the researchProjectDocumentRequest to the put research project documents params +func (o *PutResearchProjectDocumentsParams) WithResearchProjectDocumentRequest(researchProjectDocumentRequest *sfgate_models.ResearchProjectDocumentRequest) *PutResearchProjectDocumentsParams { + o.SetResearchProjectDocumentRequest(researchProjectDocumentRequest) + return o +} + +// SetResearchProjectDocumentRequest adds the researchProjectDocumentRequest to the put research project documents params +func (o *PutResearchProjectDocumentsParams) SetResearchProjectDocumentRequest(researchProjectDocumentRequest *sfgate_models.ResearchProjectDocumentRequest) { + o.ResearchProjectDocumentRequest = researchProjectDocumentRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutResearchProjectDocumentsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.ResearchProjectDocumentRequest != nil { + if err := r.SetBodyParam(o.ResearchProjectDocumentRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sfgate/sfgate_client/research_projects/put_research_project_documents_responses.go b/api/sfgate/sfgate_client/research_projects/put_research_project_documents_responses.go new file mode 100644 index 0000000..43ff690 --- /dev/null +++ b/api/sfgate/sfgate_client/research_projects/put_research_project_documents_responses.go @@ -0,0 +1,551 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package research_projects + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_models" +) + +// PutResearchProjectDocumentsReader is a Reader for the PutResearchProjectDocuments structure. +type PutResearchProjectDocumentsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutResearchProjectDocumentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutResearchProjectDocumentsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 201: + result := NewPutResearchProjectDocumentsCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutResearchProjectDocumentsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutResearchProjectDocumentsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutResearchProjectDocumentsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPutResearchProjectDocumentsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutResearchProjectDocumentsInternalServerError() + 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()) + } +} + +// NewPutResearchProjectDocumentsOK creates a PutResearchProjectDocumentsOK with default headers values +func NewPutResearchProjectDocumentsOK() *PutResearchProjectDocumentsOK { + return &PutResearchProjectDocumentsOK{} +} + +/* +PutResearchProjectDocumentsOK describes a response with status code 200, with default header values. + +ResearchProjectDocument Response Object +*/ +type PutResearchProjectDocumentsOK struct { + Payload *sfgate_models.ResearchProjectDocumentResponse +} + +// IsSuccess returns true when this put research project documents o k response has a 2xx status code +func (o *PutResearchProjectDocumentsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this put research project documents o k response has a 3xx status code +func (o *PutResearchProjectDocumentsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this put research project documents o k response has a 4xx status code +func (o *PutResearchProjectDocumentsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this put research project documents o k response has a 5xx status code +func (o *PutResearchProjectDocumentsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this put research project documents o k response a status code equal to that given +func (o *PutResearchProjectDocumentsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the put research project documents o k response +func (o *PutResearchProjectDocumentsOK) Code() int { + return 200 +} + +func (o *PutResearchProjectDocumentsOK) Error() string { + return fmt.Sprintf("[PUT /researchprojectdocuments][%d] putResearchProjectDocumentsOK %+v", 200, o.Payload) +} + +func (o *PutResearchProjectDocumentsOK) String() string { + return fmt.Sprintf("[PUT /researchprojectdocuments][%d] putResearchProjectDocumentsOK %+v", 200, o.Payload) +} + +func (o *PutResearchProjectDocumentsOK) GetPayload() *sfgate_models.ResearchProjectDocumentResponse { + return o.Payload +} + +func (o *PutResearchProjectDocumentsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sfgate_models.ResearchProjectDocumentResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutResearchProjectDocumentsCreated creates a PutResearchProjectDocumentsCreated with default headers values +func NewPutResearchProjectDocumentsCreated() *PutResearchProjectDocumentsCreated { + return &PutResearchProjectDocumentsCreated{} +} + +/* +PutResearchProjectDocumentsCreated describes a response with status code 201, with default header values. + +ResearchProjectDocument Response Object +*/ +type PutResearchProjectDocumentsCreated struct { + Payload *sfgate_models.ResearchProjectDocumentResponse +} + +// IsSuccess returns true when this put research project documents created response has a 2xx status code +func (o *PutResearchProjectDocumentsCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this put research project documents created response has a 3xx status code +func (o *PutResearchProjectDocumentsCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this put research project documents created response has a 4xx status code +func (o *PutResearchProjectDocumentsCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this put research project documents created response has a 5xx status code +func (o *PutResearchProjectDocumentsCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this put research project documents created response a status code equal to that given +func (o *PutResearchProjectDocumentsCreated) IsCode(code int) bool { + return code == 201 +} + +// Code gets the status code for the put research project documents created response +func (o *PutResearchProjectDocumentsCreated) Code() int { + return 201 +} + +func (o *PutResearchProjectDocumentsCreated) Error() string { + return fmt.Sprintf("[PUT /researchprojectdocuments][%d] putResearchProjectDocumentsCreated %+v", 201, o.Payload) +} + +func (o *PutResearchProjectDocumentsCreated) String() string { + return fmt.Sprintf("[PUT /researchprojectdocuments][%d] putResearchProjectDocumentsCreated %+v", 201, o.Payload) +} + +func (o *PutResearchProjectDocumentsCreated) GetPayload() *sfgate_models.ResearchProjectDocumentResponse { + return o.Payload +} + +func (o *PutResearchProjectDocumentsCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sfgate_models.ResearchProjectDocumentResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutResearchProjectDocumentsUnauthorized creates a PutResearchProjectDocumentsUnauthorized with default headers values +func NewPutResearchProjectDocumentsUnauthorized() *PutResearchProjectDocumentsUnauthorized { + return &PutResearchProjectDocumentsUnauthorized{} +} + +/* +PutResearchProjectDocumentsUnauthorized describes a response with status code 401, with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PutResearchProjectDocumentsUnauthorized struct { + Payload *sfgate_models.Error +} + +// IsSuccess returns true when this put research project documents unauthorized response has a 2xx status code +func (o *PutResearchProjectDocumentsUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this put research project documents unauthorized response has a 3xx status code +func (o *PutResearchProjectDocumentsUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this put research project documents unauthorized response has a 4xx status code +func (o *PutResearchProjectDocumentsUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this put research project documents unauthorized response has a 5xx status code +func (o *PutResearchProjectDocumentsUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this put research project documents unauthorized response a status code equal to that given +func (o *PutResearchProjectDocumentsUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the put research project documents unauthorized response +func (o *PutResearchProjectDocumentsUnauthorized) Code() int { + return 401 +} + +func (o *PutResearchProjectDocumentsUnauthorized) Error() string { + return fmt.Sprintf("[PUT /researchprojectdocuments][%d] putResearchProjectDocumentsUnauthorized %+v", 401, o.Payload) +} + +func (o *PutResearchProjectDocumentsUnauthorized) String() string { + return fmt.Sprintf("[PUT /researchprojectdocuments][%d] putResearchProjectDocumentsUnauthorized %+v", 401, o.Payload) +} + +func (o *PutResearchProjectDocumentsUnauthorized) GetPayload() *sfgate_models.Error { + return o.Payload +} + +func (o *PutResearchProjectDocumentsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sfgate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutResearchProjectDocumentsForbidden creates a PutResearchProjectDocumentsForbidden with default headers values +func NewPutResearchProjectDocumentsForbidden() *PutResearchProjectDocumentsForbidden { + return &PutResearchProjectDocumentsForbidden{} +} + +/* +PutResearchProjectDocumentsForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PutResearchProjectDocumentsForbidden struct { + Payload *sfgate_models.Error +} + +// IsSuccess returns true when this put research project documents forbidden response has a 2xx status code +func (o *PutResearchProjectDocumentsForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this put research project documents forbidden response has a 3xx status code +func (o *PutResearchProjectDocumentsForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this put research project documents forbidden response has a 4xx status code +func (o *PutResearchProjectDocumentsForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this put research project documents forbidden response has a 5xx status code +func (o *PutResearchProjectDocumentsForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this put research project documents forbidden response a status code equal to that given +func (o *PutResearchProjectDocumentsForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the put research project documents forbidden response +func (o *PutResearchProjectDocumentsForbidden) Code() int { + return 403 +} + +func (o *PutResearchProjectDocumentsForbidden) Error() string { + return fmt.Sprintf("[PUT /researchprojectdocuments][%d] putResearchProjectDocumentsForbidden %+v", 403, o.Payload) +} + +func (o *PutResearchProjectDocumentsForbidden) String() string { + return fmt.Sprintf("[PUT /researchprojectdocuments][%d] putResearchProjectDocumentsForbidden %+v", 403, o.Payload) +} + +func (o *PutResearchProjectDocumentsForbidden) GetPayload() *sfgate_models.Error { + return o.Payload +} + +func (o *PutResearchProjectDocumentsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sfgate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutResearchProjectDocumentsNotFound creates a PutResearchProjectDocumentsNotFound with default headers values +func NewPutResearchProjectDocumentsNotFound() *PutResearchProjectDocumentsNotFound { + return &PutResearchProjectDocumentsNotFound{} +} + +/* +PutResearchProjectDocumentsNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PutResearchProjectDocumentsNotFound struct { + Payload *sfgate_models.Error +} + +// IsSuccess returns true when this put research project documents not found response has a 2xx status code +func (o *PutResearchProjectDocumentsNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this put research project documents not found response has a 3xx status code +func (o *PutResearchProjectDocumentsNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this put research project documents not found response has a 4xx status code +func (o *PutResearchProjectDocumentsNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this put research project documents not found response has a 5xx status code +func (o *PutResearchProjectDocumentsNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this put research project documents not found response a status code equal to that given +func (o *PutResearchProjectDocumentsNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the put research project documents not found response +func (o *PutResearchProjectDocumentsNotFound) Code() int { + return 404 +} + +func (o *PutResearchProjectDocumentsNotFound) Error() string { + return fmt.Sprintf("[PUT /researchprojectdocuments][%d] putResearchProjectDocumentsNotFound %+v", 404, o.Payload) +} + +func (o *PutResearchProjectDocumentsNotFound) String() string { + return fmt.Sprintf("[PUT /researchprojectdocuments][%d] putResearchProjectDocumentsNotFound %+v", 404, o.Payload) +} + +func (o *PutResearchProjectDocumentsNotFound) GetPayload() *sfgate_models.Error { + return o.Payload +} + +func (o *PutResearchProjectDocumentsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sfgate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutResearchProjectDocumentsUnprocessableEntity creates a PutResearchProjectDocumentsUnprocessableEntity with default headers values +func NewPutResearchProjectDocumentsUnprocessableEntity() *PutResearchProjectDocumentsUnprocessableEntity { + return &PutResearchProjectDocumentsUnprocessableEntity{} +} + +/* +PutResearchProjectDocumentsUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PutResearchProjectDocumentsUnprocessableEntity struct { + Payload *sfgate_models.Error +} + +// IsSuccess returns true when this put research project documents unprocessable entity response has a 2xx status code +func (o *PutResearchProjectDocumentsUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this put research project documents unprocessable entity response has a 3xx status code +func (o *PutResearchProjectDocumentsUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this put research project documents unprocessable entity response has a 4xx status code +func (o *PutResearchProjectDocumentsUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this put research project documents unprocessable entity response has a 5xx status code +func (o *PutResearchProjectDocumentsUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this put research project documents unprocessable entity response a status code equal to that given +func (o *PutResearchProjectDocumentsUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the put research project documents unprocessable entity response +func (o *PutResearchProjectDocumentsUnprocessableEntity) Code() int { + return 422 +} + +func (o *PutResearchProjectDocumentsUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /researchprojectdocuments][%d] putResearchProjectDocumentsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PutResearchProjectDocumentsUnprocessableEntity) String() string { + return fmt.Sprintf("[PUT /researchprojectdocuments][%d] putResearchProjectDocumentsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PutResearchProjectDocumentsUnprocessableEntity) GetPayload() *sfgate_models.Error { + return o.Payload +} + +func (o *PutResearchProjectDocumentsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sfgate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutResearchProjectDocumentsInternalServerError creates a PutResearchProjectDocumentsInternalServerError with default headers values +func NewPutResearchProjectDocumentsInternalServerError() *PutResearchProjectDocumentsInternalServerError { + return &PutResearchProjectDocumentsInternalServerError{} +} + +/* +PutResearchProjectDocumentsInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PutResearchProjectDocumentsInternalServerError struct { + Payload *sfgate_models.Error +} + +// IsSuccess returns true when this put research project documents internal server error response has a 2xx status code +func (o *PutResearchProjectDocumentsInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this put research project documents internal server error response has a 3xx status code +func (o *PutResearchProjectDocumentsInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this put research project documents internal server error response has a 4xx status code +func (o *PutResearchProjectDocumentsInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this put research project documents internal server error response has a 5xx status code +func (o *PutResearchProjectDocumentsInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this put research project documents internal server error response a status code equal to that given +func (o *PutResearchProjectDocumentsInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the put research project documents internal server error response +func (o *PutResearchProjectDocumentsInternalServerError) Code() int { + return 500 +} + +func (o *PutResearchProjectDocumentsInternalServerError) Error() string { + return fmt.Sprintf("[PUT /researchprojectdocuments][%d] putResearchProjectDocumentsInternalServerError %+v", 500, o.Payload) +} + +func (o *PutResearchProjectDocumentsInternalServerError) String() string { + return fmt.Sprintf("[PUT /researchprojectdocuments][%d] putResearchProjectDocumentsInternalServerError %+v", 500, o.Payload) +} + +func (o *PutResearchProjectDocumentsInternalServerError) GetPayload() *sfgate_models.Error { + return o.Payload +} + +func (o *PutResearchProjectDocumentsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sfgate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/sfgate/sfgate_client/research_projects/research_projects_client.go b/api/sfgate/sfgate_client/research_projects/research_projects_client.go index 7cef72e..3219ea6 100644 --- a/api/sfgate/sfgate_client/research_projects/research_projects_client.go +++ b/api/sfgate/sfgate_client/research_projects/research_projects_client.go @@ -36,6 +36,8 @@ type ClientOption func(*runtime.ClientOperation) type ClientService interface { GetResearchProjectCompanies(params *GetResearchProjectCompaniesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetResearchProjectCompaniesOK, error) + GetResearchProjectDocuments(params *GetResearchProjectDocumentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetResearchProjectDocumentsOK, error) + GetResearchProjectProducts(params *GetResearchProjectProductsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetResearchProjectProductsOK, error) GetResearchProjectServices(params *GetResearchProjectServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetResearchProjectServicesOK, error) @@ -46,6 +48,8 @@ type ClientService interface { PostResearchProjectCompanies(params *PostResearchProjectCompaniesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostResearchProjectCompaniesOK, error) + PostResearchProjectDocuments(params *PostResearchProjectDocumentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostResearchProjectDocumentsOK, *PostResearchProjectDocumentsCreated, error) + PostResearchProjectProducts(params *PostResearchProjectProductsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostResearchProjectProductsOK, error) PostResearchProjectServices(params *PostResearchProjectServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostResearchProjectServicesOK, *PostResearchProjectServicesCreated, error) @@ -56,6 +60,8 @@ type ClientService interface { PutResearchProjectCompanies(params *PutResearchProjectCompaniesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutResearchProjectCompaniesOK, error) + PutResearchProjectDocuments(params *PutResearchProjectDocumentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutResearchProjectDocumentsOK, *PutResearchProjectDocumentsCreated, error) + PutResearchProjectProducts(params *PutResearchProjectProductsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutResearchProjectProductsOK, error) PutResearchProjectTopics(params *PutResearchProjectTopicsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutResearchProjectTopicsOK, error) @@ -106,6 +112,47 @@ func (a *Client) GetResearchProjectCompanies(params *GetResearchProjectCompanies panic(msg) } +/* +GetResearchProjectDocuments gets a list of research project documents + +Return a list of ResearchProjectDocument records from the datastore +*/ +func (a *Client) GetResearchProjectDocuments(params *GetResearchProjectDocumentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetResearchProjectDocumentsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetResearchProjectDocumentsParams() + } + op := &runtime.ClientOperation{ + ID: "getResearchProjectDocuments", + Method: "GET", + PathPattern: "/researchprojectdocuments", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetResearchProjectDocumentsReader{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.(*GetResearchProjectDocumentsOK) + 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 getResearchProjectDocuments: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* GetResearchProjectProducts gets a list of research project products @@ -311,6 +358,48 @@ func (a *Client) PostResearchProjectCompanies(params *PostResearchProjectCompani panic(msg) } +/* +PostResearchProjectDocuments creates new research project documents + +Create ResearchProjectDocuments in the system +*/ +func (a *Client) PostResearchProjectDocuments(params *PostResearchProjectDocumentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostResearchProjectDocumentsOK, *PostResearchProjectDocumentsCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostResearchProjectDocumentsParams() + } + op := &runtime.ClientOperation{ + ID: "postResearchProjectDocuments", + Method: "POST", + PathPattern: "/researchprojectdocuments", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostResearchProjectDocumentsReader{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, nil, err + } + switch value := result.(type) { + case *PostResearchProjectDocumentsOK: + return value, nil, nil + case *PostResearchProjectDocumentsCreated: + return nil, value, nil + } + // 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 research_projects: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* PostResearchProjectProducts creates new research project products @@ -517,6 +606,48 @@ func (a *Client) PutResearchProjectCompanies(params *PutResearchProjectCompanies panic(msg) } +/* +PutResearchProjectDocuments updates research project documents + +Update ResearchProjectDocument in the system +*/ +func (a *Client) PutResearchProjectDocuments(params *PutResearchProjectDocumentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutResearchProjectDocumentsOK, *PutResearchProjectDocumentsCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutResearchProjectDocumentsParams() + } + op := &runtime.ClientOperation{ + ID: "putResearchProjectDocuments", + Method: "PUT", + PathPattern: "/researchprojectdocuments", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutResearchProjectDocumentsReader{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, nil, err + } + switch value := result.(type) { + case *PutResearchProjectDocumentsOK: + return value, nil, nil + case *PutResearchProjectDocumentsCreated: + return nil, value, nil + } + // 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 research_projects: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* PutResearchProjectProducts updates research project products diff --git a/api/sfgate/sfgate_client/sfgate_client.go b/api/sfgate/sfgate_client/sfgate_client.go index 27dfadf..a02dad7 100644 --- a/api/sfgate/sfgate_client/sfgate_client.go +++ b/api/sfgate/sfgate_client/sfgate_client.go @@ -23,6 +23,7 @@ import ( "code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_client/contracts" "code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_client/courses" "code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_client/databases" + "code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_client/documents" "code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_client/events" "code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_client/factors" "code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_client/favorites" @@ -92,6 +93,7 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *Sfgate { cli.Contracts = contracts.New(transport, formats) cli.Courses = courses.New(transport, formats) cli.Databases = databases.New(transport, formats) + cli.Documents = documents.New(transport, formats) cli.Events = events.New(transport, formats) cli.Factors = factors.New(transport, formats) cli.Favorites = favorites.New(transport, formats) @@ -170,6 +172,8 @@ type Sfgate struct { Databases databases.ClientService + Documents documents.ClientService + Events events.ClientService Factors factors.ClientService @@ -217,6 +221,7 @@ func (c *Sfgate) SetTransport(transport runtime.ClientTransport) { c.Contracts.SetTransport(transport) c.Courses.SetTransport(transport) c.Databases.SetTransport(transport) + c.Documents.SetTransport(transport) c.Events.SetTransport(transport) c.Factors.SetTransport(transport) c.Favorites.SetTransport(transport) diff --git a/api/sfgate/sfgate_models/document.go b/api/sfgate/sfgate_models/document.go new file mode 100644 index 0000000..81f1066 --- /dev/null +++ b/api/sfgate/sfgate_models/document.go @@ -0,0 +1,117 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sfgate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Document A document ingested into SalesforceDevops.net +// +// swagger:model document +type Document struct { + + // Who can access this document? + AccessControlList *string `json:"AccessControlList,omitempty"` + + // The author of the document + Author *string `json:"Author,omitempty"` + + // Created By + CreatedByID *string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate *string `json:"CreatedDate,omitempty"` + + // The date of the document + DocumentDate *string `json:"DocumentDate,omitempty"` + + // The ID of the folder in which this document is stored + FolderID *string `json:"FolderID,omitempty"` + + // Record Id + ID string `json:"ID,omitempty"` + + // Alt text for the image + ImageAltText *string `json:"ImageAltText,omitempty"` + + // Cover image for this document + ImageURL *string `json:"ImageURL,omitempty"` + + // The language of the document + Language *string `json:"Language,omitempty"` + + // Last Modified By + LastModifiedByID *string `json:"LastModifiedByID,omitempty"` + + // Last Modifed Date + LastModifiedDate *string `json:"LastModifiedDate,omitempty"` + + // Logo for this document + Logo *string `json:"Logo,omitempty"` + + // The ID of the object who owns this document + ObjectID *string `json:"ObjectID,omitempty"` + + // The type of object who owns this document + ObjectType *string `json:"ObjectType,omitempty"` + + // Where did the document come from? + Source *string `json:"Source,omitempty"` + + // Ingestion status of this document + Status *string `json:"Status,omitempty"` + + // tenant ID + TenantID *string `json:"TenantID,omitempty"` + + // Document Title + Title *string `json:"Title,omitempty"` + + // Source URL for document ingestion + URL *string `json:"URL,omitempty"` + + // The ID of the user who owns this document + UserID *string `json:"UserID,omitempty"` + + // Version of the document + Version *string `json:"Version,omitempty"` +} + +// Validate validates this document +func (m *Document) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this document based on context it is used +func (m *Document) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Document) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Document) UnmarshalBinary(b []byte) error { + var res Document + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sfgate/sfgate_models/document_request.go b/api/sfgate/sfgate_models/document_request.go new file mode 100644 index 0000000..5146b5d --- /dev/null +++ b/api/sfgate/sfgate_models/document_request.go @@ -0,0 +1,166 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sfgate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DocumentRequest An array of Document objects +// +// swagger:model DocumentRequest +type DocumentRequest struct { + + // data + Data []*Document `json:"data"` + + // meta + Meta *RequestMeta `json:"meta,omitempty"` +} + +// Validate validates this document request +func (m *DocumentRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DocumentRequest) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.IsZero(m.Data[i]) { // not required + continue + } + + if m.Data[i] != nil { + if err := m.Data[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DocumentRequest) validateMeta(formats strfmt.Registry) error { + if swag.IsZero(m.Meta) { // not required + return nil + } + + if m.Meta != nil { + if err := m.Meta.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("meta") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this document request based on the context it is used +func (m *DocumentRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DocumentRequest) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DocumentRequest) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("meta") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("meta") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DocumentRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DocumentRequest) UnmarshalBinary(b []byte) error { + var res DocumentRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sfgate/sfgate_models/document_response.go b/api/sfgate/sfgate_models/document_response.go new file mode 100644 index 0000000..eadede3 --- /dev/null +++ b/api/sfgate/sfgate_models/document_response.go @@ -0,0 +1,166 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sfgate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DocumentResponse An array of Document objects +// +// swagger:model DocumentResponse +type DocumentResponse struct { + + // data + Data []*Document `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this document response +func (m *DocumentResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DocumentResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.IsZero(m.Data[i]) { // not required + continue + } + + if m.Data[i] != nil { + if err := m.Data[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DocumentResponse) validateMeta(formats strfmt.Registry) error { + if swag.IsZero(m.Meta) { // not required + return nil + } + + if m.Meta != nil { + if err := m.Meta.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("meta") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this document response based on the context it is used +func (m *DocumentResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DocumentResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DocumentResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("meta") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("meta") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DocumentResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DocumentResponse) UnmarshalBinary(b []byte) error { + var res DocumentResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sfgate/sfgate_models/research_project_document_request.go b/api/sfgate/sfgate_models/research_project_document_request.go new file mode 100644 index 0000000..bd533c7 --- /dev/null +++ b/api/sfgate/sfgate_models/research_project_document_request.go @@ -0,0 +1,120 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sfgate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ResearchProjectDocumentRequest An array of ResearchProjectDocument objects +// +// swagger:model ResearchProjectDocumentRequest +type ResearchProjectDocumentRequest struct { + + // data + Data []*ResearchProjectDocument `json:"Data"` +} + +// Validate validates this research project document request +func (m *ResearchProjectDocumentRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ResearchProjectDocumentRequest) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.IsZero(m.Data[i]) { // not required + continue + } + + if m.Data[i] != nil { + if err := m.Data[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this research project document request based on the context it is used +func (m *ResearchProjectDocumentRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ResearchProjectDocumentRequest) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ResearchProjectDocumentRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ResearchProjectDocumentRequest) UnmarshalBinary(b []byte) error { + var res ResearchProjectDocumentRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sfgate/sfgate_models/research_project_document_response.go b/api/sfgate/sfgate_models/research_project_document_response.go new file mode 100644 index 0000000..11dc7df --- /dev/null +++ b/api/sfgate/sfgate_models/research_project_document_response.go @@ -0,0 +1,166 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sfgate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ResearchProjectDocumentResponse An array of ResearchProjectDocument objects +// +// swagger:model ResearchProjectDocumentResponse +type ResearchProjectDocumentResponse struct { + + // data + Data []*ResearchProjectDocument `json:"Data"` + + // meta + Meta *ResearchProjectCompanyResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this research project document response +func (m *ResearchProjectDocumentResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ResearchProjectDocumentResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.IsZero(m.Data[i]) { // not required + continue + } + + if m.Data[i] != nil { + if err := m.Data[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ResearchProjectDocumentResponse) validateMeta(formats strfmt.Registry) error { + if swag.IsZero(m.Meta) { // not required + return nil + } + + if m.Meta != nil { + if err := m.Meta.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Meta") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this research project document response based on the context it is used +func (m *ResearchProjectDocumentResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ResearchProjectDocumentResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ResearchProjectDocumentResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Meta") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ResearchProjectDocumentResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ResearchProjectDocumentResponse) UnmarshalBinary(b []byte) error { + var res ResearchProjectDocumentResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/swagger/external/research-vernonkeenan.yaml b/swagger/external/research-vernonkeenan.yaml index ef8999e..d7f0476 100644 --- a/swagger/external/research-vernonkeenan.yaml +++ b/swagger/external/research-vernonkeenan.yaml @@ -398,7 +398,7 @@ paths: - CompanyServices post: description: Create a new CompanyService record - operationId: createCompanyService + operationId: postCompanyServices parameters: - $ref: "#/parameters/companyServiceRequest" responses: diff --git a/swagger/external/sf-gate-vernonkeenan.yaml b/swagger/external/sf-gate-vernonkeenan.yaml index 5568877..6b99d54 100644 --- a/swagger/external/sf-gate-vernonkeenan.yaml +++ b/swagger/external/sf-gate-vernonkeenan.yaml @@ -172,6 +172,13 @@ parameters: required: true schema: $ref: "#/definitions/ContactRequest" + documentRequest: + description: An array of new Document records + in: body + name: documentRequest + required: true + schema: + $ref: "#/definitions/DocumentRequest" contractIdQuery: description: Contact record ID in: query @@ -323,6 +330,13 @@ parameters: required: true schema: $ref: "#/definitions/ResearchProjectCompanyRequest" + ResearchProjectDocumentRequest: + description: An array of new ResearchProjectDocument records + in: body + name: researchProjectDocumentRequest + required: true + schema: + $ref: "#/definitions/ResearchProjectDocumentRequest" researchProjectProductRequest: description: An array of new ResearchProjectProduct records in: body @@ -438,6 +452,10 @@ responses: description: Response with Database objects schema: $ref: "#/definitions/DatabaseResponse" + DocumentResponse: + description: Response with Document objects + schema: + $ref: "#/definitions/DocumentResponse" DeleteResponse: description: Response with Message Objects with Delete Status schema: @@ -494,6 +512,10 @@ responses: description: ResearchProjectCompany Response Object schema: $ref: "#/definitions/ResearchProjectCompanyResponse" + ResearchProjectDocumentResponse: + description: ResearchProjectDocument Response Object + schema: + $ref: "#/definitions/ResearchProjectDocumentResponse" ResearchProjectProductResponse: description: ResearchProjectProduct Response Object schema: @@ -1273,6 +1295,78 @@ paths: summary: Update Databases tags: - Databases + /documents: + get: + description: Return a list of Document records from the datastore + operationId: getDocuments + parameters: + - $ref: "#/parameters/idQuery" + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + responses: + "200": + $ref: "#/responses/DocumentResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Get a list Documents + tags: + - Documents + post: + description: Create Documents in Salesforce + operationId: postDocuments + parameters: + - $ref: "#/parameters/documentRequest" + responses: + "201": + $ref: "#/responses/SalesforcePostResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Create new Documents + tags: + - Documents + put: + description: Update Document in Salesforce + operationId: putDocuments + parameters: + - $ref: "#/parameters/documentRequest" + responses: + "200": + $ref: "#/responses/DocumentResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Update Documents + tags: + - Documents /eventcategories: get: security: @@ -1892,6 +1986,82 @@ paths: $ref: "#/responses/Unauthorized" "403": $ref: "#/responses/AccessForbidden" + /researchprojectdocuments: + get: + description: Return a list of ResearchProjectDocument records from the datastore + operationId: getResearchProjectDocuments + parameters: + - $ref: "#/parameters/idQuery" + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + responses: + "200": + $ref: "#/responses/ResearchProjectDocumentResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Get a list of ResearchProjectDocuments + tags: + - ResearchProjects + post: + description: Create ResearchProjectDocuments in the system + operationId: postResearchProjectDocuments + parameters: + - $ref: "#/parameters/ResearchProjectDocumentRequest" + responses: + "200": + $ref: "#/responses/ResearchProjectDocumentResponse" + "201": + $ref: "#/responses/ResearchProjectDocumentResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Create new ResearchProjectDocuments + tags: + - ResearchProjects + put: + description: Update ResearchProjectDocument in the system + operationId: putResearchProjectDocuments + parameters: + - $ref: "#/parameters/ResearchProjectDocumentRequest" + responses: + "200": + $ref: "#/responses/ResearchProjectDocumentResponse" + "201": + $ref: "#/responses/ResearchProjectDocumentResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Update ResearchProjectDocuments + tags: + - ResearchProjects /researchprojectproducts: get: description: Return a list of ResearchProjectProduct records from the datastore @@ -3514,6 +3684,26 @@ definitions: type: string x-nullable: true type: object + DocumentRequest: + description: An array of Document objects + properties: + data: + items: + $ref: "../../lib/swagger/defs/document.yaml#/Document" + type: array + meta: + $ref: "#/definitions/RequestMeta" + type: object + DocumentResponse: + description: An array of Document objects + properties: + data: + items: + $ref: "../../lib/swagger/defs/document.yaml#/Document" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object DatabaseRequest: description: An array of Database objects properties: @@ -4857,6 +5047,24 @@ definitions: $ref: "../../lib/swagger/defs/research-project.yaml#/ResearchProject" type: array type: object + ResearchProjectDocumentRequest: + description: An array of ResearchProjectDocument objects + properties: + Data: + items: + $ref: "../../lib/swagger/defs/research-project-document.yaml#/ResearchProjectDocument" + type: array + type: object + ResearchProjectDocumentResponse: + description: An array of ResearchProjectDocument objects + properties: + Meta: + $ref: "../../lib/swagger/defs/response-meta.yaml#/ResponseMeta" + Data: + items: + $ref: "../../lib/swagger/defs/research-project-document.yaml#/ResearchProjectDocument" + type: array + type: object ResearchProjectProductRequest: description: An array of ResearchProjectProduct objects properties: diff --git a/swagger/research-vernonkeenan.yaml b/swagger/research-vernonkeenan.yaml index b69e03a..626b3ed 100644 --- a/swagger/research-vernonkeenan.yaml +++ b/swagger/research-vernonkeenan.yaml @@ -398,7 +398,7 @@ paths: - CompanyServices post: description: Create a new CompanyService record - operationId: createCompanyService + operationId: postCompanyServices parameters: - $ref: "#/parameters/companyServiceRequest" responses: diff --git a/swagger/sf-gate-vernonkeenan.yaml b/swagger/sf-gate-vernonkeenan.yaml index 0c6c5ce..12c5e66 100644 --- a/swagger/sf-gate-vernonkeenan.yaml +++ b/swagger/sf-gate-vernonkeenan.yaml @@ -172,6 +172,13 @@ parameters: required: true schema: $ref: "#/definitions/ContactRequest" + documentRequest: + description: An array of new Document records + in: body + name: documentRequest + required: true + schema: + $ref: "#/definitions/DocumentRequest" contractIdQuery: description: Contact record ID in: query @@ -323,6 +330,13 @@ parameters: required: true schema: $ref: "#/definitions/ResearchProjectCompanyRequest" + ResearchProjectDocumentRequest: + description: An array of new ResearchProjectDocument records + in: body + name: researchProjectDocumentRequest + required: true + schema: + $ref: "#/definitions/ResearchProjectDocumentRequest" researchProjectProductRequest: description: An array of new ResearchProjectProduct records in: body @@ -438,6 +452,10 @@ responses: description: Response with Database objects schema: $ref: "#/definitions/DatabaseResponse" + DocumentResponse: + description: Response with Document objects + schema: + $ref: "#/definitions/DocumentResponse" DeleteResponse: description: Response with Message Objects with Delete Status schema: @@ -494,6 +512,10 @@ responses: description: ResearchProjectCompany Response Object schema: $ref: "#/definitions/ResearchProjectCompanyResponse" + ResearchProjectDocumentResponse: + description: ResearchProjectDocument Response Object + schema: + $ref: "#/definitions/ResearchProjectDocumentResponse" ResearchProjectProductResponse: description: ResearchProjectProduct Response Object schema: @@ -1273,6 +1295,78 @@ paths: summary: Update Databases tags: - Databases + /documents: + get: + description: Return a list of Document records from the datastore + operationId: getDocuments + parameters: + - $ref: "#/parameters/idQuery" + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + responses: + "200": + $ref: "#/responses/DocumentResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Get a list Documents + tags: + - Documents + post: + description: Create Documents in Salesforce + operationId: postDocuments + parameters: + - $ref: "#/parameters/documentRequest" + responses: + "201": + $ref: "#/responses/SalesforcePostResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Create new Documents + tags: + - Documents + put: + description: Update Document in Salesforce + operationId: putDocuments + parameters: + - $ref: "#/parameters/documentRequest" + responses: + "200": + $ref: "#/responses/DocumentResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Update Documents + tags: + - Documents /eventcategories: get: security: @@ -1892,6 +1986,82 @@ paths: $ref: "#/responses/Unauthorized" "403": $ref: "#/responses/AccessForbidden" + /researchprojectdocuments: + get: + description: Return a list of ResearchProjectDocument records from the datastore + operationId: getResearchProjectDocuments + parameters: + - $ref: "#/parameters/idQuery" + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + responses: + "200": + $ref: "#/responses/ResearchProjectDocumentResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Get a list of ResearchProjectDocuments + tags: + - ResearchProjects + post: + description: Create ResearchProjectDocuments in the system + operationId: postResearchProjectDocuments + parameters: + - $ref: "#/parameters/ResearchProjectDocumentRequest" + responses: + "200": + $ref: "#/responses/ResearchProjectDocumentResponse" + "201": + $ref: "#/responses/ResearchProjectDocumentResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Create new ResearchProjectDocuments + tags: + - ResearchProjects + put: + description: Update ResearchProjectDocument in the system + operationId: putResearchProjectDocuments + parameters: + - $ref: "#/parameters/ResearchProjectDocumentRequest" + responses: + "200": + $ref: "#/responses/ResearchProjectDocumentResponse" + "201": + $ref: "#/responses/ResearchProjectDocumentResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Update ResearchProjectDocuments + tags: + - ResearchProjects /researchprojectproducts: get: description: Return a list of ResearchProjectProduct records from the datastore @@ -3514,6 +3684,26 @@ definitions: type: string x-nullable: true type: object + DocumentRequest: + description: An array of Document objects + properties: + data: + items: + $ref: "../../lib/swagger/defs/document.yaml#/Document" + type: array + meta: + $ref: "#/definitions/RequestMeta" + type: object + DocumentResponse: + description: An array of Document objects + properties: + data: + items: + $ref: "../../lib/swagger/defs/document.yaml#/Document" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object DatabaseRequest: description: An array of Database objects properties: @@ -4857,6 +5047,24 @@ definitions: $ref: "../../lib/swagger/defs/research-project.yaml#/ResearchProject" type: array type: object + ResearchProjectDocumentRequest: + description: An array of ResearchProjectDocument objects + properties: + Data: + items: + $ref: "../../lib/swagger/defs/research-project-document.yaml#/ResearchProjectDocument" + type: array + type: object + ResearchProjectDocumentResponse: + description: An array of ResearchProjectDocument objects + properties: + Meta: + $ref: "../../lib/swagger/defs/response-meta.yaml#/ResponseMeta" + Data: + items: + $ref: "../../lib/swagger/defs/research-project-document.yaml#/ResearchProjectDocument" + type: array + type: object ResearchProjectProductRequest: description: An array of ResearchProjectProduct objects properties: