Class: Favorites

Version 1.5 - Updated on 12/15/2016

Contents

Constructor Details

#initialize(session) ⇒ Favorites

def initialize(session)
  # Instance variables
  @session = session
end

Instance Method Details

deleteFavorites

deleteFavorites(uri, createVersion) ⇒ Object

Deletes favorites.

  • Arguments:

    • uri: URI of the resource. This is a URI value obtained from a fullview or metadata response.
    • createVersion: If set to true, creates a new version of the file or folder. Defaults to false.
  • Returns:

    • A Hash object
def deleteFavorites(uri,createVersion)
  params = {
    "uri" => uri,
    "createVersion" => createVersion
  }
  headers = {'Content-Type' => 'application/json'}
  response = @session.do_delete_with_params "favorites", params
  Sdk::parse_response(response, raw=true)
end

getFavorites

#getFavorites(name, type, filetype) ⇒ Object

Lists favorites.

  • Arguments:

    • name: Name of Favorites
    • type: Type of favorites used to restrict the search results. Possible values are:
      • file&folder (default)
      • file
      • folder
    • filetype: The type of the favorite. Possible values are:
      • all (default)
      • documents
      • image
      • music
      • video
  • Returns:

    • A Hash object
def getFavorites(name,type,filetype)
  params = {
 "virtualfolder" => name,
  "type" => type,
  "filetype" => filetype
  }
  response = @session.do_get "favorites", params
  Sdk::parse_response(response)
end

setFavorites

#setFavorites(favoriteslistdata) ⇒ Object

Creates favorites.

  • Arguments:

    • favoriteslistdata: favorites data in the json format.
  • Returns:

    • A Hash object
def setFavorites(favoriteslistdata)
  params = favoriteslistdata
  headers = {'Content-Type' => 'application/json'}
  response = @session.do_put "favorites", params, headers
  Sdk::parse_response(response, raw=true)
end

Copyright © 2015-2017, Verizon and/or its Licensors. All rights reserved.