Skip to content

Commit

Permalink
Merge pull request #52 from kintone/feat-add-app-create-permission-pa…
Browse files Browse the repository at this point in the history
…rameter

feat: support permissions response parameter of Get Space API
  • Loading branch information
0gr authored Apr 4, 2024
2 parents 2b1335d + e9af917 commit 0425f42
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ API client library for Kintone REST APIs on Java.
Add dependency declaration in `build.gradle` of your project.
```
dependencies {
implementation 'com.kintone:kintone-java-client:2.0.0'
implementation 'com.kintone:kintone-java-client:2.1.0'
}
```
- For projects using Maven
Expand All @@ -17,7 +17,7 @@ API client library for Kintone REST APIs on Java.
<dependency>
<groupId>com.kintone</groupId>
<artifactId>kintone-java-client</artifactId>
<version>2.0.0</version>
<version>2.1.0</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
id 'com.github.hierynomus.license' version '0.16.1'
}

version = '2.0.0'
version = '2.1.0'
sourceCompatibility = 1.8
targetCompatibility = 1.8

Expand Down
4 changes: 2 additions & 2 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ client.close();
Add dependency declaration in `build.gradle` of your project.
```groovy
dependencies {
implementation 'com.kintone:kintone-java-client:2.0.0'
implementation 'com.kintone:kintone-java-client:2.1.0'
}
```

Expand All @@ -39,7 +39,7 @@ Add dependency declaration in `pom.xml` of your project.
<dependency>
<groupId>com.kintone</groupId>
<artifactId>kintone-java-client</artifactId>
<version>2.0.0</version>
<version>2.1.0</version>
</dependency>
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.kintone.client.model.User;
import com.kintone.client.model.space.AttachedApp;
import com.kintone.client.model.space.CoverType;
import com.kintone.client.model.space.SpacePermissions;
import java.util.List;
import lombok.Value;

Expand Down Expand Up @@ -107,4 +108,7 @@ public class GetSpaceResponseBody implements KintoneResponseBody {
* @return true if the "Related Apps &amp; Spaces" widget is shown.
*/
private final boolean showRelatedLinkList;

/** An object contains information of permissions of the Space. */
private final SpacePermissions permissions;
}
11 changes: 11 additions & 0 deletions src/main/java/com/kintone/client/model/space/CreateAppSubject.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.kintone.client.model.space;

/** An enum for representing the permission setting to create apps in the space. */
public enum CreateAppSubject {

/** Allow everyone to create apps in the space. */
EVERYONE,

/** Only allow space administrators to create apps in the space. */
ADMIN
}
14 changes: 14 additions & 0 deletions src/main/java/com/kintone/client/model/space/SpacePermissions.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.kintone.client.model.space;

import lombok.Value;

/** An object contains permission settings of the Space. */
@Value
public class SpacePermissions {

/**
* The permission setting whether to allow only space administrators or users to create apps in
* the space.
*/
CreateAppSubject createApp;
}
28 changes: 25 additions & 3 deletions src/test/java/com/kintone/client/SpaceClientTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@
import com.kintone.client.model.EntityType;
import com.kintone.client.model.space.AddedSpaceMember;
import com.kintone.client.model.space.CoverType;
import com.kintone.client.model.space.CreateAppSubject;
import com.kintone.client.model.space.GuestUser;
import com.kintone.client.model.space.SpaceMember;
import com.kintone.client.model.space.SpacePermissions;
import com.kintone.client.model.space.ThreadComment;
import java.util.Collections;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -167,7 +169,8 @@ public void getSpace_long() {
true,
true,
true,
true);
true,
new SpacePermissions(CreateAppSubject.EVERYONE));
mockClient.setResponseBody(resp);

assertThat(sut.getSpace(10L)).isEqualTo(resp);
Expand All @@ -180,8 +183,27 @@ public void getSpace_GetSpaceRequest() {
GetSpaceRequest req = new GetSpaceRequest();
GetSpaceResponseBody resp =
new GetSpaceResponseBody(
1, "", 1, false, null, null, null, "", "", "", null, 1, false, false, false, true, true,
true, true, true);
1,
"",
1,
false,
null,
null,
null,
"",
"",
"",
null,
1,
false,
false,
false,
true,
true,
true,
true,
true,
new SpacePermissions(CreateAppSubject.EVERYONE));
mockClient.setResponseBody(resp);

assertThat(sut.getSpace(req)).isEqualTo(resp);
Expand Down

0 comments on commit 0425f42

Please sign in to comment.