Skip to content

Commit 8e2e2e7

Browse files
🪴 Label class added
1 parent 5154bba commit 8e2e2e7

File tree

11 files changed

+623
-145
lines changed

11 files changed

+623
-145
lines changed

cms.iml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,12 @@
1818
<orderEntry type="library" name="Maven: com.squareup.okhttp3:okhttp:3.14.9" level="project" />
1919
<orderEntry type="library" name="Maven: com.squareup.okio:okio:1.17.2" level="project" />
2020
<orderEntry type="library" name="Maven: com.squareup.retrofit2:converter-gson:2.9.0" level="project" />
21-
<orderEntry type="library" name="Maven: com.squareup.okhttp3:logging-interceptor:4.9.3" level="project" />
22-
<orderEntry type="library" name="Maven: org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.10" level="project" />
23-
<orderEntry type="library" name="Maven: org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.10" level="project" />
24-
<orderEntry type="library" name="Maven: org.projectlombok:lombok:1.18.22" level="project" />
21+
<orderEntry type="library" name="Maven: com.squareup.okhttp3:logging-interceptor:4.7.2" level="project" />
22+
<orderEntry type="library" scope="PROVIDED" name="Maven: org.jetbrains:annotations:23.0.0" level="project" />
23+
<orderEntry type="library" name="Maven: org.projectlombok:lombok:1.18.24" level="project" />
2524
<orderEntry type="library" scope="TEST" name="Maven: io.github.cdimascio:java-dotenv:5.2.2" level="project" />
26-
<orderEntry type="library" name="Maven: org.jetbrains.kotlin:kotlin-stdlib:1.4.0" level="project" />
27-
<orderEntry type="library" name="Maven: org.jetbrains.kotlin:kotlin-stdlib-common:1.4.0" level="project" />
28-
<orderEntry type="library" name="Maven: org.jetbrains:annotations:13.0" level="project" />
25+
<orderEntry type="library" scope="TEST" name="Maven: org.jetbrains.kotlin:kotlin-stdlib:1.4.0" level="project" />
26+
<orderEntry type="library" scope="TEST" name="Maven: org.jetbrains.kotlin:kotlin-stdlib-common:1.4.0" level="project" />
2927
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter:5.8.2" level="project" />
3028
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-api:5.8.2" level="project" />
3129
<orderEntry type="library" scope="TEST" name="Maven: org.opentest4j:opentest4j:1.2.0" level="project" />

pom.xml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
<converter-gson-version>2.9.0</converter-gson-version>
8686
<loggin.version>4.9.3</loggin.version>
8787
<jococo-plugin.version>0.8.5</jococo-plugin.version>
88-
<lombok-source.version>1.18.22</lombok-source.version>
88+
<lombok-source.version>1.18.24</lombok-source.version>
8989
<junit-jupiter.version>5.8.2</junit-jupiter.version>
9090
<junit-jupiter-engine.version>5.8.0-M1</junit-jupiter-engine.version>
9191
<junit-vintage-engine.version>5.8.2</junit-vintage-engine.version>
@@ -97,7 +97,9 @@
9797
<maven-release-plugin.version>2.5.3</maven-release-plugin.version>
9898
</properties>
9999

100+
100101
<dependencies>
102+
101103
<dependency>
102104
<groupId>com.google.code.gson</groupId>
103105
<artifactId>gson</artifactId>
@@ -126,7 +128,19 @@
126128
<groupId>com.squareup.okhttp3</groupId>
127129
<artifactId>logging-interceptor</artifactId>
128130
<version>${loggin.version}</version>
129-
<scope>compile</scope>
131+
<scope>runtime</scope>
132+
</dependency>
133+
<dependency>
134+
<groupId>org.jetbrains</groupId>
135+
<artifactId>annotations</artifactId>
136+
<version>23.0.0</version>
137+
<scope>provided</scope>
138+
</dependency>
139+
<!--com.squareup.okhttp3:logging-interceptor:4.7.2-->
140+
<dependency>
141+
<groupId>com.squareup.okhttp3</groupId>
142+
<artifactId>logging-interceptor</artifactId>
143+
<version>4.7.2</version>
130144
</dependency>
131145
<dependency>
132146
<groupId>org.projectlombok</groupId>
@@ -152,13 +166,13 @@
152166
<version>${junit-vintage-engine.version}</version>
153167
<scope>test</scope>
154168
</dependency>
155-
156169
<dependency>
157170
<groupId>com.googlecode.json-simple</groupId>
158171
<artifactId>json-simple</artifactId>
159172
<version>1.1.1</version>
160173
<scope>compile</scope>
161174
</dependency>
175+
162176
</dependencies>
163177

