# coding: utf-8

"""
    Airtable API

    OpenAPI spec for Airtable's REST API  # noqa: E501

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

import pprint
import re  # noqa: F401

import six

class BaseIdTableIdOrNameBody2(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 = {
        'perform_upsert': 'BaseIdtableIdOrNamePerformUpsert',
        'return_fields_by_field_id': 'bool',
        'typecast': 'bool',
        'records': 'list[BaseIdtableIdOrNameRecords]'
    }

    attribute_map = {
        'perform_upsert': 'performUpsert',
        'return_fields_by_field_id': 'returnFieldsByFieldId',
        'typecast': 'typecast',
        'records': 'records'
    }

    def __init__(self, perform_upsert=None, return_fields_by_field_id=False, typecast=False, records=None):  # noqa: E501
        """BaseIdTableIdOrNameBody2 - a model defined in Swagger"""  # noqa: E501
        self._perform_upsert = None
        self._return_fields_by_field_id = None
        self._typecast = None
        self._records = None
        self.discriminator = None
        if perform_upsert is not None:
            self.perform_upsert = perform_upsert
        if return_fields_by_field_id is not None:
            self.return_fields_by_field_id = return_fields_by_field_id
        if typecast is not None:
            self.typecast = typecast
        self.records = records

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


        :return: The perform_upsert of this BaseIdTableIdOrNameBody2.  # noqa: E501
        :rtype: BaseIdtableIdOrNamePerformUpsert
        """
        return self._perform_upsert

    @perform_upsert.setter
    def perform_upsert(self, perform_upsert):
        """Sets the perform_upsert of this BaseIdTableIdOrNameBody2.


        :param perform_upsert: The perform_upsert of this BaseIdTableIdOrNameBody2.  # noqa: E501
        :type: BaseIdtableIdOrNamePerformUpsert
        """

        self._perform_upsert = perform_upsert

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

        If set to true, records in the API response will key the fields object by field ID. Defaults to false when unset, which returns fields objects keyed by field name.  # noqa: E501

        :return: The return_fields_by_field_id of this BaseIdTableIdOrNameBody2.  # noqa: E501
        :rtype: bool
        """
        return self._return_fields_by_field_id

    @return_fields_by_field_id.setter
    def return_fields_by_field_id(self, return_fields_by_field_id):
        """Sets the return_fields_by_field_id of this BaseIdTableIdOrNameBody2.

        If set to true, records in the API response will key the fields object by field ID. Defaults to false when unset, which returns fields objects keyed by field name.  # noqa: E501

        :param return_fields_by_field_id: The return_fields_by_field_id of this BaseIdTableIdOrNameBody2.  # noqa: E501
        :type: bool
        """

        self._return_fields_by_field_id = return_fields_by_field_id

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

        If set to true, Airtable will try to convert string values into the appropriate cell value. This conversion is only performed on a best-effort basis. To ensure your data's integrity, this should only be used when necessary. Defaults to false when unset.  # noqa: E501

        :return: The typecast of this BaseIdTableIdOrNameBody2.  # noqa: E501
        :rtype: bool
        """
        return self._typecast

    @typecast.setter
    def typecast(self, typecast):
        """Sets the typecast of this BaseIdTableIdOrNameBody2.

        If set to true, Airtable will try to convert string values into the appropriate cell value. This conversion is only performed on a best-effort basis. To ensure your data's integrity, this should only be used when necessary. Defaults to false when unset.  # noqa: E501

        :param typecast: The typecast of this BaseIdTableIdOrNameBody2.  # noqa: E501
        :type: bool
        """

        self._typecast = typecast

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

        Array of records to update  # noqa: E501

        :return: The records of this BaseIdTableIdOrNameBody2.  # noqa: E501
        :rtype: list[BaseIdtableIdOrNameRecords]
        """
        return self._records

    @records.setter
    def records(self, records):
        """Sets the records of this BaseIdTableIdOrNameBody2.

        Array of records to update  # noqa: E501

        :param records: The records of this BaseIdTableIdOrNameBody2.  # noqa: E501
        :type: list[BaseIdtableIdOrNameRecords]
        """
        if records is None:
            raise ValueError("Invalid value for `records`, must not be `None`")  # noqa: E501

        self._records = records

    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
        if issubclass(BaseIdTableIdOrNameBody2, dict):
            for key, value in self.items():
                result[key] = 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, BaseIdTableIdOrNameBody2):
            return False

        return self.__dict__ == other.__dict__

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