github.com/ActiveState/cli@v0.0.0-20240508170324-6801f60cd051/pkg/platform/api/inventory/inventory_models/solution_response.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  package inventory_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  	"context"
    10  
    11  	"github.com/go-openapi/errors"
    12  	"github.com/go-openapi/strfmt"
    13  	"github.com/go-openapi/validate"
    14  )
    15  
    16  // SolutionResponse Solver Response
    17  //
    18  // The response to an order. It is a mapping of platform id to recipe id and location.
    19  //
    20  // swagger:model solutionResponse
    21  type SolutionResponse map[string]SolutionResponseAdditionalProperties
    22  
    23  // Validate validates this solution response
    24  func (m SolutionResponse) Validate(formats strfmt.Registry) error {
    25  	var res []error
    26  
    27  	for k := range m {
    28  
    29  		if err := validate.Required(k, "body", m[k]); err != nil {
    30  			return err
    31  		}
    32  		if val, ok := m[k]; ok {
    33  			if err := val.Validate(formats); err != nil {
    34  				return err
    35  			}
    36  		}
    37  
    38  	}
    39  
    40  	if len(res) > 0 {
    41  		return errors.CompositeValidationError(res...)
    42  	}
    43  	return nil
    44  }
    45  
    46  // ContextValidate validate this solution response based on the context it is used
    47  func (m SolutionResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
    48  	var res []error
    49  
    50  	for k := range m {
    51  
    52  		if val, ok := m[k]; ok {
    53  			if err := val.ContextValidate(ctx, formats); err != nil {
    54  				return err
    55  			}
    56  		}
    57  
    58  	}
    59  
    60  	if len(res) > 0 {
    61  		return errors.CompositeValidationError(res...)
    62  	}
    63  	return nil
    64  }