...

Source file src/github.com/redhat-developer/odo/pkg/apiserver-gen/go/model_composite_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 CompositeCommand struct {
    13  	Commands []string `json:"commands"`
    14  
    15  	Parallel bool `json:"parallel"`
    16  }
    17  
    18  // AssertCompositeCommandRequired checks if the required fields are not zero-ed
    19  func AssertCompositeCommandRequired(obj CompositeCommand) error {
    20  	elements := map[string]interface{}{
    21  		"commands": obj.Commands,
    22  		"parallel": obj.Parallel,
    23  	}
    24  	for name, el := range elements {
    25  		if isZero := IsZeroValue(el); isZero {
    26  			return &RequiredError{Field: name}
    27  		}
    28  	}
    29  
    30  	return nil
    31  }
    32  
    33  // AssertRecurseCompositeCommandRequired recursively checks if required fields are not zero-ed in a nested slice.
    34  // Accepts only nested slice of CompositeCommand (e.g. [][]CompositeCommand), otherwise ErrTypeAssertionError is thrown.
    35  func AssertRecurseCompositeCommandRequired(objSlice interface{}) error {
    36  	return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error {
    37  		aCompositeCommand, ok := obj.(CompositeCommand)
    38  		if !ok {
    39  			return ErrTypeAssertionError
    40  		}
    41  		return AssertCompositeCommandRequired(aCompositeCommand)
    42  	})
    43  }
    44  

View as plain text