1// Code generated by go-swagger; DO NOT EDIT. 2 3// Copyright Prometheus Team 4// Licensed under the Apache License, Version 2.0 (the "License"); 5// you may not use this file except in compliance with the License. 6// You may obtain a copy of the License at 7// 8// http://www.apache.org/licenses/LICENSE-2.0 9// 10// Unless required by applicable law or agreed to in writing, software 11// distributed under the License is distributed on an "AS IS" BASIS, 12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13// See the License for the specific language governing permissions and 14// limitations under the License. 15// 16 17package models 18 19// This file was generated by the swagger tool. 20// Editing this file might prove futile when you re-run the swagger generate command 21 22import ( 23 "strconv" 24 25 "github.com/go-openapi/errors" 26 "github.com/go-openapi/strfmt" 27 "github.com/go-openapi/swag" 28) 29 30// GettableSilences gettable silences 31// 32// swagger:model gettableSilences 33type GettableSilences []*GettableSilence 34 35// Validate validates this gettable silences 36func (m GettableSilences) Validate(formats strfmt.Registry) error { 37 var res []error 38 39 for i := 0; i < len(m); i++ { 40 if swag.IsZero(m[i]) { // not required 41 continue 42 } 43 44 if m[i] != nil { 45 if err := m[i].Validate(formats); err != nil { 46 if ve, ok := err.(*errors.Validation); ok { 47 return ve.ValidateName(strconv.Itoa(i)) 48 } 49 return err 50 } 51 } 52 53 } 54 55 if len(res) > 0 { 56 return errors.CompositeValidationError(res...) 57 } 58 return nil 59} 60