From eacab45cfa45f954fb9a33bd3af34dc5d3ab22dd Mon Sep 17 00:00:00 2001 From: powervs-ibm Date: Thu, 12 Dec 2024 16:38:17 +0000 Subject: [PATCH] Generated Swagger client from service-broker commit a395a23df07c454a8577d59b80ffb6ba29b0db49 --- power/models/tags.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/power/models/tags.go b/power/models/tags.go index 477c7687..26e030c0 100644 --- a/power/models/tags.go +++ b/power/models/tags.go @@ -7,8 +7,11 @@ package models import ( "context" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // Tags List of user tags @@ -18,6 +21,29 @@ type Tags []string // Validate validates this tags func (m Tags) Validate(formats strfmt.Registry) error { + var res []error + + iTagsSize := int64(len(m)) + + if err := validate.MaxItems("", "body", iTagsSize, 100); err != nil { + return err + } + + for i := 0; i < len(m); i++ { + + if err := validate.MaxLength(strconv.Itoa(i), "body", m[i], 128); err != nil { + return err + } + + if err := validate.Pattern(strconv.Itoa(i), "body", m[i], `^[\s]*[A-Za-z0-9:_.\-][A-Za-z0-9\s:_.\-]*$`); err != nil { + return err + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } return nil }