While a lambda is still processing (archive unpacking etc), the lambda state should be set to "Pending" (currently "Active") and invocations to that lambda should fail (currently, it can end up in a inconsistent state in this case, like lambdas being executed without layers).

Lambda state should reflect the current internal state, and invocations should fail if not active.
---
    operationId: 'updateFunctionCode'
    parameters:
        - name: 'request'
          in: body
    """
    region = LambdaRegion.get()
    arn = func_arn(function)
    lambda_function = region.lambdas.get(arn)
    if not lambda_function:
        return not_found_error("Function not found: %s" % arn)
    data = json.loads(to_str(request.data))
    lambda_function.code = data
    result = set_function_code(lambda_function)
    if isinstance(result, Response):
        return result
    if data.get("Architectures"):
        lambda_function.architectures = data["Architectures"]
    lambda_function.last_modified = datetime.utcnow()
    result.update(format_func_details(lambda_function))
    if data.get("Publish"):
        result["Version"] = publish_new_function_version(arn)["Version"]
    return jsonify(result or {})
@app.route("%s/functions/<function>/code" % API_PATH_ROOT, methods=["GET"])
def get_function_code(function):
    """Get the code of an existing function
    ---
    operationId: 'getFunctionCode'
    parameters:
    """