Esempio n. 1
0
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.Required("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
}
Esempio n. 2
0
func (m *Pet) validatePhotoUrls(formats strfmt.Registry) error {

	if err := validate.Required("photoUrls", "body", m.PhotoUrls); err != nil {
		return err
	}

	for i := 0; i < len(m.PhotoUrls); i++ {

		if err := validate.Required("photoUrls"+"."+strconv.Itoa(i), "body", string(m.PhotoUrls[i])); err != nil {
			return err
		}

	}

	return nil
}
Esempio n. 3
0
func (o *AddCommentToTaskBody) validateUserID(formats strfmt.Registry) error {

	if err := validate.Required("body"+"."+"userId", "body", int64(o.UserID)); err != nil {
		return err
	}

	return nil
}
func (m *CreateSubscriptionRequest) validateProductRatePlan(formats strfmt.Registry) error {

	if err := validate.Required("productRatePlan", "body", string(m.ProductRatePlan)); err != nil {
		return err
	}

	return nil
}
Esempio n. 5
0
func (m *NewUser) validateUsername(formats strfmt.Registry) error {

	if err := validate.Required("username", "body", string(m.Username)); err != nil {
		return err
	}

	return nil
}
Esempio n. 6
0
func (m *NewUser) validateEmail(formats strfmt.Registry) error {

	if err := validate.Required("email", "body", string(m.Email)); err != nil {
		return err
	}

	return nil
}
Esempio n. 7
0
func (m *NewPrototypeDelegate) validateName(formats strfmt.Registry) error {

	if err := validate.Required("delegate"+"."+"name", "body", string(m.Name)); err != nil {
		return err
	}

	return nil
}
Esempio n. 8
0
func (m *NewStarredRepository) validateRepository(formats strfmt.Registry) error {

	if err := validate.Required("repository", "body", string(m.Repository)); err != nil {
		return err
	}

	return nil
}
Esempio n. 9
0
func (m *RevertTag) validateImage(formats strfmt.Registry) error {

	if err := validate.Required("image", "body", string(m.Image)); err != nil {
		return err
	}

	return nil
}
Esempio n. 10
0
func (m *UpdateApp) validateRedirectURI(formats strfmt.Registry) error {

	if err := validate.Required("redirect_uri", "body", string(m.RedirectURI)); err != nil {
		return err
	}

	return nil
}
Esempio n. 11
0
func (m *UpdateApp) validateApplicationURI(formats strfmt.Registry) error {

	if err := validate.Required("application_uri", "body", string(m.ApplicationURI)); err != nil {
		return err
	}

	return nil
}
func (m *MutableBillingEntity) validateRefreshTokenURL(formats strfmt.Registry) error {

	if err := validate.Required("refreshTokenUrl", "body", string(m.RefreshTokenURL)); err != nil {
		return err
	}

	return nil
}
func (m *MutableBillingEntity) validateAppSecret(formats strfmt.Registry) error {

	if err := validate.Required("appSecret", "body", string(m.AppSecret)); err != nil {
		return err
	}

	return nil
}
func (m *InsertableBillingEntity) validateRole(formats strfmt.Registry) error {

	if err := validate.Required("role", "body", string(m.Role)); err != nil {
		return err
	}

	return nil
}
func (m *InsertableBillingEntity) validateOrganizationID(formats strfmt.Registry) error {

	if err := validate.Required("organizationID", "body", string(m.OrganizationID)); err != nil {
		return err
	}

	return nil
}
Esempio n. 16
0
func (m *Ticket) validateNum(formats strfmt.Registry) error {

	if err := validate.Required("num", "body", int32(m.Num)); err != nil {
		return err
	}

	return nil
}
Esempio n. 17
0
func (m *NewStarredRepository) validateNamespace(formats strfmt.Registry) error {

	if err := validate.Required("namespace", "body", string(m.Namespace)); err != nil {
		return err
	}

	return nil
}
Esempio n. 18
0
func (m *UserView) validateVerified(formats strfmt.Registry) error {

	if err := validate.Required("verified", "body", bool(m.Verified)); err != nil {
		return err
	}

	return nil
}
Esempio n. 19
0
func (m *NewPrototypeActivatingUser) validateName(formats strfmt.Registry) error {

	if err := validate.Required("activating_user"+"."+"name", "body", string(m.Name)); err != nil {
		return err
	}

	return nil
}
Esempio n. 20
0
func (m *UserView) validateAnonymous(formats strfmt.Registry) error {

	if err := validate.Required("anonymous", "body", bool(m.Anonymous)); err != nil {
		return err
	}

	return nil
}
func (o *AddCommentToTaskBody) validateContent(formats strfmt.Registry) error {

	if err := validate.Required("body"+"."+"content", "body", string(o.Content)); err != nil {
		return err
	}

	return nil
}
Esempio n. 22
0
func (o *AddEventBody) validateMaxTicket(formats strfmt.Registry) error {

	if err := validate.Required("options"+"."+"max_ticket", "body", int32(o.MaxTicket)); err != nil {
		return err
	}

	return nil
}
Esempio n. 23
0
func (m *NewUser) validatePassword(formats strfmt.Registry) error {

	if err := validate.Required("password", "body", string(m.Password)); err != nil {
		return err
	}

	return nil
}
Esempio n. 24
0
func (m *PaymentMethod) validateExpiryDate(formats strfmt.Registry) error {

	if err := validate.Required("expiryDate", "body", string(m.ExpiryDate)); err != nil {
		return err
	}

	return nil
}
func (m *CreateSubscriptionRequest) validateAccountID(formats strfmt.Registry) error {

	if err := validate.Required("accountID", "body", string(m.AccountID)); err != nil {
		return err
	}

	return nil
}
Esempio n. 26
0
func (m *PaymentMethod) validateLinkID(formats strfmt.Registry) error {

	if err := validate.Required("linkID", "body", string(m.LinkID)); err != nil {
		return err
	}

	return nil
}
Esempio n. 27
0
func (m *LearningResource) validateID(formats strfmt.Registry) error {

	if err := validate.Required("id", "body", int64(m.ID)); err != nil {
		return err
	}

	return nil
}
func (m *NotificationCreateRequest) validateEvent(formats strfmt.Registry) error {

	if err := validate.Required("event", "body", string(m.Event)); err != nil {
		return err
	}

	return nil
}
Esempio n. 29
0
func (m *Pet) validateName(formats strfmt.Registry) error {

	if err := validate.Required("name", "body", string(m.Name)); err != nil {
		return err
	}

	return nil
}
func (m *NotificationCreateRequest) validateMethod(formats strfmt.Registry) error {

	if err := validate.Required("method", "body", string(m.Method)); err != nil {
		return err
	}

	return nil
}