Class DriveListParser

java.lang.Object
com.amilesend.onedrive.parse.resource.parser.DriveListParser
All Implemented Interfaces:
GsonParser<List<Drive>>

public class DriveListParser extends Object implements GsonParser<List<Drive>>
Parses a response body that contains a list of Drives.

Example response body:

 {
   "value": [
     {
       "id": "942CAEB0-13AE-491B-85E4-7557CDC0F25F",
       "driveType": "documentLibrary",
       "name": "Shared Documents",
       "owner": {
         "user": {
           "id": "AE2A1EE9-81A7-423C-ABE4-B945F47509BB",
           "displayName": "Ryan Gregg"
         }
       }
     },
     {
       "id": "C1CD3ED9-0E98-4B0B-82D3-C8FB784B9DCC",
       "driveType": "documentLibrary",
       "name": "Contoso Project Files",
       "owner": {
         "user": {
           "id": "406B2281-18E8-4416-9857-38C531B904F1",
           "displayName": "Daron Spektor"
         }
       }
     }
   ]
 }
 
API Documentation
See Also:
  • Constructor Details

    • DriveListParser

      public DriveListParser()
  • Method Details

    • parse

      public List<Drive> parse(@NonNull com.google.gson.Gson gson, @NonNull InputStream jsonStream)
      Description copied from interface: GsonParser
      Deserializes a JSON-formatted input stream to the defined POJO type.
      Specified by:
      parse in interface GsonParser<List<Drive>>
      Parameters:
      gson - the Gson instance used to deserialize the string
      jsonStream - stream with expected JSON-formatted contents
      Returns:
      the parsed POJO instance