@assets.route('<STR_LIT>', methods=['<STR_LIT>'])<EOL>def update(did):
required_attributes = ['<STR_LIT>', '<STR_LIT>', '<STR_LIT:id>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>']<EOL>required_metadata_base_attributes = ['<STR_LIT:name>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>', '<STR_LIT:type>', '<STR_LIT>']<EOL>required_metadata_curation_attributes = ['<STR_LIT>', '<STR_LIT>']<EOL>assert isinstance(request.json, dict), '<STR_LIT>'<EOL>data = request.json<EOL>if not data:<EOL><INDENT>logger.error(f'<STR_LIT>')<EOL>return <NUM_LIT><EOL><DEDENT>msg, status = check_required_attributes(required_attributes, data, '<STR_LIT>')<EOL>if msg:<EOL><INDENT>return msg, status<EOL><DEDENT>msg, status = check_required_attributes(required_metadata_base_attributes,<EOL>_get_base_metadata(data['<STR_LIT>']), '<STR_LIT>')<EOL>if msg:<EOL><INDENT>return msg, status<EOL><DEDENT>msg, status = check_required_attributes(required_metadata_curation_attributes,<EOL>_get_curation_metadata(data['<STR_LIT>']), '<STR_LIT>')<EOL>if msg:<EOL><INDENT>return msg, status<EOL><DEDENT>msg, status = check_no_urls_in_files(_get_base_metadata(data['<STR_LIT>']), '<STR_LIT>')<EOL>if msg:<EOL><INDENT>return msg, status<EOL><DEDENT>msg, status = validate_date_format(data['<STR_LIT>'])<EOL>if msg:<EOL><INDENT>return msg, status<EOL><DEDENT>_record = dict()<EOL>_record = copy.deepcopy(data)<EOL>_record['<STR_LIT>'] = datetime.strptime(data['<STR_LIT>'], '<STR_LIT>')<EOL>try:<EOL><INDENT>if dao.get(did) is None:<EOL><INDENT>register()<EOL>return _sanitize_record(_record), <NUM_LIT><EOL><DEDENT>else:<EOL><INDENT>for service in _record['<STR_LIT>']:<EOL><INDENT>service_id = int(service['<STR_LIT>'])<EOL>if service['<STR_LIT:type>'] == '<STR_LIT>':<EOL><INDENT>_record['<STR_LIT>'][service_id]['<STR_LIT>']['<STR_LIT>']['<STR_LIT>'] = _get_date(<EOL>dao.get(did)['<STR_LIT>'])<EOL><DEDENT><DEDENT>dao.update(_record, did)<EOL>return Response(_sanitize_record(_record), <NUM_LIT:200>, content_type='<STR_LIT:application/json>')<EOL><DEDENT><DEDENT>except Exception as err:<EOL><INDENT>return f'<STR_LIT>', <NUM_LIT><EOL><DEDENT>
Update DDO of an existing asset
    ---
    tags:
      - ddo
    consumes:
      - application/json
    parameters:
      - in: body
        name: body
        required: true
        description: DDO of the asset.
        schema:
          type: object
          required:
            - "@context"
            - created
            - id
            - publicKey
            - authentication
            - proof
            - service
          properties:
            "@context":
              description:
              example: https://w3id.org/future-method/v1
              type: string
            id:
              description: ID of the asset.
              example: did:op:123456789abcdefghi
              type: string
            created:
              description: date of ddo creation.
              example: "2016-02-08T16:02:20Z"
              type: string
            publicKey:
                  type: array
                  description: List of public keys.
                  example: [{"id": "did:op:123456789abcdefghi#keys-1"},
                            {"type": "Ed25519VerificationKey2018"},
                            {"owner": "did:op:123456789abcdefghi"},
                            {"publicKeyBase58": "H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV"}]
            authentication:
                  type: array
                  description: List of authentication mechanisms.
                  example: [{"type": "RsaSignatureAuthentication2018"},
                            {"publicKey": "did:op:123456789abcdefghi#keys-1"}]
            proof:
                  type: dictionary
                  description: Information about the creation and creator of the asset.
                  example:  {"type": "UUIDSignature",
                             "created": "2016-02-08T16:02:20Z",
                             "creator": "did:example:8uQhQMGzWxR8vw5P3UWH1ja",
                             "signatureValue": "QNB13Y7Q9...1tzjn4w=="
                            }
            service:
                  type: array
                  description: List of services.
                  example: [{"type": "Access",
                             "serviceEndpoint":
                             "http://mybrizo.org/api/v1/brizo/services/consume?pubKey=${
                             pubKey}&serviceId={serviceId}&url={url}"},
                            {"type": "Compute",
                             "serviceEndpoint":
                             "http://mybrizo.org/api/v1/brizo/services/compute?pubKey=${
                             pubKey}&serviceId={serviceId}&algo={algo}&container={container}"},
                           {
                            "type": "Metadata",
                            "serviceDefinitionId": "2",
                            "serviceEndpoint":
                            "http://myaquarius.org/api/v1/provider/assets/metadata/{did}",
                            "metadata": {
                                "base": {
                                    "name": "UK Weather information 2011",
                                    "type": "dataset",
                                    "description": "Weather information of UK including
                                    temperature and humidity",
                                    "dateCreated": "2012-02-01T10:55:11Z",
                                    "author": "Met Office",
                                    "license": "CC-BY",
                                    "copyrightHolder": "Met Office",
                                    "compression": "zip",
                                    "workExample": "stationId,latitude,longitude,datetime,
                                    temperature,humidity/n423432fsd,51.509865,-0.118092,
                                    2011-01-01T10:55:11+00:00,7.2,68",
                                    "files": [{
                                            "contentLength": "4535431",
                                            "contentType": "text/csv",
                                            "encoding": "UTF-8",
                                            "compression": "zip",
                                            "resourceId": "access-log2018-02-13-15-17-29-18386C502CAEA932"
                                    }
                                    ],

                                    "encryptedFiles": "0x098213xzckasdf089723hjgdasfkjgasfv",
                                    "links": [{
                                            "name": "Sample of Asset Data",
                                            "type": "sample",
                                            "url": "https://foo.com/sample.csv"
                                        },
                                        {
                                            "name": "Data Format Definition",
                                            "type": "format",
                                            "AssetID":
                                            "4d517500da0acb0d65a716f61330969334630363ce4a6a9d39691026ac7908ea"
                                        }
                                    ],
                                    "inLanguage": "en",
                                    "tags": "weather, uk, 2011, temperature, humidity",
                                    "price": 10,
                                    "checksum":
                                    "38803b9e6f04fce3fba4b124524672592264d31847182c689095a081c9e85262"
                                },
                                "curation": {
                                    "rating": 0.93,
                                    "numVotes": 123,
                                    "schema": "Binary Voting"
                                },
                                "additionalInformation": {
                                    "updateFrecuency": "yearly",
                                    "structuredMarkup": [{
                                            "uri": "http://skos.um.es/unescothes/C01194/jsonld",
                                            "mediaType": "application/ld+json"
                                        },
                                        {
                                            "uri": "http://skos.um.es/unescothes/C01194/turtle",
                                            "mediaType": "text/turtle"
                                        }
                                    ]
                                }
                            }
                        }]
    responses:
      200:
        description: Asset successfully updated.
      201:
        description: Asset successfully registered.
      400:
        description: One of the required attributes is missing.
      404:
        description: Invalid asset data.
      500:
        description: Error