/// <summary>
 /// Publishes a Mini-Feed story to the Facebook Page corresponding to the page_actor_id parameter.
 /// </summary>
 /// <param name="title_template">The templatized markup displayed in the feed story's title section. This template must contain the token {actor} somewhere in it.</param>
 /// <param name="title_data">Optional - A collection of the values that should be substituted into the templates in the title_template markup string. The keys of this array are the tokens, and their associated values are the desired substitutions. 'actor' and 'target' are special tokens and should not be included in this array. If your title_template contains tokens besides 'actor' and 'target', then this is a required parameter.</param>
 /// <param name="body_template">Optional - The markup displayed in the feed story's body section.</param>
 /// <param name="body_data">Optional - A collection of the values that should be substituted into the templates in the body_template markup string. The keys of this array are the tokens, and their associated values are the desired substitutions. 'actor' and 'target' are special token and should not be included in this array.</param>
 /// <param name="body_general">Optional - Additional markup displayed in the feed story's body section. This markup is not required to be identical for two stories to be aggregated. One of the two will be chosen at random.</param>
 /// <param name="page_actor_id">Optional - if publishing a story to a Facebook Page, use this parameter as the page who performed the action. If you use this parameter, the application must be added to that Page's Feed. A session key is not required to do this.</param>
 /// <param name="images">Optional - A collection of images to be displayed in the Feed story. Similar to body_general, the image displayed is not aggregated -- the image from any one of the aggregated stories may be displayed.</param>
 /// <param name="target_ids">Optional - A collection of IDs of friends of the actor, used for stories about a direct action between the actor and these targets of his/her action. This is required if either the title_template or body_template includes the token {target}.</param>
 /// <param name="callback">The AsyncCallback delegate</param>
 /// <param name="state">An object containing state information for this asynchronous request</param>        
 /// <returns>The function returns true on success, false on permissions error, or an error response.</returns>
 /// <remarks>This method is deprecated for actions taken by users only; it still works for actions taken by Facebook Pages.</remarks>
 public void PublishTemplatizedActionAsync(string title_template, Dictionary<string, string> title_data,
     string body_template, Dictionary<string, string> body_data,
     string body_general, int page_actor_id,
     Collection<feed_image> images, Collection<string> target_ids,
     PublishTemplatizedActionCallback callback, Object state)
 {
     PublishTemplatizedAction(title_template, title_data, body_template, body_data, body_general, page_actor_id,
                             images, target_ids, true, callback, state);
 }
        private bool PublishTemplatizedAction(string title_template, Dictionary<string, string> title_data,
            string body_template, Dictionary<string, string> body_data,
            string body_general, int page_actor_id,
            Collection<feed_image> images, Collection<string> target_ids,
            bool isAsync, PublishTemplatizedActionCallback callback, Object state)
        {
            var parameterList = new Dictionary<string, string> { { "method", "facebook.feed.publishTemplatizedAction" } };
            Utilities.AddRequiredParameter(parameterList, "title_template", title_template);
            Utilities.AddOptionalParameter(parameterList, "page_actor_id", page_actor_id);
            Utilities.AddJSONAssociativeArray(parameterList, "title_data", title_data);
            Utilities.AddJSONAssociativeArray(parameterList, "body_data", body_data);
            Utilities.AddOptionalParameter(parameterList, "body_template", body_template);
            Utilities.AddOptionalParameter(parameterList, "body_general", body_general);
            Utilities.AddCollection(parameterList, "target_ids", target_ids);
            AddFeedImages(parameterList, images);

            if (isAsync)
            {
                SendRequestAsync<feed_publishTemplatizedAction_response, bool>(parameterList, !string.IsNullOrEmpty(Session.SessionKey), new FacebookCallCompleted<bool>(callback), state);
                return true;
            }

            var response = SendRequest<feed_publishTemplatizedAction_response>(parameterList, !string.IsNullOrEmpty(Session.SessionKey));
            return response == null ? true : response.TypedValue;
        }
 /// <summary>
 /// Publishes a Mini-Feed story to the Facebook Page corresponding to the page_actor_id parameter.
 /// </summary>
 /// <param name="title_template">The templatized markup displayed in the feed story's title section. This template must contain the token {actor} somewhere in it.</param>
 /// <param name="title_data">Optional - A collection of the values that should be substituted into the templates in the title_template markup string. The keys of this array are the tokens, and their associated values are the desired substitutions. 'actor' and 'target' are special tokens and should not be included in this array. If your title_template contains tokens besides 'actor' and 'target', then this is a required parameter.</param>
 /// <param name="body_template">Optional - The markup displayed in the feed story's body section.</param>
 /// <param name="body_data">Optional - A collection of the values that should be substituted into the templates in the body_template markup string. The keys of this array are the tokens, and their associated values are the desired substitutions. 'actor' and 'target' are special token and should not be included in this array.</param>
 /// <param name="images">Optional - A collection of images to be displayed in the Feed story. Similar to body_general, the image displayed is not aggregated -- the image from any one of the aggregated stories may be displayed.</param>
 /// <param name="callback">The AsyncCallback delegate</param>
 /// <param name="state">An object containing state information for this asynchronous request</param>        
 /// <returns>The function returns true on success, false on permissions error, or an error response.</returns>
 /// <remarks>This method is deprecated for actions taken by users only; it still works for actions taken by Facebook Pages.</remarks>
 public void PublishTemplatizedActionAsync(string title_template, Dictionary<string, string> title_data,
     string body_template, Dictionary<string, string> body_data,
     Collection<feed_image> images, PublishTemplatizedActionCallback callback,
     Object state)
 {
     PublishTemplatizedActionAsync(title_template, title_data, body_template, body_data, null, 0, images, null, callback, state);
 }