"""
    Events and Transcripts API

    <p>The Calendar Events API provides access to FactSetâ€™s Event Calendar data alongside business logic that allows users to replicate views and functionality consistent with the experience provided by the Workstation. This API provides the ability to pull Event Calendar data based on specific filters.</p> <p>Events Audio API provides access to historical as well as the latest audio recordings of various company events covered by FactSet. The events include, but are not limited to: earnings calls, conferences, and investor days. This API also provides relevant metadata such as timestamps and identifiers around each audio file.</p> <p>The  Near Real-time Transcripts API enables access to Near Real-time Transcripts provided by CallStreet to time-sensitive clients. This API also provides the relevant speaker metadata along with their confidence scores. This data caters to quant clients interested in building machine learning models. Clients can leverage this API to perform sentiment analysis through natural language processing or machine learning. It can also be used to complement analysis using FactSet's transcripts service.</p> <p>Transcripts API provides conference call transcripts for companies' publicly held conference calls and a wealth of information regarding upcoming corporate events, such as conference call date and time, phone number and password, type of conference call, and important company investor relations contact information.</p>   # noqa: E501

    The version of the OpenAPI document: 2.2.0
    Contact: api@factset.com
    Generated by: https://openapi-generator.tech
"""


import re  # noqa: F401
import sys  # noqa: F401

from fds.sdk.EventsandTranscripts.model_utils import (  # noqa: F401
    ApiTypeError,
    ModelComposed,
    ModelNormal,
    ModelSimple,
    cached_property,
    change_keys_js_to_python,
    convert_js_args_to_python_args,
    date,
    datetime,
    file_type,
    none_type,
    validate_get_composed_info,
    OpenApiModel
)
from fds.sdk.EventsandTranscripts.exceptions import ApiAttributeError


def lazy_import():
    from fds.sdk.EventsandTranscripts.model.transcripts_by_date_request import TranscriptsByDateRequest
    from fds.sdk.EventsandTranscripts.model.transcripts_by_events_request import TranscriptsByEventsRequest
    from fds.sdk.EventsandTranscripts.model.transcripts_by_ids_request import TranscriptsByIdsRequest
    from fds.sdk.EventsandTranscripts.model.transcripts_by_search_request import TranscriptsBySearchRequest
    from fds.sdk.EventsandTranscripts.model.transcripts_by_times_request import TranscriptsByTimesRequest
    globals()['TranscriptsByDateRequest'] = TranscriptsByDateRequest
    globals()['TranscriptsByEventsRequest'] = TranscriptsByEventsRequest
    globals()['TranscriptsByIdsRequest'] = TranscriptsByIdsRequest
    globals()['TranscriptsBySearchRequest'] = TranscriptsBySearchRequest
    globals()['TranscriptsByTimesRequest'] = TranscriptsByTimesRequest


