func (m *RepositoryBuildRequest) validateDockerTags(formats strfmt.Registry) error { if swag.IsZero(m.DockerTags) { // not required return nil } iDockerTagsSize := int64(len(m.DockerTags)) if err := validate.MinItems("docker_tags", "body", iDockerTagsSize, 1); err != nil { return err } if err := validate.UniqueItems("docker_tags", "body", m.DockerTags); err != nil { return err } for i := 0; i < len(m.DockerTags); i++ { if err := validate.RequiredString("docker_tags"+"."+strconv.Itoa(i), "body", string(m.DockerTags[i])); err != nil { return err } } return nil }
func (m *TaskCard) validateTags(formats strfmt.Registry) error { if swag.IsZero(m.Tags) { // not required return nil } iTagsSize := int64(len(m.Tags)) if err := validate.MaxItems("tags", "body", iTagsSize, 5); err != nil { return err } if err := validate.UniqueItems("tags", "body", m.Tags); err != nil { return err } for i := 0; i < len(m.Tags); i++ { if err := validate.RequiredString("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i])); err != nil { return err } if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 3); err != nil { return err } if err := validate.Pattern("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), `\w[\w- ]+`); err != nil { return err } } return nil }
func (s *stringValidator) Validate(val interface{}) *Result { data := val.(string) if s.Required && (s.Default == nil || s.Default == "") { if err := validate.RequiredString(s.Path, s.In, data); err != nil { return sErr(err) } } if s.MaxLength != nil { if err := validate.MaxLength(s.Path, s.In, data, *s.MaxLength); err != nil { return sErr(err) } } if s.MinLength != nil { if err := validate.MinLength(s.Path, s.In, data, *s.MinLength); err != nil { return sErr(err) } } if s.Pattern != "" { if err := validate.Pattern(s.Path, s.In, data, s.Pattern); err != nil { return sErr(err) } } return nil }
func (m *NewUser) validateUsername(formats strfmt.Registry) error { if err := validate.RequiredString("username", "body", string(m.Username)); err != nil { return err } return nil }
func (m *NewUser) validatePassword(formats strfmt.Registry) error { if err := validate.RequiredString("password", "body", string(m.Password)); err != nil { return err } return nil }
func (m *NewUser) validateEmail(formats strfmt.Registry) error { if err := validate.RequiredString("email", "body", string(m.Email)); err != nil { return err } return nil }
func (m *Comment) validateContent(formats strfmt.Registry) error { if err := validate.RequiredString("content", "body", string(m.Content)); err != nil { return err } return nil }
func (m *NewRepo) validateRepository(formats strfmt.Registry) error { if err := validate.RequiredString("repository", "body", string(m.Repository)); err != nil { return err } return nil }
func (m *Event) validateID(formats strfmt.Registry) error { if err := validate.RequiredString("id", "body", string(m.ID)); err != nil { return err } return nil }
func (m *UpdateApp) validateRedirectURI(formats strfmt.Registry) error { if err := validate.RequiredString("redirect_uri", "body", string(m.RedirectURI)); err != nil { return err } return nil }
func (m *UpdateApp) validateApplicationURI(formats strfmt.Registry) error { if err := validate.RequiredString("application_uri", "body", string(m.ApplicationURI)); err != nil { return err } return nil }
func (m *NewStarredRepository) validateNamespace(formats strfmt.Registry) error { if err := validate.RequiredString("namespace", "body", string(m.Namespace)); err != nil { return err } return nil }
func (m *RevertTag) validateImage(formats strfmt.Registry) error { if err := validate.RequiredString("image", "body", string(m.Image)); err != nil { return err } return nil }
func (o *AddCommentToTaskBody) validateContent(formats strfmt.Registry) error { if err := validate.RequiredString("body"+"."+"content", "body", string(o.Content)); err != nil { return err } return nil }
func (m *NotificationCreateRequest) validateEvent(formats strfmt.Registry) error { if err := validate.RequiredString("event", "body", string(m.Event)); err != nil { return err } return nil }
func (m *LearningResource) validateType(formats strfmt.Registry) error { if err := validate.RequiredString("type", "body", string(m.Type)); err != nil { return err } return nil }
func (m *LearningResource) validateURL(formats strfmt.Registry) error { if err := validate.RequiredString("url", "body", string(m.URL)); err != nil { return err } return nil }
func (m *RepoUpdate) validateDescription(formats strfmt.Registry) error { if err := validate.RequiredString("description", "body", string(m.Description)); err != nil { return err } return nil }
func (m *NewPrototypeDelegate) validateName(formats strfmt.Registry) error { if err := validate.RequiredString("delegate"+"."+"name", "body", string(m.Name)); err != nil { return err } return nil }
func (m *NewPrototypeActivatingUser) validateName(formats strfmt.Registry) error { if err := validate.RequiredString("activating_user"+"."+"name", "body", string(m.Name)); err != nil { return err } return nil }
func (m *Ticket) validateEventID(formats strfmt.Registry) error { if err := validate.RequiredString("event_id", "body", string(m.EventID)); err != nil { return err } return nil }
func (m *NewToken) validateFriendlyName(formats strfmt.Registry) error { if err := validate.RequiredString("friendlyName", "body", string(m.FriendlyName)); err != nil { return err } return nil }
func (m *Error) validateMessage(formats strfmt.Registry) error { if err := validate.RequiredString("message", "body", string(m.Message)); err != nil { return err } return nil }
func (m *Team) validateName(formats strfmt.Registry) error { if err := validate.RequiredString("name", "body", string(m.Name)); err != nil { return err } return nil }
func (m *NotificationCreateRequest) validateMethod(formats strfmt.Registry) error { if err := validate.RequiredString("method", "body", string(m.Method)); err != nil { return err } return nil }
func (o *DeletePetParams) bindAPIKey(raw string, formats strfmt.Registry) error { if err := validate.RequiredString("api_key", "header", raw); err != nil { return err } o.APIKey = raw return nil }
func (o *UpdatePetWithFormParams) bindStatus(raw string, formats strfmt.Registry) error { if err := validate.RequiredString("status", "formData", raw); err != nil { return err } o.Status = raw return nil }
func (m *NewPrototypeDelegate) validateKind(formats strfmt.Registry) error { if err := validate.RequiredString("delegate"+"."+"kind", "body", string(m.Kind)); err != nil { return err } if err := m.validateKindEnum("delegate"+"."+"kind", "body", m.Kind); err != nil { return err } return nil }
func (m *NewPrototype) validateRole(formats strfmt.Registry) error { if err := validate.RequiredString("role", "body", string(m.Role)); err != nil { return err } if err := m.validateRoleEnum("role", "body", m.Role); err != nil { return err } return nil }
func (m *Cluster) validateID(formats strfmt.Registry) error { if err := validate.RequiredString("id", "body", string(m.ID)); err != nil { return err } if err := validate.MinLength("id", "body", string(m.ID), 1); err != nil { return err } return nil }