Skip to content

Commit ec9c83a

Browse files
❇️ api documentation
1 parent b0e8812 commit ec9c83a

File tree

8 files changed

+49
-51
lines changed

8 files changed

+49
-51
lines changed

src/main/java/com/contentstack/cms/stack/Asset.java

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,37 +46,36 @@ protected Asset(Retrofit instance, @NotNull Map<String, Object> stackHeaders) {
4646
* @param query
4747
* query params for the assets older(optional) Enter either the UID of a specific folder to get the assets
4848
* of that folder, or enter ‘cs_root’ to get all assets and their folder details from the root folder.
49-
* <p>
49+
*
5050
* <p>
5151
* include_folders(optional) Set this parameter to ‘true’ to include the details of the created folders
5252
* along with the details of the assets.
53-
* <p>
53+
*
5454
* <p>
5555
* environment(optional) Enter the name of the environment to retrieve the assets published on them. You can
5656
* enter multiple environments.
57-
* <p>
57+
*
5858
* <p>
5959
* version(optional) Specify the version number of the asset that you want to retrieve. If the version is
6060
* not specified, the details of the latest version will be retrieved.
6161
* <p>
62-
* <p>
6362
* include_publish_details(optional) Enter 'true' to include the publishing details of the entry.
64-
* <p>
63+
*
6564
* <p>
6665
* include_count(optional) Set this parameter to 'true' to include the total number of assets available in
6766
* your stack in the response body.
68-
* <p>
67+
*
6968
* <p>
7069
* relative_urls(optional) Set this to 'true' to display the relative URL of the asset.
71-
* <p>
70+
*
7271
* <p>
7372
* asc_field_uid(optional) Enter the unique ID of the field for sorting the assets in ascending order by
7473
* that field. Example:created_at
75-
* <p>
74+
*
7675
* <p>
7776
* desc_field_uid(optional) Enter the unique ID of the field for sorting the assets in descending order by
7877
* that field.
79-
* <p>
78+
*
8079
* <p>
8180
* Example:file_size
8281
* @return the retrofit2.Call
@@ -142,6 +141,8 @@ public Call<ResponseBody> subfolder(
142141
* To upload assets from your local system to Contentstack and manage their details, you need to use the following
143142
* "form-data" parameters:
144143
*
144+
* @param filePath
145+
* the file path
145146
* @param requestBody
146147
* Request body for the asset file
147148
* <p>
@@ -284,6 +285,8 @@ public Call<ResponseBody> rteInformation() {
284285
* asset uid
285286
* @param versionNumber
286287
* asset version number
288+
* @param requestBody
289+
* the request body of {@link JSONObject}
287290
* @return the retrofit2.Call
288291
*/
289292
public Call<ResponseBody> setVersionName(@NotNull String assetUid, int versionNumber,

src/main/java/com/contentstack/cms/stack/ContentType.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,12 @@ public Call<ResponseBody> delete(@NotNull String contentTypeUid,
267267
*
268268
* @param contentTypeUid
269269
* the content type uid
270+
* @param isIncludeGlobalField
271+
* Include Global Field true/false
270272
* @return the call
271273
*/
272-
public Call<ResponseBody> reference(@NotNull String contentTypeUid, Boolean includeGlobalField) {
273-
return service.reference(contentTypeUid, this.headers, includeGlobalField);
274+
public Call<ResponseBody> reference(@NotNull String contentTypeUid, Boolean isIncludeGlobalField) {
275+
return service.reference(contentTypeUid, this.headers, isIncludeGlobalField);
274276
}
275277

276278
/**

src/main/java/com/contentstack/cms/stack/Environment.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ protected Environment(Retrofit instance, @NotNull Map<String, Object> stackHeade
3737
*
3838
* @param query
3939
* query parameter
40-
* @return Call<ResponseBody>
40+
* @return Call
4141
*/
4242
public Call<ResponseBody> fetch(Map<String, Object> query) {
4343
if (query == null) {
@@ -55,7 +55,7 @@ public Call<ResponseBody> fetch(Map<String, Object> query) {
5555
*
5656
* @param environment
5757
* name of the environment
58-
* @return Call<ResponseBody>
58+
* @return Call
5959
*/
6060
public Call<ResponseBody> get(@NotNull String environment) {
6161
return this.service.getEnv(this.headers, environment);
@@ -73,7 +73,7 @@ public Call<ResponseBody> get(@NotNull String environment) {
7373
*
7474
* @param requestBody
7575
* request body of type @{@link JSONObject}
76-
* @return Call<ResponseBody>
76+
* @return Call
7777
*/
7878
public Call<ResponseBody> add(@NotNull JSONObject requestBody) {
7979
return this.service.add(this.headers, requestBody);
@@ -94,7 +94,7 @@ public Call<ResponseBody> add(@NotNull JSONObject requestBody) {
9494
* name of the environment
9595
* @param requestBody
9696
* request body of type @{@link JSONObject}
97-
* @return Call<ResponseBody>
97+
* @return Call
9898
*/
9999
public Call<ResponseBody> update(@NotNull String environmentName, @NotNull JSONObject requestBody) {
100100
return this.service.update(this.headers, environmentName, requestBody);
@@ -109,7 +109,7 @@ public Call<ResponseBody> update(@NotNull String environmentName, @NotNull JSONO
109109
*
110110
* @param environmentName
111111
* name of the environment
112-
* @return Call<ResponseBody>
112+
* @return Call
113113
*/
114114
public Call<ResponseBody> delete(@NotNull String environmentName) {
115115
return this.service.delete(this.headers, environmentName);

src/main/java/com/contentstack/cms/stack/Extensions.java

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919
* <p>
2020
* You can now pass the branch header in the API request to fetch or manage modules located within specific branches of
2121
* the stack. Additionally, you can also set the include_branch query parameter to true to include the _branch top-level
22-
* key in the response.
23-
* This key specifies the unique ID of the branch where the concerned Contentstack module resides.
22+
* key in the response. This key specifies the unique ID of the branch where the concerned Contentstack module resides.
2423
*
2524
* @author ***REMOVED***
2625
* @version 1.0.0
@@ -58,7 +57,7 @@ public Extensions addParam(@NotNull String key, @NotNull String value) {
5857
* Set this to 'true' to include the '_branch' top-level key in the response. This key states the unique ID
5958
* of the branch where the concerned Contentstack module resides.
6059
* <b>Example:false</b>
61-
* @return @{@link Call}
60+
* @return Call
6261
*/
6362
public Call<ResponseBody> getAll(@NotNull String query, boolean isIncludeBranch) {
6463
return this.service.getAll(this.headers, query, isIncludeBranch);
@@ -97,16 +96,12 @@ public Call<ResponseBody> get(@NotNull String customFieldUid, Map<String, Object
9796
* of the branch where the concerned Contentstack module resides.
9897
* <p>
9998
* <b>Example:false</b>
100-
* @param body
101-
* In the ‘Body’ section, you need to provide the following ‘Body’ parameters under ‘form-data’
102-
* <pre>
103-
* Use like: Map<String, RequestBody> params = new HashMap<>();
104-
* prepare RequestBody RequestBody someDataBody = ....;
105-
* add it Map object params.put("DYNAMIC_PARAM_NAME", someDataBody);
106-
* </pre>
99+
* @param body the request body
100+
*
107101
* @return Call
108102
*/
109103
public Call<ResponseBody> uploadCustomField(Map<String, RequestBody> body, Map<String, Object> queryParam) {
104+
//TODO: Could be improved:
110105
if (queryParam == null) {
111106
queryParam = new HashMap<>();
112107
}
@@ -129,12 +124,7 @@ public Call<ResponseBody> uploadCustomField(Map<String, RequestBody> body, Map<S
129124
* <p>
130125
* <b>Example:false</b>
131126
* @param body
132-
* In the ‘Body’ section, you need to provide the following ‘Body’ parameters under ‘form-data’
133-
* <pre>
134-
* Use like: Map<String, RequestBody> params = new HashMap<>();
135-
* //prepare RequestBody RequestBody someDataBody = ....;
136-
* //add it Map object params.put("DYNAMIC_PARAM_NAME", someDataBody);
137-
* </pre>
127+
* the request body
138128
* @return Call
139129
*/
140130
public Call<ResponseBody> uploadCustomField(Map<String, Object> queryParam, JSONObject body) {

src/main/java/com/contentstack/cms/stack/Label.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ public Call<ResponseBody> get() {
8686
* <p>
8787
* To learn more about the queries, refer to the Query section of the Content Delivery API doc.
8888
*
89+
* @param jsonRequest
90+
* request parameters
8991
* @return Call
9092
*/
9193
public Call<ResponseBody> get(@NotNull Map<String, Object> jsonRequest) {
@@ -143,6 +145,7 @@ public Call<ResponseBody> add(@NotNull JSONObject requestBody) {
143145
*
144146
* @param labelUid
145147
* the label uid
148+
* @param body request body
146149
* @return Call
147150
*/
148151
public Call<ResponseBody> update(@NotNull String labelUid, @NotNull JSONObject body) {

src/main/java/com/contentstack/cms/stack/Locale.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,9 @@ public Call<ResponseBody> updateLocale(@NotNull String code, @NotNull JSONObject
114114
* <p>
115115
* Fallback Languages
116116
*
117-
* @return the retrofit2.Call
117+
* @param localeCode
118+
* locale code you want to delete
119+
* @return Call
118120
*/
119121
public Call<ResponseBody> deleteLocale(String localeCode) {
120122
return localeService.deleteLocale(this.headers, localeCode);

src/main/java/com/contentstack/cms/stack/Stack.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ public Asset asset() {
104104

105105
/**
106106
* An entry is the actual piece of content created using one of the defined
107-
*
108-
* @return {@link Entry} Entry instance
107+
* @param contentTypeUid content type uid for the entry
108+
* @return Entry instance
109109
* @see <a href="https://www.contentstack.com/docs/developers/create-content-types/about-content-types">Content
110110
* Type</a>
111111
*/
@@ -117,6 +117,8 @@ public Entry entry(@NotNull String contentTypeUid) {
117117
* A Global field is a reusable field (or group of fields) that you can define once and reuse in any content type
118118
* within your stack. This eliminates the need (and thereby time and efforts) to create the same set of fields
119119
* repeatedly in multiple content types.
120+
*
121+
* @return GlobalField
120122
*/
121123
public GlobalField globalField() {
122124
return new GlobalField(this.client, this.headers);
@@ -155,16 +157,12 @@ public Environment environment() {
155157
* Labels allow you to group a collection of content within a stack. Using labels you can group content types that
156158
* need to work together. Read more about
157159
*
158-
* @return @{@link Label}
159-
* <p>
160-
* @see <a href="https://www.contentstack.com/docs/developers/create-content-types/manage-labels">Labels</a>
160+
* @return Label
161161
*
162-
* <p>
163162
* You can now pass the branch header in the API request to fetch or manage modules located within specific branches
164163
* of the stack. Additionally, you can also set the include_branch query parameter to true to include the _branch
165164
* top-level key in the response. This key specifies the unique ID of the branch where the concerned Contentstack
166165
* module resides.
167-
* <p>
168166
*/
169167
public Label label() {
170168
return new Label(this.client, this.headers);

src/main/java/com/contentstack/cms/stack/Tokens.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public Tokens addHeader(@NotNull String key, @NotNull String value) {
5252
/**
5353
* The Get all delivery tokens request returns the details of all the delivery tokens created in a stack.
5454
*
55-
* @return Call<ResponseBody>
55+
* @return Call
5656
*/
5757
public Call<ResponseBody> getDeliveryTokens() {
5858
return this.service.getDeliveryToken(this.headers);
@@ -63,7 +63,7 @@ public Call<ResponseBody> getDeliveryTokens() {
6363
*
6464
* @param tokenUid
6565
* the UID of the token that you want to retrieve
66-
* @return Call<ResponseBody>
66+
* @return Call
6767
*/
6868
public Call<ResponseBody> getDeliveryToken(@NotNull String tokenUid) {
6969
return this.service.getDeliveryToken(this.headers, tokenUid);
@@ -77,7 +77,7 @@ public Call<ResponseBody> getDeliveryToken(@NotNull String tokenUid) {
7777
*
7878
* @param requestBody
7979
* details of the delivery token in @{@link JSONObject} format
80-
* @return Call<ResponseBody>
80+
* @return Call
8181
*/
8282
public Call<ResponseBody> createDeliveryToken(@NotNull JSONObject requestBody) {
8383
return this.service.createDeliveryToken(this.headers, requestBody);
@@ -96,7 +96,7 @@ public Call<ResponseBody> createDeliveryToken(@NotNull JSONObject requestBody) {
9696
* the UID of the token that you want to retrieve
9797
* @param requestBody
9898
* the body should be of @{@link JSONObject} type
99-
* @return Call<ResponseBody>
99+
* @return Call
100100
*/
101101
public Call<ResponseBody> updateDeliveryToken(@NotNull String tokenUid, @NotNull JSONObject requestBody) {
102102
return this.service.updateDeliveryToken(this.headers, tokenUid, requestBody);
@@ -107,7 +107,7 @@ public Call<ResponseBody> updateDeliveryToken(@NotNull String tokenUid, @NotNull
107107
*
108108
* @param tokenUid
109109
* the UID of the token that you want to retrieve
110-
* @return Call<ResponseBody>
110+
* @return Call
111111
*/
112112
public Call<ResponseBody> deleteDeliveryToken(@NotNull String tokenUid) {
113113
return this.service.deleteDeliveryToken(this.headers, tokenUid, false);
@@ -120,7 +120,7 @@ public Call<ResponseBody> deleteDeliveryToken(@NotNull String tokenUid) {
120120
* the UID of the token that you want to retrieve
121121
* @param isForce
122122
* provide ‘true’ to force delete a delivery token
123-
* @return Call<ResponseBody>
123+
* @return Call
124124
*/
125125
public Call<ResponseBody> deleteDeliveryToken(@NotNull String tokenUid, @NotNull Boolean isForce) {
126126
return this.service.deleteDeliveryToken(this.headers, tokenUid, isForce);
@@ -130,7 +130,7 @@ public Call<ResponseBody> deleteDeliveryToken(@NotNull String tokenUid, @NotNull
130130
* The Get all management tokens request returns the details of all the management tokens generated in a stack and
131131
* NOT the actual management tokens.
132132
*
133-
* @return Call<ResponseBody>
133+
* @return Call
134134
*/
135135
public Call<ResponseBody> getManagementTokens() {
136136
return this.service.getManagementToken(this.headers);
@@ -142,7 +142,7 @@ public Call<ResponseBody> getManagementTokens() {
142142
*
143143
* @param tokenUid
144144
* the UID of the token that you want to retrieve
145-
* @return Call<ResponseBody>
145+
* @return Call
146146
*/
147147
public Call<ResponseBody> getManagementToken(@NotNull String tokenUid) {
148148
return this.service.getManagementToken(this.headers, tokenUid);
@@ -154,7 +154,7 @@ public Call<ResponseBody> getManagementToken(@NotNull String tokenUid) {
154154
*
155155
* @param requestBody
156156
* details of the management token in @{@link JSONObject} format
157-
* @return Call<ResponseBody>
157+
* @return Call
158158
*/
159159
public Call<ResponseBody> createManagementToken(@NotNull JSONObject requestBody) {
160160
return this.service.createManagementToken(this.headers, requestBody);
@@ -174,7 +174,7 @@ public Call<ResponseBody> createManagementToken(@NotNull JSONObject requestBody)
174174
* the UID of the token that you want to retrieve
175175
* @param requestBody
176176
* details of the management token in @{@link JSONObject} format
177-
* @return Call<ResponseBody>
177+
* @return Call
178178
*/
179179
public Call<ResponseBody> updateManagementToken(@NotNull String tokenUid, @NotNull JSONObject requestBody) {
180180
return this.service.updateManagementToken(this.headers, tokenUid, requestBody);
@@ -185,7 +185,7 @@ public Call<ResponseBody> updateManagementToken(@NotNull String tokenUid, @NotNu
185185
*
186186
* @param tokenUid
187187
* the UID of the token that you want to retrieve
188-
* @return Call<ResponseBody>
188+
* @return Call
189189
*/
190190
public Call<ResponseBody> deleteManagementToken(@NotNull String tokenUid) {
191191
return this.service.deleteManagementToken(this.headers, tokenUid);

0 commit comments

Comments
 (0)