From f0a768157ca438c270903af57af9bcc4c11cf814 Mon Sep 17 00:00:00 2001 From: Vernon Keenan Date: Sat, 17 Jun 2023 16:42:54 +0000 Subject: [PATCH] prompt answer response --- .../sfgate_models/prompt_answer_response.go | 46 +++++++++++++++++++ api/sfgate/sfgate_models/role.go | 2 +- swagger/external/sf-gate-vernonkeenan.yaml | 4 +- swagger/sf-gate-vernonkeenan.yaml | 4 +- 4 files changed, 53 insertions(+), 3 deletions(-) diff --git a/api/sfgate/sfgate_models/prompt_answer_response.go b/api/sfgate/sfgate_models/prompt_answer_response.go index 08465ce..0ba3666 100644 --- a/api/sfgate/sfgate_models/prompt_answer_response.go +++ b/api/sfgate/sfgate_models/prompt_answer_response.go @@ -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 { diff --git a/api/sfgate/sfgate_models/role.go b/api/sfgate/sfgate_models/role.go index 2b16422..e4705c6 100644 --- a/api/sfgate/sfgate_models/role.go +++ b/api/sfgate/sfgate_models/role.go @@ -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"` diff --git a/swagger/external/sf-gate-vernonkeenan.yaml b/swagger/external/sf-gate-vernonkeenan.yaml index 1baa4d3..61cd00f 100644 --- a/swagger/external/sf-gate-vernonkeenan.yaml +++ b/swagger/external/sf-gate-vernonkeenan.yaml @@ -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 diff --git a/swagger/sf-gate-vernonkeenan.yaml b/swagger/sf-gate-vernonkeenan.yaml index dd0549b..a2655d4 100644 --- a/swagger/sf-gate-vernonkeenan.yaml +++ b/swagger/sf-gate-vernonkeenan.yaml @@ -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