# coding: utf-8

"""
    Selling Partner API for Services

    With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources.

    The version of the OpenAPI document: v1
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501


import pprint
import re  # noqa: F401

import six

from spapi.configuration import Configuration


class ServiceJob(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 = {
        'create_time': 'datetime',
        'service_job_id': 'str',
        'service_job_status': 'str',
        'scope_of_work': 'ScopeOfWork',
        'seller': 'Seller',
        'service_job_provider': 'ServiceJobProvider',
        'preferred_appointment_times': 'List[AppointmentTime]',
        'appointments': 'List[Appointment]',
        'service_order_id': 'str',
        'marketplace_id': 'str',
        'store_id': 'str',
        'buyer': 'Buyer',
        'associated_items': 'List[AssociatedItem]',
        'service_location': 'ServiceLocation',
    }

    attribute_map = {
        'create_time': 'createTime',
        'service_job_id': 'serviceJobId',
        'service_job_status': 'serviceJobStatus',
        'scope_of_work': 'scopeOfWork',
        'seller': 'seller',
        'service_job_provider': 'serviceJobProvider',
        'preferred_appointment_times': 'preferredAppointmentTimes',
        'appointments': 'appointments',
        'service_order_id': 'serviceOrderId',
        'marketplace_id': 'marketplaceId',
        'store_id': 'storeId',
        'buyer': 'buyer',
        'associated_items': 'associatedItems',
        'service_location': 'serviceLocation',
    }

    def __init__(self, create_time=None, service_job_id=None, service_job_status=None, scope_of_work=None, seller=None, service_job_provider=None, preferred_appointment_times=None, appointments=None, service_order_id=None, marketplace_id=None, store_id=None, buyer=None, associated_items=None, service_location=None, _configuration=None):  # noqa: E501
        """ServiceJob - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._create_time = None
        self._service_job_id = None
        self._service_job_status = None
        self._scope_of_work = None
        self._seller = None
        self._service_job_provider = None
        self._preferred_appointment_times = None
        self._appointments = None
        self._service_order_id = None
        self._marketplace_id = None
        self._store_id = None
        self._buyer = None
        self._associated_items = None
        self._service_location = None
        self.discriminator = None

        if create_time is not None:
            self.create_time = create_time
        if service_job_id is not None:
            self.service_job_id = service_job_id
        if service_job_status is not None:
            self.service_job_status = service_job_status
        if scope_of_work is not None:
            self.scope_of_work = scope_of_work
        if seller is not None:
            self.seller = seller
        if service_job_provider is not None:
            self.service_job_provider = service_job_provider
        if preferred_appointment_times is not None:
            self.preferred_appointment_times = preferred_appointment_times
        if appointments is not None:
            self.appointments = appointments
        if service_order_id is not None:
            self.service_order_id = service_order_id
        if marketplace_id is not None:
            self.marketplace_id = marketplace_id
        if store_id is not None:
            self.store_id = store_id
        if buyer is not None:
            self.buyer = buyer
        if associated_items is not None:
            self.associated_items = associated_items
        if service_location is not None:
            self.service_location = service_location

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

        The date and time of the creation of the job in ISO 8601 format.  # noqa: E501

        :return: The create_time of this ServiceJob.  # noqa: E501
        :rtype: datetime
        """
        return self._create_time

    @create_time.setter
    def create_time(self, create_time):
        """Sets the create_time of this ServiceJob.

        The date and time of the creation of the job in ISO 8601 format.  # noqa: E501

        :param create_time: The create_time of this ServiceJob.  # noqa: E501
        :type: datetime
        """

        self._create_time = create_time

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

        Amazon identifier for the service job.  # noqa: E501

        :return: The service_job_id of this ServiceJob.  # noqa: E501
        :rtype: str
        """
        return self._service_job_id

    @service_job_id.setter
    def service_job_id(self, service_job_id):
        """Sets the service_job_id of this ServiceJob.

        Amazon identifier for the service job.  # noqa: E501

        :param service_job_id: The service_job_id of this ServiceJob.  # noqa: E501
        :type: str
        """
        if (self._configuration.client_side_validation and
                service_job_id is not None and len(service_job_id) > 100):
            raise ValueError("Invalid value for `service_job_id`, length must be less than or equal to `100`")  # noqa: E501
        if (self._configuration.client_side_validation and
                service_job_id is not None and len(service_job_id) < 1):
            raise ValueError("Invalid value for `service_job_id`, length must be greater than or equal to `1`")  # noqa: E501

        self._service_job_id = service_job_id

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

        The status of the service job.  # noqa: E501

        :return: The service_job_status of this ServiceJob.  # noqa: E501
        :rtype: str
        """
        return self._service_job_status

    @service_job_status.setter
    def service_job_status(self, service_job_status):
        """Sets the service_job_status of this ServiceJob.

        The status of the service job.  # noqa: E501

        :param service_job_status: The service_job_status of this ServiceJob.  # noqa: E501
        :type: str
        """
        allowed_values = ["NOT_SERVICED", "CANCELLED", "COMPLETED", "PENDING_SCHEDULE", "NOT_FULFILLABLE", "HOLD", "PAYMENT_DECLINED"]  # noqa: E501
        if (self._configuration.client_side_validation and
                service_job_status not in allowed_values):
            raise ValueError(
                "Invalid value for `service_job_status` ({0}), must be one of {1}"  # noqa: E501
                .format(service_job_status, allowed_values)
            )

        self._service_job_status = service_job_status

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


        :return: The scope_of_work of this ServiceJob.  # noqa: E501
        :rtype: ScopeOfWork
        """
        return self._scope_of_work

    @scope_of_work.setter
    def scope_of_work(self, scope_of_work):
        """Sets the scope_of_work of this ServiceJob.


        :param scope_of_work: The scope_of_work of this ServiceJob.  # noqa: E501
        :type: ScopeOfWork
        """

        self._scope_of_work = scope_of_work

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


        :return: The seller of this ServiceJob.  # noqa: E501
        :rtype: Seller
        """
        return self._seller

    @seller.setter
    def seller(self, seller):
        """Sets the seller of this ServiceJob.


        :param seller: The seller of this ServiceJob.  # noqa: E501
        :type: Seller
        """

        self._seller = seller

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


        :return: The service_job_provider of this ServiceJob.  # noqa: E501
        :rtype: ServiceJobProvider
        """
        return self._service_job_provider

    @service_job_provider.setter
    def service_job_provider(self, service_job_provider):
        """Sets the service_job_provider of this ServiceJob.


        :param service_job_provider: The service_job_provider of this ServiceJob.  # noqa: E501
        :type: ServiceJobProvider
        """

        self._service_job_provider = service_job_provider

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

        A list of appointment windows preferred by the buyer. Included only if the buyer selected appointment windows when creating the order.  # noqa: E501

        :return: The preferred_appointment_times of this ServiceJob.  # noqa: E501
        :rtype: List[AppointmentTime]
        """
        return self._preferred_appointment_times

    @preferred_appointment_times.setter
    def preferred_appointment_times(self, preferred_appointment_times):
        """Sets the preferred_appointment_times of this ServiceJob.

        A list of appointment windows preferred by the buyer. Included only if the buyer selected appointment windows when creating the order.  # noqa: E501

        :param preferred_appointment_times: The preferred_appointment_times of this ServiceJob.  # noqa: E501
        :type: List[AppointmentTime]
        """

        self._preferred_appointment_times = preferred_appointment_times

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

        A list of appointments.  # noqa: E501

        :return: The appointments of this ServiceJob.  # noqa: E501
        :rtype: List[Appointment]
        """
        return self._appointments

    @appointments.setter
    def appointments(self, appointments):
        """Sets the appointments of this ServiceJob.

        A list of appointments.  # noqa: E501

        :param appointments: The appointments of this ServiceJob.  # noqa: E501
        :type: List[Appointment]
        """

        self._appointments = appointments

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

        The Amazon-defined identifier for an order placed by the buyer, in 3-7-7 format.  # noqa: E501

        :return: The service_order_id of this ServiceJob.  # noqa: E501
        :rtype: str
        """
        return self._service_order_id

    @service_order_id.setter
    def service_order_id(self, service_order_id):
        """Sets the service_order_id of this ServiceJob.

        The Amazon-defined identifier for an order placed by the buyer, in 3-7-7 format.  # noqa: E501

        :param service_order_id: The service_order_id of this ServiceJob.  # noqa: E501
        :type: str
        """
        if (self._configuration.client_side_validation and
                service_order_id is not None and len(service_order_id) > 20):
            raise ValueError("Invalid value for `service_order_id`, length must be less than or equal to `20`")  # noqa: E501
        if (self._configuration.client_side_validation and
                service_order_id is not None and len(service_order_id) < 5):
            raise ValueError("Invalid value for `service_order_id`, length must be greater than or equal to `5`")  # noqa: E501

        self._service_order_id = service_order_id

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

        The marketplace identifier.  # noqa: E501

        :return: The marketplace_id of this ServiceJob.  # noqa: E501
        :rtype: str
        """
        return self._marketplace_id

    @marketplace_id.setter
    def marketplace_id(self, marketplace_id):
        """Sets the marketplace_id of this ServiceJob.

        The marketplace identifier.  # noqa: E501

        :param marketplace_id: The marketplace_id of this ServiceJob.  # noqa: E501
        :type: str
        """
        if (self._configuration.client_side_validation and
                marketplace_id is not None and not re.search(r'^[A-Z0-9]*$', marketplace_id)):  # noqa: E501
            raise ValueError(r"Invalid value for `marketplace_id`, must be a follow pattern or equal to `/^[A-Z0-9]*$/`")  # noqa: E501

        self._marketplace_id = marketplace_id

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

        The Amazon-defined identifier for the region scope.  # noqa: E501

        :return: The store_id of this ServiceJob.  # noqa: E501
        :rtype: str
        """
        return self._store_id

    @store_id.setter
    def store_id(self, store_id):
        """Sets the store_id of this ServiceJob.

        The Amazon-defined identifier for the region scope.  # noqa: E501

        :param store_id: The store_id of this ServiceJob.  # noqa: E501
        :type: str
        """
        if (self._configuration.client_side_validation and
                store_id is not None and len(store_id) > 100):
            raise ValueError("Invalid value for `store_id`, length must be less than or equal to `100`")  # noqa: E501
        if (self._configuration.client_side_validation and
                store_id is not None and len(store_id) < 1):
            raise ValueError("Invalid value for `store_id`, length must be greater than or equal to `1`")  # noqa: E501

        self._store_id = store_id

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


        :return: The buyer of this ServiceJob.  # noqa: E501
        :rtype: Buyer
        """
        return self._buyer

    @buyer.setter
    def buyer(self, buyer):
        """Sets the buyer of this ServiceJob.


        :param buyer: The buyer of this ServiceJob.  # noqa: E501
        :type: Buyer
        """

        self._buyer = buyer

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

        A list of items associated with the service job.  # noqa: E501

        :return: The associated_items of this ServiceJob.  # noqa: E501
        :rtype: List[AssociatedItem]
        """
        return self._associated_items

    @associated_items.setter
    def associated_items(self, associated_items):
        """Sets the associated_items of this ServiceJob.

        A list of items associated with the service job.  # noqa: E501

        :param associated_items: The associated_items of this ServiceJob.  # noqa: E501
        :type: List[AssociatedItem]
        """

        self._associated_items = associated_items

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


        :return: The service_location of this ServiceJob.  # noqa: E501
        :rtype: ServiceLocation
        """
        return self._service_location

    @service_location.setter
    def service_location(self, service_location):
        """Sets the service_location of this ServiceJob.


        :param service_location: The service_location of this ServiceJob.  # noqa: E501
        :type: ServiceLocation
        """

        self._service_location = service_location

    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(ServiceJob, 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, ServiceJob):
            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, ServiceJob):
            return True

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