package io.castle.client.model;

import com.google.gson.annotations.SerializedName;

import java.util.List;

public class CastleUserDevices {
    int totalCount;
    @SerializedName("data")
    List<CastleUserDevice> devices;

    public int getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(int totalCount) {
        this.totalCount = totalCount;
    }

    public List<CastleUserDevice> getDevices() {
        return devices;
    }

    public void setDevices(List<CastleUserDevice> devices) {
        this.devices = devices;
    }
}

@@ -139,16 +139,24 @@
 s %7B%0A    
+private 
 int tota
@@ -159,24 +159,24 @@
 totalCount;%0A
-
     @Seriali
@@ -195,16 +195,24 @@
 a%22)%0A    
+private 
 List%3CCas
@@ -307,101 +307,8 @@
  %7D%0A%0A
-    public void setTotalCount(int totalCount) %7B%0A        this.totalCount = totalCount;%0A    %7D%0A%0A
     
@@ -440,24 +440,24 @@
  devices) %7B%0A
-
         this
@@ -472,20 +472,84 @@
  = devices;%0A
+        this.totalCount = devices != null ? devices.size() : 0;%0A
     %7D%0A%7D%0A

Set totalCount field automatically in setter for devices