Skip to content

Commit babba38

Browse files
docs cleanup 🎉
1 parent fbcb4c2 commit babba38

File tree

3 files changed

+76
-61
lines changed

3 files changed

+76
-61
lines changed

src/main/java/com/contentstack/cms/Contentstack.java

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
package com.contentstack.cms;
22

33
import com.contentstack.cms.core.AuthInterceptor;
4-
import com.contentstack.cms.models.Error;
54
import com.contentstack.cms.core.Util;
5+
import com.contentstack.cms.models.Error;
66
import com.contentstack.cms.models.LoginDetails;
77
import com.contentstack.cms.organization.Organization;
88
import com.contentstack.cms.stack.Stack;
99
import com.contentstack.cms.user.User;
1010
import com.google.gson.Gson;
1111
import okhttp3.OkHttpClient;
1212
import okhttp3.ResponseBody;
13+
import okhttp3.logging.HttpLoggingInterceptor;
1314
import org.jetbrains.annotations.NotNull;
1415
import retrofit2.Response;
1516
import retrofit2.Retrofit;
1617
import retrofit2.converter.gson.GsonConverterFactory;
17-
import okhttp3.logging.HttpLoggingInterceptor;
1818

1919
import java.io.IOException;
2020
import java.net.Proxy;
@@ -25,7 +25,12 @@
2525
import static com.contentstack.cms.core.Util.*;
2626

