/// <summary> /// Replies to activity with retries asynchronously. /// </summary> /// <param name="conversation">The conversation client instance.</param> /// <param name="activity">The activity.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns>Resource response.</returns> public static async Task <ResourceResponse> ReplyToActivityWithRetriesAsync( this IConversations conversation, Activity activity, CancellationToken cancellationToken = default(CancellationToken)) { return(await ExecuteWithRetries(() => conversation.ReplyToActivityAsync(activity, cancellationToken), conversation)); }
public static Task <ResourceResponse> ReplyToActivityAsync(this IConversations operations, Activity activity, Dictionary <string, List <string> > customHeaders, CancellationToken cancellationToken = default(CancellationToken)) { if (activity.ReplyToId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "ReplyToId"); } return(operations.ReplyToActivityAsync(activity.Conversation.Id, activity.ReplyToId, activity, customHeaders, cancellationToken)); }
/// <summary> /// Reply to an activity in an existing conversation /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='activity'> /// Activity to send /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static Task <APIResponse> ReplyToActivityAsync(this IConversations operations, Activity activity, CancellationToken cancellationToken = default(CancellationToken)) { // TEMP TODO REMOVE THIS AFTER SKYPE DEPLOYS NEW SERVICE WHICH PROPERLY IMPLEMENTS THIS ENDPOINT if (activity.ReplyToId == "0") { return(operations.SendToConversationAsync(activity)); } return(operations.ReplyToActivityAsync(activity.Conversation.Id, activity.ReplyToId, activity, cancellationToken)); }
/// <summary> /// Reply to an activity in an existing conversation /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='activity'> /// Activity to send /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static Task <ResourceResponse> ReplyToActivityAsync(this IConversations operations, Activity activity, CancellationToken cancellationToken = default(CancellationToken)) { // TEMP TODO REMOVE THIS AFTER SKYPE DEPLOYS NEW SERVICE WHICH PROPERLY IMPLEMENTS THIS ENDPOINT if (activity.ReplyToId == "0") { return(operations.SendToConversationAsync(activity)); } if (activity.ReplyToId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "ReplyToId"); } return(operations.ReplyToActivityAsync(activity.Conversation.Id, activity.ReplyToId, activity, cancellationToken)); }
public static ResourceResponse ReplyToActivity(this IConversations operations, string conversationId, string activityId, Activity activity, Dictionary <string, List <string> > customHeaders) { return(operations.ReplyToActivityAsync(conversationId, activityId, activity, customHeaders).GetAwaiter().GetResult()); }
/// <summary> /// ReplyToActivity /// </summary> /// <remarks> /// This method allows you to reply to an activity. /// /// This is slightly different from SendToConversation(). /// * SendToConverstion(conversationId) - will append the activity to the end /// of the conversation according to the timestamp or semantics of the channel. /// * ReplyToActivity(conversationId,ActivityId) - adds the activity as a reply /// to another activity, if the channel supports it. If the channel does not /// support nested replies, ReplyToActivity falls back to SendToConversation. /// /// Use ReplyToActivity when replying to a specific activity in the /// conversation. /// /// Use SendToConversation in all other cases. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='conversationId'> /// Conversation ID /// </param> /// <param name='activityId'> /// activityId the reply is to (OPTIONAL) /// </param> /// <param name='activity'> /// Activity to send /// </param> public static ResourceResponse ReplyToActivity(this IConversations operations, string conversationId, string activityId, Activity activity) { return(operations.ReplyToActivityAsync(conversationId, activityId, activity).GetAwaiter().GetResult()); }