peridot/vendor/github.com/ory/hydra-client-go/models/plugin_device.go
2022-07-07 22:13:21 +02:00

122 lines
2.5 KiB
Go

// 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 (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// PluginDevice PluginDevice plugin device
//
// swagger:model PluginDevice
type PluginDevice struct {
// description
// Required: true
Description *string `json:"Description"`
// name
// Required: true
Name *string `json:"Name"`
// path
// Required: true
Path *string `json:"Path"`
// settable
// Required: true
Settable []string `json:"Settable"`
}
// Validate validates this plugin device
func (m *PluginDevice) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateDescription(formats); err != nil {
res = append(res, err)
}
if err := m.validateName(formats); err != nil {
res = append(res, err)
}
if err := m.validatePath(formats); err != nil {
res = append(res, err)
}
if err := m.validateSettable(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *PluginDevice) validateDescription(formats strfmt.Registry) error {
if err := validate.Required("Description", "body", m.Description); err != nil {
return err
}
return nil
}
func (m *PluginDevice) validateName(formats strfmt.Registry) error {
if err := validate.Required("Name", "body", m.Name); err != nil {
return err
}
return nil
}
func (m *PluginDevice) validatePath(formats strfmt.Registry) error {
if err := validate.Required("Path", "body", m.Path); err != nil {
return err
}
return nil
}
func (m *PluginDevice) validateSettable(formats strfmt.Registry) error {
if err := validate.Required("Settable", "body", m.Settable); err != nil {
return err
}
return nil
}
// ContextValidate validates this plugin device based on context it is used
func (m *PluginDevice) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *PluginDevice) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *PluginDevice) UnmarshalBinary(b []byte) error {
var res PluginDevice
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}