diff --git a/PocketSharp/Components/ModifyTags.cs b/PocketSharp/Components/ModifyTags.cs index 77a799a..252e2f1 100644 --- a/PocketSharp/Components/ModifyTags.cs +++ b/PocketSharp/Components/ModifyTags.cs @@ -124,7 +124,7 @@ namespace PocketSharp /// /// Renames a tag. /// - /// The item. + /// The item. /// The old tag. /// The new tag name. /// @@ -139,6 +139,7 @@ namespace PocketSharp /// /// The item ID. /// The action. + /// The tags. /// protected bool PutSendActionForTags(int itemID, string action, string[] tags) { diff --git a/PocketSharp/Components/Retrieve.cs b/PocketSharp/Components/Retrieve.cs index 2459210..e1022ef 100644 --- a/PocketSharp/Components/Retrieve.cs +++ b/PocketSharp/Components/Retrieve.cs @@ -75,7 +75,7 @@ namespace PocketSharp /// /// Retrieves items from pocket which match the specified search string in title or content /// - /// The tag. + /// The search string. /// public List Search(string searchString) { @@ -94,12 +94,33 @@ namespace PocketSharp /// public enum RetrieveFilter { + /// + /// All types + /// All, + /// + /// Only unread items + /// Unread, + /// + /// Archived items + /// Archive, + /// + /// Favorited items + /// Favorite, + /// + /// Only articles + /// Article, + /// + /// Only videos + /// Video, + /// + /// Only images + /// Image } } diff --git a/PocketSharp/Models/Authentification/AccessCode.cs b/PocketSharp/Models/Authentification/AccessCode.cs index cf366b0..e8bef95 100644 --- a/PocketSharp/Models/Authentification/AccessCode.cs +++ b/PocketSharp/Models/Authentification/AccessCode.cs @@ -4,12 +4,27 @@ using System.Runtime.Serialization; namespace PocketSharp.Models.Authentification { + /// + /// Access Code + /// [DataContract] - public class AccessCode + internal class AccessCode { + /// + /// Gets or sets the code. + /// + /// + /// The code. + /// [DataMember(Name = "access_token")] public string Code { get; set; } + /// + /// Gets or sets the username. + /// + /// + /// The username. + /// [DataMember] public string Username { get; set; } } diff --git a/PocketSharp/Models/Authentification/RequestCode.cs b/PocketSharp/Models/Authentification/RequestCode.cs index 56db383..99f9fda 100644 --- a/PocketSharp/Models/Authentification/RequestCode.cs +++ b/PocketSharp/Models/Authentification/RequestCode.cs @@ -4,12 +4,27 @@ using System.Runtime.Serialization; namespace PocketSharp.Models.Authentification { + /// + /// Request Code + /// [DataContract] - class RequestCode + internal class RequestCode { + /// + /// Gets or sets the code. + /// + /// + /// The code. + /// [DataMember] public string Code { get; set; } + /// + /// Gets or sets the state. + /// + /// + /// The state. + /// [DataMember] public string State { get; set; } } diff --git a/PocketSharp/Models/Parameters/ActionParameter.cs b/PocketSharp/Models/Parameters/ActionParameter.cs index d02769c..93fd110 100644 --- a/PocketSharp/Models/Parameters/ActionParameter.cs +++ b/PocketSharp/Models/Parameters/ActionParameter.cs @@ -6,23 +6,66 @@ using System.Runtime.Serialization; namespace PocketSharp.Models { + /// + /// All parameters which can be passed for a modify action + /// public class ActionParameter { + /// + /// Gets or sets the action. + /// + /// + /// The action. + /// public string Action { get; set; } + /// + /// Gets or sets the ID. + /// + /// + /// The ID. + /// public int ID { get; set; } + /// + /// Gets or sets the time. + /// + /// + /// The time. + /// public DateTime? Time { get; set; } // specific params + /// + /// Gets or sets the tags. + /// + /// + /// The tags. + /// public string[] Tags { get; set; } + /// + /// Gets or sets the old tag. + /// + /// + /// The old tag. + /// public string OldTag { get; set; } + /// + /// Gets or sets the new tag. + /// + /// + /// The new tag. + /// public string NewTag { get; set; } + /// + /// Converts this instance to a parameter list. + /// + /// public object Convert() { Dictionary parameters = new Dictionary diff --git a/PocketSharp/Models/Parameters/AddParameters.cs b/PocketSharp/Models/Parameters/AddParameters.cs index 401219f..5efc4e9 100644 --- a/PocketSharp/Models/Parameters/AddParameters.cs +++ b/PocketSharp/Models/Parameters/AddParameters.cs @@ -6,16 +6,47 @@ using System.Runtime.Serialization; namespace PocketSharp.Models { + /// + /// All parameters which can be passed to add a new item + /// public class AddParameters { + /// + /// Gets or sets the URI. + /// + /// + /// The URI. + /// public Uri Uri { get; set; } + /// + /// Gets or sets the title. + /// + /// + /// The title. + /// public string Title { get; set; } + /// + /// Gets or sets the tags. + /// + /// + /// The tags. + /// public string[] Tags { get; set; } + /// + /// Gets or sets the tweet ID. + /// + /// + /// The tweet ID. + /// public string TweetID { get; set; } + /// + /// Converts this instance to a parameter list. + /// + /// public List Convert() { return new List() diff --git a/PocketSharp/Models/Parameters/ModifyParameters.cs b/PocketSharp/Models/Parameters/ModifyParameters.cs index a2b4b61..eb4fff8 100644 --- a/PocketSharp/Models/Parameters/ModifyParameters.cs +++ b/PocketSharp/Models/Parameters/ModifyParameters.cs @@ -5,11 +5,24 @@ using System.Collections.Generic; namespace PocketSharp.Models { + /// + /// All parameters which can be passed to modify an item + /// public class ModifyParameters { + /// + /// Gets or sets the actions. + /// + /// + /// The actions. + /// public List Actions { get; set; } + /// + /// Converts this instance to a parameter list. + /// + /// public List Convert() { List actions = new List(); diff --git a/PocketSharp/Models/Parameters/RetrieveParameters.cs b/PocketSharp/Models/Parameters/RetrieveParameters.cs index 737e423..a459261 100644 --- a/PocketSharp/Models/Parameters/RetrieveParameters.cs +++ b/PocketSharp/Models/Parameters/RetrieveParameters.cs @@ -7,31 +7,104 @@ using ServiceStack.Text; namespace PocketSharp.Models { + /// + /// All parameters which can be passed for item retrieval + /// public class RetrieveParameters { + /// + /// Gets or sets the state. + /// + /// + /// The state. + /// public StateEnum? State { get; set; } + /// + /// Gets or sets the favorite. + /// + /// + /// The favorite. + /// public bool? Favorite { get; set; } + /// + /// Gets or sets the tag. + /// + /// + /// The tag. + /// public string Tag { get; set; } + /// + /// Gets or sets the type of the content. + /// + /// + /// The type of the content. + /// public ContentTypeEnum? ContentType { get; set; } + /// + /// Gets or sets the sort. + /// + /// + /// The sort. + /// public SortEnum? Sort { get; set; } + /// + /// Gets or sets the type of the detail. + /// + /// + /// The type of the detail. + /// public DetailTypeEnum? DetailType { get; set; } + /// + /// Gets or sets the search. + /// + /// + /// The search. + /// public string Search { get; set; } + /// + /// Gets or sets the domain. + /// + /// + /// The domain. + /// public string Domain { get; set; } + /// + /// Gets or sets the since. + /// + /// + /// The since. + /// public DateTime? Since { get; set; } + /// + /// Gets or sets the count. + /// + /// + /// The count. + /// public int? Count { get; set; } + /// + /// Gets or sets the offset. + /// + /// + /// The offset. + /// public int? Offset { get; set; } + /// + /// Converts this instance to a parameter list. + /// + /// public List Convert() { return new List() @@ -52,31 +125,79 @@ namespace PocketSharp.Models } + /// + /// Item states + /// public enum StateEnum { + /// + /// Only unread items + /// unread, + /// + /// Only archived items + /// archive, + /// + /// All items + /// all } + /// + /// Sorting + /// public enum SortEnum { + /// + /// Newest first + /// newest, + /// + /// Oldest first + /// oldest, + /// + /// Title A-Z descending + /// title, + /// + /// URL descending + /// site } + /// + /// Item types + /// public enum ContentTypeEnum { + /// + /// Articles + /// article, + /// + /// Videos + /// video, + /// + /// Images + /// image } + /// + /// Item data + /// public enum DetailTypeEnum { + /// + /// Necessary data + /// simple, + /// + /// Includes all Images/videos/tags/authors + /// complete } } diff --git a/PocketSharp/Models/PocketAuthor.cs b/PocketSharp/Models/PocketAuthor.cs index cc9106f..2d111bc 100644 --- a/PocketSharp/Models/PocketAuthor.cs +++ b/PocketSharp/Models/PocketAuthor.cs @@ -3,15 +3,36 @@ using System.Runtime.Serialization; namespace PocketSharp.Models { + /// + /// Author + /// [DataContract] public class PocketAuthor { + /// + /// Gets or sets the ID. + /// + /// + /// The ID. + /// [DataMember(Name = "author_id")] public string ID { get; set; } + /// + /// Gets or sets the name. + /// + /// + /// The name. + /// [DataMember] public string Name { get; set; } + /// + /// Gets or sets the URI. + /// + /// + /// The URI. + /// [DataMember(Name = "url")] public Uri Uri { get; set; } } diff --git a/PocketSharp/Models/PocketImage.cs b/PocketSharp/Models/PocketImage.cs index 91815bd..8ede582 100644 --- a/PocketSharp/Models/PocketImage.cs +++ b/PocketSharp/Models/PocketImage.cs @@ -3,18 +3,45 @@ using System.Runtime.Serialization; namespace PocketSharp.Models { + /// + /// Image + /// [DataContract] public class PocketImage { + /// + /// Gets or sets the ID. + /// + /// + /// The ID. + /// [DataMember(Name = "image_id")] public string ID { get; set; } + /// + /// Gets or sets the caption. + /// + /// + /// The caption. + /// [DataMember] public string Caption { get; set; } + /// + /// Gets or sets the credit. + /// + /// + /// The credit. + /// [DataMember] public string Credit { get; set; } + /// + /// Gets or sets the URI. + /// + /// + /// The URI. + /// [DataMember(Name = "src")] public Uri Uri { get; set; } } diff --git a/PocketSharp/Models/PocketItem.cs b/PocketSharp/Models/PocketItem.cs index ca1f3b6..845949a 100644 --- a/PocketSharp/Models/PocketItem.cs +++ b/PocketSharp/Models/PocketItem.cs @@ -4,102 +4,268 @@ using System.Runtime.Serialization; namespace PocketSharp.Models { + /// + /// Item containing all available data + /// see: http://getpocket.com/developer/docs/v3/retrieve + /// [DataContract] public class PocketItem { + /// + /// Gets or sets the ID. + /// + /// + /// The ID. + /// [DataMember(Name = "item_id")] public int ID { get; set; } + /// + /// Gets or sets the URI. + /// + /// + /// The URI. + /// [DataMember(Name = "resolved_url")] public Uri Uri { get; set; } + /// + /// Gets or sets the title. + /// + /// + /// The title. + /// [DataMember(Name = "resolved_title")] public string Title { get; set; } + /// + /// Gets or sets the full title. + /// + /// + /// The full title. + /// [DataMember(Name = "given_title")] public string FullTitle { get; set; } + /// + /// Gets or sets the excerpt. + /// + /// + /// The excerpt. + /// [DataMember] public string Excerpt { get; set; } + /// + /// Gets or sets the status. + /// + /// + /// The status. + /// [DataMember] public int Status { get; set; } + /// + /// Gets or sets a value indicating whether this instance is favorite. + /// + /// + /// true if this instance is favorite; otherwise, false. + /// [DataMember(Name = "favorite")] public bool IsFavorite { get; set; } + /// + /// Gets a value indicating whether this instance is archive. + /// + /// + /// true if this instance is archive; otherwise, false. + /// [IgnoreDataMember] public bool IsArchive { get { return Status == 1; } } + /// + /// Gets a value indicating whether this instance is deleted. + /// + /// + /// true if this instance is deleted; otherwise, false. + /// [IgnoreDataMember] public bool IsDeleted { get { return Status == 2; } } + /// + /// Gets or sets a value indicating whether this instance is article. + /// + /// + /// true if this instance is article; otherwise, false. + /// [DataMember(Name = "is_article")] public bool IsArticle { get; set; } + /// + /// Gets or sets a value indicating whether this instance has image. + /// + /// + /// true if this instance has image; otherwise, false. + /// [DataMember(Name = "has_image")] public bool HasImage { get; set; } + /// + /// Gets or sets a value indicating whether this instance has video. + /// + /// + /// true if this instance has video; otherwise, false. + /// [DataMember(Name = "has_video")] public bool HasVideo { get; set; } + /// + /// Gets or sets the word count. + /// + /// + /// The word count. + /// [DataMember(Name = "word_count")] public int WordCount { get; set; } + /// + /// Gets or sets the sort. + /// + /// + /// The sort. + /// [DataMember(Name = "sort_id")] public int Sort { get; set; } + /// + /// Gets or sets the add time. + /// + /// + /// The add time. + /// [DataMember(Name = "time_added")] public DateTime? AddTime { get; set; } + /// + /// Gets or sets the update time. + /// + /// + /// The update time. + /// [DataMember(Name = "time_updated")] public DateTime? UpdateTime { get; set; } + /// + /// Gets or sets the read time. + /// + /// + /// The read time. + /// [DataMember(Name = "time_read")] public DateTime? ReadTime { get; set; } + /// + /// Gets or sets the favorite time. + /// + /// + /// The favorite time. + /// [DataMember(Name = "time_favorited")] public DateTime? FavoriteTime { get; set; } + /// + /// Gets or sets the _ tag dictionary. + /// + /// + /// The _ tag dictionary. + /// [DataMember(Name = "tags")] public Dictionary _TagDictionary { get; set; } + /// + /// Gets or sets the _ image dictionary. + /// + /// + /// The _ image dictionary. + /// [DataMember(Name = "images")] public Dictionary _ImageDictionary { get; set; } + /// + /// Gets or sets the _ video dictionary. + /// + /// + /// The _ video dictionary. + /// [DataMember(Name = "videos")] public Dictionary _VideoDictionary { get; set; } + /// + /// Gets or sets the _ author dictionary. + /// + /// + /// The _ author dictionary. + /// [DataMember(Name = "authors")] public Dictionary _AuthorDictionary { get; set; } + /// + /// Gets the tags. + /// + /// + /// The tags. + /// [IgnoreDataMember] public List Tags { get { return Utilities.DictionaryToList(_TagDictionary); } } + /// + /// Gets the images. + /// + /// + /// The images. + /// [IgnoreDataMember] public List Images { get { return Utilities.DictionaryToList(_ImageDictionary); } } + /// + /// Gets the lead image. + /// + /// + /// The lead image. + /// [IgnoreDataMember] public PocketImage LeadImage { get { return Images != null ? Images[0] : null; } } + /// + /// Gets the videos. + /// + /// + /// The videos. + /// [IgnoreDataMember] public List Videos { get { return Utilities.DictionaryToList(_VideoDictionary); } } + /// + /// Gets the authors. + /// + /// + /// The authors. + /// [IgnoreDataMember] public List Authors { diff --git a/PocketSharp/Models/PocketTag.cs b/PocketSharp/Models/PocketTag.cs index 37bcc50..59d00de 100644 --- a/PocketSharp/Models/PocketTag.cs +++ b/PocketSharp/Models/PocketTag.cs @@ -2,9 +2,18 @@ namespace PocketSharp.Models { + /// + /// Tag + /// [DataContract] public class PocketTag { + /// + /// Gets or sets the name. + /// + /// + /// The name. + /// [DataMember(Name = "tag")] public string Name { get; set; } } diff --git a/PocketSharp/Models/PocketVideo.cs b/PocketSharp/Models/PocketVideo.cs index 9b011ac..72901f5 100644 --- a/PocketSharp/Models/PocketVideo.cs +++ b/PocketSharp/Models/PocketVideo.cs @@ -3,15 +3,36 @@ using System.Runtime.Serialization; namespace PocketSharp.Models { + /// + /// Video + /// [DataContract] public class PocketVideo { + /// + /// Gets or sets the ID. + /// + /// + /// The ID. + /// [DataMember(Name = "video_id")] public string ID { get; set; } + /// + /// Gets or sets the external ID. + /// + /// + /// The external ID. + /// [DataMember(Name = "vid")] public string ExternalID { get; set; } + /// + /// Gets or sets the URI. + /// + /// + /// The URI. + /// [DataMember(Name = "src")] public Uri Uri { get; set; } } diff --git a/PocketSharp/Models/Response/Add.cs b/PocketSharp/Models/Response/Add.cs index 8e3499b..a3c2c8e 100644 --- a/PocketSharp/Models/Response/Add.cs +++ b/PocketSharp/Models/Response/Add.cs @@ -4,9 +4,18 @@ using System.Runtime.Serialization; namespace PocketSharp.Models { + /// + /// Add Response + /// [DataContract] class Add : ResponseBase { + /// + /// Gets or sets the item. + /// + /// + /// The item. + /// [DataMember] public PocketItem Item { get; set; } } diff --git a/PocketSharp/Models/Response/Modify.cs b/PocketSharp/Models/Response/Modify.cs index d064b62..86c699c 100644 --- a/PocketSharp/Models/Response/Modify.cs +++ b/PocketSharp/Models/Response/Modify.cs @@ -4,9 +4,18 @@ using System.Runtime.Serialization; namespace PocketSharp.Models { + /// + /// Modify Response + /// [DataContract] class Modify : ResponseBase { + /// + /// Gets or sets the action results. + /// + /// + /// The action results. + /// [DataMember(Name = "action_results")] public bool[] ActionResults { get; set; } } diff --git a/PocketSharp/Models/Response/ResponseBase.cs b/PocketSharp/Models/Response/ResponseBase.cs index 2e65e69..d9f93b6 100644 --- a/PocketSharp/Models/Response/ResponseBase.cs +++ b/PocketSharp/Models/Response/ResponseBase.cs @@ -6,9 +6,18 @@ using System.Text; namespace PocketSharp.Models { + /// + /// Base for Responses + /// [DataContract] class ResponseBase { + /// + /// Gets or sets a value indicating whether this is status. + /// + /// + /// true if status is OK; otherwise, false. + /// [DataMember(Name = "status")] public bool Status { get; set; } } diff --git a/PocketSharp/Models/Response/Retrieve.cs b/PocketSharp/Models/Response/Retrieve.cs index 1232fa6..f686ed1 100644 --- a/PocketSharp/Models/Response/Retrieve.cs +++ b/PocketSharp/Models/Response/Retrieve.cs @@ -4,18 +4,45 @@ using System.Runtime.Serialization; namespace PocketSharp.Models { + /// + /// Item Response + /// [DataContract] class Retrieve : ResponseBase { + /// + /// Gets or sets the complete. + /// + /// + /// The complete. + /// [DataMember(Name = "complete")] public int Complete { get; set; } + /// + /// Gets or sets the since. + /// + /// + /// The since. + /// [DataMember] public int Since { get; set; } + /// + /// Gets or sets the _ item dictionary. + /// + /// + /// The _ item dictionary. + /// [DataMember(Name = "list")] public Dictionary _ItemDictionary { get; set; } + /// + /// Gets the items. + /// + /// + /// The items. + /// [IgnoreDataMember] public List Items { diff --git a/PocketSharp/PocketClient.cs b/PocketSharp/PocketClient.cs index 0b7ee13..b46148b 100644 --- a/PocketSharp/PocketClient.cs +++ b/PocketSharp/PocketClient.cs @@ -63,17 +63,19 @@ namespace PocketSharp /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The API key. + /// The access code. public PocketClient(string consumerKey, string accessCode) : this(consumerKey, accessCode, defaultBaseUrl) { } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The API key. + /// The base URL. public PocketClient(string consumerKey, Uri baseUrl) : this(consumerKey, "", baseUrl) { } @@ -83,6 +85,7 @@ namespace PocketSharp /// /// The API key. /// Provide an access code if the user is already authenticated + /// The base URL. public PocketClient(string consumerKey, string accessCode, Uri baseUrl) { // assign public properties @@ -192,7 +195,6 @@ namespace PocketSharp /// /// Puts an action /// - /// The item ID. /// The action parameter. /// protected bool PutSendAction(ActionParameter actionParameter)