Skip to content

Commit

Permalink
Make the Field Data Ref Object Plural
Browse files Browse the repository at this point in the history
By specifying that the field data references is plural, it helps clarify as to what would be returned from the API.
  • Loading branch information
AvocadoMoon committed Jan 13, 2025
1 parent dbd1742 commit deba142
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 77 deletions.
2 changes: 1 addition & 1 deletion python-restclient/docs/FieldDataReference.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**external_data_identifier** | [**ExternalDataIdentifier**](ExternalDataIdentifier.md) | | [optional]
**external_data_annotation** | **str** | | [optional]
**external_data_id_sim_ref** | [**List[KeyValue]**](KeyValue.md) | | [optional]
**external_data_id_sim_refs** | [**List[KeyValue]**](KeyValue.md) | | [optional]

## Example

Expand Down
14 changes: 7 additions & 7 deletions python-restclient/vcell_client/models/field_data_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ class FieldDataReference(BaseModel):
""" # noqa: E501
external_data_identifier: Optional[ExternalDataIdentifier] = Field(default=None, alias="externalDataIdentifier")
external_data_annotation: Optional[StrictStr] = Field(default=None, alias="externalDataAnnotation")
external_data_id_sim_ref: Optional[List[KeyValue]] = Field(default=None, alias="externalDataIDSimRef")
__properties: ClassVar[List[str]] = ["externalDataIdentifier", "externalDataAnnotation", "externalDataIDSimRef"]
external_data_id_sim_refs: Optional[List[KeyValue]] = Field(default=None, alias="externalDataIDSimRefs")
__properties: ClassVar[List[str]] = ["externalDataIdentifier", "externalDataAnnotation", "externalDataIDSimRefs"]

model_config = {
"populate_by_name": True,
Expand Down Expand Up @@ -77,13 +77,13 @@ def to_dict(self) -> Dict[str, Any]:
# override the default output from pydantic by calling `to_dict()` of external_data_identifier
if self.external_data_identifier:
_dict['externalDataIdentifier'] = self.external_data_identifier.to_dict()
# override the default output from pydantic by calling `to_dict()` of each item in external_data_id_sim_ref (list)
# override the default output from pydantic by calling `to_dict()` of each item in external_data_id_sim_refs (list)
_items = []
if self.external_data_id_sim_ref:
for _item in self.external_data_id_sim_ref:
if self.external_data_id_sim_refs:
for _item in self.external_data_id_sim_refs:
if _item:
_items.append(_item.to_dict())
_dict['externalDataIDSimRef'] = _items
_dict['externalDataIDSimRefs'] = _items
return _dict

@classmethod
Expand All @@ -103,7 +103,7 @@ def from_dict(cls, obj: Dict) -> Self:
_obj = cls.model_validate({
"externalDataIdentifier": ExternalDataIdentifier.from_dict(obj.get("externalDataIdentifier")) if obj.get("externalDataIdentifier") is not None else None,
"externalDataAnnotation": obj.get("externalDataAnnotation"),
"externalDataIDSimRef": [KeyValue.from_dict(_item) for _item in obj.get("externalDataIDSimRef")] if obj.get("externalDataIDSimRef") is not None else None
"externalDataIDSimRefs": [KeyValue.from_dict(_item) for _item in obj.get("externalDataIDSimRefs")] if obj.get("externalDataIDSimRefs") is not None else None
})
return _obj

Expand Down
2 changes: 1 addition & 1 deletion tools/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ components:
$ref: '#/components/schemas/ExternalDataIdentifier'
externalDataAnnotation:
type: string
externalDataIDSimRef:
externalDataIDSimRefs:
type: array
items:
$ref: '#/components/schemas/KeyValue'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static FieldDataDBOperationResults fieldDataReferencesToDBResults(List<Fi
ExternalDataIdentifier externalDataIdentifier = ExternalDataIdentifier.dtoToExternalDataIdentifier(fieldDataReference.getExternalDataIdentifier());
externalDataIdentifiers.add(externalDataIdentifier);
externalDataAnnotations.add(fieldDataReference.getExternalDataAnnotation());
List<KeyValue> keyValues = fieldDataReference.getExternalDataIDSimRef().stream().map(KeyValue::dtoToKeyValue).collect(Collectors.toList());
List<KeyValue> keyValues = fieldDataReference.getExternalDataIDSimRefs().stream().map(KeyValue::dtoToKeyValue).collect(Collectors.toList());
externalDataIDSimRefs.put(externalDataIdentifier, new Vector<>(keyValues));
}
fieldDataDBOperationResults.extDataIDArr = externalDataIdentifiers.toArray(new ExternalDataIdentifier[0]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public record FieldDataShape(
public record FieldDataReference(
ExternalDataIdentifier externalDataIdentifier,
String externalDataAnnotation,
Vector<KeyValue> externalDataIDSimRef
Vector<KeyValue> externalDataIDSimRefs
) { }

public record AnalyzedResultsFromFieldData(
Expand Down
37 changes: 0 additions & 37 deletions vcell-restclient/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -100,40 +100,3 @@ src/main/java/org/vcell/restclient/model/UserRegistrationInfo.java
src/main/java/org/vcell/restclient/model/VCSimulationIdentifier.java
src/main/java/org/vcell/restclient/model/VariableDomain.java
src/main/java/org/vcell/restclient/model/VariableType.java
src/test/java/org/vcell/restclient/model/AccesTokenRepresentationRecordTest.java
src/test/java/org/vcell/restclient/model/AnalyzedResultsFromFieldDataTest.java
src/test/java/org/vcell/restclient/model/BatchSystemTypeTest.java
src/test/java/org/vcell/restclient/model/BioModelTest.java
src/test/java/org/vcell/restclient/model/BiomodelRefTest.java
src/test/java/org/vcell/restclient/model/DataIdentifierTest.java
src/test/java/org/vcell/restclient/model/DetailedStateTest.java
src/test/java/org/vcell/restclient/model/DomainTest.java
src/test/java/org/vcell/restclient/model/ExtentTest.java
src/test/java/org/vcell/restclient/model/ExternalDataIdentifierTest.java
src/test/java/org/vcell/restclient/model/FieldDataReferenceTest.java
src/test/java/org/vcell/restclient/model/FieldDataSaveResultsTest.java
src/test/java/org/vcell/restclient/model/FieldDataShapeTest.java
src/test/java/org/vcell/restclient/model/HelloWorldMessageTest.java
src/test/java/org/vcell/restclient/model/HtcJobIDTest.java
src/test/java/org/vcell/restclient/model/ISizeTest.java
src/test/java/org/vcell/restclient/model/IdentityTest.java
src/test/java/org/vcell/restclient/model/KeyValueTest.java
src/test/java/org/vcell/restclient/model/MathmodelRefTest.java
src/test/java/org/vcell/restclient/model/OriginTest.java
src/test/java/org/vcell/restclient/model/PublicationTest.java
src/test/java/org/vcell/restclient/model/SchedulerStatusTest.java
src/test/java/org/vcell/restclient/model/SimulationExecutionStatusRecordTest.java
src/test/java/org/vcell/restclient/model/SimulationJobStatusRecordTest.java
src/test/java/org/vcell/restclient/model/SimulationMessageTest.java
src/test/java/org/vcell/restclient/model/SimulationQueueEntryStatusRecordTest.java
src/test/java/org/vcell/restclient/model/SimulationQueueIDTest.java
src/test/java/org/vcell/restclient/model/SimulationStatusPersistentRecordTest.java
src/test/java/org/vcell/restclient/model/StatusMessageTest.java
src/test/java/org/vcell/restclient/model/StatusTest.java
src/test/java/org/vcell/restclient/model/UserIdentityJSONSafeTest.java
src/test/java/org/vcell/restclient/model/UserLoginInfoForMappingTest.java
src/test/java/org/vcell/restclient/model/UserRegistrationInfoTest.java
src/test/java/org/vcell/restclient/model/UserTest.java
src/test/java/org/vcell/restclient/model/VCSimulationIdentifierTest.java
src/test/java/org/vcell/restclient/model/VariableDomainTest.java
src/test/java/org/vcell/restclient/model/VariableTypeTest.java
4 changes: 2 additions & 2 deletions vcell-restclient/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -985,15 +985,15 @@ components:
key:
value: 0.8008281904610115
parameterScanType: true
externalDataIDSimRef:
externalDataIDSimRefs:
- value: 0.8008281904610115
- value: 0.8008281904610115
properties:
externalDataIdentifier:
$ref: '#/components/schemas/ExternalDataIdentifier'
externalDataAnnotation:
type: string
externalDataIDSimRef:
externalDataIDSimRefs:
items:
$ref: '#/components/schemas/KeyValue'
type: array
Expand Down
2 changes: 1 addition & 1 deletion vcell-restclient/docs/FieldDataReference.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
|------------ | ------------- | ------------- | -------------|
|**externalDataIdentifier** | [**ExternalDataIdentifier**](ExternalDataIdentifier.md) | | [optional] |
|**externalDataAnnotation** | **String** | | [optional] |
|**externalDataIDSimRef** | [**List&lt;KeyValue&gt;**](KeyValue.md) | | [optional] |
|**externalDataIDSimRefs** | [**List&lt;KeyValue&gt;**](KeyValue.md) | | [optional] |



Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
@JsonPropertyOrder({
FieldDataReference.JSON_PROPERTY_EXTERNAL_DATA_IDENTIFIER,
FieldDataReference.JSON_PROPERTY_EXTERNAL_DATA_ANNOTATION,
FieldDataReference.JSON_PROPERTY_EXTERNAL_DATA_I_D_SIM_REF
FieldDataReference.JSON_PROPERTY_EXTERNAL_DATA_I_D_SIM_REFS
})
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class FieldDataReference {
Expand All @@ -48,8 +48,8 @@ public class FieldDataReference {
public static final String JSON_PROPERTY_EXTERNAL_DATA_ANNOTATION = "externalDataAnnotation";
private String externalDataAnnotation;

public static final String JSON_PROPERTY_EXTERNAL_DATA_I_D_SIM_REF = "externalDataIDSimRef";
private List<KeyValue> externalDataIDSimRef;
public static final String JSON_PROPERTY_EXTERNAL_DATA_I_D_SIM_REFS = "externalDataIDSimRefs";
private List<KeyValue> externalDataIDSimRefs;

public FieldDataReference() {
}
Expand Down Expand Up @@ -104,36 +104,36 @@ public void setExternalDataAnnotation(String externalDataAnnotation) {
}


public FieldDataReference externalDataIDSimRef(List<KeyValue> externalDataIDSimRef) {
this.externalDataIDSimRef = externalDataIDSimRef;
public FieldDataReference externalDataIDSimRefs(List<KeyValue> externalDataIDSimRefs) {
this.externalDataIDSimRefs = externalDataIDSimRefs;
return this;
}

public FieldDataReference addExternalDataIDSimRefItem(KeyValue externalDataIDSimRefItem) {
if (this.externalDataIDSimRef == null) {
this.externalDataIDSimRef = new ArrayList<>();
public FieldDataReference addExternalDataIDSimRefsItem(KeyValue externalDataIDSimRefsItem) {
if (this.externalDataIDSimRefs == null) {
this.externalDataIDSimRefs = new ArrayList<>();
}
this.externalDataIDSimRef.add(externalDataIDSimRefItem);
this.externalDataIDSimRefs.add(externalDataIDSimRefsItem);
return this;
}

/**
* Get externalDataIDSimRef
* @return externalDataIDSimRef
* Get externalDataIDSimRefs
* @return externalDataIDSimRefs
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_EXTERNAL_DATA_I_D_SIM_REF)
@JsonProperty(JSON_PROPERTY_EXTERNAL_DATA_I_D_SIM_REFS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

public List<KeyValue> getExternalDataIDSimRef() {
return externalDataIDSimRef;
public List<KeyValue> getExternalDataIDSimRefs() {
return externalDataIDSimRefs;
}


@JsonProperty(JSON_PROPERTY_EXTERNAL_DATA_I_D_SIM_REF)
@JsonProperty(JSON_PROPERTY_EXTERNAL_DATA_I_D_SIM_REFS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setExternalDataIDSimRef(List<KeyValue> externalDataIDSimRef) {
this.externalDataIDSimRef = externalDataIDSimRef;
public void setExternalDataIDSimRefs(List<KeyValue> externalDataIDSimRefs) {
this.externalDataIDSimRefs = externalDataIDSimRefs;
}


Expand All @@ -151,12 +151,12 @@ public boolean equals(Object o) {
FieldDataReference fieldDataReference = (FieldDataReference) o;
return Objects.equals(this.externalDataIdentifier, fieldDataReference.externalDataIdentifier) &&
Objects.equals(this.externalDataAnnotation, fieldDataReference.externalDataAnnotation) &&
Objects.equals(this.externalDataIDSimRef, fieldDataReference.externalDataIDSimRef);
Objects.equals(this.externalDataIDSimRefs, fieldDataReference.externalDataIDSimRefs);
}

@Override
public int hashCode() {
return Objects.hash(externalDataIdentifier, externalDataAnnotation, externalDataIDSimRef);
return Objects.hash(externalDataIdentifier, externalDataAnnotation, externalDataIDSimRefs);
}

@Override
Expand All @@ -165,7 +165,7 @@ public String toString() {
sb.append("class FieldDataReference {\n");
sb.append(" externalDataIdentifier: ").append(toIndentedString(externalDataIdentifier)).append("\n");
sb.append(" externalDataAnnotation: ").append(toIndentedString(externalDataAnnotation)).append("\n");
sb.append(" externalDataIDSimRef: ").append(toIndentedString(externalDataIDSimRef)).append("\n");
sb.append(" externalDataIDSimRefs: ").append(toIndentedString(externalDataIDSimRefs)).append("\n");
sb.append("}");
return sb.toString();
}
Expand Down Expand Up @@ -223,11 +223,11 @@ public String toUrlQueryString(String prefix) {
joiner.add(String.format("%sexternalDataAnnotation%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getExternalDataAnnotation()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}

// add `externalDataIDSimRef` to the URL query string
if (getExternalDataIDSimRef() != null) {
for (int i = 0; i < getExternalDataIDSimRef().size(); i++) {
if (getExternalDataIDSimRef().get(i) != null) {
joiner.add(getExternalDataIDSimRef().get(i).toUrlQueryString(String.format("%sexternalDataIDSimRef%s%s", prefix, suffix,
// add `externalDataIDSimRefs` to the URL query string
if (getExternalDataIDSimRefs() != null) {
for (int i = 0; i < getExternalDataIDSimRefs().size(); i++) {
if (getExternalDataIDSimRefs().get(i) != null) {
joiner.add(getExternalDataIDSimRefs().get(i).toUrlQueryString(String.format("%sexternalDataIDSimRefs%s%s", prefix, suffix,
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix))));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ import { ExternalDataIdentifier } from './external-data-identifier';
export interface FieldDataReference {
externalDataIdentifier?: ExternalDataIdentifier;
externalDataAnnotation?: string;
externalDataIDSimRef?: Array<KeyValue>;
externalDataIDSimRefs?: Array<KeyValue>;
}

0 comments on commit deba142

Please sign in to comment.