Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ public class FaceDetectionItem {
public static final String SERIALIZED_NAME_FACE_DETECTION = "FaceDetection";

@SerializedName(SERIALIZED_NAME_FACE_DETECTION)
@javax.annotation.Nonnull
@javax.annotation.Nullable
private FaceDetection faceDetection;

public FaceDetectionItem() {}

public FaceDetectionItem faceDetection(@javax.annotation.Nonnull FaceDetection faceDetection) {
public FaceDetectionItem faceDetection(@javax.annotation.Nullable FaceDetection faceDetection) {
this.faceDetection = faceDetection;
return this;
}
Expand All @@ -49,12 +49,12 @@ public FaceDetectionItem faceDetection(@javax.annotation.Nonnull FaceDetection f
*
* @return faceDetection
*/
@javax.annotation.Nonnull
@javax.annotation.Nullable
public FaceDetection getFaceDetection() {
return faceDetection;
}

public void setFaceDetection(@javax.annotation.Nonnull FaceDetection faceDetection) {
public void setFaceDetection(@javax.annotation.Nullable FaceDetection faceDetection) {
this.faceDetection = faceDetection;
}

Expand Down Expand Up @@ -104,7 +104,6 @@ private String toIndentedString(Object o) {

// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("FaceDetection");
}

/**
Expand All @@ -124,18 +123,11 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}

// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : FaceDetectionItem.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
throw new IllegalArgumentException(
String.format(
"The required field `%s` is not found in the JSON string: %s",
requiredField, jsonElement.toString()));
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
// validate the required field `FaceDetection`
FaceDetection.validateJsonElement(jsonObj.get("FaceDetection"));
// validate the optional field `FaceDetection`
if (jsonObj.get("FaceDetection") != null && !jsonObj.get("FaceDetection").isJsonNull()) {
FaceDetection.validateJsonElement(jsonObj.get("FaceDetection"));
}
}

public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ public class FaceDetectionResult extends ResultItem {
public static final String SERIALIZED_NAME_FACE_DETECTION = "FaceDetection";

@SerializedName(SERIALIZED_NAME_FACE_DETECTION)
@javax.annotation.Nonnull
@javax.annotation.Nullable
private FaceDetection faceDetection;

public FaceDetectionResult() {}

public FaceDetectionResult faceDetection(@javax.annotation.Nonnull FaceDetection faceDetection) {
public FaceDetectionResult faceDetection(@javax.annotation.Nullable FaceDetection faceDetection) {
this.faceDetection = faceDetection;
return this;
}
Expand All @@ -49,12 +49,12 @@ public FaceDetectionResult faceDetection(@javax.annotation.Nonnull FaceDetection
*
* @return faceDetection
*/
@javax.annotation.Nonnull
@javax.annotation.Nullable
public FaceDetection getFaceDetection() {
return faceDetection;
}

public void setFaceDetection(@javax.annotation.Nonnull FaceDetection faceDetection) {
public void setFaceDetection(@javax.annotation.Nullable FaceDetection faceDetection) {
this.faceDetection = faceDetection;
}

Expand Down Expand Up @@ -110,7 +110,6 @@ private String toIndentedString(Object o) {

// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("FaceDetection");
openapiRequiredFields.add("result_type");
}

Expand Down