Beispiel #1
0
        /// <summary>
        /// Categorizes current post
        /// </summary>
        /// <param name="flag">Value indicating how the current post should be categorized</param>
        /// <returns>Request result</returns>
        /// <exception cref="LinkedInInvalidOperationException">Thrown when user attempts to categorize the post which is not marked as available for this action</exception>
        public LinkedInResponse <bool> Categorize(LinkedInGroupPostFlag flag)
        {
            if (!AvailableAction[LinkedInGroupPostAction.CategorizeAsPromotion] && flag == LinkedInGroupPostFlag.Promotion)
            {
                throw new LinkedInInvalidOperationException("Specifying promotion flag is not available for current post");
            }
            if (!AvailableAction[LinkedInGroupPostAction.CategorizeAsJob] && flag == LinkedInGroupPostFlag.Job)
            {
                throw new LinkedInInvalidOperationException("Specifying job flag is not available for current post");
            }

            return(RequestRunner.CategorizePost(Id, flag));
        }