github.com/sap/cf-mta-plugin@v2.6.3+incompatible/clients/models/module.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  package 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  	strfmt "github.com/go-openapi/strfmt"
    10  
    11  	"github.com/go-openapi/errors"
    12  	"github.com/go-openapi/swag"
    13  )
    14  
    15  // Module module
    16  // swagger:model Module
    17  
    18  type Module struct {
    19  
    20  	// app name
    21  	AppName string `json:"appName,omitempty"`
    22  
    23  	// created on
    24  	CreatedOn strfmt.Date `json:"createdOn,omitempty"`
    25  
    26  	// module name
    27  	ModuleName string `json:"moduleName,omitempty"`
    28  
    29  	// provided dendency names
    30  	ProvidedDendencyNames []string `json:"providedDendencyNames"`
    31  
    32  	// services
    33  	Services []string `json:"services"`
    34  
    35  	// updated on
    36  	UpdatedOn strfmt.Date `json:"updatedOn,omitempty"`
    37  
    38  	// uris
    39  	Uris []string `json:"uris"`
    40  }
    41  
    42  /* polymorph Module appName false */
    43  
    44  /* polymorph Module createdOn false */
    45  
    46  /* polymorph Module moduleName false */
    47  
    48  /* polymorph Module providedDendencyNames false */
    49  
    50  /* polymorph Module services false */
    51  
    52  /* polymorph Module updatedOn false */
    53  
    54  /* polymorph Module uris false */
    55  
    56  // Validate validates this module
    57  func (m *Module) Validate(formats strfmt.Registry) error {
    58  	var res []error
    59  
    60  	if err := m.validateProvidedDendencyNames(formats); err != nil {
    61  		// prop
    62  		res = append(res, err)
    63  	}
    64  
    65  	if err := m.validateServices(formats); err != nil {
    66  		// prop
    67  		res = append(res, err)
    68  	}
    69  
    70  	if err := m.validateUris(formats); err != nil {
    71  		// prop
    72  		res = append(res, err)
    73  	}
    74  
    75  	if len(res) > 0 {
    76  		return errors.CompositeValidationError(res...)
    77  	}
    78  	return nil
    79  }
    80  
    81  func (m *Module) validateProvidedDendencyNames(formats strfmt.Registry) error {
    82  
    83  	if swag.IsZero(m.ProvidedDendencyNames) { // not required
    84  		return nil
    85  	}
    86  
    87  	return nil
    88  }
    89  
    90  func (m *Module) validateServices(formats strfmt.Registry) error {
    91  
    92  	if swag.IsZero(m.Services) { // not required
    93  		return nil
    94  	}
    95  
    96  	return nil
    97  }
    98  
    99  func (m *Module) validateUris(formats strfmt.Registry) error {
   100  
   101  	if swag.IsZero(m.Uris) { // not required
   102  		return nil
   103  	}
   104  
   105  	return nil
   106  }
   107  
   108  // MarshalBinary interface implementation
   109  func (m *Module) MarshalBinary() ([]byte, error) {
   110  	if m == nil {
   111  		return nil, nil
   112  	}
   113  	return swag.WriteJSON(m)
   114  }
   115  
   116  // UnmarshalBinary interface implementation
   117  func (m *Module) UnmarshalBinary(b []byte) error {
   118  	var res Module
   119  	if err := swag.ReadJSON(b, &res); err != nil {
   120  		return err
   121  	}
   122  	*m = res
   123  	return nil
   124  }