indexing description: "Issue update message." author: "Peter Wyss " date: "$Date$" revision: "$Revision$" class O_ISSUE_UPDATE_MESSAGE inherit O_SESSION_MESSAGE rename make as make_session redefine make_from_generic, arguments end O_ISSUE_CONSTANTS undefine out end create make create {O_MESSAGE_FACTORY} make_from_generic feature {NONE} -- Initialization make (a_session: like session; a_project: like project; a_project_issue_id: like project_issue_id; a_title: like title; a_description: like description; a_tags: like tags; a_is_private: like is_private; a_is_internal: like is_internal) is -- Create. require a_session_ok: a_session /= Void and then not a_session.is_empty a_project_ok: a_project > 0 a_project_issue_ok: a_project_issue_id > 0 a_title_ok: a_title /= Void and then not a_title.is_empty a_description_ok: a_description /= Void a_tags_ok: a_tags /= Void do make_session (a_session) project := a_project project_issue_id := a_project_issue_id title := a_title description := a_description tags := a_tags is_private := a_is_private is_internal := a_is_internal ensure project_set: project = a_project issie_id_set: project_issue_id = a_project_issue_id title_set: title = a_title description_set: description = a_description tags_set: tags = a_tags is_private_set: is_private = a_is_private is_internal_set: is_internal = a_is_internal end make_from_generic (a_msg: O_GENERIC_MESSAGE) is -- Create from a generic message. local l_args: HASH_TABLE [STRING, STRING] do Precursor (a_msg) l_args := a_msg.arguments project := l_args.item (project_argument).to_integer project_issue_id := l_args.item (project_issue_id_argument).to_integer title := l_args.item (title_argument) description := l_args.item (description_argument) tags := l_args.item (tags_argument) is_private := l_args.item (is_private_argument).to_boolean is_internal := l_args.item (is_internal_argument).to_boolean end feature -- Access namespace: STRING is -- Namespace of the message type. once Result := issue_namespace end type: STRING is -- Type of the message. once Result := issue_update_type end project: INTEGER -- id of the project project_issue_id: INTEGER -- id of the issue title: STRING -- Title of the issue description: STRING -- Issue description tags: STRING -- Tags is_private: BOOLEAN -- is this a private issue? is_internal: BOOLEAN -- is this an internal message? arguments: HASH_TABLE [STRING, STRING] is -- Named arguments. do Result := Precursor Result.force (project.out, project_argument) Result.force (project_issue_id.out, project_issue_id_argument) Result.force (title, title_argument) Result.force (description, description_argument) Result.force (tags, tags_argument) Result.force (is_private.out, is_private_argument) Result.force (is_internal.out, is_internal_argument) end feature {NONE} -- Implementation project_argument: STRING is "project" project_issue_id_argument: STRING is "project_issue_id" title_argument: STRING is "title" description_argument: STRING is "description" tags_argument: STRING is "tags" is_private_argument: STRING is "is_private" is_internal_argument: STRING is "is_internal" invariant project_ok: project > 0 issue_isd_ok: project_issue_id > 0 title_ok: title /= Void and then not title.is_empty description_ok: description /= Void tags_ok: tags /= Void end