def _merge_entity(entity, if_match, require_encryption=False, key_encryption_key=None):
_validate_not_none('<STR_LIT>', if_match)<EOL>_validate_entity(entity)<EOL>_validate_encryption_unsupported(require_encryption, key_encryption_key)<EOL>request = HTTPRequest()<EOL>request.method = '<STR_LIT>'<EOL>request.headers = {<EOL>_DEFAULT_CONTENT_TYPE_HEADER[<NUM_LIT:0>]: _DEFAULT_CONTENT_TYPE_HEADER[<NUM_LIT:1>],<EOL>_DEFAULT_ACCEPT_HEADER[<NUM_LIT:0>]: _DEFAULT_ACCEPT_HEADER[<NUM_LIT:1>],<EOL>'<STR_LIT>': _to_str(if_match)<EOL>}<EOL>request.body = _get_request_body(_convert_entity_to_json(entity))<EOL>return request<EOL>
Constructs a merge entity request.