# 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 UDFUpdate(Model):
    """UDFUpdate.

    :param udf_id: The Udf's ID. When creating a new UDF, assign null to this
     property. <span class='property-internal'>Required (defined)</span>
    :type udf_id: int
    :param name: The UDF's name <span
     class='property-internal'>Required</span> <span
     class='property-internal'>Must be between 0 and 32 characters</span>
    :type name: str
    :param data_type_id: The UDF's data type identifier. Possible value
     include 1 (boolean), 2 (integer), 3 (string), 4 (double), 6 (date), 12
     (select list) and 13 (url) <span class='property-internal'>Required</span>
    :type data_type_id: 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> <span class='property-internal'>Required
     when dataTypeId is set to 12</span>
    :type udf_select_values: list[~energycap.sdk.models.UDFSelectValueUpdate]
    """

    _validation = {
        'udf_id': {'required': True},
        'name': {'required': True, 'max_length': 32, 'min_length': 0},
        'data_type_id': {'required': True},
    }

    _attribute_map = {
        'udf_id': {'key': 'udfId', 'type': 'int'},
        'name': {'key': 'name', 'type': 'str'},
        'data_type_id': {'key': 'dataTypeId', 'type': 'int'},
        'udf_select_values': {'key': 'udfSelectValues', 'type': '[UDFSelectValueUpdate]'},
    }

    def __init__(self, udf_id, name, data_type_id, udf_select_values=None):
        super(UDFUpdate, self).__init__()
        self.udf_id = udf_id
        self.name = name
        self.data_type_id = data_type_id
        self.udf_select_values = udf_select_values
