@@ -26,7 +26,7 @@ public final class BandwidthClient implements Configuration {
2626 * Private store for clients.
2727 */
2828 private MessagingClient messagingClient ;
29- private MultiFactorAuthClient multiFactorAuthClient ;
29+ private TwoFactorAuthClient twoFactorAuthClient ;
3030 private VoiceClient voiceClient ;
3131 private WebRtcClient webRtcClient ;
3232
@@ -61,9 +61,9 @@ public final class BandwidthClient implements Configuration {
6161 private MessagingBasicAuthManager messagingBasicAuthManager ;
6262
6363 /**
64- * MultiFactorAuthBasicAuthManager .
64+ * TwoFactorAuthBasicAuthManager .
6565 */
66- private MultiFactorAuthBasicAuthManager multiFactorAuthBasicAuthManager ;
66+ private TwoFactorAuthBasicAuthManager twoFactorAuthBasicAuthManager ;
6767
6868 /**
6969 * VoiceBasicAuthManager.
@@ -88,7 +88,7 @@ public final class BandwidthClient implements Configuration {
8888 private BandwidthClient (Environment environment , String baseUrl , HttpClient httpClient ,
8989 long timeout , ReadonlyHttpClientConfiguration httpClientConfig ,
9090 String messagingBasicAuthUserName , String messagingBasicAuthPassword ,
91- String multiFactorAuthBasicAuthUserName , String multiFactorAuthBasicAuthPassword ,
91+ String twoFactorAuthBasicAuthUserName , String twoFactorAuthBasicAuthPassword ,
9292 String voiceBasicAuthUserName , String voiceBasicAuthPassword ,
9393 String webRtcBasicAuthUserName , String webRtcBasicAuthPassword ,
9494 Map <String , AuthManager > authManagers , HttpCallback httpCallback ) {
@@ -113,17 +113,17 @@ private BandwidthClient(Environment environment, String baseUrl, HttpClient http
113113 this .authManagers .put ("messaging" , messagingBasicAuthManager );
114114 }
115115
116- if (this .authManagers .containsKey ("multiFactorAuth " )) {
117- this .multiFactorAuthBasicAuthManager =
118- (MultiFactorAuthBasicAuthManager ) this .authManagers .get ("multiFactorAuth " );
116+ if (this .authManagers .containsKey ("twoFactorAuth " )) {
117+ this .twoFactorAuthBasicAuthManager =
118+ (TwoFactorAuthBasicAuthManager ) this .authManagers .get ("twoFactorAuth " );
119119 }
120120
121- if (!this .authManagers .containsKey ("multiFactorAuth " )
122- || !getMultiFactorAuthBasicAuthCredentials ().equals (
123- multiFactorAuthBasicAuthUserName , multiFactorAuthBasicAuthPassword )) {
124- this .multiFactorAuthBasicAuthManager = new MultiFactorAuthBasicAuthManager (
125- multiFactorAuthBasicAuthUserName , multiFactorAuthBasicAuthPassword );
126- this .authManagers .put ("multiFactorAuth " , multiFactorAuthBasicAuthManager );
121+ if (!this .authManagers .containsKey ("twoFactorAuth " )
122+ || !getTwoFactorAuthBasicAuthCredentials ().equals (twoFactorAuthBasicAuthUserName ,
123+ twoFactorAuthBasicAuthPassword )) {
124+ this .twoFactorAuthBasicAuthManager = new TwoFactorAuthBasicAuthManager (
125+ twoFactorAuthBasicAuthUserName , twoFactorAuthBasicAuthPassword );
126+ this .authManagers .put ("twoFactorAuth " , twoFactorAuthBasicAuthManager );
127127 }
128128
129129 if (this .authManagers .containsKey ("voice" )) {
@@ -152,7 +152,7 @@ private BandwidthClient(Environment environment, String baseUrl, HttpClient http
152152
153153
154154 messagingClient = new MessagingClient (this );
155- multiFactorAuthClient = new MultiFactorAuthClient (this );
155+ twoFactorAuthClient = new TwoFactorAuthClient (this );
156156 voiceClient = new VoiceClient (this );
157157 webRtcClient = new WebRtcClient (this );
158158 }
@@ -173,11 +173,11 @@ public MessagingClient getMessagingClient() {
173173 }
174174
175175 /**
176- * Provides access to multiFactorAuthClient Client.
177- * @return Returns the MultiFactorAuthClient instance
176+ * Provides access to twoFactorAuthClient Client.
177+ * @return Returns the TwoFactorAuthClient instance
178178 */
179- public MultiFactorAuthClient getMultiFactorAuthClient () {
180- return multiFactorAuthClient ;
179+ public TwoFactorAuthClient getTwoFactorAuthClient () {
180+ return twoFactorAuthClient ;
181181 }
182182
183183 /**
@@ -245,11 +245,11 @@ public MessagingBasicAuthCredentials getMessagingBasicAuthCredentials() {
245245 }
246246
247247 /**
248- * The credentials to use with MultiFactorAuthBasicAuth .
249- * @return multiFactorAuthBasicAuthCredentials
248+ * The credentials to use with TwoFactorAuthBasicAuth .
249+ * @return twoFactorAuthBasicAuthCredentials
250250 */
251- public MultiFactorAuthBasicAuthCredentials getMultiFactorAuthBasicAuthCredentials () {
252- return multiFactorAuthBasicAuthManager ;
251+ public TwoFactorAuthBasicAuthCredentials getTwoFactorAuthBasicAuthCredentials () {
252+ return twoFactorAuthBasicAuthManager ;
253253 }
254254
255255 /**
@@ -312,7 +312,7 @@ private static String environmentMapper(Environment environment, Server server)
312312 if (server .equals (Server .MESSAGINGDEFAULT )) {
313313 return "https://messaging.bandwidth.com/api/v2" ;
314314 }
315- if (server .equals (Server .MULTIFACTORAUTHDEFAULT )) {
315+ if (server .equals (Server .TWOFACTORAUTHDEFAULT )) {
316316 return "https://mfa.bandwidth.com/api/v1" ;
317317 }
318318 if (server .equals (Server .VOICEDEFAULT )) {
@@ -329,7 +329,7 @@ private static String environmentMapper(Environment environment, Server server)
329329 if (server .equals (Server .MESSAGINGDEFAULT )) {
330330 return "{base_url}" ;
331331 }
332- if (server .equals (Server .MULTIFACTORAUTHDEFAULT )) {
332+ if (server .equals (Server .TWOFACTORAUTHDEFAULT )) {
333333 return "{base_url}" ;
334334 }
335335 if (server .equals (Server .VOICEDEFAULT )) {
@@ -367,10 +367,10 @@ public Builder newBuilder() {
367367 getMessagingBasicAuthCredentials ().getBasicAuthUserName ();
368368 builder .messagingBasicAuthPassword =
369369 getMessagingBasicAuthCredentials ().getBasicAuthPassword ();
370- builder .multiFactorAuthBasicAuthUserName =
371- getMultiFactorAuthBasicAuthCredentials ().getBasicAuthUserName ();
372- builder .multiFactorAuthBasicAuthPassword =
373- getMultiFactorAuthBasicAuthCredentials ().getBasicAuthPassword ();
370+ builder .twoFactorAuthBasicAuthUserName =
371+ getTwoFactorAuthBasicAuthCredentials ().getBasicAuthUserName ();
372+ builder .twoFactorAuthBasicAuthPassword =
373+ getTwoFactorAuthBasicAuthCredentials ().getBasicAuthPassword ();
374374 builder .voiceBasicAuthUserName = getVoiceBasicAuthCredentials ().getBasicAuthUserName ();
375375 builder .voiceBasicAuthPassword = getVoiceBasicAuthCredentials ().getBasicAuthPassword ();
376376 builder .webRtcBasicAuthUserName = getWebRtcBasicAuthCredentials ().getBasicAuthUserName ();
@@ -391,8 +391,8 @@ public static class Builder {
391391 private long timeout = 0 ;
392392 private String messagingBasicAuthUserName = "TODO: Replace" ;
393393 private String messagingBasicAuthPassword = "TODO: Replace" ;
394- private String multiFactorAuthBasicAuthUserName = "TODO: Replace" ;
395- private String multiFactorAuthBasicAuthPassword = "TODO: Replace" ;
394+ private String twoFactorAuthBasicAuthUserName = "TODO: Replace" ;
395+ private String twoFactorAuthBasicAuthPassword = "TODO: Replace" ;
396396 private String voiceBasicAuthUserName = "TODO: Replace" ;
397397 private String voiceBasicAuthPassword = "TODO: Replace" ;
398398 private String webRtcBasicAuthUserName = "TODO: Replace" ;
@@ -421,21 +421,21 @@ public Builder messagingBasicAuthCredentials(String basicAuthUserName,
421421 }
422422
423423 /**
424- * Credentials setter for MultiFactorAuthBasicAuth .
425- * @param basicAuthUserName String value for multiFactorAuthBasicAuthUserName .
426- * @param basicAuthPassword String value for multiFactorAuthBasicAuthPassword .
424+ * Credentials setter for TwoFactorAuthBasicAuth .
425+ * @param basicAuthUserName String value for twoFactorAuthBasicAuthUserName .
426+ * @param basicAuthPassword String value for twoFactorAuthBasicAuthPassword .
427427 * @return Builder
428428 */
429- public Builder multiFactorAuthBasicAuthCredentials (String basicAuthUserName ,
429+ public Builder twoFactorAuthBasicAuthCredentials (String basicAuthUserName ,
430430 String basicAuthPassword ) {
431431 if (basicAuthUserName == null ) {
432432 throw new NullPointerException ("BasicAuthUserName cannot be null." );
433433 }
434434 if (basicAuthPassword == null ) {
435435 throw new NullPointerException ("BasicAuthPassword cannot be null." );
436436 }
437- this .multiFactorAuthBasicAuthUserName = basicAuthUserName ;
438- this .multiFactorAuthBasicAuthPassword = basicAuthPassword ;
437+ this .twoFactorAuthBasicAuthUserName = basicAuthUserName ;
438+ this .twoFactorAuthBasicAuthPassword = basicAuthPassword ;
439439 return this ;
440440 }
441441
@@ -535,7 +535,7 @@ public BandwidthClient build() {
535535
536536 return new BandwidthClient (environment , baseUrl , httpClient , timeout , httpClientConfig ,
537537 messagingBasicAuthUserName , messagingBasicAuthPassword ,
538- multiFactorAuthBasicAuthUserName , multiFactorAuthBasicAuthPassword ,
538+ twoFactorAuthBasicAuthUserName , twoFactorAuthBasicAuthPassword ,
539539 voiceBasicAuthUserName , voiceBasicAuthPassword , webRtcBasicAuthUserName ,
540540 webRtcBasicAuthPassword , authManagers , httpCallback );
541541 }
0 commit comments