# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class UDFEdit(Model):
    """UDFEdit.

    All required parameters must be populated in order to send to Azure.

    :param name: Required. The UDF's name <span
     class='property-internal'>Required</span>
    :type name: str
    :param display_order: Required. <p>The UDF's display order</p>
     <p>A value of 1 or less will put this record the beginning of the list</p>
     <p>A value greater than the stored max will put this record at the end of
     the list</p>
     <p>When the old display order of the UDF being updated is less than the
     new specified display order, decrement the display order of all other UDFs
     falling between the old and new display order</p>
     <p>When the old display order of the UDF being updated is greater than the
     new specified display order, increment the display order of all other UDFs
     falling between the old and new display order</p>
     <p>All UDF lying outside the range of display orders being updated retain
     their original values</p> <span class='property-internal'>Required</span>
    :type display_order: int
    :param udf_select_values: <p>An array of options to populate a UDF select
     list.</p>
     <p>Required when the UDF being edited has a dataTypeId of 12 otherwise
     this will be ignored.</p>
     <p>To remove an option from the select list, omit it from this array.
     Options that are in use may not be deleted. To add a new option, pass in
     null as the udfSelectValueId</p>
    :type udf_select_values: list[~energycap.sdk.models.UDFSelectValueEdit]
    """

    _validation = {
        'name': {'required': True},
        'display_order': {'required': True},
    }

    _attribute_map = {
        'name': {'key': 'name', 'type': 'str'},
        'display_order': {'key': 'displayOrder', 'type': 'int'},
        'udf_select_values': {'key': 'udfSelectValues', 'type': '[UDFSelectValueEdit]'},
    }

    def __init__(self, **kwargs):
        super(UDFEdit, self).__init__(**kwargs)
        self.name = kwargs.get('name', None)
        self.display_order = kwargs.get('display_order', None)
        self.udf_select_values = kwargs.get('udf_select_values', None)
