Class: Vk::API::Pages

Inherits:
Schema::Namespace show all
Defined in:
lib/vk/api/types.rb,
lib/vk/api/methods.rb,
lib/vk/api/objects.rb,
lib/vk/api/responses.rb,
lib/vk/api/pages/wikipage.rb,
lib/vk/api/pages/methods/get.rb,
lib/vk/api/pages/methods/save.rb,
lib/vk/api/pages/wikipage_full.rb,
lib/vk/api/pages/privacy_settings.rb,
lib/vk/api/pages/wikipage_version.rb,
lib/vk/api/pages/methods/get_titles.rb,
lib/vk/api/pages/methods/parse_wiki.rb,
lib/vk/api/pages/methods/clear_cache.rb,
lib/vk/api/pages/methods/get_history.rb,
lib/vk/api/pages/methods/get_version.rb,
lib/vk/api/pages/methods/save_access.rb,
lib/vk/api/pages/responses/get_response.rb,
lib/vk/api/pages/responses/save_response.rb,
lib/vk/api/pages/responses/get_titles_response.rb,
lib/vk/api/pages/responses/parse_wiki_response.rb,
lib/vk/api/pages/responses/clear_cache_response.rb,
lib/vk/api/pages/responses/get_history_response.rb,
lib/vk/api/pages/responses/get_version_response.rb,
lib/vk/api/pages/responses/save_access_response.rb

Defined Under Namespace

Modules: Methods, Responses Classes: Wikipage, WikipageFull, WikipageVersion

Constant Summary collapse

PrivacySettings =
API::Types::Coercible::Int.enum(0, 1, 2)

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

#clear_cache(arguments = {}) ⇒ Vk::API::Pages::Responses::ClearCacheResponse

Returns Allows to clear the cache of particular 'external' pages which may be attached to VK posts.

Parameters:

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

Options Hash (arguments):

  • :url (String)

    Address of the page where you need to refesh the cached version

Returns:

See Also:


2307
2308
2309
2310
2311
2312
2313
# File 'lib/vk/api/methods.rb', line 2307

def clear_cache(arguments = {})
  require "vk/api/pages/methods/clear_cache"
  method = Methods::ClearCache.new(arguments)
  response = method.call(@client)
  require "vk/api/pages/responses/clear_cache_response"
  Responses::ClearCacheResponse.new(response.deep_symbolize_keys)
end

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

Returns information about a wiki page.

Parameters:

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

Options Hash (arguments):

  • :owner_id (Integer)

    Page owner ID.

  • :page_id (Integer)

    Wiki page ID.

  • :global (Boolean)

    '1' — to return information about a global wiki page

  • :site_preview (Boolean)

    '1' — resulting wiki page is a preview for the attached link

  • :title (String)

    Wiki page title.

  • :need_source (Boolean)
  • :need_html (Boolean)

    '1' — to return the page as HTML;

Returns:

See Also:


2216
2217
2218
2219
2220
2221
2222
# File 'lib/vk/api/methods.rb', line 2216

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

#get_history(arguments = {}) ⇒ Vk::API::Pages::Responses::GetHistoryResponse

Returns a list of all previous versions of a wiki page.

Parameters:

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

Options Hash (arguments):

  • :page_id (Integer)

    Wiki page ID.

  • :group_id (Integer)

    ID of the community that owns the wiki page.

  • :user_id (Integer)

Returns:

See Also:


2259
2260
2261
2262
2263
2264
2265
# File 'lib/vk/api/methods.rb', line 2259

def get_history(arguments = {})
  require "vk/api/pages/methods/get_history"
  method = Methods::GetHistory.new(arguments)
  response = method.call(@client)
  require "vk/api/pages/responses/get_history_response"
  Responses::GetHistoryResponse.new(response.deep_symbolize_keys)
end

#get_titles(arguments = {}) ⇒ Vk::API::Pages::Responses::GetTitlesResponse

Returns a list of wiki pages in a group.

Parameters:

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

Options Hash (arguments):

  • :group_id (Integer)

    ID of the community that owns the wiki page.

