# -*- coding: utf-8 -*-

"""
shelldatareportingapis

This file was automatically generated by APIMATIC v3.0 (
 https://www.apimatic.io ).
"""


class UpdateOdometer(object):

    """Implementation of the 'UpdateOdometer' model.

    TODO: type model description here.

    Attributes:
        sales_item_id (str): Unique SalesItemId (Either Billed on Unbilled)
            Mandatory
        new_odometer_value (int): NewOdometerValue that needs to be updated

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "sales_item_id": 'SalesItemId',
        "new_odometer_value": 'NewOdometerValue'
    }

    _nullables = [
        'sales_item_id',
        'new_odometer_value',
    ]

    def __init__(self,
                 sales_item_id=None,
                 new_odometer_value=None):
        """Constructor for the UpdateOdometer class"""

        # Initialize members of the class
        self.sales_item_id = sales_item_id 
        self.new_odometer_value = new_odometer_value 

    @classmethod
    def from_dictionary(cls,
                        dictionary):
        """Creates an instance of this model from a dictionary

        Args:
            dictionary (dictionary): A dictionary representation of the object
            as obtained from the deserialization of the server's response. The
            keys MUST match property names in the API description.

        Returns:
            object: An instance of this structure class.

        """

        if not isinstance(dictionary, dict) or dictionary is None:
            return None

        # Extract variables from the dictionary
        sales_item_id = dictionary.get("SalesItemId") if dictionary.get("SalesItemId") else None
        new_odometer_value = dictionary.get("NewOdometerValue") if dictionary.get("NewOdometerValue") else None
        # Return an object of this model
        return cls(sales_item_id,
                   new_odometer_value)
