source/backend/lambda_schema_server/lambda_schema_server.py [73:162]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        if 'Item' in resp:
            attributes = resp['Item']['attributes']
        for attr in attributes:
            if 'name' in attr:
                names.append(attr['name'])
        if 'event' in body:
            if body['event'] == 'DELETE':
               if "name" not in body:
                    return {'headers': {'Access-Control-Allow-Origin': '*'},
                            'statusCode': 400, 'body': "Attribute Name: name is required"}
               for attr in attributes:
                   if attr['name'] == body['name']:
                       attributes.remove(attr)
            if body['event'] == 'PUT':
                if "update" not in body:
                    return {'headers': {'Access-Control-Allow-Origin': '*'},
                            'statusCode': 400, 'body': "Attribute Name: update is required"}
                if "name" not in body:
                    return {'headers': {'Access-Control-Allow-Origin': '*'},
                            'statusCode': 400, 'body': "Attribute Name: name is required"}
                if body['update']['type'] is '':
                    return {'headers': {'Access-Control-Allow-Origin': '*'},
                            'statusCode': 400, 'body': "Attribute Name: 'Type' cannot be empty"}
                if body['update']['description'] is '':
                    return {'headers': {'Access-Control-Allow-Origin': '*'},
                            'statusCode': 400, 'body': "Attribute Name: 'Description' cannot be empty"}
                if body['update']['name'] is '':
                    return {'headers': {'Access-Control-Allow-Origin': '*'},
                            'statusCode': 400, 'body': "Attribute Name: 'Name' can not be empty"}
                if body['update']['type'] == 'list':
                    if 'listvalue' in body['update']:
                        if body['update']['listvalue'] is '':
                            return {'headers': {'Access-Control-Allow-Origin': '*'},
                                    'statusCode': 400, 'body': "Attribute Name: 'List Value' can not be empty"}
                    else:
                            return {'headers': {'Access-Control-Allow-Origin': '*'},
                                    'statusCode': 400, 'body': "Attribute Name: 'List Value' can not be empty"}
                if body['update']['name'] in names and body['name'] != body['update']['name']:
                    return {'headers': {'Access-Control-Allow-Origin': '*'},
                            'statusCode': 400, 'body': "Name: " + body['update']['name'] + " already exist"}
                for attr in attributes:
                   if attr['name'] == body['name']:
                       if body['update']['type'] != 'list':
                          if 'listvalue' in body['update']:
                              del body['update']['listvalue']
                       index = attributes.index(attr)
                       attributes.remove(attr)
                       attributes.insert(index,body['update'])
            if body['event'] == 'POST':
                if "new" not in body:
                    return {'headers': {'Access-Control-Allow-Origin': '*'},
                            'statusCode': 400, 'body': "Attribute Name: new is required"}
                if "name" not in body['new']:
                    return {'headers': {'Access-Control-Allow-Origin': '*'},
                            'statusCode': 400, 'body': "Attribute Name: name is required"}
                if body['new']['name'] in names:
                    return {'headers': {'Access-Control-Allow-Origin': '*'},
                            'statusCode': 400, 'body': "Name: " + body['new']['name'] + " already exist"}
                if body['new']['name'] == "":
                    return {'headers': {'Access-Control-Allow-Origin': '*'},
                            'statusCode': 400, 'body': "Attribute Name can not be empty"}
                if 'description' not in body['new']:
                    return {'headers': {'Access-Control-Allow-Origin': '*'},
                            'statusCode': 400, 'body': "Attribute Name: 'Description' cannot be empty"}
                else:
                    if body['new']['description'] is '':
                        return {'headers': {'Access-Control-Allow-Origin': '*'},
                                'statusCode': 400, 'body': "Attribute Name: 'Description' cannot be empty"}
                if 'type' not in body['new']:
                        return {'headers': {'Access-Control-Allow-Origin': '*'},
                                'statusCode': 400, 'body': "Attribute Name: 'Type' cannot be empty"}
                else:
                    if body['new']['type'] is '':
                        return {'headers': {'Access-Control-Allow-Origin': '*'},
                                'statusCode': 400, 'body': "Attribute Name: 'Type' cannot be empty"}
                if body['new']['type'] == 'list':
                    if 'listvalue' in body['new']:
                        if body['new']['listvalue'] is '':
                            return {'headers': {'Access-Control-Allow-Origin': '*'},
                                    'statusCode': 400, 'body': "Attribute Name: 'List Value' can not be empty"}
                    else:
                            return {'headers': {'Access-Control-Allow-Origin': '*'},
                                    'statusCode': 400, 'body': "Attribute Name: 'List Value' can not be empty"}
                attributes.append(body['new'])
        else:
            return {'headers': {'Access-Control-Allow-Origin': '*'},
                    'statusCode': 400, 'body': "Attribute Name: event is required"}
        resp = schema_table.put_item(

            Item={
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



source/backend/lambda_schema_wave/lambda_schema_wave.py [73:162]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        if 'Item' in resp:
            attributes = resp['Item']['attributes']
        for attr in attributes:
            if 'name' in attr:
                names.append(attr['name'])
        if 'event' in body:
            if body['event'] == 'DELETE':
               if "name" not in body:
                    return {'headers': {'Access-Control-Allow-Origin': '*'},
                            'statusCode': 400, 'body': "Attribute Name: name is required"}
               for attr in attributes:
                   if attr['name'] == body['name']:
                       attributes.remove(attr)
            if body['event'] == 'PUT':
                if "update" not in body:
                    return {'headers': {'Access-Control-Allow-Origin': '*'},
                            'statusCode': 400, 'body': "Attribute Name: update is required"}
                if "name" not in body:
                    return {'headers': {'Access-Control-Allow-Origin': '*'},
                            'statusCode': 400, 'body': "Attribute Name: name is required"}
                if body['update']['type'] is '':
                    return {'headers': {'Access-Control-Allow-Origin': '*'},
                            'statusCode': 400, 'body': "Attribute Name: 'Type' cannot be empty"}
                if body['update']['description'] is '':
                    return {'headers': {'Access-Control-Allow-Origin': '*'},
                            'statusCode': 400, 'body': "Attribute Name: 'Description' cannot be empty"}
                if body['update']['name'] is '':
                    return {'headers': {'Access-Control-Allow-Origin': '*'},
                            'statusCode': 400, 'body': "Attribute Name: 'Name' can not be empty"}
                if body['update']['type'] == 'list':
                    if 'listvalue' in body['update']:
                        if body['update']['listvalue'] is '':
                            return {'headers': {'Access-Control-Allow-Origin': '*'},
                                    'statusCode': 400, 'body': "Attribute Name: 'List Value' can not be empty"}
                    else:
                            return {'headers': {'Access-Control-Allow-Origin': '*'},
                                    'statusCode': 400, 'body': "Attribute Name: 'List Value' can not be empty"}
                if body['update']['name'] in names and body['name'] != body['update']['name']:
                    return {'headers': {'Access-Control-Allow-Origin': '*'},
                            'statusCode': 400, 'body': "Name: " + body['update']['name'] + " already exist"}
                for attr in attributes:
                   if attr['name'] == body['name']:
                       if body['update']['type'] != 'list':
                          if 'listvalue' in body['update']:
                              del body['update']['listvalue']
                       index = attributes.index(attr)
                       attributes.remove(attr)
                       attributes.insert(index,body['update'])
            if body['event'] == 'POST':
                if "new" not in body:
                    return {'headers': {'Access-Control-Allow-Origin': '*'},
                            'statusCode': 400, 'body': "Attribute Name: new is required"}
                if "name" not in body['new']:
                    return {'headers': {'Access-Control-Allow-Origin': '*'},
                            'statusCode': 400, 'body': "Attribute Name: name is required"}
                if body['new']['name'] in names:
                    return {'headers': {'Access-Control-Allow-Origin': '*'},
                            'statusCode': 400, 'body': "Name: " + body['new']['name'] + " already exist"}
                if body['new']['name'] == "":
                    return {'headers': {'Access-Control-Allow-Origin': '*'},
                            'statusCode': 400, 'body': "Attribute Name can not be empty"}
                if 'description' not in body['new']:
                    return {'headers': {'Access-Control-Allow-Origin': '*'},
                            'statusCode': 400, 'body': "Attribute Name: 'Description' cannot be empty"}
                else:
                    if body['new']['description'] is '':
                        return {'headers': {'Access-Control-Allow-Origin': '*'},
                                'statusCode': 400, 'body': "Attribute Name: 'Description' cannot be empty"}
                if 'type' not in body['new']:
                        return {'headers': {'Access-Control-Allow-Origin': '*'},
                                'statusCode': 400, 'body': "Attribute Name: 'Type' cannot be empty"}
                else:
                    if body['new']['type'] is '':
                        return {'headers': {'Access-Control-Allow-Origin': '*'},
                                'statusCode': 400, 'body': "Attribute Name: 'Type' cannot be empty"}
                if body['new']['type'] == 'list':
                    if 'listvalue' in body['new']:
                        if body['new']['listvalue'] is '':
                            return {'headers': {'Access-Control-Allow-Origin': '*'},
                                    'statusCode': 400, 'body': "Attribute Name: 'List Value' can not be empty"}
                    else:
                            return {'headers': {'Access-Control-Allow-Origin': '*'},
                                    'statusCode': 400, 'body': "Attribute Name: 'List Value' can not be empty"}
                attributes.append(body['new'])
        else:
            return {'headers': {'Access-Control-Allow-Origin': '*'},
                    'statusCode': 400, 'body': "Attribute Name: event is required"}
        resp = schema_table.put_item(

            Item={
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



