Skip to content
This repository has been archived by the owner on Dec 23, 2024. It is now read-only.

16 findHWReservationById API response schema patch #52

Merged
merged 8 commits into from
Jan 11, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,7 @@ private String toIndentedString(Object o) {
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (Address.openapiRequiredFields.isEmpty()) {
return;
} else { // has required fields
if (!Address.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in Address is not found in the empty JSON string", Address.openapiRequiredFields.toString()));
}
}
Expand All @@ -372,7 +370,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if ((jsonObj.get("address") != null && !jsonObj.get("address").isJsonNull()) && !jsonObj.get("address").isJsonPrimitive()) {
if (!jsonObj.get("address").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address").toString()));
}
if ((jsonObj.get("address2") != null && !jsonObj.get("address2").isJsonNull()) && !jsonObj.get("address2").isJsonPrimitive()) {
Expand All @@ -385,13 +383,13 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj.get("coordinates") != null && !jsonObj.get("coordinates").isJsonNull()) {
Coordinates.validateJsonObject(jsonObj.getAsJsonObject("coordinates"));
}
if ((jsonObj.get("country") != null && !jsonObj.get("country").isJsonNull()) && !jsonObj.get("country").isJsonPrimitive()) {
if (!jsonObj.get("country").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `country` to be a primitive type in the JSON string but got `%s`", jsonObj.get("country").toString()));
}
if ((jsonObj.get("state") != null && !jsonObj.get("state").isJsonNull()) && !jsonObj.get("state").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `state` to be a primitive type in the JSON string but got `%s`", jsonObj.get("state").toString()));
}
if ((jsonObj.get("zip_code") != null && !jsonObj.get("zip_code").isJsonNull()) && !jsonObj.get("zip_code").isJsonPrimitive()) {
if (!jsonObj.get("zip_code").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `zip_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("zip_code").toString()));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,9 +389,7 @@ private String toIndentedString(Object o) {
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (AuthToken.openapiRequiredFields.isEmpty()) {
return;
} else { // has required fields
if (!AuthToken.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in AuthToken is not found in the empty JSON string", AuthToken.openapiRequiredFields.toString()));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,7 @@ private String toIndentedString(Object o) {
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (AuthTokenInput.openapiRequiredFields.isEmpty()) {
return;
} else { // has required fields
if (!AuthTokenInput.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in AuthTokenInput is not found in the empty JSON string", AuthTokenInput.openapiRequiredFields.toString()));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,7 @@ private String toIndentedString(Object o) {
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (AuthTokenList.openapiRequiredFields.isEmpty()) {
return;
} else { // has required fields
if (!AuthTokenList.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in AuthTokenList is not found in the empty JSON string", AuthTokenList.openapiRequiredFields.toString()));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -648,9 +648,7 @@ private String toIndentedString(Object o) {
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (AuthTokenProject.openapiRequiredFields.isEmpty()) {
return;
} else { // has required fields
if (!AuthTokenProject.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in AuthTokenProject is not found in the empty JSON string", AuthTokenProject.openapiRequiredFields.toString()));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -796,9 +796,7 @@ private String toIndentedString(Object o) {
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (AuthTokenUser.openapiRequiredFields.isEmpty()) {
return;
} else { // has required fields
if (!AuthTokenUser.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in AuthTokenUser is not found in the empty JSON string", AuthTokenUser.openapiRequiredFields.toString()));
}
}
Expand Down Expand Up @@ -856,7 +854,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException {
throw new IllegalArgumentException(String.format("Expected the field `two_factor_auth` to be a primitive type in the JSON string but got `%s`", jsonObj.get("two_factor_auth").toString()));
}
// ensure the json data is an array
if ((jsonObj.get("features") != null && !jsonObj.get("features").isJsonNull()) && !jsonObj.get("features").isJsonArray()) {
if (!jsonObj.get("features").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `features` to be an array in the JSON string but got `%s`", jsonObj.get("features").toString()));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,7 @@ private String toIndentedString(Object o) {
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (BGPSessionInput.openapiRequiredFields.isEmpty()) {
return;
} else { // has required fields
if (!BGPSessionInput.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in BGPSessionInput is not found in the empty JSON string", BGPSessionInput.openapiRequiredFields.toString()));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -406,9 +406,7 @@ private String toIndentedString(Object o) {
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (Batch.openapiRequiredFields.isEmpty()) {
return;
} else { // has required fields
if (!Batch.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in Batch is not found in the empty JSON string", Batch.openapiRequiredFields.toString()));
}
}
Expand All @@ -427,7 +425,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException {
}
}
// ensure the json data is an array
if ((jsonObj.get("error_messages") != null && !jsonObj.get("error_messages").isJsonNull()) && !jsonObj.get("error_messages").isJsonArray()) {
if (!jsonObj.get("error_messages").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `error_messages` to be an array in the JSON string but got `%s`", jsonObj.get("error_messages").toString()));
}
if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,7 @@ private String toIndentedString(Object o) {
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (BatchesList.openapiRequiredFields.isEmpty()) {
return;
} else { // has required fields
if (!BatchesList.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in BatchesList is not found in the empty JSON string", BatchesList.openapiRequiredFields.toString()));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -666,9 +666,7 @@ private String toIndentedString(Object o) {
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (BgpConfig.openapiRequiredFields.isEmpty()) {
return;
} else { // has required fields
if (!BgpConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in BgpConfig is not found in the empty JSON string", BgpConfig.openapiRequiredFields.toString()));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,7 @@ private String toIndentedString(Object o) {
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (BgpConfigRequestInput.openapiRequiredFields.isEmpty()) {
return;
} else { // has required fields
if (!BgpConfigRequestInput.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in BgpConfigRequestInput is not found in the empty JSON string", BgpConfigRequestInput.openapiRequiredFields.toString()));
}
}
Expand All @@ -280,7 +278,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if ((jsonObj.get("deployment_type") != null && !jsonObj.get("deployment_type").isJsonNull()) && !jsonObj.get("deployment_type").isJsonPrimitive()) {
if (!jsonObj.get("deployment_type").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `deployment_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deployment_type").toString()));
}
if ((jsonObj.get("md5") != null && !jsonObj.get("md5").isJsonNull()) && !jsonObj.get("md5").isJsonPrimitive()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -474,9 +474,7 @@ private String toIndentedString(Object o) {
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (BgpNeighborData.openapiRequiredFields.isEmpty()) {
return;
} else { // has required fields
if (!BgpNeighborData.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in BgpNeighborData is not found in the empty JSON string", BgpNeighborData.openapiRequiredFields.toString()));
}
}
Expand All @@ -487,7 +485,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException {
throw new IllegalArgumentException(String.format("Expected the field `md5_password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("md5_password").toString()));
}
// ensure the json data is an array
if ((jsonObj.get("peer_ips") != null && !jsonObj.get("peer_ips").isJsonNull()) && !jsonObj.get("peer_ips").isJsonArray()) {
if (!jsonObj.get("peer_ips").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `peer_ips` to be an array in the JSON string but got `%s`", jsonObj.get("peer_ips").toString()));
}
if (jsonObj.get("routes_in") != null && !jsonObj.get("routes_in").isJsonNull()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,7 @@ private String toIndentedString(Object o) {
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (BgpNeighborDataRoutesInInner.openapiRequiredFields.isEmpty()) {
return;
} else { // has required fields
if (!BgpNeighborDataRoutesInInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in BgpNeighborDataRoutesInInner is not found in the empty JSON string", BgpNeighborDataRoutesInInner.openapiRequiredFields.toString()));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,7 @@ private String toIndentedString(Object o) {
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (BgpNeighborDataRoutesOutInner.openapiRequiredFields.isEmpty()) {
return;
} else { // has required fields
if (!BgpNeighborDataRoutesOutInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in BgpNeighborDataRoutesOutInner is not found in the empty JSON string", BgpNeighborDataRoutesOutInner.openapiRequiredFields.toString()));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -525,9 +525,7 @@ private String toIndentedString(Object o) {
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (BgpSession.openapiRequiredFields.isEmpty()) {
return;
} else { // has required fields
if (!BgpSession.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in BgpSession is not found in the empty JSON string", BgpSession.openapiRequiredFields.toString()));
}
}
Expand All @@ -538,7 +536,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if ((jsonObj.get("address_family") != null && !jsonObj.get("address_family").isJsonNull()) && !jsonObj.get("address_family").isJsonPrimitive()) {
if (!jsonObj.get("address_family").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `address_family` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address_family").toString()));
}
// validate the optional field `device`
Expand All @@ -552,7 +550,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
// ensure the json data is an array
if ((jsonObj.get("learned_routes") != null && !jsonObj.get("learned_routes").isJsonNull()) && !jsonObj.get("learned_routes").isJsonArray()) {
if (!jsonObj.get("learned_routes").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `learned_routes` to be an array in the JSON string but got `%s`", jsonObj.get("learned_routes").toString()));
}
if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,7 @@ private String toIndentedString(Object o) {
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (BgpSessionList.openapiRequiredFields.isEmpty()) {
return;
} else { // has required fields
if (!BgpSessionList.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in BgpSessionList is not found in the empty JSON string", BgpSessionList.openapiRequiredFields.toString()));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,7 @@ private String toIndentedString(Object o) {
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (BgpSessionNeighbors.openapiRequiredFields.isEmpty()) {
return;
} else { // has required fields
if (!BgpSessionNeighbors.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in BgpSessionNeighbors is not found in the empty JSON string", BgpSessionNeighbors.openapiRequiredFields.toString()));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,7 @@ private String toIndentedString(Object o) {
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (CapacityCheckPerFacilityInfo.openapiRequiredFields.isEmpty()) {
return;
} else { // has required fields
if (!CapacityCheckPerFacilityInfo.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in CapacityCheckPerFacilityInfo is not found in the empty JSON string", CapacityCheckPerFacilityInfo.openapiRequiredFields.toString()));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,7 @@ private String toIndentedString(Object o) {
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (CapacityCheckPerFacilityList.openapiRequiredFields.isEmpty()) {
return;
} else { // has required fields
if (!CapacityCheckPerFacilityList.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in CapacityCheckPerFacilityList is not found in the empty JSON string", CapacityCheckPerFacilityList.openapiRequiredFields.toString()));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,7 @@ private String toIndentedString(Object o) {
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (CapacityCheckPerMetroInfo.openapiRequiredFields.isEmpty()) {
return;
} else { // has required fields
if (!CapacityCheckPerMetroInfo.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in CapacityCheckPerMetroInfo is not found in the empty JSON string", CapacityCheckPerMetroInfo.openapiRequiredFields.toString()));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,7 @@ private String toIndentedString(Object o) {
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (CapacityCheckPerMetroList.openapiRequiredFields.isEmpty()) {
return;
} else { // has required fields
if (!CapacityCheckPerMetroList.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in CapacityCheckPerMetroList is not found in the empty JSON string", CapacityCheckPerMetroList.openapiRequiredFields.toString()));
}
}
Expand Down
Loading