# coding: utf-8

"""
    Cyclos 4.11.5 API

    The REST API for Cyclos 4.11.5  # noqa: E501

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


import pprint
import re  # noqa: F401

import six

from swagger_client.configuration import Configuration


class AdView(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 = {
        'categories': 'list[AdCategoryWithParent]',
        'custom_values': 'list[CustomFieldValue]',
        'currency': 'Currency',
        'promotional_price': 'BigDecimal',
        'promotional_period': 'DatePeriod',
        'promotional_period_active': 'bool',
        'can_manage': 'bool',
        'can_buy': 'bool',
        'can_ask': 'bool',
        'questions_enabled': 'bool',
        'additional_images': 'list[Image]',
        'addresses': 'list[Address]',
        'user_addresses': 'list[Address]',
        'ad_addresses': 'list[Address]',
        'questions': 'list[AdQuestionView]',
        'allow_decimal': 'bool',
        'delivery_methods': 'list[AdDeliveryMethod]',
        'max_allowed_in_cart': 'BigDecimal',
        'min_allowed_in_cart': 'BigDecimal',
        'product_number': 'str',
        'stock_quantity': 'BigDecimal',
        'unlimited_stock': 'bool',
        'operations': 'list[Operation]'
    }

    attribute_map = {
        'categories': 'categories',
        'custom_values': 'customValues',
        'currency': 'currency',
        'promotional_price': 'promotionalPrice',
        'promotional_period': 'promotionalPeriod',
        'promotional_period_active': 'promotionalPeriodActive',
        'can_manage': 'canManage',
        'can_buy': 'canBuy',
        'can_ask': 'canAsk',
        'questions_enabled': 'questionsEnabled',
        'additional_images': 'additionalImages',
        'addresses': 'addresses',
        'user_addresses': 'userAddresses',
        'ad_addresses': 'adAddresses',
        'questions': 'questions',
        'allow_decimal': 'allowDecimal',
        'delivery_methods': 'deliveryMethods',
        'max_allowed_in_cart': 'maxAllowedInCart',
        'min_allowed_in_cart': 'minAllowedInCart',
        'product_number': 'productNumber',
        'stock_quantity': 'stockQuantity',
        'unlimited_stock': 'unlimitedStock',
        'operations': 'operations'
    }

    def __init__(self, categories=None, custom_values=None, currency=None, promotional_price=None, promotional_period=None, promotional_period_active=None, can_manage=None, can_buy=None, can_ask=None, questions_enabled=None, additional_images=None, addresses=None, user_addresses=None, ad_addresses=None, questions=None, allow_decimal=None, delivery_methods=None, max_allowed_in_cart=None, min_allowed_in_cart=None, product_number=None, stock_quantity=None, unlimited_stock=None, operations=None, _configuration=None):  # noqa: E501
        """AdView - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._categories = None
        self._custom_values = None
        self._currency = None
        self._promotional_price = None
        self._promotional_period = None
        self._promotional_period_active = None
        self._can_manage = None
        self._can_buy = None
        self._can_ask = None
        self._questions_enabled = None
        self._additional_images = None
        self._addresses = None
        self._user_addresses = None
        self._ad_addresses = None
        self._questions = None
        self._allow_decimal = None
        self._delivery_methods = None
        self._max_allowed_in_cart = None
        self._min_allowed_in_cart = None
        self._product_number = None
        self._stock_quantity = None
        self._unlimited_stock = None
        self._operations = None
        self.discriminator = None

        if categories is not None:
            self.categories = categories
        if custom_values is not None:
            self.custom_values = custom_values
        if currency is not None:
            self.currency = currency
        if promotional_price is not None:
            self.promotional_price = promotional_price
        if promotional_period is not None:
            self.promotional_period = promotional_period
        if promotional_period_active is not None:
            self.promotional_period_active = promotional_period_active
        if can_manage is not None:
            self.can_manage = can_manage
        if can_buy is not None:
            self.can_buy = can_buy
        if can_ask is not None:
            self.can_ask = can_ask
        if questions_enabled is not None:
            self.questions_enabled = questions_enabled
        if additional_images is not None:
            self.additional_images = additional_images
        if addresses is not None:
            self.addresses = addresses
        if user_addresses is not None:
            self.user_addresses = user_addresses
        if ad_addresses is not None:
            self.ad_addresses = ad_addresses
        if questions is not None:
            self.questions = questions
        if allow_decimal is not None:
            self.allow_decimal = allow_decimal
        if delivery_methods is not None:
            self.delivery_methods = delivery_methods
        if max_allowed_in_cart is not None:
            self.max_allowed_in_cart = max_allowed_in_cart
        if min_allowed_in_cart is not None:
            self.min_allowed_in_cart = min_allowed_in_cart
        if product_number is not None:
            self.product_number = product_number
        if stock_quantity is not None:
            self.stock_quantity = stock_quantity
        if unlimited_stock is not None:
            self.unlimited_stock = unlimited_stock
        if operations is not None:
            self.operations = operations

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

        Either internal name or id of categories this advertisement belongs to. In most cases an advertisement will have a single category, but this depends on the Cyclos configuration.   # noqa: E501

        :return: The categories of this AdView.  # noqa: E501
        :rtype: list[AdCategoryWithParent]
        """
        return self._categories

    @categories.setter
    def categories(self, categories):
        """Sets the categories of this AdView.

        Either internal name or id of categories this advertisement belongs to. In most cases an advertisement will have a single category, but this depends on the Cyclos configuration.   # noqa: E501

        :param categories: The categories of this AdView.  # noqa: E501
        :type: list[AdCategoryWithParent]
        """

        self._categories = categories

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

        The list of custom field values this advertisement has  # noqa: E501

        :return: The custom_values of this AdView.  # noqa: E501
        :rtype: list[CustomFieldValue]
        """
        return self._custom_values

    @custom_values.setter
    def custom_values(self, custom_values):
        """Sets the custom_values of this AdView.

        The list of custom field values this advertisement has  # noqa: E501

        :param custom_values: The custom_values of this AdView.  # noqa: E501
        :type: list[CustomFieldValue]
        """

        self._custom_values = custom_values

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

        The advertisement's price currency  # noqa: E501

        :return: The currency of this AdView.  # noqa: E501
        :rtype: Currency
        """
        return self._currency

    @currency.setter
    def currency(self, currency):
        """Sets the currency of this AdView.

        The advertisement's price currency  # noqa: E501

        :param currency: The currency of this AdView.  # noqa: E501
        :type: Currency
        """

        self._currency = currency

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

        The promotional price, to be applied on the promotional period is active   # noqa: E501

        :return: The promotional_price of this AdView.  # noqa: E501
        :rtype: BigDecimal
        """
        return self._promotional_price

    @promotional_price.setter
    def promotional_price(self, promotional_price):
        """Sets the promotional_price of this AdView.

        The promotional price, to be applied on the promotional period is active   # noqa: E501

        :param promotional_price: The promotional_price of this AdView.  # noqa: E501
        :type: BigDecimal
        """

        self._promotional_price = promotional_price

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

        The promotional period, the one when `promotionalPrice` is valid   # noqa: E501

        :return: The promotional_period of this AdView.  # noqa: E501
        :rtype: DatePeriod
        """
        return self._promotional_period

    @promotional_period.setter
    def promotional_period(self, promotional_period):
        """Sets the promotional_period of this AdView.

        The promotional period, the one when `promotionalPrice` is valid   # noqa: E501

        :param promotional_period: The promotional_period of this AdView.  # noqa: E501
        :type: DatePeriod
        """

        self._promotional_period = promotional_period

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

        Indicates whether the promotional period is active at the moment this data is returned   # noqa: E501

        :return: The promotional_period_active of this AdView.  # noqa: E501
        :rtype: bool
        """
        return self._promotional_period_active

    @promotional_period_active.setter
    def promotional_period_active(self, promotional_period_active):
        """Sets the promotional_period_active of this AdView.

        Indicates whether the promotional period is active at the moment this data is returned   # noqa: E501

        :param promotional_period_active: The promotional_period_active of this AdView.  # noqa: E501
        :type: bool
        """

        self._promotional_period_active = promotional_period_active

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

        Indicates if the authenticated user manage this advertisement  # noqa: E501

        :return: The can_manage of this AdView.  # noqa: E501
        :rtype: bool
        """
        return self._can_manage

    @can_manage.setter
    def can_manage(self, can_manage):
        """Sets the can_manage of this AdView.

        Indicates if the authenticated user manage this advertisement  # noqa: E501

        :param can_manage: The can_manage of this AdView.  # noqa: E501
        :type: bool
        """

        self._can_manage = can_manage

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

        Indicates if the authenticated user can buy this webshop ad.   # noqa: E501

        :return: The can_buy of this AdView.  # noqa: E501
        :rtype: bool
        """
        return self._can_buy

    @can_buy.setter
    def can_buy(self, can_buy):
        """Sets the can_buy of this AdView.

        Indicates if the authenticated user can buy this webshop ad.   # noqa: E501

        :param can_buy: The can_buy of this AdView.  # noqa: E501
        :type: bool
        """

        self._can_buy = can_buy

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

        Indicates if the authenticated user can ask questions about this advertisement.   # noqa: E501

        :return: The can_ask of this AdView.  # noqa: E501
        :rtype: bool
        """
        return self._can_ask

    @can_ask.setter
    def can_ask(self, can_ask):
        """Sets the can_ask of this AdView.

        Indicates if the authenticated user can ask questions about this advertisement.   # noqa: E501

        :param can_ask: The can_ask of this AdView.  # noqa: E501
        :type: bool
        """

        self._can_ask = can_ask

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

        Indicates if the questions are anabled for the given advertisement.  # noqa: E501

        :return: The questions_enabled of this AdView.  # noqa: E501
        :rtype: bool
        """
        return self._questions_enabled

    @questions_enabled.setter
    def questions_enabled(self, questions_enabled):
        """Sets the questions_enabled of this AdView.

        Indicates if the questions are anabled for the given advertisement.  # noqa: E501

        :param questions_enabled: The questions_enabled of this AdView.  # noqa: E501
        :type: bool
        """

        self._questions_enabled = questions_enabled

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

        Holds the images other than the primary image, which is returned in the `image` field   # noqa: E501

        :return: The additional_images of this AdView.  # noqa: E501
        :rtype: list[Image]
        """
        return self._additional_images

    @additional_images.setter
    def additional_images(self, additional_images):
        """Sets the additional_images of this AdView.

        Holds the images other than the primary image, which is returned in the `image` field   # noqa: E501

        :param additional_images: The additional_images of this AdView.  # noqa: E501
        :type: list[Image]
        """

        self._additional_images = additional_images

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

        (Deprecated) The addresses (belonging to the advertisement's owner) where this  advertisement is available.   # noqa: E501

        :return: The addresses of this AdView.  # noqa: E501
        :rtype: list[Address]
        """
        return self._addresses

    @addresses.setter
    def addresses(self, addresses):
        """Sets the addresses of this AdView.

        (Deprecated) The addresses (belonging to the advertisement's owner) where this  advertisement is available.   # noqa: E501

        :param addresses: The addresses of this AdView.  # noqa: E501
        :type: list[Address]
        """

        self._addresses = addresses

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

        The addresses (belonging to the advertisement's owner) where this  advertisement is available.   # noqa: E501

        :return: The user_addresses of this AdView.  # noqa: E501
        :rtype: list[Address]
        """
        return self._user_addresses

    @user_addresses.setter
    def user_addresses(self, user_addresses):
        """Sets the user_addresses of this AdView.

        The addresses (belonging to the advertisement's owner) where this  advertisement is available.   # noqa: E501

        :param user_addresses: The user_addresses of this AdView.  # noqa: E501
        :type: list[Address]
        """

        self._user_addresses = user_addresses

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

        The custom addresses where this advertisement is available.   # noqa: E501

        :return: The ad_addresses of this AdView.  # noqa: E501
        :rtype: list[Address]
        """
        return self._ad_addresses

    @ad_addresses.setter
    def ad_addresses(self, ad_addresses):
        """Sets the ad_addresses of this AdView.

        The custom addresses where this advertisement is available.   # noqa: E501

        :param ad_addresses: The ad_addresses of this AdView.  # noqa: E501
        :type: list[Address]
        """

        self._ad_addresses = ad_addresses

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

        The list of questions this advertisement has.   # noqa: E501

        :return: The questions of this AdView.  # noqa: E501
        :rtype: list[AdQuestionView]
        """
        return self._questions

    @questions.setter
    def questions(self, questions):
        """Sets the questions of this AdView.

        The list of questions this advertisement has.   # noqa: E501

        :param questions: The questions of this AdView.  # noqa: E501
        :type: list[AdQuestionView]
        """

        self._questions = questions

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

        if true then this webshop ad can be ordered specifying the quantity  as a decimal number.   # noqa: E501

        :return: The allow_decimal of this AdView.  # noqa: E501
        :rtype: bool
        """
        return self._allow_decimal

    @allow_decimal.setter
    def allow_decimal(self, allow_decimal):
        """Sets the allow_decimal of this AdView.

        if true then this webshop ad can be ordered specifying the quantity  as a decimal number.   # noqa: E501

        :param allow_decimal: The allow_decimal of this AdView.  # noqa: E501
        :type: bool
        """

        self._allow_decimal = allow_decimal

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

        The available delivery methods for this webshop ad.  # noqa: E501

        :return: The delivery_methods of this AdView.  # noqa: E501
        :rtype: list[AdDeliveryMethod]
        """
        return self._delivery_methods

    @delivery_methods.setter
    def delivery_methods(self, delivery_methods):
        """Sets the delivery_methods of this AdView.

        The available delivery methods for this webshop ad.  # noqa: E501

        :param delivery_methods: The delivery_methods of this AdView.  # noqa: E501
        :type: list[AdDeliveryMethod]
        """

        self._delivery_methods = delivery_methods

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

        The maximum quantity that can be specified in the shopping cart.   # noqa: E501

        :return: The max_allowed_in_cart of this AdView.  # noqa: E501
        :rtype: BigDecimal
        """
        return self._max_allowed_in_cart

    @max_allowed_in_cart.setter
    def max_allowed_in_cart(self, max_allowed_in_cart):
        """Sets the max_allowed_in_cart of this AdView.

        The maximum quantity that can be specified in the shopping cart.   # noqa: E501

        :param max_allowed_in_cart: The max_allowed_in_cart of this AdView.  # noqa: E501
        :type: BigDecimal
        """

        self._max_allowed_in_cart = max_allowed_in_cart

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

        The minimum quantity that can be specified in the shopping cart.         # noqa: E501

        :return: The min_allowed_in_cart of this AdView.  # noqa: E501
        :rtype: BigDecimal
        """
        return self._min_allowed_in_cart

    @min_allowed_in_cart.setter
    def min_allowed_in_cart(self, min_allowed_in_cart):
        """Sets the min_allowed_in_cart of this AdView.

        The minimum quantity that can be specified in the shopping cart.         # noqa: E501

        :param min_allowed_in_cart: The min_allowed_in_cart of this AdView.  # noqa: E501
        :type: BigDecimal
        """

        self._min_allowed_in_cart = min_allowed_in_cart

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

        The product number according to the webshop settings.  # noqa: E501

        :return: The product_number of this AdView.  # noqa: E501
        :rtype: str
        """
        return self._product_number

    @product_number.setter
    def product_number(self, product_number):
        """Sets the product_number of this AdView.

        The product number according to the webshop settings.  # noqa: E501

        :param product_number: The product_number of this AdView.  # noqa: E501
        :type: str
        """

        self._product_number = product_number

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

        The stock disponibility. Only if `unlimitedStock` is false and the  'Stock type' was not marked as 'Not available' (through the web  interface).   # noqa: E501

        :return: The stock_quantity of this AdView.  # noqa: E501
        :rtype: BigDecimal
        """
        return self._stock_quantity

    @stock_quantity.setter
    def stock_quantity(self, stock_quantity):
        """Sets the stock_quantity of this AdView.

        The stock disponibility. Only if `unlimitedStock` is false and the  'Stock type' was not marked as 'Not available' (through the web  interface).   # noqa: E501

        :param stock_quantity: The stock_quantity of this AdView.  # noqa: E501
        :type: BigDecimal
        """

        self._stock_quantity = stock_quantity

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

        If true then it means there is always disponibility of the webshop ad.  # noqa: E501

        :return: The unlimited_stock of this AdView.  # noqa: E501
        :rtype: bool
        """
        return self._unlimited_stock

    @unlimited_stock.setter
    def unlimited_stock(self, unlimited_stock):
        """Sets the unlimited_stock of this AdView.

        If true then it means there is always disponibility of the webshop ad.  # noqa: E501

        :param unlimited_stock: The unlimited_stock of this AdView.  # noqa: E501
        :type: bool
        """

        self._unlimited_stock = unlimited_stock

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

        List of runnable custom operations.  # noqa: E501

        :return: The operations of this AdView.  # noqa: E501
        :rtype: list[Operation]
        """
        return self._operations

    @operations.setter
    def operations(self, operations):
        """Sets the operations of this AdView.

        List of runnable custom operations.  # noqa: E501

        :param operations: The operations of this AdView.  # noqa: E501
        :type: list[Operation]
        """

        self._operations = operations

    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(AdView, 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, AdView):
            return False

        return self.to_dict() == other.to_dict()

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

        return self.to_dict() != other.to_dict()
