lib/api/members/members_models/course_section.go

130 lines
2.7 KiB
Go
Raw Normal View History

2023-03-28 17:47:34 +00:00
// 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 members_models
import (
"context"
2023-04-30 02:07:31 +00:00
"github.com/go-openapi/errors"
2023-03-28 17:47:34 +00:00
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag/jsonutils"
"github.com/go-openapi/swag/typeutils"
"github.com/go-openapi/validate"
2023-03-28 17:47:34 +00:00
)
// CourseSection Estate-global section linked to one Course.
2023-03-28 17:47:34 +00:00
//
// swagger:model CourseSection
2023-03-28 17:47:34 +00:00
type CourseSection struct {
2023-04-30 02:07:31 +00:00
// content
Content *string `json:"Content,omitempty"`
2023-03-28 17:47:34 +00:00
// course ID
2023-04-15 14:27:18 +00:00
CourseID *string `json:"CourseID,omitempty"`
2023-03-28 17:47:34 +00:00
// created by ID
2023-04-15 14:27:18 +00:00
CreatedByID *string `json:"CreatedByID,omitempty"`
2023-03-28 17:47:34 +00:00
// created date
CreatedDate *string `json:"CreatedDate,omitempty"`
// ID
ID string `json:"ID,omitempty"`
2023-04-30 02:07:31 +00:00
// image alt text
ImageAltText *string `json:"ImageAltText,omitempty"`
// image URL
ImageURL *string `json:"ImageURL,omitempty"`
2023-03-28 17:47:34 +00:00
// last modified by ID
2023-04-15 14:27:18 +00:00
LastModifiedByID *string `json:"LastModifiedByID,omitempty"`
2023-03-28 17:47:34 +00:00
// last modified date
LastModifiedDate *string `json:"LastModifiedDate,omitempty"`
2023-04-30 02:07:31 +00:00
// logo
Logo *string `json:"Logo,omitempty"`
2023-03-28 17:47:34 +00:00
// order
2023-04-30 02:07:31 +00:00
Order *int64 `json:"Order,omitempty"`
// slug
// Max Length: 80
2023-04-30 02:07:31 +00:00
Slug *string `json:"Slug,omitempty"`
2023-03-28 17:47:34 +00:00
// title
// Max Length: 255
2023-04-15 14:27:18 +00:00
Title *string `json:"Title,omitempty"`
2023-03-28 17:47:34 +00:00
}
// Validate validates this course section
func (m *CourseSection) Validate(formats strfmt.Registry) error {
2023-04-30 02:07:31 +00:00
var res []error
if err := m.validateSlug(formats); err != nil {
res = append(res, err)
}
if err := m.validateTitle(formats); err != nil {
2023-04-30 02:07:31 +00:00
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
2023-03-28 17:47:34 +00:00
return nil
}
func (m *CourseSection) validateSlug(formats strfmt.Registry) error {
if typeutils.IsZero(m.Slug) { // not required
2023-04-30 02:07:31 +00:00
return nil
}
if err := validate.MaxLength("Slug", "body", *m.Slug, 80); err != nil {
return err
2023-04-30 02:07:31 +00:00
}
return nil
}
func (m *CourseSection) validateTitle(formats strfmt.Registry) error {
if typeutils.IsZero(m.Title) { // not required
return nil
2023-04-30 02:07:31 +00:00
}
if err := validate.MaxLength("Title", "body", *m.Title, 255); err != nil {
return err
2023-04-30 02:07:31 +00:00
}
2023-04-30 02:07:31 +00:00
return nil
}
// ContextValidate validates this course section based on context it is used
func (m *CourseSection) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
2023-03-28 17:47:34 +00:00
return nil
}
// MarshalBinary interface implementation
func (m *CourseSection) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return jsonutils.WriteJSON(m)
2023-03-28 17:47:34 +00:00
}
// UnmarshalBinary interface implementation
func (m *CourseSection) UnmarshalBinary(b []byte) error {
var res CourseSection
if err := jsonutils.ReadJSON(b, &res); err != nil {
2023-03-28 17:47:34 +00:00
return err
}
*m = res
return nil
}