#
# Copyright 2021 DataRobot, Inc. and its affiliates.
#
# All rights reserved.
#
# DataRobot, Inc.
#
# This is proprietary source code of DataRobot, Inc. and its
# affiliates.
#
# Released under the terms of DataRobot Tool and Utility Agreement.
"""
Autogenerated DataRobot python client file.  Please don't modify.
"""

import trafaret as t
from datarobot.models.api_object import APIObject

class TimeDelta(APIObject):
    """
    Attributes
    ----------
    duration:int
         Value/size of this time delta.
    time_unit:str
         Time unit name like 'MINUTE', 'DAY', 'MONTH' etc.
    """
    _converter = t.Dict(
        {
            t.Key("duration"):  t.Int(),
            t.Key("time_unit"):  t.String(),
        }
    ).ignore_extra("*")

    def __init__(
        self,
        duration,
        time_unit,
    ):
        self.duration = duration
        self.time_unit = time_unit

    def __repr__(self):
        return (
            "TimeDelta("
            "duration={0.duration}, "
            "time_unit={0.time_unit}, "
        ).format(self)