164178
<build>

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -503,18 +503,15 @@ private void validateClient(Contentstack contentstack) {
503503

504504
private OkHttpClient httpClient(Contentstack contentstack, Boolean retryOnFailure) {
505505
this.authInterceptor = contentstack.interceptor = new AuthInterceptor();
506-
HttpLoggingInterceptor level = new HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY);
506+
HttpLoggingInterceptor logging = new HttpLoggingInterceptor();
507+
logging.setLevel(HttpLoggingInterceptor.Level.BASIC);
507508
return new OkHttpClient.Builder()
508509
.addInterceptor(this.authInterceptor)
509-
.addInterceptor(level)
510+
.addInterceptor(logging)
510511
.proxy(this.proxy)
511512
.retryOnConnectionFailure(retryOnFailure)
512513
.build();
513514
}
514515

515-
// private HttpLoggingInterceptor setLoggerLevel(HttpLoggingInterceptor.Level level) {
516-
// return new HttpLoggingInterceptor().setLevel(level);
517-
// }
518-
519516
}
520517
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package com.contentstack.cms.core;
22

33
public class CMSRuntimeException extends Exception {
4-
54
public CMSRuntimeException(String message) {
65
super(message);
76
}

src/main/java/com/contentstack/cms/organization/Organization.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class Organization {
2727
* @param client
2828
* the client
2929
*/
30-
public Organization(@NotNull Retrofit client) {
30+
public Organization(Retrofit client) {
3131
this.orgService = client.create(OrganizationService.class);
3232
}
3333

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

Lines changed: 22 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,11 @@ protected GlobalField(Retrofit retrofit, HashMap<String, Object> stackHeaders) {
3838
/**
3939
* <b>Get All Global Fields</b>
4040
* <p>
41-
* The Get <b>All global fields</b> call returns comprehensive information of
42-
* all the global fields available in a
41+
* The Get <b>All global fields</b> call returns comprehensive information of all the global fields available in a
4342
* particular stack in your account
4443
* <p>
4544
* <b>Note:</b> You need to use either the stack's Management Token or the user
46-
* Authtoken (any one is mandatory),
47-
* along with the stack API key, to make a valid Content Management API request.
45+
* Authtoken (any one is mandatory), along with the stack API key, to make a valid Content Management API request.
4846
* Read more about authentication.
4947
*
5048
* @return retrofit2.Call
@@ -56,20 +54,17 @@ public Call<ResponseBody> fetch() {
5654
/**
5755
* <b>Get Single Global Field:</b>
5856
* <p>
59-
* The Get a <b>Single global field</b> request allows you to fetch
60-
* comprehensive details of a specific global
57+
* The Get a <b>Single global field</b> request allows you to fetch comprehensive details of a specific global
6158
* field.
6259
* <p>
63-
* When executing the API call, in the <b>URI Parameters</b> section, provide
64-
* the unique ID of your global field.
60+
* When executing the API call, in the <b>URI Parameters</b> section, provide the unique ID of your global field.
6561
* <p>
6662
* <b>Note:</b> You need to use either the stack's Management Token or the user
67-
* Authtoken (any one is mandatory),
68-
* along with the stack API key, to make a valid Content Management API request.
63+
* Authtoken (any one is mandatory), along with the stack API key, to make a valid Content Management API request.
6964
* Read more about authentication.
7065
*
7166
* @param globalFiledUid
72-
* the global filed uid
67+
* the global filed uid
7368
* @return retrofit2.Call
7469
*/
7570
public Call<ResponseBody> single(@NotNull String globalFiledUid) {
@@ -79,21 +74,18 @@ public Call<ResponseBody> single(@NotNull String globalFiledUid) {
7974
/**
8075
* <b>Create Global Field</b>
8176
* <p>
82-
* The <b>Create a global field</b> request allows you to create a new global
83-
* field in a particular stack of your
84-
* Contentstack account. You can use this global field in any content type
85-
* within your stack.
77+
* The <b>Create a global field</b> request allows you to create a new global field in a particular stack of your
78+
* Contentstack account. You can use this global field in any content type within your stack.
8679
* <p>
8780
* <b>Note:</b> Only the stack owner, administrator and developer can create
8881
* global fields
8982
* <p>
9083
* <b>Note:</b> You need to use either the stack's Management Token or the user
91-
* Authtoken (any one is mandatory),
92-
* along with the stack API key, to make a valid Content Management API request.
84+
* Authtoken (any one is mandatory), along with the stack API key, to make a valid Content Management API request.
9385
* Read more about authentication.
9486
*
9587
* @param requestBody
96-
* the request body
88+
* the request body
9789
* @return retrofit2.Call
9890
*/
9991
public Call<ResponseBody> create(@NotNull JSONObject requestBody) {
@@ -103,21 +95,18 @@ public Call<ResponseBody> create(@NotNull JSONObject requestBody) {
10395
/**
10496
* <b>Update a global field </b>
10597
* <p>
106-
* The <b>Update a global field</b> request allows you to update the schema of
107-
* an existing global field.
98+
* The <b>Update a global field</b> request allows you to update the schema of an existing global field.
10899
* <p>
109-
* When executing the API call, in the <b>URI Parameters</b> section, provide
110-
* the unique ID of your global field.
100+
* When executing the API call, in the <b>URI Parameters</b> section, provide the unique ID of your global field.
111101
*
112102
* <b>Note:</b> You need to use either the stack's Management Token or the user
113-
* Authtoken (any one is mandatory),
114-
* along with the stack API key, to make a valid Content Management API request.
103+
* Authtoken (any one is mandatory), along with the stack API key, to make a valid Content Management API request.
115104
* Read more about authentication.
116105
*
117106
* @param globalFiledUid
118-
* the global filed uid
107+
* the global filed uid
119108
* @param requestBody
120-
* the request body
109+
* the request body
121110
* @return retrofit2.Call
122111
*/
123112
public Call<ResponseBody> update(@NotNull String globalFiledUid, @NotNull JSONObject requestBody) {
@@ -130,13 +119,12 @@ public Call<ResponseBody> update(@NotNull String globalFiledUid, @NotNull JSONOb
130119
* The Delete global field request allows you to delete a specific global field.
131120
* <p>
132121
* <b>Warning:</b> If your Global field has been referred within a particular
133-
* content type, then you will need to
134-
* pass an additional query parameter force:true to delete the Global field.
122+
* content type, then you will need to pass an additional query parameter force:true to delete the Global field.
135123
* <p>
136124
* <b>here</b>: force:true is already applied in this request call
137125
*
138126
* @param globalFiledUid
139-
* the global filed uid
127+
* the global filed uid
140128
* @return retrofit2.Call
141129
*/
142130
public Call<ResponseBody> delete(@NotNull String globalFiledUid) {
@@ -145,18 +133,15 @@ public Call<ResponseBody> delete(@NotNull String globalFiledUid) {
145133

146134
/**
147135
* <b>Import a global field</b>
148-
* The <br>
149-
* Import global field <br>
150-
* call imports global fields into <b>Stack</b>
136+
* The <br> Import global field <br> call imports global fields into <b>Stack</b>
151137
* <br>
152138
* <b>[Note]</b>
153139
* <p>
154-
* You need to use either the stack's Management Token or the user Authtoken
155-
* (any one is mandatory), along with the
140+
* You need to use either the stack's Management Token or the user Authtoken (any one is mandatory), along with the
156141
* stack API key, to make a valid Content Management API request.
157142
*
158143
* @param jsonGlobalField
159-
* The Json object to pass as body
144+
* The Json object to pass as body
160145
* @return retrofit2.Call
161146
*/
162147
public Call<ResponseBody> imports(@NotNull Map<String, Object> jsonGlobalField) {
@@ -170,11 +155,10 @@ public Call<ResponseBody> imports(@NotNull Map<String, Object> jsonGlobalField)
170155
/**
171156
* <b>Export global field</b>
172157
* <p>
173-
* This request is used to export a specific global field and it's schema, The
174-
* data is exported in JSON format
158+
* This request is used to export a specific global field and it's schema, The data is exported in JSON format
175159
*
176160
* @param globalFiledUid
177-
* the global filed uid
161+
* the global filed uid
178162
* @return the retrofit2.Call
179163
*/
180164
public Call<ResponseBody> export(@NotNull String globalFiledUid) {

0 commit comments

Comments
 (0)