I am trying to create a wrapper class to hold the JSON response in my apex class. But I am getting the error ' Inner types are not allowed to have inner types '. Below is my wrapper class.
public class GetTheDetails {
// Wrapper class
public class fromJSON{
public String SId;
public List<valueRanges> valueRanges ;
public class valueRanges {
public String range;
public String majorDimension;
public List<values> values;
}
public class values {
public String Id; //Id
public String AccountID; //AccountId
public String CreatedById; //CreatedById
public String Name; //Name
public String StageName; //StageName
public String CloseDate; //CloseDate
}
public fromJSON parse(String json){
return (fromJSON) System.JSON.deserialize(json, fromJSON.class);
}
} }
Can anybody help me in identifying the error ? I am not able to find any syntax error in defining wrapper class here.