| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- // 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"
- )
- // Powerplant powerplant
- //
- // swagger:model powerplant
- type Powerplant struct {
- // efficiency
- // Required: true
- Efficiency *float64 `json:"efficiency"`
- // name
- // Required: true
- Name *string `json:"name"`
- // pmax
- // Required: true
- Pmax *float64 `json:"pmax"`
- // pmin
- // Required: true
- Pmin *float64 `json:"pmin"`
- // type
- // Required: true
- Type *string `json:"type"`
- }
- // Validate validates this powerplant
- func (m *Powerplant) Validate(formats strfmt.Registry) error {
- var res []error
- if err := m.validateEfficiency(formats); err != nil {
- res = append(res, err)
- }
- if err := m.validateName(formats); err != nil {
- res = append(res, err)
- }
- if err := m.validatePmax(formats); err != nil {
- res = append(res, err)
- }
- if err := m.validatePmin(formats); err != nil {
- res = append(res, err)
- }
- if err := m.validateType(formats); err != nil {
- res = append(res, err)
- }
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
- }
- func (m *Powerplant) validateEfficiency(formats strfmt.Registry) error {
- if err := validate.Required("efficiency", "body", m.Efficiency); err != nil {
- return err
- }
- return nil
- }
- func (m *Powerplant) validateName(formats strfmt.Registry) error {
- if err := validate.Required("name", "body", m.Name); err != nil {
- return err
- }
- return nil
- }
- func (m *Powerplant) validatePmax(formats strfmt.Registry) error {
- if err := validate.Required("pmax", "body", m.Pmax); err != nil {
- return err
- }
- return nil
- }
- func (m *Powerplant) validatePmin(formats strfmt.Registry) error {
- if err := validate.Required("pmin", "body", m.Pmin); err != nil {
- return err
- }
- return nil
- }
- func (m *Powerplant) validateType(formats strfmt.Registry) error {
- if err := validate.Required("type", "body", m.Type); err != nil {
- return err
- }
- return nil
- }
- // ContextValidate validates this powerplant based on context it is used
- func (m *Powerplant) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- return nil
- }
- // MarshalBinary interface implementation
- func (m *Powerplant) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
- }
- // UnmarshalBinary interface implementation
- func (m *Powerplant) UnmarshalBinary(b []byte) error {
- var res Powerplant
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
- }
|