class TranscriptsRequestData(ModelComposed):
    """NOTE: This class is auto generated by OpenAPI Generator.
    Ref: https://openapi-generator.tech

    Do not edit the class manually.

    Attributes:
      allowed_values (dict): The key is the tuple path to the attribute
          and the for var_name this is (var_name,). The value is a dict
          with a capitalized key describing the allowed value and an allowed
          value. These dicts store the allowed enum values.
      attribute_map (dict): The key is attribute name
          and the value is json key in definition.
      discriminator_value_class_map (dict): A dict to go from the discriminator
          variable value to the discriminator class name.
      validations (dict): The key is the tuple path to the attribute
          and the for var_name this is (var_name,). The value is a dict
          that stores validations for max_length, min_length, max_items,
          min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
          inclusive_minimum, and regex.
      additional_properties_type (tuple): A tuple of classes accepted
          as additional properties values.
    """

    allowed_values = {
    }

    validations = {
    }

    @cached_property
    def additional_properties_type():
        """
        This must be a method because a model may have properties that are
        of type self, this must run after the class is loaded
        """
        lazy_import()
        return (bool, date, datetime, dict, float, int, list, str, none_type,)  # noqa: E501

    _nullable = False

    @cached_property
    def openapi_types():
        """
        This must be a method because a model may have properties that are
        of type self, this must run after the class is loaded

        Returns
            openapi_types (dict): The key is attribute name
                and the value is attribute type.
        """
        lazy_import()
        return {
            'start_date': (date,),  # noqa: E501
            'end_date': (date,),  # noqa: E501
            'start_date_relative': (int,),  # noqa: E501
            'end_date_relative': (int,),  # noqa: E501
            'time_zone': (str,),  # noqa: E501
            'search_text': (str,),  # noqa: E501
            'primary_id': (bool,),  # noqa: E501
            'report_ids': ([str],),  # noqa: E501
            'categories': ([str],),  # noqa: E501
            'date_type': (str,),  # noqa: E501
            'event_ids': ([str],),  # noqa: E501
            'event_type': (str,),  # noqa: E501
            'start_date_time': (datetime,),  # noqa: E501
            'end_date_time': (datetime,),  # noqa: E501
            'ids': ([str],),  # noqa: E501
        }

    @cached_property
    def discriminator():
        lazy_import()
        val = {
            'TranscriptsByDateRequest': TranscriptsByDateRequest,
            'TranscriptsByEventsRequest': TranscriptsByEventsRequest,
            'TranscriptsByIdsRequest': TranscriptsByIdsRequest,
            'TranscriptsBySearchRequest': TranscriptsBySearchRequest,
            'TranscriptsByTimesRequest': TranscriptsByTimesRequest,
            'object1': TranscriptsByDateRequest,
            'object2': TranscriptsBySearchRequest,
            'object3': TranscriptsByIdsRequest,
            'object4': TranscriptsByEventsRequest,
            'object5': TranscriptsByTimesRequest,
        }
        if not val:
            return None
        return {'transcript': val}

    attribute_map = {
        'start_date': 'startDate',  # noqa: E501
        'end_date': 'endDate',  # noqa: E501
        'start_date_relative': 'startDateRelative',  # noqa: E501
        'end_date_relative': 'endDateRelative',  # noqa: E501
        'time_zone': 'timeZone',  # noqa: E501
        'search_text': 'searchText',  # noqa: E501
        'primary_id': 'primaryId',  # noqa: E501
        'report_ids': 'reportIds',  # noqa: E501
        'categories': 'categories',  # noqa: E501
        'date_type': 'dateType',  # noqa: E501
        'event_ids': 'eventIds',  # noqa: E501
        'event_type': 'eventType',  # noqa: E501
        'start_date_time': 'startDateTime',  # noqa: E501
        'end_date_time': 'endDateTime',  # noqa: E501
        'ids': 'ids',  # noqa: E501
    }

    read_only_vars = {
    }

    @classmethod
    @convert_js_args_to_python_args
    def _from_openapi_data(cls, *args, **kwargs):  # noqa: E501
        """TranscriptsRequestData - a model defined in OpenAPI

        Keyword Args:
            _check_type (bool): if True, values for parameters in openapi_types
                                will be type checked and a TypeError will be
                                raised if the wrong type is input.
                                Defaults to True
            _path_to_item (tuple/list): This is a list of keys or values to
                                drill down to the model in received_data
                                when deserializing a response
            _spec_property_naming (bool): True if the variable names in the input data
                                are serialized names, as specified in the OpenAPI document.
                                False if the variable names in the input data
                                are pythonic names, e.g. snake case (default)
            _configuration (Configuration): the instance to use when
                                deserializing a file_type parameter.
                                If passed, type conversion is attempted
                                If omitted no type conversion is done.
            _visited_composed_classes (tuple): This stores a tuple of
                                classes that we have traveled through so that
                                if we see that class again we will not use its
                                discriminator again.
                                When traveling through a discriminator, the
                                composed schema that is
                                is traveled through is added to this set.
                                For example if Animal has a discriminator
                                petType and we pass in "Dog", and the class Dog
                                allOf includes Animal, we move through Animal
                                once using the discriminator, and pick Dog.
                                Then in Dog, we will make an instance of the
                                Animal class but this time we won't travel
                                through its discriminator because we passed in
                                _visited_composed_classes = (Animal,)
            start_date (date): Start Date (YYYY-MM-DD). If dates are not provided, default will return all files. . [optional]  # noqa: E501
            end_date (date): End Date (YYYY-MM-DD). If dates are not provided, default will return all files. . [optional]  # noqa: E501
            start_date_relative (int): - Start date relative to today (0=today, -1=yesterday). - *Either `startDate` or `startDateRelative` should be used.* - If dates are not provided, default will return all files. . [optional]  # noqa: E501
            end_date_relative (int): -  End date relative to today (0=today, -1=yesterday). -  *Either `endDate` or `endDateRelative` should be used.* -  If dates are not provided, default will return all files.   . [optional]  # noqa: E501
            time_zone (str): Time Zone for story dates/times (POSIX format from IANA timeZone registry).  Use the `/meta/time-zones` endpoint to get the list of available time zones.. [optional] if omitted the server will use the default value of "America/New_York"  # noqa: E501
            search_text (str): Text to search for within the transcript document stories.. [optional]  # noqa: E501
            primary_id (bool): If true, search only for documents where the provided `ids` are the primary identifiers. If false, search for any mention.  **Note:** Transcripts only have a primary ID, so the results remain the same regardless of whether primaryId=true or primaryId=false is specified in the request. . [optional] if omitted the server will use the default value of False  # noqa: E501
            report_ids ([str]): List of report IDs (max 1000).. [optional]  # noqa: E501
            categories ([str]): List of category codes (country, industry, subject). Use `/meta/categories` endpoint. Default is all.. [optional]  # noqa: E501
            date_type (str): Enables filtering of transcripts based on their uploadDateTime. . [optional]  # noqa: E501
            event_ids ([str]): List of event IDs (max 1000).. [optional]  # noqa: E501
            event_type (str): Specifies the type of event:  * Earnings: Regular quarterly calls where companies provide insights into their latest earnings, sharing details on their financial performance, including revenue, profits, and earnings per share.  * Guidance: Calls where companies offer estimated financial information about future earnings or outline business outlooks before official earnings are released.  * Analyst, Investor & Shareholder Meeting: Gatherings hosted by companies for analysts, investors, and shareholders to discuss strategic updates, financial health, and corporate developments.  * ConferencePresentation: A structured delivery of information within a conference setting, where individuals gather to discuss shared interests through formats such as keynote speeches, panel discussions, workshops, seminars, or webinars.  * SalesRevenue: Conference calls focused on discussing comprehensive sales activity and revenue figures, typically held monthly or quarterly.  * SpecialSituation: Conference calls addressing situations that do not fit into standard categories, often concerning mergers, acquisitions, joint ventures, or significant business updates.. [optional]  # noqa: E501
            start_date_time (datetime): The date from which data is required. If dates are not provided, default will return all files. . [optional]  # noqa: E501
            end_date_time (datetime): The date to which data is required. If dates are not provided, default will return all files. . [optional]  # noqa: E501
            ids ([str]): Requested symbols or securities. This is a list with a maximum limit of 1000. Each symbol can be a FactSet exchange symbol, CUSIP, SEDOL, ISIN, or Entity ID. [optional]  # noqa: E501
        """

        _check_type = kwargs.pop('_check_type', True)
        _spec_property_naming = kwargs.pop('_spec_property_naming', False)
        _path_to_item = kwargs.pop('_path_to_item', ())
        _configuration = kwargs.pop('_configuration', None)
        _visited_composed_classes = kwargs.pop('_visited_composed_classes', ())

        self = super(OpenApiModel, cls).__new__(cls)

        if args:
            raise ApiTypeError(
                "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
                    args,
                    self.__class__.__name__,
                ),
                path_to_item=_path_to_item,
                valid_classes=(self.__class__,),
            )

        self._data_store = {}
        self._check_type = _check_type
        self._spec_property_naming = _spec_property_naming
        self._path_to_item = _path_to_item
        self._configuration = _configuration
        self._visited_composed_classes = _visited_composed_classes + (self.__class__,)

        constant_args = {
            '_check_type': _check_type,
            '_path_to_item': _path_to_item,
            '_spec_property_naming': _spec_property_naming,
            '_configuration': _configuration,
            '_visited_composed_classes': self._visited_composed_classes,
        }
        composed_info = validate_get_composed_info(
            constant_args, kwargs, self)
        self._composed_instances = composed_info[0]
        self._var_name_to_model_instances = composed_info[1]
        self._additional_properties_model_instances = composed_info[2]
        discarded_args = composed_info[3]

        for var_name, var_value in kwargs.items():
            if var_name in discarded_args and \
                        self._configuration is not None and \
                        self._configuration.discard_unknown_keys and \
                        self._additional_properties_model_instances:
                # discard variable.
                continue
            setattr(self, var_name, var_value)

        return self

    required_properties = set([
        '_data_store',
        '_check_type',
        '_spec_property_naming',
        '_path_to_item',
        '_configuration',
        '_visited_composed_classes',
        '_composed_instances',
        '_var_name_to_model_instances',
        '_additional_properties_model_instances',
    ])

    @convert_js_args_to_python_args
    def __init__(self, *args, **kwargs):  # noqa: E501
        """TranscriptsRequestData - a model defined in OpenAPI

        Keyword Args:
            _check_type (bool): if True, values for parameters in openapi_types
                                will be type checked and a TypeError will be
                                raised if the wrong type is input.
                                Defaults to True
            _path_to_item (tuple/list): This is a list of keys or values to
                                drill down to the model in received_data
                                when deserializing a response
            _spec_property_naming (bool): True if the variable names in the input data
                                are serialized names, as specified in the OpenAPI document.
                                False if the variable names in the input data
                                are pythonic names, e.g. snake case (default)
            _configuration (Configuration): the instance to use when
                                deserializing a file_type parameter.
                                If passed, type conversion is attempted
                                If omitted no type conversion is done.
            _visited_composed_classes (tuple): This stores a tuple of
                                classes that we have traveled through so that
                                if we see that class again we will not use its
                                discriminator again.
                                When traveling through a discriminator, the
                                composed schema that is
                                is traveled through is added to this set.
                                For example if Animal has a discriminator
                                petType and we pass in "Dog", and the class Dog
                                allOf includes Animal, we move through Animal
                                once using the discriminator, and pick Dog.
                                Then in Dog, we will make an instance of the
                                Animal class but this time we won't travel
                                through its discriminator because we passed in
                                _visited_composed_classes = (Animal,)
            start_date (date): Start Date (YYYY-MM-DD). If dates are not provided, default will return all files. . [optional]  # noqa: E501
            end_date (date): End Date (YYYY-MM-DD). If dates are not provided, default will return all files. . [optional]  # noqa: E501
            start_date_relative (int): - Start date relative to today (0=today, -1=yesterday). - *Either `startDate` or `startDateRelative` should be used.* - If dates are not provided, default will return all files. . [optional]  # noqa: E501
            end_date_relative (int): -  End date relative to today (0=today, -1=yesterday). -  *Either `endDate` or `endDateRelative` should be used.* -  If dates are not provided, default will return all files.   . [optional]  # noqa: E501
            time_zone (str): Time Zone for story dates/times (POSIX format from IANA timeZone registry).  Use the `/meta/time-zones` endpoint to get the list of available time zones.. [optional] if omitted the server will use the default value of "America/New_York"  # noqa: E501
            search_text (str): Text to search for within the transcript document stories.. [optional]  # noqa: E501
            primary_id (bool): If true, search only for documents where the provided `ids` are the primary identifiers. If false, search for any mention.  **Note:** Transcripts only have a primary ID, so the results remain the same regardless of whether primaryId=true or primaryId=false is specified in the request. . [optional] if omitted the server will use the default value of False  # noqa: E501
            report_ids ([str]): List of report IDs (max 1000).. [optional]  # noqa: E501
            categories ([str]): List of category codes (country, industry, subject). Use `/meta/categories` endpoint. Default is all.. [optional]  # noqa: E501
            date_type (str): Enables filtering of transcripts based on their uploadDateTime. . [optional]  # noqa: E501
            event_ids ([str]): List of event IDs (max 1000).. [optional]  # noqa: E501
            event_type (str): Specifies the type of event:  * Earnings: Regular quarterly calls where companies provide insights into their latest earnings, sharing details on their financial performance, including revenue, profits, and earnings per share.  * Guidance: Calls where companies offer estimated financial information about future earnings or outline business outlooks before official earnings are released.  * Analyst, Investor & Shareholder Meeting: Gatherings hosted by companies for analysts, investors, and shareholders to discuss strategic updates, financial health, and corporate developments.  * ConferencePresentation: A structured delivery of information within a conference setting, where individuals gather to discuss shared interests through formats such as keynote speeches, panel discussions, workshops, seminars, or webinars.  * SalesRevenue: Conference calls focused on discussing comprehensive sales activity and revenue figures, typically held monthly or quarterly.  * SpecialSituation: Conference calls addressing situations that do not fit into standard categories, often concerning mergers, acquisitions, joint ventures, or significant business updates.. [optional]  # noqa: E501
            start_date_time (datetime): The date from which data is required. If dates are not provided, default will return all files. . [optional]  # noqa: E501
            end_date_time (datetime): The date to which data is required. If dates are not provided, default will return all files. . [optional]  # noqa: E501
            ids ([str]): Requested symbols or securities. This is a list with a maximum limit of 1000. Each symbol can be a FactSet exchange symbol, CUSIP, SEDOL, ISIN, or Entity ID. [optional]  # noqa: E501
        """

        _check_type = kwargs.pop('_check_type', True)
        _spec_property_naming = kwargs.pop('_spec_property_naming', False)
        _path_to_item = kwargs.pop('_path_to_item', ())
        _configuration = kwargs.pop('_configuration', None)
        _visited_composed_classes = kwargs.pop('_visited_composed_classes', ())

        if args:
            raise ApiTypeError(
                "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
                    args,
                    self.__class__.__name__,
                ),
                path_to_item=_path_to_item,
                valid_classes=(self.__class__,),
            )

        self._data_store = {}
        self._check_type = _check_type
        self._spec_property_naming = _spec_property_naming
        self._path_to_item = _path_to_item
        self._configuration = _configuration
        self._visited_composed_classes = _visited_composed_classes + (self.__class__,)

        constant_args = {
            '_check_type': _check_type,
            '_path_to_item': _path_to_item,
            '_spec_property_naming': _spec_property_naming,
            '_configuration': _configuration,
            '_visited_composed_classes': self._visited_composed_classes,
        }
        composed_info = validate_get_composed_info(
            constant_args, kwargs, self)
        self._composed_instances = composed_info[0]
        self._var_name_to_model_instances = composed_info[1]
        self._additional_properties_model_instances = composed_info[2]
        discarded_args = composed_info[3]

        for var_name, var_value in kwargs.items():
            if var_name in discarded_args and \
                        self._configuration is not None and \
                        self._configuration.discard_unknown_keys and \
                        self._additional_properties_model_instances:
                # discard variable.
                continue
            setattr(self, var_name, var_value)
            if var_name in self.read_only_vars:
                raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
                                     f"class with read only attributes.")

    @cached_property
    def _composed_schemas():
        # we need this here to make our import statements work
        # we must store _composed_schemas in here so the code is only run
        # when we invoke this method. If we kept this at the class
        # level we would get an error because the class level
        # code would be run when this module is imported, and these composed
        # classes don't exist yet because their module has not finished
        # loading
        lazy_import()
        return {
          'anyOf': [
              TranscriptsByDateRequest,
              TranscriptsByEventsRequest,
              TranscriptsByIdsRequest,
              TranscriptsBySearchRequest,
              TranscriptsByTimesRequest,
          ],
          'allOf': [
          ],
          'oneOf': [
          ],
        }
