Class: Vk::API::Docs

Inherits:
Schema::Namespace show all
Defined in:
lib/vk/api/methods.rb,
lib/vk/api/objects.rb,
lib/vk/api/docs/doc.rb,
lib/vk/api/responses.rb,
lib/vk/api/docs/doc_types.rb,
lib/vk/api/docs/methods/add.rb,
lib/vk/api/docs/methods/get.rb,
lib/vk/api/docs/methods/edit.rb,
lib/vk/api/docs/methods/save.rb,
lib/vk/api/docs/methods/delete.rb,
lib/vk/api/docs/methods/search.rb,
lib/vk/api/docs/methods/get_by_id.rb,
lib/vk/api/docs/methods/get_types.rb,
lib/vk/api/docs/doc_upload_response.rb,
lib/vk/api/docs/responses/add_response.rb,
lib/vk/api/docs/responses/get_response.rb,
lib/vk/api/docs/responses/edit_response.rb,
lib/vk/api/docs/responses/save_response.rb,
lib/vk/api/docs/methods/get_upload_server.rb,
lib/vk/api/docs/responses/delete_response.rb,
lib/vk/api/docs/responses/search_response.rb,
lib/vk/api/docs/responses/get_by_id_response.rb,
lib/vk/api/docs/responses/get_types_response.rb,
lib/vk/api/docs/methods/get_wall_upload_server.rb,
lib/vk/api/docs/responses/get_upload_server_response.rb,
lib/vk/api/docs/responses/get_wall_upload_server_response.rb

Defined Under Namespace

Modules: Methods, Responses Classes: Doc, DocTypes, DocUploadResponse

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

#add(arguments = {}) ⇒ Vk::API::Docs::Responses::AddResponse

Returns Copies a document to a user's or community's document list.

Parameters:

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

Options Hash (arguments):

  • :owner_id (Integer)

    ID of the user or community that owns the document. Use a negative value to designate a community ID.

  • :doc_id (Integer)

    Document ID.

  • :access_key (String)

    Access key. This parameter is required if 'access_key' was returned with the document's data.

Returns:

See Also:



4942
4943
4944
4945
4946
4947
4948
# File 'lib/vk/api/methods.rb', line 4942

def add(arguments = {})
  require "vk/api/docs/methods/add"
  method = Methods::Add.new(arguments)
  response = method.call(@client)
  require "vk/api/docs/responses/add_response"
  Responses::AddResponse.new(response.deep_symbolize_keys)
end

#delete(arguments = {}) ⇒ Vk::API::Docs::Responses::DeleteResponse

Returns Deletes a user or community document.

Parameters:

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

Options Hash (arguments):

  • :owner_id (Integer)

    ID of the user or community that owns the document. Use a negative value to designate a community ID.

  • :doc_id (Integer)

    Document ID.

Returns:

See Also:



4929
4930
4931
4932
4933
4934
4935
# File 'lib/vk/api/methods.rb', line 4929

def delete(arguments = {})
  require "vk/api/docs/methods/delete"
  method = Methods::Delete.new(arguments)
  response = method.call(@client)
  require "vk/api/docs/responses/delete_response"
  Responses::DeleteResponse.new(response.deep_symbolize_keys)
end

#edit(arguments = {}) ⇒ Vk::API::Docs::Responses::EditResponse

Returns Edits a document.

Parameters:

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

Options Hash (arguments):

  • :owner_id (Integer)

    User ID or community ID. Use a negative value to designate a community ID.

  • :doc_id (Integer)

    Document ID.

  • :title (String)

    Document title.

  • :tags (Array)

    Document tags.

Returns:

See Also:



4980
4981
4982
4983
4984
4985
4986
# File 'lib/vk/api/methods.rb', line 4980

def edit(arguments = {})
  require "vk/api/docs/methods/edit"
  method = Methods::Edit.new(arguments)
  response = method.call(@client)
  require "vk/api/docs/responses/edit_response"
  Responses::EditResponse.new(response.deep_symbolize_keys)
end

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

Returns detailed information about user or community documents.

Parameters:

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

Options Hash (arguments):

  • :count (Integer)

    Number of documents to return. By default, all documents.

  • :offset (Integer)

    Offset needed to return a specific subset of documents.

  • :owner_id (Integer)

    ID of the user or community that owns the documents. Use a negative value to designate a community ID.

