code: public void addTrait(String guid, Struct traitDefinition) throws AtlasServiceException {
          String traitJson = InstanceSerialization.toJson(traitDefinition, true);
          LOG.debug("Adding trait to entity with id {} {}", guid, traitJson);
          callAPIWithBodyAndParams(API.ADD_TRAITS, traitJson, guid, URI_TRAITS);
      }
docs: Associate trait to an entity
  
  @param guid      guid
  @param traitDefinition trait definition