def validate(dic):
	option_list = ['create', 'update', 'delete']
	for option in option_list:
		if dic['getlist'] and dic[option]:
			raise click.UsageError('Invalid option combination --getlist cannot be used with --%s' % option)
			break

	option_list = ['update', 'delete']
	for option in option_list:
		if dic['create'] and dic[option]:
			raise click.UsageError('Invalid option combination --create cannot be used with --%s' % option)
			break

	if dic['delete'] and dic['update']:
		raise click.UsageError('Invalid option combination --delete cannot be used with --update')

	option_list = ['type', 'name', 'data', 'priority', 'port', 'weight', 'recordid']
	for option in option_list:
		if dic['getlist'] and dic[option]:
			raise click.UsageError('Invalid option combination --getlist cannot be used with --%s' % option)
			break

		if dic['delete'] and dic[option]:
			raise click.UsageError('Invalid option combination --delete cannot be used with --%s' % option)
			break

	option_list = ['type', 'name', 'data']
	for option in option_list:
		if dic['create'] and not dic[option]:
			raise click.UsageError('--create requires --type, --name and --data options')
			break

	if dic['update'] and not dic['recordid']:
		raise click.UsageError('--update requires --recordid to be updated')


	if dic['update'] and (not dic['type'] or not dic['name'] or not dic['data'] or not dic['priority'] or not dic['port'] or not dic['weight']):
		raise click.UsageError('--update requires atleast one option from [--type, --name, --data, --priority, --port, --weight]')

	if (dic['name'] or dic['type'] or dic['data'] or dic['priority'] or dic['port'] or dic['weight']) and (not dic['create'] or not dic['update']):
		raise click.UsageError('[--type, --name, --data, --priority, --port, --weight] options either use with --create or --update')

	if dic['recordid'] and not dic['update']:
		raise click.UsageError('--recordid requires --update option')

	return True
dataset/ETHPy150Open yspanchal/docli/docli/commands/records.py/validate/original