Returns:

See Also:


2270
2271
2272
2273
2274
2275
2276
# File 'lib/vk/api/methods.rb', line 2270

def get_titles(arguments = {})
  require "vk/api/pages/methods/get_titles"
  method = Methods::GetTitles.new(arguments)
  response = method.call(@client)
  require "vk/api/pages/responses/get_titles_response"
  Responses::GetTitlesResponse.new(response.deep_symbolize_keys)
end

#get_version(arguments = {}) ⇒ Vk::API::Pages::Responses::GetVersionResponse

Returns the text of one of the previous versions of a wiki page.

Parameters:

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

Options Hash (arguments):

  • :version_id (Integer)
  • :group_id (Integer)

    ID of the community that owns the wiki page.

  • :user_id (Integer)
  • :need_html (Boolean)

    '1' — to return the page as HTML

Returns:

See Also:


2284
2285
2286
2287
2288
2289
2290
# File 'lib/vk/api/methods.rb', line 2284

def get_version(arguments = {})
  require "vk/api/pages/methods/get_version"
  method = Methods::GetVersion.new(arguments)
  response = method.call(@client)
  require "vk/api/pages/responses/get_version_response"
  Responses::GetVersionResponse.new(response.deep_symbolize_keys)
end

#parse_wiki(arguments = {}) ⇒ Vk::API::Pages::Responses::ParseWikiResponse

Returns HTML representation of the wiki markup.

Parameters:

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

Options Hash (arguments):

  • :text (String)

    Text of the wiki page.

  • :group_id (Integer)

    ID of the group in the context of which this markup is interpreted.;

Returns:

See Also:


2296
2297
2298
2299
2300
2301
2302
# File 'lib/vk/api/methods.rb', line 2296

def parse_wiki(arguments = {})
  require "vk/api/pages/methods/parse_wiki"
  method = Methods::ParseWiki.new(arguments)
  response = method.call(@client)
  require "vk/api/pages/responses/parse_wiki_response"
  Responses::ParseWikiResponse.new(response.deep_symbolize_keys)
end

#save(arguments = {}) ⇒ Vk::API::Pages::Responses::SaveResponse

Returns Saves the text of a wiki page.

Parameters:

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

Options Hash (arguments):

  • :text (String)

    Text of the wiki page in wiki-format.

  • :page_id (Integer)

    Wiki page ID. The 'title' parameter can be passed instead of 'pid'.

  • :group_id (Integer)

    ID of the community that owns the wiki page.

  • :user_id (Integer)
  • :title (String)

    Wiki page title.

Returns:

See Also:


2231
2232
2233
2234
2235
2236
2237
# File 'lib/vk/api/methods.rb', line 2231

def save(arguments = {})
  require "vk/api/pages/methods/save"
  method = Methods::Save.new(arguments)
  response = method.call(@client)
  require "vk/api/pages/responses/save_response"
  Responses::SaveResponse.new(response.deep_symbolize_keys)
end

#save_access(arguments = {}) ⇒ Vk::API::Pages::Responses::SaveAccessResponse

Returns Saves modified read and edit access settings for a wiki page.

Parameters:

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

Options Hash (arguments):

  • :page_id (Integer)

    Wiki page ID.

  • :group_id (Integer)

    ID of the community that owns the wiki page.

  • :user_id (Integer)
  • :view (Integer)

    Who can view the wiki page:; '1' — only community members; '2' — all users can view the page; '0' — only community managers

  • :edit (Integer)

    Who can edit the wiki page:; '1' — only community members; '2' — all users can edit the page; '0' — only community managers

Returns:

See Also:


2246
2247
2248
2249
2250
2251
2252
# File 'lib/vk/api/methods.rb', line 2246

def save_access(arguments = {})
  require "vk/api/pages/methods/save_access"
  method = Methods::SaveAccess.new(arguments)
  response = method.call(@client)
  require "vk/api/pages/responses/save_access_response"
  Responses::SaveAccessResponse.new(response.deep_symbolize_keys)
end