Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 52478cc

Browse files
Add admin examples + dependency updates
1 parent c9b5a12 commit 52478cc

File tree

4 files changed

+26
-4
lines changed

4 files changed

+26
-4
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,3 +414,25 @@ runsClient.createRunAndStream(thread.id(), createRunRequest, new AssistantStream
414414
});
415415
// "createThreadAndRunAndStream" and "submitToolOutputsAndStream" methods are also available
416416
```
417+
- List all the users in an organization.
418+
```java
419+
OpenAI openAI = OpenAI.newBuilder()
420+
.adminKey(System.getenv("OPENAI_ADMIN_KEY"))
421+
.build();
422+
423+
UsersClient usersClient = openAI.usersClient();
424+
List<User> users = usersClient.listUsers(Optional.empty(), Optional.empty()).data();
425+
```
426+
- List user actions and configuration changes within an organization
427+
```java
428+
OpenAI openAI = OpenAI.newBuilder()
429+
.adminKey(System.getenv("OPENAI_ADMIN_KEY"))
430+
.build();
431+
432+
AuditLogsClient auditLogsClient = openAI.auditLogsClient();
433+
ListAuditLogsQueryParameters queryParameters = ListAuditLogsQueryParameters.newBuilder()
434+
.eventTypes(List.of("invite.sent", "invite.deleted"))
435+
.build();
436+
List<AuditLog> auditLogs = auditLogsClient.listAuditLogs(queryParameters).data();
437+
```
438+

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ plugins {
66
id "signing"
77
id "io.github.gradle-nexus.publish-plugin" version "2.0.0"
88
id "com.diffplug.spotless" version "6.25.0"
9-
id "me.qoomon.git-versioning" version "6.4.3"
9+
id "me.qoomon.git-versioning" version "6.4.4"
1010
id "com.github.ben-manes.versions" version "0.51.0"
1111
}
1212

@@ -34,7 +34,7 @@ java {
3434
}
3535

3636
def jacksonVersion = "2.17.2"
37-
def junitVersion = "5.10.3"
37+
def junitVersion = "5.11.0"
3838

3939
dependencies {
4040
implementation("com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}")
@@ -45,7 +45,7 @@ dependencies {
4545
testImplementation("org.junit.jupiter:junit-jupiter-params:${junitVersion}")
4646
testImplementation("org.assertj:assertj-core:3.26.3")
4747
testImplementation("org.mock-server:mockserver-netty-no-dependencies:5.15.0")
48-
testImplementation("com.atlassian.oai:swagger-request-validator-core:2.41.0")
48+
testImplementation("com.atlassian.oai:swagger-request-validator-core:2.42.0")
4949
testImplementation("org.skyscreamer:jsonassert:1.5.3")
5050
}
5151

gradle/wrapper/gradle-wrapper.jar

79 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

0 commit comments

Comments
 (0)