# Path: lamvery/clients/base.py
# class BaseClient:
# 
#     __metaclass__ = ABCMeta
# 
#     def __init__(self, region=None, profile=None, dry_run=False):
#         self._session = boto3.session.Session(
#             profile_name=profile, region_name=region)
#         self._dry_run = dry_run
#         self._sts = self._session.client('sts')
# 
#     def get_account_id(self):
#         return self._sts.get_caller_identity().get('Account')


from lamvery.clients.base import BaseClient
# -*- coding: utf-8 -*-



class LogsClient(BaseClient):

    def __init__(self, *args, **kwargs):
        super(LogsClient, self).__init__(*args, **kwargs)
        self._logs = self._session.client('logs')

    def get_log_events(self, function, start, pattern, next_token=None):
        kwargs = {}
        kwargs['logGroupName'] = '/aws/lambda/{}'.format(function)
        kwargs['startTime'] = start
        kwargs['limit'] = 100

        if pattern is not None:
            kwargs['filterPattern'] = pattern
        if next_token is not None:

# Path: lamvery/clients/base.py
# class BaseClient:
# 
#     __metaclass__ = ABCMeta
# 
#     def __init__(self, region=None, profile=None, dry_run=False):
#         self._session = boto3.session.Session(
#             profile_name=profile, region_name=region)
#         self._dry_run = dry_run
#         self._sts = self._session.client('sts')
# 
#     def get_account_id(self):
#         return self._sts.get_caller_identity().get('Account')


# Path: lamvery/clients/logs.py
from lamvery.clients.base import BaseClient

# -*- coding: utf-8 -*-



class LogsClient(BaseClient):

    def __init__(self, *args, **kwargs):
        super(LogsClient, self).__init__(*args, **kwargs)
        self._logs = self._session.client('logs')

    def get_log_events(self, function, start, pattern, next_token=None):
        kwargs = {}
        kwargs['logGroupName'] = '/aws/lambda/{}'.format(function)
        kwargs['startTime'] = start
        kwargs['limit'] = 100

        if pattern is not None:
            kwargs['filterPattern'] = pattern
        if next_token is not None:

            kwargs['nextToken'] = next_token