...

Source file src/github.com/redhat-developer/odo/pkg/apiserver-gen/go/model_exec_command.go

Documentation: github.com/redhat-developer/odo/pkg/apiserver-gen/go

     1  /*
     2   * odo dev
     3   *
     4   * API interface for 'odo dev'
     5   *
     6   * API version: 0.1
     7   * Generated by: OpenAPI Generator (https://openapi-generator.tech)
     8   */
     9  
    10  package openapi
    11  
    12  type ExecCommand struct {
    13  	Component string `json:"component"`
    14  
    15  	CommandLine string `json:"commandLine"`
    16  
    17  	WorkingDir string `json:"workingDir"`
    18  
    19  	HotReloadCapable bool `json:"hotReloadCapable"`
    20  }
    21  
    22  // AssertExecCommandRequired checks if the required fields are not zero-ed
    23  func AssertExecCommandRequired(obj ExecCommand) error {
    24  	elements := map[string]interface{}{
    25  		"component":        obj.Component,
    26  		"commandLine":      obj.CommandLine,
    27  		"workingDir":       obj.WorkingDir,
    28  		"hotReloadCapable": obj.HotReloadCapable,
    29  	}
    30  	for name, el := range elements {
    31  		if isZero := IsZeroValue(el); isZero {
    32  			return &RequiredError{Field: name}
    33  		}
    34  	}
    35  
    36  	return nil
    37  }
    38  
    39  // AssertRecurseExecCommandRequired recursively checks if required fields are not zero-ed in a nested slice.
    40  // Accepts only nested slice of ExecCommand (e.g. [][]ExecCommand), otherwise ErrTypeAssertionError is thrown.
    41  func AssertRecurseExecCommandRequired(objSlice interface{}) error {
    42  	return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error {
    43  		aExecCommand, ok := obj.(ExecCommand)
    44  		if !ok {
    45  			return ErrTypeAssertionError
    46  		}
    47  		return AssertExecCommandRequired(aExecCommand)
    48  	})
    49  }
    50  

View as plain text