def add_plan(self, name: str, services: Optional[str], tasks: Optional[List[str]], description: Optional[str]):
    'Add a new backup plan\n\n        The validation of the inputs in the CLI is intentionally lacking as this is offloaded to the backup service.\n        Args:\n            name (str): The name to give the new plan. It must be unique.\n            services (optional list): A list of services to backup if empty all services are backed up.\n            tasks (optional list): A list of JSON strings representing the tasks to be run.\n            description (optional str): A optional description string.\n        '
    if (not name):
        _exit_if_errors(['--name is required'])
    service_list = []
    if services:
        service_list = [service.strip() for service in services.split(',')]
    tasks_objects = []
    if tasks:
        for task_str in tasks:
            try:
                task = json.loads(task_str)
                tasks_objects.append(task)
            except json.decoder.JSONDecodeError as json_error:
                _exit_if_errors([f'invalid task {json_error!s}'])
    plan = {}
    if service_list:
        plan['services'] = service_list
    if tasks_objects:
        plan['tasks'] = tasks_objects
    if description:
        plan['description'] = description
    (_, errors) = self.rest.add_backup_plan(name, plan)
    _exit_if_errors(errors)
    _success('Added plan')
Add a new backup plan

The validation of the inputs in the CLI is intentionally lacking as this is offloaded to the backup service.
Args:
    name (str): The name to give the new plan. It must be unique.
    services (optional list): A list of services to backup if empty all services are backed up.
    tasks (optional list): A list of JSON strings representing the tasks to be run.
    description (optional str): A optional description string.
def add_plan(self, name: str, services: Optional[str], tasks: Optional[List[str]], description: Optional[str]):
    'Add a new backup plan\n\n        The validation of the inputs in the CLI is intentionally lacking as this is offloaded to the backup service.\n        Args:\n            name (str): The name to give the new plan. It must be unique.\n            services (optional list): A list of services to backup if empty all services are backed up.\n            tasks (optional list): A list of JSON strings representing the tasks to be run.\n            description (optional str): A optional description string.\n        '
    if (not name):
        _exit_if_errors(['--name is required'])
    service_list = []
    if services:
        service_list = [service.strip() for service in services.split(',')]
    tasks_objects = []
    if tasks:
        for task_str in tasks:
            try:
                task = json.loads(task_str)
                tasks_objects.append(task)
            except json.decoder.JSONDecodeError as json_error:
                _exit_if_errors([f'invalid task {json_error!s}'])
    plan = {}
    if service_list:
        plan['services'] = service_list
    if tasks_objects:
        plan['tasks'] = tasks_objects
    if description:
        plan['description'] = description
    (_, errors) = self.rest.add_backup_plan(name, plan)
    _exit_if_errors(errors)
    _success('Added plan')