Skip to content

Commit e0056cd

Browse files
authored
Remove unnecessary code (Azure#37455)
* Remove unnecessary code * Fix getValue * Remove other classes * Remove all Item classes * Removed Request models
1 parent 3fa4662 commit e0056cd

File tree

15 files changed

+15
-871
lines changed

15 files changed

+15
-871
lines changed

sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/converters/JobAdapter.java

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ public class JobAdapter {
2626
public static RouterJob convertCreateJobOptionsToRouterJob(CreateJobOptions createJobOptions) {
2727
Map<String, LabelValue> labelValueMap = createJobOptions.getLabels();
2828
Map<String, Object> labels = labelValueMap != null ? labelValueMap.entrySet().stream()
29-
.collect(Collectors.toMap(Map.Entry::getKey, entry -> entry.getValue().getValue())) : null;
29+
.collect(Collectors.toMap(entry -> entry.getKey(), entry -> getValue(entry.getValue()))) : null;
3030
Map<String, LabelValue> tagValueMap = createJobOptions.getLabels();
3131
Map<String, Object> tags = tagValueMap != null ? tagValueMap.entrySet().stream()
32-
.collect(Collectors.toMap(Map.Entry::getKey, entry -> entry.getValue().getValue())) : null;
32+
.collect(Collectors.toMap(entry -> entry.getKey(), entry -> getValue(entry.getValue()))) : null;
3333
List<RouterWorkerSelector> workerSelectors = createJobOptions.getRequestedWorkerSelectors();
3434
List<RouterJobNote> jobNotes = createJobOptions.getNotes();
3535

@@ -45,4 +45,17 @@ public static RouterJob convertCreateJobOptionsToRouterJob(CreateJobOptions crea
4545
.setTags(tags)
4646
.setMatchingMode(createJobOptions.getMatchingMode());
4747
}
48+
49+
private static Object getValue(LabelValue labelValue) {
50+
if (labelValue.getValueAsBoolean()) {
51+
return labelValue.getValueAsBoolean();
52+
} else if (labelValue.getValueAsDouble() != null) {
53+
return labelValue.getValueAsDouble();
54+
} else if (labelValue.getValueAsInteger() != null) {
55+
return labelValue.getValueAsInteger();
56+
} else if (labelValue.getValueAsString() != null) {
57+
return labelValue.getValueAsString();
58+
}
59+
return null;
60+
}
4861
}

sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/CancelJobRequest.java

Lines changed: 0 additions & 82 deletions
This file was deleted.

sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ClassificationPolicyItem.java

Lines changed: 0 additions & 63 deletions
This file was deleted.

sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/CloseJobRequest.java

Lines changed: 0 additions & 143 deletions
This file was deleted.

sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/CompleteJobRequest.java

Lines changed: 0 additions & 74 deletions
This file was deleted.

0 commit comments

Comments
 (0)