# 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 GenericBodylineRequest(Model):
    """Representation of a generic "empty" bodyline which is not associated with a
    specific bill or template.

    :param observation_type_id: The observation type
     For account body lines the observation type must be a charge type <span
     class='property-internal'>Required when CalculationType is set to Fixed,
     or Percentage</span>
    :type observation_type_id: int
    :param caption: The caption <span class='property-internal'>Must be
     between 0 and 32 characters</span> <span
     class='property-internal'>Required when CalculationType is set to Fixed,
     or Percentage, or Subtotal</span>
    :type caption: str
    :param calculation_type: The calculation type for the line item <span
     class='property-internal'>One of Fixed, Percentage, Subtotal </span>
    :type calculation_type: str
    :param value: The bodyline's value
     When CalculationType is Fixed.  Precision max is 2
     When CalculationType is Percentage.  Precision max is 8 <span
     class='property-internal'>Required when CalculationType is set to Fixed,
     or Percentage</span>
    :type value: float
    """

    _validation = {
        'caption': {'max_length': 32, 'min_length': 0},
    }

    _attribute_map = {
        'observation_type_id': {'key': 'observationTypeId', 'type': 'int'},
        'caption': {'key': 'caption', 'type': 'str'},
        'calculation_type': {'key': 'calculationType', 'type': 'str'},
        'value': {'key': 'value', 'type': 'float'},
    }

    def __init__(self, observation_type_id=None, caption=None, calculation_type=None, value=None):
        super(GenericBodylineRequest, self).__init__()
        self.observation_type_id = observation_type_id
        self.caption = caption
        self.calculation_type = calculation_type
        self.value = value
