Class: Vk::API::Notifications

Inherits:
Schema::Namespace show all
Defined in:
lib/vk/api/methods.rb,
lib/vk/api/objects.rb,
lib/vk/api/responses.rb,
lib/vk/api/notifications/reply.rb,
lib/vk/api/notifications/feedback.rb,
lib/vk/api/notifications/methods/get.rb,
lib/vk/api/notifications/notification.rb,
lib/vk/api/notifications/notifications_comment.rb,
lib/vk/api/notifications/methods/mark_as_viewed.rb,
lib/vk/api/notifications/responses/get_response.rb,
lib/vk/api/notifications/responses/mark_as_viewed_response.rb

Defined Under Namespace

Modules: Methods, Responses Classes: Feedback, Notification, NotificationsComment, Reply

Instance Attribute Summary

Attributes inherited from Schema::Namespace

#client

DSL collapse

Methods inherited from Schema::Namespace

#call, #initialize

Constructor Details

This class inherits a constructor from Vk::Schema::Namespace

Instance Method Details

#get(arguments = {}) ⇒ Vk::API::Notifications::Responses::GetResponse

Returns a list of notifications about other users' feedback to the current user's wall posts.

Parameters:

  • arguments (Hash) (defaults to: {})

Options Hash (arguments):

  • :count (Integer) — default: 30

    Number of notifications to return.

  • :start_from (String)
  • :filters (Array)

    Type of notifications to return:; 'wall' — wall posts; 'mentions' — mentions in wall posts, comments, or topics; 'comments' — comments to wall posts, photos, and videos; 'likes' — likes; 'reposted' — wall posts that are copied from the current user's wall; 'followers' — new followers; 'friends' — accepted friend requests

  • :start_time (Integer)

    Earliest timestamp (in Unix time) of a notification to return. By default, 24 hours ago.

  • :end_time (Integer)

    Latest timestamp (in Unix time) of a notification to return. By default, the current time.

Returns:

See Also:


5165
5166
5167
5168
5169
5170
5171
# File 'lib/vk/api/methods.rb', line 5165

def get(arguments = {})
  require "vk/api/notifications/methods/get"
  method = Methods::Get.new(arguments)
  response = method.call(@client)
  require "vk/api/notifications/responses/get_response"
  Responses::GetResponse.new(response.deep_symbolize_keys)
end

#mark_as_viewed(arguments = {}) ⇒ Vk::API::Notifications::Responses::MarkAsViewedResponse

Returns Resets the counter of new notifications about other users' feedback to the current user's wall posts.

Parameters:

  • arguments (Hash) (defaults to: {})

Returns:

See Also:


5175
5176
5177
5178
5179
5180
5181
# File 'lib/vk/api/methods.rb', line 5175

def mark_as_viewed(arguments = {})
  require "vk/api/notifications/methods/mark_as_viewed"
  method = Methods::MarkAsViewed.new(arguments)
  response = method.call(@client)
  require "vk/api/notifications/responses/mark_as_viewed_response"
  Responses::MarkAsViewedResponse.new(response.deep_symbolize_keys)
end