@@ -23,6 +23,10 @@ public class App {
2323 protected HashMap <String , Object > params ;
2424 private String appUid ;
2525 private Retrofit client ;
26+ /**
27+ * Error message for internal uses
28+ */
29+ private final String ErrorMessage = "App/Manifest uid is required" ;
2630
2731 /**
2832 * Instantiates a new Organization.
@@ -34,7 +38,7 @@ public App(Retrofit client, @NotNull String organizationUid) {
3438 this .headers = new HashMap <>();
3539 this .params = new HashMap <>();
3640 if (organizationUid .isEmpty ()) {
37- throw new IllegalArgumentException ("Organization UID could not be empty" );
41+ throw new IllegalArgumentException ("Organization uid could not be empty" );
3842 }
3943 this .headers .put ("organization_uid" , organizationUid );
4044 this .client = client ;
@@ -54,7 +58,7 @@ public App(Retrofit client, @NotNull String organizationUid) {
5458 public App (Retrofit client , @ NotNull String organizationUid , @ NotNull String uid ) {
5559 this .headers = new HashMap <>();
5660 if (organizationUid .isEmpty ()) {
57- throw new IllegalArgumentException ("Organization UID could not be empty for app/manifest operations " );
61+ throw new IllegalArgumentException ("Organization uid could not be empty" );
5862 }
5963 this .headers .put ("organization_uid" , organizationUid );
6064 this .appUid = uid ;
@@ -65,7 +69,7 @@ public App(Retrofit client, @NotNull String organizationUid, @NotNull String uid
6569
6670 public Installation installation () {
6771 if (this .appUid == null || this .appUid .isEmpty ()) {
68- throw new BadArgumentException ("app uid/Manifest uid is required" );
72+ throw new BadArgumentException (ErrorMessage );
6973 }
7074 return new Installation (this .client , this .headers .get ("organization_uid" ), this .appUid );
7175 }
@@ -150,7 +154,7 @@ public Call<ResponseBody> fetch(@NotNull String manifestUid) {
150154
151155 private void validate () {
152156 if (!this .headers .containsKey ("organization_uid" ))
153- throw new IllegalStateException ("organization uid can not be null or empty" );
157+ throw new IllegalStateException ("Organization uid can not be null or empty" );
154158 }
155159
156160 /**
@@ -212,7 +216,7 @@ public Call<ResponseBody> update(JSONObject body) {
212216 validate ();
213217 isValidJSON (body );
214218 if (this .appUid == null || this .appUid .isEmpty ()) {
215- throw new BadArgumentException ("appUid/ManifestUid is required" );
219+ throw new BadArgumentException (ErrorMessage );
216220 }
217221 return service .updateById (this .headers , this .appUid , body );
218222 }
@@ -233,7 +237,7 @@ public Call<ResponseBody> update(@NotNull String id, JSONObject body) {
233237 public Call <ResponseBody > delete () {
234238 validate ();
235239 if (this .appUid == null || this .appUid .isEmpty ()) {
236- throw new BadArgumentException ("appUid/ManifestUid is required" );
240+ throw new BadArgumentException (ErrorMessage );
237241 }
238242 return service .delete (this .headers , this .appUid );
239243 }
@@ -306,7 +310,7 @@ public Call<ResponseBody> updateOauth(@NotNull String uid, JSONObject body) {
306310 public Call <ResponseBody > updateOauth (JSONObject body ) {
307311 validate ();
308312 if (this .appUid == null || this .appUid .isEmpty ()) {
309- throw new BadArgumentException ("app uid / manifest uid required" );
313+ throw new BadArgumentException (ErrorMessage );
310314 }
311315 return service .updateAuthConfiguration (this .headers , this .appUid , body );
312316 }
0 commit comments