@@ -82,6 +82,10 @@ public class ApiContext implements java.io.Serializable {
82
82
@ SerializedName ("session_context" )
83
83
private SessionContext sessionContext ;
84
84
85
+ @ Expose
86
+ @ SerializedName ("proxy" )
87
+ private String proxy ;
88
+
85
89
/**
86
90
* Create an empty API context.
87
91
*/
@@ -91,19 +95,36 @@ private ApiContext(ApiEnvironmentType environmentType, String apiKey) {
91
95
}
92
96
93
97
/**
94
- * Create and initialize an API Context with current IP as permitted.
98
+ * Create and initialize an API Context with current IP as permitted and no proxy .
95
99
*/
96
100
public static ApiContext create (ApiEnvironmentType environmentType , String apiKey ,
97
101
String deviceDescription ) {
98
102
return create (environmentType , apiKey , deviceDescription , new ArrayList <>());
99
103
}
100
104
101
105
/**
102
- * Create and initialize an API Context.
106
+ * Create and initialize an API Context with given permitted ips and no proxy .
103
107
*/
104
108
public static ApiContext create (ApiEnvironmentType environmentType , String apiKey ,
105
109
String deviceDescription , List <String > permittedIps ) {
110
+ return create (environmentType , apiKey , deviceDescription , permittedIps , null );
111
+ }
112
+
113
+ /**
114
+ * Create and initialize an API Context with current IP as permitted and a proxy.
115
+ */
116
+ public static ApiContext create (ApiEnvironmentType environmentType , String apiKey ,
117
+ String deviceDescription , String proxy ) {
118
+ return create (environmentType , apiKey , deviceDescription , new ArrayList <>(), proxy );
119
+ }
120
+
121
+ /**
122
+ * Create and initialize an API Context.
123
+ */
124
+ public static ApiContext create (ApiEnvironmentType environmentType , String apiKey ,
125
+ String deviceDescription , List <String > permittedIps , String proxy ) {
106
126
ApiContext apiContext = new ApiContext (environmentType , apiKey );
127
+ apiContext .proxy = proxy ;
107
128
apiContext .initialize (deviceDescription , permittedIps );
108
129
109
130
return apiContext ;
@@ -289,4 +310,8 @@ public SessionContext getSessionContext() {
289
310
return sessionContext ;
290
311
}
291
312
313
+ public String getProxy () {
314
+ return proxy ;
315
+ }
316
+
292
317
}
0 commit comments