diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e430b2..97bdf8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,11 @@ or PR number is invented. - Added the compound-auth Members client surface for Estate Administrator, Owner, and Manager tenant-membership administration, including manageable- tenant discovery, optimistic updates, and soft revocation (ADR-KV-021). +- Regenerated the Research Go client and synchronized Research Swagger copies + for governed Industry read/create/update plus tenant-attributed + IndustryCompany, IndustryProduct, and IndustryService read/create operations. + Contract tests pin the generated HTTP methods and paths and prevent an + unsupported `IndustryService.HTML` field from entering the shared model. ## [v0.7.5] — 2026-07-12 diff --git a/api/research/research_client/company_product_proposals/company_product_proposals_client.go b/api/research/research_client/company_product_proposals/company_product_proposals_client.go new file mode 100644 index 0000000..ba0b2d5 --- /dev/null +++ b/api/research/research_client/company_product_proposals/company_product_proposals_client.go @@ -0,0 +1,442 @@ +// 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_product_proposals + +import ( + "context" + "fmt" + "time" + + "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// New creates a new company product proposals API client. +func New(transport runtime.ContextualTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +// New creates a new company product proposals API client with basic auth credentials. +// +// It takes the following parameters: +// - host: http host (github.com). +// - basePath: any base path for the API client ("/v1", "/v3"). +// - scheme: http scheme ("http", "https"). +// - user: user for basic authentication header. +// - password: password for basic authentication header. +func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { + transport := httptransport.New(host, basePath, []string{scheme}) + transport.DefaultAuthentication = httptransport.BasicAuth(user, password) + return &Client{transport: transport, formats: strfmt.Default} +} + +// New creates a new company product proposals API client with a bearer token for authentication. +// +// It takes the following parameters: +// - host: http host (github.com). +// - basePath: any base path for the API client ("/v1", "/v3"). +// - scheme: http scheme ("http", "https"). +// - bearerToken: bearer token for Bearer authentication header. +func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { + transport := httptransport.New(host, basePath, []string{scheme}) + transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) + return &Client{transport: transport, formats: strfmt.Default} +} + +// Client for company product proposals API. +type Client struct { + transport runtime.ContextualTransport + formats strfmt.Registry +} + +// ClientOption may be used to customize the behavior of Client methods. +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods. +type ClientService interface { + + // GetCompanyProductProposal get a company product proposal. + GetCompanyProductProposal(params *GetCompanyProductProposalParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCompanyProductProposalOK, error) + + // GetCompanyProductProposalContext get a company product proposal. + GetCompanyProductProposalContext(ctx context.Context, params *GetCompanyProductProposalParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCompanyProductProposalOK, error) + + // GetCompanyProductProposals list company product proposals. + GetCompanyProductProposals(params *GetCompanyProductProposalsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCompanyProductProposalsOK, error) + + // GetCompanyProductProposalsContext list company product proposals. + GetCompanyProductProposalsContext(ctx context.Context, params *GetCompanyProductProposalsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCompanyProductProposalsOK, error) + + // PostCompanyProductProposal create a company product draft proposal. + PostCompanyProductProposal(params *PostCompanyProductProposalParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostCompanyProductProposalCreated, error) + + // PostCompanyProductProposalContext create a company product draft proposal. + PostCompanyProductProposalContext(ctx context.Context, params *PostCompanyProductProposalParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostCompanyProductProposalCreated, error) + + // ReviewCompanyProductProposal review a company product proposal. + ReviewCompanyProductProposal(params *ReviewCompanyProductProposalParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ReviewCompanyProductProposalOK, error) + + // ReviewCompanyProductProposalContext review a company product proposal. + ReviewCompanyProductProposalContext(ctx context.Context, params *ReviewCompanyProductProposalParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ReviewCompanyProductProposalOK, error) + + // SubmitCompanyProductProposal submit a company product proposal. + SubmitCompanyProductProposal(params *SubmitCompanyProductProposalParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*SubmitCompanyProductProposalOK, error) + + // SubmitCompanyProductProposalContext submit a company product proposal. + SubmitCompanyProductProposalContext(ctx context.Context, params *SubmitCompanyProductProposalParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*SubmitCompanyProductProposalOK, error) + + SetTransport(transport runtime.ContextualTransport) +} + +// GetCompanyProductProposal gets a company product proposal. +// +// Return one visible CompanyProduct proposal. +// +// This method does not support injected context. +// However, timeout and opentracing contexts are honored whenever enabled. +// +// If you need to pass a specific context, use [Client.GetCompanyProductProposalContext] instead. +func (a *Client) GetCompanyProductProposal(params *GetCompanyProductProposalParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCompanyProductProposalOK, error) { + var ctx context.Context + if params.inner.ctx != nil { + ctx = params.inner.ctx + } else { + ctx = context.Background() + } + + return a.GetCompanyProductProposalContext(ctx, params, authInfo, opts...) +} + +// GetCompanyProductProposalContext gets a company product proposal. +// +// Return one visible CompanyProduct proposal. +// +// Do not use the deprecated [GetCompanyProductProposalParams.Context] with this method: it would be ignored. +func (a *Client) GetCompanyProductProposalContext(ctx context.Context, params *GetCompanyProductProposalParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCompanyProductProposalOK, error) { + // NOTE: parameters are not validated before sending + if params == nil { + params = NewGetCompanyProductProposalParams() + } + + op := &runtime.ClientOperation{ + ID: "getCompanyProductProposal", + Method: "GET", + PathPattern: "/companyproductproposals/{companyProductProposalId}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetCompanyProductProposalReader{formats: a.formats}, + AuthInfo: authInfo, + Client: params.HTTPClient, + } + + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.SubmitContext(ctx, op) + if err != nil { + return nil, err + } + + // only one success response has to be checked + success, ok := result.(*GetCompanyProductProposalOK) + if ok { + return success, nil + } + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getCompanyProductProposal: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// GetCompanyProductProposals lists company product proposals. +// +// Return actor-owned proposals or the submitted tenant review queue. +// +// This method does not support injected context. +// However, timeout and opentracing contexts are honored whenever enabled. +// +// If you need to pass a specific context, use [Client.GetCompanyProductProposalsContext] instead. +func (a *Client) GetCompanyProductProposals(params *GetCompanyProductProposalsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCompanyProductProposalsOK, error) { + var ctx context.Context + if params.inner.ctx != nil { + ctx = params.inner.ctx + } else { + ctx = context.Background() + } + + return a.GetCompanyProductProposalsContext(ctx, params, authInfo, opts...) +} + +// GetCompanyProductProposalsContext lists company product proposals. +// +// Return actor-owned proposals or the submitted tenant review queue. +// +// Do not use the deprecated [GetCompanyProductProposalsParams.Context] with this method: it would be ignored. +func (a *Client) GetCompanyProductProposalsContext(ctx context.Context, params *GetCompanyProductProposalsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCompanyProductProposalsOK, error) { + // NOTE: parameters are not validated before sending + if params == nil { + params = NewGetCompanyProductProposalsParams() + } + + op := &runtime.ClientOperation{ + ID: "getCompanyProductProposals", + Method: "GET", + PathPattern: "/companyproductproposals", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetCompanyProductProposalsReader{formats: a.formats}, + AuthInfo: authInfo, + Client: params.HTTPClient, + } + + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.SubmitContext(ctx, op) + if err != nil { + return nil, err + } + + // only one success response has to be checked + success, ok := result.(*GetCompanyProductProposalsOK) + if ok { + return success, nil + } + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getCompanyProductProposals: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// PostCompanyProductProposal creates a company product draft proposal. +// +// Create a draft proposal without changing the authoritative CompanyProduct. +// +// This method does not support injected context. +// However, timeout and opentracing contexts are honored whenever enabled. +// +// If you need to pass a specific context, use [Client.PostCompanyProductProposalContext] instead. +func (a *Client) PostCompanyProductProposal(params *PostCompanyProductProposalParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostCompanyProductProposalCreated, error) { + var ctx context.Context + if params.inner.ctx != nil { + ctx = params.inner.ctx + } else { + ctx = context.Background() + } + + return a.PostCompanyProductProposalContext(ctx, params, authInfo, opts...) +} + +// PostCompanyProductProposalContext creates a company product draft proposal. +// +// Create a draft proposal without changing the authoritative CompanyProduct. +// +// Do not use the deprecated [PostCompanyProductProposalParams.Context] with this method: it would be ignored. +func (a *Client) PostCompanyProductProposalContext(ctx context.Context, params *PostCompanyProductProposalParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostCompanyProductProposalCreated, error) { + // NOTE: parameters are not validated before sending + if params == nil { + params = NewPostCompanyProductProposalParams() + } + + op := &runtime.ClientOperation{ + ID: "postCompanyProductProposal", + Method: "POST", + PathPattern: "/companyproductproposals", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostCompanyProductProposalReader{formats: a.formats}, + AuthInfo: authInfo, + Client: params.HTTPClient, + } + + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.SubmitContext(ctx, op) + if err != nil { + return nil, err + } + + // only one success response has to be checked + success, ok := result.(*PostCompanyProductProposalCreated) + if ok { + return success, nil + } + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for postCompanyProductProposal: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// ReviewCompanyProductProposal reviews a company product proposal. +// +// Decide every field on a submitted proposal without changing the authoritative CompanyProduct. +// +// This method does not support injected context. +// However, timeout and opentracing contexts are honored whenever enabled. +// +// If you need to pass a specific context, use [Client.ReviewCompanyProductProposalContext] instead. +func (a *Client) ReviewCompanyProductProposal(params *ReviewCompanyProductProposalParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ReviewCompanyProductProposalOK, error) { + var ctx context.Context + if params.inner.ctx != nil { + ctx = params.inner.ctx + } else { + ctx = context.Background() + } + + return a.ReviewCompanyProductProposalContext(ctx, params, authInfo, opts...) +} + +// ReviewCompanyProductProposalContext reviews a company product proposal. +// +// Decide every field on a submitted proposal without changing the authoritative CompanyProduct. +// +// Do not use the deprecated [ReviewCompanyProductProposalParams.Context] with this method: it would be ignored. +func (a *Client) ReviewCompanyProductProposalContext(ctx context.Context, params *ReviewCompanyProductProposalParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ReviewCompanyProductProposalOK, error) { + // NOTE: parameters are not validated before sending + if params == nil { + params = NewReviewCompanyProductProposalParams() + } + + op := &runtime.ClientOperation{ + ID: "reviewCompanyProductProposal", + Method: "POST", + PathPattern: "/companyproductproposals/{companyProductProposalId}/review", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ReviewCompanyProductProposalReader{formats: a.formats}, + AuthInfo: authInfo, + Client: params.HTTPClient, + } + + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.SubmitContext(ctx, op) + if err != nil { + return nil, err + } + + // only one success response has to be checked + success, ok := result.(*ReviewCompanyProductProposalOK) + if ok { + return success, nil + } + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for reviewCompanyProductProposal: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SubmitCompanyProductProposal submits a company product proposal. +// +// Submit an actor-owned draft without changing the authoritative CompanyProduct. +// +// This method does not support injected context. +// However, timeout and opentracing contexts are honored whenever enabled. +// +// If you need to pass a specific context, use [Client.SubmitCompanyProductProposalContext] instead. +func (a *Client) SubmitCompanyProductProposal(params *SubmitCompanyProductProposalParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*SubmitCompanyProductProposalOK, error) { + var ctx context.Context + if params.inner.ctx != nil { + ctx = params.inner.ctx + } else { + ctx = context.Background() + } + + return a.SubmitCompanyProductProposalContext(ctx, params, authInfo, opts...) +} + +// SubmitCompanyProductProposalContext submits a company product proposal. +// +// Submit an actor-owned draft without changing the authoritative CompanyProduct. +// +// Do not use the deprecated [SubmitCompanyProductProposalParams.Context] with this method: it would be ignored. +func (a *Client) SubmitCompanyProductProposalContext(ctx context.Context, params *SubmitCompanyProductProposalParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*SubmitCompanyProductProposalOK, error) { + // NOTE: parameters are not validated before sending + if params == nil { + params = NewSubmitCompanyProductProposalParams() + } + + op := &runtime.ClientOperation{ + ID: "submitCompanyProductProposal", + Method: "POST", + PathPattern: "/companyproductproposals/{companyProductProposalId}/submit", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SubmitCompanyProductProposalReader{formats: a.formats}, + AuthInfo: authInfo, + Client: params.HTTPClient, + } + + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.SubmitContext(ctx, op) + if err != nil { + return nil, err + } + + // only one success response has to be checked + success, ok := result.(*SubmitCompanyProductProposalOK) + if ok { + return success, nil + } + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for submitCompanyProductProposal: 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.ContextualTransport) { + a.transport = transport +} + +// innerParams captures internal fields so they don't conflict with user-supplied parameters. +type innerParams struct { + timeout time.Duration + + // Deprecated: use the operation call with context to pass the context instead of [CompanyProductProposalsParams]. + ctx context.Context +} diff --git a/api/research/research_client/company_product_proposals/get_company_product_proposal_parameters.go b/api/research/research_client/company_product_proposals/get_company_product_proposal_parameters.go new file mode 100644 index 0000000..8e014ba --- /dev/null +++ b/api/research/research_client/company_product_proposals/get_company_product_proposal_parameters.go @@ -0,0 +1,160 @@ +// 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_product_proposals + +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" +) + +// NewGetCompanyProductProposalParams creates a new GetCompanyProductProposalParams 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 NewGetCompanyProductProposalParams() *GetCompanyProductProposalParams { + return NewGetCompanyProductProposalParamsWithTimeout(cr.DefaultTimeout) +} + +// NewGetCompanyProductProposalParamsWithTimeout creates a new GetCompanyProductProposalParams object +// with the ability to set a timeout on a request. +func NewGetCompanyProductProposalParamsWithTimeout(timeout time.Duration) *GetCompanyProductProposalParams { + return &GetCompanyProductProposalParams{ + inner: innerParams{ + timeout: timeout, + }, + } +} + +// NewGetCompanyProductProposalParamsWithContext creates a new GetCompanyProductProposalParams object +// with the ability to set a context for a request. +// +// Deprecated: use the operation call with context to pass the context instead of [GetCompanyProductProposalParams]. +func NewGetCompanyProductProposalParamsWithContext(ctx context.Context) *GetCompanyProductProposalParams { + return &GetCompanyProductProposalParams{ + inner: innerParams{ + ctx: ctx, + }, + } +} + +// NewGetCompanyProductProposalParamsWithHTTPClient creates a new GetCompanyProductProposalParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetCompanyProductProposalParamsWithHTTPClient(client *http.Client) *GetCompanyProductProposalParams { + return &GetCompanyProductProposalParams{ + HTTPClient: client, + } +} + +/* +GetCompanyProductProposalParams contains all the parameters to send to the API endpoint + + for the get company product proposal operation. + + Typically these are written to a http.Request. +*/ +type GetCompanyProductProposalParams struct { + + // CompanyProductProposalID. + // + // CompanyProduct proposal record ID + // + // Format: uuid + CompanyProductProposalID strfmt.UUID + + HTTPClient *http.Client + + inner innerParams +} + +// WithDefaults hydrates default values in the get company product proposal params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetCompanyProductProposalParams) WithDefaults() *GetCompanyProductProposalParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get company product proposal params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetCompanyProductProposalParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get company product proposal params. +func (o *GetCompanyProductProposalParams) WithTimeout(timeout time.Duration) *GetCompanyProductProposalParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get company product proposal params. +func (o *GetCompanyProductProposalParams) SetTimeout(timeout time.Duration) { + o.inner.timeout = timeout +} + +// WithContext adds the context to the get company product proposal params. +// +// Deprecated: use the operation call with context to pass the context instead of [GetCompanyProductProposalParams]. +func (o *GetCompanyProductProposalParams) WithContext(ctx context.Context) *GetCompanyProductProposalParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get company product proposal params. +// +// Deprecated: use the operation call with context to pass the context instead of [GetCompanyProductProposalParams]. +func (o *GetCompanyProductProposalParams) SetContext(ctx context.Context) { + o.inner.ctx = ctx +} + +// WithHTTPClient adds the HTTPClient to the get company product proposal params. +func (o *GetCompanyProductProposalParams) WithHTTPClient(client *http.Client) *GetCompanyProductProposalParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get company product proposal params. +func (o *GetCompanyProductProposalParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCompanyProductProposalID adds the companyProductProposalID to the get company product proposal params. +func (o *GetCompanyProductProposalParams) WithCompanyProductProposalID(companyProductProposalID strfmt.UUID) *GetCompanyProductProposalParams { + o.SetCompanyProductProposalID(companyProductProposalID) + return o +} + +// SetCompanyProductProposalID adds the companyProductProposalId to the get company product proposal params. +func (o *GetCompanyProductProposalParams) SetCompanyProductProposalID(companyProductProposalID strfmt.UUID) { + o.CompanyProductProposalID = companyProductProposalID +} + +// WriteToRequest writes these params to a [runtime.ClientRequest]. +func (o *GetCompanyProductProposalParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + if err := r.SetTimeout(o.inner.timeout); err != nil { + return err + } + var res []error + + // path param companyProductProposalId + if err := r.SetPathParam("companyProductProposalId", o.CompanyProductProposalID.String()); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/research/research_client/company_product_proposals/get_company_product_proposal_responses.go b/api/research/research_client/company_product_proposals/get_company_product_proposal_responses.go new file mode 100644 index 0000000..67ca2e9 --- /dev/null +++ b/api/research/research_client/company_product_proposals/get_company_product_proposal_responses.go @@ -0,0 +1,437 @@ +// 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_product_proposals + +import ( + "encoding/json" + stderrors "errors" + "fmt" + "io" + + "code.tnxs.net/vernonkeenan/lib/api/research/research_models" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetCompanyProductProposalReader is a Reader for the GetCompanyProductProposal structure. +type GetCompanyProductProposalReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetCompanyProductProposalReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { + switch response.Code() { + case 200: + result := NewGetCompanyProductProposalOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetCompanyProductProposalUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetCompanyProductProposalForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetCompanyProductProposalNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetCompanyProductProposalInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /companyproductproposals/{companyProductProposalId}] getCompanyProductProposal", response, response.Code()) + } +} + +// NewGetCompanyProductProposalOK creates a GetCompanyProductProposalOK with default headers values +func NewGetCompanyProductProposalOK() *GetCompanyProductProposalOK { + return &GetCompanyProductProposalOK{} +} + +// GetCompanyProductProposalOK describes a response with status code 200, with default header values. +// +// Governed proposal detail +type GetCompanyProductProposalOK struct { + Payload *research_models.CompanyProductProposal +} + +// IsSuccess returns true when this get company product proposal o k response has a 2xx status code +func (o *GetCompanyProductProposalOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get company product proposal o k response has a 3xx status code +func (o *GetCompanyProductProposalOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get company product proposal o k response has a 4xx status code +func (o *GetCompanyProductProposalOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get company product proposal o k response has a 5xx status code +func (o *GetCompanyProductProposalOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get company product proposal o k response a status code equal to that given +func (o *GetCompanyProductProposalOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get company product proposal o k response +func (o *GetCompanyProductProposalOK) Code() int { + return 200 +} + +func (o *GetCompanyProductProposalOK) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /companyproductproposals/{companyProductProposalId}][%d] getCompanyProductProposalOK %s", 200, payload) +} + +func (o *GetCompanyProductProposalOK) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /companyproductproposals/{companyProductProposalId}][%d] getCompanyProductProposalOK %s", 200, payload) +} + +func (o *GetCompanyProductProposalOK) GetPayload() *research_models.CompanyProductProposal { + return o.Payload +} + +func (o *GetCompanyProductProposalOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(research_models.CompanyProductProposal) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewGetCompanyProductProposalUnauthorized creates a GetCompanyProductProposalUnauthorized with default headers values +func NewGetCompanyProductProposalUnauthorized() *GetCompanyProductProposalUnauthorized { + return &GetCompanyProductProposalUnauthorized{} +} + +// GetCompanyProductProposalUnauthorized describes a response with status code 401, with default header values. +// +// Access unauthorized, invalid API-KEY was used +type GetCompanyProductProposalUnauthorized struct { + AccessControlAllowOrigin string + + Payload *research_models.Error +} + +// IsSuccess returns true when this get company product proposal unauthorized response has a 2xx status code +func (o *GetCompanyProductProposalUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get company product proposal unauthorized response has a 3xx status code +func (o *GetCompanyProductProposalUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get company product proposal unauthorized response has a 4xx status code +func (o *GetCompanyProductProposalUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this get company product proposal unauthorized response has a 5xx status code +func (o *GetCompanyProductProposalUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this get company product proposal unauthorized response a status code equal to that given +func (o *GetCompanyProductProposalUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the get company product proposal unauthorized response +func (o *GetCompanyProductProposalUnauthorized) Code() int { + return 401 +} + +func (o *GetCompanyProductProposalUnauthorized) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /companyproductproposals/{companyProductProposalId}][%d] getCompanyProductProposalUnauthorized %s", 401, payload) +} + +func (o *GetCompanyProductProposalUnauthorized) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /companyproductproposals/{companyProductProposalId}][%d] getCompanyProductProposalUnauthorized %s", 401, payload) +} + +func (o *GetCompanyProductProposalUnauthorized) GetPayload() *research_models.Error { + return o.Payload +} + +func (o *GetCompanyProductProposalUnauthorized) 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 && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewGetCompanyProductProposalForbidden creates a GetCompanyProductProposalForbidden with default headers values +func NewGetCompanyProductProposalForbidden() *GetCompanyProductProposalForbidden { + return &GetCompanyProductProposalForbidden{} +} + +// GetCompanyProductProposalForbidden describes a response with status code 403, with default header values. +// +// Access forbidden, account lacks access +type GetCompanyProductProposalForbidden struct { + AccessControlAllowOrigin string + + Payload *research_models.Error +} + +// IsSuccess returns true when this get company product proposal forbidden response has a 2xx status code +func (o *GetCompanyProductProposalForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get company product proposal forbidden response has a 3xx status code +func (o *GetCompanyProductProposalForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get company product proposal forbidden response has a 4xx status code +func (o *GetCompanyProductProposalForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this get company product proposal forbidden response has a 5xx status code +func (o *GetCompanyProductProposalForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this get company product proposal forbidden response a status code equal to that given +func (o *GetCompanyProductProposalForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the get company product proposal forbidden response +func (o *GetCompanyProductProposalForbidden) Code() int { + return 403 +} + +func (o *GetCompanyProductProposalForbidden) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /companyproductproposals/{companyProductProposalId}][%d] getCompanyProductProposalForbidden %s", 403, payload) +} + +func (o *GetCompanyProductProposalForbidden) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /companyproductproposals/{companyProductProposalId}][%d] getCompanyProductProposalForbidden %s", 403, payload) +} + +func (o *GetCompanyProductProposalForbidden) GetPayload() *research_models.Error { + return o.Payload +} + +func (o *GetCompanyProductProposalForbidden) 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 && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewGetCompanyProductProposalNotFound creates a GetCompanyProductProposalNotFound with default headers values +func NewGetCompanyProductProposalNotFound() *GetCompanyProductProposalNotFound { + return &GetCompanyProductProposalNotFound{} +} + +// GetCompanyProductProposalNotFound describes a response with status code 404, with default header values. +// +// Resource was not found +type GetCompanyProductProposalNotFound struct { + AccessControlAllowOrigin string + + Payload *research_models.Error +} + +// IsSuccess returns true when this get company product proposal not found response has a 2xx status code +func (o *GetCompanyProductProposalNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get company product proposal not found response has a 3xx status code +func (o *GetCompanyProductProposalNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get company product proposal not found response has a 4xx status code +func (o *GetCompanyProductProposalNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get company product proposal not found response has a 5xx status code +func (o *GetCompanyProductProposalNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get company product proposal not found response a status code equal to that given +func (o *GetCompanyProductProposalNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get company product proposal not found response +func (o *GetCompanyProductProposalNotFound) Code() int { + return 404 +} + +func (o *GetCompanyProductProposalNotFound) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /companyproductproposals/{companyProductProposalId}][%d] getCompanyProductProposalNotFound %s", 404, payload) +} + +func (o *GetCompanyProductProposalNotFound) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /companyproductproposals/{companyProductProposalId}][%d] getCompanyProductProposalNotFound %s", 404, payload) +} + +func (o *GetCompanyProductProposalNotFound) GetPayload() *research_models.Error { + return o.Payload +} + +func (o *GetCompanyProductProposalNotFound) 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 && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewGetCompanyProductProposalInternalServerError creates a GetCompanyProductProposalInternalServerError with default headers values +func NewGetCompanyProductProposalInternalServerError() *GetCompanyProductProposalInternalServerError { + return &GetCompanyProductProposalInternalServerError{} +} + +// GetCompanyProductProposalInternalServerError describes a response with status code 500, with default header values. +// +// Server Internal Error +type GetCompanyProductProposalInternalServerError struct { + AccessControlAllowOrigin string + + Payload *research_models.Error +} + +// IsSuccess returns true when this get company product proposal internal server error response has a 2xx status code +func (o *GetCompanyProductProposalInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get company product proposal internal server error response has a 3xx status code +func (o *GetCompanyProductProposalInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get company product proposal internal server error response has a 4xx status code +func (o *GetCompanyProductProposalInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get company product proposal internal server error response has a 5xx status code +func (o *GetCompanyProductProposalInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get company product proposal internal server error response a status code equal to that given +func (o *GetCompanyProductProposalInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the get company product proposal internal server error response +func (o *GetCompanyProductProposalInternalServerError) Code() int { + return 500 +} + +func (o *GetCompanyProductProposalInternalServerError) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /companyproductproposals/{companyProductProposalId}][%d] getCompanyProductProposalInternalServerError %s", 500, payload) +} + +func (o *GetCompanyProductProposalInternalServerError) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /companyproductproposals/{companyProductProposalId}][%d] getCompanyProductProposalInternalServerError %s", 500, payload) +} + +func (o *GetCompanyProductProposalInternalServerError) GetPayload() *research_models.Error { + return o.Payload +} + +func (o *GetCompanyProductProposalInternalServerError) 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 && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} diff --git a/api/research/research_client/company_product_proposals/get_company_product_proposals_parameters.go b/api/research/research_client/company_product_proposals/get_company_product_proposals_parameters.go new file mode 100644 index 0000000..0aa9484 --- /dev/null +++ b/api/research/research_client/company_product_proposals/get_company_product_proposals_parameters.go @@ -0,0 +1,267 @@ +// 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_product_proposals + +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/conv" +) + +// NewGetCompanyProductProposalsParams creates a new GetCompanyProductProposalsParams 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 NewGetCompanyProductProposalsParams() *GetCompanyProductProposalsParams { + return NewGetCompanyProductProposalsParamsWithTimeout(cr.DefaultTimeout) +} + +// NewGetCompanyProductProposalsParamsWithTimeout creates a new GetCompanyProductProposalsParams object +// with the ability to set a timeout on a request. +func NewGetCompanyProductProposalsParamsWithTimeout(timeout time.Duration) *GetCompanyProductProposalsParams { + return &GetCompanyProductProposalsParams{ + inner: innerParams{ + timeout: timeout, + }, + } +} + +// NewGetCompanyProductProposalsParamsWithContext creates a new GetCompanyProductProposalsParams object +// with the ability to set a context for a request. +// +// Deprecated: use the operation call with context to pass the context instead of [GetCompanyProductProposalsParams]. +func NewGetCompanyProductProposalsParamsWithContext(ctx context.Context) *GetCompanyProductProposalsParams { + return &GetCompanyProductProposalsParams{ + inner: innerParams{ + ctx: ctx, + }, + } +} + +// NewGetCompanyProductProposalsParamsWithHTTPClient creates a new GetCompanyProductProposalsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetCompanyProductProposalsParamsWithHTTPClient(client *http.Client) *GetCompanyProductProposalsParams { + return &GetCompanyProductProposalsParams{ + HTTPClient: client, + } +} + +/* +GetCompanyProductProposalsParams contains all the parameters to send to the API endpoint + + for the get company product proposals operation. + + Typically these are written to a http.Request. +*/ +type GetCompanyProductProposalsParams struct { + + // CompanyProductID. + // + // CompanyProduct record ID + CompanyProductID *string + + // Limit. + // + // How many objects to return at one time + // + // Format: int64 + Limit *int64 + + // Offset. + // + // How many objects to skip? + // + // Format: int64 + Offset *int64 + + // View. + // + // Actor-owned proposals or the tenant review queue + View string + + HTTPClient *http.Client + + inner innerParams +} + +// WithDefaults hydrates default values in the get company product proposals params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetCompanyProductProposalsParams) WithDefaults() *GetCompanyProductProposalsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get company product proposals params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetCompanyProductProposalsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get company product proposals params. +func (o *GetCompanyProductProposalsParams) WithTimeout(timeout time.Duration) *GetCompanyProductProposalsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get company product proposals params. +func (o *GetCompanyProductProposalsParams) SetTimeout(timeout time.Duration) { + o.inner.timeout = timeout +} + +// WithContext adds the context to the get company product proposals params. +// +// Deprecated: use the operation call with context to pass the context instead of [GetCompanyProductProposalsParams]. +func (o *GetCompanyProductProposalsParams) WithContext(ctx context.Context) *GetCompanyProductProposalsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get company product proposals params. +// +// Deprecated: use the operation call with context to pass the context instead of [GetCompanyProductProposalsParams]. +func (o *GetCompanyProductProposalsParams) SetContext(ctx context.Context) { + o.inner.ctx = ctx +} + +// WithHTTPClient adds the HTTPClient to the get company product proposals params. +func (o *GetCompanyProductProposalsParams) WithHTTPClient(client *http.Client) *GetCompanyProductProposalsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get company product proposals params. +func (o *GetCompanyProductProposalsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCompanyProductID adds the companyProductID to the get company product proposals params. +func (o *GetCompanyProductProposalsParams) WithCompanyProductID(companyProductID *string) *GetCompanyProductProposalsParams { + o.SetCompanyProductID(companyProductID) + return o +} + +// SetCompanyProductID adds the companyProductId to the get company product proposals params. +func (o *GetCompanyProductProposalsParams) SetCompanyProductID(companyProductID *string) { + o.CompanyProductID = companyProductID +} + +// WithLimit adds the limit to the get company product proposals params. +func (o *GetCompanyProductProposalsParams) WithLimit(limit *int64) *GetCompanyProductProposalsParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get company product proposals params. +func (o *GetCompanyProductProposalsParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get company product proposals params. +func (o *GetCompanyProductProposalsParams) WithOffset(offset *int64) *GetCompanyProductProposalsParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get company product proposals params. +func (o *GetCompanyProductProposalsParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithView adds the view to the get company product proposals params. +func (o *GetCompanyProductProposalsParams) WithView(view string) *GetCompanyProductProposalsParams { + o.SetView(view) + return o +} + +// SetView adds the view to the get company product proposals params. +func (o *GetCompanyProductProposalsParams) SetView(view string) { + o.View = view +} + +// WriteToRequest writes these params to a [runtime.ClientRequest]. +func (o *GetCompanyProductProposalsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + if err := r.SetTimeout(o.inner.timeout); err != nil { + return err + } + var res []error + + if o.CompanyProductID != nil { + + // query param companyProductId + var qrCompanyProductID string + + if o.CompanyProductID != nil { + qrCompanyProductID = *o.CompanyProductID + } + qCompanyProductID := qrCompanyProductID + if qCompanyProductID != "" { + + if err := r.SetQueryParam("companyProductId", qCompanyProductID); err != nil { + return err + } + } + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := conv.FormatInteger(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 := conv.FormatInteger(qrOffset) + if qOffset != "" { + + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + } + + // query param view + qrView := o.View + qView := qrView + if qView != "" { + + if err := r.SetQueryParam("view", qView); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/research/research_client/company_product_proposals/get_company_product_proposals_responses.go b/api/research/research_client/company_product_proposals/get_company_product_proposals_responses.go new file mode 100644 index 0000000..cf7f9b3 --- /dev/null +++ b/api/research/research_client/company_product_proposals/get_company_product_proposals_responses.go @@ -0,0 +1,437 @@ +// 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_product_proposals + +import ( + "encoding/json" + stderrors "errors" + "fmt" + "io" + + "code.tnxs.net/vernonkeenan/lib/api/research/research_models" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetCompanyProductProposalsReader is a Reader for the GetCompanyProductProposals structure. +type GetCompanyProductProposalsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetCompanyProductProposalsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { + switch response.Code() { + case 200: + result := NewGetCompanyProductProposalsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetCompanyProductProposalsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetCompanyProductProposalsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetCompanyProductProposalsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetCompanyProductProposalsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /companyproductproposals] getCompanyProductProposals", response, response.Code()) + } +} + +// NewGetCompanyProductProposalsOK creates a GetCompanyProductProposalsOK with default headers values +func NewGetCompanyProductProposalsOK() *GetCompanyProductProposalsOK { + return &GetCompanyProductProposalsOK{} +} + +// GetCompanyProductProposalsOK describes a response with status code 200, with default header values. +// +// Governed proposal collection +type GetCompanyProductProposalsOK struct { + Payload *research_models.CompanyProductProposalResponse +} + +// IsSuccess returns true when this get company product proposals o k response has a 2xx status code +func (o *GetCompanyProductProposalsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get company product proposals o k response has a 3xx status code +func (o *GetCompanyProductProposalsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get company product proposals o k response has a 4xx status code +func (o *GetCompanyProductProposalsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get company product proposals o k response has a 5xx status code +func (o *GetCompanyProductProposalsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get company product proposals o k response a status code equal to that given +func (o *GetCompanyProductProposalsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get company product proposals o k response +func (o *GetCompanyProductProposalsOK) Code() int { + return 200 +} + +func (o *GetCompanyProductProposalsOK) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /companyproductproposals][%d] getCompanyProductProposalsOK %s", 200, payload) +} + +func (o *GetCompanyProductProposalsOK) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /companyproductproposals][%d] getCompanyProductProposalsOK %s", 200, payload) +} + +func (o *GetCompanyProductProposalsOK) GetPayload() *research_models.CompanyProductProposalResponse { + return o.Payload +} + +func (o *GetCompanyProductProposalsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(research_models.CompanyProductProposalResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewGetCompanyProductProposalsUnauthorized creates a GetCompanyProductProposalsUnauthorized with default headers values +func NewGetCompanyProductProposalsUnauthorized() *GetCompanyProductProposalsUnauthorized { + return &GetCompanyProductProposalsUnauthorized{} +} + +// GetCompanyProductProposalsUnauthorized describes a response with status code 401, with default header values. +// +// Access unauthorized, invalid API-KEY was used +type GetCompanyProductProposalsUnauthorized struct { + AccessControlAllowOrigin string + + Payload *research_models.Error +} + +// IsSuccess returns true when this get company product proposals unauthorized response has a 2xx status code +func (o *GetCompanyProductProposalsUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get company product proposals unauthorized response has a 3xx status code +func (o *GetCompanyProductProposalsUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get company product proposals unauthorized response has a 4xx status code +func (o *GetCompanyProductProposalsUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this get company product proposals unauthorized response has a 5xx status code +func (o *GetCompanyProductProposalsUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this get company product proposals unauthorized response a status code equal to that given +func (o *GetCompanyProductProposalsUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the get company product proposals unauthorized response +func (o *GetCompanyProductProposalsUnauthorized) Code() int { + return 401 +} + +func (o *GetCompanyProductProposalsUnauthorized) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /companyproductproposals][%d] getCompanyProductProposalsUnauthorized %s", 401, payload) +} + +func (o *GetCompanyProductProposalsUnauthorized) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /companyproductproposals][%d] getCompanyProductProposalsUnauthorized %s", 401, payload) +} + +func (o *GetCompanyProductProposalsUnauthorized) GetPayload() *research_models.Error { + return o.Payload +} + +func (o *GetCompanyProductProposalsUnauthorized) 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 && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewGetCompanyProductProposalsForbidden creates a GetCompanyProductProposalsForbidden with default headers values +func NewGetCompanyProductProposalsForbidden() *GetCompanyProductProposalsForbidden { + return &GetCompanyProductProposalsForbidden{} +} + +// GetCompanyProductProposalsForbidden describes a response with status code 403, with default header values. +// +// Access forbidden, account lacks access +type GetCompanyProductProposalsForbidden struct { + AccessControlAllowOrigin string + + Payload *research_models.Error +} + +// IsSuccess returns true when this get company product proposals forbidden response has a 2xx status code +func (o *GetCompanyProductProposalsForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get company product proposals forbidden response has a 3xx status code +func (o *GetCompanyProductProposalsForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get company product proposals forbidden response has a 4xx status code +func (o *GetCompanyProductProposalsForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this get company product proposals forbidden response has a 5xx status code +func (o *GetCompanyProductProposalsForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this get company product proposals forbidden response a status code equal to that given +func (o *GetCompanyProductProposalsForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the get company product proposals forbidden response +func (o *GetCompanyProductProposalsForbidden) Code() int { + return 403 +} + +func (o *GetCompanyProductProposalsForbidden) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /companyproductproposals][%d] getCompanyProductProposalsForbidden %s", 403, payload) +} + +func (o *GetCompanyProductProposalsForbidden) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /companyproductproposals][%d] getCompanyProductProposalsForbidden %s", 403, payload) +} + +func (o *GetCompanyProductProposalsForbidden) GetPayload() *research_models.Error { + return o.Payload +} + +func (o *GetCompanyProductProposalsForbidden) 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 && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewGetCompanyProductProposalsUnprocessableEntity creates a GetCompanyProductProposalsUnprocessableEntity with default headers values +func NewGetCompanyProductProposalsUnprocessableEntity() *GetCompanyProductProposalsUnprocessableEntity { + return &GetCompanyProductProposalsUnprocessableEntity{} +} + +// GetCompanyProductProposalsUnprocessableEntity describes a response with status code 422, with default header values. +// +// Unprocessable Entity, likely a bad parameter +type GetCompanyProductProposalsUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *research_models.Error +} + +// IsSuccess returns true when this get company product proposals unprocessable entity response has a 2xx status code +func (o *GetCompanyProductProposalsUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get company product proposals unprocessable entity response has a 3xx status code +func (o *GetCompanyProductProposalsUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get company product proposals unprocessable entity response has a 4xx status code +func (o *GetCompanyProductProposalsUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this get company product proposals unprocessable entity response has a 5xx status code +func (o *GetCompanyProductProposalsUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this get company product proposals unprocessable entity response a status code equal to that given +func (o *GetCompanyProductProposalsUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the get company product proposals unprocessable entity response +func (o *GetCompanyProductProposalsUnprocessableEntity) Code() int { + return 422 +} + +func (o *GetCompanyProductProposalsUnprocessableEntity) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /companyproductproposals][%d] getCompanyProductProposalsUnprocessableEntity %s", 422, payload) +} + +func (o *GetCompanyProductProposalsUnprocessableEntity) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /companyproductproposals][%d] getCompanyProductProposalsUnprocessableEntity %s", 422, payload) +} + +func (o *GetCompanyProductProposalsUnprocessableEntity) GetPayload() *research_models.Error { + return o.Payload +} + +func (o *GetCompanyProductProposalsUnprocessableEntity) 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 && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewGetCompanyProductProposalsInternalServerError creates a GetCompanyProductProposalsInternalServerError with default headers values +func NewGetCompanyProductProposalsInternalServerError() *GetCompanyProductProposalsInternalServerError { + return &GetCompanyProductProposalsInternalServerError{} +} + +// GetCompanyProductProposalsInternalServerError describes a response with status code 500, with default header values. +// +// Server Internal Error +type GetCompanyProductProposalsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *research_models.Error +} + +// IsSuccess returns true when this get company product proposals internal server error response has a 2xx status code +func (o *GetCompanyProductProposalsInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get company product proposals internal server error response has a 3xx status code +func (o *GetCompanyProductProposalsInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get company product proposals internal server error response has a 4xx status code +func (o *GetCompanyProductProposalsInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get company product proposals internal server error response has a 5xx status code +func (o *GetCompanyProductProposalsInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get company product proposals internal server error response a status code equal to that given +func (o *GetCompanyProductProposalsInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the get company product proposals internal server error response +func (o *GetCompanyProductProposalsInternalServerError) Code() int { + return 500 +} + +func (o *GetCompanyProductProposalsInternalServerError) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /companyproductproposals][%d] getCompanyProductProposalsInternalServerError %s", 500, payload) +} + +func (o *GetCompanyProductProposalsInternalServerError) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /companyproductproposals][%d] getCompanyProductProposalsInternalServerError %s", 500, payload) +} + +func (o *GetCompanyProductProposalsInternalServerError) GetPayload() *research_models.Error { + return o.Payload +} + +func (o *GetCompanyProductProposalsInternalServerError) 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 && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} diff --git a/api/research/research_client/company_product_proposals/post_company_product_proposal_parameters.go b/api/research/research_client/company_product_proposals/post_company_product_proposal_parameters.go new file mode 100644 index 0000000..7f205c9 --- /dev/null +++ b/api/research/research_client/company_product_proposals/post_company_product_proposal_parameters.go @@ -0,0 +1,159 @@ +// 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_product_proposals + +import ( + "context" + "net/http" + "time" + + "code.tnxs.net/vernonkeenan/lib/api/research/research_models" + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewPostCompanyProductProposalParams creates a new PostCompanyProductProposalParams 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 NewPostCompanyProductProposalParams() *PostCompanyProductProposalParams { + return NewPostCompanyProductProposalParamsWithTimeout(cr.DefaultTimeout) +} + +// NewPostCompanyProductProposalParamsWithTimeout creates a new PostCompanyProductProposalParams object +// with the ability to set a timeout on a request. +func NewPostCompanyProductProposalParamsWithTimeout(timeout time.Duration) *PostCompanyProductProposalParams { + return &PostCompanyProductProposalParams{ + inner: innerParams{ + timeout: timeout, + }, + } +} + +// NewPostCompanyProductProposalParamsWithContext creates a new PostCompanyProductProposalParams object +// with the ability to set a context for a request. +// +// Deprecated: use the operation call with context to pass the context instead of [PostCompanyProductProposalParams]. +func NewPostCompanyProductProposalParamsWithContext(ctx context.Context) *PostCompanyProductProposalParams { + return &PostCompanyProductProposalParams{ + inner: innerParams{ + ctx: ctx, + }, + } +} + +// NewPostCompanyProductProposalParamsWithHTTPClient creates a new PostCompanyProductProposalParams object +// with the ability to set a custom HTTPClient for a request. +func NewPostCompanyProductProposalParamsWithHTTPClient(client *http.Client) *PostCompanyProductProposalParams { + return &PostCompanyProductProposalParams{ + HTTPClient: client, + } +} + +/* +PostCompanyProductProposalParams contains all the parameters to send to the API endpoint + + for the post company product proposal operation. + + Typically these are written to a http.Request. +*/ +type PostCompanyProductProposalParams struct { + + // CompanyProductProposalRequest. + // + // A human-attributed draft proposal for an existing CompanyProduct + CompanyProductProposalRequest *research_models.CompanyProductProposalRequest + + HTTPClient *http.Client + + inner innerParams +} + +// WithDefaults hydrates default values in the post company product proposal params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostCompanyProductProposalParams) WithDefaults() *PostCompanyProductProposalParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the post company product proposal params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostCompanyProductProposalParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the post company product proposal params. +func (o *PostCompanyProductProposalParams) WithTimeout(timeout time.Duration) *PostCompanyProductProposalParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post company product proposal params. +func (o *PostCompanyProductProposalParams) SetTimeout(timeout time.Duration) { + o.inner.timeout = timeout +} + +// WithContext adds the context to the post company product proposal params. +// +// Deprecated: use the operation call with context to pass the context instead of [PostCompanyProductProposalParams]. +func (o *PostCompanyProductProposalParams) WithContext(ctx context.Context) *PostCompanyProductProposalParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post company product proposal params. +// +// Deprecated: use the operation call with context to pass the context instead of [PostCompanyProductProposalParams]. +func (o *PostCompanyProductProposalParams) SetContext(ctx context.Context) { + o.inner.ctx = ctx +} + +// WithHTTPClient adds the HTTPClient to the post company product proposal params. +func (o *PostCompanyProductProposalParams) WithHTTPClient(client *http.Client) *PostCompanyProductProposalParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post company product proposal params. +func (o *PostCompanyProductProposalParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCompanyProductProposalRequest adds the companyProductProposalRequest to the post company product proposal params. +func (o *PostCompanyProductProposalParams) WithCompanyProductProposalRequest(companyProductProposalRequest *research_models.CompanyProductProposalRequest) *PostCompanyProductProposalParams { + o.SetCompanyProductProposalRequest(companyProductProposalRequest) + return o +} + +// SetCompanyProductProposalRequest adds the companyProductProposalRequest to the post company product proposal params. +func (o *PostCompanyProductProposalParams) SetCompanyProductProposalRequest(companyProductProposalRequest *research_models.CompanyProductProposalRequest) { + o.CompanyProductProposalRequest = companyProductProposalRequest +} + +// WriteToRequest writes these params to a [runtime.ClientRequest]. +func (o *PostCompanyProductProposalParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + if err := r.SetTimeout(o.inner.timeout); err != nil { + return err + } + var res []error + if o.CompanyProductProposalRequest != nil { + if err := r.SetBodyParam(o.CompanyProductProposalRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/research/research_client/company_product_proposals/post_company_product_proposal_responses.go b/api/research/research_client/company_product_proposals/post_company_product_proposal_responses.go new file mode 100644 index 0000000..6a6ff93 --- /dev/null +++ b/api/research/research_client/company_product_proposals/post_company_product_proposal_responses.go @@ -0,0 +1,677 @@ +// 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_product_proposals + +import ( + "encoding/json" + stderrors "errors" + "fmt" + "io" + + "code.tnxs.net/vernonkeenan/lib/api/research/research_models" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// PostCompanyProductProposalReader is a Reader for the PostCompanyProductProposal structure. +type PostCompanyProductProposalReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostCompanyProductProposalReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { + switch response.Code() { + case 201: + result := NewPostCompanyProductProposalCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewPostCompanyProductProposalBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewPostCompanyProductProposalUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostCompanyProductProposalForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostCompanyProductProposalNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewPostCompanyProductProposalConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostCompanyProductProposalUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostCompanyProductProposalInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /companyproductproposals] postCompanyProductProposal", response, response.Code()) + } +} + +// NewPostCompanyProductProposalCreated creates a PostCompanyProductProposalCreated with default headers values +func NewPostCompanyProductProposalCreated() *PostCompanyProductProposalCreated { + return &PostCompanyProductProposalCreated{} +} + +// PostCompanyProductProposalCreated describes a response with status code 201, with default header values. +// +// Draft proposal created +type PostCompanyProductProposalCreated struct { + Payload *research_models.CompanyProductProposal +} + +// IsSuccess returns true when this post company product proposal created response has a 2xx status code +func (o *PostCompanyProductProposalCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this post company product proposal created response has a 3xx status code +func (o *PostCompanyProductProposalCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post company product proposal created response has a 4xx status code +func (o *PostCompanyProductProposalCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this post company product proposal created response has a 5xx status code +func (o *PostCompanyProductProposalCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this post company product proposal created response a status code equal to that given +func (o *PostCompanyProductProposalCreated) IsCode(code int) bool { + return code == 201 +} + +// Code gets the status code for the post company product proposal created response +func (o *PostCompanyProductProposalCreated) Code() int { + return 201 +} + +func (o *PostCompanyProductProposalCreated) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /companyproductproposals][%d] postCompanyProductProposalCreated %s", 201, payload) +} + +func (o *PostCompanyProductProposalCreated) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /companyproductproposals][%d] postCompanyProductProposalCreated %s", 201, payload) +} + +func (o *PostCompanyProductProposalCreated) GetPayload() *research_models.CompanyProductProposal { + return o.Payload +} + +func (o *PostCompanyProductProposalCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(research_models.CompanyProductProposal) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewPostCompanyProductProposalBadRequest creates a PostCompanyProductProposalBadRequest with default headers values +func NewPostCompanyProductProposalBadRequest() *PostCompanyProductProposalBadRequest { + return &PostCompanyProductProposalBadRequest{} +} + +// PostCompanyProductProposalBadRequest describes a response with status code 400, with default header values. +// +// Unprocessable Entity, likely a bad parameter +type PostCompanyProductProposalBadRequest struct { + AccessControlAllowOrigin string + + Payload *research_models.Error +} + +// IsSuccess returns true when this post company product proposal bad request response has a 2xx status code +func (o *PostCompanyProductProposalBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this post company product proposal bad request response has a 3xx status code +func (o *PostCompanyProductProposalBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post company product proposal bad request response has a 4xx status code +func (o *PostCompanyProductProposalBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this post company product proposal bad request response has a 5xx status code +func (o *PostCompanyProductProposalBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this post company product proposal bad request response a status code equal to that given +func (o *PostCompanyProductProposalBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the post company product proposal bad request response +func (o *PostCompanyProductProposalBadRequest) Code() int { + return 400 +} + +func (o *PostCompanyProductProposalBadRequest) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /companyproductproposals][%d] postCompanyProductProposalBadRequest %s", 400, payload) +} + +func (o *PostCompanyProductProposalBadRequest) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /companyproductproposals][%d] postCompanyProductProposalBadRequest %s", 400, payload) +} + +func (o *PostCompanyProductProposalBadRequest) GetPayload() *research_models.Error { + return o.Payload +} + +func (o *PostCompanyProductProposalBadRequest) 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 && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewPostCompanyProductProposalUnauthorized creates a PostCompanyProductProposalUnauthorized with default headers values +func NewPostCompanyProductProposalUnauthorized() *PostCompanyProductProposalUnauthorized { + return &PostCompanyProductProposalUnauthorized{} +} + +// PostCompanyProductProposalUnauthorized describes a response with status code 401, with default header values. +// +// Access unauthorized, invalid API-KEY was used +type PostCompanyProductProposalUnauthorized struct { + AccessControlAllowOrigin string + + Payload *research_models.Error +} + +// IsSuccess returns true when this post company product proposal unauthorized response has a 2xx status code +func (o *PostCompanyProductProposalUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this post company product proposal unauthorized response has a 3xx status code +func (o *PostCompanyProductProposalUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post company product proposal unauthorized response has a 4xx status code +func (o *PostCompanyProductProposalUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this post company product proposal unauthorized response has a 5xx status code +func (o *PostCompanyProductProposalUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this post company product proposal unauthorized response a status code equal to that given +func (o *PostCompanyProductProposalUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the post company product proposal unauthorized response +func (o *PostCompanyProductProposalUnauthorized) Code() int { + return 401 +} + +func (o *PostCompanyProductProposalUnauthorized) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /companyproductproposals][%d] postCompanyProductProposalUnauthorized %s", 401, payload) +} + +func (o *PostCompanyProductProposalUnauthorized) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /companyproductproposals][%d] postCompanyProductProposalUnauthorized %s", 401, payload) +} + +func (o *PostCompanyProductProposalUnauthorized) GetPayload() *research_models.Error { + return o.Payload +} + +func (o *PostCompanyProductProposalUnauthorized) 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 && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewPostCompanyProductProposalForbidden creates a PostCompanyProductProposalForbidden with default headers values +func NewPostCompanyProductProposalForbidden() *PostCompanyProductProposalForbidden { + return &PostCompanyProductProposalForbidden{} +} + +// PostCompanyProductProposalForbidden describes a response with status code 403, with default header values. +// +// Access forbidden, account lacks access +type PostCompanyProductProposalForbidden struct { + AccessControlAllowOrigin string + + Payload *research_models.Error +} + +// IsSuccess returns true when this post company product proposal forbidden response has a 2xx status code +func (o *PostCompanyProductProposalForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this post company product proposal forbidden response has a 3xx status code +func (o *PostCompanyProductProposalForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post company product proposal forbidden response has a 4xx status code +func (o *PostCompanyProductProposalForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this post company product proposal forbidden response has a 5xx status code +func (o *PostCompanyProductProposalForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this post company product proposal forbidden response a status code equal to that given +func (o *PostCompanyProductProposalForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the post company product proposal forbidden response +func (o *PostCompanyProductProposalForbidden) Code() int { + return 403 +} + +func (o *PostCompanyProductProposalForbidden) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /companyproductproposals][%d] postCompanyProductProposalForbidden %s", 403, payload) +} + +func (o *PostCompanyProductProposalForbidden) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /companyproductproposals][%d] postCompanyProductProposalForbidden %s", 403, payload) +} + +func (o *PostCompanyProductProposalForbidden) GetPayload() *research_models.Error { + return o.Payload +} + +func (o *PostCompanyProductProposalForbidden) 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 && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewPostCompanyProductProposalNotFound creates a PostCompanyProductProposalNotFound with default headers values +func NewPostCompanyProductProposalNotFound() *PostCompanyProductProposalNotFound { + return &PostCompanyProductProposalNotFound{} +} + +// PostCompanyProductProposalNotFound describes a response with status code 404, with default header values. +// +// Resource was not found +type PostCompanyProductProposalNotFound struct { + AccessControlAllowOrigin string + + Payload *research_models.Error +} + +// IsSuccess returns true when this post company product proposal not found response has a 2xx status code +func (o *PostCompanyProductProposalNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this post company product proposal not found response has a 3xx status code +func (o *PostCompanyProductProposalNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post company product proposal not found response has a 4xx status code +func (o *PostCompanyProductProposalNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this post company product proposal not found response has a 5xx status code +func (o *PostCompanyProductProposalNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this post company product proposal not found response a status code equal to that given +func (o *PostCompanyProductProposalNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the post company product proposal not found response +func (o *PostCompanyProductProposalNotFound) Code() int { + return 404 +} + +func (o *PostCompanyProductProposalNotFound) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /companyproductproposals][%d] postCompanyProductProposalNotFound %s", 404, payload) +} + +func (o *PostCompanyProductProposalNotFound) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /companyproductproposals][%d] postCompanyProductProposalNotFound %s", 404, payload) +} + +func (o *PostCompanyProductProposalNotFound) GetPayload() *research_models.Error { + return o.Payload +} + +func (o *PostCompanyProductProposalNotFound) 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 && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewPostCompanyProductProposalConflict creates a PostCompanyProductProposalConflict with default headers values +func NewPostCompanyProductProposalConflict() *PostCompanyProductProposalConflict { + return &PostCompanyProductProposalConflict{} +} + +// PostCompanyProductProposalConflict describes a response with status code 409, with default header values. +// +// Product version or idempotency conflict +type PostCompanyProductProposalConflict struct { + Payload *research_models.Error +} + +// IsSuccess returns true when this post company product proposal conflict response has a 2xx status code +func (o *PostCompanyProductProposalConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this post company product proposal conflict response has a 3xx status code +func (o *PostCompanyProductProposalConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post company product proposal conflict response has a 4xx status code +func (o *PostCompanyProductProposalConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this post company product proposal conflict response has a 5xx status code +func (o *PostCompanyProductProposalConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this post company product proposal conflict response a status code equal to that given +func (o *PostCompanyProductProposalConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the post company product proposal conflict response +func (o *PostCompanyProductProposalConflict) Code() int { + return 409 +} + +func (o *PostCompanyProductProposalConflict) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /companyproductproposals][%d] postCompanyProductProposalConflict %s", 409, payload) +} + +func (o *PostCompanyProductProposalConflict) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /companyproductproposals][%d] postCompanyProductProposalConflict %s", 409, payload) +} + +func (o *PostCompanyProductProposalConflict) GetPayload() *research_models.Error { + return o.Payload +} + +func (o *PostCompanyProductProposalConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(research_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewPostCompanyProductProposalUnprocessableEntity creates a PostCompanyProductProposalUnprocessableEntity with default headers values +func NewPostCompanyProductProposalUnprocessableEntity() *PostCompanyProductProposalUnprocessableEntity { + return &PostCompanyProductProposalUnprocessableEntity{} +} + +// PostCompanyProductProposalUnprocessableEntity describes a response with status code 422, with default header values. +// +// Unprocessable Entity, likely a bad parameter +type PostCompanyProductProposalUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *research_models.Error +} + +// IsSuccess returns true when this post company product proposal unprocessable entity response has a 2xx status code +func (o *PostCompanyProductProposalUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this post company product proposal unprocessable entity response has a 3xx status code +func (o *PostCompanyProductProposalUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post company product proposal unprocessable entity response has a 4xx status code +func (o *PostCompanyProductProposalUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this post company product proposal unprocessable entity response has a 5xx status code +func (o *PostCompanyProductProposalUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this post company product proposal unprocessable entity response a status code equal to that given +func (o *PostCompanyProductProposalUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the post company product proposal unprocessable entity response +func (o *PostCompanyProductProposalUnprocessableEntity) Code() int { + return 422 +} + +func (o *PostCompanyProductProposalUnprocessableEntity) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /companyproductproposals][%d] postCompanyProductProposalUnprocessableEntity %s", 422, payload) +} + +func (o *PostCompanyProductProposalUnprocessableEntity) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /companyproductproposals][%d] postCompanyProductProposalUnprocessableEntity %s", 422, payload) +} + +func (o *PostCompanyProductProposalUnprocessableEntity) GetPayload() *research_models.Error { + return o.Payload +} + +func (o *PostCompanyProductProposalUnprocessableEntity) 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 && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewPostCompanyProductProposalInternalServerError creates a PostCompanyProductProposalInternalServerError with default headers values +func NewPostCompanyProductProposalInternalServerError() *PostCompanyProductProposalInternalServerError { + return &PostCompanyProductProposalInternalServerError{} +} + +// PostCompanyProductProposalInternalServerError describes a response with status code 500, with default header values. +// +// Server Internal Error +type PostCompanyProductProposalInternalServerError struct { + AccessControlAllowOrigin string + + Payload *research_models.Error +} + +// IsSuccess returns true when this post company product proposal internal server error response has a 2xx status code +func (o *PostCompanyProductProposalInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this post company product proposal internal server error response has a 3xx status code +func (o *PostCompanyProductProposalInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post company product proposal internal server error response has a 4xx status code +func (o *PostCompanyProductProposalInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this post company product proposal internal server error response has a 5xx status code +func (o *PostCompanyProductProposalInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this post company product proposal internal server error response a status code equal to that given +func (o *PostCompanyProductProposalInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the post company product proposal internal server error response +func (o *PostCompanyProductProposalInternalServerError) Code() int { + return 500 +} + +func (o *PostCompanyProductProposalInternalServerError) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /companyproductproposals][%d] postCompanyProductProposalInternalServerError %s", 500, payload) +} + +func (o *PostCompanyProductProposalInternalServerError) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /companyproductproposals][%d] postCompanyProductProposalInternalServerError %s", 500, payload) +} + +func (o *PostCompanyProductProposalInternalServerError) GetPayload() *research_models.Error { + return o.Payload +} + +func (o *PostCompanyProductProposalInternalServerError) 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 && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} diff --git a/api/research/research_client/company_product_proposals/review_company_product_proposal_parameters.go b/api/research/research_client/company_product_proposals/review_company_product_proposal_parameters.go new file mode 100644 index 0000000..3f2eda9 --- /dev/null +++ b/api/research/research_client/company_product_proposals/review_company_product_proposal_parameters.go @@ -0,0 +1,182 @@ +// 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_product_proposals + +import ( + "context" + "net/http" + "time" + + "code.tnxs.net/vernonkeenan/lib/api/research/research_models" + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewReviewCompanyProductProposalParams creates a new ReviewCompanyProductProposalParams 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 NewReviewCompanyProductProposalParams() *ReviewCompanyProductProposalParams { + return NewReviewCompanyProductProposalParamsWithTimeout(cr.DefaultTimeout) +} + +// NewReviewCompanyProductProposalParamsWithTimeout creates a new ReviewCompanyProductProposalParams object +// with the ability to set a timeout on a request. +func NewReviewCompanyProductProposalParamsWithTimeout(timeout time.Duration) *ReviewCompanyProductProposalParams { + return &ReviewCompanyProductProposalParams{ + inner: innerParams{ + timeout: timeout, + }, + } +} + +// NewReviewCompanyProductProposalParamsWithContext creates a new ReviewCompanyProductProposalParams object +// with the ability to set a context for a request. +// +// Deprecated: use the operation call with context to pass the context instead of [ReviewCompanyProductProposalParams]. +func NewReviewCompanyProductProposalParamsWithContext(ctx context.Context) *ReviewCompanyProductProposalParams { + return &ReviewCompanyProductProposalParams{ + inner: innerParams{ + ctx: ctx, + }, + } +} + +// NewReviewCompanyProductProposalParamsWithHTTPClient creates a new ReviewCompanyProductProposalParams object +// with the ability to set a custom HTTPClient for a request. +func NewReviewCompanyProductProposalParamsWithHTTPClient(client *http.Client) *ReviewCompanyProductProposalParams { + return &ReviewCompanyProductProposalParams{ + HTTPClient: client, + } +} + +/* +ReviewCompanyProductProposalParams contains all the parameters to send to the API endpoint + + for the review company product proposal operation. + + Typically these are written to a http.Request. +*/ +type ReviewCompanyProductProposalParams struct { + + // CompanyProductProposalID. + // + // CompanyProduct proposal record ID + // + // Format: uuid + CompanyProductProposalID strfmt.UUID + + // CompanyProductProposalReviewRequest. + // + // Complete field-level review request + CompanyProductProposalReviewRequest *research_models.CompanyProductProposalReviewRequest + + HTTPClient *http.Client + + inner innerParams +} + +// WithDefaults hydrates default values in the review company product proposal params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReviewCompanyProductProposalParams) WithDefaults() *ReviewCompanyProductProposalParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the review company product proposal params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReviewCompanyProductProposalParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the review company product proposal params. +func (o *ReviewCompanyProductProposalParams) WithTimeout(timeout time.Duration) *ReviewCompanyProductProposalParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the review company product proposal params. +func (o *ReviewCompanyProductProposalParams) SetTimeout(timeout time.Duration) { + o.inner.timeout = timeout +} + +// WithContext adds the context to the review company product proposal params. +// +// Deprecated: use the operation call with context to pass the context instead of [ReviewCompanyProductProposalParams]. +func (o *ReviewCompanyProductProposalParams) WithContext(ctx context.Context) *ReviewCompanyProductProposalParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the review company product proposal params. +// +// Deprecated: use the operation call with context to pass the context instead of [ReviewCompanyProductProposalParams]. +func (o *ReviewCompanyProductProposalParams) SetContext(ctx context.Context) { + o.inner.ctx = ctx +} + +// WithHTTPClient adds the HTTPClient to the review company product proposal params. +func (o *ReviewCompanyProductProposalParams) WithHTTPClient(client *http.Client) *ReviewCompanyProductProposalParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the review company product proposal params. +func (o *ReviewCompanyProductProposalParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCompanyProductProposalID adds the companyProductProposalID to the review company product proposal params. +func (o *ReviewCompanyProductProposalParams) WithCompanyProductProposalID(companyProductProposalID strfmt.UUID) *ReviewCompanyProductProposalParams { + o.SetCompanyProductProposalID(companyProductProposalID) + return o +} + +// SetCompanyProductProposalID adds the companyProductProposalId to the review company product proposal params. +func (o *ReviewCompanyProductProposalParams) SetCompanyProductProposalID(companyProductProposalID strfmt.UUID) { + o.CompanyProductProposalID = companyProductProposalID +} + +// WithCompanyProductProposalReviewRequest adds the companyProductProposalReviewRequest to the review company product proposal params. +func (o *ReviewCompanyProductProposalParams) WithCompanyProductProposalReviewRequest(companyProductProposalReviewRequest *research_models.CompanyProductProposalReviewRequest) *ReviewCompanyProductProposalParams { + o.SetCompanyProductProposalReviewRequest(companyProductProposalReviewRequest) + return o +} + +// SetCompanyProductProposalReviewRequest adds the companyProductProposalReviewRequest to the review company product proposal params. +func (o *ReviewCompanyProductProposalParams) SetCompanyProductProposalReviewRequest(companyProductProposalReviewRequest *research_models.CompanyProductProposalReviewRequest) { + o.CompanyProductProposalReviewRequest = companyProductProposalReviewRequest +} + +// WriteToRequest writes these params to a [runtime.ClientRequest]. +func (o *ReviewCompanyProductProposalParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + if err := r.SetTimeout(o.inner.timeout); err != nil { + return err + } + var res []error + + // path param companyProductProposalId + if err := r.SetPathParam("companyProductProposalId", o.CompanyProductProposalID.String()); err != nil { + return err + } + if o.CompanyProductProposalReviewRequest != nil { + if err := r.SetBodyParam(o.CompanyProductProposalReviewRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/research/research_client/company_product_proposals/review_company_product_proposal_responses.go b/api/research/research_client/company_product_proposals/review_company_product_proposal_responses.go new file mode 100644 index 0000000..feb0ad7 --- /dev/null +++ b/api/research/research_client/company_product_proposals/review_company_product_proposal_responses.go @@ -0,0 +1,594 @@ +// 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_product_proposals + +import ( + "encoding/json" + stderrors "errors" + "fmt" + "io" + + "code.tnxs.net/vernonkeenan/lib/api/research/research_models" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ReviewCompanyProductProposalReader is a Reader for the ReviewCompanyProductProposal structure. +type ReviewCompanyProductProposalReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReviewCompanyProductProposalReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { + switch response.Code() { + case 200: + result := NewReviewCompanyProductProposalOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewReviewCompanyProductProposalUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewReviewCompanyProductProposalForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewReviewCompanyProductProposalNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewReviewCompanyProductProposalConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewReviewCompanyProductProposalUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewReviewCompanyProductProposalInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /companyproductproposals/{companyProductProposalId}/review] reviewCompanyProductProposal", response, response.Code()) + } +} + +// NewReviewCompanyProductProposalOK creates a ReviewCompanyProductProposalOK with default headers values +func NewReviewCompanyProductProposalOK() *ReviewCompanyProductProposalOK { + return &ReviewCompanyProductProposalOK{} +} + +// ReviewCompanyProductProposalOK describes a response with status code 200, with default header values. +// +// Proposal review completed +type ReviewCompanyProductProposalOK struct { + Payload *research_models.CompanyProductProposal +} + +// IsSuccess returns true when this review company product proposal o k response has a 2xx status code +func (o *ReviewCompanyProductProposalOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this review company product proposal o k response has a 3xx status code +func (o *ReviewCompanyProductProposalOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this review company product proposal o k response has a 4xx status code +func (o *ReviewCompanyProductProposalOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this review company product proposal o k response has a 5xx status code +func (o *ReviewCompanyProductProposalOK) IsServerError() bool { + return false +} + +// IsCode returns true when this review company product proposal o k response a status code equal to that given +func (o *ReviewCompanyProductProposalOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the review company product proposal o k response +func (o *ReviewCompanyProductProposalOK) Code() int { + return 200 +} + +func (o *ReviewCompanyProductProposalOK) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /companyproductproposals/{companyProductProposalId}/review][%d] reviewCompanyProductProposalOK %s", 200, payload) +} + +func (o *ReviewCompanyProductProposalOK) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /companyproductproposals/{companyProductProposalId}/review][%d] reviewCompanyProductProposalOK %s", 200, payload) +} + +func (o *ReviewCompanyProductProposalOK) GetPayload() *research_models.CompanyProductProposal { + return o.Payload +} + +func (o *ReviewCompanyProductProposalOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(research_models.CompanyProductProposal) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewReviewCompanyProductProposalUnauthorized creates a ReviewCompanyProductProposalUnauthorized with default headers values +func NewReviewCompanyProductProposalUnauthorized() *ReviewCompanyProductProposalUnauthorized { + return &ReviewCompanyProductProposalUnauthorized{} +} + +// ReviewCompanyProductProposalUnauthorized describes a response with status code 401, with default header values. +// +// Access unauthorized, invalid API-KEY was used +type ReviewCompanyProductProposalUnauthorized struct { + AccessControlAllowOrigin string + + Payload *research_models.Error +} + +// IsSuccess returns true when this review company product proposal unauthorized response has a 2xx status code +func (o *ReviewCompanyProductProposalUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this review company product proposal unauthorized response has a 3xx status code +func (o *ReviewCompanyProductProposalUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this review company product proposal unauthorized response has a 4xx status code +func (o *ReviewCompanyProductProposalUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this review company product proposal unauthorized response has a 5xx status code +func (o *ReviewCompanyProductProposalUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this review company product proposal unauthorized response a status code equal to that given +func (o *ReviewCompanyProductProposalUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the review company product proposal unauthorized response +func (o *ReviewCompanyProductProposalUnauthorized) Code() int { + return 401 +} + +func (o *ReviewCompanyProductProposalUnauthorized) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /companyproductproposals/{companyProductProposalId}/review][%d] reviewCompanyProductProposalUnauthorized %s", 401, payload) +} + +func (o *ReviewCompanyProductProposalUnauthorized) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /companyproductproposals/{companyProductProposalId}/review][%d] reviewCompanyProductProposalUnauthorized %s", 401, payload) +} + +func (o *ReviewCompanyProductProposalUnauthorized) GetPayload() *research_models.Error { + return o.Payload +} + +func (o *ReviewCompanyProductProposalUnauthorized) 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 && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewReviewCompanyProductProposalForbidden creates a ReviewCompanyProductProposalForbidden with default headers values +func NewReviewCompanyProductProposalForbidden() *ReviewCompanyProductProposalForbidden { + return &ReviewCompanyProductProposalForbidden{} +} + +// ReviewCompanyProductProposalForbidden describes a response with status code 403, with default header values. +// +// Access forbidden, account lacks access +type ReviewCompanyProductProposalForbidden struct { + AccessControlAllowOrigin string + + Payload *research_models.Error +} + +// IsSuccess returns true when this review company product proposal forbidden response has a 2xx status code +func (o *ReviewCompanyProductProposalForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this review company product proposal forbidden response has a 3xx status code +func (o *ReviewCompanyProductProposalForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this review company product proposal forbidden response has a 4xx status code +func (o *ReviewCompanyProductProposalForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this review company product proposal forbidden response has a 5xx status code +func (o *ReviewCompanyProductProposalForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this review company product proposal forbidden response a status code equal to that given +func (o *ReviewCompanyProductProposalForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the review company product proposal forbidden response +func (o *ReviewCompanyProductProposalForbidden) Code() int { + return 403 +} + +func (o *ReviewCompanyProductProposalForbidden) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /companyproductproposals/{companyProductProposalId}/review][%d] reviewCompanyProductProposalForbidden %s", 403, payload) +} + +func (o *ReviewCompanyProductProposalForbidden) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /companyproductproposals/{companyProductProposalId}/review][%d] reviewCompanyProductProposalForbidden %s", 403, payload) +} + +func (o *ReviewCompanyProductProposalForbidden) GetPayload() *research_models.Error { + return o.Payload +} + +func (o *ReviewCompanyProductProposalForbidden) 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 && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewReviewCompanyProductProposalNotFound creates a ReviewCompanyProductProposalNotFound with default headers values +func NewReviewCompanyProductProposalNotFound() *ReviewCompanyProductProposalNotFound { + return &ReviewCompanyProductProposalNotFound{} +} + +// ReviewCompanyProductProposalNotFound describes a response with status code 404, with default header values. +// +// Resource was not found +type ReviewCompanyProductProposalNotFound struct { + AccessControlAllowOrigin string + + Payload *research_models.Error +} + +// IsSuccess returns true when this review company product proposal not found response has a 2xx status code +func (o *ReviewCompanyProductProposalNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this review company product proposal not found response has a 3xx status code +func (o *ReviewCompanyProductProposalNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this review company product proposal not found response has a 4xx status code +func (o *ReviewCompanyProductProposalNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this review company product proposal not found response has a 5xx status code +func (o *ReviewCompanyProductProposalNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this review company product proposal not found response a status code equal to that given +func (o *ReviewCompanyProductProposalNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the review company product proposal not found response +func (o *ReviewCompanyProductProposalNotFound) Code() int { + return 404 +} + +func (o *ReviewCompanyProductProposalNotFound) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /companyproductproposals/{companyProductProposalId}/review][%d] reviewCompanyProductProposalNotFound %s", 404, payload) +} + +func (o *ReviewCompanyProductProposalNotFound) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /companyproductproposals/{companyProductProposalId}/review][%d] reviewCompanyProductProposalNotFound %s", 404, payload) +} + +func (o *ReviewCompanyProductProposalNotFound) GetPayload() *research_models.Error { + return o.Payload +} + +func (o *ReviewCompanyProductProposalNotFound) 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 && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewReviewCompanyProductProposalConflict creates a ReviewCompanyProductProposalConflict with default headers values +func NewReviewCompanyProductProposalConflict() *ReviewCompanyProductProposalConflict { + return &ReviewCompanyProductProposalConflict{} +} + +// ReviewCompanyProductProposalConflict describes a response with status code 409, with default header values. +// +// Proposal state or optimistic version conflict +type ReviewCompanyProductProposalConflict struct { + Payload *research_models.Error +} + +// IsSuccess returns true when this review company product proposal conflict response has a 2xx status code +func (o *ReviewCompanyProductProposalConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this review company product proposal conflict response has a 3xx status code +func (o *ReviewCompanyProductProposalConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this review company product proposal conflict response has a 4xx status code +func (o *ReviewCompanyProductProposalConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this review company product proposal conflict response has a 5xx status code +func (o *ReviewCompanyProductProposalConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this review company product proposal conflict response a status code equal to that given +func (o *ReviewCompanyProductProposalConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the review company product proposal conflict response +func (o *ReviewCompanyProductProposalConflict) Code() int { + return 409 +} + +func (o *ReviewCompanyProductProposalConflict) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /companyproductproposals/{companyProductProposalId}/review][%d] reviewCompanyProductProposalConflict %s", 409, payload) +} + +func (o *ReviewCompanyProductProposalConflict) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /companyproductproposals/{companyProductProposalId}/review][%d] reviewCompanyProductProposalConflict %s", 409, payload) +} + +func (o *ReviewCompanyProductProposalConflict) GetPayload() *research_models.Error { + return o.Payload +} + +func (o *ReviewCompanyProductProposalConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(research_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewReviewCompanyProductProposalUnprocessableEntity creates a ReviewCompanyProductProposalUnprocessableEntity with default headers values +func NewReviewCompanyProductProposalUnprocessableEntity() *ReviewCompanyProductProposalUnprocessableEntity { + return &ReviewCompanyProductProposalUnprocessableEntity{} +} + +// ReviewCompanyProductProposalUnprocessableEntity describes a response with status code 422, with default header values. +// +// Unprocessable Entity, likely a bad parameter +type ReviewCompanyProductProposalUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *research_models.Error +} + +// IsSuccess returns true when this review company product proposal unprocessable entity response has a 2xx status code +func (o *ReviewCompanyProductProposalUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this review company product proposal unprocessable entity response has a 3xx status code +func (o *ReviewCompanyProductProposalUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this review company product proposal unprocessable entity response has a 4xx status code +func (o *ReviewCompanyProductProposalUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this review company product proposal unprocessable entity response has a 5xx status code +func (o *ReviewCompanyProductProposalUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this review company product proposal unprocessable entity response a status code equal to that given +func (o *ReviewCompanyProductProposalUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the review company product proposal unprocessable entity response +func (o *ReviewCompanyProductProposalUnprocessableEntity) Code() int { + return 422 +} + +func (o *ReviewCompanyProductProposalUnprocessableEntity) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /companyproductproposals/{companyProductProposalId}/review][%d] reviewCompanyProductProposalUnprocessableEntity %s", 422, payload) +} + +func (o *ReviewCompanyProductProposalUnprocessableEntity) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /companyproductproposals/{companyProductProposalId}/review][%d] reviewCompanyProductProposalUnprocessableEntity %s", 422, payload) +} + +func (o *ReviewCompanyProductProposalUnprocessableEntity) GetPayload() *research_models.Error { + return o.Payload +} + +func (o *ReviewCompanyProductProposalUnprocessableEntity) 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 && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewReviewCompanyProductProposalInternalServerError creates a ReviewCompanyProductProposalInternalServerError with default headers values +func NewReviewCompanyProductProposalInternalServerError() *ReviewCompanyProductProposalInternalServerError { + return &ReviewCompanyProductProposalInternalServerError{} +} + +// ReviewCompanyProductProposalInternalServerError describes a response with status code 500, with default header values. +// +// Server Internal Error +type ReviewCompanyProductProposalInternalServerError struct { + AccessControlAllowOrigin string + + Payload *research_models.Error +} + +// IsSuccess returns true when this review company product proposal internal server error response has a 2xx status code +func (o *ReviewCompanyProductProposalInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this review company product proposal internal server error response has a 3xx status code +func (o *ReviewCompanyProductProposalInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this review company product proposal internal server error response has a 4xx status code +func (o *ReviewCompanyProductProposalInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this review company product proposal internal server error response has a 5xx status code +func (o *ReviewCompanyProductProposalInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this review company product proposal internal server error response a status code equal to that given +func (o *ReviewCompanyProductProposalInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the review company product proposal internal server error response +func (o *ReviewCompanyProductProposalInternalServerError) Code() int { + return 500 +} + +func (o *ReviewCompanyProductProposalInternalServerError) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /companyproductproposals/{companyProductProposalId}/review][%d] reviewCompanyProductProposalInternalServerError %s", 500, payload) +} + +func (o *ReviewCompanyProductProposalInternalServerError) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /companyproductproposals/{companyProductProposalId}/review][%d] reviewCompanyProductProposalInternalServerError %s", 500, payload) +} + +func (o *ReviewCompanyProductProposalInternalServerError) GetPayload() *research_models.Error { + return o.Payload +} + +func (o *ReviewCompanyProductProposalInternalServerError) 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 && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} diff --git a/api/research/research_client/company_product_proposals/submit_company_product_proposal_parameters.go b/api/research/research_client/company_product_proposals/submit_company_product_proposal_parameters.go new file mode 100644 index 0000000..f162b45 --- /dev/null +++ b/api/research/research_client/company_product_proposals/submit_company_product_proposal_parameters.go @@ -0,0 +1,182 @@ +// 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_product_proposals + +import ( + "context" + "net/http" + "time" + + "code.tnxs.net/vernonkeenan/lib/api/research/research_models" + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewSubmitCompanyProductProposalParams creates a new SubmitCompanyProductProposalParams 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 NewSubmitCompanyProductProposalParams() *SubmitCompanyProductProposalParams { + return NewSubmitCompanyProductProposalParamsWithTimeout(cr.DefaultTimeout) +} + +// NewSubmitCompanyProductProposalParamsWithTimeout creates a new SubmitCompanyProductProposalParams object +// with the ability to set a timeout on a request. +func NewSubmitCompanyProductProposalParamsWithTimeout(timeout time.Duration) *SubmitCompanyProductProposalParams { + return &SubmitCompanyProductProposalParams{ + inner: innerParams{ + timeout: timeout, + }, + } +} + +// NewSubmitCompanyProductProposalParamsWithContext creates a new SubmitCompanyProductProposalParams object +// with the ability to set a context for a request. +// +// Deprecated: use the operation call with context to pass the context instead of [SubmitCompanyProductProposalParams]. +func NewSubmitCompanyProductProposalParamsWithContext(ctx context.Context) *SubmitCompanyProductProposalParams { + return &SubmitCompanyProductProposalParams{ + inner: innerParams{ + ctx: ctx, + }, + } +} + +// NewSubmitCompanyProductProposalParamsWithHTTPClient creates a new SubmitCompanyProductProposalParams object +// with the ability to set a custom HTTPClient for a request. +func NewSubmitCompanyProductProposalParamsWithHTTPClient(client *http.Client) *SubmitCompanyProductProposalParams { + return &SubmitCompanyProductProposalParams{ + HTTPClient: client, + } +} + +/* +SubmitCompanyProductProposalParams contains all the parameters to send to the API endpoint + + for the submit company product proposal operation. + + Typically these are written to a http.Request. +*/ +type SubmitCompanyProductProposalParams struct { + + // CompanyProductProposalID. + // + // CompanyProduct proposal record ID + // + // Format: uuid + CompanyProductProposalID strfmt.UUID + + // CompanyProductProposalSubmitRequest. + // + // Optimistic draft submission request + CompanyProductProposalSubmitRequest *research_models.CompanyProductProposalSubmitRequest + + HTTPClient *http.Client + + inner innerParams +} + +// WithDefaults hydrates default values in the submit company product proposal params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SubmitCompanyProductProposalParams) WithDefaults() *SubmitCompanyProductProposalParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the submit company product proposal params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SubmitCompanyProductProposalParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the submit company product proposal params. +func (o *SubmitCompanyProductProposalParams) WithTimeout(timeout time.Duration) *SubmitCompanyProductProposalParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the submit company product proposal params. +func (o *SubmitCompanyProductProposalParams) SetTimeout(timeout time.Duration) { + o.inner.timeout = timeout +} + +// WithContext adds the context to the submit company product proposal params. +// +// Deprecated: use the operation call with context to pass the context instead of [SubmitCompanyProductProposalParams]. +func (o *SubmitCompanyProductProposalParams) WithContext(ctx context.Context) *SubmitCompanyProductProposalParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the submit company product proposal params. +// +// Deprecated: use the operation call with context to pass the context instead of [SubmitCompanyProductProposalParams]. +func (o *SubmitCompanyProductProposalParams) SetContext(ctx context.Context) { + o.inner.ctx = ctx +} + +// WithHTTPClient adds the HTTPClient to the submit company product proposal params. +func (o *SubmitCompanyProductProposalParams) WithHTTPClient(client *http.Client) *SubmitCompanyProductProposalParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the submit company product proposal params. +func (o *SubmitCompanyProductProposalParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCompanyProductProposalID adds the companyProductProposalID to the submit company product proposal params. +func (o *SubmitCompanyProductProposalParams) WithCompanyProductProposalID(companyProductProposalID strfmt.UUID) *SubmitCompanyProductProposalParams { + o.SetCompanyProductProposalID(companyProductProposalID) + return o +} + +// SetCompanyProductProposalID adds the companyProductProposalId to the submit company product proposal params. +func (o *SubmitCompanyProductProposalParams) SetCompanyProductProposalID(companyProductProposalID strfmt.UUID) { + o.CompanyProductProposalID = companyProductProposalID +} + +// WithCompanyProductProposalSubmitRequest adds the companyProductProposalSubmitRequest to the submit company product proposal params. +func (o *SubmitCompanyProductProposalParams) WithCompanyProductProposalSubmitRequest(companyProductProposalSubmitRequest *research_models.CompanyProductProposalSubmitRequest) *SubmitCompanyProductProposalParams { + o.SetCompanyProductProposalSubmitRequest(companyProductProposalSubmitRequest) + return o +} + +// SetCompanyProductProposalSubmitRequest adds the companyProductProposalSubmitRequest to the submit company product proposal params. +func (o *SubmitCompanyProductProposalParams) SetCompanyProductProposalSubmitRequest(companyProductProposalSubmitRequest *research_models.CompanyProductProposalSubmitRequest) { + o.CompanyProductProposalSubmitRequest = companyProductProposalSubmitRequest +} + +// WriteToRequest writes these params to a [runtime.ClientRequest]. +func (o *SubmitCompanyProductProposalParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + if err := r.SetTimeout(o.inner.timeout); err != nil { + return err + } + var res []error + + // path param companyProductProposalId + if err := r.SetPathParam("companyProductProposalId", o.CompanyProductProposalID.String()); err != nil { + return err + } + if o.CompanyProductProposalSubmitRequest != nil { + if err := r.SetBodyParam(o.CompanyProductProposalSubmitRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/research/research_client/company_product_proposals/submit_company_product_proposal_responses.go b/api/research/research_client/company_product_proposals/submit_company_product_proposal_responses.go new file mode 100644 index 0000000..381bb2b --- /dev/null +++ b/api/research/research_client/company_product_proposals/submit_company_product_proposal_responses.go @@ -0,0 +1,594 @@ +// 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_product_proposals + +import ( + "encoding/json" + stderrors "errors" + "fmt" + "io" + + "code.tnxs.net/vernonkeenan/lib/api/research/research_models" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// SubmitCompanyProductProposalReader is a Reader for the SubmitCompanyProductProposal structure. +type SubmitCompanyProductProposalReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SubmitCompanyProductProposalReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { + switch response.Code() { + case 200: + result := NewSubmitCompanyProductProposalOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewSubmitCompanyProductProposalUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewSubmitCompanyProductProposalForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewSubmitCompanyProductProposalNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewSubmitCompanyProductProposalConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewSubmitCompanyProductProposalUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewSubmitCompanyProductProposalInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /companyproductproposals/{companyProductProposalId}/submit] submitCompanyProductProposal", response, response.Code()) + } +} + +// NewSubmitCompanyProductProposalOK creates a SubmitCompanyProductProposalOK with default headers values +func NewSubmitCompanyProductProposalOK() *SubmitCompanyProductProposalOK { + return &SubmitCompanyProductProposalOK{} +} + +// SubmitCompanyProductProposalOK describes a response with status code 200, with default header values. +// +// Proposal submitted for review +type SubmitCompanyProductProposalOK struct { + Payload *research_models.CompanyProductProposal +} + +// IsSuccess returns true when this submit company product proposal o k response has a 2xx status code +func (o *SubmitCompanyProductProposalOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this submit company product proposal o k response has a 3xx status code +func (o *SubmitCompanyProductProposalOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this submit company product proposal o k response has a 4xx status code +func (o *SubmitCompanyProductProposalOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this submit company product proposal o k response has a 5xx status code +func (o *SubmitCompanyProductProposalOK) IsServerError() bool { + return false +} + +// IsCode returns true when this submit company product proposal o k response a status code equal to that given +func (o *SubmitCompanyProductProposalOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the submit company product proposal o k response +func (o *SubmitCompanyProductProposalOK) Code() int { + return 200 +} + +func (o *SubmitCompanyProductProposalOK) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /companyproductproposals/{companyProductProposalId}/submit][%d] submitCompanyProductProposalOK %s", 200, payload) +} + +func (o *SubmitCompanyProductProposalOK) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /companyproductproposals/{companyProductProposalId}/submit][%d] submitCompanyProductProposalOK %s", 200, payload) +} + +func (o *SubmitCompanyProductProposalOK) GetPayload() *research_models.CompanyProductProposal { + return o.Payload +} + +func (o *SubmitCompanyProductProposalOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(research_models.CompanyProductProposal) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewSubmitCompanyProductProposalUnauthorized creates a SubmitCompanyProductProposalUnauthorized with default headers values +func NewSubmitCompanyProductProposalUnauthorized() *SubmitCompanyProductProposalUnauthorized { + return &SubmitCompanyProductProposalUnauthorized{} +} + +// SubmitCompanyProductProposalUnauthorized describes a response with status code 401, with default header values. +// +// Access unauthorized, invalid API-KEY was used +type SubmitCompanyProductProposalUnauthorized struct { + AccessControlAllowOrigin string + + Payload *research_models.Error +} + +// IsSuccess returns true when this submit company product proposal unauthorized response has a 2xx status code +func (o *SubmitCompanyProductProposalUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this submit company product proposal unauthorized response has a 3xx status code +func (o *SubmitCompanyProductProposalUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this submit company product proposal unauthorized response has a 4xx status code +func (o *SubmitCompanyProductProposalUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this submit company product proposal unauthorized response has a 5xx status code +func (o *SubmitCompanyProductProposalUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this submit company product proposal unauthorized response a status code equal to that given +func (o *SubmitCompanyProductProposalUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the submit company product proposal unauthorized response +func (o *SubmitCompanyProductProposalUnauthorized) Code() int { + return 401 +} + +func (o *SubmitCompanyProductProposalUnauthorized) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /companyproductproposals/{companyProductProposalId}/submit][%d] submitCompanyProductProposalUnauthorized %s", 401, payload) +} + +func (o *SubmitCompanyProductProposalUnauthorized) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /companyproductproposals/{companyProductProposalId}/submit][%d] submitCompanyProductProposalUnauthorized %s", 401, payload) +} + +func (o *SubmitCompanyProductProposalUnauthorized) GetPayload() *research_models.Error { + return o.Payload +} + +func (o *SubmitCompanyProductProposalUnauthorized) 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 && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewSubmitCompanyProductProposalForbidden creates a SubmitCompanyProductProposalForbidden with default headers values +func NewSubmitCompanyProductProposalForbidden() *SubmitCompanyProductProposalForbidden { + return &SubmitCompanyProductProposalForbidden{} +} + +// SubmitCompanyProductProposalForbidden describes a response with status code 403, with default header values. +// +// Access forbidden, account lacks access +type SubmitCompanyProductProposalForbidden struct { + AccessControlAllowOrigin string + + Payload *research_models.Error +} + +// IsSuccess returns true when this submit company product proposal forbidden response has a 2xx status code +func (o *SubmitCompanyProductProposalForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this submit company product proposal forbidden response has a 3xx status code +func (o *SubmitCompanyProductProposalForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this submit company product proposal forbidden response has a 4xx status code +func (o *SubmitCompanyProductProposalForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this submit company product proposal forbidden response has a 5xx status code +func (o *SubmitCompanyProductProposalForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this submit company product proposal forbidden response a status code equal to that given +func (o *SubmitCompanyProductProposalForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the submit company product proposal forbidden response +func (o *SubmitCompanyProductProposalForbidden) Code() int { + return 403 +} + +func (o *SubmitCompanyProductProposalForbidden) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /companyproductproposals/{companyProductProposalId}/submit][%d] submitCompanyProductProposalForbidden %s", 403, payload) +} + +func (o *SubmitCompanyProductProposalForbidden) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /companyproductproposals/{companyProductProposalId}/submit][%d] submitCompanyProductProposalForbidden %s", 403, payload) +} + +func (o *SubmitCompanyProductProposalForbidden) GetPayload() *research_models.Error { + return o.Payload +} + +func (o *SubmitCompanyProductProposalForbidden) 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 && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewSubmitCompanyProductProposalNotFound creates a SubmitCompanyProductProposalNotFound with default headers values +func NewSubmitCompanyProductProposalNotFound() *SubmitCompanyProductProposalNotFound { + return &SubmitCompanyProductProposalNotFound{} +} + +// SubmitCompanyProductProposalNotFound describes a response with status code 404, with default header values. +// +// Resource was not found +type SubmitCompanyProductProposalNotFound struct { + AccessControlAllowOrigin string + + Payload *research_models.Error +} + +// IsSuccess returns true when this submit company product proposal not found response has a 2xx status code +func (o *SubmitCompanyProductProposalNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this submit company product proposal not found response has a 3xx status code +func (o *SubmitCompanyProductProposalNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this submit company product proposal not found response has a 4xx status code +func (o *SubmitCompanyProductProposalNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this submit company product proposal not found response has a 5xx status code +func (o *SubmitCompanyProductProposalNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this submit company product proposal not found response a status code equal to that given +func (o *SubmitCompanyProductProposalNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the submit company product proposal not found response +func (o *SubmitCompanyProductProposalNotFound) Code() int { + return 404 +} + +func (o *SubmitCompanyProductProposalNotFound) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /companyproductproposals/{companyProductProposalId}/submit][%d] submitCompanyProductProposalNotFound %s", 404, payload) +} + +func (o *SubmitCompanyProductProposalNotFound) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /companyproductproposals/{companyProductProposalId}/submit][%d] submitCompanyProductProposalNotFound %s", 404, payload) +} + +func (o *SubmitCompanyProductProposalNotFound) GetPayload() *research_models.Error { + return o.Payload +} + +func (o *SubmitCompanyProductProposalNotFound) 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 && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewSubmitCompanyProductProposalConflict creates a SubmitCompanyProductProposalConflict with default headers values +func NewSubmitCompanyProductProposalConflict() *SubmitCompanyProductProposalConflict { + return &SubmitCompanyProductProposalConflict{} +} + +// SubmitCompanyProductProposalConflict describes a response with status code 409, with default header values. +// +// Proposal state or optimistic version conflict +type SubmitCompanyProductProposalConflict struct { + Payload *research_models.Error +} + +// IsSuccess returns true when this submit company product proposal conflict response has a 2xx status code +func (o *SubmitCompanyProductProposalConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this submit company product proposal conflict response has a 3xx status code +func (o *SubmitCompanyProductProposalConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this submit company product proposal conflict response has a 4xx status code +func (o *SubmitCompanyProductProposalConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this submit company product proposal conflict response has a 5xx status code +func (o *SubmitCompanyProductProposalConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this submit company product proposal conflict response a status code equal to that given +func (o *SubmitCompanyProductProposalConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the submit company product proposal conflict response +func (o *SubmitCompanyProductProposalConflict) Code() int { + return 409 +} + +func (o *SubmitCompanyProductProposalConflict) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /companyproductproposals/{companyProductProposalId}/submit][%d] submitCompanyProductProposalConflict %s", 409, payload) +} + +func (o *SubmitCompanyProductProposalConflict) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /companyproductproposals/{companyProductProposalId}/submit][%d] submitCompanyProductProposalConflict %s", 409, payload) +} + +func (o *SubmitCompanyProductProposalConflict) GetPayload() *research_models.Error { + return o.Payload +} + +func (o *SubmitCompanyProductProposalConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(research_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewSubmitCompanyProductProposalUnprocessableEntity creates a SubmitCompanyProductProposalUnprocessableEntity with default headers values +func NewSubmitCompanyProductProposalUnprocessableEntity() *SubmitCompanyProductProposalUnprocessableEntity { + return &SubmitCompanyProductProposalUnprocessableEntity{} +} + +// SubmitCompanyProductProposalUnprocessableEntity describes a response with status code 422, with default header values. +// +// Unprocessable Entity, likely a bad parameter +type SubmitCompanyProductProposalUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *research_models.Error +} + +// IsSuccess returns true when this submit company product proposal unprocessable entity response has a 2xx status code +func (o *SubmitCompanyProductProposalUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this submit company product proposal unprocessable entity response has a 3xx status code +func (o *SubmitCompanyProductProposalUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this submit company product proposal unprocessable entity response has a 4xx status code +func (o *SubmitCompanyProductProposalUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this submit company product proposal unprocessable entity response has a 5xx status code +func (o *SubmitCompanyProductProposalUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this submit company product proposal unprocessable entity response a status code equal to that given +func (o *SubmitCompanyProductProposalUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the submit company product proposal unprocessable entity response +func (o *SubmitCompanyProductProposalUnprocessableEntity) Code() int { + return 422 +} + +func (o *SubmitCompanyProductProposalUnprocessableEntity) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /companyproductproposals/{companyProductProposalId}/submit][%d] submitCompanyProductProposalUnprocessableEntity %s", 422, payload) +} + +func (o *SubmitCompanyProductProposalUnprocessableEntity) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /companyproductproposals/{companyProductProposalId}/submit][%d] submitCompanyProductProposalUnprocessableEntity %s", 422, payload) +} + +func (o *SubmitCompanyProductProposalUnprocessableEntity) GetPayload() *research_models.Error { + return o.Payload +} + +func (o *SubmitCompanyProductProposalUnprocessableEntity) 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 && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewSubmitCompanyProductProposalInternalServerError creates a SubmitCompanyProductProposalInternalServerError with default headers values +func NewSubmitCompanyProductProposalInternalServerError() *SubmitCompanyProductProposalInternalServerError { + return &SubmitCompanyProductProposalInternalServerError{} +} + +// SubmitCompanyProductProposalInternalServerError describes a response with status code 500, with default header values. +// +// Server Internal Error +type SubmitCompanyProductProposalInternalServerError struct { + AccessControlAllowOrigin string + + Payload *research_models.Error +} + +// IsSuccess returns true when this submit company product proposal internal server error response has a 2xx status code +func (o *SubmitCompanyProductProposalInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this submit company product proposal internal server error response has a 3xx status code +func (o *SubmitCompanyProductProposalInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this submit company product proposal internal server error response has a 4xx status code +func (o *SubmitCompanyProductProposalInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this submit company product proposal internal server error response has a 5xx status code +func (o *SubmitCompanyProductProposalInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this submit company product proposal internal server error response a status code equal to that given +func (o *SubmitCompanyProductProposalInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the submit company product proposal internal server error response +func (o *SubmitCompanyProductProposalInternalServerError) Code() int { + return 500 +} + +func (o *SubmitCompanyProductProposalInternalServerError) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /companyproductproposals/{companyProductProposalId}/submit][%d] submitCompanyProductProposalInternalServerError %s", 500, payload) +} + +func (o *SubmitCompanyProductProposalInternalServerError) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /companyproductproposals/{companyProductProposalId}/submit][%d] submitCompanyProductProposalInternalServerError %s", 500, payload) +} + +func (o *SubmitCompanyProductProposalInternalServerError) GetPayload() *research_models.Error { + return o.Payload +} + +func (o *SubmitCompanyProductProposalInternalServerError) 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 && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} diff --git a/api/research/research_client/industry/industry_client.go b/api/research/research_client/industry/industry_client.go index 5e527de..9ac0bcf 100644 --- a/api/research/research_client/industry/industry_client.go +++ b/api/research/research_client/industry/industry_client.go @@ -66,18 +66,24 @@ type ClientService interface { // GetIndustriesContext get industry records. GetIndustriesContext(ctx context.Context, params *GetIndustriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIndustriesOK, error) - // PostIndustries add new companies. + // PostIndustries add a shared industry taxonomy record. PostIndustries(params *PostIndustriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostIndustriesOK, error) - // PostIndustriesContext add new companies. + // PostIndustriesContext add a shared industry taxonomy record. PostIndustriesContext(ctx context.Context, params *PostIndustriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostIndustriesOK, error) + // PutIndustries update a shared industry taxonomy record. + PutIndustries(params *PutIndustriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutIndustriesOK, error) + + // PutIndustriesContext update a shared industry taxonomy record. + PutIndustriesContext(ctx context.Context, params *PutIndustriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutIndustriesOK, error) + SetTransport(transport runtime.ContextualTransport) } // GetIndustries gets industry records. // -// Retrieve Industry records from the microservice. +// Retrieve the shared global Industry taxonomy. Requires research:industry:read on a tenant-bound service principal; the tenant authorizes the caller but does not own taxonomy rows.. // // This method does not support injected context. // However, timeout and opentracing contexts are honored whenever enabled. @@ -96,7 +102,7 @@ func (a *Client) GetIndustries(params *GetIndustriesParams, authInfo runtime.Cli // GetIndustriesContext gets industry records. // -// Retrieve Industry records from the microservice. +// Retrieve the shared global Industry taxonomy. Requires research:industry:read on a tenant-bound service principal; the tenant authorizes the caller but does not own taxonomy rows.. // // Do not use the deprecated [GetIndustriesParams.Context] with this method: it would be ignored. func (a *Client) GetIndustriesContext(ctx context.Context, params *GetIndustriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIndustriesOK, error) { @@ -142,9 +148,9 @@ func (a *Client) GetIndustriesContext(ctx context.Context, params *GetIndustries panic(msg) } -// PostIndustries adds new companies. +// PostIndustries adds a shared industry taxonomy record. // -// Add new industries. +// Add exactly one shared global Industry with server-owned ID and audit fields. Requires research:industry:create plus an active Owner or Manager session in the machine tenant.. // // This method does not support injected context. // However, timeout and opentracing contexts are honored whenever enabled. @@ -161,9 +167,9 @@ func (a *Client) PostIndustries(params *PostIndustriesParams, authInfo runtime.C return a.PostIndustriesContext(ctx, params, authInfo, opts...) } -// PostIndustriesContext adds new companies. +// PostIndustriesContext adds a shared industry taxonomy record. // -// Add new industries. +// Add exactly one shared global Industry with server-owned ID and audit fields. Requires research:industry:create plus an active Owner or Manager session in the machine tenant.. // // Do not use the deprecated [PostIndustriesParams.Context] with this method: it would be ignored. func (a *Client) PostIndustriesContext(ctx context.Context, params *PostIndustriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostIndustriesOK, error) { @@ -209,6 +215,73 @@ func (a *Client) PostIndustriesContext(ctx context.Context, params *PostIndustri panic(msg) } +// PutIndustries updates a shared industry taxonomy record. +// +// Optimistically replace the editable fields of exactly one shared global Industry. ID and LastModifiedDate form the compare-and-swap contract; audit fields are server-owned. Requires research:industry:update plus an active Owner or Manager session in the machine tenant.. +// +// This method does not support injected context. +// However, timeout and opentracing contexts are honored whenever enabled. +// +// If you need to pass a specific context, use [Client.PutIndustriesContext] instead. +func (a *Client) PutIndustries(params *PutIndustriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutIndustriesOK, error) { + var ctx context.Context + if params.inner.ctx != nil { + ctx = params.inner.ctx + } else { + ctx = context.Background() + } + + return a.PutIndustriesContext(ctx, params, authInfo, opts...) +} + +// PutIndustriesContext updates a shared industry taxonomy record. +// +// Optimistically replace the editable fields of exactly one shared global Industry. ID and LastModifiedDate form the compare-and-swap contract; audit fields are server-owned. Requires research:industry:update plus an active Owner or Manager session in the machine tenant.. +// +// Do not use the deprecated [PutIndustriesParams.Context] with this method: it would be ignored. +func (a *Client) PutIndustriesContext(ctx context.Context, params *PutIndustriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutIndustriesOK, error) { + // NOTE: parameters are not validated before sending + if params == nil { + params = NewPutIndustriesParams() + } + + op := &runtime.ClientOperation{ + ID: "putIndustries", + Method: "PUT", + PathPattern: "/industries", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutIndustriesReader{formats: a.formats}, + AuthInfo: authInfo, + Client: params.HTTPClient, + } + + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.SubmitContext(ctx, op) + if err != nil { + return nil, err + } + + // only one success response has to be checked + success, ok := result.(*PutIndustriesOK) + if ok { + return success, nil + } + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for putIndustries: 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.ContextualTransport) { a.transport = transport diff --git a/api/research/research_client/industry/put_industries_parameters.go b/api/research/research_client/industry/put_industries_parameters.go new file mode 100644 index 0000000..f4f34fc --- /dev/null +++ b/api/research/research_client/industry/put_industries_parameters.go @@ -0,0 +1,159 @@ +// 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 industry + +import ( + "context" + "net/http" + "time" + + "code.tnxs.net/vernonkeenan/lib/api/research/research_models" + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewPutIndustriesParams creates a new PutIndustriesParams 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 NewPutIndustriesParams() *PutIndustriesParams { + return NewPutIndustriesParamsWithTimeout(cr.DefaultTimeout) +} + +// NewPutIndustriesParamsWithTimeout creates a new PutIndustriesParams object +// with the ability to set a timeout on a request. +func NewPutIndustriesParamsWithTimeout(timeout time.Duration) *PutIndustriesParams { + return &PutIndustriesParams{ + inner: innerParams{ + timeout: timeout, + }, + } +} + +// NewPutIndustriesParamsWithContext creates a new PutIndustriesParams object +// with the ability to set a context for a request. +// +// Deprecated: use the operation call with context to pass the context instead of [PutIndustriesParams]. +func NewPutIndustriesParamsWithContext(ctx context.Context) *PutIndustriesParams { + return &PutIndustriesParams{ + inner: innerParams{ + ctx: ctx, + }, + } +} + +// NewPutIndustriesParamsWithHTTPClient creates a new PutIndustriesParams object +// with the ability to set a custom HTTPClient for a request. +func NewPutIndustriesParamsWithHTTPClient(client *http.Client) *PutIndustriesParams { + return &PutIndustriesParams{ + HTTPClient: client, + } +} + +/* +PutIndustriesParams contains all the parameters to send to the API endpoint + + for the put industries operation. + + Typically these are written to a http.Request. +*/ +type PutIndustriesParams struct { + + // IndustryRequest. + // + // An array of new Industry records + IndustryRequest *research_models.IndustryRequest + + HTTPClient *http.Client + + inner innerParams +} + +// WithDefaults hydrates default values in the put industries params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutIndustriesParams) WithDefaults() *PutIndustriesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the put industries params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutIndustriesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the put industries params. +func (o *PutIndustriesParams) WithTimeout(timeout time.Duration) *PutIndustriesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put industries params. +func (o *PutIndustriesParams) SetTimeout(timeout time.Duration) { + o.inner.timeout = timeout +} + +// WithContext adds the context to the put industries params. +// +// Deprecated: use the operation call with context to pass the context instead of [PutIndustriesParams]. +func (o *PutIndustriesParams) WithContext(ctx context.Context) *PutIndustriesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put industries params. +// +// Deprecated: use the operation call with context to pass the context instead of [PutIndustriesParams]. +func (o *PutIndustriesParams) SetContext(ctx context.Context) { + o.inner.ctx = ctx +} + +// WithHTTPClient adds the HTTPClient to the put industries params. +func (o *PutIndustriesParams) WithHTTPClient(client *http.Client) *PutIndustriesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put industries params. +func (o *PutIndustriesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIndustryRequest adds the industryRequest to the put industries params. +func (o *PutIndustriesParams) WithIndustryRequest(industryRequest *research_models.IndustryRequest) *PutIndustriesParams { + o.SetIndustryRequest(industryRequest) + return o +} + +// SetIndustryRequest adds the industryRequest to the put industries params. +func (o *PutIndustriesParams) SetIndustryRequest(industryRequest *research_models.IndustryRequest) { + o.IndustryRequest = industryRequest +} + +// WriteToRequest writes these params to a [runtime.ClientRequest]. +func (o *PutIndustriesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + if err := r.SetTimeout(o.inner.timeout); err != nil { + return err + } + var res []error + if o.IndustryRequest != nil { + if err := r.SetBodyParam(o.IndustryRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/research/research_client/industry/put_industries_responses.go b/api/research/research_client/industry/put_industries_responses.go new file mode 100644 index 0000000..be32cda --- /dev/null +++ b/api/research/research_client/industry/put_industries_responses.go @@ -0,0 +1,603 @@ +// 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 industry + +import ( + "encoding/json" + stderrors "errors" + "fmt" + "io" + + "code.tnxs.net/vernonkeenan/lib/api/research/research_models" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// PutIndustriesReader is a Reader for the PutIndustries structure. +type PutIndustriesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutIndustriesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { + switch response.Code() { + case 200: + result := NewPutIndustriesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutIndustriesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutIndustriesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutIndustriesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewPutIndustriesConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPutIndustriesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutIndustriesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[PUT /industries] putIndustries", response, response.Code()) + } +} + +// NewPutIndustriesOK creates a PutIndustriesOK with default headers values +func NewPutIndustriesOK() *PutIndustriesOK { + return &PutIndustriesOK{} +} + +// PutIndustriesOK describes a response with status code 200, with default header values. +// +// Response with Industry objects +type PutIndustriesOK struct { + Payload *research_models.IndustryResponse +} + +// IsSuccess returns true when this put industries o k response has a 2xx status code +func (o *PutIndustriesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this put industries o k response has a 3xx status code +func (o *PutIndustriesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this put industries o k response has a 4xx status code +func (o *PutIndustriesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this put industries o k response has a 5xx status code +func (o *PutIndustriesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this put industries o k response a status code equal to that given +func (o *PutIndustriesOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the put industries o k response +func (o *PutIndustriesOK) Code() int { + return 200 +} + +func (o *PutIndustriesOK) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /industries][%d] putIndustriesOK %s", 200, payload) +} + +func (o *PutIndustriesOK) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /industries][%d] putIndustriesOK %s", 200, payload) +} + +func (o *PutIndustriesOK) GetPayload() *research_models.IndustryResponse { + return o.Payload +} + +func (o *PutIndustriesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(research_models.IndustryResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewPutIndustriesUnauthorized creates a PutIndustriesUnauthorized with default headers values +func NewPutIndustriesUnauthorized() *PutIndustriesUnauthorized { + return &PutIndustriesUnauthorized{} +} + +// PutIndustriesUnauthorized describes a response with status code 401, with default header values. +// +// Access unauthorized, invalid API-KEY was used +type PutIndustriesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *research_models.Error +} + +// IsSuccess returns true when this put industries unauthorized response has a 2xx status code +func (o *PutIndustriesUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this put industries unauthorized response has a 3xx status code +func (o *PutIndustriesUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this put industries unauthorized response has a 4xx status code +func (o *PutIndustriesUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this put industries unauthorized response has a 5xx status code +func (o *PutIndustriesUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this put industries unauthorized response a status code equal to that given +func (o *PutIndustriesUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the put industries unauthorized response +func (o *PutIndustriesUnauthorized) Code() int { + return 401 +} + +func (o *PutIndustriesUnauthorized) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /industries][%d] putIndustriesUnauthorized %s", 401, payload) +} + +func (o *PutIndustriesUnauthorized) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /industries][%d] putIndustriesUnauthorized %s", 401, payload) +} + +func (o *PutIndustriesUnauthorized) GetPayload() *research_models.Error { + return o.Payload +} + +func (o *PutIndustriesUnauthorized) 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 && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewPutIndustriesForbidden creates a PutIndustriesForbidden with default headers values +func NewPutIndustriesForbidden() *PutIndustriesForbidden { + return &PutIndustriesForbidden{} +} + +// PutIndustriesForbidden describes a response with status code 403, with default header values. +// +// Access forbidden, account lacks access +type PutIndustriesForbidden struct { + AccessControlAllowOrigin string + + Payload *research_models.Error +} + +// IsSuccess returns true when this put industries forbidden response has a 2xx status code +func (o *PutIndustriesForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this put industries forbidden response has a 3xx status code +func (o *PutIndustriesForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this put industries forbidden response has a 4xx status code +func (o *PutIndustriesForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this put industries forbidden response has a 5xx status code +func (o *PutIndustriesForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this put industries forbidden response a status code equal to that given +func (o *PutIndustriesForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the put industries forbidden response +func (o *PutIndustriesForbidden) Code() int { + return 403 +} + +func (o *PutIndustriesForbidden) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /industries][%d] putIndustriesForbidden %s", 403, payload) +} + +func (o *PutIndustriesForbidden) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /industries][%d] putIndustriesForbidden %s", 403, payload) +} + +func (o *PutIndustriesForbidden) GetPayload() *research_models.Error { + return o.Payload +} + +func (o *PutIndustriesForbidden) 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 && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewPutIndustriesNotFound creates a PutIndustriesNotFound with default headers values +func NewPutIndustriesNotFound() *PutIndustriesNotFound { + return &PutIndustriesNotFound{} +} + +// PutIndustriesNotFound describes a response with status code 404, with default header values. +// +// Resource was not found +type PutIndustriesNotFound struct { + AccessControlAllowOrigin string + + Payload *research_models.Error +} + +// IsSuccess returns true when this put industries not found response has a 2xx status code +func (o *PutIndustriesNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this put industries not found response has a 3xx status code +func (o *PutIndustriesNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this put industries not found response has a 4xx status code +func (o *PutIndustriesNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this put industries not found response has a 5xx status code +func (o *PutIndustriesNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this put industries not found response a status code equal to that given +func (o *PutIndustriesNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the put industries not found response +func (o *PutIndustriesNotFound) Code() int { + return 404 +} + +func (o *PutIndustriesNotFound) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /industries][%d] putIndustriesNotFound %s", 404, payload) +} + +func (o *PutIndustriesNotFound) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /industries][%d] putIndustriesNotFound %s", 404, payload) +} + +func (o *PutIndustriesNotFound) GetPayload() *research_models.Error { + return o.Payload +} + +func (o *PutIndustriesNotFound) 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 && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewPutIndustriesConflict creates a PutIndustriesConflict with default headers values +func NewPutIndustriesConflict() *PutIndustriesConflict { + return &PutIndustriesConflict{} +} + +// PutIndustriesConflict describes a response with status code 409, with default header values. +// +// Conflict +type PutIndustriesConflict struct { + AccessControlAllowOrigin string + + Payload *research_models.Error +} + +// IsSuccess returns true when this put industries conflict response has a 2xx status code +func (o *PutIndustriesConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this put industries conflict response has a 3xx status code +func (o *PutIndustriesConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this put industries conflict response has a 4xx status code +func (o *PutIndustriesConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this put industries conflict response has a 5xx status code +func (o *PutIndustriesConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this put industries conflict response a status code equal to that given +func (o *PutIndustriesConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the put industries conflict response +func (o *PutIndustriesConflict) Code() int { + return 409 +} + +func (o *PutIndustriesConflict) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /industries][%d] putIndustriesConflict %s", 409, payload) +} + +func (o *PutIndustriesConflict) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /industries][%d] putIndustriesConflict %s", 409, payload) +} + +func (o *PutIndustriesConflict) GetPayload() *research_models.Error { + return o.Payload +} + +func (o *PutIndustriesConflict) 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 && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewPutIndustriesUnprocessableEntity creates a PutIndustriesUnprocessableEntity with default headers values +func NewPutIndustriesUnprocessableEntity() *PutIndustriesUnprocessableEntity { + return &PutIndustriesUnprocessableEntity{} +} + +// PutIndustriesUnprocessableEntity describes a response with status code 422, with default header values. +// +// Unprocessable Entity, likely a bad parameter +type PutIndustriesUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *research_models.Error +} + +// IsSuccess returns true when this put industries unprocessable entity response has a 2xx status code +func (o *PutIndustriesUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this put industries unprocessable entity response has a 3xx status code +func (o *PutIndustriesUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this put industries unprocessable entity response has a 4xx status code +func (o *PutIndustriesUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this put industries unprocessable entity response has a 5xx status code +func (o *PutIndustriesUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this put industries unprocessable entity response a status code equal to that given +func (o *PutIndustriesUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the put industries unprocessable entity response +func (o *PutIndustriesUnprocessableEntity) Code() int { + return 422 +} + +func (o *PutIndustriesUnprocessableEntity) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /industries][%d] putIndustriesUnprocessableEntity %s", 422, payload) +} + +func (o *PutIndustriesUnprocessableEntity) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /industries][%d] putIndustriesUnprocessableEntity %s", 422, payload) +} + +func (o *PutIndustriesUnprocessableEntity) GetPayload() *research_models.Error { + return o.Payload +} + +func (o *PutIndustriesUnprocessableEntity) 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 && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewPutIndustriesInternalServerError creates a PutIndustriesInternalServerError with default headers values +func NewPutIndustriesInternalServerError() *PutIndustriesInternalServerError { + return &PutIndustriesInternalServerError{} +} + +// PutIndustriesInternalServerError describes a response with status code 500, with default header values. +// +// Server Internal Error +type PutIndustriesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *research_models.Error +} + +// IsSuccess returns true when this put industries internal server error response has a 2xx status code +func (o *PutIndustriesInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this put industries internal server error response has a 3xx status code +func (o *PutIndustriesInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this put industries internal server error response has a 4xx status code +func (o *PutIndustriesInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this put industries internal server error response has a 5xx status code +func (o *PutIndustriesInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this put industries internal server error response a status code equal to that given +func (o *PutIndustriesInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the put industries internal server error response +func (o *PutIndustriesInternalServerError) Code() int { + return 500 +} + +func (o *PutIndustriesInternalServerError) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /industries][%d] putIndustriesInternalServerError %s", 500, payload) +} + +func (o *PutIndustriesInternalServerError) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /industries][%d] putIndustriesInternalServerError %s", 500, payload) +} + +func (o *PutIndustriesInternalServerError) GetPayload() *research_models.Error { + return o.Payload +} + +func (o *PutIndustriesInternalServerError) 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 && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} diff --git a/api/research/research_client/industry_companies/industry_companies_client.go b/api/research/research_client/industry_companies/industry_companies_client.go index 5269373..37313c0 100644 --- a/api/research/research_client/industry_companies/industry_companies_client.go +++ b/api/research/research_client/industry_companies/industry_companies_client.go @@ -72,10 +72,10 @@ type ClientService interface { // GetIndustryCompaniesContext get a list of industrycompanies. GetIndustryCompaniesContext(ctx context.Context, params *GetIndustryCompaniesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIndustryCompaniesOK, error) - // PostIndustryCompanies add a new industry company to salesforce devops net. + // PostIndustryCompanies add a tenant attributed industry company link. PostIndustryCompanies(params *PostIndustryCompaniesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostIndustryCompaniesOK, error) - // PostIndustryCompaniesContext add a new industry company to salesforce devops net. + // PostIndustryCompaniesContext add a tenant attributed industry company link. PostIndustryCompaniesContext(ctx context.Context, params *PostIndustryCompaniesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostIndustryCompaniesOK, error) SetTransport(transport runtime.ContextualTransport) @@ -83,7 +83,7 @@ type ClientService interface { // DeleteIndustryCompany deletes an industry company. // -// Delete IndustryCompany record. +// Reserved compatibility operation. Runtime removal remains disabled until a recoverable relationship-event or tombstone contract exists.. // // This method does not support injected context. // However, timeout and opentracing contexts are honored whenever enabled. @@ -102,7 +102,7 @@ func (a *Client) DeleteIndustryCompany(params *DeleteIndustryCompanyParams, auth // DeleteIndustryCompanyContext deletes an industry company. // -// Delete IndustryCompany record. +// Reserved compatibility operation. Runtime removal remains disabled until a recoverable relationship-event or tombstone contract exists.. // // Do not use the deprecated [DeleteIndustryCompanyParams.Context] with this method: it would be ignored. func (a *Client) DeleteIndustryCompanyContext(ctx context.Context, params *DeleteIndustryCompanyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteIndustryCompanyOK, error) { @@ -150,7 +150,7 @@ func (a *Client) DeleteIndustryCompanyContext(ctx context.Context, params *Delet // GetIndustryCompanies gets a list of industrycompanies. // -// Return a list of all available IndustryCompanies. +// Return IndustryCompany links attributed to the caller tenant through crm.account. Requires research:industry-company:read.. // // This method does not support injected context. // However, timeout and opentracing contexts are honored whenever enabled. @@ -169,7 +169,7 @@ func (a *Client) GetIndustryCompanies(params *GetIndustryCompaniesParams, authIn // GetIndustryCompaniesContext gets a list of industrycompanies. // -// Return a list of all available IndustryCompanies. +// Return IndustryCompany links attributed to the caller tenant through crm.account. Requires research:industry-company:read.. // // Do not use the deprecated [GetIndustryCompaniesParams.Context] with this method: it would be ignored. func (a *Client) GetIndustryCompaniesContext(ctx context.Context, params *GetIndustryCompaniesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIndustryCompaniesOK, error) { @@ -215,9 +215,9 @@ func (a *Client) GetIndustryCompaniesContext(ctx context.Context, params *GetInd panic(msg) } -// PostIndustryCompanies adds a new industry company to salesforce devops net. +// PostIndustryCompanies adds a tenant attributed industry company link. // -// IndustryCompany record to be added. +// Idempotently add exactly one IndustryCompany link attributed through the referenced CRM Account tenant. ID and audit fields are server-owned. Requires research:industry-company:create plus an active Owner or Manager session.. // // This method does not support injected context. // However, timeout and opentracing contexts are honored whenever enabled. @@ -234,9 +234,9 @@ func (a *Client) PostIndustryCompanies(params *PostIndustryCompaniesParams, auth return a.PostIndustryCompaniesContext(ctx, params, authInfo, opts...) } -// PostIndustryCompaniesContext adds a new industry company to salesforce devops net. +// PostIndustryCompaniesContext adds a tenant attributed industry company link. // -// IndustryCompany record to be added. +// Idempotently add exactly one IndustryCompany link attributed through the referenced CRM Account tenant. ID and audit fields are server-owned. Requires research:industry-company:create plus an active Owner or Manager session.. // // Do not use the deprecated [PostIndustryCompaniesParams.Context] with this method: it would be ignored. func (a *Client) PostIndustryCompaniesContext(ctx context.Context, params *PostIndustryCompaniesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostIndustryCompaniesOK, error) { diff --git a/api/research/research_client/industry_contract_test.go b/api/research/research_client/industry_contract_test.go new file mode 100644 index 0000000..76e157d --- /dev/null +++ b/api/research/research_client/industry_contract_test.go @@ -0,0 +1,269 @@ +package research_client_test + +import ( + "context" + "encoding/json" + "os" + "path/filepath" + "reflect" + "regexp" + "runtime" + "strings" + "testing" + + "code.tnxs.net/vernonkeenan/lib/api/research/research_client/industry" + "code.tnxs.net/vernonkeenan/lib/api/research/research_client/industry_companies" + "code.tnxs.net/vernonkeenan/lib/api/research/research_client/industry_products" + "code.tnxs.net/vernonkeenan/lib/api/research/research_client/industry_services" + "code.tnxs.net/vernonkeenan/lib/api/research/research_models" + openapiruntime "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +type captureTransport struct { + operation *openapiruntime.ClientOperation +} + +func (transport *captureTransport) Submit(operation *openapiruntime.ClientOperation) (any, error) { + return transport.SubmitContext(context.Background(), operation) +} + +func (transport *captureTransport) SubmitContext(_ context.Context, operation *openapiruntime.ClientOperation) (any, error) { + transport.operation = operation + + switch operation.ID { + case "getIndustries": + return industry.NewGetIndustriesOK(), nil + case "postIndustries": + return industry.NewPostIndustriesOK(), nil + case "putIndustries": + return industry.NewPutIndustriesOK(), nil + case "getIndustryCompanies": + return industry_companies.NewGetIndustryCompaniesOK(), nil + case "postIndustryCompanies": + return industry_companies.NewPostIndustryCompaniesOK(), nil + case "getIndustryProducts": + return industry_products.NewGetIndustryProductsOK(), nil + case "postIndustryProducts": + return industry_products.NewPostIndustryProductsOK(), nil + case "getIndustryServices": + return industry_services.NewGetIndustryServicesOK(), nil + case "postIndustryServices": + return industry_services.NewPostIndustryServicesOK(), nil + default: + panic("unexpected generated operation: " + operation.ID) + } +} + +func TestGeneratedIndustryOperationContract(t *testing.T) { + type operationCall func(openapiruntime.ContextualTransport) error + + tests := []struct { + name string + wantID string + wantMethod string + wantPath string + call operationCall + }{ + { + name: "list industries", + wantID: "getIndustries", + wantMethod: "GET", + wantPath: "/industries", + call: func(transport openapiruntime.ContextualTransport) error { + _, err := industry.New(transport, strfmt.Default).GetIndustries(industry.NewGetIndustriesParams(), nil) + return err + }, + }, + { + name: "create industry", + wantID: "postIndustries", + wantMethod: "POST", + wantPath: "/industries", + call: func(transport openapiruntime.ContextualTransport) error { + _, err := industry.New(transport, strfmt.Default).PostIndustries(industry.NewPostIndustriesParams(), nil) + return err + }, + }, + { + name: "update industry", + wantID: "putIndustries", + wantMethod: "PUT", + wantPath: "/industries", + call: func(transport openapiruntime.ContextualTransport) error { + _, err := industry.New(transport, strfmt.Default).PutIndustries(industry.NewPutIndustriesParams(), nil) + return err + }, + }, + { + name: "list industry companies", + wantID: "getIndustryCompanies", + wantMethod: "GET", + wantPath: "/industrycompanies", + call: func(transport openapiruntime.ContextualTransport) error { + _, err := industry_companies.New(transport, strfmt.Default).GetIndustryCompanies(industry_companies.NewGetIndustryCompaniesParams(), nil) + return err + }, + }, + { + name: "create industry company", + wantID: "postIndustryCompanies", + wantMethod: "POST", + wantPath: "/industrycompanies", + call: func(transport openapiruntime.ContextualTransport) error { + _, err := industry_companies.New(transport, strfmt.Default).PostIndustryCompanies(industry_companies.NewPostIndustryCompaniesParams(), nil) + return err + }, + }, + { + name: "list industry products", + wantID: "getIndustryProducts", + wantMethod: "GET", + wantPath: "/industryproducts", + call: func(transport openapiruntime.ContextualTransport) error { + _, err := industry_products.New(transport, strfmt.Default).GetIndustryProducts(industry_products.NewGetIndustryProductsParams(), nil) + return err + }, + }, + { + name: "create industry product", + wantID: "postIndustryProducts", + wantMethod: "POST", + wantPath: "/industryproducts", + call: func(transport openapiruntime.ContextualTransport) error { + _, err := industry_products.New(transport, strfmt.Default).PostIndustryProducts(industry_products.NewPostIndustryProductsParams(), nil) + return err + }, + }, + { + name: "list industry services", + wantID: "getIndustryServices", + wantMethod: "GET", + wantPath: "/industryservices", + call: func(transport openapiruntime.ContextualTransport) error { + _, err := industry_services.New(transport, strfmt.Default).GetIndustryServices(industry_services.NewGetIndustryServicesParams(), nil) + return err + }, + }, + { + name: "create industry service", + wantID: "postIndustryServices", + wantMethod: "POST", + wantPath: "/industryservices", + call: func(transport openapiruntime.ContextualTransport) error { + _, err := industry_services.New(transport, strfmt.Default).PostIndustryServices(industry_services.NewPostIndustryServicesParams(), nil) + return err + }, + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + transport := &captureTransport{} + if err := test.call(transport); err != nil { + t.Fatalf("generated client operation failed: %v", err) + } + if transport.operation == nil { + t.Fatal("generated client did not submit an operation") + } + if transport.operation.ID != test.wantID { + t.Errorf("operation ID = %q, want %q", transport.operation.ID, test.wantID) + } + if transport.operation.Method != test.wantMethod { + t.Errorf("method = %q, want %q", transport.operation.Method, test.wantMethod) + } + if transport.operation.PathPattern != test.wantPath { + t.Errorf("path = %q, want %q", transport.operation.PathPattern, test.wantPath) + } + }) + } +} + +func TestIndustryServiceDoesNotInventHTML(t *testing.T) { + serviceType := reflect.TypeOf(research_models.IndustryService{}) + if _, exists := serviceType.FieldByName("HTML"); exists { + t.Fatal("IndustryService must not grow an HTML field absent from the authoritative contract") + } + + productType := reflect.TypeOf(research_models.IndustryProduct{}) + if _, exists := productType.FieldByName("HTML"); !exists { + t.Fatal("IndustryProduct must retain its authoritative HTML field") + } + + payload, err := json.Marshal(research_models.IndustryService{ID: "industry-service-id"}) + if err != nil { + t.Fatalf("marshal IndustryService: %v", err) + } + if strings.Contains(string(payload), "HTML") { + t.Fatalf("IndustryService JSON invented an HTML field: %s", payload) + } +} + +func TestIndustryJunctionContractDoesNotInventUpdateOperations(t *testing.T) { + interfaces := []struct { + name string + typ reflect.Type + }{ + {name: "IndustryCompany", typ: reflect.TypeOf((*industry_companies.ClientService)(nil)).Elem()}, + {name: "IndustryProduct", typ: reflect.TypeOf((*industry_products.ClientService)(nil)).Elem()}, + {name: "IndustryService", typ: reflect.TypeOf((*industry_services.ClientService)(nil)).Elem()}, + } + + for _, contract := range interfaces { + for _, suffix := range []string{"", "Context"} { + method := "Put" + contract.name + suffix + if _, exists := contract.typ.MethodByName(method); exists { + t.Errorf("%s client invented unsupported operation %s", contract.name, method) + } + } + } +} + +func TestGeneratedIndustrySurfaceHasNoSalesforceOrEmbeddedSecrets(t *testing.T) { + _, testFile, _, ok := runtime.Caller(0) + if !ok { + t.Fatal("resolve test source path") + } + clientRoot := filepath.Dir(testFile) + modelRoot := filepath.Join(clientRoot, "..", "research_models") + targets := []string{ + filepath.Join(clientRoot, "industry"), + filepath.Join(clientRoot, "industry_companies"), + filepath.Join(clientRoot, "industry_products"), + filepath.Join(clientRoot, "industry_services"), + filepath.Join(modelRoot, "industry.go"), + filepath.Join(modelRoot, "industry_company.go"), + filepath.Join(modelRoot, "industry_product.go"), + filepath.Join(modelRoot, "industry_service.go"), + } + credentialLiteral := regexp.MustCompile(`(?i)(api[_-]?key|password|secret)\s*[:=]\s*["'][^"']+["']`) + + for _, target := range targets { + err := filepath.WalkDir(target, func(path string, entry os.DirEntry, walkErr error) error { + if walkErr != nil { + return walkErr + } + if entry.IsDir() || !strings.HasSuffix(path, ".go") || strings.HasSuffix(path, "_test.go") { + return nil + } + + content, err := os.ReadFile(path) + if err != nil { + return err + } + lower := strings.ToLower(string(content)) + for _, forbidden := range []string{"salesforce", "sf-gate", "go-force", "private key-----"} { + if strings.Contains(lower, forbidden) { + t.Errorf("%s contains forbidden boundary %q", path, forbidden) + } + } + if credentialLiteral.Match(content) { + t.Errorf("%s contains a credential-shaped literal", path) + } + return nil + }) + if err != nil { + t.Fatalf("scan generated contract target %s: %v", target, err) + } + } +} diff --git a/api/research/research_client/industry_products/industry_products_client.go b/api/research/research_client/industry_products/industry_products_client.go index 656e8c5..3914f4f 100644 --- a/api/research/research_client/industry_products/industry_products_client.go +++ b/api/research/research_client/industry_products/industry_products_client.go @@ -72,10 +72,10 @@ type ClientService interface { // GetIndustryProductsContext get a list of industry products. GetIndustryProductsContext(ctx context.Context, params *GetIndustryProductsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIndustryProductsOK, error) - // PostIndustryProducts add a new industry product to salesforce devops net. + // PostIndustryProducts add a tenant attributed industry product link. PostIndustryProducts(params *PostIndustryProductsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostIndustryProductsOK, error) - // PostIndustryProductsContext add a new industry product to salesforce devops net. + // PostIndustryProductsContext add a tenant attributed industry product link. PostIndustryProductsContext(ctx context.Context, params *PostIndustryProductsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostIndustryProductsOK, error) SetTransport(transport runtime.ContextualTransport) @@ -83,7 +83,7 @@ type ClientService interface { // DeleteIndustryProduct deletes an industry product. // -// Delete IndustryProduct record. +// Reserved compatibility operation. Runtime removal remains disabled until a recoverable relationship-event or tombstone contract exists.. // // This method does not support injected context. // However, timeout and opentracing contexts are honored whenever enabled. @@ -102,7 +102,7 @@ func (a *Client) DeleteIndustryProduct(params *DeleteIndustryProductParams, auth // DeleteIndustryProductContext deletes an industry product. // -// Delete IndustryProduct record. +// Reserved compatibility operation. Runtime removal remains disabled until a recoverable relationship-event or tombstone contract exists.. // // Do not use the deprecated [DeleteIndustryProductParams.Context] with this method: it would be ignored. func (a *Client) DeleteIndustryProductContext(ctx context.Context, params *DeleteIndustryProductParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteIndustryProductOK, error) { @@ -150,7 +150,7 @@ func (a *Client) DeleteIndustryProductContext(ctx context.Context, params *Delet // GetIndustryProducts gets a list of industry products. // -// Return a list of all available IndustryProducts. +// Return IndustryProduct links attributed to the caller tenant through CompanyProduct and crm.account. Requires research:industry-product:read.. // // This method does not support injected context. // However, timeout and opentracing contexts are honored whenever enabled. @@ -169,7 +169,7 @@ func (a *Client) GetIndustryProducts(params *GetIndustryProductsParams, authInfo // GetIndustryProductsContext gets a list of industry products. // -// Return a list of all available IndustryProducts. +// Return IndustryProduct links attributed to the caller tenant through CompanyProduct and crm.account. Requires research:industry-product:read.. // // Do not use the deprecated [GetIndustryProductsParams.Context] with this method: it would be ignored. func (a *Client) GetIndustryProductsContext(ctx context.Context, params *GetIndustryProductsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIndustryProductsOK, error) { @@ -215,9 +215,9 @@ func (a *Client) GetIndustryProductsContext(ctx context.Context, params *GetIndu panic(msg) } -// PostIndustryProducts adds a new industry product to salesforce devops net. +// PostIndustryProducts adds a tenant attributed industry product link. // -// IndustryProduct record to be added. +// Idempotently add exactly one tenant-attributed IndustryProduct link. ID and audit fields are server-owned. Requires research:industry-product:create plus an active Owner or Manager session.. // // This method does not support injected context. // However, timeout and opentracing contexts are honored whenever enabled. @@ -234,9 +234,9 @@ func (a *Client) PostIndustryProducts(params *PostIndustryProductsParams, authIn return a.PostIndustryProductsContext(ctx, params, authInfo, opts...) } -// PostIndustryProductsContext adds a new industry product to salesforce devops net. +// PostIndustryProductsContext adds a tenant attributed industry product link. // -// IndustryProduct record to be added. +// Idempotently add exactly one tenant-attributed IndustryProduct link. ID and audit fields are server-owned. Requires research:industry-product:create plus an active Owner or Manager session.. // // Do not use the deprecated [PostIndustryProductsParams.Context] with this method: it would be ignored. func (a *Client) PostIndustryProductsContext(ctx context.Context, params *PostIndustryProductsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostIndustryProductsOK, error) { diff --git a/api/research/research_client/industry_services/industry_services_client.go b/api/research/research_client/industry_services/industry_services_client.go index 641c459..0fae985 100644 --- a/api/research/research_client/industry_services/industry_services_client.go +++ b/api/research/research_client/industry_services/industry_services_client.go @@ -72,10 +72,10 @@ type ClientService interface { // GetIndustryServicesContext get a list of industryservices. GetIndustryServicesContext(ctx context.Context, params *GetIndustryServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIndustryServicesOK, error) - // PostIndustryServices add a new industry service to salesforce devops net. + // PostIndustryServices add a tenant attributed industry service link. PostIndustryServices(params *PostIndustryServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostIndustryServicesOK, error) - // PostIndustryServicesContext add a new industry service to salesforce devops net. + // PostIndustryServicesContext add a tenant attributed industry service link. PostIndustryServicesContext(ctx context.Context, params *PostIndustryServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostIndustryServicesOK, error) SetTransport(transport runtime.ContextualTransport) @@ -83,7 +83,7 @@ type ClientService interface { // DeleteIndustryService deletes an industry service. // -// Delete IndustryService record. +// Reserved compatibility operation. Runtime removal remains disabled until a recoverable relationship-event or tombstone contract exists.. // // This method does not support injected context. // However, timeout and opentracing contexts are honored whenever enabled. @@ -102,7 +102,7 @@ func (a *Client) DeleteIndustryService(params *DeleteIndustryServiceParams, auth // DeleteIndustryServiceContext deletes an industry service. // -// Delete IndustryService record. +// Reserved compatibility operation. Runtime removal remains disabled until a recoverable relationship-event or tombstone contract exists.. // // Do not use the deprecated [DeleteIndustryServiceParams.Context] with this method: it would be ignored. func (a *Client) DeleteIndustryServiceContext(ctx context.Context, params *DeleteIndustryServiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteIndustryServiceOK, error) { @@ -150,7 +150,7 @@ func (a *Client) DeleteIndustryServiceContext(ctx context.Context, params *Delet // GetIndustryServices gets a list of industryservices. // -// Return a list of all available IndustryServices. +// Return IndustryService links attributed to the caller tenant through CompanyService and crm.account. Requires research:industry-service:read.. // // This method does not support injected context. // However, timeout and opentracing contexts are honored whenever enabled. @@ -169,7 +169,7 @@ func (a *Client) GetIndustryServices(params *GetIndustryServicesParams, authInfo // GetIndustryServicesContext gets a list of industryservices. // -// Return a list of all available IndustryServices. +// Return IndustryService links attributed to the caller tenant through CompanyService and crm.account. Requires research:industry-service:read.. // // Do not use the deprecated [GetIndustryServicesParams.Context] with this method: it would be ignored. func (a *Client) GetIndustryServicesContext(ctx context.Context, params *GetIndustryServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIndustryServicesOK, error) { @@ -215,9 +215,9 @@ func (a *Client) GetIndustryServicesContext(ctx context.Context, params *GetIndu panic(msg) } -// PostIndustryServices adds a new industry service to salesforce devops net. +// PostIndustryServices adds a tenant attributed industry service link. // -// IndustryService record to be added. +// Idempotently add exactly one tenant-attributed IndustryService link. ID and audit fields are server-owned. Requires research:industry-service:create plus an active Owner or Manager session.. // // This method does not support injected context. // However, timeout and opentracing contexts are honored whenever enabled. @@ -234,9 +234,9 @@ func (a *Client) PostIndustryServices(params *PostIndustryServicesParams, authIn return a.PostIndustryServicesContext(ctx, params, authInfo, opts...) } -// PostIndustryServicesContext adds a new industry service to salesforce devops net. +// PostIndustryServicesContext adds a tenant attributed industry service link. // -// IndustryService record to be added. +// Idempotently add exactly one tenant-attributed IndustryService link. ID and audit fields are server-owned. Requires research:industry-service:create plus an active Owner or Manager session.. // // Do not use the deprecated [PostIndustryServicesParams.Context] with this method: it would be ignored. func (a *Client) PostIndustryServicesContext(ctx context.Context, params *PostIndustryServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostIndustryServicesOK, error) { diff --git a/api/research/research_client/research_client.go b/api/research/research_client/research_client.go index 5a25856..f8bb6cf 100644 --- a/api/research/research_client/research_client.go +++ b/api/research/research_client/research_client.go @@ -10,6 +10,7 @@ import ( "maps" "code.tnxs.net/vernonkeenan/lib/api/research/research_client/company_categories" + "code.tnxs.net/vernonkeenan/lib/api/research/research_client/company_product_proposals" "code.tnxs.net/vernonkeenan/lib/api/research/research_client/company_products" "code.tnxs.net/vernonkeenan/lib/api/research/research_client/company_services" "code.tnxs.net/vernonkeenan/lib/api/research/research_client/factors" @@ -69,6 +70,7 @@ func New(transport runtime.ContextualTransport, formats strfmt.Registry) *Resear cli := new(Research) cli.Transport = transport cli.CompanyCategories = company_categories.New(transport, formats) + cli.CompanyProductProposals = company_product_proposals.New(transport, formats) cli.CompanyProducts = company_products.New(transport, formats) cli.CompanyServices = company_services.New(transport, formats) cli.Factors = factors.New(transport, formats) @@ -140,6 +142,8 @@ func (cfg *TransportConfig) WithConsumers(consumers map[string]runtime.Consumer) type Research struct { CompanyCategories company_categories.ClientService + CompanyProductProposals company_product_proposals.ClientService + CompanyProducts company_products.ClientService CompanyServices company_services.ClientService @@ -167,6 +171,7 @@ type Research struct { func (c *Research) SetTransport(transport runtime.ContextualTransport) { c.Transport = transport c.CompanyCategories.SetTransport(transport) + c.CompanyProductProposals.SetTransport(transport) c.CompanyProducts.SetTransport(transport) c.CompanyServices.SetTransport(transport) c.Factors.SetTransport(transport) diff --git a/api/research/research_models/company_product_proposal.go b/api/research/research_models/company_product_proposal.go new file mode 100644 index 0000000..0a482b4 --- /dev/null +++ b/api/research/research_models/company_product_proposal.go @@ -0,0 +1,497 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package research_models + +import ( + "context" + "encoding/json" + stderrors "errors" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" + "github.com/go-openapi/validate" +) + +// CompanyProductProposal Server-owned draft proposal; it does not imply approval or authoritative publication +// +// swagger:model CompanyProductProposal +type CompanyProductProposal struct { + + // base version + // Required: true + // Format: date-time + BaseVersion *strfmt.DateTime `json:"BaseVersion"` + + // client principal key + // Required: true + ClientPrincipalKey *string `json:"ClientPrincipalKey"` + + // company product ID + // Required: true + // Format: uuid + CompanyProductID *strfmt.UUID `json:"CompanyProductID"` + + // company product name + CompanyProductName *string `json:"CompanyProductName,omitempty"` + + // created date + // Required: true + // Format: date-time + CreatedDate *strfmt.DateTime `json:"CreatedDate"` + + // fields + // Required: true + Fields []*CompanyProductProposalField `json:"Fields"` + + // ID + // Required: true + // Format: uuid + ID *strfmt.UUID `json:"ID"` + + // last modified date + // Required: true + // Format: date-time + LastModifiedDate *strfmt.DateTime `json:"LastModifiedDate"` + + // operation + // Required: true + // Enum: ["update"] + Operation *string `json:"Operation"` + + // proposed by ID + // Required: true + // Format: uuid + ProposedByID *strfmt.UUID `json:"ProposedByID"` + + // review reason + // Max Length: 1000 + ReviewReason *string `json:"ReviewReason,omitempty"` + + // reviewed at + // Format: date-time + ReviewedAt *strfmt.DateTime `json:"ReviewedAt,omitempty"` + + // reviewed by ID + // Format: uuid + ReviewedByID *strfmt.UUID `json:"ReviewedByID,omitempty"` + + // status + // Required: true + // Enum: ["draft","submitted","approved","rejected"] + Status *string `json:"Status"` + + // submitted at + // Format: date-time + SubmittedAt *strfmt.DateTime `json:"SubmittedAt,omitempty"` + + // tenant ID + // Required: true + // Format: uuid + TenantID *strfmt.UUID `json:"TenantID"` +} + +// Validate validates this company product proposal +func (m *CompanyProductProposal) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBaseVersion(formats); err != nil { + res = append(res, err) + } + + if err := m.validateClientPrincipalKey(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCompanyProductID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFields(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastModifiedDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOperation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateProposedByID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReviewReason(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReviewedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReviewedByID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubmittedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTenantID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CompanyProductProposal) validateBaseVersion(formats strfmt.Registry) error { + + if err := validate.Required("BaseVersion", "body", m.BaseVersion); err != nil { + return err + } + + if err := validate.FormatOf("BaseVersion", "body", "date-time", m.BaseVersion.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CompanyProductProposal) validateClientPrincipalKey(formats strfmt.Registry) error { + + if err := validate.Required("ClientPrincipalKey", "body", m.ClientPrincipalKey); err != nil { + return err + } + + return nil +} + +func (m *CompanyProductProposal) validateCompanyProductID(formats strfmt.Registry) error { + + if err := validate.Required("CompanyProductID", "body", m.CompanyProductID); err != nil { + return err + } + + if err := validate.FormatOf("CompanyProductID", "body", "uuid", m.CompanyProductID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CompanyProductProposal) validateCreatedDate(formats strfmt.Registry) error { + + if err := validate.Required("CreatedDate", "body", m.CreatedDate); err != nil { + return err + } + + if err := validate.FormatOf("CreatedDate", "body", "date-time", m.CreatedDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CompanyProductProposal) validateFields(formats strfmt.Registry) error { + + if err := validate.Required("Fields", "body", m.Fields); err != nil { + return err + } + + for i := 0; i < len(m.Fields); i++ { + if typeutils.IsZero(m.Fields[i]) { // not required + continue + } + + if m.Fields[i] != nil { + if err := m.Fields[i].Validate(formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("Fields" + "." + strconv.Itoa(i)) + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("Fields" + "." + strconv.Itoa(i)) + } + + return err + } + } + + } + + return nil +} + +func (m *CompanyProductProposal) validateID(formats strfmt.Registry) error { + + if err := validate.Required("ID", "body", m.ID); err != nil { + return err + } + + if err := validate.FormatOf("ID", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CompanyProductProposal) validateLastModifiedDate(formats strfmt.Registry) error { + + if err := validate.Required("LastModifiedDate", "body", m.LastModifiedDate); err != nil { + return err + } + + if err := validate.FormatOf("LastModifiedDate", "body", "date-time", m.LastModifiedDate.String(), formats); err != nil { + return err + } + + return nil +} + +var companyProductProposalTypeOperationPropEnum []any + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["update"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + companyProductProposalTypeOperationPropEnum = append(companyProductProposalTypeOperationPropEnum, v) + } +} + +const ( + + // CompanyProductProposalOperationUpdate captures enum value "update" + CompanyProductProposalOperationUpdate string = "update" +) + +// prop value enum +func (m *CompanyProductProposal) validateOperationEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, companyProductProposalTypeOperationPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *CompanyProductProposal) validateOperation(formats strfmt.Registry) error { + + if err := validate.Required("Operation", "body", m.Operation); err != nil { + return err + } + + // value enum + if err := m.validateOperationEnum("Operation", "body", *m.Operation); err != nil { + return err + } + + return nil +} + +func (m *CompanyProductProposal) validateProposedByID(formats strfmt.Registry) error { + + if err := validate.Required("ProposedByID", "body", m.ProposedByID); err != nil { + return err + } + + if err := validate.FormatOf("ProposedByID", "body", "uuid", m.ProposedByID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CompanyProductProposal) validateReviewReason(formats strfmt.Registry) error { + if typeutils.IsZero(m.ReviewReason) { // not required + return nil + } + + if err := validate.MaxLength("ReviewReason", "body", *m.ReviewReason, 1000); err != nil { + return err + } + + return nil +} + +func (m *CompanyProductProposal) validateReviewedAt(formats strfmt.Registry) error { + if typeutils.IsZero(m.ReviewedAt) { // not required + return nil + } + + if err := validate.FormatOf("ReviewedAt", "body", "date-time", m.ReviewedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CompanyProductProposal) validateReviewedByID(formats strfmt.Registry) error { + if typeutils.IsZero(m.ReviewedByID) { // not required + return nil + } + + if err := validate.FormatOf("ReviewedByID", "body", "uuid", m.ReviewedByID.String(), formats); err != nil { + return err + } + + return nil +} + +var companyProductProposalTypeStatusPropEnum []any + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["draft","submitted","approved","rejected"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + companyProductProposalTypeStatusPropEnum = append(companyProductProposalTypeStatusPropEnum, v) + } +} + +const ( + + // CompanyProductProposalStatusDraft captures enum value "draft" + CompanyProductProposalStatusDraft string = "draft" + + // CompanyProductProposalStatusSubmitted captures enum value "submitted" + CompanyProductProposalStatusSubmitted string = "submitted" + + // CompanyProductProposalStatusApproved captures enum value "approved" + CompanyProductProposalStatusApproved string = "approved" + + // CompanyProductProposalStatusRejected captures enum value "rejected" + CompanyProductProposalStatusRejected string = "rejected" +) + +// prop value enum +func (m *CompanyProductProposal) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, companyProductProposalTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *CompanyProductProposal) validateStatus(formats strfmt.Registry) error { + + if err := validate.Required("Status", "body", m.Status); err != nil { + return err + } + + // value enum + if err := m.validateStatusEnum("Status", "body", *m.Status); err != nil { + return err + } + + return nil +} + +func (m *CompanyProductProposal) validateSubmittedAt(formats strfmt.Registry) error { + if typeutils.IsZero(m.SubmittedAt) { // not required + return nil + } + + if err := validate.FormatOf("SubmittedAt", "body", "date-time", m.SubmittedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CompanyProductProposal) validateTenantID(formats strfmt.Registry) error { + + if err := validate.Required("TenantID", "body", m.TenantID); err != nil { + return err + } + + if err := validate.FormatOf("TenantID", "body", "uuid", m.TenantID.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this company product proposal based on the context it is used +func (m *CompanyProductProposal) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateFields(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CompanyProductProposal) contextValidateFields(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Fields); i++ { + + if m.Fields[i] != nil { + + if typeutils.IsZero(m.Fields[i]) { // not required + return nil + } + + if err := m.Fields[i].ContextValidate(ctx, formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("Fields" + "." + strconv.Itoa(i)) + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("Fields" + "." + strconv.Itoa(i)) + } + + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CompanyProductProposal) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return jsonutils.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CompanyProductProposal) UnmarshalBinary(b []byte) error { + var res CompanyProductProposal + if err := jsonutils.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/research/research_models/company_product_proposal_field.go b/api/research/research_models/company_product_proposal_field.go new file mode 100644 index 0000000..83a41f1 --- /dev/null +++ b/api/research/research_models/company_product_proposal_field.go @@ -0,0 +1,271 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package research_models + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" + "github.com/go-openapi/validate" +) + +// CompanyProductProposalField One governed CompanyProduct field change +// +// swagger:model CompanyProductProposalField +type CompanyProductProposalField struct { + + // Current authoritative value captured when the proposal was created + CurrentValue *string `json:"CurrentValue,omitempty"` + + // decided at + // Format: date-time + DecidedAt *strfmt.DateTime `json:"DecidedAt,omitempty"` + + // decided by ID + // Format: uuid + DecidedByID *strfmt.UUID `json:"DecidedByID,omitempty"` + + // decision + // Enum: ["pending","accepted","rejected"] + Decision string `json:"Decision,omitempty"` + + // decision reason + // Max Length: 1000 + DecisionReason *string `json:"DecisionReason,omitempty"` + + // field name + // Required: true + // Enum: ["description","enrichmentstatus","fulldescription","imagealttext","imageurl","logo","name","slug","tagline","url"] + FieldName *string `json:"FieldName"` + + // Proposed JSON value. The server captures the current value. + // Required: true + // Max Length: 20000 + ProposedValue *string `json:"ProposedValue"` +} + +// Validate validates this company product proposal field +func (m *CompanyProductProposalField) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDecidedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDecidedByID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDecision(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDecisionReason(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFieldName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateProposedValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CompanyProductProposalField) validateDecidedAt(formats strfmt.Registry) error { + if typeutils.IsZero(m.DecidedAt) { // not required + return nil + } + + if err := validate.FormatOf("DecidedAt", "body", "date-time", m.DecidedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CompanyProductProposalField) validateDecidedByID(formats strfmt.Registry) error { + if typeutils.IsZero(m.DecidedByID) { // not required + return nil + } + + if err := validate.FormatOf("DecidedByID", "body", "uuid", m.DecidedByID.String(), formats); err != nil { + return err + } + + return nil +} + +var companyProductProposalFieldTypeDecisionPropEnum []any + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["pending","accepted","rejected"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + companyProductProposalFieldTypeDecisionPropEnum = append(companyProductProposalFieldTypeDecisionPropEnum, v) + } +} + +const ( + + // CompanyProductProposalFieldDecisionPending captures enum value "pending" + CompanyProductProposalFieldDecisionPending string = "pending" + + // CompanyProductProposalFieldDecisionAccepted captures enum value "accepted" + CompanyProductProposalFieldDecisionAccepted string = "accepted" + + // CompanyProductProposalFieldDecisionRejected captures enum value "rejected" + CompanyProductProposalFieldDecisionRejected string = "rejected" +) + +// prop value enum +func (m *CompanyProductProposalField) validateDecisionEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, companyProductProposalFieldTypeDecisionPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *CompanyProductProposalField) validateDecision(formats strfmt.Registry) error { + if typeutils.IsZero(m.Decision) { // not required + return nil + } + + // value enum + if err := m.validateDecisionEnum("Decision", "body", m.Decision); err != nil { + return err + } + + return nil +} + +func (m *CompanyProductProposalField) validateDecisionReason(formats strfmt.Registry) error { + if typeutils.IsZero(m.DecisionReason) { // not required + return nil + } + + if err := validate.MaxLength("DecisionReason", "body", *m.DecisionReason, 1000); err != nil { + return err + } + + return nil +} + +var companyProductProposalFieldTypeFieldNamePropEnum []any + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["description","enrichmentstatus","fulldescription","imagealttext","imageurl","logo","name","slug","tagline","url"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + companyProductProposalFieldTypeFieldNamePropEnum = append(companyProductProposalFieldTypeFieldNamePropEnum, v) + } +} + +const ( + + // CompanyProductProposalFieldFieldNameDescription captures enum value "description" + CompanyProductProposalFieldFieldNameDescription string = "description" + + // CompanyProductProposalFieldFieldNameEnrichmentstatus captures enum value "enrichmentstatus" + CompanyProductProposalFieldFieldNameEnrichmentstatus string = "enrichmentstatus" + + // CompanyProductProposalFieldFieldNameFulldescription captures enum value "fulldescription" + CompanyProductProposalFieldFieldNameFulldescription string = "fulldescription" + + // CompanyProductProposalFieldFieldNameImagealttext captures enum value "imagealttext" + CompanyProductProposalFieldFieldNameImagealttext string = "imagealttext" + + // CompanyProductProposalFieldFieldNameImageurl captures enum value "imageurl" + CompanyProductProposalFieldFieldNameImageurl string = "imageurl" + + // CompanyProductProposalFieldFieldNameLogo captures enum value "logo" + CompanyProductProposalFieldFieldNameLogo string = "logo" + + // CompanyProductProposalFieldFieldNameName captures enum value "name" + CompanyProductProposalFieldFieldNameName string = "name" + + // CompanyProductProposalFieldFieldNameSlug captures enum value "slug" + CompanyProductProposalFieldFieldNameSlug string = "slug" + + // CompanyProductProposalFieldFieldNameTagline captures enum value "tagline" + CompanyProductProposalFieldFieldNameTagline string = "tagline" + + // CompanyProductProposalFieldFieldNameURL captures enum value "url" + CompanyProductProposalFieldFieldNameURL string = "url" +) + +// prop value enum +func (m *CompanyProductProposalField) validateFieldNameEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, companyProductProposalFieldTypeFieldNamePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *CompanyProductProposalField) validateFieldName(formats strfmt.Registry) error { + + if err := validate.Required("FieldName", "body", m.FieldName); err != nil { + return err + } + + // value enum + if err := m.validateFieldNameEnum("FieldName", "body", *m.FieldName); err != nil { + return err + } + + return nil +} + +func (m *CompanyProductProposalField) validateProposedValue(formats strfmt.Registry) error { + + if err := validate.Required("ProposedValue", "body", m.ProposedValue); err != nil { + return err + } + + if err := validate.MaxLength("ProposedValue", "body", *m.ProposedValue, 20000); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this company product proposal field based on context it is used +func (m *CompanyProductProposalField) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CompanyProductProposalField) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return jsonutils.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CompanyProductProposalField) UnmarshalBinary(b []byte) error { + var res CompanyProductProposalField + if err := jsonutils.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/research/research_models/company_product_proposal_field_decision.go b/api/research/research_models/company_product_proposal_field_decision.go new file mode 100644 index 0000000..f5bad37 --- /dev/null +++ b/api/research/research_models/company_product_proposal_field_decision.go @@ -0,0 +1,205 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package research_models + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" + "github.com/go-openapi/validate" +) + +// CompanyProductProposalFieldDecision One complete reviewer decision for a proposed field +// +// swagger:model CompanyProductProposalFieldDecision +type CompanyProductProposalFieldDecision struct { + + // decision + // Required: true + // Enum: ["accepted","rejected"] + Decision *string `json:"Decision"` + + // decision reason + // Max Length: 1000 + DecisionReason string `json:"DecisionReason,omitempty"` + + // field name + // Required: true + // Enum: ["description","enrichmentstatus","fulldescription","imagealttext","imageurl","logo","name","slug","tagline","url"] + FieldName *string `json:"FieldName"` +} + +// Validate validates this company product proposal field decision +func (m *CompanyProductProposalFieldDecision) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDecision(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDecisionReason(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFieldName(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var companyProductProposalFieldDecisionTypeDecisionPropEnum []any + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["accepted","rejected"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + companyProductProposalFieldDecisionTypeDecisionPropEnum = append(companyProductProposalFieldDecisionTypeDecisionPropEnum, v) + } +} + +const ( + + // CompanyProductProposalFieldDecisionDecisionAccepted captures enum value "accepted" + CompanyProductProposalFieldDecisionDecisionAccepted string = "accepted" + + // CompanyProductProposalFieldDecisionDecisionRejected captures enum value "rejected" + CompanyProductProposalFieldDecisionDecisionRejected string = "rejected" +) + +// prop value enum +func (m *CompanyProductProposalFieldDecision) validateDecisionEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, companyProductProposalFieldDecisionTypeDecisionPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *CompanyProductProposalFieldDecision) validateDecision(formats strfmt.Registry) error { + + if err := validate.Required("Decision", "body", m.Decision); err != nil { + return err + } + + // value enum + if err := m.validateDecisionEnum("Decision", "body", *m.Decision); err != nil { + return err + } + + return nil +} + +func (m *CompanyProductProposalFieldDecision) validateDecisionReason(formats strfmt.Registry) error { + if typeutils.IsZero(m.DecisionReason) { // not required + return nil + } + + if err := validate.MaxLength("DecisionReason", "body", m.DecisionReason, 1000); err != nil { + return err + } + + return nil +} + +var companyProductProposalFieldDecisionTypeFieldNamePropEnum []any + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["description","enrichmentstatus","fulldescription","imagealttext","imageurl","logo","name","slug","tagline","url"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + companyProductProposalFieldDecisionTypeFieldNamePropEnum = append(companyProductProposalFieldDecisionTypeFieldNamePropEnum, v) + } +} + +const ( + + // CompanyProductProposalFieldDecisionFieldNameDescription captures enum value "description" + CompanyProductProposalFieldDecisionFieldNameDescription string = "description" + + // CompanyProductProposalFieldDecisionFieldNameEnrichmentstatus captures enum value "enrichmentstatus" + CompanyProductProposalFieldDecisionFieldNameEnrichmentstatus string = "enrichmentstatus" + + // CompanyProductProposalFieldDecisionFieldNameFulldescription captures enum value "fulldescription" + CompanyProductProposalFieldDecisionFieldNameFulldescription string = "fulldescription" + + // CompanyProductProposalFieldDecisionFieldNameImagealttext captures enum value "imagealttext" + CompanyProductProposalFieldDecisionFieldNameImagealttext string = "imagealttext" + + // CompanyProductProposalFieldDecisionFieldNameImageurl captures enum value "imageurl" + CompanyProductProposalFieldDecisionFieldNameImageurl string = "imageurl" + + // CompanyProductProposalFieldDecisionFieldNameLogo captures enum value "logo" + CompanyProductProposalFieldDecisionFieldNameLogo string = "logo" + + // CompanyProductProposalFieldDecisionFieldNameName captures enum value "name" + CompanyProductProposalFieldDecisionFieldNameName string = "name" + + // CompanyProductProposalFieldDecisionFieldNameSlug captures enum value "slug" + CompanyProductProposalFieldDecisionFieldNameSlug string = "slug" + + // CompanyProductProposalFieldDecisionFieldNameTagline captures enum value "tagline" + CompanyProductProposalFieldDecisionFieldNameTagline string = "tagline" + + // CompanyProductProposalFieldDecisionFieldNameURL captures enum value "url" + CompanyProductProposalFieldDecisionFieldNameURL string = "url" +) + +// prop value enum +func (m *CompanyProductProposalFieldDecision) validateFieldNameEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, companyProductProposalFieldDecisionTypeFieldNamePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *CompanyProductProposalFieldDecision) validateFieldName(formats strfmt.Registry) error { + + if err := validate.Required("FieldName", "body", m.FieldName); err != nil { + return err + } + + // value enum + if err := m.validateFieldNameEnum("FieldName", "body", *m.FieldName); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this company product proposal field decision based on context it is used +func (m *CompanyProductProposalFieldDecision) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CompanyProductProposalFieldDecision) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return jsonutils.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CompanyProductProposalFieldDecision) UnmarshalBinary(b []byte) error { + var res CompanyProductProposalFieldDecision + if err := jsonutils.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/research/research_models/company_product_proposal_request.go b/api/research/research_models/company_product_proposal_request.go new file mode 100644 index 0000000..636fc49 --- /dev/null +++ b/api/research/research_models/company_product_proposal_request.go @@ -0,0 +1,228 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package research_models + +import ( + "context" + stderrors "errors" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" + "github.com/go-openapi/validate" +) + +// CompanyProductProposalRequest Update-only first slice; tenant, actor, client, status, and audit fields are server-owned +// +// swagger:model CompanyProductProposalRequest +type CompanyProductProposalRequest struct { + + // base version + // Required: true + // Format: date-time + BaseVersion *strfmt.DateTime `json:"BaseVersion"` + + // company product ID + // Required: true + // Format: uuid + CompanyProductID *strfmt.UUID `json:"CompanyProductID"` + + // fields + // Required: true + // Max Items: 10 + // Min Items: 1 + // Unique: true + Fields []*CompanyProductProposalField `json:"Fields"` + + // idempotency key + // Required: true + // Max Length: 120 + // Min Length: 8 + // Pattern: ^[A-Za-z0-9._:-]+$ + IdempotencyKey *string `json:"IdempotencyKey"` +} + +// Validate validates this company product proposal request +func (m *CompanyProductProposalRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBaseVersion(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCompanyProductID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFields(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIdempotencyKey(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CompanyProductProposalRequest) validateBaseVersion(formats strfmt.Registry) error { + + if err := validate.Required("BaseVersion", "body", m.BaseVersion); err != nil { + return err + } + + if err := validate.FormatOf("BaseVersion", "body", "date-time", m.BaseVersion.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CompanyProductProposalRequest) validateCompanyProductID(formats strfmt.Registry) error { + + if err := validate.Required("CompanyProductID", "body", m.CompanyProductID); err != nil { + return err + } + + if err := validate.FormatOf("CompanyProductID", "body", "uuid", m.CompanyProductID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CompanyProductProposalRequest) validateFields(formats strfmt.Registry) error { + + if err := validate.Required("Fields", "body", m.Fields); err != nil { + return err + } + + iFieldsSize := int64(len(m.Fields)) + + if err := validate.MinItems("Fields", "body", iFieldsSize, 1); err != nil { + return err + } + + if err := validate.MaxItems("Fields", "body", iFieldsSize, 10); err != nil { + return err + } + + if err := validate.UniqueItems("Fields", "body", m.Fields); err != nil { + return err + } + + for i := 0; i < len(m.Fields); i++ { + if typeutils.IsZero(m.Fields[i]) { // not required + continue + } + + if m.Fields[i] != nil { + if err := m.Fields[i].Validate(formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("Fields" + "." + strconv.Itoa(i)) + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("Fields" + "." + strconv.Itoa(i)) + } + + return err + } + } + + } + + return nil +} + +func (m *CompanyProductProposalRequest) validateIdempotencyKey(formats strfmt.Registry) error { + + if err := validate.Required("IdempotencyKey", "body", m.IdempotencyKey); err != nil { + return err + } + + if err := validate.MinLength("IdempotencyKey", "body", *m.IdempotencyKey, 8); err != nil { + return err + } + + if err := validate.MaxLength("IdempotencyKey", "body", *m.IdempotencyKey, 120); err != nil { + return err + } + + if err := validate.Pattern("IdempotencyKey", "body", *m.IdempotencyKey, `^[A-Za-z0-9._:-]+$`); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this company product proposal request based on the context it is used +func (m *CompanyProductProposalRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateFields(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CompanyProductProposalRequest) contextValidateFields(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Fields); i++ { + + if m.Fields[i] != nil { + + if typeutils.IsZero(m.Fields[i]) { // not required + return nil + } + + if err := m.Fields[i].ContextValidate(ctx, formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("Fields" + "." + strconv.Itoa(i)) + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("Fields" + "." + strconv.Itoa(i)) + } + + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CompanyProductProposalRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return jsonutils.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CompanyProductProposalRequest) UnmarshalBinary(b []byte) error { + var res CompanyProductProposalRequest + if err := jsonutils.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/research/research_models/company_product_proposal_response.go b/api/research/research_models/company_product_proposal_response.go new file mode 100644 index 0000000..79aabc5 --- /dev/null +++ b/api/research/research_models/company_product_proposal_response.go @@ -0,0 +1,135 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package research_models + +import ( + "context" + stderrors "errors" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" + "github.com/go-openapi/validate" +) + +// CompanyProductProposalResponse A bounded collection of visible CompanyProduct proposals +// +// swagger:model CompanyProductProposalResponse +type CompanyProductProposalResponse struct { + + // data + // Required: true + Data []*CompanyProductProposal `json:"Data"` +} + +// Validate validates this company product proposal response +func (m *CompanyProductProposalResponse) 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 *CompanyProductProposalResponse) validateData(formats strfmt.Registry) error { + + if err := validate.Required("Data", "body", m.Data); err != nil { + return err + } + + for i := 0; i < len(m.Data); i++ { + if typeutils.IsZero(m.Data[i]) { // not required + continue + } + + if m.Data[i] != nil { + if err := m.Data[i].Validate(formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("Data" + "." + strconv.Itoa(i)) + } + + return err + } + } + + } + + return nil +} + +// ContextValidate validate this company product proposal response based on the context it is used +func (m *CompanyProductProposalResponse) 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 *CompanyProductProposalResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + + if typeutils.IsZero(m.Data[i]) { // not required + return nil + } + + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("Data" + "." + strconv.Itoa(i)) + } + + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CompanyProductProposalResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return jsonutils.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CompanyProductProposalResponse) UnmarshalBinary(b []byte) error { + var res CompanyProductProposalResponse + if err := jsonutils.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/research/research_models/company_product_proposal_review_request.go b/api/research/research_models/company_product_proposal_review_request.go new file mode 100644 index 0000000..bb5db63 --- /dev/null +++ b/api/research/research_models/company_product_proposal_review_request.go @@ -0,0 +1,201 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package research_models + +import ( + "context" + stderrors "errors" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" + "github.com/go-openapi/validate" +) + +// CompanyProductProposalReviewRequest Complete atomic field review; rejected fields require a decision reason +// +// swagger:model CompanyProductProposalReviewRequest +type CompanyProductProposalReviewRequest struct { + + // expected last modified date + // Required: true + // Format: date-time + ExpectedLastModifiedDate *strfmt.DateTime `json:"ExpectedLastModifiedDate"` + + // fields + // Required: true + // Max Items: 10 + // Min Items: 1 + // Unique: true + Fields []*CompanyProductProposalFieldDecision `json:"Fields"` + + // review reason + // Required: true + // Max Length: 1000 + // Min Length: 1 + ReviewReason *string `json:"ReviewReason"` +} + +// Validate validates this company product proposal review request +func (m *CompanyProductProposalReviewRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateExpectedLastModifiedDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFields(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReviewReason(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CompanyProductProposalReviewRequest) validateExpectedLastModifiedDate(formats strfmt.Registry) error { + + if err := validate.Required("ExpectedLastModifiedDate", "body", m.ExpectedLastModifiedDate); err != nil { + return err + } + + if err := validate.FormatOf("ExpectedLastModifiedDate", "body", "date-time", m.ExpectedLastModifiedDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CompanyProductProposalReviewRequest) validateFields(formats strfmt.Registry) error { + + if err := validate.Required("Fields", "body", m.Fields); err != nil { + return err + } + + iFieldsSize := int64(len(m.Fields)) + + if err := validate.MinItems("Fields", "body", iFieldsSize, 1); err != nil { + return err + } + + if err := validate.MaxItems("Fields", "body", iFieldsSize, 10); err != nil { + return err + } + + if err := validate.UniqueItems("Fields", "body", m.Fields); err != nil { + return err + } + + for i := 0; i < len(m.Fields); i++ { + if typeutils.IsZero(m.Fields[i]) { // not required + continue + } + + if m.Fields[i] != nil { + if err := m.Fields[i].Validate(formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("Fields" + "." + strconv.Itoa(i)) + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("Fields" + "." + strconv.Itoa(i)) + } + + return err + } + } + + } + + return nil +} + +func (m *CompanyProductProposalReviewRequest) validateReviewReason(formats strfmt.Registry) error { + + if err := validate.Required("ReviewReason", "body", m.ReviewReason); err != nil { + return err + } + + if err := validate.MinLength("ReviewReason", "body", *m.ReviewReason, 1); err != nil { + return err + } + + if err := validate.MaxLength("ReviewReason", "body", *m.ReviewReason, 1000); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this company product proposal review request based on the context it is used +func (m *CompanyProductProposalReviewRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateFields(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CompanyProductProposalReviewRequest) contextValidateFields(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Fields); i++ { + + if m.Fields[i] != nil { + + if typeutils.IsZero(m.Fields[i]) { // not required + return nil + } + + if err := m.Fields[i].ContextValidate(ctx, formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("Fields" + "." + strconv.Itoa(i)) + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("Fields" + "." + strconv.Itoa(i)) + } + + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CompanyProductProposalReviewRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return jsonutils.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CompanyProductProposalReviewRequest) UnmarshalBinary(b []byte) error { + var res CompanyProductProposalReviewRequest + if err := jsonutils.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/research/research_models/company_product_proposal_submit_request.go b/api/research/research_models/company_product_proposal_submit_request.go new file mode 100644 index 0000000..4bba59a --- /dev/null +++ b/api/research/research_models/company_product_proposal_submit_request.go @@ -0,0 +1,77 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package research_models + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/validate" +) + +// CompanyProductProposalSubmitRequest Optimistic submission input; lifecycle and attribution remain server-owned +// +// swagger:model CompanyProductProposalSubmitRequest +type CompanyProductProposalSubmitRequest struct { + + // expected last modified date + // Required: true + // Format: date-time + ExpectedLastModifiedDate *strfmt.DateTime `json:"ExpectedLastModifiedDate"` +} + +// Validate validates this company product proposal submit request +func (m *CompanyProductProposalSubmitRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateExpectedLastModifiedDate(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CompanyProductProposalSubmitRequest) validateExpectedLastModifiedDate(formats strfmt.Registry) error { + + if err := validate.Required("ExpectedLastModifiedDate", "body", m.ExpectedLastModifiedDate); err != nil { + return err + } + + if err := validate.FormatOf("ExpectedLastModifiedDate", "body", "date-time", m.ExpectedLastModifiedDate.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this company product proposal submit request based on context it is used +func (m *CompanyProductProposalSubmitRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CompanyProductProposalSubmitRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return jsonutils.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CompanyProductProposalSubmitRequest) UnmarshalBinary(b []byte) error { + var res CompanyProductProposalSubmitRequest + if err := jsonutils.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 e6ee421..76407e4 100644 --- a/swagger/external/research-vernonkeenan.yaml +++ b/swagger/external/research-vernonkeenan.yaml @@ -13,6 +13,11 @@ securityDefinitions: type: "apiKey" in: "header" name: "X-API-Key" + kvSessionCookie: + type: "apiKey" + in: "header" + name: "Cookie" + description: "Members session cookie. Credential values are never accepted in request bodies or logs." schemes: - "https" basePath: "/vk/research/v1" @@ -53,6 +58,41 @@ parameters: required: true schema: $ref: "#/definitions/CompanyProductRequest" + companyProductProposalRequest: + description: A human-attributed draft proposal for an existing CompanyProduct + in: body + name: companyProductProposalRequest + required: true + schema: + $ref: "#/definitions/CompanyProductProposalRequest" + companyProductProposalIdPath: + description: CompanyProduct proposal record ID + in: path + name: companyProductProposalId + required: true + type: string + format: uuid + companyProductProposalViewQuery: + description: Actor-owned proposals or the tenant review queue + in: query + name: view + required: true + type: string + enum: [mine, review] + companyProductProposalSubmitRequest: + description: Optimistic draft submission request + in: body + name: companyProductProposalSubmitRequest + required: true + schema: + $ref: "#/definitions/CompanyProductProposalSubmitRequest" + companyProductProposalReviewRequest: + description: Complete field-level review request + in: body + name: companyProductProposalReviewRequest + required: true + schema: + $ref: "#/definitions/CompanyProductProposalReviewRequest" companyServiceRequest: description: An array of new CompanyService records in: body @@ -530,6 +570,155 @@ paths: summary: Update a single companyproduct tags: - CompanyProducts + /companyproductproposals: + get: + description: Return actor-owned proposals or the submitted tenant review queue + operationId: getCompanyProductProposals + parameters: + - $ref: "#/parameters/companyProductProposalViewQuery" + - $ref: "#/parameters/companyProductIdQuery" + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + responses: + "200": + description: Governed proposal collection + schema: + $ref: "#/definitions/CompanyProductProposalResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + kvSessionCookie: [] + summary: List CompanyProduct proposals + tags: + - CompanyProductProposals + post: + description: Create a draft proposal without changing the authoritative CompanyProduct + operationId: postCompanyProductProposal + parameters: + - $ref: "#/parameters/companyProductProposalRequest" + responses: + "201": + description: Draft proposal created + schema: + $ref: "#/definitions/CompanyProductProposal" + "400": + $ref: "#/responses/UnprocessableEntity" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "409": + description: Product version or idempotency conflict + schema: + $ref: "#/definitions/Error" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + kvSessionCookie: [] + summary: Create a CompanyProduct draft proposal + tags: + - CompanyProductProposals + /companyproductproposals/{companyProductProposalId}: + get: + description: Return one visible CompanyProduct proposal + operationId: getCompanyProductProposal + parameters: + - $ref: "#/parameters/companyProductProposalIdPath" + responses: + "200": + description: Governed proposal detail + schema: + $ref: "#/definitions/CompanyProductProposal" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + kvSessionCookie: [] + summary: Get a CompanyProduct proposal + tags: + - CompanyProductProposals + /companyproductproposals/{companyProductProposalId}/submit: + post: + description: Submit an actor-owned draft without changing the authoritative CompanyProduct + operationId: submitCompanyProductProposal + parameters: + - $ref: "#/parameters/companyProductProposalIdPath" + - $ref: "#/parameters/companyProductProposalSubmitRequest" + responses: + "200": + description: Proposal submitted for review + schema: + $ref: "#/definitions/CompanyProductProposal" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "409": + description: Proposal state or optimistic version conflict + schema: + $ref: "#/definitions/Error" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + kvSessionCookie: [] + summary: Submit a CompanyProduct proposal + tags: + - CompanyProductProposals + /companyproductproposals/{companyProductProposalId}/review: + post: + description: Decide every field on a submitted proposal without changing the authoritative CompanyProduct + operationId: reviewCompanyProductProposal + parameters: + - $ref: "#/parameters/companyProductProposalIdPath" + - $ref: "#/parameters/companyProductProposalReviewRequest" + responses: + "200": + description: Proposal review completed + schema: + $ref: "#/definitions/CompanyProductProposal" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "409": + description: Proposal state or optimistic version conflict + schema: + $ref: "#/definitions/Error" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + kvSessionCookie: [] + summary: Review a CompanyProduct proposal + tags: + - CompanyProductProposals /factors: delete: description: Delete Factor record @@ -726,7 +915,7 @@ paths: - FinancialStatements /industries: get: - description: Retrieve Industry records from the microservice + description: Retrieve the shared global Industry taxonomy. Requires research:industry:read on a tenant-bound service principal; the tenant authorizes the caller but does not own taxonomy rows. operationId: getIndustries parameters: - $ref: "#/parameters/limitQuery" @@ -754,7 +943,7 @@ paths: tags: - Industry post: - description: Add new industries + description: Add exactly one shared global Industry with server-owned ID and audit fields. Requires research:industry:create plus an active Owner or Manager session in the machine tenant. operationId: postIndustries parameters: - $ref: "#/parameters/industryRequest" @@ -773,12 +962,39 @@ paths: $ref: "#/responses/ServerError" security: - ApiKeyAuth: [] - summary: Add new companies + kvSessionCookie: [] + summary: Add a shared Industry taxonomy record + tags: + - Industry + put: + description: Optimistically replace the editable fields of exactly one shared global Industry. ID and LastModifiedDate form the compare-and-swap contract; audit fields are server-owned. Requires research:industry:update plus an active Owner or Manager session in the machine tenant. + operationId: putIndustries + parameters: + - $ref: "#/parameters/industryRequest" + responses: + "200": + $ref: "#/responses/IndustryResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + kvSessionCookie: [] + summary: Update a shared Industry taxonomy record tags: - Industry /industrycompanies: delete: - description: Delete IndustryCompany record + description: Reserved compatibility operation. Runtime removal remains disabled until a recoverable relationship-event or tombstone contract exists. operationId: deleteIndustryCompany parameters: - $ref: "#/parameters/industryCompanyIdQuery" @@ -801,7 +1017,7 @@ paths: tags: - IndustryCompanies get: - description: Return a list of all available IndustryCompanies + description: Return IndustryCompany links attributed to the caller tenant through crm.account. Requires research:industry-company:read. operationId: getIndustryCompanies parameters: - $ref: "#/parameters/limitQuery" @@ -829,7 +1045,7 @@ paths: tags: - IndustryCompanies post: - description: IndustryCompany record to be added + description: Idempotently add exactly one IndustryCompany link attributed through the referenced CRM Account tenant. ID and audit fields are server-owned. Requires research:industry-company:create plus an active Owner or Manager session. operationId: postIndustryCompanies parameters: - $ref: "#/parameters/industryCompanyRequest" @@ -848,12 +1064,13 @@ paths: $ref: "#/responses/ServerError" security: - ApiKeyAuth: [] - summary: Add a new industryCompany to SalesforceDevops.net + kvSessionCookie: [] + summary: Add a tenant-attributed IndustryCompany link tags: - IndustryCompanies /industryservices: delete: - description: Delete IndustryService record + description: Reserved compatibility operation. Runtime removal remains disabled until a recoverable relationship-event or tombstone contract exists. operationId: deleteIndustryService parameters: - $ref: "#/parameters/limitQuery" @@ -878,7 +1095,7 @@ paths: tags: - IndustryServices get: - description: Return a list of all available IndustryServices + description: Return IndustryService links attributed to the caller tenant through CompanyService and crm.account. Requires research:industry-service:read. operationId: getIndustryServices parameters: - $ref: "#/parameters/limitQuery" @@ -903,7 +1120,7 @@ paths: tags: - IndustryServices post: - description: IndustryService record to be added + description: Idempotently add exactly one tenant-attributed IndustryService link. ID and audit fields are server-owned. Requires research:industry-service:create plus an active Owner or Manager session. operationId: postIndustryServices parameters: - $ref: "#/parameters/industryServiceRequest" @@ -922,12 +1139,13 @@ paths: $ref: "#/responses/ServerError" security: - ApiKeyAuth: [] - summary: Add a new industryService to SalesforceDevops.net + kvSessionCookie: [] + summary: Add a tenant-attributed IndustryService link tags: - IndustryServices /industryproducts: delete: - description: Delete IndustryProduct record + description: Reserved compatibility operation. Runtime removal remains disabled until a recoverable relationship-event or tombstone contract exists. operationId: deleteIndustryProduct parameters: - $ref: "#/parameters/limitQuery" @@ -952,7 +1170,7 @@ paths: tags: - IndustryProducts get: - description: Return a list of all available IndustryProducts + description: Return IndustryProduct links attributed to the caller tenant through CompanyProduct and crm.account. Requires research:industry-product:read. operationId: getIndustryProducts parameters: - $ref: "#/parameters/limitQuery" @@ -979,7 +1197,7 @@ paths: tags: - IndustryProducts post: - description: IndustryProduct record to be added + description: Idempotently add exactly one tenant-attributed IndustryProduct link. ID and audit fields are server-owned. Requires research:industry-product:create plus an active Owner or Manager session. operationId: postIndustryProducts parameters: - $ref: "#/parameters/industryProductRequest" @@ -998,7 +1216,8 @@ paths: $ref: "#/responses/ServerError" security: - ApiKeyAuth: [] - summary: Add a new industryProduct to SalesforceDevops.net + kvSessionCookie: [] + summary: Add a tenant-attributed IndustryProduct link tags: - IndustryProducts /observations: @@ -1179,6 +1398,215 @@ definitions: $ref: "../../lib/swagger/defs/company-product.yaml#/CompanyProduct" type: array type: object + CompanyProductProposalField: + description: One governed CompanyProduct field change + required: + - FieldName + - ProposedValue + properties: + FieldName: + type: string + enum: + - description + - enrichmentstatus + - fulldescription + - imagealttext + - imageurl + - logo + - name + - slug + - tagline + - url + ProposedValue: + description: Proposed JSON value. The server captures the current value. + type: string + maxLength: 20000 + CurrentValue: + description: Current authoritative value captured when the proposal was created + type: string + x-nullable: true + Decision: + type: string + enum: [pending, accepted, rejected] + DecidedByID: + type: string + format: uuid + x-nullable: true + DecidedAt: + type: string + format: date-time + x-nullable: true + DecisionReason: + type: string + maxLength: 1000 + x-nullable: true + type: object + CompanyProductProposalRequest: + description: Update-only first slice; tenant, actor, client, status, and audit fields are server-owned + required: + - CompanyProductID + - BaseVersion + - IdempotencyKey + - Fields + properties: + CompanyProductID: + type: string + format: uuid + BaseVersion: + type: string + format: date-time + IdempotencyKey: + type: string + minLength: 8 + maxLength: 120 + pattern: "^[A-Za-z0-9._:-]+$" + Fields: + type: array + minItems: 1 + maxItems: 10 + uniqueItems: true + items: + $ref: "#/definitions/CompanyProductProposalField" + additionalProperties: false + type: object + CompanyProductProposal: + description: Server-owned draft proposal; it does not imply approval or authoritative publication + required: + - ID + - TenantID + - CompanyProductID + - Operation + - Status + - BaseVersion + - ProposedByID + - ClientPrincipalKey + - CreatedDate + - LastModifiedDate + - Fields + properties: + ID: + type: string + format: uuid + TenantID: + type: string + format: uuid + CompanyProductID: + type: string + format: uuid + CompanyProductName: + type: string + x-nullable: true + Operation: + type: string + enum: [update] + Status: + type: string + enum: [draft, submitted, approved, rejected] + BaseVersion: + type: string + format: date-time + ProposedByID: + type: string + format: uuid + ClientPrincipalKey: + type: string + CreatedDate: + type: string + format: date-time + LastModifiedDate: + type: string + format: date-time + SubmittedAt: + type: string + format: date-time + x-nullable: true + ReviewedByID: + type: string + format: uuid + x-nullable: true + ReviewedAt: + type: string + format: date-time + x-nullable: true + ReviewReason: + type: string + maxLength: 1000 + x-nullable: true + Fields: + type: array + items: + $ref: "#/definitions/CompanyProductProposalField" + type: object + CompanyProductProposalResponse: + description: A bounded collection of visible CompanyProduct proposals + required: + - Data + properties: + Data: + type: array + items: + $ref: "#/definitions/CompanyProductProposal" + type: object + CompanyProductProposalSubmitRequest: + description: Optimistic submission input; lifecycle and attribution remain server-owned + required: + - ExpectedLastModifiedDate + properties: + ExpectedLastModifiedDate: + type: string + format: date-time + additionalProperties: false + type: object + CompanyProductProposalFieldDecision: + description: One complete reviewer decision for a proposed field + required: + - FieldName + - Decision + properties: + FieldName: + type: string + enum: + - description + - enrichmentstatus + - fulldescription + - imagealttext + - imageurl + - logo + - name + - slug + - tagline + - url + Decision: + type: string + enum: [accepted, rejected] + DecisionReason: + type: string + maxLength: 1000 + additionalProperties: false + type: object + CompanyProductProposalReviewRequest: + description: Complete atomic field review; rejected fields require a decision reason + required: + - ExpectedLastModifiedDate + - ReviewReason + - Fields + properties: + ExpectedLastModifiedDate: + type: string + format: date-time + ReviewReason: + type: string + minLength: 1 + maxLength: 1000 + Fields: + type: array + minItems: 1 + maxItems: 10 + uniqueItems: true + items: + $ref: "#/definitions/CompanyProductProposalFieldDecision" + additionalProperties: false + type: object CompanyProductResponse: description: An array of CompanyProduct objects produced in response to a request properties: diff --git a/swagger/research-vernonkeenan.yaml b/swagger/research-vernonkeenan.yaml index 3731c87..8ed4437 100644 --- a/swagger/research-vernonkeenan.yaml +++ b/swagger/research-vernonkeenan.yaml @@ -13,6 +13,11 @@ securityDefinitions: type: "apiKey" in: "header" name: "X-API-Key" + kvSessionCookie: + type: "apiKey" + in: "header" + name: "Cookie" + description: "Members session cookie. Credential values are never accepted in request bodies or logs." schemes: - "http" basePath: "/v1" @@ -53,6 +58,41 @@ parameters: required: true schema: $ref: "#/definitions/CompanyProductRequest" + companyProductProposalRequest: + description: A human-attributed draft proposal for an existing CompanyProduct + in: body + name: companyProductProposalRequest + required: true + schema: + $ref: "#/definitions/CompanyProductProposalRequest" + companyProductProposalIdPath: + description: CompanyProduct proposal record ID + in: path + name: companyProductProposalId + required: true + type: string + format: uuid + companyProductProposalViewQuery: + description: Actor-owned proposals or the tenant review queue + in: query + name: view + required: true + type: string + enum: [mine, review] + companyProductProposalSubmitRequest: + description: Optimistic draft submission request + in: body + name: companyProductProposalSubmitRequest + required: true + schema: + $ref: "#/definitions/CompanyProductProposalSubmitRequest" + companyProductProposalReviewRequest: + description: Complete field-level review request + in: body + name: companyProductProposalReviewRequest + required: true + schema: + $ref: "#/definitions/CompanyProductProposalReviewRequest" companyServiceRequest: description: An array of new CompanyService records in: body @@ -530,6 +570,155 @@ paths: summary: Update a single companyproduct tags: - CompanyProducts + /companyproductproposals: + get: + description: Return actor-owned proposals or the submitted tenant review queue + operationId: getCompanyProductProposals + parameters: + - $ref: "#/parameters/companyProductProposalViewQuery" + - $ref: "#/parameters/companyProductIdQuery" + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + responses: + "200": + description: Governed proposal collection + schema: + $ref: "#/definitions/CompanyProductProposalResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + kvSessionCookie: [] + summary: List CompanyProduct proposals + tags: + - CompanyProductProposals + post: + description: Create a draft proposal without changing the authoritative CompanyProduct + operationId: postCompanyProductProposal + parameters: + - $ref: "#/parameters/companyProductProposalRequest" + responses: + "201": + description: Draft proposal created + schema: + $ref: "#/definitions/CompanyProductProposal" + "400": + $ref: "#/responses/UnprocessableEntity" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "409": + description: Product version or idempotency conflict + schema: + $ref: "#/definitions/Error" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + kvSessionCookie: [] + summary: Create a CompanyProduct draft proposal + tags: + - CompanyProductProposals + /companyproductproposals/{companyProductProposalId}: + get: + description: Return one visible CompanyProduct proposal + operationId: getCompanyProductProposal + parameters: + - $ref: "#/parameters/companyProductProposalIdPath" + responses: + "200": + description: Governed proposal detail + schema: + $ref: "#/definitions/CompanyProductProposal" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + kvSessionCookie: [] + summary: Get a CompanyProduct proposal + tags: + - CompanyProductProposals + /companyproductproposals/{companyProductProposalId}/submit: + post: + description: Submit an actor-owned draft without changing the authoritative CompanyProduct + operationId: submitCompanyProductProposal + parameters: + - $ref: "#/parameters/companyProductProposalIdPath" + - $ref: "#/parameters/companyProductProposalSubmitRequest" + responses: + "200": + description: Proposal submitted for review + schema: + $ref: "#/definitions/CompanyProductProposal" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "409": + description: Proposal state or optimistic version conflict + schema: + $ref: "#/definitions/Error" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + kvSessionCookie: [] + summary: Submit a CompanyProduct proposal + tags: + - CompanyProductProposals + /companyproductproposals/{companyProductProposalId}/review: + post: + description: Decide every field on a submitted proposal without changing the authoritative CompanyProduct + operationId: reviewCompanyProductProposal + parameters: + - $ref: "#/parameters/companyProductProposalIdPath" + - $ref: "#/parameters/companyProductProposalReviewRequest" + responses: + "200": + description: Proposal review completed + schema: + $ref: "#/definitions/CompanyProductProposal" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "409": + description: Proposal state or optimistic version conflict + schema: + $ref: "#/definitions/Error" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + kvSessionCookie: [] + summary: Review a CompanyProduct proposal + tags: + - CompanyProductProposals /factors: delete: description: Delete Factor record @@ -726,7 +915,7 @@ paths: - FinancialStatements /industries: get: - description: Retrieve Industry records from the microservice + description: Retrieve the shared global Industry taxonomy. Requires research:industry:read on a tenant-bound service principal; the tenant authorizes the caller but does not own taxonomy rows. operationId: getIndustries parameters: - $ref: "#/parameters/limitQuery" @@ -754,7 +943,7 @@ paths: tags: - Industry post: - description: Add new industries + description: Add exactly one shared global Industry with server-owned ID and audit fields. Requires research:industry:create plus an active Owner or Manager session in the machine tenant. operationId: postIndustries parameters: - $ref: "#/parameters/industryRequest" @@ -773,12 +962,39 @@ paths: $ref: "#/responses/ServerError" security: - ApiKeyAuth: [] - summary: Add new companies + kvSessionCookie: [] + summary: Add a shared Industry taxonomy record + tags: + - Industry + put: + description: Optimistically replace the editable fields of exactly one shared global Industry. ID and LastModifiedDate form the compare-and-swap contract; audit fields are server-owned. Requires research:industry:update plus an active Owner or Manager session in the machine tenant. + operationId: putIndustries + parameters: + - $ref: "#/parameters/industryRequest" + responses: + "200": + $ref: "#/responses/IndustryResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + kvSessionCookie: [] + summary: Update a shared Industry taxonomy record tags: - Industry /industrycompanies: delete: - description: Delete IndustryCompany record + description: Reserved compatibility operation. Runtime removal remains disabled until a recoverable relationship-event or tombstone contract exists. operationId: deleteIndustryCompany parameters: - $ref: "#/parameters/industryCompanyIdQuery" @@ -801,7 +1017,7 @@ paths: tags: - IndustryCompanies get: - description: Return a list of all available IndustryCompanies + description: Return IndustryCompany links attributed to the caller tenant through crm.account. Requires research:industry-company:read. operationId: getIndustryCompanies parameters: - $ref: "#/parameters/limitQuery" @@ -829,7 +1045,7 @@ paths: tags: - IndustryCompanies post: - description: IndustryCompany record to be added + description: Idempotently add exactly one IndustryCompany link attributed through the referenced CRM Account tenant. ID and audit fields are server-owned. Requires research:industry-company:create plus an active Owner or Manager session. operationId: postIndustryCompanies parameters: - $ref: "#/parameters/industryCompanyRequest" @@ -848,12 +1064,13 @@ paths: $ref: "#/responses/ServerError" security: - ApiKeyAuth: [] - summary: Add a new industryCompany to SalesforceDevops.net + kvSessionCookie: [] + summary: Add a tenant-attributed IndustryCompany link tags: - IndustryCompanies /industryservices: delete: - description: Delete IndustryService record + description: Reserved compatibility operation. Runtime removal remains disabled until a recoverable relationship-event or tombstone contract exists. operationId: deleteIndustryService parameters: - $ref: "#/parameters/limitQuery" @@ -878,7 +1095,7 @@ paths: tags: - IndustryServices get: - description: Return a list of all available IndustryServices + description: Return IndustryService links attributed to the caller tenant through CompanyService and crm.account. Requires research:industry-service:read. operationId: getIndustryServices parameters: - $ref: "#/parameters/limitQuery" @@ -903,7 +1120,7 @@ paths: tags: - IndustryServices post: - description: IndustryService record to be added + description: Idempotently add exactly one tenant-attributed IndustryService link. ID and audit fields are server-owned. Requires research:industry-service:create plus an active Owner or Manager session. operationId: postIndustryServices parameters: - $ref: "#/parameters/industryServiceRequest" @@ -922,12 +1139,13 @@ paths: $ref: "#/responses/ServerError" security: - ApiKeyAuth: [] - summary: Add a new industryService to SalesforceDevops.net + kvSessionCookie: [] + summary: Add a tenant-attributed IndustryService link tags: - IndustryServices /industryproducts: delete: - description: Delete IndustryProduct record + description: Reserved compatibility operation. Runtime removal remains disabled until a recoverable relationship-event or tombstone contract exists. operationId: deleteIndustryProduct parameters: - $ref: "#/parameters/limitQuery" @@ -952,7 +1170,7 @@ paths: tags: - IndustryProducts get: - description: Return a list of all available IndustryProducts + description: Return IndustryProduct links attributed to the caller tenant through CompanyProduct and crm.account. Requires research:industry-product:read. operationId: getIndustryProducts parameters: - $ref: "#/parameters/limitQuery" @@ -979,7 +1197,7 @@ paths: tags: - IndustryProducts post: - description: IndustryProduct record to be added + description: Idempotently add exactly one tenant-attributed IndustryProduct link. ID and audit fields are server-owned. Requires research:industry-product:create plus an active Owner or Manager session. operationId: postIndustryProducts parameters: - $ref: "#/parameters/industryProductRequest" @@ -998,7 +1216,8 @@ paths: $ref: "#/responses/ServerError" security: - ApiKeyAuth: [] - summary: Add a new industryProduct to SalesforceDevops.net + kvSessionCookie: [] + summary: Add a tenant-attributed IndustryProduct link tags: - IndustryProducts /observations: @@ -1179,6 +1398,215 @@ definitions: $ref: "../../lib/swagger/defs/company-product.yaml#/CompanyProduct" type: array type: object + CompanyProductProposalField: + description: One governed CompanyProduct field change + required: + - FieldName + - ProposedValue + properties: + FieldName: + type: string + enum: + - description + - enrichmentstatus + - fulldescription + - imagealttext + - imageurl + - logo + - name + - slug + - tagline + - url + ProposedValue: + description: Proposed JSON value. The server captures the current value. + type: string + maxLength: 20000 + CurrentValue: + description: Current authoritative value captured when the proposal was created + type: string + x-nullable: true + Decision: + type: string + enum: [pending, accepted, rejected] + DecidedByID: + type: string + format: uuid + x-nullable: true + DecidedAt: + type: string + format: date-time + x-nullable: true + DecisionReason: + type: string + maxLength: 1000 + x-nullable: true + type: object + CompanyProductProposalRequest: + description: Update-only first slice; tenant, actor, client, status, and audit fields are server-owned + required: + - CompanyProductID + - BaseVersion + - IdempotencyKey + - Fields + properties: + CompanyProductID: + type: string + format: uuid + BaseVersion: + type: string + format: date-time + IdempotencyKey: + type: string + minLength: 8 + maxLength: 120 + pattern: "^[A-Za-z0-9._:-]+$" + Fields: + type: array + minItems: 1 + maxItems: 10 + uniqueItems: true + items: + $ref: "#/definitions/CompanyProductProposalField" + additionalProperties: false + type: object + CompanyProductProposal: + description: Server-owned draft proposal; it does not imply approval or authoritative publication + required: + - ID + - TenantID + - CompanyProductID + - Operation + - Status + - BaseVersion + - ProposedByID + - ClientPrincipalKey + - CreatedDate + - LastModifiedDate + - Fields + properties: + ID: + type: string + format: uuid + TenantID: + type: string + format: uuid + CompanyProductID: + type: string + format: uuid + CompanyProductName: + type: string + x-nullable: true + Operation: + type: string + enum: [update] + Status: + type: string + enum: [draft, submitted, approved, rejected] + BaseVersion: + type: string + format: date-time + ProposedByID: + type: string + format: uuid + ClientPrincipalKey: + type: string + CreatedDate: + type: string + format: date-time + LastModifiedDate: + type: string + format: date-time + SubmittedAt: + type: string + format: date-time + x-nullable: true + ReviewedByID: + type: string + format: uuid + x-nullable: true + ReviewedAt: + type: string + format: date-time + x-nullable: true + ReviewReason: + type: string + maxLength: 1000 + x-nullable: true + Fields: + type: array + items: + $ref: "#/definitions/CompanyProductProposalField" + type: object + CompanyProductProposalResponse: + description: A bounded collection of visible CompanyProduct proposals + required: + - Data + properties: + Data: + type: array + items: + $ref: "#/definitions/CompanyProductProposal" + type: object + CompanyProductProposalSubmitRequest: + description: Optimistic submission input; lifecycle and attribution remain server-owned + required: + - ExpectedLastModifiedDate + properties: + ExpectedLastModifiedDate: + type: string + format: date-time + additionalProperties: false + type: object + CompanyProductProposalFieldDecision: + description: One complete reviewer decision for a proposed field + required: + - FieldName + - Decision + properties: + FieldName: + type: string + enum: + - description + - enrichmentstatus + - fulldescription + - imagealttext + - imageurl + - logo + - name + - slug + - tagline + - url + Decision: + type: string + enum: [accepted, rejected] + DecisionReason: + type: string + maxLength: 1000 + additionalProperties: false + type: object + CompanyProductProposalReviewRequest: + description: Complete atomic field review; rejected fields require a decision reason + required: + - ExpectedLastModifiedDate + - ReviewReason + - Fields + properties: + ExpectedLastModifiedDate: + type: string + format: date-time + ReviewReason: + type: string + minLength: 1 + maxLength: 1000 + Fields: + type: array + minItems: 1 + maxItems: 10 + uniqueItems: true + items: + $ref: "#/definitions/CompanyProductProposalFieldDecision" + additionalProperties: false + type: object CompanyProductResponse: description: An array of CompanyProduct objects produced in response to a request properties: