def _fetch_activity_data(
        self, type_data, state, table_name, is_table_not_exist, last_time=None
    ):
        """Fetch_activity_data is used to push all the data into table.

        Args:
            self: Armis object.
            type_data (json): will contain the json data to use in the _get_links function.
            state (object): StateManager object.
            table_name (String): table name to store the data in microsoft sentinel.
            is_table_not_exist (bool): it is a flag that contains the value if table exists or not.
            last_time (String): it will contain latest time stamp.
        """
        try:
            self._get_access_token_activity("/access_token/")
            if is_table_not_exist:
                aql_data = '''{} timeFrame:"1 Days" alert:(status:Unhandled,Suppressed,Resolved timeFrame:"1 Days")'''.format(
                    type_data["aql"]
                )
            else:
                aql_data = """{} alert:(status:Unhandled,Suppressed,Resolved) after:{} """.format(
                    type_data["aql"], last_time
                )
            type_data["aql"] = aql_data
            logging.info(
                "Armis Activity Connector: aql data new " + str(type_data["aql"])
            )

            azuresentinel = AzureSentinel()
            while self._data_activity_from is not None:
                parameter_activity = {
                    "aql": type_data["aql"],
                    "from": self._data_activity_from,
                    "orderBy": "time",
                    "length": 1000,
                    "fields": type_data["fields"],
                }
                (
                    body,
                    current_time,
                    total_data_length,
                    count_per_frame_data,
                ) = self._get_activity_data("/search/", parameter_activity)
                logging.info(
                    "Armis Activity Connector: Total length of data is %s ",
                    total_data_length,
                )
                logging.info("Armis Activity Connector:  Data collection is done successfully.")
                azuresentinel.post_data(customer_id, body, table_name)
                logging.info(
                    "Armis Activity Connector: Collected %s activity data into microsoft sentinel.",
                    count_per_frame_data,
                )
                state.post(str(current_time))
                logging.info(
                    "Armis Activity Connector: Timestamp added at: "
                    + str(current_time)
                )
                logging.info(
                    "Armis Activity Connector: Timestamp added into the StateManager successfully."
                )

            if(str(is_avoid_duplicates).lower() == "true"):
                current_time = datetime.datetime.strptime(current_time, '%Y-%m-%dT%H:%M:%S')
                current_time += datetime.timedelta(seconds=1)
                current_time = current_time.strftime('%Y-%m-%dT%H:%M:%S')
                state.post(str(current_time))
                logging.info("Armis Activity Connector: Last timestamp with plus one second is added at: {}".format(
                    current_time)
                )
                logging.info("Armis Activity Connector: "
                             + "Last timestamp is added with plus one second into the StateManager successfully.")

        except ArmisException as err:
            logging.error(err)
            raise ArmisException(
                "Armis Activity Connector: Error while processing the data."
            )

        except ArmisDataNotFoundException:
            raise ArmisDataNotFoundException()
Fetch_activity_data is used to push all the data into table.

        Args:
            self: Armis object.
            type_data (json): will contain the json data to use in the _get_links function.
            state (object): StateManager object.
            table_name (String): table name to store the data in microsoft sentinel.
            is_table_not_exist (bool): it is a flag that contains the value if table exists or not.
            last_time (String): it will contain latest time stamp.
        
Solutions/Armis/Data Connectors/ArmisActivities/ArmisActivitySentinelConnector/__init__.py