// Code generated by go-swagger; DO NOT EDIT.

package models

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"github.com/go-openapi/errors"
	"github.com/go-openapi/strfmt"
	"github.com/go-openapi/swag"
	"github.com/go-openapi/validate"
)

// GetAiGatewayProvidersOKBody get ai gateway providers o k body
//
// swagger:model getAiGatewayProvidersOKBody
type GetAiGatewayProvidersOKBody struct {

	// providers
	Providers map[string]ProviderDefinition `json:"providers,omitempty"`
}

// Validate validates this get ai gateway providers o k body
func (m *GetAiGatewayProvidersOKBody) Validate(formats strfmt.Registry) error {
	var res []error

	if err := m.validateProviders(formats); err != nil {
		res = append(res, err)
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}

func (m *GetAiGatewayProvidersOKBody) validateProviders(formats strfmt.Registry) error {

	if swag.IsZero(m.Providers) { // not required
		return nil
	}

	for k := range m.Providers {

		if err := validate.Required("providers"+"."+k, "body", m.Providers[k]); err != nil {
			return err
		}
		if val, ok := m.Providers[k]; ok {
			if err := val.Validate(formats); err != nil {
				return err
			}
		}

	}

	return nil
}

// MarshalBinary interface implementation
func (m *GetAiGatewayProvidersOKBody) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}

// UnmarshalBinary interface implementation
func (m *GetAiGatewayProvidersOKBody) UnmarshalBinary(b []byte) error {
	var res GetAiGatewayProvidersOKBody
	if err := swag.ReadJSON(b, &res); err != nil {
		return err
	}
	*m = res
	return nil
}