2727
/**
28-
* The type Contentstack.
28+
* <b>Contentstack Java Management SDK</b>
29+
* <br>
30+
* <b>Contentstack Java Management SDK</b> interact with the Content Management APIs and allow you to create, update,
31+
* delete, and fetch content from your Contentstack account. They are read-write in nature.
32+
* <b>
33+
* You can use them to build your own apps and manage your content from Contentstack.
2934
*/
3035
public class Contentstack {
3136

@@ -63,7 +68,11 @@ public class Contentstack {
6368
* </pre>
6469
* <br>
6570
*
66-
* @return User user
71+
* @return User
72+
* @author ***REMOVED***
73+
* @see <a href="https://www.contentstack.com/docs/developers/apis/content-management-api/#users">User
74+
* </a>
75+
* @since 2022-05-19
6776
*/
6877
public User user() {
6978
if (this.authtoken == null)
@@ -103,12 +112,15 @@ public User user() {
103112
* <br>
104113
*
105114
* @param emailId
106-
* the email id
115+
* the email id of the user
107116
* @param password
108-
* the password
109-
* @return response the Response type of @{@link LoginDetails}
117+
* the password of the user
118+
* @return LoginDetails
110119
* @throws IOException
111-
* the io exception
120+
* the IOException
121+
* @author ***REMOVED***
122+
* @see <a href="https://www.contentstack.com/docs/developers/apis/content-management-api/#users">User
123+
* </a>
112124
*/
113125
public Response<LoginDetails> login(String emailId, String password) throws IOException {
114126
if (this.authtoken != null)
@@ -155,9 +167,16 @@ public Response<LoginDetails> login(String emailId, String password) throws IOEx
155167
* the password
156168
* @param tfaToken
157169
* the tfa token
158-
* @return response the Response type of @{@link LoginDetails} throws {@link IOException}
170+
* @return LoginDetails
159171
* @throws IOException
160172
* the io exception
173+
* @throws IOException
174+
* the IOException
175+
* @author ***REMOVED***
176+
* @see <a
177+
* href="https://www.contentstack.com/docs/developers/apis/content-management-api/#log-in-to-your-account">Login
178+
* your account
179+
* </a>
161180
*/
162181
public Response<LoginDetails> login(String emailId, String password, String tfaToken) throws IOException {
163182
if (this.authtoken != null)
@@ -400,9 +419,12 @@ public Builder() {
400419
* InetSocketAddress(proxyHost, proxyPort));
401420
* <br>
402421
* <pre>
403-
* Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("hostname", 433));
404-
* Contentstack contentstack = new Contentstack.Builder().setProxy(proxy).build();
405-
* </pre>
422+
* {
423+
* @code
424+
* Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("hostname", 433));
425+
* Contentstack contentstack = new Contentstack.Builder().setProxy(proxy).build();
426+
* }
427+
* </pre>
406428
*
407429
* @param proxy
408430
* the proxy

src/main/java/com/contentstack/cms/core/CSResponse.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@
99
import java.io.IOException;
1010
import java.util.Objects;
1111

12+
/**
13+
* Contentstack Response:
14+
*
15+
* @author ***REMOVED***
16+
* @version 1.0.0
17+
* @since 2022-05-19
18+
*/
19+
1220
public class CSResponse {
1321

1422
private static final String MODEL_NULL_CHECK = "model class == null";

src/main/java/com/contentstack/cms/user/User.java

Lines changed: 34 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@
1313
import java.util.Map;
1414

1515
/**
16-
* The type User.
17-
*/
18-
/*
19-
* All accounts registered with Contentstack are known as Users. A stack can
20-
* have many users with varying permissions and roles.
16+
* All accounts registered with Contentstack are known as Users. A stack can have many users with varying permissions
17+
* and roles.
18+
*
19+
* @author ***REMOVED***
20+
* @version 1.0.0
21+
* @since 2022-05-19
2122
*/
2223
public class User {
2324

@@ -27,20 +28,19 @@ public class User {
2728
* Instantiates a new User.
2829
*
2930
* @param client
30-
* the client
31+
* the client
3132
*/
3233
public User(Retrofit client) {
3334
this.userService = client.create(UserService.class);
3435
}
3536

3637
/**
37-
* The Log in to your account request is used to sign in to your Contentstack
38-
* account and obtain the authtoken.
38+
* The Log in to your account request is used to sign in to your Contentstack account and obtain the authtoken.
3939
*
4040
* @param emailId
41-
* the email id
41+
* the email id
4242
* @param password
43-
* the password
43+
* the password
4444
* @return the call
4545
*/
4646
public Call<LoginDetails> login(@NotNull String emailId, @NotNull String password) {
@@ -55,11 +55,11 @@ public Call<LoginDetails> login(@NotNull String emailId, @NotNull String passwor
5555
* Login call.
5656
*
5757
* @param emailId
58-
* the email id
58+
* the email id
5959
* @param password
60-
* the password
60+
* the password
6161
* @param tfaToken
62-
* the tfa token
62+
* the tfa token
6363
* @return the call
6464
*/
6565
public Call<LoginDetails> login(@NotNull String emailId, @NotNull String password, @NotNull String tfaToken) {
@@ -81,10 +81,8 @@ private HashMap<String, String> setCredentials(@NotNull String... arguments) {
8181
}
8282

8383
/**
84-
* The Get user call returns comprehensive information of an existing user
85-
* account. The information returned
86-
* includes details of the stacks owned by and shared with the specified user
87-
* account. <br>
84+
* The Get user call returns comprehensive information of an existing user account. The information returned
85+
* includes details of the stacks owned by and shared with the specified user account. <br>
8886
*
8987
* @return {@link UserService}
9088
*/
@@ -94,30 +92,25 @@ public Call<ResponseBody> getUser() {
9492

9593

9694
/**
97-
* The Get user call returns comprehensive information of an existing user
98-
* account. The information returned
99-
* includes details of the stacks and organisation owned by and shared with the
100-
* specified user account.
95+
* The Get user call returns comprehensive information of an existing user account. The information returned
96+
* includes details of the stacks and organisation owned by and shared with the specified user account.
10197
*
10298
* @param query
103-
* parameters
99+
* parameters
104100
* @return {@link UserService}
105101
*/
106102
public Call<ResponseBody> getUserOrganizations(@NotNull Map<String, Object> query) {
107103
return this.userService.getUserOrganization(query);
108104
}
109105

110106
/**
111-
* The Update User API Request updates the details of an existing user account.
112-
* Only the information entered here
113-
* will be updated, the existing data will remain unaffected. <br>
114-
* When executing the API call, under the 'Body'
115-
* section, enter the information of the user that you wish to update. This
116-
* information should be in JSON format.
107+
* The Update User API Request updates the details of an existing user account. Only the information entered here
108+
* will be updated, the existing data will remain unaffected. <br> When executing the API call, under the 'Body'
109+
* section, enter the information of the user that you wish to update. This information should be in JSON format.
117110
* <br>
118111
*
119112
* @param strBody
120-
* the str body
113+
* the str body
121114
* @return {@link UserService}
122115
*/
123116
public Call<ResponseBody> updateUser(String strBody) {
@@ -131,69 +124,61 @@ private RequestBody toBody(String bodyString) {
131124
}
132125

133126
/**
134-
* The activate_token a user account call activates the account of a user after
135-
* signing up. For account activation,
127+
* The activate_token a user account call activates the account of a user after signing up. For account activation,
136128
* you will require the token received in the activation email. <br>
137129
*
138130
* @param activationToken
139-
* The activation token
131+
* The activation token
140132
* @param requestBody
141-
* The request body
133+
* The request body
142134
* @return {@link UserService}
143135
*/
144136
public Call<ResponseBody> activateUser(@NotNull String activationToken, String requestBody) {
145137
return userService.activateUser(activationToken, toBody(requestBody));
146138
}
147139

148140
/**
149-
* The Request for a password call sends a request for a temporary password to
150-
* log in to an account in case a user
151-
* has forgotten the login password. <br>
152-
* Using this temporary password, you can log in to your account and set a
141+
* The Request for a password call sends a request for a temporary password to log in to an account in case a user
142+
* has forgotten the login password. <br> Using this temporary password, you can log in to your account and set a
153143
* new password for your Contentstack account. <br>
154144
* <ul>
155145
* <li>Provide the user's email address in JSON format</li>
156146
* </ul>
157147
*
158148
* @param requestBody
159-
* the request body
149+
* the request body
160150
* @return {@link UserService}
161151
*/
162152
public Call<ResponseBody> requestPassword(String requestBody) {
163153
return userService.requestPassword(toBody(requestBody));
164154
}
165155

166156
/**
167-
* The Reset password call sends a request for resetting the password of your
168-
* Contentstack account. <br>
169-
* When
170-
* executing the call, in the 'Body' section, you need to provide the token that
171-
* you receive via email, your new
157+
* The Reset password call sends a request for resetting the password of your Contentstack account. <br> When
158+
* executing the call, in the 'Body' section, you need to provide the token that you receive via email, your new
172159
* password, and password confirmation in JSON format. <br>
173160
*
174161
* @param requestBody
175-
* the request body
162+
* the request body
176163
* @return {@link UserService}
177164
*/
178165
public Call<ResponseBody> resetPassword(@NotNull String requestBody) {
179166
return userService.resetPassword(toBody(requestBody));
180167
}
181168

182169
/**
183-
* The Log out of your account call is used to sign out the user of Contentstack
184-
* account
170+
* The Log out of your account call is used to sign out the user of Contentstack account
185171
*
186172
* @param authtoken
187-
* : authtoken
173+
* : authtoken
188174
* @return {@link UserService}
189175
*/
190176
public Call<ResponseBody> logoutWithAuthtoken(String authtoken) {
191177
return userService.logout(authtoken);
192178
}
193179

194180
/**
195-
* The Log out of your account call is used to sign out the user of Contentstack
196-
* account
181+
* The Log out of your account call is used to sign out the user of Contentstack account
197182
*
198183
* @return {@link UserService}
199184
*/

0 commit comments

Comments
 (0)