Попробуйте следующим образом:
private void getResponseList() {
ApiInterface apiService = ApiClient.getClient().create(ApiInterface.class);
Call<Example> call = apiService.getResponse();
call.enqueue(new Callback<Example>() {
@Override
public void onResponse(@NonNull Call<Example> call, @NonNull Response<Example> response) {
assert response.body() != null;
Log.e("Message",""+response.body().getMessage());
Log.e("Code",""+response.body().getCode());
Log.e("DisplayName",""+response.body().getDealsViewModel().getCountryDealsViewModel().getDealsPageInfo().get(0).getExpiredDate());
}
@Override
public void onFailure(@NonNull Call<Example> call, @NonNull Throwable t) {
// Log error here since request failed
Log.e(TAG, t.toString());
}
});
}
===============================
public class CountryDealsViewModel {
@SerializedName("CultureCountry")
@Expose
private String cultureCountry;
@SerializedName("CultureLanguage")
@Expose
private String cultureLanguage;
@SerializedName("DealsPageInfo")
@Expose
private List<DealsPageInfo> dealsPageInfo = null;
@SerializedName("CountryCode")
@Expose
private String countryCode;
@SerializedName("CountryName")
@Expose
private String countryName;
public String getCultureCountry() {
return cultureCountry;
}
public void setCultureCountry(String cultureCountry) {
this.cultureCountry = cultureCountry;
}
public String getCultureLanguage() {
return cultureLanguage;
}
public void setCultureLanguage(String cultureLanguage) {
this.cultureLanguage = cultureLanguage;
}
public List<DealsPageInfo> getDealsPageInfo() {
return dealsPageInfo;
}
public void setDealsPageInfo(List<DealsPageInfo> dealsPageInfo) {
this.dealsPageInfo = dealsPageInfo;
}
public String getCountryCode() {
return countryCode;
}
public void setCountryCode(String countryCode) {
this.countryCode = countryCode;
}
public String getCountryName() {
return countryName;
}
public void setCountryName(String countryName) {
this.countryName = countryName;
}
}
==================================
public class DealsPageInfo {
@SerializedName("DisplayName")
@Expose
private String displayName;
@SerializedName("StartDate")
@Expose
private String startDate;
@SerializedName("ExpiredDate")
@Expose
private String expiredDate;
@SerializedName("Url")
@Expose
private String url;
@SerializedName("ImageUrl")
@Expose
private String imageUrl;
@SerializedName("ShortDescription")
@Expose
private String shortDescription;
public String getDisplayName() {
return displayName;
}
public void setDisplayName(String displayName) {
this.displayName = displayName;
}
public String getStartDate() {
return startDate;
}
public void setStartDate(String startDate) {
this.startDate = startDate;
}
public String getExpiredDate() {
return expiredDate;
}
public void setExpiredDate(String expiredDate) {
this.expiredDate = expiredDate;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getImageUrl() {
return imageUrl;
}
public void setImageUrl(String imageUrl) {
this.imageUrl = imageUrl;
}
public String getShortDescription() {
return shortDescription;
}
public void setShortDescription(String shortDescription) {
this.shortDescription = shortDescription;
}
}
===============================
открытый класс DealsViewModel {
@SerializedName("CountryDealsViewModel")
@Expose
private CountryDealsViewModel countryDealsViewModel;
public CountryDealsViewModel getCountryDealsViewModel() {
return countryDealsViewModel;
}
public void setCountryDealsViewModel(CountryDealsViewModel countryDealsViewModel) {
this.countryDealsViewModel = countryDealsViewModel;
}
}
=============================
public class Example {
@SerializedName("DealsViewModel")
@Expose
private DealsViewModel dealsViewModel;
@SerializedName("Status")
@Expose
private Integer status;
@SerializedName("Code")
@Expose
private Integer code;
@SerializedName("Message")
@Expose
private String message;
public DealsViewModel getDealsViewModel() {
return dealsViewModel;
}
public void setDealsViewModel(DealsViewModel dealsViewModel) {
this.dealsViewModel = dealsViewModel;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}