@@ -42,8 +42,7 @@ public class Contentstack {
4242 protected User user ;
4343
4444 /**
45- * All accounts registered with Contentstack are known as Users. A stack can
46- * have many users with varying
45+ * All accounts registered with Contentstack are known as Users. A stack can have many users with varying
4746 * permissions and roles
4847 * <p>
4948 * To perform User operations first get User instance like below.
@@ -75,14 +74,12 @@ public User user() {
7574
7675 /**
7776 * <b>[Note]:</b> Before executing any calls, retrieve the authtoken by
78- * authenticating yourself via the Log in call of User Session. The authtoken is
79- * returned to the 'Response' body of
77+ * authenticating yourself via the Log in call of User Session. The authtoken is returned to the 'Response' body of
8078 * the Log in call and is mandatory in all the calls.
8179 * <p>
8280 * <b>Example:</b>
8381 * <p>
84- * All accounts registered with Contentstack are known as Users. A stack can
85- * have many users with varying
82+ * All accounts registered with Contentstack are known as Users. A stack can have many users with varying
8683 * permissions and roles
8784 * <p>
8885 * To perform User operations first get User instance like below.
@@ -106,12 +103,12 @@ public User user() {
106103 * <p>
107104 *
108105 * @param emailId
109- * the email id
106+ * the email id
110107 * @param password
111- * the password
108+ * the password
112109 * @return response the Response type of @{@link LoginDetails}
113110 * @throws IOException
114- * the io exception
111+ * the io exception
115112 */
116113 public Response <LoginDetails > login (String emailId , String password ) throws IOException {
117114 if (this .authtoken != null )
@@ -124,14 +121,12 @@ public Response<LoginDetails> login(String emailId, String password) throws IOEx
124121
125122 /**
126123 * <b>[Note]:</b> Before executing any calls, retrieve the authtoken by
127- * authenticating yourself via the Log in call of User Session. The authtoken is
128- * returned to the 'Response' body of
124+ * authenticating yourself via the Log in call of User Session. The authtoken is returned to the 'Response' body of
129125 * the Log in call and is mandatory in all the calls.
130126 * <p>
131127 * <b>Example:</b>
132128 * <p>
133- * All accounts registered with Contentstack are known as Users. A stack can
134- * have many users with varying
129+ * All accounts registered with Contentstack are known as Users. A stack can have many users with varying
135130 * permissions and roles
136131 * <p>
137132 * To perform User operations first get User instance like below.
@@ -155,15 +150,14 @@ public Response<LoginDetails> login(String emailId, String password) throws IOEx
155150 * <p>
156151 *
157152 * @param emailId
158- * the email id
153+ * the email id
159154 * @param password
160- * the password
155+ * the password
161156 * @param tfaToken
162- * the tfa token
163- * @return response the Response type of @{@link LoginDetails} throws
164- * {@link IOException}
157+ * the tfa token
158+ * @return response the Response type of @{@link LoginDetails} throws {@link IOException}
165159 * @throws IOException
166- * the io exception
160+ * the io exception
167161 */
168162 public Response <LoginDetails > login (String emailId , String password , String tfaToken ) throws IOException {
169163 if (this .authtoken != null )
@@ -189,8 +183,7 @@ private void setupLoginCredentials(Response<LoginDetails> loginResponse) throws
189183 }
190184
191185 /**
192- * The Log out of your account call is used to sign out the user of Contentstack
193- * account
186+ * The Log out of your account call is used to sign out the user of Contentstack account
194187 *
195188 * <b> Example </b>
196189 *
@@ -202,16 +195,15 @@ private void setupLoginCredentials(Response<LoginDetails> loginResponse) throws
202195 *
203196 * @return the response
204197 * @throws IOException
205- * the io exception
198+ * the io exception
206199 */
207200 Response <ResponseBody > logout () throws IOException {
208201 user = new User (this .instance );
209202 return user .logoutWithAuthtoken (this .authtoken ).execute ();
210203 }
211204
212205 /**
213- * The Log out of your account using authtoken is used to sign out the user of
214- * Contentstack account
206+ * The Log out of your account using authtoken is used to sign out the user of Contentstack account
215207 *
216208 * <b> Example </b>
217209 *
@@ -222,10 +214,10 @@ Response<ResponseBody> logout() throws IOException {
222214 * <p>
223215 *
224216 * @param authtoken
225- * the authtoken
217+ * the authtoken
226218 * @return the response
227219 * @throws IOException
228- * the io exception
220+ * the io exception
229221 */
230222 Response <ResponseBody > logoutWithAuthtoken (String authtoken ) throws IOException {
231223 user = new User (this .instance );
@@ -237,10 +229,8 @@ Response<ResponseBody> logoutWithAuthtoken(String authtoken) throws IOException
237229 }
238230
239231 /**
240- * Organization is the top-level entity in the hierarchy of Contentstack,
241- * consisting of stacks and stack resources,
242- * and users. Organization allows easy management of projects as well as users
243- * within the Organization.
232+ * Organization is the top-level entity in the hierarchy of Contentstack, consisting of stacks and stack resources,
233+ * and users. Organization allows easy management of projects as well as users within the Organization.
244234 *
245235 * <b> Example </b>
246236 *
@@ -286,8 +276,10 @@ public Stack stack() {
286276 * <b> Example </b>
287277 *
288278 * <pre>
279+ * ```
289280 * Contentstack client = new Contentstack.Builder().build();
290281 * Stack org = client.stack();
282+ * ```
291283 * </pre>
292284 *
293285 * @param header
@@ -345,7 +337,7 @@ public Stack stack(@NotNull String apiKey, @NotNull String managementToken) {
345337 * @param apiKey
346338 * the apiKey for the stack
347339 * @param branch
348- * the branch that include branching in the response
340+ * the branch that include branching in the response
349341 * @return the stack instance
350342 */
351343 public Stack stack (@ NotNull String apiKey , @ NotNull String managementToken , @ NotNull String branch ) {
@@ -399,20 +391,17 @@ public static class Builder {
399391 * Instantiates a new Builder.
400392 */
401393 public Builder () {
402- // Builder constructor initialises the Builder class.
403394 }
404395
405396 /**
406- * Sets proxy. (Setting proxy to the OkHttpClient) Proxy proxy = new
407- * Proxy(Proxy.Type.HTTP, new
397+ * Sets proxy. (Setting proxy to the OkHttpClient) Proxy proxy = new Proxy(Proxy.Type.HTTP, new
408398 * InetSocketAddress(proxyHost, proxyPort));
409399 * <p>
410- * Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("hostname",
411- * 433)); Contentstack contentstack =
400+ * Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("hostname", 433)); Contentstack contentstack =
412401 * new Contentstack.Builder().setProxy(proxy).build();
413402 *
414403 * @param proxy
415- * the proxy
404+ * the proxy
416405 * @return the Builder instance
417406 */
418407 public Builder setProxy (@ NotNull Proxy proxy ) {
@@ -424,7 +413,7 @@ public Builder setProxy(@NotNull Proxy proxy) {
424413 * Sets retry on failure.
425414 *
426415 * @param retry
427- * if retry is true
416+ * if retry is true
428417 * @return the retry on failure
429418 */
430419 public Builder setRetry (@ NotNull Boolean retry ) {
@@ -436,7 +425,7 @@ public Builder setRetry(@NotNull Boolean retry) {
436425 * Set host for client instance
437426 *
438427 * @param hostname
439- * host for the Contentstack Client
428+ * host for the Contentstack Client
440429 * @return Client host
441430 */
442431 public Builder setHost (@ NotNull String hostname ) {
@@ -448,7 +437,7 @@ public Builder setHost(@NotNull String hostname) {
448437 * Set port for client instance
449438 *
450439 * @param port
451- * - port for the Contentstack Client
440+ * - port for the Contentstack Client
452441 * @return Client port
453442 */
454443 public Builder setPort (@ NotNull String port ) {
@@ -460,7 +449,7 @@ public Builder setPort(@NotNull String port) {
460449 * Set version for client instance
461450 *
462451 * @param version
463- * for the Contentstack Client
452+ * for the Contentstack Client
464453 * @return Client version
465454 */
466455 public Builder setVersion (@ NotNull String version ) {
@@ -472,7 +461,7 @@ public Builder setVersion(@NotNull String version) {
472461 * Set timeout for client instance
473462 *
474463 * @param timeout
475- * for the Contentstack Client
464+ * for the Contentstack Client
476465 * @return Client timeout
477466 */
478467 public Builder setTimeout (int timeout ) {
@@ -484,7 +473,7 @@ public Builder setTimeout(int timeout) {
484473 * Sets authtoken for the client
485474 *
486475 * @param authtoken
487- * for the client
476+ * for the client
488477 * @return Contentstack authtoken
489478 */
490479 public Builder setAuthtoken (String authtoken ) {
@@ -514,17 +503,18 @@ private void validateClient(Contentstack contentstack) {
514503
515504 private OkHttpClient httpClient (Contentstack contentstack , Boolean retryOnFailure ) {
516505 this .authInterceptor = contentstack .interceptor = new AuthInterceptor ();
506+ HttpLoggingInterceptor level = new HttpLoggingInterceptor ().setLevel (HttpLoggingInterceptor .Level .BODY );
517507 return new OkHttpClient .Builder ()
518508 .addInterceptor (this .authInterceptor )
519- .addInterceptor (logger () )
509+ .addInterceptor (level )
520510 .proxy (this .proxy )
521511 .retryOnConnectionFailure (retryOnFailure )
522512 .build ();
523513 }
524514
525- private HttpLoggingInterceptor logger ( ) {
526- return new HttpLoggingInterceptor ().setLevel (HttpLoggingInterceptor . Level . NONE );
527- }
515+ // private HttpLoggingInterceptor setLoggerLevel(HttpLoggingInterceptor.Level level ) {
516+ // return new HttpLoggingInterceptor().setLevel(level );
517+ // }
528518
529519 }
530520}
0 commit comments