/// <summary> /// Get Name for goal /// </summary> /// <param name="value">GoalCodeEnum</param> /// <returns></returns> public static string goalName(this GoalCode value) { return(value.GetType()? .GetMember(value.ToString())?[0]? .GetCustomAttribute <DisplayAttribute>()? .Description); }
private void testSMSOutOfBandInvitationMsg(JsonObject msg, GoalCode goalCode) { testBaseMessage(msg); Assert.AreEqual("did:sov:123456789abcdefghi1234;spec/relationship/1.0/sms-out-of-band-invitation", msg.getAsString("@type")); Assert.IsTrue(msg.getAsString("goalCode").Equals(goalCode.code())); Assert.IsTrue(msg.getAsString("goal").Equals(goalCode.goalName())); }
/// <summary> /// Get Code for goal /// </summary> /// <param name="value">GoalCodeEnum</param> /// <returns></returns> public static string code(this GoalCode value) { return(value.GetType()? .GetMember(value.ToString())?[0]? .GetCustomAttribute <DisplayAttribute>()? .Name); }
private void testSMSOutOfBandInvitationMsg(JsonObject msg, GoalCode goalCode) { testBaseMessage(msg); Assert.AreEqual(Util.EVERNYM_MSG_QUALIFIER + "/relationship/1.0/sms-out-of-band-invitation", msg.getAsString("@type")); Assert.IsTrue(msg.getAsString("goalCode").Equals(goalCode.code())); Assert.IsTrue(msg.getAsString("goal").Equals(goalCode.goalName())); }
private void testOutOfBandInvitationMsg(JsonObject msg, bool hasShortInvite, GoalCode goalCode) { testBaseMessage(msg); Assert.AreEqual("did:sov:123456789abcdefghi1234;spec/relationship/1.0/out-of-band-invitation", msg.getAsString("@type")); Assert.IsTrue(msg.getAsString("goalCode").Equals(goalCode.code())); Assert.IsTrue(msg.getAsString("goal").Equals(goalCode.goalName())); if (hasShortInvite) { Assert.AreEqual(shortInvite, msg.getAsBoolean("shortInvite")); } }
private void testOutOfBandInvitationMsg(JsonObject msg, bool hasShortInvite, GoalCode goalCode) { testBaseMessage(msg); Assert.AreEqual(Util.EVERNYM_MSG_QUALIFIER + "/relationship/1.0/out-of-band-invitation", msg.getAsString("@type")); Assert.IsTrue(msg.getAsString("goalCode").Equals(goalCode.code())); Assert.IsTrue(msg.getAsString("goal").Equals(goalCode.goalName())); if (hasShortInvite) { Assert.AreEqual(shortInvite, msg.getAsBoolean("shortInvite")); } }
/// <summary> /// Creates and packages message without sending it. /// </summary> /// <param name="context">an instance of the Context object initialized to a verity-application agent</param> /// <param name="goal">the initial intended goal of the relationship (this goal is expressed in the invite)</param> /// <returns>the byte array ready for transport</returns> public byte[] smsOutOfBandInvitationMsgPacked(Context context, GoalCode goal) { return(packMsg(context, smsOutOfBandInvitationMsg(context, goal))); }
/// <summary> /// Ask for sending SMS aries out of band invitation from the verity-application agent for the relationship created by this protocol /// </summary> /// <param name="context">an instance of the Context object initialized to a verity-application agent</param> /// <param name="goal">the initial intended goal of the relationship (this goal is expressed in the invite)</param> public void smsOutOfBandInvitation(Context context, GoalCode goal) { send(context, smsOutOfBandInvitationMsg(context, goal)); }
/// <summary> /// Creates and packages message without sending it. /// </summary> /// <param name="context">an instance of the Context object initialized to a verity-application agent</param> /// <param name="shortInvite">decides should short invite be provided as well</param> /// <param name="goal">the initial intended goal of the relationship (this goal is expressed in the invite)</param> /// <returns>the byte array ready for transport</returns> public byte[] outOfBandInvitationMsgPacked(Context context, bool shortInvite, GoalCode goal) { return(packMsg(context, outOfBandInvitationMsg(context, shortInvite, goal))); }
/// <summary> /// Ask for aries out of band invitation from the verity-application agent for the relationship created by this protocol /// </summary> /// <param name="context">an instance of the Context object initialized to a verity-application agent</param> /// <param name="shortInvite">decides should short invite be provided as well</param> /// <param name="goal">the initial intended goal of the relationship (this goal is expressed in the invite)</param> public void outOfBandInvitation(Context context, bool shortInvite, GoalCode goal) { send(context, outOfBandInvitationMsg(context, shortInvite, goal)); }