diff --git a/api/plex/plex_models/company.go b/api/plex/plex_models/company.go index 5ed8f55..e71bc65 100644 --- a/api/plex/plex_models/company.go +++ b/api/plex/plex_models/company.go @@ -53,6 +53,9 @@ type Company struct { // Company Products CompanyProducts []*CompanyProduct `json:"CompanyProducts"` + // Company Services + CompanyServices []*CompanyService `json:"CompanyServices"` + // Company Crunchbase URL CrunchbaseURL *string `json:"CrunchbaseURL,omitempty"` @@ -173,6 +176,10 @@ func (m *Company) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateCompanyServices(formats); err != nil { + res = append(res, err) + } + if err := m.validateFinancialStatements(formats); err != nil { res = append(res, err) } @@ -217,6 +224,32 @@ func (m *Company) validateCompanyProducts(formats strfmt.Registry) error { return nil } +func (m *Company) validateCompanyServices(formats strfmt.Registry) error { + if swag.IsZero(m.CompanyServices) { // not required + return nil + } + + for i := 0; i < len(m.CompanyServices); i++ { + if swag.IsZero(m.CompanyServices[i]) { // not required + continue + } + + if m.CompanyServices[i] != nil { + if err := m.CompanyServices[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("CompanyServices" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("CompanyServices" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *Company) validateFinancialStatements(formats strfmt.Registry) error { if swag.IsZero(m.FinancialStatements) { // not required return nil @@ -296,6 +329,10 @@ func (m *Company) ContextValidate(ctx context.Context, formats strfmt.Registry) res = append(res, err) } + if err := m.contextValidateCompanyServices(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateFinancialStatements(ctx, formats); err != nil { res = append(res, err) } @@ -334,6 +371,26 @@ func (m *Company) contextValidateCompanyProducts(ctx context.Context, formats st return nil } +func (m *Company) contextValidateCompanyServices(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.CompanyServices); i++ { + + if m.CompanyServices[i] != nil { + if err := m.CompanyServices[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("CompanyServices" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("CompanyServices" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *Company) contextValidateFinancialStatements(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.FinancialStatements); i++ { diff --git a/api/plex/plex_models/company_product.go b/api/plex/plex_models/company_product.go index b4ab1fa..180b79e 100644 --- a/api/plex/plex_models/company_product.go +++ b/api/plex/plex_models/company_product.go @@ -26,6 +26,9 @@ type CompanyProduct struct { // ID of the Company that owns this Product AccountID *string `json:"AccountID,omitempty"` + // Salesforce AppExchange URL + AppExchange *string `json:"AppExchange,omitempty"` + // Created By User ID CreatedByID *string `json:"CreatedByID,omitempty"` diff --git a/api/plex/plex_models/company_service.go b/api/plex/plex_models/company_service.go new file mode 100644 index 0000000..5e3c683 --- /dev/null +++ b/api/plex/plex_models/company_service.go @@ -0,0 +1,177 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package plex_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CompanyService A service performed by a Company +// +// swagger:model CompanyService +type CompanyService struct { + + // ID of the Company that owns this Service + AccountID *string `json:"AccountID,omitempty"` + + // Salesforce AppExchange URL + AppExchange *string `json:"AppExchange,omitempty"` + + // Created By User ID + CreatedByID *string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate *string `json:"CreatedDate,omitempty"` + + // Description of service + Description *string `json:"Description,omitempty"` + + // Full Description of service + FullDescription *string `json:"FullDescription,omitempty"` + + // Record Id + ID string `json:"ID,omitempty"` + + // Image Alt Text + ImageAltText *string `json:"ImageAltText,omitempty"` + + // Image URL + ImageURL *string `json:"ImageURL,omitempty"` + + // Industries + Industries []*Industry `json:"Industries"` + + // Last Modified By User ID + LastModifiedByID *string `json:"LastModifiedByID,omitempty"` + + // Last Modified Date + LastModifiedDate *string `json:"LastModifiedDate,omitempty"` + + // Logo + Logo *string `json:"Logo,omitempty"` + + // Service Name + Name *string `json:"Name,omitempty"` + + // Published + Published *bool `json:"Published,omitempty"` + + // Salesforce Specific + SalesforceSpecific *bool `json:"SalesforceSpecific,omitempty"` + + // Service Video ID + ServiceVideoID *string `json:"ServiceVideoID,omitempty"` + + // Slug + Slug *string `json:"Slug,omitempty"` + + // Tag Line + TagLine *string `json:"TagLine,omitempty"` + + // URL + URL *string `json:"URL,omitempty"` +} + +// Validate validates this company service +func (m *CompanyService) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateIndustries(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CompanyService) validateIndustries(formats strfmt.Registry) error { + if swag.IsZero(m.Industries) { // not required + return nil + } + + for i := 0; i < len(m.Industries); i++ { + if swag.IsZero(m.Industries[i]) { // not required + continue + } + + if m.Industries[i] != nil { + if err := m.Industries[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Industries" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Industries" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this company service based on the context it is used +func (m *CompanyService) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateIndustries(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CompanyService) contextValidateIndustries(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Industries); i++ { + + if m.Industries[i] != nil { + if err := m.Industries[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Industries" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Industries" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CompanyService) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CompanyService) UnmarshalBinary(b []byte) error { + var res CompanyService + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/research/research_client/company_services/get_company_services_parameters.go b/api/research/research_client/company_services/get_company_services_parameters.go index 7437ca1..24325ea 100644 --- a/api/research/research_client/company_services/get_company_services_parameters.go +++ b/api/research/research_client/company_services/get_company_services_parameters.go @@ -66,6 +66,12 @@ GetCompanyServicesParams contains all the parameters to send to the API endpoint */ type GetCompanyServicesParams struct { + /* AccountID. + + Record Id of an Account + */ + AccountID *string + /* CompanyServiceID. CompanyService record ID @@ -147,6 +153,17 @@ func (o *GetCompanyServicesParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithAccountID adds the accountID to the get company services params +func (o *GetCompanyServicesParams) WithAccountID(accountID *string) *GetCompanyServicesParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get company services params +func (o *GetCompanyServicesParams) SetAccountID(accountID *string) { + o.AccountID = accountID +} + // WithCompanyServiceID adds the companyServiceID to the get company services params func (o *GetCompanyServicesParams) WithCompanyServiceID(companyServiceID *string) *GetCompanyServicesParams { o.SetCompanyServiceID(companyServiceID) @@ -199,6 +216,23 @@ func (o *GetCompanyServicesParams) WriteToRequest(r runtime.ClientRequest, reg s } var res []error + if o.AccountID != nil { + + // query param accountId + var qrAccountID string + + if o.AccountID != nil { + qrAccountID = *o.AccountID + } + qAccountID := qrAccountID + if qAccountID != "" { + + if err := r.SetQueryParam("accountId", qAccountID); err != nil { + return err + } + } + } + if o.CompanyServiceID != nil { // query param companyServiceId diff --git a/swagger/external/plex-vernonkeenan.yaml b/swagger/external/plex-vernonkeenan.yaml index 308b222..8ff7bdf 100644 --- a/swagger/external/plex-vernonkeenan.yaml +++ b/swagger/external/plex-vernonkeenan.yaml @@ -321,6 +321,12 @@ definitions: type: array items: $ref: "#/definitions/CompanyProduct" + CompanyServices: + description: Company Services + x-nullable: true + type: array + items: + $ref: "#/definitions/CompanyService" FinancialStatements: description: Financial Statements x-nullable: true @@ -396,6 +402,10 @@ definitions: description: ID of the Company that owns this Product type: string x-nullable: true + AppExchange: + description: Salesforce AppExchange URL + type: string + x-nullable: true CreatedByID: description: Created By User ID type: string @@ -467,6 +477,92 @@ definitions: description: Website type: string type: object + CompanyService: + description: A service performed by a Company + properties: + ID: + description: Record Id + type: string + AccountID: + description: ID of the Company that owns this Service + type: string + x-nullable: true + AppExchange: + description: Salesforce AppExchange URL + type: string + x-nullable: true + CreatedByID: + description: Created By User ID + type: string + x-nullable: true + CreatedDate: + description: Created Date + type: string + x-nullable: true + Description: + description: Description of service + type: string + x-nullable: true + FullDescription: + description: Full Description of service + type: string + x-nullable: true + ImageAltText: + description: Image Alt Text + type: string + x-nullable: true + ImageURL: + description: Image URL + type: string + x-nullable: true + Industries: + x-nullable: true + description: Industries + type: array + items: + $ref: "#/definitions/Industry" + LastModifiedByID: + description: Last Modified By User ID + type: string + x-nullable: true + LastModifiedDate: + description: Last Modified Date + type: string + x-nullable: true + Logo: + description: Logo + type: string + x-nullable: true + Name: + description: Service Name + type: string + x-nullable: true + Published: + description: Published + type: boolean + x-nullable: true + SalesforceSpecific: + description: Salesforce Specific + type: boolean + x-nullable: true + ServiceVideoID: + description: Service Video ID + type: string + x-nullable: true + Slug: + description: Slug + type: string + x-nullable: true + TagLine: + description: Tag Line + type: string + x-nullable: true + URL: + description: URL + type: string + x-nullable: true + type: object + Industry: description: An industry that is being researched properties: diff --git a/swagger/external/research-vernonkeenan.yaml b/swagger/external/research-vernonkeenan.yaml index bb06506..7e43f5d 100644 --- a/swagger/external/research-vernonkeenan.yaml +++ b/swagger/external/research-vernonkeenan.yaml @@ -383,6 +383,7 @@ paths: - $ref: "#/parameters/limitQuery" - $ref: "#/parameters/offsetQuery" - $ref: "#/parameters/slugQuery" + - $ref: "#/parameters/accountIdQuery" - $ref: "#/parameters/companyServiceIdQuery" responses: "200": diff --git a/swagger/plex-vernonkeenan.yaml b/swagger/plex-vernonkeenan.yaml index 4008ab7..2a15974 100644 --- a/swagger/plex-vernonkeenan.yaml +++ b/swagger/plex-vernonkeenan.yaml @@ -321,6 +321,12 @@ definitions: type: array items: $ref: "#/definitions/CompanyProduct" + CompanyServices: + description: Company Services + x-nullable: true + type: array + items: + $ref: "#/definitions/CompanyService" FinancialStatements: description: Financial Statements x-nullable: true @@ -396,6 +402,10 @@ definitions: description: ID of the Company that owns this Product type: string x-nullable: true + AppExchange: + description: Salesforce AppExchange URL + type: string + x-nullable: true CreatedByID: description: Created By User ID type: string @@ -467,6 +477,92 @@ definitions: description: Website type: string type: object + CompanyService: + description: A service performed by a Company + properties: + ID: + description: Record Id + type: string + AccountID: + description: ID of the Company that owns this Service + type: string + x-nullable: true + AppExchange: + description: Salesforce AppExchange URL + type: string + x-nullable: true + CreatedByID: + description: Created By User ID + type: string + x-nullable: true + CreatedDate: + description: Created Date + type: string + x-nullable: true + Description: + description: Description of service + type: string + x-nullable: true + FullDescription: + description: Full Description of service + type: string + x-nullable: true + ImageAltText: + description: Image Alt Text + type: string + x-nullable: true + ImageURL: + description: Image URL + type: string + x-nullable: true + Industries: + x-nullable: true + description: Industries + type: array + items: + $ref: "#/definitions/Industry" + LastModifiedByID: + description: Last Modified By User ID + type: string + x-nullable: true + LastModifiedDate: + description: Last Modified Date + type: string + x-nullable: true + Logo: + description: Logo + type: string + x-nullable: true + Name: + description: Service Name + type: string + x-nullable: true + Published: + description: Published + type: boolean + x-nullable: true + SalesforceSpecific: + description: Salesforce Specific + type: boolean + x-nullable: true + ServiceVideoID: + description: Service Video ID + type: string + x-nullable: true + Slug: + description: Slug + type: string + x-nullable: true + TagLine: + description: Tag Line + type: string + x-nullable: true + URL: + description: URL + type: string + x-nullable: true + type: object + Industry: description: An industry that is being researched properties: diff --git a/swagger/research-vernonkeenan.yaml b/swagger/research-vernonkeenan.yaml index ea63026..3c6ced6 100644 --- a/swagger/research-vernonkeenan.yaml +++ b/swagger/research-vernonkeenan.yaml @@ -383,6 +383,7 @@ paths: - $ref: "#/parameters/limitQuery" - $ref: "#/parameters/offsetQuery" - $ref: "#/parameters/slugQuery" + - $ref: "#/parameters/accountIdQuery" - $ref: "#/parameters/companyServiceIdQuery" responses: "200":