Skip to content

Commit c60bf33

Browse files
committed
Merge branch 'VCSWP-10950' into 'master'
VCSWP-10945: Add Privacy mode option See merge request vail-cloud-services/fc-boilerplates/java-sdk!2
2 parents 45e01bf + d1322f6 commit c60bf33

File tree

15 files changed

+149
-1
lines changed

15 files changed

+149
-1
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ group = 'com.github.FreeClimbAPI'
99

1010
sourceCompatibility = 1.7 // java 7
1111
targetCompatibility = 1.7
12-
version = '3.0.0'
12+
version = '3.0.1'
1313

1414
repositories {
1515
mavenCentral()

src/main/java/com/vailsys/freeclimb/api/call/CallOptions.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ public class CallOptions {
3131
*/
3232
private String parentCallId;
3333

34+
/**
35+
* Parameter privacyMode will not log the text as required by PCI compliance.
36+
*/
37+
private Boolean privacyMode;
38+
3439
/**
3540
* Create an empty {@code CallOptions} object. Set only values that are desired
3641
* to be included in the request. Any unset fields will be ignored.
@@ -40,6 +45,7 @@ public CallOptions() {
4045
ifMachine = null;
4146
timeout = null;
4247
parentCallId = null;
48+
privacyMode = null;
4349
}
4450

4551
/**
@@ -78,6 +84,15 @@ public void setParentCallId(String parentCallId) {
7884
this.parentCallId = parentCallId;
7985
}
8086

87+
/**
88+
* Sets the privacyMode field.
89+
*
90+
* @param privacyMode Value to which to set privacyMode.
91+
*/
92+
public void setPrivacyMode(Boolean privacyMode) {
93+
this.privacyMode = privacyMode;
94+
}
95+
8196
/**
8297
* Retrieve the sendDigits value.
8398
*
@@ -116,4 +131,13 @@ public String getParentCallId() {
116131
return this.parentCallId;
117132
}
118133

134+
/**
135+
* Retrieve the privacyMode value.
136+
*
137+
* @return The privacyMode value of the object.
138+
*/
139+
public Boolean getPrivacyMode() {
140+
return this.privacyMode;
141+
}
142+
119143
}

src/main/java/com/vailsys/freeclimb/percl/GetDigits.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public class GetDigits extends PerCLCommand {
1616
private Integer maxDigits;
1717
private Boolean flushBuffer;
1818
private LinkedList<GetDigitsNestable> prompts;
19+
private Boolean privacyMode;
1920

2021
public GetDigits(String actionUrl) {
2122
this.setActionUrl(actionUrl);
@@ -57,6 +58,10 @@ public LinkedList<GetDigitsNestable> getPrompts() {
5758
return this.prompts;
5859
}
5960

61+
public Boolean getPrivacyMode() {
62+
return this.privacyMode;
63+
}
64+
6065
public void setActionUrl(String actionUrl) {
6166
this.actionUrl = actionUrl;
6267
}
@@ -92,4 +97,8 @@ public void setFlushBuffer(Boolean flushBuffer) {
9297
public void setPrompts(LinkedList<GetDigitsNestable> prompts) {
9398
this.prompts = prompts;
9499
}
100+
101+
public void setPrivacyMode(Boolean privacyMode) {
102+
this.privacyMode = privacyMode;
103+
}
95104
}

src/main/java/com/vailsys/freeclimb/percl/GetSpeech.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public class GetSpeech extends PerCLCommand {
1616
private Integer speechCompleteTimeoutMs;
1717
private Integer speechIncompleteTimeoutMs;
1818
private LinkedList<GetSpeechNestable> prompts;
19+
private Boolean privacyMode;
1920

2021
public GetSpeech(String actionUrl, String grammarFile) {
2122
this.setActionUrl(actionUrl);
@@ -74,6 +75,10 @@ public LinkedList<GetSpeechNestable> getPrompts() {
7475
return this.prompts;
7576
}
7677

78+
public Boolean getPrivacyMode() {
79+
return this.privacyMode;
80+
}
81+
7782
public void setActionUrl(String actionUrl) {
7883
this.actionUrl = actionUrl;
7984
}
@@ -125,4 +130,8 @@ public void setSpeechIncompleteTimeoutMs(Integer speechIncompleteTimeoutMs) {
125130
public void setPrompts(LinkedList<GetSpeechNestable> prompts) {
126131
this.prompts = prompts;
127132
}
133+
134+
public void setPrivacyMode(Boolean privacyMode) {
135+
this.privacyMode = privacyMode;
136+
}
128137
}

src/main/java/com/vailsys/freeclimb/percl/OutDial.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ public class OutDial extends PerCLCommand {
1111
private OutDialIfMachine ifMachine;
1212
private String ifMachineUrl;
1313
private String statusCallbackUrl;
14+
private Boolean privacyMode;
1415

1516
public OutDial(String destination, String callingNumber, String actionUrl, String callConnectUrl) {
1617
this.setDestination(destination);
@@ -55,6 +56,10 @@ public String getStatusCallbackUrl() {
5556
return this.statusCallbackUrl;
5657
}
5758

59+
public Boolean getPrivacyMode() {
60+
return this.privacyMode;
61+
}
62+
5863
public void setDestination(String destination) {
5964
this.destination = destination;
6065
}
@@ -91,4 +96,7 @@ public void setStatusCallbackUrl(String statusCallbackUrl) {
9196
this.statusCallbackUrl = statusCallbackUrl;
9297
}
9398

99+
public void setPrivacyMode(Boolean privacyMode) {
100+
this.privacyMode = privacyMode;
101+
}
94102
}

src/main/java/com/vailsys/freeclimb/percl/Play.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ public class Play extends PerCLCommand implements GetDigitsNestable, GetSpeechNe
44
private String file;
55
private Integer loop;
66
private String conferenceId;
7+
private Boolean privacyMode;
78

89
public Play(String file) {
910
this.setFile(file);
@@ -21,6 +22,10 @@ public String getConferenceId() {
2122
return this.conferenceId;
2223
}
2324

25+
public Boolean getPrivacyMode() {
26+
return this.privacyMode;
27+
}
28+
2429
public void setFile(String file) {
2530
this.file = file;
2631
}
@@ -32,4 +37,8 @@ public void setLoop(Integer loop) {
3237
public void setConferenceId(String conferenceId) {
3338
this.conferenceId = conferenceId;
3439
}
40+
41+
public void setPrivacyMode(Boolean privacyMode) {
42+
this.privacyMode = privacyMode;
43+
}
3544
}

src/main/java/com/vailsys/freeclimb/percl/Say.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ public class Say extends PerCLCommand implements GetDigitsNestable, GetSpeechNes
55
private String language;
66
private Integer loop;
77
private String conferenceId;
8+
private Boolean privacyMode;
89

910
public Say(String text) {
1011
this.setText(text);
@@ -26,6 +27,10 @@ public String getConferenceId() {
2627
return this.conferenceId;
2728
}
2829

30+
public Boolean getPrivacyMode() {
31+
return this.privacyMode;
32+
}
33+
2934
public void setText(String text) {
3035
this.text = text;
3136
}
@@ -41,4 +46,8 @@ public void setLoop(Integer loop) {
4146
public void setConferenceId(String conferenceId) {
4247
this.conferenceId = conferenceId;
4348
}
49+
50+
public void setPrivacyMode(Boolean privacyMode) {
51+
this.privacyMode = privacyMode;
52+
}
4453
}

src/main/java/com/vailsys/freeclimb/percl/SendDigits.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ public class SendDigits extends PerCLCommand {
88

99
private String digits;
1010
private Integer pauseMs;
11+
private Boolean privacyMode;
1112

1213
public SendDigits(String digits) {
1314
this.setDigits(digits);
@@ -21,11 +22,19 @@ public Integer getPauseMs() {
2122
return this.pauseMs;
2223
}
2324

25+
public Boolean getPrivacyMode() {
26+
return this.privacyMode;
27+
}
28+
2429
public void setDigits(String digits) {
2530
this.digits = digits;
2631
}
2732

2833
public void setPauseMs(Integer pauseMs) {
2934
this.pauseMs = pauseMs;
3035
}
36+
37+
public void setPrivacyMode(Boolean privacyMode) {
38+
this.privacyMode = privacyMode;
39+
}
3140
}

src/test/java/com/vailsys/freeclimb/api/call/CallOptionsTest.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public void checkFieldsAreNull() {
3535
assertThat(this.options.getSendDigits(), nullValue());
3636
assertThat(this.options.getIfMachine(), nullValue());
3737
assertThat(this.options.getTimeout(), nullValue());
38+
assertThat(this.options.getPrivacyMode(), nullValue());
3839
}
3940

4041
@Then("^check that setSendDigits\\(\\) and getSendDigits\\(\\) are setting and retrieving the correct value.$")
@@ -64,4 +65,10 @@ public void checkSetGetParentCallId() {
6465
this.options.setParentCallId(parentCallId);
6566
assertThat(this.options.getParentCallId(), is(parentCallId));
6667
}
68+
69+
@Then("^check that setPrivacyMode and getPrivacyMode are setting and retrieving the correct value.$")
70+
public void checkSetGetPrivacyMode() {
71+
this.options.setPrivacyMode(true);
72+
assertThat(this.options.getPrivacyMode(), is(true));
73+
}
6774
}

src/test/java/com/vailsys/freeclimb/percl/GetDigitsTest.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public void checkAllAreNull() {
2929
assertThat(this.command.getMaxDigits(), nullValue());
3030
assertThat(this.command.getFlushBuffer(), nullValue());
3131
assertThat(this.command.getPrompts(), nullValue());
32+
assertThat(this.command.getPrivacyMode(), nullValue());
3233
}
3334

3435
@Then("^set GetDigits actionUrl to (.*)$")
@@ -81,6 +82,11 @@ public void setPromptsFull(){
8182
this.command.setPrompts(prompts);
8283
}
8384

85+
@Then("^set GetDigits privacyMode to (true|false)$")
86+
public void setPrivacyMode(Boolean privacyMode) {
87+
this.command.setPrivacyMode(privacyMode);
88+
}
89+
8490
@Then("^check that actionUrl equals (.*) in GetDigits object$")
8591
public void getActionUrl(String actionUrl) {
8692
assertThat(this.command.getActionUrl(), is(actionUrl));
@@ -126,4 +132,9 @@ public void checkSerialize(){
126132
String serialized = this.command.toJson();
127133
assertThat(serialized, is("{\"GetDigits\":{\"actionUrl\":\"http://action.url/end/point\",\"prompts\":[{\"Say\":{\"text\":\"test\"}},{\"Pause\":{\"length\":100}}]}}"));
128134
}
135+
136+
@Then("^check that privacyMode equals (true|false) in GetDigits objects$")
137+
public void getPrivacyMode(Boolean privacyMode) {
138+
assertThat(this.command.getPrivacyMode(), is(privacyMode));
139+
}
129140
}

0 commit comments

Comments
 (0)