def build_query(self, parsed_args):
    selectors = []
    if ((parsed_args.start_interval is None) and (parsed_args.schedule_interval is None)):
        end_datetime = self.current_time
        start_datetime = (end_datetime - timedelta(days=4))
        start_time_str = start_datetime.strftime('%Y-%m-%dT%H:%M:%S')
        end_time_str = end_datetime.strftime('%Y-%m-%dT%H:%M:%S')
        selectors.append({'fieldName': '@actualStartTime', 'operator': {'type': 'BETWEEN', 'values': [start_time_str, end_time_str]}})
    else:
        self._build_schedule_times(selectors, parsed_args)
    if (parsed_args.status is not None):
        self._build_status(selectors, parsed_args)
    query = {'selectors': selectors}
    return query
def build_query(self, parsed_args):
    selectors = []
    if ((parsed_args.start_interval is None) and (parsed_args.schedule_interval is None)):
        end_datetime = self.current_time
        start_datetime = (end_datetime - timedelta(days=4))
        start_time_str = start_datetime.strftime('%Y-%m-%dT%H:%M:%S')
        end_time_str = end_datetime.strftime('%Y-%m-%dT%H:%M:%S')
        selectors.append({'fieldName': '@actualStartTime', 'operator': {'type': 'BETWEEN', 'values': [start_time_str, end_time_str]}})
    else:
        self._build_schedule_times(selectors, parsed_args)
    if (parsed_args.status is not None):
        self._build_status(selectors, parsed_args)
    query = {'selectors': selectors}
    return query