Skip to content

Commit 0425f42

Browse files
authored
Merge pull request #52 from kintone/feat-add-app-create-permission-parameter
feat: support permissions response parameter of Get Space API
2 parents 2b1335d + e9af917 commit 0425f42

File tree

7 files changed

+59
-8
lines changed

7 files changed

+59
-8
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ API client library for Kintone REST APIs on Java.
88
Add dependency declaration in `build.gradle` of your project.
99
```
1010
dependencies {
11-
implementation 'com.kintone:kintone-java-client:2.0.0'
11+
implementation 'com.kintone:kintone-java-client:2.1.0'
1212
}
1313
```
1414
- For projects using Maven
@@ -17,7 +17,7 @@ API client library for Kintone REST APIs on Java.
1717
<dependency>
1818
<groupId>com.kintone</groupId>
1919
<artifactId>kintone-java-client</artifactId>
20-
<version>2.0.0</version>
20+
<version>2.1.0</version>
2121
</dependency>
2222
```
2323

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ plugins {
66
id 'com.github.hierynomus.license' version '0.16.1'
77
}
88

9-
version = '2.0.0'
9+
version = '2.1.0'
1010
sourceCompatibility = 1.8
1111
targetCompatibility = 1.8
1212

docs/getting-started.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ client.close();
2929
Add dependency declaration in `build.gradle` of your project.
3030
```groovy
3131
dependencies {
32-
implementation 'com.kintone:kintone-java-client:2.0.0'
32+
implementation 'com.kintone:kintone-java-client:2.1.0'
3333
}
3434
```
3535

@@ -39,7 +39,7 @@ Add dependency declaration in `pom.xml` of your project.
3939
<dependency>
4040
<groupId>com.kintone</groupId>
4141
<artifactId>kintone-java-client</artifactId>
42-
<version>2.0.0</version>
42+
<version>2.1.0</version>
4343
</dependency>
4444
```
4545

src/main/java/com/kintone/client/api/space/GetSpaceResponseBody.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.kintone.client.model.User;
55
import com.kintone.client.model.space.AttachedApp;
66
import com.kintone.client.model.space.CoverType;
7+
import com.kintone.client.model.space.SpacePermissions;
78
import java.util.List;
89
import lombok.Value;
910

@@ -107,4 +108,7 @@ public class GetSpaceResponseBody implements KintoneResponseBody {
107108
* @return true if the "Related Apps &amp; Spaces" widget is shown.
108109
*/
109110
private final boolean showRelatedLinkList;
111+
112+
/** An object contains information of permissions of the Space. */
113+
private final SpacePermissions permissions;
110114
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package com.kintone.client.model.space;
2+
3+
/** An enum for representing the permission setting to create apps in the space. */
4+
public enum CreateAppSubject {
5+
6+
/** Allow everyone to create apps in the space. */
7+
EVERYONE,
8+
9+
/** Only allow space administrators to create apps in the space. */
10+
ADMIN
11+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.kintone.client.model.space;
2+
3+
import lombok.Value;
4+
5+
/** An object contains permission settings of the Space. */
6+
@Value
7+
public class SpacePermissions {
8+
9+
/**
10+
* The permission setting whether to allow only space administrators or users to create apps in
11+
* the space.
12+
*/
13+
CreateAppSubject createApp;
14+
}

src/test/java/com/kintone/client/SpaceClientTest.java

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@
2828
import com.kintone.client.model.EntityType;
2929
import com.kintone.client.model.space.AddedSpaceMember;
3030
import com.kintone.client.model.space.CoverType;
31+
import com.kintone.client.model.space.CreateAppSubject;
3132
import com.kintone.client.model.space.GuestUser;
3233
import com.kintone.client.model.space.SpaceMember;
34+
import com.kintone.client.model.space.SpacePermissions;
3335
import com.kintone.client.model.space.ThreadComment;
3436
import java.util.Collections;
3537
import org.junit.jupiter.api.Test;
@@ -167,7 +169,8 @@ public void getSpace_long() {
167169
true,
168170
true,
169171
true,
170-
true);
172+
true,
173+
new SpacePermissions(CreateAppSubject.EVERYONE));
171174
mockClient.setResponseBody(resp);
172175

173176
assertThat(sut.getSpace(10L)).isEqualTo(resp);
@@ -180,8 +183,27 @@ public void getSpace_GetSpaceRequest() {
180183
GetSpaceRequest req = new GetSpaceRequest();
181184
GetSpaceResponseBody resp =
182185
new GetSpaceResponseBody(
183-
1, "", 1, false, null, null, null, "", "", "", null, 1, false, false, false, true, true,
184-
true, true, true);
186+
1,
187+
"",
188+
1,
189+
false,
190+
null,
191+
null,
192+
null,
193+
"",
194+
"",
195+
"",
196+
null,
197+
1,
198+
false,
199+
false,
200+
false,
201+
true,
202+
true,
203+
true,
204+
true,
205+
true,
206+
new SpacePermissions(CreateAppSubject.EVERYONE));
185207
mockClient.setResponseBody(resp);
186208

187209
assertThat(sut.getSpace(req)).isEqualTo(resp);

0 commit comments

Comments
 (0)