github.com/sap/cf-mta-plugin@v2.6.3+incompatible/clients/models/cloud_foundry_response_resources.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  package models
     4  
     5  // This file was generated by the swagger tool.
     6  // Editing this file might prove futile when you re-run the swagger generate command
     7  
     8  import (
     9  	"strconv"
    10  
    11  	strfmt "github.com/go-openapi/strfmt"
    12  
    13  	"github.com/go-openapi/errors"
    14  	"github.com/go-openapi/swag"
    15  )
    16  
    17  // CloudFoundryResponseResources cloud foundry response resources
    18  // swagger:model cloudFoundryResponseResources
    19  
    20  type CloudFoundryResponseResources []*CloudFoundryResource
    21  
    22  // Validate validates this cloud foundry response resources
    23  func (m CloudFoundryResponseResources) Validate(formats strfmt.Registry) error {
    24  	var res []error
    25  
    26  	for i := 0; i < len(m); i++ {
    27  
    28  		if swag.IsZero(m[i]) { // not required
    29  			continue
    30  		}
    31  
    32  		if m[i] != nil {
    33  
    34  			if err := m[i].Validate(formats); err != nil {
    35  				if ve, ok := err.(*errors.Validation); ok {
    36  					return ve.ValidateName(strconv.Itoa(i))
    37  				}
    38  				return err
    39  			}
    40  		}
    41  
    42  	}
    43  
    44  	if len(res) > 0 {
    45  		return errors.CompositeValidationError(res...)
    46  	}
    47  	return nil
    48  }