...

Source file src/github.com/redhat-developer/odo/pkg/apiserver-gen/go/model__devstate_container_post_request.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 DevstateContainerPostRequest struct {
    13  
    14  	// Name of the container
    15  	Name string `json:"name"`
    16  
    17  	// Container image
    18  	Image string `json:"image"`
    19  
    20  	// Entrypoint of the container
    21  	Command []string `json:"command,omitempty"`
    22  
    23  	// Args passed to the Container entrypoint
    24  	Args []string `json:"args,omitempty"`
    25  
    26  	// Environment variables to define
    27  	Env []Env `json:"env,omitempty"`
    28  
    29  	// Requested memory for the deployed container
    30  	MemReq string `json:"memReq,omitempty"`
    31  
    32  	// Memory limit for the deployed container
    33  	MemLimit string `json:"memLimit,omitempty"`
    34  
    35  	// Requested CPU for the deployed container
    36  	CpuReq string `json:"cpuReq,omitempty"`
    37  
    38  	// CPU limit for the deployed container
    39  	CpuLimit string `json:"cpuLimit,omitempty"`
    40  
    41  	// Volume to mount into the container filesystem
    42  	VolumeMounts []VolumeMount `json:"volumeMounts,omitempty"`
    43  
    44  	// If false, mountSources and sourceMapping values are not considered
    45  	ConfigureSources bool `json:"configureSources,omitempty"`
    46  
    47  	// If true, sources are mounted into container's filesystem
    48  	MountSources bool `json:"mountSources,omitempty"`
    49  
    50  	// Specific directory on which to mount sources
    51  	SourceMapping string `json:"sourceMapping,omitempty"`
    52  
    53  	Annotation Annotation `json:"annotation,omitempty"`
    54  
    55  	// Endpoints exposed by the container
    56  	Endpoints []Endpoint `json:"endpoints,omitempty"`
    57  }
    58  
    59  // AssertDevstateContainerPostRequestRequired checks if the required fields are not zero-ed
    60  func AssertDevstateContainerPostRequestRequired(obj DevstateContainerPostRequest) error {
    61  	elements := map[string]interface{}{
    62  		"name":  obj.Name,
    63  		"image": obj.Image,
    64  	}
    65  	for name, el := range elements {
    66  		if isZero := IsZeroValue(el); isZero {
    67  			return &RequiredError{Field: name}
    68  		}
    69  	}
    70  
    71  	for _, el := range obj.Env {
    72  		if err := AssertEnvRequired(el); err != nil {
    73  			return err
    74  		}
    75  	}
    76  	for _, el := range obj.VolumeMounts {
    77  		if err := AssertVolumeMountRequired(el); err != nil {
    78  			return err
    79  		}
    80  	}
    81  	if err := AssertAnnotationRequired(obj.Annotation); err != nil {
    82  		return err
    83  	}
    84  	for _, el := range obj.Endpoints {
    85  		if err := AssertEndpointRequired(el); err != nil {
    86  			return err
    87  		}
    88  	}
    89  	return nil
    90  }
    91  
    92  // AssertRecurseDevstateContainerPostRequestRequired recursively checks if required fields are not zero-ed in a nested slice.
    93  // Accepts only nested slice of DevstateContainerPostRequest (e.g. [][]DevstateContainerPostRequest), otherwise ErrTypeAssertionError is thrown.
    94  func AssertRecurseDevstateContainerPostRequestRequired(objSlice interface{}) error {
    95  	return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error {
    96  		aDevstateContainerPostRequest, ok := obj.(DevstateContainerPostRequest)
    97  		if !ok {
    98  			return ErrTypeAssertionError
    99  		}
   100  		return AssertDevstateContainerPostRequestRequired(aDevstateContainerPostRequest)
   101  	})
   102  }
   103  

View as plain text