package com.filestack;

import com.filestack.util.responses.CloudAuthHolder;

public class CloudResponse {
  private CloudAuthHolder auth;
  private CloudItem[] items;
  private String client;
  private String filename;
  private String next;

  /** Returns an OAuth URL or null if the user has already authorized. */
  public String getAuthUrl() {
    return auth != null ? auth.getRedirectUrl() : null;
  }

  public CloudItem[] getItems() {
    return items;
  }

  public String getProvider() {
    return client;
  }

  public String getDirectory() {
    return filename;
  }

  /** Returns a pagination token if all items can't be returned at once. */
  public String getNextToken() {
    // An empty string token is confusing, just return null
    if (next == null || next.equals("")) {
      return null;
    }
    return next;
  }
}

@@ -69,16 +69,67 @@
 hHolder;
+%0Aimport com.google.gson.annotations.SerializedName;
 %0A%0Apublic
@@ -189,86 +189,203 @@
 ;%0A  
-private CloudItem%5B%5D items;%0A  private String client;%0A  private String filename;
+@SerializedName(%22contents%22)%0A  private CloudItem%5B%5D items;%0A  @SerializedName(%22client%22)%0A  private String provider;%0A  @SerializedName(%22filename%22)%0A  private String directory;%0A  @SerializedName(%22next%22)
 %0A  p
@@ -402,16 +402,21 @@
 ing next
+Token
 ;%0A%0A  /**
@@ -676,22 +676,24 @@
  return 
-client
+provider
 ;%0A  %7D%0A%0A 
@@ -735,24 +735,25 @@
  return 
-filename
+directory
 ;%0A  %7D%0A%0A 
@@ -932,16 +932,21 @@
 if (next
+Token
  == null
@@ -953,16 +953,21 @@
  %7C%7C next
+Token
 .equals(
@@ -1013,16 +1013,21 @@
 urn next
+Token
 ;%0A  %7D%0A%7D%0A

Fix serialized names in CloudResponse