feat: Add AppExchange URL field to CompanyProduct model

v0.6.4 v0.6.4
Vernon Keenan 2024-06-29 00:23:11 +00:00
parent 6846446ffa
commit 7eb2060c65
8 changed files with 465 additions and 0 deletions

View File

@ -53,6 +53,9 @@ type Company struct {
// Company Products // Company Products
CompanyProducts []*CompanyProduct `json:"CompanyProducts"` CompanyProducts []*CompanyProduct `json:"CompanyProducts"`
// Company Services
CompanyServices []*CompanyService `json:"CompanyServices"`
// Company Crunchbase URL // Company Crunchbase URL
CrunchbaseURL *string `json:"CrunchbaseURL,omitempty"` CrunchbaseURL *string `json:"CrunchbaseURL,omitempty"`
@ -173,6 +176,10 @@ func (m *Company) Validate(formats strfmt.Registry) error {
res = append(res, err) res = append(res, err)
} }
if err := m.validateCompanyServices(formats); err != nil {
res = append(res, err)
}
if err := m.validateFinancialStatements(formats); err != nil { if err := m.validateFinancialStatements(formats); err != nil {
res = append(res, err) res = append(res, err)
} }
@ -217,6 +224,32 @@ func (m *Company) validateCompanyProducts(formats strfmt.Registry) error {
return nil 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 { func (m *Company) validateFinancialStatements(formats strfmt.Registry) error {
if swag.IsZero(m.FinancialStatements) { // not required if swag.IsZero(m.FinancialStatements) { // not required
return nil return nil
@ -296,6 +329,10 @@ func (m *Company) ContextValidate(ctx context.Context, formats strfmt.Registry)
res = append(res, err) res = append(res, err)
} }
if err := m.contextValidateCompanyServices(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateFinancialStatements(ctx, formats); err != nil { if err := m.contextValidateFinancialStatements(ctx, formats); err != nil {
res = append(res, err) res = append(res, err)
} }
@ -334,6 +371,26 @@ func (m *Company) contextValidateCompanyProducts(ctx context.Context, formats st
return nil 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 { func (m *Company) contextValidateFinancialStatements(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.FinancialStatements); i++ { for i := 0; i < len(m.FinancialStatements); i++ {

View File

@ -26,6 +26,9 @@ type CompanyProduct struct {
// ID of the Company that owns this Product // ID of the Company that owns this Product
AccountID *string `json:"AccountID,omitempty"` AccountID *string `json:"AccountID,omitempty"`
// Salesforce AppExchange URL
AppExchange *string `json:"AppExchange,omitempty"`
// Created By User ID // Created By User ID
CreatedByID *string `json:"CreatedByID,omitempty"` CreatedByID *string `json:"CreatedByID,omitempty"`

View File

@ -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
}

View File

@ -66,6 +66,12 @@ GetCompanyServicesParams contains all the parameters to send to the API endpoint
*/ */
type GetCompanyServicesParams struct { type GetCompanyServicesParams struct {
/* AccountID.
Record Id of an Account
*/
AccountID *string
/* CompanyServiceID. /* CompanyServiceID.
CompanyService record ID CompanyService record ID
@ -147,6 +153,17 @@ func (o *GetCompanyServicesParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = 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 // WithCompanyServiceID adds the companyServiceID to the get company services params
func (o *GetCompanyServicesParams) WithCompanyServiceID(companyServiceID *string) *GetCompanyServicesParams { func (o *GetCompanyServicesParams) WithCompanyServiceID(companyServiceID *string) *GetCompanyServicesParams {
o.SetCompanyServiceID(companyServiceID) o.SetCompanyServiceID(companyServiceID)
@ -199,6 +216,23 @@ func (o *GetCompanyServicesParams) WriteToRequest(r runtime.ClientRequest, reg s
} }
var res []error 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 { if o.CompanyServiceID != nil {
// query param companyServiceId // query param companyServiceId

View File

@ -321,6 +321,12 @@ definitions:
type: array type: array
items: items:
$ref: "#/definitions/CompanyProduct" $ref: "#/definitions/CompanyProduct"
CompanyServices:
description: Company Services
x-nullable: true
type: array
items:
$ref: "#/definitions/CompanyService"
FinancialStatements: FinancialStatements:
description: Financial Statements description: Financial Statements
x-nullable: true x-nullable: true
@ -396,6 +402,10 @@ definitions:
description: ID of the Company that owns this Product description: ID of the Company that owns this Product
type: string type: string
x-nullable: true x-nullable: true
AppExchange:
description: Salesforce AppExchange URL
type: string
x-nullable: true
CreatedByID: CreatedByID:
description: Created By User ID description: Created By User ID
type: string type: string
@ -467,6 +477,92 @@ definitions:
description: Website description: Website
type: string type: string
type: object 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: Industry:
description: An industry that is being researched description: An industry that is being researched
properties: properties:

View File

@ -383,6 +383,7 @@ paths:
- $ref: "#/parameters/limitQuery" - $ref: "#/parameters/limitQuery"
- $ref: "#/parameters/offsetQuery" - $ref: "#/parameters/offsetQuery"
- $ref: "#/parameters/slugQuery" - $ref: "#/parameters/slugQuery"
- $ref: "#/parameters/accountIdQuery"
- $ref: "#/parameters/companyServiceIdQuery" - $ref: "#/parameters/companyServiceIdQuery"
responses: responses:
"200": "200":

View File

@ -321,6 +321,12 @@ definitions:
type: array type: array
items: items:
$ref: "#/definitions/CompanyProduct" $ref: "#/definitions/CompanyProduct"
CompanyServices:
description: Company Services
x-nullable: true
type: array
items:
$ref: "#/definitions/CompanyService"
FinancialStatements: FinancialStatements:
description: Financial Statements description: Financial Statements
x-nullable: true x-nullable: true
@ -396,6 +402,10 @@ definitions:
description: ID of the Company that owns this Product description: ID of the Company that owns this Product
type: string type: string
x-nullable: true x-nullable: true
AppExchange:
description: Salesforce AppExchange URL
type: string
x-nullable: true
CreatedByID: CreatedByID:
description: Created By User ID description: Created By User ID
type: string type: string
@ -467,6 +477,92 @@ definitions:
description: Website description: Website
type: string type: string
type: object 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: Industry:
description: An industry that is being researched description: An industry that is being researched
properties: properties:

View File

@ -383,6 +383,7 @@ paths:
- $ref: "#/parameters/limitQuery" - $ref: "#/parameters/limitQuery"
- $ref: "#/parameters/offsetQuery" - $ref: "#/parameters/offsetQuery"
- $ref: "#/parameters/slugQuery" - $ref: "#/parameters/slugQuery"
- $ref: "#/parameters/accountIdQuery"
- $ref: "#/parameters/companyServiceIdQuery" - $ref: "#/parameters/companyServiceIdQuery"
responses: responses:
"200": "200":