This commit is contained in:
2024-04-20 16:45:56 +03:00
commit 937c8d8eab
34 changed files with 3048 additions and 0 deletions

View File

@@ -0,0 +1,117 @@
// Code generated by go-swagger; DO NOT EDIT.
package 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"
"encoding/json"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// Feedback feedback
//
// swagger:model Feedback
type Feedback struct {
// to have more context about the project
ProjectID string `json:"project_id,omitempty"`
// text
Text string `json:"text,omitempty"`
// type
// Enum: [feature_request feedback support]
Type string `json:"type,omitempty"`
// to have more context about the user
UserID string `json:"user_id,omitempty"`
}
// Validate validates this feedback
func (m *Feedback) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateType(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
var feedbackTypeTypePropEnum []interface{}
func init() {
var res []string
if err := json.Unmarshal([]byte(`["feature_request","feedback","support"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
feedbackTypeTypePropEnum = append(feedbackTypeTypePropEnum, v)
}
}
const (
// FeedbackTypeFeatureRequest captures enum value "feature_request"
FeedbackTypeFeatureRequest string = "feature_request"
// FeedbackTypeFeedback captures enum value "feedback"
FeedbackTypeFeedback string = "feedback"
// FeedbackTypeSupport captures enum value "support"
FeedbackTypeSupport string = "support"
)
// prop value enum
func (m *Feedback) validateTypeEnum(path, location string, value string) error {
if err := validate.EnumCase(path, location, value, feedbackTypeTypePropEnum, true); err != nil {
return err
}
return nil
}
func (m *Feedback) validateType(formats strfmt.Registry) error {
if swag.IsZero(m.Type) { // not required
return nil
}
// value enum
if err := m.validateTypeEnum("type", "body", m.Type); err != nil {
return err
}
return nil
}
// ContextValidate validates this feedback based on context it is used
func (m *Feedback) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *Feedback) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Feedback) UnmarshalBinary(b []byte) error {
var res Feedback
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}