# 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')


import botocore
from lamvery.clients.base import BaseClient
            kwargs['Name'] = rule['name']
            kwargs['State'] = rule.get('state', 'ENABLED')

            if rule.get('description') is not None:
                kwargs['Description'] = rule.get('description')
            if rule.get('pattern') is not None:
                kwargs['EventPattern'] = rule.get('pattern')
            if rule.get('schedule') is not None:
                kwargs['ScheduleExpression'] = rule.get('schedule')

            return self._events.put_rule(**kwargs)

    def put_targets(self, rule, targets, arn):
        if not self._dry_run:
            t_args = []

            for t in targets:
                arg = {'Id': t['id'], 'Arn': arn}
                if t.get('input') is not None:
                    arg['Input'] = t['input']
                if t.get('input_path') is not None:
                    arg['InputPath'] = t['input_path']
                t_args.append(arg)

            self._events.put_targets(Rule=rule, Targets=t_args)

    def get_targets_by_rule(self, rule, next_token=None):
        try:
            if next_token:
                rules = self._events.list_targets_by_rule(

# 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/events.py
import botocore
from lamvery.clients.base import BaseClient

            kwargs['Name'] = rule['name']
            kwargs['State'] = rule.get('state', 'ENABLED')

            if rule.get('description') is not None:
                kwargs['Description'] = rule.get('description')
            if rule.get('pattern') is not None:
                kwargs['EventPattern'] = rule.get('pattern')
            if rule.get('schedule') is not None:
                kwargs['ScheduleExpression'] = rule.get('schedule')

            return self._events.put_rule(**kwargs)

    def put_targets(self, rule, targets, arn):
        if not self._dry_run:
            t_args = []

            for t in targets:
                arg = {'Id': t['id'], 'Arn': arn}
                if t.get('input') is not None:
                    arg['Input'] = t['input']
                if t.get('input_path') is not None:
                    arg['InputPath'] = t['input_path']
                t_args.append(arg)

            self._events.put_targets(Rule=rule, Targets=t_args)

    def get_targets_by_rule(self, rule, next_token=None):
        try:
            if next_token:
                rules = self._events.list_targets_by_rule(

                    Rule=rule, NextToken=next_token, Limit=100)