Skip to content
Closed
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
23 changes: 21 additions & 2 deletions src/main/java/com/bandwidth/sdk/model/CallDirectionEnum.java
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is autogenerated and should not be changed manually. These changes will get overwritten the next time the SDK updates. Can you please open an issue on this repo for this fix? That way DevX can create a Jira to track the work done to fix it. I can fix this and hopefully have it ready for our net release on Tuesday.

Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import jakarta.xml.bind.annotation.adapters.XmlAdapter;

/**
* The direction of the call.
Expand All @@ -33,7 +34,7 @@ public enum CallDirectionEnum {

OUTBOUND("outbound");

private String value;
private final String value;

CallDirectionEnum(String value) {
this.value = value;
Expand All @@ -45,7 +46,7 @@ public String getValue() {

@Override
public String toString() {
return String.valueOf(value);
return value;
}

public static CallDirectionEnum fromValue(String value) {
Expand All @@ -70,6 +71,24 @@ public CallDirectionEnum read(final JsonReader jsonReader) throws IOException {
}
}

public static class XMLAdapter extends XmlAdapter<String, CallDirectionEnum> {
@Override
public CallDirectionEnum unmarshal(String v) {
for (CallDirectionEnum e : CallDirectionEnum.values()) {
if (e.toString().equals(v)) {
return e;
}
}
return null;
}

@Override
public String marshal(CallDirectionEnum v) {
return v.toString();
}
}


public static void validateJsonElement(JsonElement jsonElement) throws IOException {
String value = jsonElement.getAsString();
CallDirectionEnum.fromValue(value);
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/bandwidth/sdk/model/bxml/StartStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import com.bandwidth.sdk.model.CallDirectionEnum;

import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Builder.Default;
Expand Down Expand Up @@ -83,6 +84,7 @@ public class StartStream implements Verb {
protected String mode;

@XmlAttribute
@XmlJavaTypeAdapter(CallDirectionEnum.XMLAdapter.class)
@Default
protected CallDirectionEnum tracks = CallDirectionEnum.INBOUND;

Expand Down
Loading