Exemplo n.º 1
0
 /// <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));
 }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
        /// <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));
        }
Exemplo n.º 4
0
        /// <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));
        }
Exemplo n.º 5
0
 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());
 }