示例#1
0
 /// <summary>
 /// Update notifications status
 /// </summary>
 /// This API call records the most recent notification that the user has read
 /// (or seen).
 /// In the GET notifications API call, each notification will have
 /// an unread status.
 /// Any notifications that are newer than this ReadActivityHandle
 /// will have an unread status of true.
 /// Any notifications that correspond to this ReadActivityHandle
 /// or older will have an unread status of false.
 /// If this API call has never been made, then all notifications
 /// will have an unread status of true.
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='request'>
 /// Put notifications status request
 /// </param>
 /// <param name='authorization'>
 /// Format is: "Scheme CredentialsList". Possible values are:
 ///
 /// - Anon AK=AppKey
 ///
 /// - SocialPlus TK=SessionToken
 ///
 /// - Facebook AK=AppKey|TK=AccessToken
 ///
 /// - Google AK=AppKey|TK=AccessToken
 ///
 /// - Twitter AK=AppKey|RT=RequestToken|TK=AccessToken
 ///
 /// - Microsoft AK=AppKey|TK=AccessToken
 ///
 /// - AADS2S AK=AppKey|[UH=UserHandle]|TK=AADToken
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <object> PutNotificationsStatusAsync(this IMyNotifications operations, PutNotificationsStatusRequest request, string authorization, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.PutNotificationsStatusWithHttpMessagesAsync(request, authorization, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
示例#2
0
 /// <summary>
 /// Get unread notifications count
 /// </summary>
 /// This returns a count of activities in my notification feed that have an
 /// unread status of true.
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='authorization'>
 /// Format is: "Scheme CredentialsList". Possible values are:
 ///
 /// - Anon AK=AppKey
 ///
 /// - SocialPlus TK=SessionToken
 ///
 /// - Facebook AK=AppKey|TK=AccessToken
 ///
 /// - Google AK=AppKey|TK=AccessToken
 ///
 /// - Twitter AK=AppKey|RT=RequestToken|TK=AccessToken
 ///
 /// - Microsoft AK=AppKey|TK=AccessToken
 ///
 /// - AADS2S AK=AppKey|[UH=UserHandle]|TK=AADToken
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <CountResponse> GetNotificationsCountAsync(this IMyNotifications operations, string authorization, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetNotificationsCountWithHttpMessagesAsync(authorization, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
示例#3
0
 /// <summary>
 /// Get my notifications
 /// </summary>
 /// This gets a feed of activities.
 /// This feed is time ordered, with the most recent activity
 /// first.
 /// An activity is added to this feed when any user other than
 /// myself does one of the following 6 actions:
 /// (a) creates a comment to my topic; (b) creates a reply to my
 /// comment; (c) likes my topic; (d) follows me;
 /// (e) requests to follow me when I'm a private user; (f) accepts
 /// my request to follow them when they are a private user.
 /// Each activity has an unread status, which is controlled by
 /// doing a PUT on the status API call.
 /// If a user that performed the activity is deleted, then that
 /// activity will no longer appear in this feed.
 /// If an activity is performed on content that is then deleted,
 /// that activity will no longer appear in this feed.
 /// If a user has un-done an activity (e.g. unlike a previous
 /// like), then that activity will no longer appear in this feed.
 /// When activityType is Like, the activityHandle is the
 /// likeHandle that uniquely identifies the new like.
 /// When activityType is Comment, the activityHandle is the
 /// commentHandle that uniquely identifies the new comment.
 /// When activityType is Reply, the activityHandle is the
 /// replyHandle that uniquely identifies the new reply.
 /// ActivityType values of CommentPeer and ReplyPeer are currently
 /// not used.
 /// When activityType is Following or FollowRequest or
 /// FollowAccept, the activityHandle is the relationshipHandle
 /// that uniquely identifies the relationship between the two
 /// users.
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='authorization'>
 /// Format is: "Scheme CredentialsList". Possible values are:
 ///
 /// - Anon AK=AppKey
 ///
 /// - SocialPlus TK=SessionToken
 ///
 /// - Facebook AK=AppKey|TK=AccessToken
 ///
 /// - Google AK=AppKey|TK=AccessToken
 ///
 /// - Twitter AK=AppKey|RT=RequestToken|TK=AccessToken
 ///
 /// - Microsoft AK=AppKey|TK=AccessToken
 ///
 /// - AADS2S AK=AppKey|[UH=UserHandle]|TK=AADToken
 /// </param>
 /// <param name='cursor'>
 /// Current read cursor
 /// </param>
 /// <param name='limit'>
 /// Number of items to return
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <FeedResponseActivityView> GetNotificationsAsync(this IMyNotifications operations, string authorization, string cursor = default(string), int?limit = default(int?), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetNotificationsWithHttpMessagesAsync(authorization, cursor, limit, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
示例#4
0
 /// <summary>
 /// Update notifications status
 /// </summary>
 /// This API call records the most recent notification that the user has read
 /// (or seen).
 /// In the GET notifications API call, each notification will have
 /// an unread status.
 /// Any notifications that are newer than this ReadActivityHandle
 /// will have an unread status of true.
 /// Any notifications that correspond to this ReadActivityHandle
 /// or older will have an unread status of false.
 /// If this API call has never been made, then all notifications
 /// will have an unread status of true.
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='request'>
 /// Put notifications status request
 /// </param>
 /// <param name='authorization'>
 /// Format is: "Scheme CredentialsList". Possible values are:
 ///
 /// - Anon AK=AppKey
 ///
 /// - SocialPlus TK=SessionToken
 ///
 /// - Facebook AK=AppKey|TK=AccessToken
 ///
 /// - Google AK=AppKey|TK=AccessToken
 ///
 /// - Twitter AK=AppKey|RT=RequestToken|TK=AccessToken
 ///
 /// - Microsoft AK=AppKey|TK=AccessToken
 ///
 /// - AADS2S AK=AppKey|[UH=UserHandle]|TK=AADToken
 /// </param>
 public static object PutNotificationsStatus(this IMyNotifications operations, PutNotificationsStatusRequest request, string authorization)
 {
     return(Task.Factory.StartNew(s => ((IMyNotifications)s).PutNotificationsStatusAsync(request, authorization), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
示例#5
0
 /// <summary>
 /// Get unread notifications count
 /// </summary>
 /// This returns a count of activities in my notification feed that have an
 /// unread status of true.
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='authorization'>
 /// Format is: "Scheme CredentialsList". Possible values are:
 ///
 /// - Anon AK=AppKey
 ///
 /// - SocialPlus TK=SessionToken
 ///
 /// - Facebook AK=AppKey|TK=AccessToken
 ///
 /// - Google AK=AppKey|TK=AccessToken
 ///
 /// - Twitter AK=AppKey|RT=RequestToken|TK=AccessToken
 ///
 /// - Microsoft AK=AppKey|TK=AccessToken
 ///
 /// - AADS2S AK=AppKey|[UH=UserHandle]|TK=AADToken
 /// </param>
 public static CountResponse GetNotificationsCount(this IMyNotifications operations, string authorization)
 {
     return(Task.Factory.StartNew(s => ((IMyNotifications)s).GetNotificationsCountAsync(authorization), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
示例#6
0
 /// <summary>
 /// Get my notifications
 /// </summary>
 /// This gets a feed of activities.
 /// This feed is time ordered, with the most recent activity
 /// first.
 /// An activity is added to this feed when any user other than
 /// myself does one of the following 6 actions:
 /// (a) creates a comment to my topic; (b) creates a reply to my
 /// comment; (c) likes my topic; (d) follows me;
 /// (e) requests to follow me when I'm a private user; (f) accepts
 /// my request to follow them when they are a private user.
 /// Each activity has an unread status, which is controlled by
 /// doing a PUT on the status API call.
 /// If a user that performed the activity is deleted, then that
 /// activity will no longer appear in this feed.
 /// If an activity is performed on content that is then deleted,
 /// that activity will no longer appear in this feed.
 /// If a user has un-done an activity (e.g. unlike a previous
 /// like), then that activity will no longer appear in this feed.
 /// When activityType is Like, the activityHandle is the
 /// likeHandle that uniquely identifies the new like.
 /// When activityType is Comment, the activityHandle is the
 /// commentHandle that uniquely identifies the new comment.
 /// When activityType is Reply, the activityHandle is the
 /// replyHandle that uniquely identifies the new reply.
 /// ActivityType values of CommentPeer and ReplyPeer are currently
 /// not used.
 /// When activityType is Following or FollowRequest or
 /// FollowAccept, the activityHandle is the relationshipHandle
 /// that uniquely identifies the relationship between the two
 /// users.
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='authorization'>
 /// Format is: "Scheme CredentialsList". Possible values are:
 ///
 /// - Anon AK=AppKey
 ///
 /// - SocialPlus TK=SessionToken
 ///
 /// - Facebook AK=AppKey|TK=AccessToken
 ///
 /// - Google AK=AppKey|TK=AccessToken
 ///
 /// - Twitter AK=AppKey|RT=RequestToken|TK=AccessToken
 ///
 /// - Microsoft AK=AppKey|TK=AccessToken
 ///
 /// - AADS2S AK=AppKey|[UH=UserHandle]|TK=AADToken
 /// </param>
 /// <param name='cursor'>
 /// Current read cursor
 /// </param>
 /// <param name='limit'>
 /// Number of items to return
 /// </param>
 public static FeedResponseActivityView GetNotifications(this IMyNotifications operations, string authorization, string cursor = default(string), int?limit = default(int?))
 {
     return(Task.Factory.StartNew(s => ((IMyNotifications)s).GetNotificationsAsync(authorization, cursor, limit), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }