# coding: utf-8

"""
    CloudEndure API documentation

    © 2017 CloudEndure All rights reserved  # General Request authentication in CloudEndure's API is done using session cookies. A session cookie is returned upon successful execution of the \"login\" method. This value must then be provided within the request headers of all subsequent API requests.  ## Errors Some errors are not specifically written in every method since they may always return. Those are: 1) 401 (Unauthorized) - for unauthenticated requests. 2) 405 (Method Not Allowed) - for using a method that is not supported (POST instead of GET). 3) 403 (Forbidden) - request is authenticated, but the user is not allowed to access. 4) 422 (Unprocessable Entity) - for invalid input.  ## Formats All strings with date-time format are according to RFC3339.  All strings with \"duration\" format are according to ISO8601. For example, a full day duration can be specified with \"PNNNND\".   # noqa: E501

    OpenAPI spec version: 5
    Contact: https://bit.ly/2T54hSc
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

import pprint
import re  # noqa: F401

import six

from cloudendure.cloudendure_api.models.cloud_endure_audit_log_changed_field import (  # noqa: F401,E501
    CloudEndureAuditLogChangedField,
)


class CloudEndureAuditLogEntry:
    """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 = {
        "username": "str",
        "event_name": "str",
        "participating_machines": "list[object]",
        "description": "str",
        "changed_fields": "list[CloudEndureAuditLogChangedField]",
        "timestamp": "datetime",
        "job_id": "str",
    }

    attribute_map = {
        "username": "username",
        "event_name": "eventName",
        "participating_machines": "participatingMachines",
        "description": "description",
        "changed_fields": "changedFields",
        "timestamp": "timestamp",
        "job_id": "jobId",
    }

    def __init__(
        self,
        username=None,
        event_name=None,
        participating_machines=None,
        description=None,
        changed_fields=None,
        timestamp=None,
        job_id=None,
    ):  # noqa: E501
        """CloudEndureAuditLogEntry - a model defined in Swagger"""  # noqa: E501
        self._username = None
        self._event_name = None
        self._participating_machines = None
        self._description = None
        self._changed_fields = None
        self._timestamp = None
        self._job_id = None
        self.discriminator = None
        if username is not None:
            self.username = username
        if event_name is not None:
            self.event_name = event_name
        if participating_machines is not None:
            self.participating_machines = participating_machines
        if description is not None:
            self.description = description
        if changed_fields is not None:
            self.changed_fields = changed_fields
        if timestamp is not None:
            self.timestamp = timestamp
        if job_id is not None:
            self.job_id = job_id

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

        username (typically an email) of user who initiated action (in UI or via API) which resulted in this audit log entry being added.   # noqa: E501

        :return: The username of this CloudEndureAuditLogEntry.  # noqa: E501
        :rtype: str
        """
        return self._username

    @username.setter
    def username(self, username):
        """Sets the username of this CloudEndureAuditLogEntry.

        username (typically an email) of user who initiated action (in UI or via API) which resulted in this audit log entry being added.   # noqa: E501

        :param username: The username of this CloudEndureAuditLogEntry.  # noqa: E501
        :type: str
        """

        self._username = username

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

        Unique event name.  One of:  - replicationConfigurationChanged  - blueprintChanged  - ... @todo: complete   # noqa: E501

        :return: The event_name of this CloudEndureAuditLogEntry.  # noqa: E501
        :rtype: str
        """
        return self._event_name

    @event_name.setter
    def event_name(self, event_name):
        """Sets the event_name of this CloudEndureAuditLogEntry.

        Unique event name.  One of:  - replicationConfigurationChanged  - blueprintChanged  - ... @todo: complete   # noqa: E501

        :param event_name: The event_name of this CloudEndureAuditLogEntry.  # noqa: E501
        :type: str
        """

        self._event_name = event_name

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

        List of machine-identifiers objects.  Only present if Audit Log entry relates to one or more machines.   # noqa: E501

        :return: The participating_machines of this CloudEndureAuditLogEntry.  # noqa: E501
        :rtype: list[object]
        """
        return self._participating_machines

    @participating_machines.setter
    def participating_machines(self, participating_machines):
        """Sets the participating_machines of this CloudEndureAuditLogEntry.

        List of machine-identifiers objects.  Only present if Audit Log entry relates to one or more machines.   # noqa: E501

        :param participating_machines: The participating_machines of this CloudEndureAuditLogEntry.  # noqa: E501
        :type: list[object]
        """

        self._participating_machines = participating_machines

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

        Long-form human-readable description of Audit Log entry.  # noqa: E501

        :return: The description of this CloudEndureAuditLogEntry.  # noqa: E501
        :rtype: str
        """
        return self._description

    @description.setter
    def description(self, description):
        """Sets the description of this CloudEndureAuditLogEntry.

        Long-form human-readable description of Audit Log entry.  # noqa: E501

        :param description: The description of this CloudEndureAuditLogEntry.  # noqa: E501
        :type: str
        """

        self._description = description

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

        Map of fields that have been changed and their old an new values. Only present when eventName is replicationConfigurationChanged or blueprintChanged   # noqa: E501

        :return: The changed_fields of this CloudEndureAuditLogEntry.  # noqa: E501
        :rtype: list[CloudEndureAuditLogChangedField]
        """
        return self._changed_fields

    @changed_fields.setter
    def changed_fields(self, changed_fields):
        """Sets the changed_fields of this CloudEndureAuditLogEntry.

        Map of fields that have been changed and their old an new values. Only present when eventName is replicationConfigurationChanged or blueprintChanged   # noqa: E501

        :param changed_fields: The changed_fields of this CloudEndureAuditLogEntry.  # noqa: E501
        :type: list[CloudEndureAuditLogChangedField]
        """

        self._changed_fields = changed_fields

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

        RFC 3339 compliant date-time string of when Audit Log entry was created/ event described by audit log entry happened.   # noqa: E501

        :return: The timestamp of this CloudEndureAuditLogEntry.  # noqa: E501
        :rtype: datetime
        """
        return self._timestamp

    @timestamp.setter
    def timestamp(self, timestamp):
        """Sets the timestamp of this CloudEndureAuditLogEntry.

        RFC 3339 compliant date-time string of when Audit Log entry was created/ event described by audit log entry happened.   # noqa: E501

        :param timestamp: The timestamp of this CloudEndureAuditLogEntry.  # noqa: E501
        :type: datetime
        """

        self._timestamp = timestamp

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

        ID of Job due to which this log entry was created (only included if log entry is result of a Job)  # noqa: E501

        :return: The job_id of this CloudEndureAuditLogEntry.  # noqa: E501
        :rtype: str
        """
        return self._job_id

    @job_id.setter
    def job_id(self, job_id):
        """Sets the job_id of this CloudEndureAuditLogEntry.

        ID of Job due to which this log entry was created (only included if log entry is result of a Job)  # noqa: E501

        :param job_id: The job_id of this CloudEndureAuditLogEntry.  # noqa: E501
        :type: str
        """

        self._job_id = job_id

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

        return self.__dict__ == other.__dict__

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