@@ -38,11 +38,6 @@ protected Extensions(Retrofit retrofit, HashMap<String, Object> stackHeaders) {
3838 this .service = retrofit .create (ExtensionsService .class );
3939 }
4040
41- public Extensions addHeader (@ NotNull String key , @ NotNull String value ) {
42- this .headers .put (key , value );
43- return this ;
44- }
45-
4641 /**
4742 * Sets header for the request
4843 *
@@ -59,58 +54,75 @@ public void addHeader(@NotNull String key, @NotNull Object value) {
5954 * Sets header for the request
6055 *
6156 * @param key
62- * header key for the request
57+ * query param key for the request
6358 * @param value
64- * header value for the request
59+ * query param value for the request
6560 */
6661 public void addParam (@ NotNull String key , @ NotNull Object value ) {
6762 this .params .put (key , value );
6863 }
6964
7065
7166 /**
72- * Sets header for the request
67+ * Set header for the request
7368 *
7469 * @param key
75- * header key for the request
70+ * Removes query param using key of request
7671 */
7772 public void removeParam (@ NotNull String key ) {
7873 this .params .remove (key );
7974 }
8075
8176
8277 /**
83- * To clear all the params
78+ * To clear all the query params
8479 */
8580 protected void clearParams () {
8681 this .params .clear ();
8782 }
8883
84+
8985 /**
9086 * The Get all custom fields request is used to get the information of all custom fields created in a stack.
9187 *
92- * @param query
93- * For custom fields <b>Example:"type":"field"</b>
94- * @param isIncludeBranch
95- * Set this to 'true' to include the '_branch' top-level key in the response. This key states the unique ID
96- * of the branch where the concerned Contentstack module resides.
97- * <b>Example:false</b>
88+ * <dl>
89+ * <dt>query</dt>
90+ * <dd>For custom fields <b>Example:"type":"field"</b></dd>
91+ * <dt>include_branch</dt>
92+ * <dd>Set this to 'true' to include the '_branch' top-level key in the response. This key states the unique ID
93+ * of the branch where the concerned Contentstack module resides</dd>
94+ * </dl>
95+ *
9896 * @return Call
97+ * @see <a
98+ * href="https://www.contentstack.com/docs/developers/apis/content-management-api/#get-all-custom-fields">Get all
99+ * Custom Field
100+ * </a>
101+ * @see #addHeader(String, Object) to add headers
102+ * @see #addParam(String, Object) to add query parameters
103+ * @since 1.0.0
99104 */
100- public Call <ResponseBody > fetch (@ NotNull String query , boolean isIncludeBranch ) {
101- return this .service .getAll (this .headers , query , isIncludeBranch );
105+ public Call <ResponseBody > fetch () {
106+ return this .service .getAll (this .headers , this . params );
102107 }
103108
104109
105110 /**
106111 * @param customFieldUid
107- * Enter the UID of the custom field of which you want to retrieve the details.
108- * <br><br >
109- * {@link #addParam(String, Object)} Set this to 'true' to include the '_branch' top-level key in the
110- * response. This key states the unique ID of the branch where the concerned Contentstack module resides .
111- * <p >
112- * <b>Example:false</b >
112+ * Enter the UID of the custom field of which you want to retrieve the details.<br>
113+ * <dl >
114+ * <dt>include_branch</dt>
115+ * <dd>Set this to 'true' to include the '_branch' top-level key in the response .
116+ * This key states the unique ID of the branch where the concerned Contentstack module resides.</dd >
117+ * </dl >
113118 * @return Call
119+ * @see <a
120+ * href="https://www.contentstack.com/docs/developers/apis/content-management-api/#get-a-single-custom-field">Get a
121+ * Single Custom Field
122+ * </a>
123+ * @see #addHeader(String, Object) to add headers
124+ * @see #addParam(String, Object) to add query parameters
125+ * @since 1.0.0
114126 */
115127 public Call <ResponseBody > single (@ NotNull String customFieldUid ) {
116128 this .headers .put (Util .CONTENT_TYPE , "multipart/form-data" );
@@ -135,6 +147,13 @@ public Call<ResponseBody> single(@NotNull String customFieldUid) {
135147 * @param body
136148 * the request body
137149 * @return Call
150+ * @see <a
151+ * href="https://www.contentstack.com/docs/developers/apis/content-management-api/#upload-a-custom-field">Upload a
152+ * custom field
153+ * </a>
154+ * @see #addHeader(String, Object) to add headers
155+ * @see #addParam(String, Object) to add query parameters
156+ * @since 1.0.0
138157 */
139158 public Call <ResponseBody > uploadCustomField (Map <String , RequestBody > body ) {
140159 this .headers .put (Util .CONTENT_TYPE , "multipart/form-data" );
@@ -158,6 +177,13 @@ public Call<ResponseBody> uploadCustomField(Map<String, RequestBody> body) {
158177 * @param body
159178 * the request body
160179 * @return Call
180+ * @see <a
181+ * href="https://www.contentstack.com/docs/developers/apis/content-management-api/#upload-a-custom-field">Upload a
182+ * custom field
183+ * </a>
184+ * @see #addHeader(String, Object) to add headers
185+ * @see #addParam(String, Object) to add query parameters
186+ * @since 1.0.0
161187 */
162188 public Call <ResponseBody > uploadCustomField (JSONObject body ) {
163189 this .headers .put (Util .CONTENT_TYPE , "application/json" );
@@ -175,6 +201,12 @@ public Call<ResponseBody> uploadCustomField(JSONObject body) {
175201 * @param body
176202 * JSON requestBody
177203 * @return Call
204+ * @see <a
205+ * href="https://www.contentstack.com/docs/developers/apis/content-management-api/#update-a-custom-field">Update a
206+ * custom field
207+ * </a>
208+ * @see #addHeader(String, Object) to add headers
209+ * @since 1.0.0
178210 */
179211 public Call <ResponseBody > update (@ NotNull String customFieldUid , JSONObject body ) {
180212 if (body == null ) {
@@ -194,6 +226,12 @@ public Call<ResponseBody> update(@NotNull String customFieldUid, JSONObject body
194226 * @param customFieldUid
195227 * UID of the custom field that you want to update
196228 * @return Call
229+ * @see <a
230+ * href="https://www.contentstack.com/docs/developers/apis/content-management-api/#delete-custom-field">Delete a
231+ * custom field
232+ * </a>
233+ * @see #addHeader(String, Object) to add headers
234+ * @since 1.0.0
197235 */
198236 public Call <ResponseBody > delete (@ NotNull String customFieldUid ) {
199237 return this .service .delete (this .headers , customFieldUid );
0 commit comments