github.com/ActiveState/cli@v0.0.0-20240508170324-6801f60cd051/pkg/platform/api/mono/mono_models/sys_info.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  package mono_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/swag"
    14  	"github.com/go-openapi/validate"
    15  )
    16  
    17  // SysInfo sys info
    18  //
    19  // swagger:model SysInfo
    20  type SysInfo struct {
    21  
    22  	// banner
    23  	Banner string `json:"banner,omitempty"`
    24  
    25  	// branch
    26  	Branch string `json:"branch,omitempty"`
    27  
    28  	// build date
    29  	// Format: date-time
    30  	BuildDate strfmt.DateTime `json:"buildDate,omitempty"`
    31  
    32  	// build host
    33  	BuildHost string `json:"buildHost,omitempty"`
    34  
    35  	// build user
    36  	BuildUser string `json:"buildUser,omitempty"`
    37  
    38  	// database
    39  	Database string `json:"database,omitempty"`
    40  
    41  	// environment
    42  	Environment string `json:"environment,omitempty"`
    43  
    44  	// golang
    45  	Golang string `json:"golang,omitempty"`
    46  
    47  	// version
    48  	Version string `json:"version,omitempty"`
    49  }
    50  
    51  // Validate validates this sys info
    52  func (m *SysInfo) Validate(formats strfmt.Registry) error {
    53  	var res []error
    54  
    55  	if err := m.validateBuildDate(formats); err != nil {
    56  		res = append(res, err)
    57  	}
    58  
    59  	if len(res) > 0 {
    60  		return errors.CompositeValidationError(res...)
    61  	}
    62  	return nil
    63  }
    64  
    65  func (m *SysInfo) validateBuildDate(formats strfmt.Registry) error {
    66  	if swag.IsZero(m.BuildDate) { // not required
    67  		return nil
    68  	}
    69  
    70  	if err := validate.FormatOf("buildDate", "body", "date-time", m.BuildDate.String(), formats); err != nil {
    71  		return err
    72  	}
    73  
    74  	return nil
    75  }
    76  
    77  // ContextValidate validates this sys info based on context it is used
    78  func (m *SysInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
    79  	return nil
    80  }
    81  
    82  // MarshalBinary interface implementation
    83  func (m *SysInfo) MarshalBinary() ([]byte, error) {
    84  	if m == nil {
    85  		return nil, nil
    86  	}
    87  	return swag.WriteJSON(m)
    88  }
    89  
    90  // UnmarshalBinary interface implementation
    91  func (m *SysInfo) UnmarshalBinary(b []byte) error {
    92  	var res SysInfo
    93  	if err := swag.ReadJSON(b, &res); err != nil {
    94  		return err
    95  	}
    96  	*m = res
    97  	return nil
    98  }