Skip to content

Commit 89cf16c

Browse files
Merge pull request #30 from thingsboard/auto/update-pe-client
Update PE OpenAPI spec (from master)
2 parents e0174eb + e52a869 commit 89cf16c

File tree

3 files changed

+61
-3
lines changed

3 files changed

+61
-3
lines changed

pe/docs/SolutionImportResult.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Result of a solution import operation.
1111
|------------ | ------------- | ------------- | -------------|
1212
| **success** | **Boolean** | 'true' if all entities were imported successfully. | [optional] |
1313
| **created** | **Map\<String, Integer\>** | Number of newly created entities per entity type. Entity types with zero created entities are omitted. | [optional] |
14+
| **idMapping** | **Map\<String, UUID\>** | Mapping from external entity IDs (as they appear in the solution file) to the internal entity IDs assigned during import. | [optional] |
1415

1516

1617

pe/spec/openapi.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137256,6 +137256,14 @@
137256137256
"DEVICE_PROFILE": 1,
137257137257
"DEVICE": 3
137258137258
}
137259+
},
137260+
"idMapping": {
137261+
"type": "object",
137262+
"additionalProperties": {
137263+
"type": "string",
137264+
"format": "uuid"
137265+
},
137266+
"description": "Mapping from external entity IDs (as they appear in the solution file) to the internal entity IDs assigned during import."
137259137267
}
137260137268
}
137261137269
},

pe/src/main/java/org/thingsboard/client/model/SolutionImportResult.java

Lines changed: 52 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import java.util.Arrays;
3232
import java.util.HashMap;
3333
import java.util.Map;
34+
import java.util.UUID;
3435
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
3536

3637

@@ -40,7 +41,8 @@
4041
*/
4142
@JsonPropertyOrder({
4243
SolutionImportResult.JSON_PROPERTY_SUCCESS,
43-
SolutionImportResult.JSON_PROPERTY_CREATED
44+
SolutionImportResult.JSON_PROPERTY_CREATED,
45+
SolutionImportResult.JSON_PROPERTY_ID_MAPPING
4446
})
4547
@Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.20.0")
4648
public class SolutionImportResult {
@@ -52,6 +54,10 @@ public class SolutionImportResult {
5254
@Nullable
5355
private Map<String, Integer> created = new HashMap<>();
5456

57+
public static final String JSON_PROPERTY_ID_MAPPING = "idMapping";
58+
@Nullable
59+
private Map<String, UUID> idMapping = new HashMap<>();
60+
5561
public SolutionImportResult() {
5662
}
5763

@@ -111,6 +117,38 @@ public void setCreated(@Nullable Map<String, Integer> created) {
111117
}
112118

113119

120+
public SolutionImportResult idMapping(@Nullable Map<String, UUID> idMapping) {
121+
this.idMapping = idMapping;
122+
return this;
123+
}
124+
125+
public SolutionImportResult putIdMappingItem(String key, UUID idMappingItem) {
126+
if (this.idMapping == null) {
127+
this.idMapping = new HashMap<>();
128+
}
129+
this.idMapping.put(key, idMappingItem);
130+
return this;
131+
}
132+
133+
/**
134+
* Mapping from external entity IDs (as they appear in the solution file) to the internal entity IDs assigned during import.
135+
* @return idMapping
136+
*/
137+
@Nullable
138+
@JsonProperty(value = JSON_PROPERTY_ID_MAPPING, required = false)
139+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
140+
public Map<String, UUID> getIdMapping() {
141+
return idMapping;
142+
}
143+
144+
145+
@JsonProperty(value = JSON_PROPERTY_ID_MAPPING, required = false)
146+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
147+
public void setIdMapping(@Nullable Map<String, UUID> idMapping) {
148+
this.idMapping = idMapping;
149+
}
150+
151+
114152
/**
115153
* Return true if this SolutionImportResult object is equal to o.
116154
*/
@@ -124,12 +162,13 @@ public boolean equals(Object o) {
124162
}
125163
SolutionImportResult solutionImportResult = (SolutionImportResult) o;
126164
return Objects.equals(this.success, solutionImportResult.success) &&
127-
Objects.equals(this.created, solutionImportResult.created);
165+
Objects.equals(this.created, solutionImportResult.created) &&
166+
Objects.equals(this.idMapping, solutionImportResult.idMapping);
128167
}
129168

130169
@Override
131170
public int hashCode() {
132-
return Objects.hash(success, created);
171+
return Objects.hash(success, created, idMapping);
133172
}
134173

135174
@Override
@@ -138,6 +177,7 @@ public String toString() {
138177
sb.append("class SolutionImportResult {\n");
139178
sb.append(" success: ").append(toIndentedString(success)).append("\n");
140179
sb.append(" created: ").append(toIndentedString(created)).append("\n");
180+
sb.append(" idMapping: ").append(toIndentedString(idMapping)).append("\n");
141181
sb.append("}");
142182
return sb.toString();
143183
}
@@ -199,6 +239,15 @@ public String toUrlQueryString(String prefix) {
199239
}
200240
}
201241

242+
// add `idMapping` to the URL query string
243+
if (getIdMapping() != null) {
244+
for (String _key : getIdMapping().keySet()) {
245+
joiner.add(String.format(java.util.Locale.ROOT, "%sidMapping%s%s=%s", prefix, suffix,
246+
"".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix),
247+
getIdMapping().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getIdMapping().get(_key)))));
248+
}
249+
}
250+
202251
return joiner.toString();
203252
}
204253
}

0 commit comments

Comments
 (0)