# coding: utf-8

"""
Copyright 2017 Square, Inc.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
"""


from pprint import pformat
from six import iteritems
import re


class Shift(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    """
    def __init__(self, id=None, employee_id=None, location_id=None, timezone=None, start_at=None, end_at=None, wage=None, breaks=None, status=None, version=None, created_at=None, updated_at=None):
        """
        Shift - a model defined in Swagger

        :param dict swaggerTypes: The key is attribute name
                                  and the value is attribute type.
        :param dict attributeMap: The key is attribute name
                                  and the value is json key in definition.
        """
        self.swagger_types = {
            'id': 'str',
            'employee_id': 'str',
            'location_id': 'str',
            'timezone': 'str',
            'start_at': 'str',
            'end_at': 'str',
            'wage': 'ShiftWage',
            'breaks': 'list[ModelBreak]',
            'status': 'str',
            'version': 'int',
            'created_at': 'str',
            'updated_at': 'str'
        }

        self.attribute_map = {
            'id': 'id',
            'employee_id': 'employee_id',
            'location_id': 'location_id',
            'timezone': 'timezone',
            'start_at': 'start_at',
            'end_at': 'end_at',
            'wage': 'wage',
            'breaks': 'breaks',
            'status': 'status',
            'version': 'version',
            'created_at': 'created_at',
            'updated_at': 'updated_at'
        }

        self._id = id
        self._employee_id = employee_id
        self._location_id = location_id
        self._timezone = timezone
        self._start_at = start_at
        self._end_at = end_at
        self._wage = wage
        self._breaks = breaks
        self._status = status
        self._version = version
        self._created_at = created_at
        self._updated_at = updated_at

    @property
    def id(self):
        """
        Gets the id of this Shift.
        UUID for this object

        :return: The id of this Shift.
        :rtype: str
        """
        return self._id

    @id.setter
    def id(self, id):
        """
        Sets the id of this Shift.
        UUID for this object

        :param id: The id of this Shift.
        :type: str
        """

        if id is None:
            raise ValueError("Invalid value for `id`, must not be `None`")
        if len(id) > 255:
            raise ValueError("Invalid value for `id`, length must be less than `255`")

        self._id = id

    @property
    def employee_id(self):
        """
        Gets the employee_id of this Shift.
        The ID of the employee this shift belongs to.

        :return: The employee_id of this Shift.
        :rtype: str
        """
        return self._employee_id

    @employee_id.setter
    def employee_id(self, employee_id):
        """
        Sets the employee_id of this Shift.
        The ID of the employee this shift belongs to.

        :param employee_id: The employee_id of this Shift.
        :type: str
        """

        if employee_id is None:
            raise ValueError("Invalid value for `employee_id`, must not be `None`")
        if len(employee_id) < 1:
            raise ValueError("Invalid value for `employee_id`, length must be greater than or equal to `1`")

        self._employee_id = employee_id

    @property
    def location_id(self):
        """
        Gets the location_id of this Shift.
        The ID of the location this shift occurred at. Should be based on where the employee clocked in.

        :return: The location_id of this Shift.
        :rtype: str
        """
        return self._location_id

    @location_id.setter
    def location_id(self, location_id):
        """
        Sets the location_id of this Shift.
        The ID of the location this shift occurred at. Should be based on where the employee clocked in.

        :param location_id: The location_id of this Shift.
        :type: str
        """

        self._location_id = location_id

    @property
    def timezone(self):
        """
        Gets the timezone of this Shift.
        Read-only convenience value that is calculated from the location based on `location_id`. Format: the IANA Timezone Database identifier for the location timezone.

        :return: The timezone of this Shift.
        :rtype: str
        """
        return self._timezone

    @timezone.setter
    def timezone(self, timezone):
        """
        Sets the timezone of this Shift.
        Read-only convenience value that is calculated from the location based on `location_id`. Format: the IANA Timezone Database identifier for the location timezone.

        :param timezone: The timezone of this Shift.
        :type: str
        """

        self._timezone = timezone

    @property
    def start_at(self):
        """
        Gets the start_at of this Shift.
        RFC 3339; shifted to location timezone + offset. Precision up to the minute is respected; seconds are truncated.

        :return: The start_at of this Shift.
        :rtype: str
        """
        return self._start_at

    @start_at.setter
    def start_at(self, start_at):
        """
        Sets the start_at of this Shift.
        RFC 3339; shifted to location timezone + offset. Precision up to the minute is respected; seconds are truncated.

        :param start_at: The start_at of this Shift.
        :type: str
        """

        if start_at is None:
            raise ValueError("Invalid value for `start_at`, must not be `None`")
        if len(start_at) < 1:
            raise ValueError("Invalid value for `start_at`, length must be greater than or equal to `1`")

        self._start_at = start_at

    @property
    def end_at(self):
        """
        Gets the end_at of this Shift.
        RFC 3339; shifted to timezone + offset. Precision up to the minute is respected; seconds are truncated. The `end_at` minute is not counted when the shift length is calculated. For example, a shift from `00:00` to `08:01` is considered an 8 hour shift (midnight to 8am).

        :return: The end_at of this Shift.
        :rtype: str
        """
        return self._end_at

    @end_at.setter
    def end_at(self, end_at):
        """
        Sets the end_at of this Shift.
        RFC 3339; shifted to timezone + offset. Precision up to the minute is respected; seconds are truncated. The `end_at` minute is not counted when the shift length is calculated. For example, a shift from `00:00` to `08:01` is considered an 8 hour shift (midnight to 8am).

        :param end_at: The end_at of this Shift.
        :type: str
        """

        self._end_at = end_at

    @property
    def wage(self):
        """
        Gets the wage of this Shift.
        Job and pay related information.

        :return: The wage of this Shift.
        :rtype: ShiftWage
        """
        return self._wage

    @wage.setter
    def wage(self, wage):
        """
        Sets the wage of this Shift.
        Job and pay related information.

        :param wage: The wage of this Shift.
        :type: ShiftWage
        """

        self._wage = wage

    @property
    def breaks(self):
        """
        Gets the breaks of this Shift.
        A list of any paid or unpaid breaks that were taken during this shift.

        :return: The breaks of this Shift.
        :rtype: list[ModelBreak]
        """
        return self._breaks

    @breaks.setter
    def breaks(self, breaks):
        """
        Sets the breaks of this Shift.
        A list of any paid or unpaid breaks that were taken during this shift.

        :param breaks: The breaks of this Shift.
        :type: list[ModelBreak]
        """

        self._breaks = breaks

    @property
    def status(self):
        """
        Gets the status of this Shift.
        Describes working state of the current `Shift`. See [ShiftStatus](#type-shiftstatus) for possible values

        :return: The status of this Shift.
        :rtype: str
        """
        return self._status

    @status.setter
    def status(self, status):
        """
        Sets the status of this Shift.
        Describes working state of the current `Shift`. See [ShiftStatus](#type-shiftstatus) for possible values

        :param status: The status of this Shift.
        :type: str
        """

        self._status = status

    @property
    def version(self):
        """
        Gets the version of this Shift.
        Used for resolving concurrency issues; request will fail if version provided does not match server version at time of request. If not provided, Square executes a blind write; potentially overwriting data from another write.

        :return: The version of this Shift.
        :rtype: int
        """
        return self._version

    @version.setter
    def version(self, version):
        """
        Sets the version of this Shift.
        Used for resolving concurrency issues; request will fail if version provided does not match server version at time of request. If not provided, Square executes a blind write; potentially overwriting data from another write.

        :param version: The version of this Shift.
        :type: int
        """

        self._version = version

    @property
    def created_at(self):
        """
        Gets the created_at of this Shift.
        A read-only timestamp in RFC 3339 format; presented in UTC.

        :return: The created_at of this Shift.
        :rtype: str
        """
        return self._created_at

    @created_at.setter
    def created_at(self, created_at):
        """
        Sets the created_at of this Shift.
        A read-only timestamp in RFC 3339 format; presented in UTC.

        :param created_at: The created_at of this Shift.
        :type: str
        """

        self._created_at = created_at

    @property
    def updated_at(self):
        """
        Gets the updated_at of this Shift.
        A read-only timestamp in RFC 3339 format; presented in UTC.

        :return: The updated_at of this Shift.
        :rtype: str
        """
        return self._updated_at

    @updated_at.setter
    def updated_at(self, updated_at):
        """
        Sets the updated_at of this Shift.
        A read-only timestamp in RFC 3339 format; presented in UTC.

        :param updated_at: The updated_at of this Shift.
        :type: str
        """

        self._updated_at = updated_at

    def to_dict(self):
        """
        Returns the model properties as a dict
        """
        result = {}

        for attr, _ in iteritems(self.swagger_types):
            value = getattr(self, attr)
            if isinstance(value, list):
                result[attr] = list(map(
                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
                    value
                ))
            elif hasattr(value, "to_dict"):
                result[attr] = value.to_dict()
            elif isinstance(value, dict):
                result[attr] = dict(map(
                    lambda item: (item[0], item[1].to_dict())
                    if hasattr(item[1], "to_dict") else item,
                    value.items()
                ))
            else:
                result[attr] = value

        return result

    def to_str(self):
        """
        Returns the string representation of the model
        """
        return pformat(self.to_dict())

    def __repr__(self):
        """
        For `print` and `pprint`
        """
        return self.to_str()

    def __eq__(self, other):
        """
        Returns true if both objects are equal
        """
        return self.__dict__ == other.__dict__

    def __ne__(self, other):
        """
        Returns true if both objects are not equal
        """
        return not self == other
