# coding: utf-8

"""
    Karbon Platform Services API reference.

    OpenAPI documentation for public facing Karbon Platform Services API  This API documentation is generated from source code using go-swagger. Do not edit the generated kps_api.json directly!  # noqa: E501

    OpenAPI spec version: 1.0
    Contact: karbon-platform-services-api@nutanix.com
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

import pprint
import re  # noqa: F401

import six
from kps_api.models.key_value import KeyValue  # noqa: F401,E501
from kps_api.models.log import Log  # noqa: F401,E501
from kps_api.models.process import Process  # noqa: F401,E501
from kps_api.models.process_id import ProcessID  # noqa: F401,E501
from kps_api.models.reference import Reference  # noqa: F401,E501
from kps_api.models.span_id import SpanID  # noqa: F401,E501
from kps_api.models.trace_id import TraceID  # noqa: F401,E501


class Span(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 = {
        'duration': 'int',
        'flags': 'int',
        'logs': 'list[Log]',
        'operation_name': 'str',
        'parent_span_id': 'SpanID',
        'process': 'Process',
        'process_id': 'ProcessID',
        'references': 'list[Reference]',
        'span_id': 'SpanID',
        'start_time': 'int',
        'tags': 'list[KeyValue]',
        'trace_id': 'TraceID',
        'trace_size': 'int',
        'warnings': 'list[str]'
    }

    attribute_map = {
        'duration': 'duration',
        'flags': 'flags',
        'logs': 'logs',
        'operation_name': 'operationName',
        'parent_span_id': 'parentSpanID',
        'process': 'process',
        'process_id': 'processID',
        'references': 'references',
        'span_id': 'spanID',
        'start_time': 'startTime',
        'tags': 'tags',
        'trace_id': 'traceID',
        'trace_size': 'traceSize',
        'warnings': 'warnings'
    }

    def __init__(self, duration=None, flags=None, logs=None, operation_name=None, parent_span_id=None, process=None, process_id=None, references=None, span_id=None, start_time=None, tags=None, trace_id=None, trace_size=None, warnings=None):  # noqa: E501
        """Span - a model defined in Swagger"""  # noqa: E501
        self._duration = None
        self._flags = None
        self._logs = None
        self._operation_name = None
        self._parent_span_id = None
        self._process = None
        self._process_id = None
        self._references = None
        self._span_id = None
        self._start_time = None
        self._tags = None
        self._trace_id = None
        self._trace_size = None
        self._warnings = None
        self.discriminator = None
        if duration is not None:
            self.duration = duration
        if flags is not None:
            self.flags = flags
        if logs is not None:
            self.logs = logs
        if operation_name is not None:
            self.operation_name = operation_name
        if parent_span_id is not None:
            self.parent_span_id = parent_span_id
        if process is not None:
            self.process = process
        if process_id is not None:
            self.process_id = process_id
        if references is not None:
            self.references = references
        if span_id is not None:
            self.span_id = span_id
        if start_time is not None:
            self.start_time = start_time
        if tags is not None:
            self.tags = tags
        if trace_id is not None:
            self.trace_id = trace_id
        if trace_size is not None:
            self.trace_size = trace_size
        if warnings is not None:
            self.warnings = warnings

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


        :return: The duration of this Span.  # noqa: E501
        :rtype: int
        """
        return self._duration

    @duration.setter
    def duration(self, duration):
        """Sets the duration of this Span.


        :param duration: The duration of this Span.  # noqa: E501
        :type: int
        """

        self._duration = duration

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


        :return: The flags of this Span.  # noqa: E501
        :rtype: int
        """
        return self._flags

    @flags.setter
    def flags(self, flags):
        """Sets the flags of this Span.


        :param flags: The flags of this Span.  # noqa: E501
        :type: int
        """

        self._flags = flags

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


        :return: The logs of this Span.  # noqa: E501
        :rtype: list[Log]
        """
        return self._logs

    @logs.setter
    def logs(self, logs):
        """Sets the logs of this Span.


        :param logs: The logs of this Span.  # noqa: E501
        :type: list[Log]
        """

        self._logs = logs

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


        :return: The operation_name of this Span.  # noqa: E501
        :rtype: str
        """
        return self._operation_name

    @operation_name.setter
    def operation_name(self, operation_name):
        """Sets the operation_name of this Span.


        :param operation_name: The operation_name of this Span.  # noqa: E501
        :type: str
        """

        self._operation_name = operation_name

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


        :return: The parent_span_id of this Span.  # noqa: E501
        :rtype: SpanID
        """
        return self._parent_span_id

    @parent_span_id.setter
    def parent_span_id(self, parent_span_id):
        """Sets the parent_span_id of this Span.


        :param parent_span_id: The parent_span_id of this Span.  # noqa: E501
        :type: SpanID
        """

        self._parent_span_id = parent_span_id

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


        :return: The process of this Span.  # noqa: E501
        :rtype: Process
        """
        return self._process

    @process.setter
    def process(self, process):
        """Sets the process of this Span.


        :param process: The process of this Span.  # noqa: E501
        :type: Process
        """

        self._process = process

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


        :return: The process_id of this Span.  # noqa: E501
        :rtype: ProcessID
        """
        return self._process_id

    @process_id.setter
    def process_id(self, process_id):
        """Sets the process_id of this Span.


        :param process_id: The process_id of this Span.  # noqa: E501
        :type: ProcessID
        """

        self._process_id = process_id

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


        :return: The references of this Span.  # noqa: E501
        :rtype: list[Reference]
        """
        return self._references

    @references.setter
    def references(self, references):
        """Sets the references of this Span.


        :param references: The references of this Span.  # noqa: E501
        :type: list[Reference]
        """

        self._references = references

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


        :return: The span_id of this Span.  # noqa: E501
        :rtype: SpanID
        """
        return self._span_id

    @span_id.setter
    def span_id(self, span_id):
        """Sets the span_id of this Span.


        :param span_id: The span_id of this Span.  # noqa: E501
        :type: SpanID
        """

        self._span_id = span_id

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


        :return: The start_time of this Span.  # noqa: E501
        :rtype: int
        """
        return self._start_time

    @start_time.setter
    def start_time(self, start_time):
        """Sets the start_time of this Span.


        :param start_time: The start_time of this Span.  # noqa: E501
        :type: int
        """

        self._start_time = start_time

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


        :return: The tags of this Span.  # noqa: E501
        :rtype: list[KeyValue]
        """
        return self._tags

    @tags.setter
    def tags(self, tags):
        """Sets the tags of this Span.


        :param tags: The tags of this Span.  # noqa: E501
        :type: list[KeyValue]
        """

        self._tags = tags

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


        :return: The trace_id of this Span.  # noqa: E501
        :rtype: TraceID
        """
        return self._trace_id

    @trace_id.setter
    def trace_id(self, trace_id):
        """Sets the trace_id of this Span.


        :param trace_id: The trace_id of this Span.  # noqa: E501
        :type: TraceID
        """

        self._trace_id = trace_id

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


        :return: The trace_size of this Span.  # noqa: E501
        :rtype: int
        """
        return self._trace_size

    @trace_size.setter
    def trace_size(self, trace_size):
        """Sets the trace_size of this Span.


        :param trace_size: The trace_size of this Span.  # noqa: E501
        :type: int
        """

        self._trace_size = trace_size

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


        :return: The warnings of this Span.  # noqa: E501
        :rtype: list[str]
        """
        return self._warnings

    @warnings.setter
    def warnings(self, warnings):
        """Sets the warnings of this Span.


        :param warnings: The warnings of this Span.  # noqa: E501
        :type: list[str]
        """

        self._warnings = warnings

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

        return self.__dict__ == other.__dict__

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