# Path: armet/resources/resource/options.py
# def _merge(options, name, bases, default=None):
#     def __init__(self, meta, name, data, bases):
# class ResourceOptions(object):


from ..resource import options
def _methods_to_operations(methods):
    operations = set()
    for method in methods:
        operations.update(_method_to_operation(method))

    return operations


def _operation_to_method(operation):
    if operation == 'read':
        return set(['GET'])

    if operation == 'update':
        return set(['PUT', 'PATCH', 'LINK', 'UNLINK'])

    if operation == 'create':
        return set(['PUT', 'PATCH', 'POST'])

    if operation == 'destroy':
        return set(['PUT', 'DELETE'])


def _operations_to_methods(operations):
    methods = set(['HEAD', 'OPTIONS'])
    for operation in operations:
        methods.update(_operation_to_method(operation))

    return methods



# Path: armet/resources/resource/options.py
# def _merge(options, name, bases, default=None):
#     def __init__(self, meta, name, data, bases):
# class ResourceOptions(object):


# Path: armet/resources/managed/options.py
from ..resource import options

def _methods_to_operations(methods):
    operations = set()
    for method in methods:
        operations.update(_method_to_operation(method))

    return operations


def _operation_to_method(operation):
    if operation == 'read':
        return set(['GET'])

    if operation == 'update':
        return set(['PUT', 'PATCH', 'LINK', 'UNLINK'])

    if operation == 'create':
        return set(['PUT', 'PATCH', 'POST'])

    if operation == 'destroy':
        return set(['PUT', 'DELETE'])


def _operations_to_methods(operations):
    methods = set(['HEAD', 'OPTIONS'])
    for operation in operations:
        methods.update(_operation_to_method(operation))

    return methods



class ManagedResourceOptions(options.ResourceOptions):