# coding: utf-8

"""
    teralytic

    Teralytic-API allows customers and partners to view their probes, sensor readings for each, as well as analytics and calculations from Teralytic algorithms.  # noqa: E501

    OpenAPI spec version: 1.0.5
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six

from teralytic.models.field_geometry import FieldGeometry  # noqa: F401,E501


class Field(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    """

    """
    Attributes:
      swagger_types (dict): The key is attribute name
                            and the value is attribute type.
      attribute_map (dict): The key is attribute name
                            and the value is json key in definition.
    """
    swagger_types = {
        'id': 'str',
        'organization_id': 'str',
        'name': 'str',
        'acreage': 'float',
        'crop': 'str',
        'geometry': 'FieldGeometry'
    }

    attribute_map = {
        'id': 'id',
        'organization_id': 'organization_id',
        'name': 'name',
        'acreage': 'acreage',
        'crop': 'crop',
        'geometry': 'geometry'
    }

    def __init__(self, id=None, organization_id=None, name=None, acreage=None, crop=None, geometry=None):  # noqa: E501
        """Field - a model defined in Swagger"""  # noqa: E501

        self._id = None
        self._organization_id = None
        self._name = None
        self._acreage = None
        self._crop = None
        self._geometry = None
        self.discriminator = None

        self.id = id
        if organization_id is not None:
            self.organization_id = organization_id
        self.name = name
        if acreage is not None:
            self.acreage = acreage
        if crop is not None:
            self.crop = crop
        if geometry is not None:
            self.geometry = geometry

    @property
    def id(self):
        """Gets the id of this Field.  # noqa: E501


        :return: The id of this Field.  # noqa: E501
        :rtype: str
        """
        return self._id

    @id.setter
    def id(self, id):
        """Sets the id of this Field.


        :param id: The id of this Field.  # noqa: E501
        :type: str
        """
        if id is None:
            raise ValueError("Invalid value for `id`, must not be `None`")  # noqa: E501

        self._id = id

    @property
    def organization_id(self):
        """Gets the organization_id of this Field.  # noqa: E501


        :return: The organization_id of this Field.  # noqa: E501
        :rtype: str
        """
        return self._organization_id

    @organization_id.setter
    def organization_id(self, organization_id):
        """Sets the organization_id of this Field.


        :param organization_id: The organization_id of this Field.  # noqa: E501
        :type: str
        """

        self._organization_id = organization_id

    @property
    def name(self):
        """Gets the name of this Field.  # noqa: E501


        :return: The name of this Field.  # noqa: E501
        :rtype: str
        """
        return self._name

    @name.setter
    def name(self, name):
        """Sets the name of this Field.


        :param name: The name of this Field.  # noqa: E501
        :type: str
        """
        if name is None:
            raise ValueError("Invalid value for `name`, must not be `None`")  # noqa: E501

        self._name = name

    @property
    def acreage(self):
        """Gets the acreage of this Field.  # noqa: E501


        :return: The acreage of this Field.  # noqa: E501
        :rtype: float
        """
        return self._acreage

    @acreage.setter
    def acreage(self, acreage):
        """Sets the acreage of this Field.


        :param acreage: The acreage of this Field.  # noqa: E501
        :type: float
        """

        self._acreage = acreage

    @property
    def crop(self):
        """Gets the crop of this Field.  # noqa: E501


        :return: The crop of this Field.  # noqa: E501
        :rtype: str
        """
        return self._crop

    @crop.setter
    def crop(self, crop):
        """Sets the crop of this Field.


        :param crop: The crop of this Field.  # noqa: E501
        :type: str
        """

        self._crop = crop

    @property
    def geometry(self):
        """Gets the geometry of this Field.  # noqa: E501


        :return: The geometry of this Field.  # noqa: E501
        :rtype: FieldGeometry
        """
        return self._geometry

    @geometry.setter
    def geometry(self, geometry):
        """Sets the geometry of this Field.


        :param geometry: The geometry of this Field.  # noqa: E501
        :type: FieldGeometry
        """

        self._geometry = geometry

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

        for attr, _ in six.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 pprint.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"""
        if not isinstance(other, Field):
            return False

        return self.__dict__ == other.__dict__

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