mirror of https://github.com/vernonkeenan/lib
parent
7f54aa7811
commit
f0a768157c
|
@ -25,6 +25,9 @@ type PromptAnswerResponse struct {
|
|||
|
||||
// data
|
||||
Data []*PromptAnswer `json:"Data"`
|
||||
|
||||
// meta
|
||||
Meta *ResponseMeta `json:"Meta,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this prompt answer response
|
||||
|
@ -35,6 +38,10 @@ func (m *PromptAnswerResponse) Validate(formats strfmt.Registry) error {
|
|||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateMeta(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
|
@ -67,6 +74,25 @@ func (m *PromptAnswerResponse) validateData(formats strfmt.Registry) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (m *PromptAnswerResponse) validateMeta(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.Meta) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.Meta != nil {
|
||||
if err := m.Meta.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("Meta")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("Meta")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validate this prompt answer response based on the context it is used
|
||||
func (m *PromptAnswerResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
@ -75,6 +101,10 @@ func (m *PromptAnswerResponse) ContextValidate(ctx context.Context, formats strf
|
|||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.contextValidateMeta(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
|
@ -101,6 +131,22 @@ func (m *PromptAnswerResponse) contextValidateData(ctx context.Context, formats
|
|||
return nil
|
||||
}
|
||||
|
||||
func (m *PromptAnswerResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Meta != nil {
|
||||
if err := m.Meta.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("Meta")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("Meta")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *PromptAnswerResponse) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
|
|
|
@ -25,7 +25,7 @@ type Role struct {
|
|||
Auth0RoleID *string `json:"Auth0RoleID,omitempty"`
|
||||
|
||||
// created by
|
||||
CreatedByID *string `json:"CreatedByID:,omitempty"`
|
||||
CreatedByID *string `json:"CreatedByID,omitempty"`
|
||||
|
||||
// created date
|
||||
CreatedDate *string `json:"CreatedDate,omitempty"`
|
||||
|
|
|
@ -4608,6 +4608,8 @@ definitions:
|
|||
items:
|
||||
$ref: "../../lib/swagger/defs/prompt-answer.yaml#/PromptAnswer"
|
||||
type: array
|
||||
Meta:
|
||||
$ref: "#/definitions/ResponseMeta"
|
||||
type: object
|
||||
RequestMeta:
|
||||
properties:
|
||||
|
@ -4660,7 +4662,7 @@ definitions:
|
|||
description: the corresponding auth0 role
|
||||
type: string
|
||||
x-nullable: true
|
||||
"CreatedByID:":
|
||||
CreatedByID:
|
||||
description: created by
|
||||
type: string
|
||||
x-nullable: true
|
||||
|
|
|
@ -4608,6 +4608,8 @@ definitions:
|
|||
items:
|
||||
$ref: "../../lib/swagger/defs/prompt-answer.yaml#/PromptAnswer"
|
||||
type: array
|
||||
Meta:
|
||||
$ref: "#/definitions/ResponseMeta"
|
||||
type: object
|
||||
RequestMeta:
|
||||
properties:
|
||||
|
@ -4660,7 +4662,7 @@ definitions:
|
|||
description: the corresponding auth0 role
|
||||
type: string
|
||||
x-nullable: true
|
||||
"CreatedByID:":
|
||||
CreatedByID:
|
||||
description: created by
|
||||
type: string
|
||||
x-nullable: true
|
||||
|
|
Loading…
Reference in New Issue