Returns:

See Also:



4871
4872
4873
4874
4875
4876
4877
# File 'lib/vk/api/methods.rb', line 4871

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

#get_by_id(arguments = {}) ⇒ Vk::API::Docs::Responses::GetByIdResponse

Returns information about documents by their IDs.

Parameters:

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

Options Hash (arguments):

  • :docs (Array)

    Document IDs. Example: ; "66748_91488,66748_91455";

Returns:

See Also:



4882
4883
4884
4885
4886
4887
4888
# File 'lib/vk/api/methods.rb', line 4882

def get_by_id(arguments = {})
  require "vk/api/docs/methods/get_by_id"
  method = Methods::GetById.new(arguments)
  response = method.call(@client)
  require "vk/api/docs/responses/get_by_id_response"
  Responses::GetByIdResponse.new(response.deep_symbolize_keys)
end

#get_types(arguments = {}) ⇒ Vk::API::Docs::Responses::GetTypesResponse

Returns documents types available for current user.

Parameters:

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

Options Hash (arguments):

  • :owner_id (Integer)

    ID of the user or community that owns the documents. Use a negative value to designate a community ID.

Returns:

See Also:



4953
4954
4955
4956
4957
4958
4959
# File 'lib/vk/api/methods.rb', line 4953

def get_types(arguments = {})
  require "vk/api/docs/methods/get_types"
  method = Methods::GetTypes.new(arguments)
  response = method.call(@client)
  require "vk/api/docs/responses/get_types_response"
  Responses::GetTypesResponse.new(response.deep_symbolize_keys)
end

#get_upload_server(arguments = {}) ⇒ Vk::API::Docs::Responses::GetUploadServerResponse

Returns the server address for document upload.

Parameters:

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

Options Hash (arguments):

  • :group_id (Integer)

    Community ID (if the document will be uploaded to the community).

Returns:

See Also:



4893
4894
4895
4896
4897
4898
4899
# File 'lib/vk/api/methods.rb', line 4893

def get_upload_server(arguments = {})
  require "vk/api/docs/methods/get_upload_server"
  method = Methods::GetUploadServer.new(arguments)
  response = method.call(@client)
  require "vk/api/docs/responses/get_upload_server_response"
  Responses::GetUploadServerResponse.new(response.deep_symbolize_keys)
end

#get_wall_upload_server(arguments = {}) ⇒ Vk::API::Docs::Responses::GetWallUploadServerResponse

Returns the server address for document upload onto a user's or community's wall.

Parameters:

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

Options Hash (arguments):

  • :group_id (Integer)

    Community ID (if the document will be uploaded to the community).

Returns:

See Also:



4904
4905
4906
4907
4908
4909
4910
# File 'lib/vk/api/methods.rb', line 4904

def get_wall_upload_server(arguments = {})
  require "vk/api/docs/methods/get_wall_upload_server"
  method = Methods::GetWallUploadServer.new(arguments)
  response = method.call(@client)
  require "vk/api/docs/responses/get_wall_upload_server_response"
  Responses::GetWallUploadServerResponse.new(response.deep_symbolize_keys)
end

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

Returns Saves a document after [https://vk.com/dev/upload_files_2?f=10.%2BUploading%2BDocuments|uploading it to a server].

Parameters:

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

Options Hash (arguments):

Returns:

See Also:



4917
4918
4919
4920
4921
4922
4923
# File 'lib/vk/api/methods.rb', line 4917

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

#search(arguments = {}) ⇒ Vk::API::Docs::Responses::SearchResponse

Returns a list of documents matching the search criteria.

Parameters:

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

Options Hash (arguments):

  • :q (String)

    Search query string.

  • :count (Integer)

    Number of results to return.

  • :offset (Integer)

    Offset needed to return a specific subset of results.

Returns:

See Also:



4966
4967
4968
4969
4970
4971
4972
# File 'lib/vk/api/methods.rb', line 4966

def search(arguments = {})
  require "vk/api/docs/methods/search"
  method = Methods::Search.new(arguments)
  response = method.call(@client)
  require "vk/api/docs/responses/search_response"
  Responses::SearchResponse.new(response.deep_symbolize_keys)
end