# Path: syncano_cli/custom_sockets/exceptions.py
# class BadYAMLDefinitionInEndpointsException(CLIBaseException):
#     default_message = u'Specify one general endpoint or specify endpoints for each method.'
# 
# Path: syncano_cli/sync/scripts.py
# ALLOWED_RUNTIMES = {
#     'golang': '.go',
#     'nodejs': '.js',
#     'nodejs_library_v0.4': '.js',
#     'nodejs_library_v1.0': '.js',
#     'php': '.php',
#     'python': '.py',
#     'python3': '.py',
#     'python_library_v4.2': '.py',
#     'python_library_v5.0': '.py',
#     'ruby': '.rb',
#     'swift': '.swift',
# }


import os
import six
import yaml
from collections import defaultdict
from syncano_cli.custom_sockets.exceptions import BadYAMLDefinitionInEndpointsException
from syncano_cli.sync.scripts import ALLOWED_RUNTIMES

        return api_endpoints

    @classmethod
    def _get_metadata(cls, endpoint_data):
        metadata = defaultdict(dict)
        for data_key, data in six.iteritems(endpoint_data):
            if data_key in cls.HTTP_METHODS:
                for metadata_key, inner_data in six.iteritems(data):
                    if metadata_key in cls.ENDPOINT_TYPES:
                        continue
                    if metadata_key == 'parameters':
                        metadata[metadata_key][data_key] = inner_data
                    else:
                        metadata[metadata_key] = inner_data

            elif data_key not in cls.ENDPOINT_TYPES:
                if data_key == 'parameters':
                    metadata[data_key]['*'] = data
                else:
                    metadata[data_key] = data
                metadata[data_key] = data

        return metadata

    @classmethod
    def _get_calls(cls, endpoint_data):
        calls = []
        keys = set(endpoint_data.keys())
        if keys.intersection(set(cls.HTTP_METHODS)) and keys.intersection(set(cls.ENDPOINT_TYPES)):

# Path: syncano_cli/custom_sockets/exceptions.py
# class BadYAMLDefinitionInEndpointsException(CLIBaseException):
#     default_message = u'Specify one general endpoint or specify endpoints for each method.'
# 
# Path: syncano_cli/sync/scripts.py
# ALLOWED_RUNTIMES = {
#     'golang': '.go',
#     'nodejs': '.js',
#     'nodejs_library_v0.4': '.js',
#     'nodejs_library_v1.0': '.js',
#     'php': '.php',
#     'python': '.py',
#     'python3': '.py',
#     'python_library_v4.2': '.py',
#     'python_library_v5.0': '.py',
#     'ruby': '.rb',
#     'swift': '.swift',
# }


# Path: syncano_cli/custom_sockets/jsonyaml.py
import os
import six
import yaml
from collections import defaultdict
from syncano_cli.custom_sockets.exceptions import BadYAMLDefinitionInEndpointsException
from syncano_cli.sync.scripts import ALLOWED_RUNTIMES


        return api_endpoints

    @classmethod
    def _get_metadata(cls, endpoint_data):
        metadata = defaultdict(dict)
        for data_key, data in six.iteritems(endpoint_data):
            if data_key in cls.HTTP_METHODS:
                for metadata_key, inner_data in six.iteritems(data):
                    if metadata_key in cls.ENDPOINT_TYPES:
                        continue
                    if metadata_key == 'parameters':
                        metadata[metadata_key][data_key] = inner_data
                    else:
                        metadata[metadata_key] = inner_data

            elif data_key not in cls.ENDPOINT_TYPES:
                if data_key == 'parameters':
                    metadata[data_key]['*'] = data
                else:
                    metadata[data_key] = data
                metadata[data_key] = data

        return metadata

    @classmethod
    def _get_calls(cls, endpoint_data):
        calls = []
        keys = set(endpoint_data.keys())
        if keys.intersection(set(cls.HTTP_METHODS)) and keys.intersection(set(cls.ENDPOINT_TYPES)):

            raise BadYAMLDefinitionInEndpointsException()